Skip to content

Commit e142003

Browse files
lucio617Gunnar Mills
authored andcommitted
Dumps Validation Fix
- Fixed Vuelidate returning validations always as false - Activated Dumps Modal Validations only when its open Change-Id: I87e61f3033f6e4f7ab0cd19859638d686bdc9775 Signed-off-by: Nishant Tiwari <[email protected]>
1 parent 99fe228 commit e142003

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

src/views/Logs/Dumps/DumpsForm.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828
{{ $t('pageDumps.form.initiateDump') }}
2929
</b-button>
3030
</b-form>
31-
<modal-confirmation @ok="createSystemDump" />
31+
<modal-confirmation
32+
:require-confirmation="selectedDumpType === 'system'"
33+
@ok="createSystemDump"
34+
/>
3235
</div>
3336
</template>
3437

src/views/Logs/Dumps/DumpsModalConfirmation.vue

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ import { useI18n } from 'vue-i18n';
4646
export default {
4747
components: { StatusIcon },
4848
mixins: [VuelidateMixin],
49+
props: {
50+
requireConfirmation: {
51+
type: Boolean,
52+
default: false,
53+
},
54+
},
4955
setup() {
5056
return {
5157
v$: useVuelidate(),
@@ -55,12 +61,17 @@ export default {
5561
return {
5662
$t: useI18n().t,
5763
confirmed: false,
64+
isOpen: this.requireConfirmation,
5865
};
5966
},
60-
validations: {
61-
confirmed: {
62-
mustBeTrue: (value) => value === true,
63-
},
67+
validations() {
68+
return this.isOpen
69+
? {
70+
confirmed: {
71+
mustBeTrue: (value) => value === true,
72+
},
73+
}
74+
: {};
6475
},
6576
methods: {
6677
closeModal() {
@@ -76,6 +87,7 @@ export default {
7687
},
7788
resetForm() {
7889
this.confirmed = false;
90+
this.isOpen = false;
7991
this.v$.$reset();
8092
},
8193
},

0 commit comments

Comments
 (0)