diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-14 03:13:26 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-14 03:13:26 +0000 |
commit | 6be10e8588cd18091d8302fd52e166a71900f7bc (patch) | |
tree | 5e0e785ca56df17982142a9ddde4a471d1a4013c /app | |
parent | 8aea332821a78e83ce93f5b3bac7de5f95a3c7b8 (diff) | |
download | gitlab-ce-6be10e8588cd18091d8302fd52e166a71900f7bc.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
5 files changed, 38 insertions, 3 deletions
diff --git a/app/assets/javascripts/issues/constants.js b/app/assets/javascripts/issues/constants.js index f8d7b0adf3b..c359420a680 100644 --- a/app/assets/javascripts/issues/constants.js +++ b/app/assets/javascripts/issues/constants.js @@ -17,6 +17,7 @@ export const IssuableType = { Epic: 'epic', MergeRequest: 'merge_request', Alert: 'alert', + TestCase: 'test_case', }; export const IssueType = { diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/graphql/issue_labels.query.graphql b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/graphql/issue_labels.query.graphql index 2904857270e..d7456a71aff 100644 --- a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/graphql/issue_labels.query.graphql +++ b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/graphql/issue_labels.query.graphql @@ -1,9 +1,9 @@ #import "~/graphql_shared/fragments/label.fragment.graphql" -query issueLabels($fullPath: ID!, $iid: String) { +query issueLabels($fullPath: ID!, $iid: String, $types: [IssueType!]) { workspace: project(fullPath: $fullPath) { id - issuable: issue(iid: $iid) { + issuable: issue(iid: $iid, types: $types) { id labels { nodes { diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/graphql/update_test_case_labels.mutation.graphql b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/graphql/update_test_case_labels.mutation.graphql new file mode 100644 index 00000000000..9ff7ce64d3b --- /dev/null +++ b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/graphql/update_test_case_labels.mutation.graphql @@ -0,0 +1,20 @@ +#import "~/graphql_shared/fragments/author.fragment.graphql" +#import "~/graphql_shared/fragments/label.fragment.graphql" + +mutation updateTestCaseLabels($input: UpdateIssueInput!) { + updateIssuableLabels: updateIssue(input: $input) { + issuable: issue { + id + updatedAt + updatedBy { + ...Author + } + labels { + nodes { + ...Label + } + } + } + errors + } +} diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue index b7b4bbac661..f23648c91a9 100644 --- a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue +++ b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue @@ -161,10 +161,16 @@ export default { return !isDropdownVariantSidebar(this.variant); }, variables() { - return { + const queryVariables = { iid: this.iid, fullPath: this.fullPath, }; + + if (this.issuableType === IssuableType.TestCase) { + queryVariables.types = ['TEST_CASE']; + } + + return queryVariables; }, update(data) { return data.workspace?.issuable; @@ -256,6 +262,7 @@ export default { switch (this.issuableType) { case IssuableType.Issue: + case IssuableType.TestCase: return updateVariables; case IssuableType.MergeRequest: return { @@ -312,6 +319,7 @@ export default { switch (this.issuableType) { case IssuableType.Issue: + case IssuableType.TestCase: return { ...removeVariables, removeLabelIds: [labelId], diff --git a/app/assets/javascripts/sidebar/constants.js b/app/assets/javascripts/sidebar/constants.js index 825a89daf58..976fe524209 100644 --- a/app/assets/javascripts/sidebar/constants.js +++ b/app/assets/javascripts/sidebar/constants.js @@ -5,6 +5,7 @@ import userSearchQuery from '~/graphql_shared/queries/users_search.query.graphql import userSearchWithMRPermissionsQuery from '~/graphql_shared/queries/users_search_with_mr_permissions.graphql'; import { IssuableType, WorkspaceType } from '~/issues/constants'; import updateAlertAssigneesMutation from '~/vue_shared/alert_details/graphql/mutations/alert_set_assignees.mutation.graphql'; +import updateTestCaseLabelsMutation from './components/labels/labels_select_widget/graphql/update_test_case_labels.mutation.graphql'; import epicLabelsQuery from './components/labels/labels_select_widget/graphql/epic_labels.query.graphql'; import updateEpicLabelsMutation from './components/labels/labels_select_widget/graphql/epic_update_labels.mutation.graphql'; import groupLabelsQuery from './components/labels/labels_select_widget/graphql/group_labels.query.graphql'; @@ -151,6 +152,11 @@ export const issuableLabelsQueries = { mutation: updateEpicLabelsMutation, mutationName: 'updateEpic', }, + [IssuableType.TestCase]: { + issuableQuery: issueLabelsQuery, + mutation: updateTestCaseLabelsMutation, + mutationName: 'updateTestCaseLabels', + }, }; export const dateTypes = { |