Fix missing metainfo on some views

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-05-25 16:21:29 +02:00
parent c07ae1c785
commit 6353c4f372
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
40 changed files with 203 additions and 16 deletions

View File

@ -63,6 +63,11 @@ import { ICurrentUser } from "./types/current-user.model";
import(/* webpackChunkName: "editor" */ "./components/Error.vue"), import(/* webpackChunkName: "editor" */ "./components/Error.vue"),
"mobilizon-footer": Footer, "mobilizon-footer": Footer,
}, },
metaInfo() {
return {
titleTemplate: "%s | Mobilizon",
};
},
}) })
export default class App extends Vue { export default class App extends Vue {
config!: IConfig; config!: IConfig;

View File

@ -108,6 +108,15 @@ import RouteName from "../router/name";
query: CONFIG, query: CONFIG,
}, },
}, },
metaInfo() {
return {
title: this.$t("About {instance}", {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
instance: this?.config?.name,
}) as string,
};
},
}) })
export default class About extends Vue { export default class About extends Vue {
config!: IConfig; config!: IConfig;

View File

@ -135,6 +135,15 @@ import langs from "../../i18n/langs.json";
components: { components: {
InstanceContactLink, InstanceContactLink,
}, },
metaInfo() {
return {
title: this.$t("About {instance}", {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
instance: this?.config?.name,
}) as string,
};
},
}) })
export default class AboutInstance extends Vue { export default class AboutInstance extends Vue {
config!: IConfig; config!: IConfig;

View File

@ -73,6 +73,11 @@ import { IConfig } from "../../types/config.model";
apollo: { apollo: {
config: ABOUT, config: ABOUT,
}, },
metaInfo() {
return {
title: this.$t("Glossary") as string,
};
},
}) })
export default class Glossary extends Vue { export default class Glossary extends Vue {
config!: IConfig; config!: IConfig;

View File

@ -29,6 +29,11 @@ import { InstancePrivacyType } from "@/types/enums";
}, },
}, },
}, },
metaInfo() {
return {
title: this.$t("Privacy Policy") as string,
};
},
}) })
export default class Privacy extends Vue { export default class Privacy extends Vue {
config!: IConfig; config!: IConfig;

View File

@ -18,6 +18,11 @@ import RouteName from "../../router/name";
query: RULES, query: RULES,
}, },
}, },
metaInfo() {
return {
title: this.$t("Rules") as string,
};
},
}) })
export default class Rules extends Vue { export default class Rules extends Vue {
config!: IConfig; config!: IConfig;

View File

@ -25,6 +25,11 @@ import { InstanceTermsType } from "@/types/enums";
}, },
}, },
}, },
metaInfo() {
return {
title: this.$t("Terms") as string,
};
},
}) })
export default class Terms extends Vue { export default class Terms extends Vue {
config!: IConfig; config!: IConfig;

View File

@ -47,6 +47,11 @@ import { IDENTITIES } from "@/graphql/actor";
query: IDENTITIES, query: IDENTITIES,
}, },
}, },
metaInfo() {
return {
title: this.$t("Identities") as string,
};
},
}) })
export default class IdentityPicker extends Vue { export default class IdentityPicker extends Vue {
@Prop() value!: IActor; @Prop() value!: IActor;

View File

@ -124,6 +124,11 @@ import { CREATE_FEED_TOKEN_ACTOR } from "../../graphql/feed_tokens";
components: { components: {
EventCard, EventCard,
}, },
metaInfo() {
return {
title: this.$t("Profile") as string,
};
},
}) })
export default class Profile extends Vue { export default class Profile extends Vue {
@Prop({ type: String, required: true }) name!: string; @Prop({ type: String, required: true }) name!: string;

View File

@ -134,6 +134,11 @@ import { ApolloCache, FetchResult, InMemoryCache } from "@apollo/client/core";
apollo: { apollo: {
config: CONFIG, config: CONFIG,
}, },
metaInfo() {
return {
title: this.$t("Register") as string,
};
},
}) })
export default class Register extends mixins(identityEditionMixin) { export default class Register extends mixins(identityEditionMixin) {
@Prop({ type: String, required: true }) email!: string; @Prop({ type: String, required: true }) email!: string;

View File

@ -263,6 +263,20 @@ import { ApolloCache, FetchResult, InMemoryCache } from "@apollo/client/core";
}, },
config: CONFIG, config: CONFIG,
}, },
metaInfo() {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const { isUpdate, identityName } = this;
let title = this.$t("Create a new profile") as string;
if (isUpdate) {
title = this.$t("Edit profile {profile}", {
profile: identityName,
}) as string;
}
return {
title,
};
},
}) })
export default class EditIdentity extends mixins(identityEditionMixin) { export default class EditIdentity extends mixins(identityEditionMixin) {
@Prop({ type: Boolean }) isUpdate!: boolean; @Prop({ type: Boolean }) isUpdate!: boolean;

View File

@ -321,6 +321,14 @@ const MEMBERS_PER_PAGE = 3;
ActorCard, ActorCard,
EmptyContent, EmptyContent,
}, },
metaInfo() {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const { group } = this;
return {
title: group ? group.name || usernameWithDomain(group) : "",
};
},
}) })
export default class AdminGroupProfile extends Vue { export default class AdminGroupProfile extends Vue {
@Prop({ required: true }) id!: string; @Prop({ required: true }) id!: string;

View File

@ -158,7 +158,6 @@ import RouteName from "../../router/name";
metaInfo() { metaInfo() {
return { return {
title: this.$t("Administration") as string, title: this.$t("Administration") as string,
titleTemplate: "%s | Mobilizon",
}; };
}, },
}) })

View File

@ -87,6 +87,11 @@ import RouteName from "../../router/name";
}, },
}, },
}, },
metaInfo() {
return {
title: this.$t("Follows") as string,
};
},
}) })
export default class Follows extends Vue { export default class Follows extends Vue {
RouteName = RouteName; RouteName = RouteName;

View File

@ -122,6 +122,11 @@ const PROFILES_PER_PAGE = 10;
}, },
}, },
}, },
metaInfo() {
return {
title: this.$t("Groups") as string,
};
},
components: { components: {
EmptyContent, EmptyContent,
}, },

View File

@ -126,6 +126,11 @@ const PROFILES_PER_PAGE = 10;
components: { components: {
EmptyContent, EmptyContent,
}, },
metaInfo() {
return {
title: this.$t("Profiles") as string,
};
},
}) })
export default class Profiles extends Vue { export default class Profiles extends Vue {
PROFILES_PER_PAGE = PROFILES_PER_PAGE; PROFILES_PER_PAGE = PROFILES_PER_PAGE;

View File

@ -347,6 +347,11 @@ import RouteName from "../../router/name";
adminSettings: ADMIN_SETTINGS, adminSettings: ADMIN_SETTINGS,
languages: LANGUAGES, languages: LANGUAGES,
}, },
metaInfo() {
return {
title: this.$t("Settings") as string,
};
},
}) })
export default class Settings extends Vue { export default class Settings extends Vue {
adminSettings!: IAdminSettings; adminSettings!: IAdminSettings;

View File

@ -132,6 +132,11 @@ const USERS_PER_PAGE = 10;
}, },
}, },
}, },
metaInfo() {
return {
title: this.$t("Users") as string,
};
},
}) })
export default class Users extends Vue { export default class Users extends Vue {
USERS_PER_PAGE = USERS_PER_PAGE; USERS_PER_PAGE = USERS_PER_PAGE;

View File

@ -51,11 +51,7 @@ import RouteName from "../../router/name";
}, },
metaInfo() { metaInfo() {
return { return {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
title: this.$t("Create a discussion") as string, title: this.$t("Create a discussion") as string,
// all titles will be injected into this template
titleTemplate: "%s | Mobilizon",
}; };
}, },
}) })

View File

@ -216,8 +216,6 @@ import { ApolloCache, FetchResult, InMemoryCache } from "@apollo/client/core";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore
title: this.discussion.title, title: this.discussion.title,
// all titles will be injected into this template
titleTemplate: "%s | Mobilizon",
}; };
}, },
}) })

View File

@ -150,11 +150,7 @@ const DISCUSSIONS_PER_PAGE = 10;
}, },
metaInfo() { metaInfo() {
return { return {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
title: this.$t("Discussions") as string, title: this.$t("Discussions") as string,
// all titles will be injected into this template
titleTemplate: "%s | Mobilizon",
}; };
}, },
}) })

View File

@ -14,7 +14,13 @@
import { ErrorCode } from "@/types/enums"; import { ErrorCode } from "@/types/enums";
import { Component, Vue } from "vue-property-decorator"; import { Component, Vue } from "vue-property-decorator";
@Component @Component({
metaInfo() {
return {
title: this.$t("Error") as string,
};
},
})
export default class ErrorPage extends Vue { export default class ErrorPage extends Vue {
code: ErrorCode | null = null; code: ErrorCode | null = null;

View File

@ -526,7 +526,6 @@ const DEFAULT_LIMIT_NUMBER_OF_PLACES = 10;
title: (this.isUpdate title: (this.isUpdate
? this.$t("Event edition") ? this.$t("Event edition")
: this.$t("Event creation")) as string, : this.$t("Event creation")) as string,
titleTemplate: "%s | Mobilizon",
}; };
}, },
}) })

View File

@ -744,7 +744,6 @@ import { ApolloCache, FetchResult, InMemoryCache } from "@apollo/client/core";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore
title: this.eventTitle, title: this.eventTitle,
titleTemplate: "%s | Mobilizon",
meta: [ meta: [
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore

View File

@ -28,6 +28,11 @@ import { IEvent } from "../../types/event.model";
components: { components: {
EventCard, EventCard,
}, },
metaInfo() {
return {
title: this.$t("Event list") as string,
};
},
}) })
export default class EventList extends Vue { export default class EventList extends Vue {
@Prop(String) location!: string; @Prop(String) location!: string;

View File

@ -129,6 +129,16 @@ const EVENTS_PAGE_LIMIT = 10;
Subtitle, Subtitle,
EventListViewCard, EventListViewCard,
}, },
metaInfo() {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const { group } = this;
return {
title: this.$t("{group} events", {
group: group.name || usernameWithDomain(group),
}) as string,
};
},
}) })
export default class GroupEvents extends mixins(GroupMixin) { export default class GroupEvents extends mixins(GroupMixin) {
group!: IGroup; group!: IGroup;

View File

@ -187,7 +187,6 @@ import Subtitle from "../../components/Utils/Subtitle.vue";
metaInfo() { metaInfo() {
return { return {
title: this.$t("My events") as string, title: this.$t("My events") as string,
titleTemplate: "%s | Mobilizon",
}; };
}, },
}) })

View File

@ -261,6 +261,11 @@ const MESSAGE_ELLIPSIS_LENGTH = 130;
ellipsize: (text?: string) => ellipsize: (text?: string) =>
text && text.substr(0, MESSAGE_ELLIPSIS_LENGTH).concat("…"), text && text.substr(0, MESSAGE_ELLIPSIS_LENGTH).concat("…"),
}, },
metaInfo() {
return {
title: this.$t("Participants") as string,
};
},
}) })
export default class Participants extends Vue { export default class Participants extends Vue {
@Prop({ required: true }) eventId!: string; @Prop({ required: true }) eventId!: string;

View File

@ -108,6 +108,11 @@ import { ApolloCache, FetchResult, InMemoryCache } from "@apollo/client/core";
}, },
config: CONFIG, config: CONFIG,
}, },
metaInfo() {
return {
title: this.$t("Create a new group") as string,
};
},
}) })
export default class CreateGroup extends mixins(IdentityEditionMixin) { export default class CreateGroup extends mixins(IdentityEditionMixin) {
currentActor!: IPerson; currentActor!: IPerson;

View File

@ -571,7 +571,6 @@ import { PERSON_MEMBERSHIP_GROUP } from "@/graphql/actor";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore
title: this.groupTitle, title: this.groupTitle,
titleTemplate: "%s | Mobilizon",
meta: [ meta: [
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore

View File

@ -160,6 +160,11 @@ import { Paginate } from "@/types/paginate";
components: { components: {
EmptyContent, EmptyContent,
}, },
metaInfo() {
return {
title: this.$t("Group Followers") as string,
};
},
}) })
export default class GroupFollowers extends mixins(GroupMixin) { export default class GroupFollowers extends mixins(GroupMixin) {
loading = true; loading = true;

View File

@ -265,6 +265,11 @@ import EmptyContent from "@/components/Utils/EmptyContent.vue";
components: { components: {
EmptyContent, EmptyContent,
}, },
metaInfo() {
return {
title: this.$t("Group Members") as string,
};
},
}) })
export default class GroupMembers extends mixins(GroupMixin) { export default class GroupMembers extends mixins(GroupMixin) {
loading = true; loading = true;

View File

@ -196,6 +196,11 @@ import { ErrorResponse } from "@apollo/client/link/error";
apollo: { apollo: {
config: CONFIG, config: CONFIG,
}, },
metaInfo() {
return {
title: this.$t("Group settings") as string,
};
},
}) })
export default class GroupSettings extends mixins(GroupMixin) { export default class GroupSettings extends mixins(GroupMixin) {
loading = true; loading = true;

View File

@ -83,6 +83,11 @@ import { GraphQLError } from "graphql";
}, },
}, },
}, },
metaInfo() {
return {
title: this.$t("Interact with a remote content") as string,
};
},
}) })
export default class Interact extends Vue { export default class Interact extends Vue {
interact!: IEvent | IGroup; interact!: IEvent | IGroup;

View File

@ -67,6 +67,11 @@ import RouteName from "../router/name";
components: { components: {
BField, BField,
}, },
metaInfo() {
return {
title: this.$t("Page not found") as string,
};
},
}) })
export default class PageNotFound extends Vue { export default class PageNotFound extends Vue {
searchText = ""; searchText = "";

View File

@ -274,6 +274,19 @@ import { ApolloCache, FetchResult, InMemoryCache } from "@apollo/client/core";
config: CONFIG, config: CONFIG,
currentActor: CURRENT_ACTOR_CLIENT, currentActor: CURRENT_ACTOR_CLIENT,
}, },
metaInfo() {
return {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
title: this.isRoot
? (this.$t("Resources") as string)
: (this.$t("{folder} - Resources", {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
folder: this.lastFragment,
}) as string),
};
},
}) })
export default class Resources extends Mixins(ResourceMixin) { export default class Resources extends Mixins(ResourceMixin) {
@Prop({ required: true }) path!: string; @Prop({ required: true }) path!: string;
@ -345,6 +358,14 @@ export default class Resources extends Mixins(ResourceMixin) {
return []; return [];
} }
get isRoot(): boolean {
return this.actualPath === "/";
}
get lastFragment(): string | undefined {
return this.filteredPath.slice(-1)[0];
}
async createResource(): Promise<void> { async createResource(): Promise<void> {
if (!this.resource.actor) return; if (!this.resource.actor) return;
this.modalError = ""; this.modalError = "";

View File

@ -28,6 +28,11 @@ import { ICurrentUser } from "../types/current-user.model";
}, },
currentUser: CURRENT_USER_CLIENT, currentUser: CURRENT_USER_CLIENT,
}, },
metaInfo() {
return {
title: this.$t("Settings") as string,
};
},
}) })
export default class Settings extends Vue { export default class Settings extends Vue {
RouteName = RouteName; RouteName = RouteName;

View File

@ -233,6 +233,11 @@ import { logout, SELECTED_PROVIDERS } from "../../utils/auth";
apollo: { apollo: {
loggedUser: LOGGED_USER, loggedUser: LOGGED_USER,
}, },
metaInfo() {
return {
title: this.$t("General settings") as string,
};
},
}) })
export default class AccountSettings extends Vue { export default class AccountSettings extends Vue {
@Ref("passwordForm") readonly passwordForm!: HTMLElement; @Ref("passwordForm") readonly passwordForm!: HTMLElement;

View File

@ -235,6 +235,11 @@ import {
), ),
}, },
}, },
metaInfo() {
return {
title: this.$t("Notifications") as string,
};
},
}) })
export default class Notifications extends Vue { export default class Notifications extends Vue {
loggedUser!: IUser; loggedUser!: IUser;

View File

@ -123,6 +123,11 @@ import { Address, IAddress } from "@/types/address.model";
components: { components: {
AddressAutoComplete, AddressAutoComplete,
}, },
metaInfo() {
return {
title: this.$t("Preferences") as string,
};
},
}) })
export default class Preferences extends Vue { export default class Preferences extends Vue {
config!: IConfig; config!: IConfig;