Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-09-19 12:10:17 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-09-19 12:10:17 +0300
commit236caf4b92c8cc8b00dcacf81bb9e1ec1f798370 (patch)
treebcb67ec12f45e98081f593f9a6266ee33993bf02 /app/assets/javascripts/sidebar
parent8b13b280f53bc4895c2e92b7dae7b23a95480104 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/sidebar')
-rw-r--r--app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_form.vue25
-rw-r--r--app/assets/javascripts/sidebar/queries/constants.js6
-rw-r--r--app/assets/javascripts/sidebar/queries/test_case_confidential.query.graphql9
-rw-r--r--app/assets/javascripts/sidebar/queries/update_test_case_confidential.mutation.graphql9
4 files changed, 43 insertions, 6 deletions
diff --git a/app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_form.vue b/app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_form.vue
index 96d72e9545e..7a1853b1b46 100644
--- a/app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_form.vue
+++ b/app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_form.vue
@@ -1,7 +1,7 @@
<script>
import { GlSprintf, GlButton } from '@gitlab/ui';
import { createAlert } from '~/alert';
-import { TYPE_ISSUE } from '~/issues/constants';
+import { TYPE_ISSUE, TYPE_TEST_CASE, IssuableTypeText } from '~/issues/constants';
import { __, sprintf } from '~/locale';
import { confidentialityQueries } from '../../queries/constants';
@@ -11,7 +11,7 @@ export default {
'You are going to turn on confidentiality. Only %{context} members with %{strongStart}%{permissions}%{strongEnd} can view or be notified about this %{issuableType}.',
),
confidentialityOffWarning: __(
- 'You are going to turn off the confidentiality. This means %{strongStart}everyone%{strongEnd} will be able to see and leave a comment on this %{issuableType}.',
+ 'You are going to turn off the confidentiality. This means %{strongStart}everyone%{strongEnd} will be able to see%{commentText} this %{issuableType}.',
),
},
components: {
@@ -56,11 +56,17 @@ export default {
isIssue() {
return this.issuableType === TYPE_ISSUE;
},
+ isTestCase() {
+ return this.issuableType === TYPE_TEST_CASE;
+ },
+ isIssueOrTestCase() {
+ return this.isIssue || this.isTestCase;
+ },
context() {
- return this.isIssue ? __('project') : __('group');
+ return this.isIssueOrTestCase ? __('project') : __('group');
},
workspacePath() {
- return this.isIssue
+ return this.isIssueOrTestCase
? {
projectPath: this.fullPath,
}
@@ -73,6 +79,12 @@ export default {
? __('at least the Reporter role, the author, and assignees')
: __('at least the Reporter role');
},
+ issuableTypeText() {
+ return IssuableTypeText[this.issuableType];
+ },
+ commentText() {
+ return this.isTestCase ? '' : __(' and leave a comment on');
+ },
},
methods: {
submitForm() {
@@ -108,7 +120,7 @@ export default {
message: sprintf(
__('Something went wrong while setting %{issuableType} confidentiality.'),
{
- issuableType: this.issuableType,
+ issuableType: this.issuableTypeText,
},
),
});
@@ -135,7 +147,8 @@ export default {
</strong>
</template>
<template #context>{{ context }}</template>
- <template #issuableType>{{ issuableType }}</template>
+ <template #commentText>{{ commentText }}</template>
+ <template #issuableType>{{ issuableTypeText }}</template>
</gl-sprintf>
</p>
<div class="sidebar-item-warning-message-actions">
diff --git a/app/assets/javascripts/sidebar/queries/constants.js b/app/assets/javascripts/sidebar/queries/constants.js
index 05297795613..0844abc4599 100644
--- a/app/assets/javascripts/sidebar/queries/constants.js
+++ b/app/assets/javascripts/sidebar/queries/constants.js
@@ -69,6 +69,8 @@ import groupMilestonesQuery from './group_milestones.query.graphql';
import projectIssueMilestoneMutation from './project_issue_milestone.mutation.graphql';
import projectIssueMilestoneQuery from './project_issue_milestone.query.graphql';
import projectMilestonesQuery from './project_milestones.query.graphql';
+import testCaseConfidentialQuery from './test_case_confidential.query.graphql';
+import updateTestCaseConfidentialMutation from './update_test_case_confidential.mutation.graphql';
export const assigneesQueries = {
[TYPE_ISSUE]: {
@@ -120,6 +122,10 @@ export const confidentialityQueries = {
query: epicConfidentialQuery,
mutation: updateEpicConfidentialMutation,
},
+ [TYPE_TEST_CASE]: {
+ query: testCaseConfidentialQuery,
+ mutation: updateTestCaseConfidentialMutation,
+ },
};
export const referenceQueries = {
diff --git a/app/assets/javascripts/sidebar/queries/test_case_confidential.query.graphql b/app/assets/javascripts/sidebar/queries/test_case_confidential.query.graphql
new file mode 100644
index 00000000000..d8959b5ce3f
--- /dev/null
+++ b/app/assets/javascripts/sidebar/queries/test_case_confidential.query.graphql
@@ -0,0 +1,9 @@
+query testCaseConfidential($fullPath: ID!, $iid: String) {
+ workspace: project(fullPath: $fullPath) {
+ id
+ issuable: issue(iid: $iid) {
+ id
+ confidential
+ }
+ }
+}
diff --git a/app/assets/javascripts/sidebar/queries/update_test_case_confidential.mutation.graphql b/app/assets/javascripts/sidebar/queries/update_test_case_confidential.mutation.graphql
new file mode 100644
index 00000000000..4094907cb95
--- /dev/null
+++ b/app/assets/javascripts/sidebar/queries/update_test_case_confidential.mutation.graphql
@@ -0,0 +1,9 @@
+mutation updateTestCaseConfidential($input: IssueSetConfidentialInput!) {
+ issuableSetConfidential: issueSetConfidential(input: $input) {
+ issuable: issue {
+ id
+ confidential
+ }
+ errors
+ }
+}