2022-07-12 10:55:28 +02:00
|
|
|
<template>
|
|
|
|
<Story :setup-app="setupApp">
|
|
|
|
<Variant title="Basic">
|
|
|
|
<Comment
|
|
|
|
:comment="comment"
|
|
|
|
:event="event"
|
|
|
|
:currentActor="baseActor"
|
|
|
|
@create-comment="hstEvent('Create comment', $event)"
|
|
|
|
@delete-comment="hstEvent('Delete comment', $event)"
|
|
|
|
@report-comment="hstEvent('Report comment', $event)"
|
|
|
|
/>
|
|
|
|
</Variant>
|
|
|
|
<Variant title="Announcement">
|
|
|
|
<Comment
|
|
|
|
:comment="{ ...comment, isAnnouncement: true }"
|
|
|
|
:event="event"
|
|
|
|
:currentActor="baseActor"
|
|
|
|
@create-comment="hstEvent('Create comment', $event)"
|
|
|
|
@delete-comment="hstEvent('Delete comment', $event)"
|
|
|
|
@report-comment="hstEvent('Report comment', $event)"
|
|
|
|
/>
|
|
|
|
</Variant>
|
|
|
|
</Story>
|
|
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
2022-08-26 16:08:58 +02:00
|
|
|
import { IPerson } from "@/types/actor";
|
2022-07-12 10:55:28 +02:00
|
|
|
import { IComment } from "@/types/comment.model";
|
|
|
|
import {
|
|
|
|
ActorType,
|
|
|
|
CommentModeration,
|
|
|
|
EventJoinOptions,
|
|
|
|
EventStatus,
|
|
|
|
EventVisibility,
|
|
|
|
} from "@/types/enums";
|
|
|
|
import { IEvent } from "@/types/event.model";
|
|
|
|
import { reactive } from "vue";
|
2022-08-26 16:08:58 +02:00
|
|
|
import Comment from "./EventComment.vue";
|
2022-07-12 10:55:28 +02:00
|
|
|
import FloatingVue from "floating-vue";
|
|
|
|
import "floating-vue/dist/style.css";
|
|
|
|
import { hstEvent } from "histoire/client";
|
|
|
|
|
|
|
|
function setupApp({ app }) {
|
|
|
|
app.use(FloatingVue);
|
|
|
|
}
|
|
|
|
|
|
|
|
const baseActorAvatar = {
|
|
|
|
id: "",
|
|
|
|
name: "",
|
|
|
|
alt: "",
|
|
|
|
metadata: {},
|
|
|
|
url: "https://social.tcit.fr/system/accounts/avatars/000/000/001/original/a28c50ce5f2b13fd.jpg",
|
|
|
|
};
|
|
|
|
|
2022-08-26 16:08:58 +02:00
|
|
|
const baseActor: IPerson = {
|
2022-07-12 10:55:28 +02:00
|
|
|
name: "Thomas Citharel",
|
|
|
|
preferredUsername: "tcit",
|
|
|
|
avatar: baseActorAvatar,
|
|
|
|
domain: null,
|
|
|
|
url: "",
|
|
|
|
summary: "",
|
|
|
|
suspended: false,
|
|
|
|
type: ActorType.PERSON,
|
|
|
|
id: "598",
|
|
|
|
};
|
|
|
|
|
|
|
|
const baseEvent: IEvent = {
|
|
|
|
uuid: "",
|
|
|
|
title: "A very interesting event",
|
|
|
|
description: "Things happen",
|
2022-08-26 16:08:58 +02:00
|
|
|
beginsOn: new Date().toISOString(),
|
|
|
|
endsOn: new Date().toISOString(),
|
2022-07-12 10:55:28 +02:00
|
|
|
physicalAddress: {
|
|
|
|
description: "Somewhere",
|
|
|
|
street: "",
|
|
|
|
locality: "",
|
|
|
|
region: "",
|
|
|
|
country: "",
|
|
|
|
type: "",
|
|
|
|
postalCode: "",
|
|
|
|
},
|
|
|
|
picture: {
|
|
|
|
id: "",
|
|
|
|
name: "",
|
|
|
|
alt: "",
|
|
|
|
metadata: {},
|
|
|
|
url: "https://mobilizon.fr/media/81d9c76aaf740f84eefb28cf2b9988bdd2495ab1f3246159fd688e242155cb23.png?name=Screenshot_20220315_171848.png",
|
|
|
|
},
|
|
|
|
url: "",
|
|
|
|
local: true,
|
|
|
|
slug: "",
|
2022-08-26 16:08:58 +02:00
|
|
|
publishAt: new Date().toISOString(),
|
2022-07-12 10:55:28 +02:00
|
|
|
status: EventStatus.CONFIRMED,
|
|
|
|
visibility: EventVisibility.PUBLIC,
|
|
|
|
joinOptions: EventJoinOptions.FREE,
|
|
|
|
draft: false,
|
|
|
|
participantStats: {
|
|
|
|
notApproved: 0,
|
|
|
|
notConfirmed: 0,
|
|
|
|
rejected: 0,
|
|
|
|
participant: 0,
|
|
|
|
creator: 0,
|
|
|
|
moderator: 0,
|
|
|
|
administrator: 0,
|
|
|
|
going: 0,
|
|
|
|
},
|
|
|
|
participants: { total: 0, elements: [] },
|
|
|
|
relatedEvents: [],
|
|
|
|
tags: [{ slug: "something", title: "Something" }],
|
|
|
|
attributedTo: undefined,
|
|
|
|
organizerActor: {
|
|
|
|
...baseActor,
|
|
|
|
name: "Hello",
|
|
|
|
avatar: {
|
|
|
|
...baseActorAvatar,
|
|
|
|
url: "https://mobilizon.fr/media/653c2dcbb830636e0db975798163b85e038dfb7713e866e96d36bd411e105e3c.png?name=festivalsanantes%27s%20avatar.png",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
comments: [],
|
|
|
|
options: {
|
|
|
|
maximumAttendeeCapacity: 0,
|
|
|
|
remainingAttendeeCapacity: 0,
|
|
|
|
showRemainingAttendeeCapacity: false,
|
|
|
|
anonymousParticipation: false,
|
|
|
|
hideOrganizerWhenGroupEvent: false,
|
|
|
|
offers: [],
|
|
|
|
participationConditions: [],
|
|
|
|
attendees: [],
|
|
|
|
program: "",
|
|
|
|
commentModeration: CommentModeration.ALLOW_ALL,
|
|
|
|
showParticipationPrice: false,
|
|
|
|
showStartTime: false,
|
|
|
|
showEndTime: false,
|
|
|
|
timezone: null,
|
|
|
|
isOnline: false,
|
|
|
|
},
|
|
|
|
metadata: [],
|
|
|
|
contacts: [],
|
|
|
|
language: "en",
|
|
|
|
category: "hello",
|
|
|
|
};
|
|
|
|
|
|
|
|
const event = reactive<IEvent>(baseEvent);
|
|
|
|
|
|
|
|
const comment = reactive<IComment>({
|
|
|
|
text: "hello",
|
|
|
|
local: true,
|
|
|
|
actor: baseActor,
|
|
|
|
totalReplies: 5,
|
|
|
|
replies: [
|
|
|
|
{
|
|
|
|
text: "a reply!",
|
|
|
|
id: "90",
|
|
|
|
actor: baseActor,
|
2022-08-26 16:08:58 +02:00
|
|
|
updatedAt: new Date().toISOString(),
|
2022-07-12 10:55:28 +02:00
|
|
|
url: "http://somewhere.tld",
|
|
|
|
replies: [],
|
|
|
|
totalReplies: 0,
|
|
|
|
isAnnouncement: false,
|
|
|
|
local: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: "a reply to another reply!",
|
|
|
|
id: "92",
|
|
|
|
actor: baseActor,
|
2022-08-26 16:08:58 +02:00
|
|
|
updatedAt: new Date().toISOString(),
|
2022-07-12 10:55:28 +02:00
|
|
|
url: "http://somewhere.tld",
|
|
|
|
replies: [],
|
|
|
|
totalReplies: 0,
|
|
|
|
isAnnouncement: false,
|
|
|
|
local: false,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
isAnnouncement: false,
|
2022-08-26 16:08:58 +02:00
|
|
|
updatedAt: new Date().toISOString(),
|
2022-07-12 10:55:28 +02:00
|
|
|
url: "http://somewhere.tld",
|
|
|
|
});
|
|
|
|
</script>
|