Skip to content

Commit

Permalink
chore: clean code
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Apr 12, 2024
1 parent c3eacd0 commit 8e9e0e0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 131 deletions.
57 changes: 0 additions & 57 deletions src/Components/Modals/ModalContent.vue

This file was deleted.

1 change: 1 addition & 0 deletions src/views/Account/partials/ManagePassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export default {
},
setup() {
const signMethodsStore = useSignMethodsStore()
signMethodsStore.setHasSignatureFile(loadState('libresign', 'config', {})?.hasSignatureFile ?? false)
return { signMethodsStore }
},
data() {
Expand Down
33 changes: 0 additions & 33 deletions src/views/CreatePassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,36 +73,3 @@ export default {
},
}
</script>
<style lang="scss" scoped>
form{
display: flex;
flex-direction: column;
width: 100%;
max-width: 100%;
justify-content: center;
align-items: center;
text-align: center;
header{
font-weight: bold;
font-size: 20px;
margin-bottom: 12px;
line-height: 30px;
color: var(--color-text-light);
}
}
.container {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
gap: 4px 0;
}
.input-group{
justify-content: space-between;
display: flex;
flex-direction: column;
width: 100%;
}
</style>
50 changes: 9 additions & 41 deletions src/views/ResetPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@
</div>
</div>
<template #actions>
<button :disabled="!canSave"
<NcButton :disabled="!canSave"
:class="hasLoading ? 'btn-load loading primary btn-confirm' : 'primary btn-confirm'"
@click="send">
<template #icon>
<NcLoadingIcon v-if="hasLoading" :size="20" />
</template>
{{ t('libresign', 'Confirm') }}
</button>
</NcButton>
</template>
</NcDialog>
</template>

<script>
import NcDialog from '@nextcloud/vue/dist/Components/NcDialog.js'
import NcPasswordField from '@nextcloud/vue/dist/Components/NcPasswordField.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'
import { showError, showSuccess } from '@nextcloud/dialogs'
Expand All @@ -41,6 +45,7 @@ export default {
components: {
NcDialog,
NcPasswordField,
NcButton,
},
setup() {
const signMethodsStore = useSignMethodsStore()
Expand All @@ -56,7 +61,7 @@ export default {
},
computed: {
canSave() {
return this.currentPassword && this.validNewPassord
return this.currentPassword && this.validNewPassord && !this.hasLoading
},
validNewPassord() {
return this.newPassword.length > 3 && this.newPassword === this.rPassword
Expand All @@ -72,6 +77,7 @@ export default {
})
showSuccess(response.data.message)
this.hasLoading = false
this.signMethodsStore.closeModal('resetPassword')
this.$emit('close', true)
} catch (err) {
if (err.response.data.message) {
Expand All @@ -86,28 +92,6 @@ export default {
}
</script>
<style lang="scss" scoped>
form{
display: flex;
flex-direction: column;
width: 100%;
max-width: 100%;
margin: 50px;
justify-content: center;
align-items: center;
text-align: center;
padding: 1rem;
header{
margin-bottom: 2.5rem;
}
h1{
font-size: 45px;
margin-bottom: 1rem;
}
p{
font-size: 15px;
}
}
.container {
display: flex;
flex-direction: column;
Expand All @@ -119,22 +103,6 @@ export default {
text-align: start;
}
.btn-confirm{
width: 100%;
max-width: 280px;
}
.btn-load{
background-color: transparent !important;
font-size: 0;
pointer-events: none;
cursor: not-allowed;
margin-top: 10px;
border: none;
}
.input-group{
display: flex;
flex-direction: column;
Expand Down

0 comments on commit 8e9e0e0

Please sign in to comment.