summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/sidebar
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-01 15:06:05 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-01 15:06:05 +0000
commit05f4b2fb34dbb051b2ce5ddbc801ec42998c019c (patch)
tree0fd7a153f3ed7d00d40e428c08ab81ae3d863afe /app/assets/javascripts/sidebar
parent9e27f0d920cc3891fa7644c5cc0bc280c519fb20 (diff)
downloadgitlab-ce-05f4b2fb34dbb051b2ce5ddbc801ec42998c019c.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/sidebar')
-rw-r--r--app/assets/javascripts/sidebar/components/confidential/confidential_issue_sidebar.vue13
1 files changed, 11 insertions, 2 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 407e5a29aa5..5b3c3642290 100644
--- a/app/assets/javascripts/sidebar/components/confidential/confidential_issue_sidebar.vue
+++ b/app/assets/javascripts/sidebar/components/confidential/confidential_issue_sidebar.vue
@@ -5,6 +5,7 @@ import tooltip from '~/vue_shared/directives/tooltip';
import Icon from '~/vue_shared/components/icon.vue';
import eventHub from '~/sidebar/event_hub';
import editForm from './edit_form.vue';
+import recaptchaModalImplementor from '~/vue_shared/mixins/recaptcha_modal_implementor';
export default {
components: {
@@ -14,6 +15,7 @@ export default {
directives: {
tooltip,
},
+ mixins: [recaptchaModalImplementor],
props: {
isConfidential: {
required: true,
@@ -54,9 +56,14 @@ export default {
updateConfidentialAttribute(confidential) {
this.service
.update('issue', { confidential })
+ .then(({ data }) => this.checkForSpam(data))
.then(() => window.location.reload())
- .catch(() => {
- Flash(__('Something went wrong trying to change the confidentiality of this issue'));
+ .catch(error => {
+ if (error.name === 'SpamError') {
+ this.openRecaptcha();
+ } else {
+ Flash(__('Something went wrong trying to change the confidentiality of this issue'));
+ }
});
},
},
@@ -112,5 +119,7 @@ export default {
{{ __('This issue is confidential') }}
</div>
</div>
+
+ <recaptcha-modal v-if="showRecaptcha" :html="recaptchaHTML" @close="closeRecaptcha" />
</div>
</template>