build: switch from yarn to npm to manage js dependencies and move js contents to root
yarn v1 is being deprecated and starts to have some issues Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
50
src/components/Group/Sections/DiscussionsSection.vue
Normal file
50
src/components/Group/Sections/DiscussionsSection.vue
Normal file
@@ -0,0 +1,50 @@
|
||||
<template>
|
||||
<group-section
|
||||
:title="t('Discussions')"
|
||||
icon="chat"
|
||||
:route="{
|
||||
name: RouteName.DISCUSSION_LIST,
|
||||
params: { preferredUsername: usernameWithDomain(group) },
|
||||
}"
|
||||
>
|
||||
<template #default>
|
||||
<div v-if="group?.discussions?.total ?? 0 > 0">
|
||||
<discussion-list-item
|
||||
v-for="discussion in group?.discussions?.elements ?? []"
|
||||
:key="discussion.id"
|
||||
:discussion="discussion"
|
||||
/>
|
||||
</div>
|
||||
<empty-content v-else icon="chat" :inline="true">
|
||||
{{ t("No discussions yet") }}
|
||||
</empty-content>
|
||||
</template>
|
||||
<template #create>
|
||||
<o-button
|
||||
tag="router-link"
|
||||
:to="{
|
||||
name: RouteName.CREATE_DISCUSSION,
|
||||
params: { preferredUsername: usernameWithDomain(group) },
|
||||
}"
|
||||
class="button is-primary"
|
||||
>{{ t("+ Start a discussion") }}</o-button
|
||||
>
|
||||
</template>
|
||||
</group-section>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import RouteName from "@/router/name";
|
||||
import { IGroup } from "@/types/actor/group.model";
|
||||
import { usernameWithDomain } from "@/types/actor";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import EmptyContent from "@/components/Utils/EmptyContent.vue";
|
||||
import DiscussionListItem from "@/components/Discussion/DiscussionListItem.vue";
|
||||
import GroupSection from "@/components/Group/GroupSection.vue";
|
||||
|
||||
const { t } = useI18n({ useScope: "global" });
|
||||
|
||||
defineProps<{
|
||||
group: Pick<IGroup, "preferredUsername" | "domain" | "discussions">;
|
||||
}>();
|
||||
</script>
|
||||
54
src/components/Group/Sections/EventsSection.vue
Normal file
54
src/components/Group/Sections/EventsSection.vue
Normal file
@@ -0,0 +1,54 @@
|
||||
<template>
|
||||
<group-section
|
||||
:title="t('Events')"
|
||||
icon="calendar"
|
||||
:privateSection="false"
|
||||
:route="{
|
||||
name: RouteName.GROUP_EVENTS,
|
||||
params: { preferredUsername: usernameWithDomain(group) },
|
||||
}"
|
||||
>
|
||||
<template #default>
|
||||
<div
|
||||
class="flex flex-wrap gap-2 py-1"
|
||||
v-if="group && group.organizedEvents.total > 0"
|
||||
>
|
||||
<event-minimalist-card
|
||||
v-for="event in group.organizedEvents.elements.slice(0, 3)"
|
||||
:event="event"
|
||||
:key="event.uuid"
|
||||
/>
|
||||
</div>
|
||||
<empty-content v-else-if="group" icon="calendar" :inline="true">
|
||||
{{ t("No public upcoming events") }}
|
||||
</empty-content>
|
||||
<!-- <o-skeleton animated v-else></o-skeleton> -->
|
||||
</template>
|
||||
<template #create>
|
||||
<o-button
|
||||
tag="router-link"
|
||||
v-if="isModerator"
|
||||
:to="{
|
||||
name: RouteName.CREATE_EVENT,
|
||||
query: { actorId: group?.id },
|
||||
}"
|
||||
class="button is-primary"
|
||||
>{{ t("+ Create an event") }}</o-button
|
||||
>
|
||||
</template>
|
||||
</group-section>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import RouteName from "@/router/name";
|
||||
import { IGroup } from "@/types/actor/group.model";
|
||||
import { usernameWithDomain } from "@/types/actor";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import EmptyContent from "@/components/Utils/EmptyContent.vue";
|
||||
import EventMinimalistCard from "@/components/Event/EventMinimalistCard.vue";
|
||||
import GroupSection from "@/components/Group/GroupSection.vue";
|
||||
|
||||
const { t } = useI18n({ useScope: "global" });
|
||||
|
||||
defineProps<{ group: IGroup; isModerator: boolean }>();
|
||||
</script>
|
||||
50
src/components/Group/Sections/PostsSection.vue
Normal file
50
src/components/Group/Sections/PostsSection.vue
Normal file
@@ -0,0 +1,50 @@
|
||||
<template>
|
||||
<group-section
|
||||
:title="t('Announcements')"
|
||||
icon="bullhorn"
|
||||
:privateSection="false"
|
||||
:route="{
|
||||
name: RouteName.POSTS,
|
||||
params: { preferredUsername: usernameWithDomain(group) },
|
||||
}"
|
||||
>
|
||||
<template #default>
|
||||
<div class="p-1">
|
||||
<multi-post-list-item
|
||||
v-if="group?.posts?.total ?? 0 > 0"
|
||||
:posts="(group?.posts?.elements ?? []).slice(0, 3)"
|
||||
:isCurrentActorMember="isMember"
|
||||
/>
|
||||
<empty-content v-else-if="group" icon="bullhorn" :inline="true">
|
||||
{{ t("No posts yet") }}
|
||||
</empty-content>
|
||||
</div>
|
||||
</template>
|
||||
<template #create>
|
||||
<o-button
|
||||
tag="router-link"
|
||||
v-if="isModerator"
|
||||
:to="{
|
||||
name: RouteName.POST_CREATE,
|
||||
params: { preferredUsername: usernameWithDomain(group) },
|
||||
}"
|
||||
class="button is-primary"
|
||||
>{{ t("+ Create a post") }}</o-button
|
||||
>
|
||||
</template>
|
||||
</group-section>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import RouteName from "@/router/name";
|
||||
import { IGroup } from "@/types/actor/group.model";
|
||||
import { usernameWithDomain } from "@/types/actor";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import EmptyContent from "@/components/Utils/EmptyContent.vue";
|
||||
import MultiPostListItem from "@/components/Post/MultiPostListItem.vue";
|
||||
import GroupSection from "@/components/Group/GroupSection.vue";
|
||||
|
||||
const { t } = useI18n({ useScope: "global" });
|
||||
|
||||
defineProps<{ group: IGroup; isModerator: boolean; isMember: boolean }>();
|
||||
</script>
|
||||
65
src/components/Group/Sections/ResourcesSection.vue
Normal file
65
src/components/Group/Sections/ResourcesSection.vue
Normal file
@@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<group-section
|
||||
:title="t('Resources')"
|
||||
icon="link"
|
||||
:route="{
|
||||
name: RouteName.RESOURCE_FOLDER_ROOT,
|
||||
params: { preferredUsername: usernameWithDomain(group) },
|
||||
}"
|
||||
>
|
||||
<template #default>
|
||||
<div
|
||||
v-if="group?.resources?.elements?.length ?? 0 > 0"
|
||||
class="p-1 bg-white dark:bg-transparent"
|
||||
>
|
||||
<div
|
||||
v-for="resource in group?.resources?.elements ?? []"
|
||||
:key="resource.id"
|
||||
>
|
||||
<resource-item
|
||||
:resource="resource"
|
||||
v-if="resource.type !== 'folder'"
|
||||
:inline="true"
|
||||
/>
|
||||
<folder-item
|
||||
:resource="resource"
|
||||
:group="group"
|
||||
v-else-if="group"
|
||||
:inline="true"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<empty-content v-else icon="link" :inline="true">
|
||||
{{ t("No resources yet") }}
|
||||
</empty-content>
|
||||
</template>
|
||||
<template #create>
|
||||
<o-button
|
||||
tag="router-link"
|
||||
:to="{
|
||||
name: RouteName.RESOURCE_FOLDER_ROOT,
|
||||
params: { preferredUsername: usernameWithDomain(group) },
|
||||
}"
|
||||
class="button is-primary"
|
||||
>{{ t("+ Add a resource") }}</o-button
|
||||
>
|
||||
</template>
|
||||
</group-section>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import RouteName from "@/router/name";
|
||||
import { IGroup } from "@/types/actor/group.model";
|
||||
import { usernameWithDomain } from "@/types/actor";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import EmptyContent from "@/components/Utils/EmptyContent.vue";
|
||||
import ResourceItem from "@/components/Resource/ResourceItem.vue";
|
||||
import FolderItem from "@/components/Resource/FolderItem.vue";
|
||||
import GroupSection from "@/components/Group/GroupSection.vue";
|
||||
|
||||
const { t } = useI18n({ useScope: "global" });
|
||||
|
||||
defineProps<{
|
||||
group: Pick<IGroup, "preferredUsername" | "domain" | "resources">;
|
||||
}>();
|
||||
</script>
|
||||
Reference in New Issue
Block a user