Commit 73f80a03 authored by Miguel Rincon's avatar Miguel Rincon

Update runner registration token reset modal

This change updates the runner registration modal to reduce it's size
and mark it as destructive action.

Changelog: changed
parent ec3e3942
...@@ -11,8 +11,10 @@ import { INSTANCE_TYPE, GROUP_TYPE, PROJECT_TYPE } from '../../constants'; ...@@ -11,8 +11,10 @@ import { INSTANCE_TYPE, GROUP_TYPE, PROJECT_TYPE } from '../../constants';
export default { export default {
name: 'RunnerRegistrationTokenReset', name: 'RunnerRegistrationTokenReset',
i18n: { i18n: {
modalTitle: __('Reset registration token'), modalAction: s__('Runners|Reset token'),
modalCancel: __('Cancel'),
modalCopy: __('Are you sure you want to reset the registration token?'), modalCopy: __('Are you sure you want to reset the registration token?'),
modalTitle: __('Reset registration token'),
}, },
components: { components: {
GlDropdownItem, GlDropdownItem,
...@@ -30,7 +32,7 @@ export default { ...@@ -30,7 +32,7 @@ export default {
default: null, default: null,
}, },
}, },
modalID: 'token-reset-modal', modalId: 'token-reset-modal',
props: { props: {
type: { type: {
type: String, type: String,
...@@ -111,10 +113,19 @@ export default { ...@@ -111,10 +113,19 @@ export default {
}; };
</script> </script>
<template> <template>
<gl-dropdown-item v-gl-modal="$options.modalID"> <gl-dropdown-item v-gl-modal="$options.modalId">
{{ __('Reset registration token') }} {{ __('Reset registration token') }}
<gl-modal <gl-modal
:modal-id="$options.modalID" size="sm"
:modal-id="$options.modalId"
:action-primary="{
text: $options.i18n.modalAction,
attributes: [{ variant: 'danger' }],
}"
:action-secondary="{
text: $options.i18n.modalCancel,
attributes: [{ variant: 'default' }],
}"
:title="$options.i18n.modalTitle" :title="$options.i18n.modalTitle"
@primary="handleModalPrimary" @primary="handleModalPrimary"
> >
......
...@@ -30882,6 +30882,9 @@ msgstr "" ...@@ -30882,6 +30882,9 @@ msgstr ""
msgid "Runners|Registration token copied!" msgid "Runners|Registration token copied!"
msgstr "" msgstr ""
msgid "Runners|Reset token"
msgstr ""
msgid "Runners|Revision" msgid "Runners|Revision"
msgstr "" msgstr ""
......
...@@ -472,7 +472,7 @@ RSpec.describe "Admin Runners" do ...@@ -472,7 +472,7 @@ RSpec.describe "Admin Runners" do
click_on 'Reset registration token' click_on 'Reset registration token'
within_modal do within_modal do
click_button('OK', match: :first) click_button('Reset token', match: :first)
end end
wait_for_requests wait_for_requests
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment