Fix lint issues
And disable eslint when building in prod mode Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -7,6 +7,8 @@ export default class ActorMixin extends Vue {
|
||||
static actorIsOrganizer(actor: IActor, event: IEvent): boolean {
|
||||
console.log("actorIsOrganizer actor", actor.id);
|
||||
console.log("actorIsOrganizer event", event);
|
||||
return event.organizerActor !== undefined && actor.id === event.organizerActor.id;
|
||||
return (
|
||||
event.organizerActor !== undefined && actor.id === event.organizerActor.id
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,9 @@ export default class EventMixin extends mixins(Vue) {
|
||||
anonymousParticipationConfirmed: boolean | null = null
|
||||
): Promise<void> {
|
||||
try {
|
||||
const { data: resultData } = await this.$apollo.mutate<{ leaveEvent: IParticipant }>({
|
||||
const { data: resultData } = await this.$apollo.mutate<{
|
||||
leaveEvent: IParticipant;
|
||||
}>({
|
||||
mutation: LEAVE_EVENT,
|
||||
variables: {
|
||||
eventId: event.id,
|
||||
@@ -33,14 +35,18 @@ export default class EventMixin extends mixins(Vue) {
|
||||
let participation;
|
||||
|
||||
if (!token) {
|
||||
const participationCachedData = store.readQuery<{ person: IPerson }>({
|
||||
const participationCachedData = store.readQuery<{
|
||||
person: IPerson;
|
||||
}>({
|
||||
query: EVENT_PERSON_PARTICIPATION,
|
||||
variables: { eventId: event.id, actorId },
|
||||
});
|
||||
if (participationCachedData == null) return;
|
||||
const { person } = participationCachedData;
|
||||
if (person === null) {
|
||||
console.error("Cannot update participation cache, because of null value.");
|
||||
console.error(
|
||||
"Cannot update participation cache, because of null value."
|
||||
);
|
||||
return;
|
||||
}
|
||||
[participation] = person.participations.elements;
|
||||
@@ -63,7 +69,10 @@ export default class EventMixin extends mixins(Vue) {
|
||||
console.error("Cannot update event cache, because of null value.");
|
||||
return;
|
||||
}
|
||||
if (participation && participation.role === ParticipantRole.NOT_APPROVED) {
|
||||
if (
|
||||
participation &&
|
||||
participation.role === ParticipantRole.NOT_APPROVED
|
||||
) {
|
||||
eventCached.participantStats.notApproved -= 1;
|
||||
} else if (anonymousParticipationConfirmed === false) {
|
||||
eventCached.participantStats.notConfirmed -= 1;
|
||||
@@ -82,13 +91,19 @@ export default class EventMixin extends mixins(Vue) {
|
||||
this.participationCancelledMessage();
|
||||
}
|
||||
} catch (error) {
|
||||
Snackbar.open({ message: error.message, type: "is-danger", position: "is-bottom" });
|
||||
Snackbar.open({
|
||||
message: error.message,
|
||||
type: "is-danger",
|
||||
position: "is-bottom",
|
||||
});
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
private participationCancelledMessage() {
|
||||
this.$notifier.success(this.$t("You have cancelled your participation") as string);
|
||||
this.$notifier.success(
|
||||
this.$t("You have cancelled your participation") as string
|
||||
);
|
||||
}
|
||||
|
||||
protected async openDeleteEventModal(event: IEvent): Promise<void> {
|
||||
@@ -97,21 +112,29 @@ export default class EventMixin extends mixins(Vue) {
|
||||
}
|
||||
const participantsLength = event.participantStats.participant;
|
||||
const prefix = participantsLength
|
||||
? this.$tc("There are {participants} participants.", event.participantStats.participant, {
|
||||
participants: event.participantStats.participant,
|
||||
})
|
||||
? this.$tc(
|
||||
"There are {participants} participants.",
|
||||
event.participantStats.participant,
|
||||
{
|
||||
participants: event.participantStats.participant,
|
||||
}
|
||||
)
|
||||
: "";
|
||||
|
||||
this.$buefy.dialog.prompt({
|
||||
type: "is-danger",
|
||||
title: this.$t("Delete event") as string,
|
||||
message: `${prefix}
|
||||
${this.$t("Are you sure you want to delete this event? This action cannot be reverted.")}
|
||||
${this.$t(
|
||||
"Are you sure you want to delete this event? This action cannot be reverted."
|
||||
)}
|
||||
<br><br>
|
||||
${this.$t('To confirm, type your event title "{eventTitle}"', {
|
||||
eventTitle: event.title,
|
||||
})}`,
|
||||
confirmText: this.$t("Delete {eventTitle}", { eventTitle: event.title }) as string,
|
||||
confirmText: this.$t("Delete {eventTitle}", {
|
||||
eventTitle: event.title,
|
||||
}) as string,
|
||||
inputAttrs: {
|
||||
placeholder: event.title,
|
||||
pattern: escapeRegExp(event.title),
|
||||
@@ -139,13 +162,19 @@ export default class EventMixin extends mixins(Vue) {
|
||||
this.$emit("event-deleted", event.id);
|
||||
|
||||
this.$buefy.notification.open({
|
||||
message: this.$t("Event {eventTitle} deleted", { eventTitle }) as string,
|
||||
message: this.$t("Event {eventTitle} deleted", {
|
||||
eventTitle,
|
||||
}) as string,
|
||||
type: "is-success",
|
||||
position: "is-bottom-right",
|
||||
duration: 5000,
|
||||
});
|
||||
} catch (error) {
|
||||
Snackbar.open({ message: error.message, type: "is-danger", position: "is-bottom" });
|
||||
Snackbar.open({
|
||||
message: error.message,
|
||||
type: "is-danger",
|
||||
position: "is-bottom",
|
||||
});
|
||||
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,10 @@ export default class GroupMixin extends Vue {
|
||||
}
|
||||
|
||||
get isCurrentActorAGroupModerator(): boolean {
|
||||
return this.hasCurrentActorThisRole([MemberRole.MODERATOR, MemberRole.ADMINISTRATOR]);
|
||||
return this.hasCurrentActorThisRole([
|
||||
MemberRole.MODERATOR,
|
||||
MemberRole.ADMINISTRATOR,
|
||||
]);
|
||||
}
|
||||
|
||||
hasCurrentActorThisRole(givenRole: string | string[]): boolean {
|
||||
@@ -69,7 +72,8 @@ export default class GroupMixin extends Vue {
|
||||
return (
|
||||
this.person &&
|
||||
this.person.memberships.elements.some(
|
||||
({ parent: { id }, role }) => id === this.group.id && roles.includes(role)
|
||||
({ parent: { id }, role }) =>
|
||||
id === this.group.id && roles.includes(role)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,10 +9,14 @@ export default class IdentityEditionMixin extends Mixins(Vue) {
|
||||
oldDisplayName: string | null = null;
|
||||
|
||||
autoUpdateUsername(newDisplayName: string | null): void {
|
||||
const oldUsername = IdentityEditionMixin.convertToUsername(this.oldDisplayName);
|
||||
const oldUsername = IdentityEditionMixin.convertToUsername(
|
||||
this.oldDisplayName
|
||||
);
|
||||
|
||||
if (this.identity.preferredUsername === oldUsername) {
|
||||
this.identity.preferredUsername = IdentityEditionMixin.convertToUsername(newDisplayName);
|
||||
this.identity.preferredUsername = IdentityEditionMixin.convertToUsername(
|
||||
newDisplayName
|
||||
);
|
||||
}
|
||||
|
||||
this.oldDisplayName = newDisplayName;
|
||||
|
||||
@@ -13,7 +13,9 @@ export default class Onboarding extends Vue {
|
||||
|
||||
RouteName = RouteName;
|
||||
|
||||
protected async doUpdateSetting(variables: Record<string, unknown>): Promise<void> {
|
||||
protected async doUpdateSetting(
|
||||
variables: Record<string, unknown>
|
||||
): Promise<void> {
|
||||
await this.$apollo.mutate<{ setUserSettings: string }>({
|
||||
mutation: SET_USER_SETTINGS,
|
||||
variables,
|
||||
|
||||
@@ -63,7 +63,10 @@ export default class RelayMixin extends Vue {
|
||||
relayFollowings: {
|
||||
__typename: previousResult.relayFollowings.__typename,
|
||||
total: previousResult.relayFollowings.total,
|
||||
elements: [...previousResult.relayFollowings.elements, ...newFollowings],
|
||||
elements: [
|
||||
...previousResult.relayFollowings.elements,
|
||||
...newFollowings,
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
@@ -88,7 +91,10 @@ export default class RelayMixin extends Vue {
|
||||
relayFollowers: {
|
||||
__typename: previousResult.relayFollowers.__typename,
|
||||
total: previousResult.relayFollowers.total,
|
||||
elements: [...previousResult.relayFollowers.elements, ...newFollowers],
|
||||
elements: [
|
||||
...previousResult.relayFollowers.elements,
|
||||
...newFollowers,
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
@@ -101,7 +107,8 @@ export default class RelayMixin extends Vue {
|
||||
static isInstance(actor: IActor): boolean {
|
||||
return (
|
||||
actor.type === ActorType.APPLICATION &&
|
||||
(actor.preferredUsername === "relay" || actor.preferredUsername === actor.domain)
|
||||
(actor.preferredUsername === "relay" ||
|
||||
actor.preferredUsername === actor.domain)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user