diff options
author | tiwari-nishant <tiwari.nishant0077@gmail.com> | 2025-09-01 09:41:14 +0300 |
---|---|---|
committer | Gunnar Mills <gunnar@gmills.xyz> | 2025-09-29 18:11:07 +0300 |
commit | e1420032fef78a490fb2be7b407c4a6bd82b1b02 (patch) | |
tree | 7b986988ccb8213a3716b5606f4ef40dcf705925 /src | |
parent | 99fe228eef84d018125712187e04b24a328d292b (diff) | |
download | webui-vue-master.tar.xz |
- Fixed Vuelidate returning validations always as false
- Activated Dumps Modal Validations only when its open
Change-Id: I87e61f3033f6e4f7ab0cd19859638d686bdc9775
Signed-off-by: Nishant Tiwari <tiwari.nishant@ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/views/Logs/Dumps/DumpsForm.vue | 5 | ||||
-rw-r--r-- | src/views/Logs/Dumps/DumpsModalConfirmation.vue | 20 |
2 files changed, 20 insertions, 5 deletions
diff --git a/src/views/Logs/Dumps/DumpsForm.vue b/src/views/Logs/Dumps/DumpsForm.vue index 17257d1ec..b27aebac0 100644 --- a/src/views/Logs/Dumps/DumpsForm.vue +++ b/src/views/Logs/Dumps/DumpsForm.vue @@ -28,7 +28,10 @@ {{ $t('pageDumps.form.initiateDump') }} </b-button> </b-form> - <modal-confirmation @ok="createSystemDump" /> + <modal-confirmation + :require-confirmation="selectedDumpType === 'system'" + @ok="createSystemDump" + /> </div> </template> diff --git a/src/views/Logs/Dumps/DumpsModalConfirmation.vue b/src/views/Logs/Dumps/DumpsModalConfirmation.vue index 05b868dba..fd1cb78cb 100644 --- a/src/views/Logs/Dumps/DumpsModalConfirmation.vue +++ b/src/views/Logs/Dumps/DumpsModalConfirmation.vue @@ -46,6 +46,12 @@ import { useI18n } from 'vue-i18n'; export default { components: { StatusIcon }, mixins: [VuelidateMixin], + props: { + requireConfirmation: { + type: Boolean, + default: false, + }, + }, setup() { return { v$: useVuelidate(), @@ -55,12 +61,17 @@ export default { return { $t: useI18n().t, confirmed: false, + isOpen: this.requireConfirmation, }; }, - validations: { - confirmed: { - mustBeTrue: (value) => value === true, - }, + validations() { + return this.isOpen + ? { + confirmed: { + mustBeTrue: (value) => value === true, + }, + } + : {}; }, methods: { closeModal() { @@ -76,6 +87,7 @@ export default { }, resetForm() { this.confirmed = false; + this.isOpen = false; this.v$.$reset(); }, }, |