refactor(editor): Apply Prettier (no-changelog) (#4920)

*  Adjust `format` script

* 🔥 Remove exemption for `editor-ui`

* 🎨 Prettify

* 👕 Fix lint
This commit is contained in:
Iván Ovejero
2022-12-14 10:04:10 +01:00
committed by GitHub
parent bcde07e032
commit 5ca2148c7e
284 changed files with 19247 additions and 15540 deletions

View File

@@ -18,9 +18,7 @@ import { VIEWS } from '@/constants';
import { mapStores } from 'pinia';
import { useUsersStore } from '@/stores/users';
export default mixins(
showMessage,
).extend({
export default mixins(showMessage).extend({
name: 'ChangePasswordView',
components: {
AuthView,
@@ -48,7 +46,7 @@ export default mixins(
label: this.$locale.baseText('auth.newPassword'),
type: 'password',
required: true,
validationRules: [{name: 'DEFAULT_PASSWORD_RULES'}],
validationRules: [{ name: 'DEFAULT_PASSWORD_RULES' }],
infoText: this.$locale.baseText('auth.defaultPasswordRequirements'),
autocomplete: 'new-password',
capitalize: true,
@@ -65,15 +63,21 @@ export default mixins(
validate: this.passwordsMatch,
},
},
validationRules: [{name: 'TWO_PASSWORDS_MATCH'}],
validationRules: [{ name: 'TWO_PASSWORDS_MATCH' }],
autocomplete: 'new-password',
capitalize: true,
},
},
],
};
const token = (!this.$route.query.token || typeof this.$route.query.token !== 'string') ? null : this.$route.query.token;
const userId = (!this.$route.query.userId || typeof this.$route.query.userId !== 'string') ? null : this.$route.query.userId;
const token =
!this.$route.query.token || typeof this.$route.query.token !== 'string'
? null
: this.$route.query.token;
const userId =
!this.$route.query.userId || typeof this.$route.query.userId !== 'string'
? null
: this.$route.query.userId;
try {
if (!token) {
throw new Error(this.$locale.baseText('auth.changePassword.missingTokenError'));
@@ -84,7 +88,10 @@ export default mixins(
await this.usersStore.validatePasswordToken({ token, userId });
} catch (e) {
this.$showMessage({title: this.$locale.baseText('auth.changePassword.tokenValidationError'), type: 'error'});
this.$showMessage({
title: this.$locale.baseText('auth.changePassword.tokenValidationError'),
type: 'error',
});
}
},
methods: {
@@ -101,7 +108,7 @@ export default mixins(
return false;
},
onInput(e: {name: string, value: string}) {
onInput(e: { name: string; value: string }) {
if (e.name === 'password') {
this.password = e.value;
}
@@ -109,11 +116,17 @@ export default mixins(
async onSubmit() {
try {
this.loading = true;
const token = (!this.$route.query.token || typeof this.$route.query.token !== 'string') ? null : this.$route.query.token;
const userId = (!this.$route.query.userId || typeof this.$route.query.userId !== 'string') ? null : this.$route.query.userId;
const token =
!this.$route.query.token || typeof this.$route.query.token !== 'string'
? null
: this.$route.query.token;
const userId =
!this.$route.query.userId || typeof this.$route.query.userId !== 'string'
? null
: this.$route.query.userId;
if (token && userId) {
await this.usersStore.changePassword({token, userId, password: this.password});
await this.usersStore.changePassword({ token, userId, password: this.password });
this.$showMessage({
type: 'success',
@@ -123,7 +136,10 @@ export default mixins(
await this.$router.push({ name: VIEWS.SIGNIN });
} else {
this.$showError(new Error(this.$locale.baseText('auth.validation.missingParameters')), this.$locale.baseText('auth.changePassword.error'));
this.$showError(
new Error(this.$locale.baseText('auth.validation.missingParameters')),
this.$locale.baseText('auth.changePassword.error'),
);
}
} catch (error) {
this.$showError(error, this.$locale.baseText('auth.changePassword.error'));