From f8e73ca9905c3ec1b001e86f1ebaeda0426914b0 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 16 Jun 2021 11:25:53 +0200 Subject: [PATCH] Various group-related improvements Signed-off-by: Thomas Citharel --- .../Discussion/DiscussionListItem.vue | 7 +- js/src/components/Post/PostListItem.vue | 7 +- js/src/i18n/en_US.json | 2 +- js/src/i18n/fr_FR.json | 2 +- js/src/mixins/group.ts | 16 +- js/src/types/actor/actor.model.ts | 3 +- js/src/views/Group/Group.vue | 246 ++++++++++++------ js/src/views/Group/GroupSettings.vue | 20 +- js/src/views/Posts/List.vue | 6 +- 9 files changed, 197 insertions(+), 112 deletions(-) diff --git a/js/src/components/Discussion/DiscussionListItem.vue b/js/src/components/Discussion/DiscussionListItem.vue index 8edd0559..c8efe750 100644 --- a/js/src/components/Discussion/DiscussionListItem.vue +++ b/js/src/components/Discussion/DiscussionListItem.vue @@ -98,10 +98,9 @@ export default class DiscussionListItem extends Vue { .discussion-minimalist-title { color: #3c376e; - font-family: "Liberation Sans", "Helvetica Neue", Roboto, Helvetica, - Arial, serif; - font-size: 1.25rem; - font-weight: 700; + font-family: Roboto, Helvetica, Arial, serif; + font-size: 16px; + font-weight: 500; flex: 1; } } diff --git a/js/src/components/Post/PostListItem.vue b/js/src/components/Post/PostListItem.vue index 76cd1c3d..daa1024a 100644 --- a/js/src/components/Post/PostListItem.vue +++ b/js/src/components/Post/PostListItem.vue @@ -43,10 +43,9 @@ export default class PostListItem extends Vue { .post-minimalist-title { color: #3c376e; - font-family: "Liberation Sans", "Helvetica Neue", Roboto, Helvetica, Arial, - serif; - font-size: 1rem; - font-weight: 700; + font-family: Roboto, Helvetica, Arial, serif; + font-size: 16px; + font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index b0d59b1b..3cf0514d 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -1046,6 +1046,6 @@ "Move resource to the root folder": "Move resource to the root folder", "Share this group": "Share this group", "This group is accessible only through it's link. Be careful where you post this link.": "This group is accessible only through it's link. Be careful where you post this link.", - "{count} members": "{count} members", + "{count} members": "No members|One member|{count} members", "Share": "Share" } diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index 72989cfb..2215a30c 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -1137,6 +1137,6 @@ "Move resource to the root folder": "Déplacer la resource dans le dossier racine", "Share this group": "Partager ce groupe", "This group is accessible only through it's link. Be careful where you post this link.": "Ce groupe est accessible uniquement à travers son lien. Faites attention où vous le diffusez.", - "{count} members": "{count} membres", + "{count} members": "Aucun membre|Un⋅e membre|{count} membres", "Share": "Partager" } diff --git a/js/src/mixins/group.ts b/js/src/mixins/group.ts index c6e9f602..b287fbd8 100644 --- a/js/src/mixins/group.ts +++ b/js/src/mixins/group.ts @@ -5,13 +5,7 @@ import { } from "@/graphql/actor"; import { FETCH_GROUP } from "@/graphql/group"; import RouteName from "@/router/name"; -import { - Group, - IActor, - IGroup, - IPerson, - usernameWithDomain, -} from "@/types/actor"; +import { IActor, IGroup, IPerson, usernameWithDomain } from "@/types/actor"; import { MemberRole } from "@/types/enums"; import { Component, Vue } from "vue-property-decorator"; @@ -50,14 +44,14 @@ const now = new Date(); variables() { return { actorId: this.currentActor.id, - group: this.group.preferredUsername, + group: this.group?.preferredUsername, }; }, skip() { return ( !this.currentActor || !this.currentActor.id || - !this.group.preferredUsername + !this.group?.preferredUsername ); }, }, @@ -65,7 +59,7 @@ const now = new Date(); return ( !this.currentActor || !this.currentActor.id || - !this.group.preferredUsername + !this.group?.preferredUsername ); }, }, @@ -73,7 +67,7 @@ const now = new Date(); }, }) export default class GroupMixin extends Vue { - group: IGroup = new Group(); + group!: IGroup; currentActor!: IActor; diff --git a/js/src/types/actor/actor.model.ts b/js/src/types/actor/actor.model.ts index df1ed3ca..9b732a90 100644 --- a/js/src/types/actor/actor.model.ts +++ b/js/src/types/actor/actor.model.ts @@ -57,7 +57,8 @@ export class Actor implements IActor { } export function usernameWithDomain(actor: IActor, force = false): string { - if (actor.domain) { + if (!actor) return ""; + if (actor?.domain) { return `${actor.preferredUsername}@${actor.domain}`; } if (force) { diff --git a/js/src/views/Group/Group.vue b/js/src/views/Group/Group.vue index 1e1d416a..9d7e8286 100644 --- a/js/src/views/Group/Group.vue +++ b/js/src/views/Group/Group.vue @@ -10,7 +10,7 @@
  • +
    @@ -65,7 +65,10 @@
    -
    +
    @@ -300,9 +355,9 @@ :discussion="discussion" />
    -
    -

    {{ $t("No discussions yet") }}

    -
    + + {{ $t("No discussions yet") }} +