diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-16 09:09:29 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-16 09:09:29 +0000 |
commit | 3fd97b4bba24ca412112aad025a38a32c7a6cf8c (patch) | |
tree | 4aacc8a184522bcbc3db68df47620bc3d2cfcfd9 /app/assets/javascripts/registry | |
parent | c52239391bf29f640e1e0af98edbd337c0293940 (diff) | |
download | gitlab-ce-3fd97b4bba24ca412112aad025a38a32c7a6cf8c.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/registry')
-rw-r--r-- | app/assets/javascripts/registry/settings/components/registry_settings_app.vue | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/app/assets/javascripts/registry/settings/components/registry_settings_app.vue b/app/assets/javascripts/registry/settings/components/registry_settings_app.vue index 87e65d354bb..4d767f1a578 100644 --- a/app/assets/javascripts/registry/settings/components/registry_settings_app.vue +++ b/app/assets/javascripts/registry/settings/components/registry_settings_app.vue @@ -18,14 +18,23 @@ export default { unavailableFeatureText: s__( 'ContainerRegistry|Currently, the Container Registry tag expiration feature is not available for projects created before GitLab version 12.8. For updates and more information, visit Issue %{linkStart}#196124%{linkEnd}', ), + fetchSettingsErrorText: FETCH_SETTINGS_ERROR_MESSAGE, + }, + data() { + return { + fetchSettingsError: false, + }; }, computed: { ...mapState(['isDisabled']), + showSettingForm() { + return !this.isDisabled && !this.fetchSettingsError; + }, }, mounted() { - this.fetchSettings().catch(() => - this.$toast.show(FETCH_SETTINGS_ERROR_MESSAGE, { type: 'error' }), - ); + this.fetchSettings().catch(() => { + this.fetchSettingsError = true; + }); }, methods: { ...mapActions(['fetchSettings']), @@ -48,17 +57,22 @@ export default { }} </li> </ul> - <settings-form v-if="!isDisabled" /> - <gl-alert v-else :dismissible="false"> - <p> - <gl-sprintf :message="$options.i18n.unavailableFeatureText"> - <template #link="{content}"> - <gl-link href="https://gitlab.com/gitlab-org/gitlab/issues/196124" target="_blank"> - {{ content }} - </gl-link> - </template> - </gl-sprintf> - </p> - </gl-alert> + <settings-form v-if="showSettingForm" /> + <template v-else> + <gl-alert v-if="isDisabled" :dismissible="false"> + <p> + <gl-sprintf :message="$options.i18n.unavailableFeatureText"> + <template #link="{content}"> + <gl-link href="https://gitlab.com/gitlab-org/gitlab/issues/196124" target="_blank"> + {{ content }} + </gl-link> + </template> + </gl-sprintf> + </p> + </gl-alert> + <gl-alert v-else-if="fetchSettingsError" variant="warning" :dismissible="false"> + <gl-sprintf :message="$options.i18n.fetchSettingsErrorText" /> + </gl-alert> + </template> </div> </template> |