Commit 7d542903 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Merge branch 'msj-subepics-to-child-epics' into 'master'

Change sub-epics to child epics in errors and GraphQL schema

Closes #235773

See merge request gitlab-org/gitlab!39351
parents abebbc00 faa719b5
...@@ -4971,7 +4971,7 @@ Counts of descendent epics. ...@@ -4971,7 +4971,7 @@ Counts of descendent epics.
""" """
type EpicDescendantCount { type EpicDescendantCount {
""" """
Number of closed sub-epics Number of closed child epics
""" """
closedEpics: Int closedEpics: Int
...@@ -4981,7 +4981,7 @@ type EpicDescendantCount { ...@@ -4981,7 +4981,7 @@ type EpicDescendantCount {
closedIssues: Int closedIssues: Int
""" """
Number of opened sub-epics Number of opened child epics
""" """
openedEpics: Int openedEpics: Int
......
...@@ -13855,7 +13855,7 @@ ...@@ -13855,7 +13855,7 @@
"fields": [ "fields": [
{ {
"name": "closedEpics", "name": "closedEpics",
"description": "Number of closed sub-epics", "description": "Number of closed child epics",
"args": [ "args": [
], ],
...@@ -13883,7 +13883,7 @@ ...@@ -13883,7 +13883,7 @@
}, },
{ {
"name": "openedEpics", "name": "openedEpics",
"description": "Number of opened sub-epics", "description": "Number of opened child epics",
"args": [ "args": [
], ],
...@@ -807,9 +807,9 @@ Counts of descendent epics. ...@@ -807,9 +807,9 @@ Counts of descendent epics.
| Name | Type | Description | | Name | Type | Description |
| --- | ---- | ---------- | | --- | ---- | ---------- |
| `closedEpics` | Int | Number of closed sub-epics | | `closedEpics` | Int | Number of closed child epics |
| `closedIssues` | Int | Number of closed epic issues | | `closedIssues` | Int | Number of closed epic issues |
| `openedEpics` | Int | Number of opened sub-epics | | `openedEpics` | Int | Number of opened child epics |
| `openedIssues` | Int | Number of opened epic issues | | `openedIssues` | Int | Number of opened epic issues |
## EpicDescendantWeights ## EpicDescendantWeights
......
...@@ -6,8 +6,8 @@ module Types ...@@ -6,8 +6,8 @@ module Types
graphql_name 'EpicDescendantCount' graphql_name 'EpicDescendantCount'
description 'Counts of descendent epics.' description 'Counts of descendent epics.'
field :opened_epics, GraphQL::INT_TYPE, null: true, description: 'Number of opened sub-epics' field :opened_epics, GraphQL::INT_TYPE, null: true, description: 'Number of opened child epics'
field :closed_epics, GraphQL::INT_TYPE, null: true, description: 'Number of closed sub-epics' field :closed_epics, GraphQL::INT_TYPE, null: true, description: 'Number of closed child epics'
field :opened_issues, GraphQL::INT_TYPE, null: true, description: 'Number of opened epic issues' field :opened_issues, GraphQL::INT_TYPE, null: true, description: 'Number of opened epic issues'
field :closed_issues, GraphQL::INT_TYPE, null: true, description: 'Number of closed epic issues' field :closed_issues, GraphQL::INT_TYPE, null: true, description: 'Number of closed epic issues'
end end
......
...@@ -398,11 +398,11 @@ module EE ...@@ -398,11 +398,11 @@ module EE
return unless confidential? return unless confidential?
if issues.public_only.any? if issues.public_only.any?
errors.add :confidential, _('Cannot make epic confidential if it contains not-confidential issues') errors.add :confidential, _('Cannot make the epic confidential if it contains non-confidential issues')
end end
if children.public_only.any? if children.public_only.any?
errors.add :confidential, _('Cannot make epic confidential if it contains not-confidential sub-epics') errors.add :confidential, _('Cannot make the epic confidential if it contains non-confidential child epics')
end end
end end
...@@ -410,7 +410,7 @@ module EE ...@@ -410,7 +410,7 @@ module EE
return unless parent return unless parent
if !confidential? && parent.confidential? if !confidential? && parent.confidential?
errors.add :confidential, _('Not-confidential epic cannot be assigned to a confidential parent epic') errors.add :confidential, _('A non-confidential epic cannot be assigned to a confidential parent epic')
end end
end end
end end
......
...@@ -242,7 +242,7 @@ module EE ...@@ -242,7 +242,7 @@ module EE
return unless epic return unless epic
if !confidential? && epic.confidential? if !confidential? && epic.confidential?
errors.add :issue, _('Cannot set confidential epic for not-confidential issue') errors.add :issue, _('Cannot set confidential epic for a non-confidential issue')
end end
end end
end end
......
...@@ -24,7 +24,7 @@ class EpicIssue < ApplicationRecord ...@@ -24,7 +24,7 @@ class EpicIssue < ApplicationRecord
return unless epic && issue return unless epic && issue
if epic.confidential? && !issue.confidential? if epic.confidential? && !issue.confidential?
errors.add :issue, _('Cannot set confidential epic for not-confidential issue') errors.add :issue, _('Cannot set confidential epic for a non-confidential issue')
end end
end end
end end
...@@ -9,7 +9,7 @@ RSpec.describe EpicIssue do ...@@ -9,7 +9,7 @@ RSpec.describe EpicIssue do
let(:issue) { build(:issue) } let(:issue) { build(:issue) }
let(:confidential_issue) { build(:issue, :confidential) } let(:confidential_issue) { build(:issue, :confidential) }
it 'is valid to add not-confidential issue to not-confidential epic' do it 'is valid to add non-confidential issue to non-confidential epic' do
expect(build(:epic_issue, epic: epic, issue: issue)).to be_valid expect(build(:epic_issue, epic: epic, issue: issue)).to be_valid
end end
...@@ -17,11 +17,11 @@ RSpec.describe EpicIssue do ...@@ -17,11 +17,11 @@ RSpec.describe EpicIssue do
expect(build(:epic_issue, epic: confidential_epic, issue: confidential_issue)).to be_valid expect(build(:epic_issue, epic: confidential_epic, issue: confidential_issue)).to be_valid
end end
it 'is valid to add confidential issue to not-confidential epic' do it 'is valid to add confidential issue to non-confidential epic' do
expect(build(:epic_issue, epic: epic, issue: confidential_issue)).to be_valid expect(build(:epic_issue, epic: epic, issue: confidential_issue)).to be_valid
end end
it 'is not valid to add not-confidential issue to confidential epic' do it 'is not valid to add non-confidential issue to confidential epic' do
expect(build(:epic_issue, epic: confidential_epic, issue: issue)).not_to be_valid expect(build(:epic_issue, epic: confidential_epic, issue: issue)).not_to be_valid
end end
end end
......
...@@ -72,7 +72,7 @@ RSpec.describe Epic do ...@@ -72,7 +72,7 @@ RSpec.describe Epic do
expect(epic).to be_valid expect(epic).to be_valid
end end
it 'is not valid if epic is confidential and has not-confidential issues' do it 'is not valid if epic is confidential and has non-confidential issues' do
epic = create(:epic_issue).epic epic = create(:epic_issue).epic
epic.confidential = true epic.confidential = true
...@@ -89,7 +89,7 @@ RSpec.describe Epic do ...@@ -89,7 +89,7 @@ RSpec.describe Epic do
expect(epic).to be_valid expect(epic).to be_valid
end end
it 'is not valid if epic is confidential and has not-confidential subepics' do it 'is not valid if epic is confidential and has non-confidential subepics' do
epic = create(:epic, group: group) epic = create(:epic, group: group)
create(:epic, parent: epic, group: group) create(:epic, parent: epic, group: group)
......
...@@ -208,7 +208,7 @@ RSpec.describe Issue do ...@@ -208,7 +208,7 @@ RSpec.describe Issue do
describe 'confidential' do describe 'confidential' do
subject { build(:issue, :confidential) } subject { build(:issue, :confidential) }
it 'is valid when changing to not-confidential and is associated with not-confidential epic' do it 'is valid when changing to non-confidential and is associated with non-confidential epic' do
subject.epic = build(:epic) subject.epic = build(:epic)
subject.confidential = false subject.confidential = false
...@@ -216,7 +216,7 @@ RSpec.describe Issue do ...@@ -216,7 +216,7 @@ RSpec.describe Issue do
expect(subject).to be_valid expect(subject).to be_valid
end end
it 'is not valid when changing to not-confidential and is associated with confidential epic' do it 'is not valid when changing to non-confidential and is associated with confidential epic' do
subject.epic = build(:epic, :confidential) subject.epic = build(:epic, :confidential)
subject.confidential = false subject.confidential = false
......
...@@ -220,8 +220,8 @@ RSpec.describe EpicIssues::CreateService do ...@@ -220,8 +220,8 @@ RSpec.describe EpicIssues::CreateService do
expect(subject).to eq( expect(subject).to eq(
status: :error, status: :error,
http_status: 422, http_status: 422,
message: "#{invalid_issue1.to_reference} cannot be added: Cannot set confidential epic for not-confidential issue. "\ message: "#{invalid_issue1.to_reference} cannot be added: Cannot set confidential epic for a non-confidential issue. "\
"#{invalid_issue2.to_reference} cannot be added: Cannot set confidential epic for not-confidential issue" "#{invalid_issue2.to_reference} cannot be added: Cannot set confidential epic for a non-confidential issue"
) )
end end
end end
......
...@@ -285,8 +285,8 @@ RSpec.describe EpicLinks::CreateService do ...@@ -285,8 +285,8 @@ RSpec.describe EpicLinks::CreateService do
expect(subject).to eq( expect(subject).to eq(
status: :error, status: :error,
http_status: 422, http_status: 422,
message: "#{invalid_epic1.to_reference} cannot be added: Not-confidential epic cannot be assigned to a confidential parent epic. "\ message: "#{invalid_epic1.to_reference} cannot be added: A non-confidential epic cannot be assigned to a confidential parent epic. "\
"#{invalid_epic2.to_reference} cannot be added: Not-confidential epic cannot be assigned to a confidential parent epic" "#{invalid_epic2.to_reference} cannot be added: A non-confidential epic cannot be assigned to a confidential parent epic"
) )
end end
end end
......
...@@ -1159,6 +1159,9 @@ msgstr "" ...@@ -1159,6 +1159,9 @@ msgstr ""
msgid "A new impersonation token has been created." msgid "A new impersonation token has been created."
msgstr "" msgstr ""
msgid "A non-confidential epic cannot be assigned to a confidential parent epic"
msgstr ""
msgid "A plain HTML site that uses Netlify for CI/CD instead of GitLab, but still with all the other great GitLab features." msgid "A plain HTML site that uses Netlify for CI/CD instead of GitLab, but still with all the other great GitLab features."
msgstr "" msgstr ""
...@@ -4346,10 +4349,10 @@ msgstr "" ...@@ -4346,10 +4349,10 @@ msgstr ""
msgid "Cannot import because issues are not available in this project." msgid "Cannot import because issues are not available in this project."
msgstr "" msgstr ""
msgid "Cannot make epic confidential if it contains not-confidential issues" msgid "Cannot make the epic confidential if it contains non-confidential child epics"
msgstr "" msgstr ""
msgid "Cannot make epic confidential if it contains not-confidential sub-epics" msgid "Cannot make the epic confidential if it contains non-confidential issues"
msgstr "" msgstr ""
msgid "Cannot merge" msgid "Cannot merge"
...@@ -4370,7 +4373,7 @@ msgstr "" ...@@ -4370,7 +4373,7 @@ msgstr ""
msgid "Cannot refer to a group %{timebox_type} by an internal id!" msgid "Cannot refer to a group %{timebox_type} by an internal id!"
msgstr "" msgstr ""
msgid "Cannot set confidential epic for not-confidential issue" msgid "Cannot set confidential epic for a non-confidential issue"
msgstr "" msgstr ""
msgid "Cannot show preview. For previews on sketch files, they must have the file format introduced by Sketch version 43 and above." msgid "Cannot show preview. For previews on sketch files, they must have the file format introduced by Sketch version 43 and above."
...@@ -16505,9 +16508,6 @@ msgstr "" ...@@ -16505,9 +16508,6 @@ msgstr ""
msgid "Not started" msgid "Not started"
msgstr "" msgstr ""
msgid "Not-confidential epic cannot be assigned to a confidential parent epic"
msgstr ""
msgid "Note" msgid "Note"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment