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"),
"mobilizon-footer": Footer,
},
metaInfo() {
return {
titleTemplate: "%s | Mobilizon",
};
},
})
export default class App extends Vue {
config!: IConfig;

View File

@ -108,6 +108,15 @@ import RouteName from "../router/name";
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 {
config!: IConfig;

View File

@ -135,6 +135,15 @@ import langs from "../../i18n/langs.json";
components: {
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 {
config!: IConfig;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -263,6 +263,20 @@ import { ApolloCache, FetchResult, InMemoryCache } from "@apollo/client/core";
},
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) {
@Prop({ type: Boolean }) isUpdate!: boolean;

View File

@ -321,6 +321,14 @@ const MEMBERS_PER_PAGE = 3;
ActorCard,
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 {
@Prop({ required: true }) id!: string;

View File

@ -158,7 +158,6 @@ import RouteName from "../../router/name";
metaInfo() {
return {
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 {
RouteName = RouteName;

View File

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

View File

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

View File

@ -347,6 +347,11 @@ import RouteName from "../../router/name";
adminSettings: ADMIN_SETTINGS,
languages: LANGUAGES,
},
metaInfo() {
return {
title: this.$t("Settings") as string,
};
},
})
export default class Settings extends Vue {
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 {
USERS_PER_PAGE = USERS_PER_PAGE;

View File

@ -51,11 +51,7 @@ import RouteName from "../../router/name";
},
metaInfo() {
return {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
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
// @ts-ignore
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() {
return {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
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 { Component, Vue } from "vue-property-decorator";
@Component
@Component({
metaInfo() {
return {
title: this.$t("Error") as string,
};
},
})
export default class ErrorPage extends Vue {
code: ErrorCode | null = null;

View File

@ -526,7 +526,6 @@ const DEFAULT_LIMIT_NUMBER_OF_PLACES = 10;
title: (this.isUpdate
? this.$t("Event edition")
: 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
// @ts-ignore
title: this.eventTitle,
titleTemplate: "%s | Mobilizon",
meta: [
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore

View File

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

View File

@ -129,6 +129,16 @@ const EVENTS_PAGE_LIMIT = 10;
Subtitle,
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) {
group!: IGroup;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -196,6 +196,11 @@ import { ErrorResponse } from "@apollo/client/link/error";
apollo: {
config: CONFIG,
},
metaInfo() {
return {
title: this.$t("Group settings") as string,
};
},
})
export default class GroupSettings extends mixins(GroupMixin) {
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 {
interact!: IEvent | IGroup;

View File

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

View File

@ -274,6 +274,19 @@ import { ApolloCache, FetchResult, InMemoryCache } from "@apollo/client/core";
config: CONFIG,
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) {
@Prop({ required: true }) path!: string;
@ -345,6 +358,14 @@ export default class Resources extends Mixins(ResourceMixin) {
return [];
}
get isRoot(): boolean {
return this.actualPath === "/";
}
get lastFragment(): string | undefined {
return this.filteredPath.slice(-1)[0];
}
async createResource(): Promise<void> {
if (!this.resource.actor) return;
this.modalError = "";

View File

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

View File

@ -233,6 +233,11 @@ import { logout, SELECTED_PROVIDERS } from "../../utils/auth";
apollo: {
loggedUser: LOGGED_USER,
},
metaInfo() {
return {
title: this.$t("General settings") as string,
};
},
})
export default class AccountSettings extends Vue {
@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 {
loggedUser!: IUser;

View File

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