diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /app/assets/javascripts/sidebar/components/confidential/confidential_issue_sidebar.vue | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) | |
download | gitlab-ce-a09983ae35713f5a2bbb100981116d31ce99826e.tar.gz |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'app/assets/javascripts/sidebar/components/confidential/confidential_issue_sidebar.vue')
-rw-r--r-- | app/assets/javascripts/sidebar/components/confidential/confidential_issue_sidebar.vue | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/app/assets/javascripts/sidebar/components/confidential/confidential_issue_sidebar.vue b/app/assets/javascripts/sidebar/components/confidential/confidential_issue_sidebar.vue index 550a1be1e64..0987603cafd 100644 --- a/app/assets/javascripts/sidebar/components/confidential/confidential_issue_sidebar.vue +++ b/app/assets/javascripts/sidebar/components/confidential/confidential_issue_sidebar.vue @@ -1,5 +1,5 @@ <script> -import { mapState } from 'vuex'; +import { mapState, mapActions } from 'vuex'; import { __ } from '~/locale'; import Flash from '~/flash'; import tooltip from '~/vue_shared/directives/tooltip'; @@ -18,6 +18,10 @@ export default { }, mixins: [recaptchaModalImplementor], props: { + fullPath: { + required: true, + type: String, + }, isEditable: { required: true, type: Boolean, @@ -42,16 +46,24 @@ export default { }, }, created() { + eventHub.$on('updateConfidentialAttribute', this.updateConfidentialAttribute); eventHub.$on('closeConfidentialityForm', this.toggleForm); }, beforeDestroy() { + eventHub.$off('updateConfidentialAttribute', this.updateConfidentialAttribute); eventHub.$off('closeConfidentialityForm', this.toggleForm); }, methods: { + ...mapActions(['setConfidentiality']), toggleForm() { this.edit = !this.edit; }, - updateConfidentialAttribute(confidential) { + closeForm() { + this.edit = false; + }, + updateConfidentialAttribute() { + // TODO: rm when FF is defaulted to on. + const confidential = !this.confidential; this.service .update('issue', { confidential }) .then(({ data }) => this.checkForSpam(data)) @@ -97,12 +109,8 @@ export default { > </div> <div class="value sidebar-item-value hide-collapsed"> - <edit-form - v-if="edit" - :is-confidential="confidential" - :update-confidential-attribute="updateConfidentialAttribute" - /> - <div v-if="!confidential" class="no-value sidebar-item-value"> + <edit-form v-if="edit" :is-confidential="confidential" :full-path="fullPath" /> + <div v-if="!confidential" class="no-value sidebar-item-value" data-testid="not-confidential"> <icon :size="16" name="eye" aria-hidden="true" class="sidebar-item-icon inline" /> {{ __('Not confidential') }} </div> |