Fix lint issues

And disable eslint when building in prod mode

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-11-30 10:24:11 +01:00
parent da42522073
commit 2d541f2e32
161 changed files with 3869 additions and 1236 deletions

View File

@@ -19,7 +19,12 @@
:src="identity.avatar.url"
alt=""
/>
<b-icon class="media-left" v-else size="is-large" icon="account-circle" />
<b-icon
class="media-left"
v-else
size="is-large"
icon="account-circle"
/>
<div class="media-content">
<h3>@{{ identity.preferredUsername }}</h3>
<small>{{ identity.name }}</small>

View File

@@ -3,13 +3,20 @@
<div
v-if="inline"
class="inline box"
:class="{ 'has-background-grey-lighter': masked, 'no-other-identity': !hasOtherIdentities }"
:class="{
'has-background-grey-lighter': masked,
'no-other-identity': !hasOtherIdentities,
}"
@click="activateModal"
>
<div class="media">
<div class="media-left">
<figure class="image is-48x48" v-if="currentIdentity.avatar">
<img class="image is-rounded" :src="currentIdentity.avatar.url" alt="" />
<img
class="image is-rounded"
:src="currentIdentity.avatar.url"
alt=""
/>
</figure>
<b-icon v-else size="is-large" icon="account-circle" />
</div>
@@ -23,7 +30,11 @@
<div class="media-content" v-else>
{{ `@${currentIdentity.preferredUsername}` }}
</div>
<b-button type="is-text" v-if="identities.length > 1" @click="activateModal">
<b-button
type="is-text"
v-if="identities.length > 1"
@click="activateModal"
>
{{ $t("Change") }}
</b-button>
</div>

View File

@@ -40,7 +40,12 @@
</b-dropdown-item>
</b-dropdown>
<b-dropdown hoverable has-link aria-role="list" v-if="person.feedTokens.length > 0">
<b-dropdown
hoverable
has-link
aria-role="list"
v-if="person.feedTokens.length > 0"
>
<button class="button is-info" slot="trigger">
{{ $t("Private feeds") }}
<b-icon icon="menu-down"></b-icon>
@@ -57,7 +62,11 @@
</a>
</b-dropdown-item>
</b-dropdown>
<a class="button" v-if="currentActor.id === person.id" @click="createToken">
<a
class="button"
v-if="currentActor.id === person.id"
@click="createToken"
>
{{ $t("Create token") }}
</a>
</div>

View File

@@ -6,7 +6,11 @@
{{ $t("Congratulations, your account is now created!") }}
</h1>
<h1 class="title" v-else>
{{ $t("Register an account on {instanceName}!", { instanceName: config.name }) }}
{{
$t("Register an account on {instanceName}!", {
instanceName: config.name,
})
}}
</h1>
<p class="content" v-if="userAlreadyActivated">
{{ $t("Now, create your first profile:") }}
@@ -28,7 +32,9 @@
>
<b-field
:message="
$t('Only alphanumeric lowercased characters and underscores are supported.')
$t(
'Only alphanumeric lowercased characters and underscores are supported.'
)
"
>
<b-input
@@ -38,7 +44,9 @@
v-model="identity.preferredUsername"
:validation-message="
identity.preferredUsername
? $t('Only alphanumeric lowercased characters and underscores are supported.')
? $t(
'Only alphanumeric lowercased characters and underscores are supported.'
)
: null
"
/>
@@ -48,11 +56,20 @@
</b-field>
</b-field>
<p class="description">
{{ $t("This identifier is unique to your profile. It allows others to find you.") }}
{{
$t(
"This identifier is unique to your profile. It allows others to find you."
)
}}
</p>
<b-field :label="$t('Short bio')">
<b-input type="textarea" maxlength="100" rows="2" v-model="identity.summary" />
<b-input
type="textarea"
maxlength="100"
rows="2"
v-model="identity.summary"
/>
</b-field>
<p class="content">
@@ -165,7 +182,10 @@ export default class Register extends mixins(identityEditionMixin) {
window.localStorage.setItem("new-registered-user", "yes");
if (this.userAlreadyActivated) {
await changeIdentity(this.$apollo.provider.defaultClient, data.registerPerson);
await changeIdentity(
this.$apollo.provider.defaultClient,
data.registerPerson
);
await this.$router.push({ name: RouteName.HOME });
}

View File

@@ -3,7 +3,9 @@
<nav class="breadcrumb" aria-label="breadcrumbs">
<ul>
<li>
<router-link :to="{ name: RouteName.IDENTITIES }">{{ $t("Profiles") }}</router-link>
<router-link :to="{ name: RouteName.IDENTITIES }">{{
$t("Profiles")
}}</router-link>
</li>
<li class="is-active" v-if="isUpdate && identity">
<router-link
@@ -27,7 +29,11 @@
<span v-else>{{ $t("I create an identity") }}</span>
</h1>
<picture-upload v-model="avatarFile" :defaultImage="identity.avatar" class="picture-upload" />
<picture-upload
v-model="avatarFile"
:defaultImage="identity.avatar"
class="picture-upload"
/>
<b-field horizontal :label="$t('Display name')">
<b-input
@@ -62,7 +68,11 @@
</b-field>
<b-field horizontal :label="$t('Description')">
<b-input type="textarea" aria-required="false" v-model="identity.summary" />
<b-input
type="textarea"
aria-required="false"
v-model="identity.summary"
/>
</b-field>
<b-notification
@@ -84,7 +94,9 @@
</b-field>
<div class="delete-identity" v-if="isUpdate">
<span @click="openDeleteIdentityConfirmation()">{{ $t("Delete this identity") }}</span>
<span @click="openDeleteIdentityConfirmation()">{{
$t("Delete this identity")
}}</span>
</div>
</div>
</div>
@@ -229,7 +241,9 @@ export default class EditIdentity extends mixins(identityEditionMixin) {
});
if (data) {
data.identities = data.identities.filter((i) => i.id !== this.identity.id);
data.identities = data.identities.filter(
(i) => i.id !== this.identity.id
);
store.writeQuery({ query: IDENTITIES, data });
}
@@ -242,7 +256,8 @@ export default class EditIdentity extends mixins(identityEditionMixin) {
}) as string
);
/**
* If we just deleted the current identity, we need to change it to the next one
* If we just deleted the current identity,
* we need to change it to the next one
*/
const data = this.$apollo.provider.defaultClient.readQuery<{
identities: IPerson[];
@@ -270,7 +285,9 @@ export default class EditIdentity extends mixins(identityEditionMixin) {
});
if (data) {
const index = data.identities.findIndex((i) => i.id === this.identity.id);
const index = data.identities.findIndex(
(i) => i.id === this.identity.id
);
this.$set(data.identities, index, updatePerson);
this.maybeUpdateCurrentActorCache(updatePerson);
@@ -351,9 +368,12 @@ export default class EditIdentity extends mixins(identityEditionMixin) {
"Otherwise this identity will just be removed from the group administrators."
)}
<br /><br />
${this.$t('To confirm, type your identity username "{preferredUsername}"', {
preferredUsername: this.identity.preferredUsername,
})}`,
${this.$t(
'To confirm, type your identity username "{preferredUsername}"',
{
preferredUsername: this.identity.preferredUsername,
}
)}`,
confirmText: this.$t("Delete {preferredUsername}", {
preferredUsername: this.identity.preferredUsername,
}) as string,
@@ -406,7 +426,9 @@ export default class EditIdentity extends mixins(identityEditionMixin) {
private async maybeUpdateCurrentActorCache(identity: IPerson) {
if (this.currentActor) {
if (this.currentActor.preferredUsername === this.identity.preferredUsername) {
if (
this.currentActor.preferredUsername === this.identity.preferredUsername
) {
await changeIdentity(this.$apollo.provider.defaultClient, identity);
}
this.currentActor = identity;