|
1 | 1 | <template> |
2 | 2 |
|
3 | 3 | <div> |
4 | | - <ConfirmationDialog |
5 | | - v-model="deleteDialog" |
6 | | - title="Delete user" |
7 | | - :text="`Are you sure you want to permanently delete ${user.name}'s account?`" |
8 | | - confirmButtonText="Delete" |
| 4 | + <KModal |
| 5 | + v-if="deleteDialog" |
| 6 | + :title="$tr('deleteUserTitle')" |
| 7 | + :submitText="$tr('deleteAction')" |
| 8 | + :cancelText="$tr('cancelAction')" |
9 | 9 | data-test="confirm-delete" |
10 | | - @confirm="deleteHandler" |
11 | | - /> |
12 | | - <ConfirmationDialog |
13 | | - v-model="deactivateDialog" |
14 | | - title="Deactivate user" |
15 | | - :text=" |
16 | | - `Deactivating ${user.name}'s account will block them from ` + |
17 | | - `accessing their account. Are you sure you want to continue?` |
18 | | - " |
19 | | - confirmButtonText="Deactivate" |
| 10 | + @submit="deleteHandler" |
| 11 | + @cancel="deleteDialog = false" |
| 12 | + > |
| 13 | + <div class="kmodal-confirmation-content"> |
| 14 | + <p>{{ $tr('deleteUserMessage', { name: user.name }) }}</p> |
| 15 | + </div> |
| 16 | + </KModal> |
| 17 | + |
| 18 | + <KModal |
| 19 | + v-if="deactivateDialog" |
| 20 | + :title="$tr('deactivateUserTitle')" |
| 21 | + :submitText="$tr('deactivateAction')" |
| 22 | + :cancelText="$tr('cancelAction')" |
20 | 23 | data-test="confirm-deactivate" |
21 | | - @confirm="deactivateHandler" |
22 | | - /> |
| 24 | + @submit="deactivateHandler" |
| 25 | + @cancel="deactivateDialog = false" |
| 26 | + > |
| 27 | + <div class="kmodal-confirmation-content"> |
| 28 | + <p>{{ $tr('deactivateUserMessage', { name: user.name }) }}</p> |
| 29 | + </div> |
| 30 | + </KModal> |
23 | 31 | <UserPrivilegeModal |
24 | 32 | v-model="addAdminPrivilegeDialog" |
25 | 33 | header="Add admin privileges" |
|
106 | 114 | <script> |
107 | 115 |
|
108 | 116 | import { mapActions, mapGetters, mapState } from 'vuex'; |
109 | | - import ConfirmationDialog from '../../components/ConfirmationDialog'; |
| 117 | + |
110 | 118 | import EmailUsersDialog from './EmailUsersDialog'; |
111 | 119 | import UserPrivilegeModal from './UserPrivilegeModal'; |
112 | 120 |
|
113 | 121 | export default { |
114 | 122 | name: 'UserActionsDropdown', |
115 | 123 | components: { |
116 | | - ConfirmationDialog, |
| 124 | + |
117 | 125 | EmailUsersDialog, |
118 | 126 | UserPrivilegeModal, |
119 | 127 | }, |
|
174 | 182 | }); |
175 | 183 | }, |
176 | 184 | }, |
| 185 | + $trs: { |
| 186 | + deleteUserTitle: 'Delete user', |
| 187 | + deleteAction: 'Delete', |
| 188 | + deleteUserMessage: "Are you sure you want to permanently delete {name}'s account?", |
| 189 | + deactivateUserTitle: 'Deactivate user', |
| 190 | + deactivateAction: 'Deactivate', |
| 191 | + deactivateUserMessage: "Deactivating {name}'s account will block them from accessing their account. Are you sure you want to continue?", |
| 192 | + cancelAction: 'Cancel', |
| 193 | + }, |
177 | 194 | }; |
178 | 195 |
|
179 | 196 | </script> |
180 | 197 |
|
181 | 198 |
|
182 | | -<style lang="scss" scoped></style> |
| 199 | +<style lang="scss" scoped> |
| 200 | +
|
| 201 | +.kmodal-confirmation-content { |
| 202 | + color: #212121; |
| 203 | + white-space: normal; |
| 204 | + text-align: left; |
| 205 | +} |
| 206 | +
|
| 207 | +::v-deep .title { |
| 208 | + color: #212121; |
| 209 | + text-align: left; |
| 210 | + font-weight: bold; |
| 211 | +} |
| 212 | +
|
| 213 | +</style> |
0 commit comments