diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-30 21:08:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-30 21:08:07 +0300 |
commit | 2c72daf2f1744f2b8c8c6674c266907e9ef55558 (patch) | |
tree | e489b6e87557d3f6d8a94f2e7d4d47e633d646b5 /app/assets/javascripts | |
parent | 4e9acbfba3682c552b3de707c535e6257ef41054 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts')
4 files changed, 68 insertions, 1 deletions
diff --git a/app/assets/javascripts/maintenance_mode_settings/components/app.vue b/app/assets/javascripts/maintenance_mode_settings/components/app.vue new file mode 100644 index 00000000000..47150c9dc95 --- /dev/null +++ b/app/assets/javascripts/maintenance_mode_settings/components/app.vue @@ -0,0 +1,44 @@ +<script> +import { GlToggle, GlFormGroup, GlFormTextarea, GlButton } from '@gitlab/ui'; + +export default { + name: 'MaintenanceModeSettingsApp', + components: { + GlToggle, + GlFormGroup, + GlFormTextarea, + GlButton, + }, + data() { + return { + inMaintenanceMode: false, + bannerMessage: '', + }; + }, +}; +</script> +<template> + <article> + <div class="d-flex align-items-center mb-3"> + <gl-toggle v-model="inMaintenanceMode" class="mb-0" /> + <div class="ml-2"> + <p class="mb-0">{{ __('Enable maintenance mode') }}</p> + <p class="mb-0 text-secondary-500"> + {{ + __('Non-admin users can sign in with read-only access and make read-only API requests.') + }} + </p> + </div> + </div> + <gl-form-group label="Banner Message" label-for="maintenanceBannerMessage"> + <gl-form-textarea + id="maintenanceBannerMessage" + v-model="bannerMessage" + :placeholder="__(`GitLab is undergoing maintenance and is operating in a read-only mode.`)" + /> + </gl-form-group> + <div class="mt-4"> + <gl-button variant="success">{{ __('Save changes') }}</gl-button> + </div> + </article> +</template> diff --git a/app/assets/javascripts/maintenance_mode_settings/index.js b/app/assets/javascripts/maintenance_mode_settings/index.js new file mode 100644 index 00000000000..7a80233faf0 --- /dev/null +++ b/app/assets/javascripts/maintenance_mode_settings/index.js @@ -0,0 +1,20 @@ +import Vue from 'vue'; +import Translate from '~/vue_shared/translate'; +import MaintenanceModeSettingsApp from './components/app.vue'; + +Vue.use(Translate); + +export default () => { + const el = document.getElementById('js-maintenance-mode-settings'); + + return new Vue({ + el, + components: { + MaintenanceModeSettingsApp, + }, + + render(createElement) { + return createElement('maintenance-mode-settings-app'); + }, + }); +}; diff --git a/app/assets/javascripts/pages/admin/application_settings/index.js b/app/assets/javascripts/pages/admin/application_settings/index.js index 78b7e29ae53..493c216cc6e 100644 --- a/app/assets/javascripts/pages/admin/application_settings/index.js +++ b/app/assets/javascripts/pages/admin/application_settings/index.js @@ -1,9 +1,11 @@ import initSettingsPanels from '~/settings_panels'; import projectSelect from '~/project_select'; import selfMonitor from '~/self_monitor'; +import maintenanceModeSettings from '~/maintenance_mode_settings'; document.addEventListener('DOMContentLoaded', () => { selfMonitor(); + maintenanceModeSettings(); // Initialize expandable settings panels initSettingsPanels(); projectSelect(); diff --git a/app/assets/javascripts/pages/projects/labels/components/promote_label_modal.vue b/app/assets/javascripts/pages/projects/labels/components/promote_label_modal.vue index dadb20e511b..12e16b79d37 100644 --- a/app/assets/javascripts/pages/projects/labels/components/promote_label_modal.vue +++ b/app/assets/javascripts/pages/projects/labels/components/promote_label_modal.vue @@ -37,7 +37,8 @@ export default { text() { return sprintf( s__(`Labels|Promoting %{labelTitle} will make it available for all projects inside %{groupName}. - Existing project labels with the same title will be merged. This action cannot be reversed.`), + Existing project labels with the same title will be merged. If a group label with the same title exists, + it will also be merged. This action cannot be reversed.`), { labelTitle: this.labelTitle, groupName: this.groupName, |