Introduce the group activity section

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-02-24 19:06:48 +01:00
parent d0567f783d
commit 3fe64a4389
70 changed files with 3224 additions and 70 deletions

31
js/src/mixins/activity.ts Normal file
View File

@@ -0,0 +1,31 @@
import { CURRENT_ACTOR_CLIENT } from "@/graphql/actor";
import { IActivity } from "@/types/activity.model";
import { IActor } from "@/types/actor";
import { Component, Prop, Vue } from "vue-property-decorator";
@Component({
apollo: {
currentActor: CURRENT_ACTOR_CLIENT,
},
})
export default class ActivityMixin extends Vue {
@Prop({ required: true, type: Object }) activity!: IActivity;
currentActor!: IActor;
get subjectParams(): Record<string, string> {
return this.activity.subjectParams.reduce(
(acc: Record<string, string>, { key, value }) => {
acc[key] = value;
return acc;
},
{}
);
}
get isAuthorCurrentActor(): boolean {
return (
this.activity.author.id === this.currentActor.id &&
this.currentActor.id !== undefined
);
}
}