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>2020-06-26 18:08:45 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-26 18:08:45 +0300
commit2a53c24c512db8613255884b1db42402a31d831b (patch)
tree37831911612043071365082fb0838c671ec7bbb7 /app/assets/javascripts/alerts_service_settings
parent8e812185ddf4c77ae3b1512b2d04725190e64209 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/alerts_service_settings')
-rw-r--r--app/assets/javascripts/alerts_service_settings/components/alerts_service_form.vue26
-rw-r--r--app/assets/javascripts/alerts_service_settings/index.js4
2 files changed, 26 insertions, 4 deletions
diff --git a/app/assets/javascripts/alerts_service_settings/components/alerts_service_form.vue b/app/assets/javascripts/alerts_service_settings/components/alerts_service_form.vue
index ac30b086875..46fed973d6d 100644
--- a/app/assets/javascripts/alerts_service_settings/components/alerts_service_form.vue
+++ b/app/assets/javascripts/alerts_service_settings/components/alerts_service_form.vue
@@ -64,6 +64,11 @@ export default {
type: Boolean,
required: true,
},
+ isDisabled: {
+ type: Boolean,
+ required: false,
+ default: false,
+ },
},
data() {
return {
@@ -118,6 +123,9 @@ export default {
.then(() => {
this.activated = value;
this.loadingActivated = false;
+ if (value) {
+ window.location.reload();
+ }
})
.catch(() => {
createFlash(__('Update failed. Please try again.'));
@@ -142,7 +150,7 @@ export default {
<gl-form-group :label="__('Active')" label-for="activated" label-class="label-bold">
<toggle-button
id="activated"
- :disabled-input="loadingActivated"
+ :disabled-input="loadingActivated || isDisabled"
:is-loading="loadingActivated"
:value="activated"
@change="toggleActivated"
@@ -152,7 +160,11 @@ export default {
<div class="input-group">
<gl-form-input id="url" :readonly="true" :value="url" />
<span class="input-group-append">
- <clipboard-button :text="url" :title="$options.COPY_TO_CLIPBOARD" />
+ <clipboard-button
+ :text="url"
+ :title="$options.COPY_TO_CLIPBOARD"
+ :disabled="isDisabled"
+ />
</span>
</div>
</gl-form-group>
@@ -164,10 +176,16 @@ export default {
<div class="input-group">
<gl-form-input id="authorization-key" :readonly="true" :value="authorizationKey" />
<span class="input-group-append">
- <clipboard-button :text="authorizationKey" :title="$options.COPY_TO_CLIPBOARD" />
+ <clipboard-button
+ :text="authorizationKey"
+ :title="$options.COPY_TO_CLIPBOARD"
+ :disabled="isDisabled"
+ />
</span>
</div>
- <gl-button v-gl-modal.authKeyModal class="mt-2">{{ $options.RESET_KEY }}</gl-button>
+ <gl-button v-gl-modal.authKeyModal class="mt-2" :disabled="isDisabled">{{
+ $options.RESET_KEY
+ }}</gl-button>
<gl-modal
modal-id="authKeyModal"
:title="$options.RESET_KEY"
diff --git a/app/assets/javascripts/alerts_service_settings/index.js b/app/assets/javascripts/alerts_service_settings/index.js
index c26adf24a7f..fe83ced2ee7 100644
--- a/app/assets/javascripts/alerts_service_settings/index.js
+++ b/app/assets/javascripts/alerts_service_settings/index.js
@@ -14,8 +14,11 @@ export default el => {
formPath,
authorizationKey,
url,
+ disabled,
} = el.dataset;
+
const activated = parseBoolean(activatedStr);
+ const isDisabled = parseBoolean(disabled);
return new Vue({
el,
@@ -28,6 +31,7 @@ export default el => {
formPath,
initialAuthorizationKey: authorizationKey,
url,
+ isDisabled,
},
});
},