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
40 changed files with 203 additions and 16 deletions

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 = "";