Skip to content

Commit fd88377

Browse files
committed
Replace Vuetify MessageDialog with KModal in unsaved changes modal (learningequality#5299). Addresses learningequality#5306 review feedback.
1 parent 43092b7 commit fd88377

File tree

2 files changed

+11
-24
lines changed

2 files changed

+11
-24
lines changed

contentcuration/contentcuration/frontend/channelList/views/ChannelSet/ChannelSetModal.vue

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -154,29 +154,18 @@
154154
</VContainer>
155155
</VWindowItem>
156156
</VWindow>
157-
<MessageDialog
158-
v-model="showUnsavedDialog"
159-
:header="$tr('unsavedChangesHeader')"
160-
:text="$tr('unsavedChangesText')"
157+
<KModal
158+
v-if="showUnsavedDialog"
159+
:title="$tr('unsavedChangesHeader')"
160+
:submitText="$tr('saveButton')"
161+
:cancelText="$tr('closeButton')"
161162
data-test="dialog-unsaved"
162163
:data-test-visible="showUnsavedDialog"
164+
@submit="save"
165+
@cancel="confirmCancel"
163166
>
164-
<template #buttons>
165-
<VSpacer />
166-
<VBtn
167-
flat
168-
@click="confirmCancel"
169-
>
170-
{{ $tr('closeButton') }}
171-
</VBtn>
172-
<VBtn
173-
color="primary"
174-
@click="save"
175-
>
176-
{{ $tr('saveButton') }}
177-
</VBtn>
178-
</template>
179-
</MessageDialog>
167+
{{ $tr('unsavedChangesText') }}
168+
</KModal>
180169
<template #bottom>
181170
<div class="mx-4 subheading">
182171
{{ $tr('channelSelectedCountText', { channelCount: channels.length }) }}
@@ -215,7 +204,6 @@
215204
import { ChannelListTypes, ErrorTypes } from 'shared/constants';
216205
import { constantsTranslationMixin, routerMixin } from 'shared/mixins';
217206
import CopyToken from 'shared/views/CopyToken';
218-
import MessageDialog from 'shared/views/MessageDialog';
219207
import FullscreenModal from 'shared/views/FullscreenModal';
220208
import Tabs from 'shared/views/Tabs';
221209
import LoadingText from 'shared/views/LoadingText';
@@ -225,7 +213,6 @@
225213
components: {
226214
CopyToken,
227215
ChannelSelectionList,
228-
MessageDialog,
229216
ChannelItem,
230217
FullscreenModal,
231218
Tabs,

contentcuration/contentcuration/frontend/channelList/views/ChannelSet/__tests__/channelSetModal.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,12 @@ describe('ChannelSetModal', () => {
217217
});
218218

219219
it('should prompt user if there are unsaved changes', async () => {
220-
expect(getUnsavedDialog(wrapper).attributes('data-test-visible')).toBeFalsy();
220+
expect(getUnsavedDialog(wrapper).exists()).toBeFalsy();
221221

222222
await getCollectionNameInput(wrapper).setValue('My collection');
223223
await getCloseButton(wrapper).trigger('click');
224224

225-
expect(getUnsavedDialog(wrapper).attributes('data-test-visible')).toBeTruthy();
225+
expect(getUnsavedDialog(wrapper).exists()).toBeTruthy();
226226
});
227227
});
228228

0 commit comments

Comments
 (0)