Skip to content

Commit 05b7e71

Browse files
Replaces MessageDialog with KModal in EditModal
* feat: Replace MessageDialog with KModal in EditModal Replace upload progress and save failed dialogs with KModal components. Maintains existing functionality and adds unit tests. Fixes #5422 * [pre-commit.ci lite] apply automatic fixes * Migrate editModal.kmodal.spec.js to @testing-library/vue and fix linting issues * fix: fixed KModal to use its own inbuilt buttons from docs * fix: fixed the test to use actual kmodal for testing * fix: Test actual EditModal component instead of mock components and rewrite the test * [pre-commit.ci lite] apply automatic fixes * chore: remove editModal.kmodal.spec.js from PR as per review feedback --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent fd33d5b commit 05b7e71

File tree

1 file changed

+18
-39
lines changed
  • contentcuration/contentcuration/frontend/channelEdit/components/edit

1 file changed

+18
-39
lines changed

contentcuration/contentcuration/frontend/channelEdit/components/edit/EditModal.vue

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -182,49 +182,28 @@
182182
</MessageDialog>
183183

184184
<!-- Dialog for catching in-progress file uploads -->
185-
<MessageDialog
186-
v-model="promptUploading"
187-
:header="$tr('uploadInProgressHeader')"
188-
:text="$tr('uploadInProgressText')"
185+
<KModal
186+
v-if="promptUploading"
187+
:title="$tr('uploadInProgressHeader')"
188+
:cancelText="$tr('dismissDialogButton')"
189+
:submitText="$tr('cancelUploadsButton')"
190+
@cancel="promptUploading = false"
191+
@submit="closeModal"
189192
>
190-
<template #buttons="{ close }">
191-
<VBtn
192-
flat
193-
@click="close"
194-
>
195-
{{ $tr('dismissDialogButton') }}
196-
</VBtn>
197-
<VBtn
198-
data-test="canceluploads"
199-
color="primary"
200-
@click="closeModal"
201-
>
202-
{{ $tr('cancelUploadsButton') }}
203-
</VBtn>
204-
</template>
205-
</MessageDialog>
193+
<p>{{ $tr('uploadInProgressText') }}</p>
194+
</KModal>
206195

207196
<!-- Alert for failed save -->
208-
<MessageDialog
209-
v-model="promptFailed"
210-
:header="$tr('saveFailedHeader')"
211-
:text="$tr('saveFailedText')"
197+
<KModal
198+
v-if="promptFailed"
199+
:title="$tr('saveFailedHeader')"
200+
:cancelText="$tr('okButton')"
201+
:submitText="$tr('closeWithoutSavingButton')"
202+
@cancel="promptFailed = false"
203+
@submit="closeModal"
212204
>
213-
<template #buttons="{ close }">
214-
<VBtn
215-
flat
216-
@click="close"
217-
>
218-
{{ $tr('okButton') }}
219-
</VBtn>
220-
<VBtn
221-
color="primary"
222-
@click="closeModal"
223-
>
224-
{{ $tr('closeWithoutSavingButton') }}
225-
</VBtn>
226-
</template>
227-
</MessageDialog>
205+
<p>{{ $tr('saveFailedText') }}</p>
206+
</KModal>
228207
</div>
229208

230209
</template>

0 commit comments

Comments
 (0)