Skip to content

Commit

Permalink
chore: reset modal when load and close
Browse files Browse the repository at this point in the history
The certificate data, password, error message need to be empty when
modal is open. I also put this to close function to prevent to have
these data when is no more necessary.

I also converted the modal to large when display the certificate data
because in some cases, the certificate data have very large rows and a
lot of rows.

Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos authored and backportbot-libresign[bot] committed Apr 18, 2024
1 parent 6793bde commit b959f81
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/views/ReadCertificate.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<NcDialog v-if="signMethodsStore.modal.readCertificate"
:name="t('libresign', 'Certificate data')"
:size="size"
@closing="onClose">
<NcNoteCard v-if="error" type="error">
<p>{{ error }}</p>
Expand Down Expand Up @@ -116,9 +117,19 @@ export default {
password: '',
certificateData: [],
error: '',
size: 'small',
}
},
mounted() {
this.reset()
},
methods: {
reset() {
this.password = ''
this.certificateData = []
this.error = ''
this.size = 'small'
},
getLabelFromId(id) {
try {
const item = selectCustonOption(id).unwrap()
Expand All @@ -134,6 +145,7 @@ export default {
})
.then(({ data }) => {
this.certificateData = data
this.size = 'large'
this.error = ''
})
.catch(({ response }) => {
Expand All @@ -146,8 +158,8 @@ export default {
this.hasLoading = false
},
onClose() {
this.certificateData = []
this.signMethodsStore.closeModal('readCertificate')
this.reset()
},
},
}
Expand Down Expand Up @@ -187,7 +199,6 @@ form{
}
table {
display: block;
width: 100%;
white-space: unset;
}
Expand Down

0 comments on commit b959f81

Please sign in to comment.