diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-03 00:10:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-03 00:10:20 +0300 |
commit | df52f8c8af971b336f520e291da02e1ba6a1a9dd (patch) | |
tree | 41bb94e2d74f8c43e83abaf04f7e4e35cfd56251 /app/assets/javascripts/admin | |
parent | f3c61892ecbcad3bfe57f06f197ae9e8996970db (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/admin')
3 files changed, 22 insertions, 1 deletions
diff --git a/app/assets/javascripts/admin/broadcast_messages/components/message_form.vue b/app/assets/javascripts/admin/broadcast_messages/components/message_form.vue index c37251af0ab..427e6c14327 100644 --- a/app/assets/javascripts/admin/broadcast_messages/components/message_form.vue +++ b/app/assets/javascripts/admin/broadcast_messages/components/message_form.vue @@ -72,6 +72,10 @@ export default { update: s__('BroadcastMessages|Update broadcast message'), updateError: s__('BroadcastMessages|There was an error updating broadcast message.'), cancel: __('Cancel'), + showInCli: s__('BroadcastMessages|Git remote responses'), + showInCliDescription: s__( + 'BroadcastMessages|Show the broadcast message in a command-line interface as a Git remote response', + ), }, messageThemes: THEMES, messageTypes: TYPES, @@ -97,6 +101,7 @@ export default { startsAt: new Date(this.broadcastMessage.startsAt.getTime()), endsAt: new Date(this.broadcastMessage.endsAt.getTime()), renderedMessage: '', + showInCli: this.broadcastMessage.showInCli, }; }, computed: { @@ -127,6 +132,7 @@ export default { target_access_levels: this.targetAccessLevels, starts_at: this.startsAt.toISOString(), ends_at: this.endsAt.toISOString(), + show_in_cli: this.showInCli, }); }, }, @@ -226,6 +232,17 @@ export default { <span>{{ $options.i18n.dismissableDescription }}</span> </gl-form-checkbox> </gl-form-group> + + <gl-form-group :label="$options.i18n.showInCli" label-for="show-in-cli-checkbox"> + <gl-form-checkbox + id="show-in-cli-checkbox" + v-model="showInCli" + class="gl-mt-3" + data-testid="show-in-cli-checkbox" + > + <span>{{ $options.i18n.showInCliDescription }}</span> + </gl-form-checkbox> + </gl-form-group> </template> <gl-form-group :label="$options.i18n.targetRoles" data-testid="target-roles-checkboxes"> diff --git a/app/assets/javascripts/admin/broadcast_messages/constants.js b/app/assets/javascripts/admin/broadcast_messages/constants.js index 9f64b2dcaa0..ed137181a48 100644 --- a/app/assets/javascripts/admin/broadcast_messages/constants.js +++ b/app/assets/javascripts/admin/broadcast_messages/constants.js @@ -30,4 +30,5 @@ export const NEW_BROADCAST_MESSAGE = { targetAccessLevels: [], startsAt: new Date(), endsAt: new Date(), + showInCli: true, }; diff --git a/app/assets/javascripts/admin/broadcast_messages/edit.js b/app/assets/javascripts/admin/broadcast_messages/edit.js index 91dae949d45..33b3b028c58 100644 --- a/app/assets/javascripts/admin/broadcast_messages/edit.js +++ b/app/assets/javascripts/admin/broadcast_messages/edit.js @@ -1,4 +1,5 @@ import Vue from 'vue'; +import { parseBoolean } from '~/lib/utils/common_utils'; import MessageForm from './components/message_form.vue'; export default () => { @@ -16,6 +17,7 @@ export default () => { targetPath, startsAt, endsAt, + showInCli, } = el.dataset; return new Vue({ @@ -34,11 +36,12 @@ export default () => { message, broadcastType, theme, - dismissable: dismissable === 'true', + dismissable: parseBoolean(dismissable), targetAccessLevels: JSON.parse(targetAccessLevels), targetPath, startsAt: new Date(startsAt), endsAt: new Date(endsAt), + showInCli: parseBoolean(showInCli), }, }, }); |