From 60aceb442ae49458e31a1f38d277eca7af248a36 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 2 Aug 2023 15:09:08 +0200 Subject: [PATCH] fix(lint): fix lint after upgrades Signed-off-by: Thomas Citharel --- js/src/apollo/utils.ts | 15 ++-- .../Activity/DiscussionActivityItem.vue | 20 +++-- .../components/Activity/EventActivityItem.vue | 22 ++++-- .../components/Activity/GroupActivityItem.vue | 28 ++++--- .../Activity/MemberActivityItem.vue | 73 ++++++++++--------- .../components/Activity/PostActivityItem.vue | 16 ++-- .../Activity/ResourceActivityItem.vue | 35 +++++---- js/src/components/Comment/CommentTree.vue | 35 +++++---- js/src/components/Editor/MentionList.vue | 13 +++- .../Event/GroupedMultiEventMinimalistCard.vue | 4 +- .../components/Group/JoinGroupWithAccount.vue | 2 +- js/src/components/Local/MoreContent.vue | 4 +- .../Participation/ConfirmParticipation.vue | 4 +- .../ParticipationWithAccount.vue | 2 +- .../ParticipationWithoutAccount.vue | 2 +- .../Participation/UnloggedParticipation.vue | 2 +- js/src/components/Resource/FolderItem.vue | 6 +- .../components/Resource/ResourceSelector.vue | 34 +++++---- js/src/components/Search/EventMarkerMap.vue | 14 ++-- js/src/components/TextEditor.vue | 19 +++-- js/src/components/core/CustomDialog.vue | 15 ++-- js/src/composition/apollo/event.ts | 8 +- js/src/services/statistics/index.ts | 11 ++- js/src/types/actor/actor.model.ts | 8 +- .../views/Account/children/EditIdentity.vue | 6 +- js/src/views/Discussions/CreateView.vue | 3 +- js/src/views/Discussions/DiscussionView.vue | 13 ++-- .../views/Discussions/DiscussionsListView.vue | 5 +- js/src/views/Event/EditView.vue | 2 +- js/src/views/Event/EventView.vue | 2 +- js/src/views/Event/MyEventsView.vue | 2 +- js/src/views/Event/ParticipantsView.vue | 4 +- js/src/views/Group/GroupFollowers.vue | 6 +- js/src/views/Group/GroupMembers.vue | 5 +- js/src/views/Group/GroupSettings.vue | 11 +-- js/src/views/Group/GroupView.vue | 16 ++-- js/src/views/OAuth/DeviceActivationView.vue | 6 +- js/src/views/Posts/EditView.vue | 3 +- js/src/views/Resources/ResourceFolder.vue | 9 ++- js/src/views/SearchView.vue | 5 +- js/src/views/Settings/NotificationsView.vue | 21 ++++-- js/src/views/Todos/TodoLists.vue | 3 +- js/src/views/User/ResendConfirmation.vue | 13 ++-- js/src/views/User/SendPasswordReset.vue | 13 ++-- 44 files changed, 322 insertions(+), 218 deletions(-) diff --git a/js/src/apollo/utils.ts b/js/src/apollo/utils.ts index b889fb88f..0ac78d0ee 100644 --- a/js/src/apollo/utils.ts +++ b/js/src/apollo/utils.ts @@ -24,12 +24,15 @@ type schemaType = { // eslint-disable-next-line no-underscore-dangle const types = introspectionQueryResultData.__schema.types as schemaType[]; -export const possibleTypes = types.reduce((acc, type) => { - if (type.kind === "INTERFACE") { - acc[type.name] = type.possibleTypes.map(({ name }) => name); - } - return acc; -}, {} as Record); +export const possibleTypes = types.reduce( + (acc, type) => { + if (type.kind === "INTERFACE") { + acc[type.name] = type.possibleTypes.map(({ name }) => name); + } + return acc; + }, + {} as Record +); const replaceMergePolicy = ( _existing: TExisting, diff --git a/js/src/components/Activity/DiscussionActivityItem.vue b/js/src/components/Activity/DiscussionActivityItem.vue index bc19ca904..6b9a1c9df 100644 --- a/js/src/components/Activity/DiscussionActivityItem.vue +++ b/js/src/components/Activity/DiscussionActivityItem.vue @@ -62,34 +62,40 @@ const props = defineProps<{ activity: IActivity; }>(); -const isAuthorCurrentActor = useIsActivityAuthorCurrentActor()(props.activity); +const useIsActivityAuthorCurrentActorFct = useIsActivityAuthorCurrentActor(); +const useActivitySubjectParamsFct = useActivitySubjectParams(); -const subjectParams = useActivitySubjectParams()(props.activity); +const isAuthorCurrentActor = computed(() => + useIsActivityAuthorCurrentActorFct(props.activity) +); +const subjectParams = computed(() => + useActivitySubjectParamsFct(props.activity) +); const translation = computed((): string | undefined => { switch (props.activity.subject) { case ActivityDiscussionSubject.DISCUSSION_CREATED: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You created the discussion {discussion}."; } return "{profile} created the discussion {discussion}."; case ActivityDiscussionSubject.DISCUSSION_REPLIED: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You replied to the discussion {discussion}."; } return "{profile} replied to the discussion {discussion}."; case ActivityDiscussionSubject.DISCUSSION_RENAMED: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You renamed the discussion from {old_discussion} to {discussion}."; } return "{profile} renamed the discussion from {old_discussion} to {discussion}."; case ActivityDiscussionSubject.DISCUSSION_ARCHIVED: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You archived the discussion {discussion}."; } return "{profile} archived the discussion {discussion}."; case ActivityDiscussionSubject.DISCUSSION_DELETED: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You deleted the discussion {discussion}."; } return "{profile} deleted the discussion {discussion}."; diff --git a/js/src/components/Activity/EventActivityItem.vue b/js/src/components/Activity/EventActivityItem.vue index 184884f27..4c9f1a359 100644 --- a/js/src/components/Activity/EventActivityItem.vue +++ b/js/src/components/Activity/EventActivityItem.vue @@ -52,35 +52,41 @@ const props = defineProps<{ activity: IActivity; }>(); -const isAuthorCurrentActor = useIsActivityAuthorCurrentActor()(props.activity); +const useIsActivityAuthorCurrentActorFct = useIsActivityAuthorCurrentActor(); +const useActivitySubjectParamsFct = useActivitySubjectParams(); -const subjectParams = useActivitySubjectParams()(props.activity); +const isAuthorCurrentActor = computed(() => + useIsActivityAuthorCurrentActorFct(props.activity) +); +const subjectParams = computed(() => + useActivitySubjectParamsFct(props.activity) +); const translation = computed((): string | undefined => { switch (props.activity.subject) { case ActivityEventSubject.EVENT_CREATED: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You created the event {event}."; } return "The event {event} was created by {profile}."; case ActivityEventSubject.EVENT_UPDATED: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You updated the event {event}."; } return "The event {event} was updated by {profile}."; case ActivityEventSubject.EVENT_DELETED: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You deleted the event {event}."; } return "The event {event} was deleted by {profile}."; case ActivityEventCommentSubject.COMMENT_POSTED: - if (subjectParams.comment_reply_to) { - if (isAuthorCurrentActor) { + if (subjectParams.value.comment_reply_to) { + if (isAuthorCurrentActor.value) { return "You replied to a comment on the event {event}."; } return "{profile} replied to a comment on the event {event}."; } - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You posted a comment on the event {event}."; } return "{profile} posted a comment on the event {event}."; diff --git a/js/src/components/Activity/GroupActivityItem.vue b/js/src/components/Activity/GroupActivityItem.vue index d76458a90..7572f7a90 100644 --- a/js/src/components/Activity/GroupActivityItem.vue +++ b/js/src/components/Activity/GroupActivityItem.vue @@ -44,9 +44,13 @@ {{ subjectParams.group_name }} {{ subjectParams.group_name }} @@ -78,19 +82,25 @@ const props = defineProps<{ activity: IActivity; }>(); -const isAuthorCurrentActor = useIsActivityAuthorCurrentActor()(props.activity); +const useIsActivityAuthorCurrentActorFct = useIsActivityAuthorCurrentActor(); +const useActivitySubjectParamsFct = useActivitySubjectParams(); -const subjectParams = useActivitySubjectParams()(props.activity); +const isAuthorCurrentActor = computed(() => + useIsActivityAuthorCurrentActorFct(props.activity) +); +const subjectParams = computed(() => + useActivitySubjectParamsFct(props.activity) +); const translation = computed((): string | undefined => { switch (props.activity.subject) { case ActivityGroupSubject.GROUP_CREATED: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You created the group {group}."; } return "{profile} created the group {group}."; case ActivityGroupSubject.GROUP_UPDATED: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You updated the group {group}."; } return "{profile} updated the group {group}."; @@ -114,8 +124,8 @@ const group = computed(() => props.activity.object as IGroup); const details = computed((): string[] => { const localDetails = []; - const changes = subjectParams.group_changes.split(","); - if (changes.includes("name") && subjectParams.old_group_name) { + const changes = subjectParams.value.group_changes.split(","); + if (changes.includes("name") && subjectParams.value.old_group_name) { localDetails.push("{old_group_name} was renamed to {group}."); } if (changes.includes("visibility") && group.value.visibility) { diff --git a/js/src/components/Activity/MemberActivityItem.vue b/js/src/components/Activity/MemberActivityItem.vue index 275261cf5..764eb75f8 100644 --- a/js/src/components/Activity/MemberActivityItem.vue +++ b/js/src/components/Activity/MemberActivityItem.vue @@ -51,58 +51,63 @@ const props = defineProps<{ activity: IActivity; }>(); -const isAuthorCurrentActor = useIsActivityAuthorCurrentActor()(props.activity); +const isActivityAuthorCurrentActorFct = useIsActivityAuthorCurrentActor(); +const activitySubjectParamsFct = useActivitySubjectParams(); +const isActivityObjectCurrentActor = useIsActivityObjectCurrentActor(); -const subjectParams = useActivitySubjectParams()(props.activity); +const isAuthorCurrentActor = computed(() => + isActivityAuthorCurrentActorFct(props.activity) +); +const subjectParams = computed(() => activitySubjectParamsFct(props.activity)); const member = computed(() => props.activity.object as IMember); -const isObjectMemberCurrentActor = useIsActivityObjectCurrentActor()( - props.activity +const isObjectMemberCurrentActor = computed(() => + isActivityObjectCurrentActor(props.activity) ); const translation = computed((): string | undefined => { switch (props.activity.subject) { case ActivityMemberSubject.MEMBER_REQUEST: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You requested to join the group."; } return "{member} requested to join the group."; case ActivityMemberSubject.MEMBER_INVITED: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You invited {member}."; } return "{member} was invited by {profile}."; case ActivityMemberSubject.MEMBER_ADDED: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You added the member {member}."; } return "{profile} added the member {member}."; case ActivityMemberSubject.MEMBER_APPROVED: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You approved {member}'s membership."; } - if (isObjectMemberCurrentActor) { + if (isObjectMemberCurrentActor.value) { return "Your membership was approved by {profile}."; } return "{profile} approved {member}'s membership."; case ActivityMemberSubject.MEMBER_JOINED: return "{member} joined the group."; case ActivityMemberSubject.MEMBER_UPDATED: - if (subjectParams.member_role && subjectParams.old_role) { + if (subjectParams.value.member_role && subjectParams.value.old_role) { return roleUpdate.value; } - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You updated the member {member}."; } return "{profile} updated the member {member}."; case ActivityMemberSubject.MEMBER_REMOVED: - if (subjectParams.member_role === MemberRole.NOT_APPROVED) { - if (isAuthorCurrentActor) { + if (subjectParams.value.member_role === MemberRole.NOT_APPROVED) { + if (isAuthorCurrentActor.value) { return "You rejected {member}'s membership request."; } return "{profile} rejected {member}'s membership request."; } - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You excluded member {member}."; } return "{profile} excluded member {member}."; @@ -111,7 +116,7 @@ const translation = computed((): string | undefined => { case ActivityMemberSubject.MEMBER_REJECTED_INVITATION: return "{member} rejected the invitation to join the group."; case ActivityMemberSubject.MEMBER_ACCEPTED_INVITATION: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You accepted the invitation to join the group."; } return "{member} accepted the invitation to join the group."; @@ -159,69 +164,69 @@ const iconColor = computed((): string | undefined => { const roleUpdate = computed((): string | undefined => { if ( - Object.keys(MEMBER_ROLE_VALUE).includes(subjectParams.member_role) && - Object.keys(MEMBER_ROLE_VALUE).includes(subjectParams.old_role) + Object.keys(MEMBER_ROLE_VALUE).includes(subjectParams.value.member_role) && + Object.keys(MEMBER_ROLE_VALUE).includes(subjectParams.value.old_role) ) { if ( - MEMBER_ROLE_VALUE[subjectParams.member_role] > - MEMBER_ROLE_VALUE[subjectParams.old_role] + MEMBER_ROLE_VALUE[subjectParams.value.member_role] > + MEMBER_ROLE_VALUE[subjectParams.value.old_role] ) { - switch (subjectParams.member_role) { + switch (subjectParams.value.member_role) { case MemberRole.MODERATOR: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You promoted {member} to moderator."; } - if (isObjectMemberCurrentActor) { + if (isObjectMemberCurrentActor.value) { return "You were promoted to moderator by {profile}."; } return "{profile} promoted {member} to moderator."; case MemberRole.ADMINISTRATOR: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You promoted {member} to administrator."; } - if (isObjectMemberCurrentActor) { + if (isObjectMemberCurrentActor.value) { return "You were promoted to administrator by {profile}."; } return "{profile} promoted {member} to administrator."; default: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You promoted the member {member} to an unknown role."; } - if (isObjectMemberCurrentActor) { + if (isObjectMemberCurrentActor.value) { return "You were promoted to an unknown role by {profile}."; } return "{profile} promoted {member} to an unknown role."; } } else { - switch (subjectParams.member_role) { + switch (subjectParams.value.member_role) { case MemberRole.MODERATOR: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You demoted {member} to moderator."; } - if (isObjectMemberCurrentActor) { + if (isObjectMemberCurrentActor.value) { return "You were demoted to moderator by {profile}."; } return "{profile} demoted {member} to moderator."; case MemberRole.MEMBER: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You demoted {member} to simple member."; } - if (isObjectMemberCurrentActor) { + if (isObjectMemberCurrentActor.value) { return "You were demoted to simple member by {profile}."; } return "{profile} demoted {member} to simple member."; default: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You demoted the member {member} to an unknown role."; } - if (isObjectMemberCurrentActor) { + if (isObjectMemberCurrentActor.value) { return "You were demoted to an unknown role by {profile}."; } return "{profile} demoted {member} to an unknown role."; } } } else { - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You updated the member {member}."; } return "{profile} updated the member {member}"; diff --git a/js/src/components/Activity/PostActivityItem.vue b/js/src/components/Activity/PostActivityItem.vue index 06f2cb1a4..479210fd1 100644 --- a/js/src/components/Activity/PostActivityItem.vue +++ b/js/src/components/Activity/PostActivityItem.vue @@ -49,24 +49,30 @@ const props = defineProps<{ activity: IActivity; }>(); -const isAuthorCurrentActor = useIsActivityAuthorCurrentActor()(props.activity); +const useIsActivityAuthorCurrentActorFct = useIsActivityAuthorCurrentActor(); +const useActivitySubjectParamsFct = useActivitySubjectParams(); -const subjectParams = useActivitySubjectParams()(props.activity); +const isAuthorCurrentActor = computed(() => + useIsActivityAuthorCurrentActorFct(props.activity) +); +const subjectParams = computed(() => + useActivitySubjectParamsFct(props.activity) +); const translation = computed((): string | undefined => { switch (props.activity.subject) { case ActivityPostSubject.POST_CREATED: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You created the post {post}."; } return "The post {post} was created by {profile}."; case ActivityPostSubject.POST_UPDATED: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You updated the post {post}."; } return "The post {post} was updated by {profile}."; case ActivityPostSubject.POST_DELETED: - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You deleted the post {post}."; } return "The post {post} was deleted by {profile}."; diff --git a/js/src/components/Activity/ResourceActivityItem.vue b/js/src/components/Activity/ResourceActivityItem.vue index 65b8e7d50..314a69184 100644 --- a/js/src/components/Activity/ResourceActivityItem.vue +++ b/js/src/components/Activity/ResourceActivityItem.vue @@ -61,10 +61,15 @@ import { IResource } from "@/types/resource"; const props = defineProps<{ activity: IActivity; }>(); +const useIsActivityAuthorCurrentActorFct = useIsActivityAuthorCurrentActor(); +const useActivitySubjectParamsFct = useActivitySubjectParams(); -const isAuthorCurrentActor = useIsActivityAuthorCurrentActor()(props.activity); - -const subjectParams = useActivitySubjectParams()(props.activity); +const isAuthorCurrentActor = computed(() => + useIsActivityAuthorCurrentActorFct(props.activity) +); +const subjectParams = computed(() => + useActivitySubjectParamsFct(props.activity) +); const resource = computed(() => props.activity.object as IResource); @@ -74,12 +79,12 @@ const translation = computed((): string | undefined => { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore if (props.activity?.object?.type === "folder") { - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You created the folder {resource}."; } return "{profile} created the folder {resource}."; } - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You created the resource {resource}."; } return "{profile} created the resource {resource}."; @@ -88,23 +93,23 @@ const translation = computed((): string | undefined => { // @ts-ignore if (props.activity?.object?.type === "folder") { if (parentDirectory.value === null) { - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You moved the folder {resource} to the root folder."; } return "{profile} moved the folder {resource} to the root folder."; } - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You moved the folder {resource} into {new_path}."; } return "{profile} moved the folder {resource} into {new_path}."; } if (parentDirectory.value === null) { - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You moved the resource {resource} to the root folder."; } return "{profile} moved the resource {resource} to the root folder."; } - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You moved the resource {resource} into {new_path}."; } return "{profile} moved the resource {resource} into {new_path}."; @@ -112,12 +117,12 @@ const translation = computed((): string | undefined => { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore if (props.activity?.object?.type === "folder") { - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You renamed the folder from {old_resource_title} to {resource}."; } return "{profile} renamed the folder from {old_resource_title} to {resource}."; } - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You renamed the resource from {old_resource_title} to {resource}."; } return "{profile} renamed the resource from {old_resource_title} to {resource}."; @@ -125,12 +130,12 @@ const translation = computed((): string | undefined => { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore if (props.activity?.object?.type === "folder") { - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You deleted the folder {resource}."; } return "{profile} deleted the folder {resource}."; } - if (isAuthorCurrentActor) { + if (isAuthorCurrentActor.value) { return "You deleted the resource {resource}."; } return "{profile} deleted the resource {resource}."; @@ -180,8 +185,8 @@ const parentPath = (parent: string | undefined): string | undefined => { }; const parentDirectory = computed((): string | undefined | null => { - if (subjectParams.resource_path) { - const parentPathResult = parentPath(subjectParams.resource_path); + if (subjectParams.value.resource_path) { + const parentPathResult = parentPath(subjectParams.value.resource_path); const directory = parentPathResult?.split("/"); const res = directory?.pop(); res === "" ? null : res; diff --git a/js/src/components/Comment/CommentTree.vue b/js/src/components/Comment/CommentTree.vue index 5492f48b9..c2383779f 100644 --- a/js/src/components/Comment/CommentTree.vue +++ b/js/src/components/Comment/CommentTree.vue @@ -2,7 +2,7 @@
{{ t("Comments are closed for everybody else.") }}
-
- +
+
@@ -23,9 +26,9 @@ v-if="currentActor" :currentActor="currentActor" mode="comment" - v-model="newComment.text" + v-model="newCommentValue.text" :aria-label="t('Comment body')" - @submit="createCommentForEvent(newComment)" + @submit="createCommentForEvent(newCommentValue)" :placeholder="t('Write a new comment')" />

@@ -35,7 +38,7 @@

{{ t("Notify participants") }}
@@ -70,10 +73,12 @@ v-for="comment in filteredOrderedComments" :key="comment.id" @create-comment="createCommentForEvent" - @delete-comment="commentToDelete => deleteComment({ - commentId: commentToDelete.id as string, - originCommentId: commentToDelete.originComment?.id, - }) + @delete-comment=" + (commentToDelete) => + deleteComment({ + commentId: commentToDelete.id as string, + originCommentId: commentToDelete.originComment?.id, + }) " /> @@ -126,17 +131,19 @@ const Editor = defineAsyncComponent( () => import("@/components/TextEditor.vue") ); -const newComment = ref(props.newComment ?? new CommentModel()); +const newCommentProps = computed(() => props.newComment); + +const newCommentValue = ref(new CommentModel(newCommentProps.value)); const emptyCommentError = ref(false); const { t } = useI18n({ useScope: "global" }); watch(currentActor, () => { - newComment.value.actor = currentActor.value as IPerson; + newCommentValue.value.actor = currentActor.value as IPerson; }); -watch(newComment, (newCommentUpdated: IComment) => { +watch(newCommentValue, (newCommentUpdated: IComment) => { if (emptyCommentError.value) { emptyCommentError.value = ["", "

"].includes(newCommentUpdated.text); } @@ -212,7 +219,7 @@ const { createCommentForEventMutationDone(() => { // and reset the new comment field - newComment.value = new CommentModel(); + newCommentValue.value = new CommentModel(); }); const notifier = inject("notifier"); diff --git a/js/src/components/Editor/MentionList.vue b/js/src/components/Editor/MentionList.vue index 678d9c2f6..f22e16530 100644 --- a/js/src/components/Editor/MentionList.vue +++ b/js/src/components/Editor/MentionList.vue @@ -27,9 +27,12 @@ const props = defineProps<{ const selectedIndex = ref(0); -watch(props.items, () => { - selectedIndex.value = 0; -}); +watch( + () => props.items, + () => { + selectedIndex.value = 0; + } +); // const onKeyDown = ({ event }: { event: KeyboardEvent }): boolean => { // if (event.key === "ArrowUp") { @@ -80,7 +83,9 @@ const selectItem = (index: number): void => { color: rgba(black, 0.8); overflow: hidden; font-size: 0.9rem; - box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0px 10px 20px rgba(0, 0, 0, 0.1); + box-shadow: + 0 0 0 1px rgba(0, 0, 0, 0.1), + 0px 10px 20px rgba(0, 0, 0, 0.1); } .item { diff --git a/js/src/components/Event/GroupedMultiEventMinimalistCard.vue b/js/src/components/Event/GroupedMultiEventMinimalistCard.vue index c2b6d31da..280592918 100644 --- a/js/src/components/Event/GroupedMultiEventMinimalistCard.vue +++ b/js/src/components/Event/GroupedMultiEventMinimalistCard.vue @@ -41,12 +41,12 @@ const keys = computed((): string[] => { return Array.from(monthlyGroupedEvents.value.keys()).sort((a, b) => { const aParams = a.split("-").map((x) => parseInt(x, 10)) as [ number, - number + number, ]; const aDate = new Date(...aParams); const bParams = b.split("-").map((x) => parseInt(x, 10)) as [ number, - number + number, ]; const bDate = new Date(...bParams); return props.order === "DESC" diff --git a/js/src/components/Group/JoinGroupWithAccount.vue b/js/src/components/Group/JoinGroupWithAccount.vue index 488cc9ca2..3a8597b58 100644 --- a/js/src/components/Group/JoinGroupWithAccount.vue +++ b/js/src/components/Group/JoinGroupWithAccount.vue @@ -22,7 +22,7 @@ const props = defineProps<{ preferredUsername: string; }>(); -const { group } = useGroup(props.preferredUsername); +const { group } = useGroup(computed(() => props.preferredUsername)); const { t } = useI18n({ useScope: "global" }); diff --git a/js/src/components/Local/MoreContent.vue b/js/src/components/Local/MoreContent.vue index 3f4605879..4c62df1a9 100644 --- a/js/src/components/Local/MoreContent.vue +++ b/js/src/components/Local/MoreContent.vue @@ -86,6 +86,8 @@ const imageSource = computed( rgba(2, 0, 36, 0.75) 90%, rgba(2, 0, 36, 0.85) 100% ); - transition: opacity 0.1s ease-in-out, visibility 0.1s ease-in-out; + transition: + opacity 0.1s ease-in-out, + visibility 0.1s ease-in-out; } diff --git a/js/src/components/Participation/ConfirmParticipation.vue b/js/src/components/Participation/ConfirmParticipation.vue index 935daad0a..e433a581c 100644 --- a/js/src/components/Participation/ConfirmParticipation.vue +++ b/js/src/components/Participation/ConfirmParticipation.vue @@ -90,9 +90,9 @@ const { onDone, onError, mutate } = useMutation<{ confirmParticipation: IParticipant; }>(CONFIRM_PARTICIPATION); -mutate({ +mutate(() => ({ token: props.token, -}); +})); onDone(async ({ data }) => { participation.value = data?.confirmParticipation; diff --git a/js/src/components/Participation/ParticipationWithAccount.vue b/js/src/components/Participation/ParticipationWithAccount.vue index df8b97fb4..d53004f91 100644 --- a/js/src/components/Participation/ParticipationWithAccount.vue +++ b/js/src/components/Participation/ParticipationWithAccount.vue @@ -17,7 +17,7 @@ const props = defineProps<{ uuid: string; }>(); -const { event } = useFetchEvent(props.uuid); +const { event } = useFetchEvent(computed(() => props.uuid)); const { t } = useI18n({ useScope: "global" }); diff --git a/js/src/components/Participation/ParticipationWithoutAccount.vue b/js/src/components/Participation/ParticipationWithoutAccount.vue index 4edfdf113..5d70c0f32 100644 --- a/js/src/components/Participation/ParticipationWithoutAccount.vue +++ b/js/src/components/Participation/ParticipationWithoutAccount.vue @@ -156,7 +156,7 @@ const { anonymousActorId } = useAnonymousActorId(); const props = defineProps<{ uuid: string; }>(); -const { event, loading } = useFetchEventBasic(props.uuid); +const { event, loading } = useFetchEventBasic(computed(() => props.uuid)); const { t, locale } = useI18n({ useScope: "global" }); diff --git a/js/src/components/Participation/UnloggedParticipation.vue b/js/src/components/Participation/UnloggedParticipation.vue index 5db01c6a1..8be6313a6 100644 --- a/js/src/components/Participation/UnloggedParticipation.vue +++ b/js/src/components/Participation/UnloggedParticipation.vue @@ -104,7 +104,7 @@ import { useI18n } from "vue-i18n"; const props = defineProps<{ uuid: string }>(); -const { event } = useFetchEvent(props.uuid); +const { event } = useFetchEvent(computed(() => props.uuid)); const { anonymousParticipationConfig } = useAnonymousParticipationConfig(); diff --git a/js/src/components/Resource/FolderItem.vue b/js/src/components/Resource/FolderItem.vue index 63a71c4e5..f6d862fbd 100644 --- a/js/src/components/Resource/FolderItem.vue +++ b/js/src/components/Resource/FolderItem.vue @@ -49,7 +49,7 @@ import RouteName from "@/router/name"; import { IMinimalActor, usernameWithDomain } from "@/types/actor"; import ResourceDropdown from "./ResourceDropdown.vue"; import { UPDATE_RESOURCE } from "@/graphql/resources"; -import { inject, ref } from "vue"; +import { ComputedRef, computed, inject, ref } from "vue"; import { formatDateTimeString } from "@/filters/datetime"; import { useMutation } from "@vue/apollo-composable"; import { resourcePathArray } from "@/components/Resource/utils"; @@ -73,11 +73,11 @@ const emit = defineEmits<{ const list = ref([]); -const groupObject: Record = { +const groupObject: ComputedRef> = computed(() => ({ name: `folder-${props.resource?.title}`, pull: false, put: ["resources"], -}; +})); const onChange = async (evt: any) => { if (evt.added && evt.added.element) { diff --git a/js/src/components/Resource/ResourceSelector.vue b/js/src/components/Resource/ResourceSelector.vue index 68f06c3e3..70795e325 100644 --- a/js/src/components/Resource/ResourceSelector.vue +++ b/js/src/components/Resource/ResourceSelector.vue @@ -92,14 +92,17 @@ const emit = defineEmits(["update-resource", "close-move-modal"]); const { t } = useI18n({ useScope: "global" }); +const initialResourceProp = computed(() => props.initialResource); +const usernameProp = computed(() => props.username); + const resourcePath = reactive<{ path: string | undefined; username: string; id: string | undefined; }>({ - id: props.initialResource.parent?.id, - path: props.initialResource.parent?.path, - username: props.username, + id: initialResourceProp.value.parent?.id, + path: initialResourceProp.value.parent?.path, + username: usernameProp.value, }); const RESOURCES_PER_PAGE = 10; @@ -111,27 +114,30 @@ const { result: resourceResult, refetch } = useQuery<{ resource: IResource }>( if (resourcePath?.path) { return { path: resourcePath?.path, - username: props.username, + username: usernameProp.value, page: page.value, limit: RESOURCES_PER_PAGE, }; } - return { path: "/", username: props.username }; + return { path: "/", username: usernameProp.value }; } ); const resource = computed(() => resourceResult.value?.resource); const goDown = (element: IResource): void => { - if (element.type === "folder" && element.id !== props.initialResource.id) { + if ( + element.type === "folder" && + element.id !== initialResourceProp.value.id + ) { resourcePath.id = element.id; resourcePath.path = element.path; console.debug("Gone into folder", resourcePath); } }; -watch(props.initialResource, () => { - if (props.initialResource) { +watch(initialResourceProp, () => { + if (initialResourceProp.value) { resourcePath.id = props.initialResource?.parent?.id; resourcePath.path = props.initialResource?.parent?.path; refetch(); @@ -144,21 +150,21 @@ const updateResource = (): void => { emit( "update-resource", { - id: props.initialResource.id, - title: props.initialResource.title, + id: initialResourceProp.value.id, + title: initialResourceProp.value.title, parent: parent, path: parent?.path ?? "/", }, - props.initialResource.parent + initialResourceProp.value.parent ); }; const moveDisabled = computed((): boolean | undefined => { return ( - (props.initialResource.parent && + (initialResourceProp.value.parent && resourcePath && - props.initialResource.parent.path === resourcePath.path) || - (props.initialResource.parent === undefined && + initialResourceProp.value.parent.path === resourcePath.path) || + (initialResourceProp.value.parent === undefined && resourcePath && resourcePath.path === "/") ); diff --git a/js/src/components/Search/EventMarkerMap.vue b/js/src/components/Search/EventMarkerMap.vue index 164042a6f..12fe991c1 100644 --- a/js/src/components/Search/EventMarkerMap.vue +++ b/js/src/components/Search/EventMarkerMap.vue @@ -10,7 +10,7 @@ > { text-align: center; border-radius: 15px; - font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif; + font: + 12px "Helvetica Neue", + Arial, + Helvetica, + sans-serif; } .marker-cluster span { diff --git a/js/src/components/TextEditor.vue b/js/src/components/TextEditor.vue index b607fba33..c71e8857f 100644 --- a/js/src/components/TextEditor.vue +++ b/js/src/components/TextEditor.vue @@ -325,13 +325,18 @@ const transformPastedHTML = (html: string): string => { return html; }; +const ariaLabel = computed(() => props.ariaLabel); +const headingLevel = computed(() => props.headingLevel); +const placeholder = computed(() => props.placeholder); +const value = computed(() => props.modelValue); + const { t } = useI18n({ useScope: "global" }); const editor = useEditor({ editorProps: { attributes: { "aria-multiline": isShortMode.value.toString(), - "aria-label": props.ariaLabel ?? "", + "aria-label": ariaLabel.value ?? "", role: "textbox", class: "prose dark:prose-invert prose-sm lg:prose-lg xl:prose-xl bg-zinc-50 dark:bg-zinc-700 focus:outline-none !max-w-full", @@ -342,7 +347,7 @@ const editor = useEditor({ Blockquote, BulletList, Heading.configure({ - levels: props.headingLevel, + levels: headingLevel.value, }), Document, Paragraph, @@ -366,18 +371,16 @@ const editor = useEditor({ submit: () => emit("submit"), }), Placeholder.configure({ - placeholder: props.placeholder ?? t("Write something"), + placeholder: placeholder.value ?? t("Write something"), }), ], injectCSS: false, - content: props.modelValue, + content: value.value, onUpdate: () => { emit("update:modelValue", editor.value?.getHTML()); }, }); -const value = computed(() => props.modelValue); - watch(value, (val: string) => { if (!editor.value) return; if (val !== editor.value.getHTML()) { @@ -479,7 +482,9 @@ onBeforeUnmount(() => { @import "./Editor/style.scss"; .menubar { - transition: visibility 0.2s 0.4s, opacity 0.2s 0.4s; + transition: + visibility 0.2s 0.4s, + opacity 0.2s 0.4s; &__button { font-weight: bold; diff --git a/js/src/components/core/CustomDialog.vue b/js/src/components/core/CustomDialog.vue index df802e044..bf75ec2c8 100644 --- a/js/src/components/core/CustomDialog.vue +++ b/js/src/components/core/CustomDialog.vue @@ -84,14 +84,19 @@ const emit = defineEmits(["confirm", "cancel", "close"]); const { t } = useI18n({ useScope: "global" }); +const hasInput = computed(() => props.hasInput); +const onConfirm = computed(() => props.onConfirm); +const onCancel = computed(() => props.onCancel); +const inputAttrs = computed(() => props.inputAttrs); + // const modalOpened = ref(false); -const prompt = ref(props.hasInput ? props.inputAttrs?.value ?? "" : ""); +const prompt = ref(hasInput.value ? inputAttrs.value.value ?? "" : ""); const input = ref(); // https://github.com/oruga-ui/oruga/issues/339 const promptInputComp = computed(() => input.value?.$refs.input); -if (props.hasInput) { +if (hasInput.value) { useFocus(promptInputComp, { initialValue: true }); } @@ -128,7 +133,7 @@ const confirm = () => { return; } } - props.onConfirm(prompt.value); + onConfirm.value(prompt.value); close(); }; @@ -144,8 +149,8 @@ const close = () => { */ const cancel = (source: string) => { emit("cancel", source); - if (props?.onCancel) { - props?.onCancel(source); + if (onCancel.value) { + onCancel.value(source); } close(); }; diff --git a/js/src/composition/apollo/event.ts b/js/src/composition/apollo/event.ts index bc5a827a9..9860a9be6 100644 --- a/js/src/composition/apollo/event.ts +++ b/js/src/composition/apollo/event.ts @@ -1,9 +1,10 @@ import { DELETE_EVENT, FETCH_EVENT, FETCH_EVENT_BASIC } from "@/graphql/event"; import { IEvent } from "@/types/event.model"; import { useMutation, useQuery } from "@vue/apollo-composable"; -import { computed } from "vue"; +import { Ref, computed, unref } from "vue"; -export function useFetchEvent(uuid?: string) { +export function useFetchEvent(uuidValue?: string | Ref) { + const uuid = unref(uuidValue); const { result: fetchEventResult, loading, @@ -26,7 +27,8 @@ export function useFetchEvent(uuid?: string) { return { event, loading, error, onError, onResult, refetch }; } -export function useFetchEventBasic(uuid: string) { +export function useFetchEventBasic(uuidValue?: string | Ref) { + const uuid = unref(uuidValue); const { result: fetchEventResult, loading, diff --git a/js/src/services/statistics/index.ts b/js/src/services/statistics/index.ts index b4c051ccd..69f1f966f 100644 --- a/js/src/services/statistics/index.ts +++ b/js/src/services/statistics/index.ts @@ -34,10 +34,13 @@ export const checkProviderConfig = ( export const convertConfig = ( configs: IKeyValueConfig[] ): Record => { - return configs.reduce((acc, config) => { - acc[config.key] = toType(config.value, config.type); - return acc; - }, {} as Record); + return configs.reduce( + (acc, config) => { + acc[config.key] = toType(config.value, config.type); + return acc; + }, + {} as Record + ); }; const toType = (value: string, type: string): string | number | boolean => { diff --git a/js/src/types/actor/actor.model.ts b/js/src/types/actor/actor.model.ts index 2eab8c583..5772a0ba9 100644 --- a/js/src/types/actor/actor.model.ts +++ b/js/src/types/actor/actor.model.ts @@ -16,6 +16,10 @@ export interface IActor { } export type IMinimalActor = Pick; +export type IMinimalActorWithName = Pick< + IActor, + "preferredUsername" | "domain" | "name" +>; export class Actor implements IActor { id?: string; @@ -72,13 +76,13 @@ export function usernameWithDomain( return actor.preferredUsername; } -export function displayName(actor: IActor | undefined): string { +export function displayName(actor: IMinimalActorWithName | undefined): string { return actor && actor.name != null && actor.name !== "" ? actor.name : usernameWithDomain(actor); } -export function displayNameAndUsername(actor: IActor): string { +export function displayNameAndUsername(actor: IMinimalActorWithName): string { if (actor.name) { return `${actor.name} (@${usernameWithDomain(actor)})`; } diff --git a/js/src/views/Account/children/EditIdentity.vue b/js/src/views/Account/children/EditIdentity.vue index 93cdfc372..90c3f7655 100644 --- a/js/src/views/Account/children/EditIdentity.vue +++ b/js/src/views/Account/children/EditIdentity.vue @@ -125,7 +125,8 @@ tag="a" icon-left="rss" @click=" - (e: Event) => copyURL(e, tokenToURL(feedToken.token, 'atom'), 'atom') + (e: Event) => + copyURL(e, tokenToURL(feedToken.token, 'atom'), 'atom') " :href="tokenToURL(feedToken.token, 'atom')" target="_blank" @@ -142,7 +143,8 @@ (); const { currentActor } = useCurrentActorClient(); +const preferredUsername = computed(() => props.preferredUsername); -const { group } = useGroup(props.preferredUsername); +const { group } = useGroup(preferredUsername); const { t } = useI18n({ useScope: "global" }); diff --git a/js/src/views/Discussions/DiscussionView.vue b/js/src/views/Discussions/DiscussionView.vue index d400fb82d..db507642b 100644 --- a/js/src/views/Discussions/DiscussionView.vue +++ b/js/src/views/Discussions/DiscussionView.vue @@ -108,9 +108,12 @@ text: comment.text, }) " - @delete-comment="(comment: IComment) => deleteComment({ - commentId: comment.id as string, - })" + @delete-comment=" + (comment: IComment) => + deleteComment({ + commentId: comment.id as string, + }) + " /> ({ slug: props.slug, page: page.value, limit: COMMENTS_PER_PAGE, - }, + }), updateQuery( previousResult: any, { subscriptionData }: { subscriptionData: any } diff --git a/js/src/views/Discussions/DiscussionsListView.vue b/js/src/views/Discussions/DiscussionsListView.vue index de0aa90c9..3d085bb11 100644 --- a/js/src/views/Discussions/DiscussionsListView.vue +++ b/js/src/views/Discussions/DiscussionsListView.vue @@ -90,9 +90,10 @@ const page = useRouteQuery("page", 1, integerTransformer); const DISCUSSIONS_PER_PAGE = 10; const props = defineProps<{ preferredUsername: string }>(); +const preferredUsername = computed(() => props.preferredUsername); const { group, loading: groupLoading } = useGroupDiscussionsList( - props.preferredUsername, + preferredUsername.value, { discussionsPage: page.value, discussionsLimit: DISCUSSIONS_PER_PAGE, @@ -100,7 +101,7 @@ const { group, loading: groupLoading } = useGroupDiscussionsList( ); const { person, loading: personLoading } = usePersonStatusGroup( - props.preferredUsername + preferredUsername.value ); const { t } = useI18n({ useScope: "global" }); diff --git a/js/src/views/Event/EditView.vue b/js/src/views/Event/EditView.vue index 19ca5b977..4a00cf7c6 100644 --- a/js/src/views/Event/EditView.vue +++ b/js/src/views/Event/EditView.vue @@ -127,7 +127,7 @@ { refetchEvent({ uuid: newUUid }); diff --git a/js/src/views/Event/MyEventsView.vue b/js/src/views/Event/MyEventsView.vue index 211c506ba..50bc11b20 100644 --- a/js/src/views/Event/MyEventsView.vue +++ b/js/src/views/Event/MyEventsView.vue @@ -188,7 +188,7 @@ (); +const preferredUsername = computed(() => props.preferredUsername); + const page = useRouteQuery("page", 1, integerTransformer); const pending = useRouteQuery("pending", false, booleanTransformer); @@ -241,5 +243,5 @@ const personMemberships = computed( () => person.value?.memberships ?? { total: 0, elements: [] } ); -const { person } = usePersonStatusGroup(props.preferredUsername); +const { person } = usePersonStatusGroup(preferredUsername.value); diff --git a/js/src/views/Group/GroupMembers.vue b/js/src/views/Group/GroupMembers.vue index ce7018365..56fdbc4a6 100644 --- a/js/src/views/Group/GroupMembers.vue +++ b/js/src/views/Group/GroupMembers.vue @@ -275,6 +275,7 @@ useHead({ }); const props = defineProps<{ preferredUsername: string }>(); +const preferredUsername = computed(() => props.preferredUsername); const emit = defineEmits(["sort"]); @@ -440,7 +441,7 @@ const { { query: GROUP_MEMBERS, variables: { - groupName: props.preferredUsername, + groupName: preferredUsername.value, page: page.value, limit: MEMBERS_PER_PAGE, roles: roles.value, @@ -547,5 +548,5 @@ const personMemberships = computed( () => person.value?.memberships ?? { total: 0, elements: [] } ); -const { person } = usePersonStatusGroup(props.preferredUsername); +const { person } = usePersonStatusGroup(preferredUsername.value); diff --git a/js/src/views/Group/GroupSettings.vue b/js/src/views/Group/GroupSettings.vue index 322ba189a..66b490f42 100644 --- a/js/src/views/Group/GroupSettings.vue +++ b/js/src/views/Group/GroupSettings.vue @@ -189,7 +189,7 @@ import PictureUpload from "@/components/PictureUpload.vue"; import { GroupVisibility, MemberRole, Openness } from "@/types/enums"; import { IGroup, usernameWithDomain, displayName } from "@/types/actor"; -import { Address, IAddress } from "@/types/address.model"; +import { IAddress } from "@/types/address.model"; import { ServerParseError } from "@apollo/client/link/http"; import { ErrorResponse } from "@apollo/client/link/error"; import RouteName from "@/router/name"; @@ -218,14 +218,11 @@ const FullAddressAutoComplete = defineAsyncComponent( ); const props = defineProps<{ preferredUsername: string }>(); +const preferredUsername = computed(() => props.preferredUsername); const { currentActor } = useCurrentActorClient(); -const { - group, - loading, - onResult: onGroupResult, -} = useGroup(props.preferredUsername); +const { group, loading, onResult: onGroupResult } = useGroup(preferredUsername); const { t } = useI18n({ useScope: "global" }); @@ -395,7 +392,7 @@ const personMemberships = computed( () => person.value?.memberships ?? { total: 0, elements: [] } ); -const { person } = usePersonStatusGroup(props.preferredUsername); +const { person } = usePersonStatusGroup(preferredUsername); const dialog = inject("dialog"); diff --git a/js/src/views/Group/GroupView.vue b/js/src/views/Group/GroupView.vue index 47f93e282..cf092bb67 100644 --- a/js/src/views/Group/GroupView.vue +++ b/js/src/views/Group/GroupView.vue @@ -703,22 +703,22 @@ const props = defineProps<{ preferredUsername: string; }>(); +const preferredUsername = computed(() => props.preferredUsername); + const { anonymousReportsConfig } = useAnonymousReportsConfig(); const { currentActor } = useCurrentActorClient(); const { group, loading: groupLoading, refetch: refetchGroup, -} = useGroup(props.preferredUsername, { afterDateTime: new Date() }); +} = useGroup(preferredUsername, { afterDateTime: new Date() }); const router = useRouter(); -const { group: discussionGroup } = useGroupDiscussionsList( - props.preferredUsername -); -const { group: resourcesGroup } = useGroupResourcesList( - props.preferredUsername, - { resourcesPage: 1, resourcesLimit: 3 } -); +const { group: discussionGroup } = useGroupDiscussionsList(preferredUsername); +const { group: resourcesGroup } = useGroupResourcesList(preferredUsername, { + resourcesPage: 1, + resourcesLimit: 3, +}); const { t } = useI18n({ useScope: "global" }); diff --git a/js/src/views/OAuth/DeviceActivationView.vue b/js/src/views/OAuth/DeviceActivationView.vue index f8e313b25..6ed5dd631 100644 --- a/js/src/views/OAuth/DeviceActivationView.vue +++ b/js/src/views/OAuth/DeviceActivationView.vue @@ -27,10 +27,12 @@ > (), { isUpdate: false } ); +const preferredUsername = computed(() => props.preferredUsername); const { currentActor } = useCurrentActorClient(); -const { group } = useGroup(props.preferredUsername); +const { group } = useGroup(preferredUsername); const { result: postResult, loading: postLoading } = useQuery<{ post: IPost; diff --git a/js/src/views/Resources/ResourceFolder.vue b/js/src/views/Resources/ResourceFolder.vue index fdcdaaa7c..a51938337 100644 --- a/js/src/views/Resources/ResourceFolder.vue +++ b/js/src/views/Resources/ResourceFolder.vue @@ -36,9 +36,12 @@ :resources="resource.children.elements" :isRoot="resource.path === '/'" :group="resource.actor" - @delete="(resourceID: string) => deleteResource({ - id: resourceID, - })" + @delete=" + (resourceID: string) => + deleteResource({ + id: resourceID, + }) + " @update="updateResource" @rename="handleRename" @move="handleMove" diff --git a/js/src/views/SearchView.vue b/js/src/views/SearchView.vue index 5d76def9c..46faf5bf3 100644 --- a/js/src/views/SearchView.vue +++ b/js/src/views/SearchView.vue @@ -852,6 +852,7 @@ const arrayTransformer: RouteQueryTransformer = { const props = defineProps<{ tag?: string; }>(); +const tag = computed(() => props.tag); const page = useRouteQuery("page", 1, integerTransformer); const eventPage = useRouteQuery("eventPage", 1, integerTransformer); @@ -864,7 +865,7 @@ const distance = useRouteQuery("distance", "10_km"); const when = useRouteQuery("when", "any"); const contentType = useRouteQuery( "contentType", - props.tag ? ContentType.EVENTS : ContentType.ALL, + tag.value ? ContentType.EVENTS : ContentType.ALL, enumTransformer(ContentType) ); @@ -1286,7 +1287,7 @@ const { result: searchElementsResult, loading: searchLoading } = useQuery<{ searchGroups: Paginate>; }>(SEARCH_EVENTS_AND_GROUPS, () => ({ term: searchDebounced.value, - tags: props.tag, + tags: tag.value, location: geoHashLocation.value, beginsOn: start.value, endsOn: end.value, diff --git a/js/src/views/Settings/NotificationsView.vue b/js/src/views/Settings/NotificationsView.vue index d367469b7..3e684b6f0 100644 --- a/js/src/views/Settings/NotificationsView.vue +++ b/js/src/views/Settings/NotificationsView.vue @@ -248,10 +248,12 @@ tag="a" icon-left="rss" @click=" - (e: Event) => copyURL(e, tokenToURL(feedToken.token, 'atom'), 'atom') + (e: Event) => + copyURL(e, tokenToURL(feedToken.token, 'atom'), 'atom') " @keyup.enter=" - (e: Event) => copyURL(e, tokenToURL(feedToken.token, 'atom'), 'atom') + (e: Event) => + copyURL(e, tokenToURL(feedToken.token, 'atom'), 'atom') " :href="tokenToURL(feedToken.token, 'atom')" target="_blank" @@ -268,10 +270,12 @@ ( USER_NOTIFICATIONS ); const loggedUser = computed(() => loggedUserResult.value?.loggedUser); -const feedTokens = computed(() => - loggedUser.value?.feedTokens.filter( - (token: IFeedToken) => token.actor === null - ) +const feedTokens = computed( + () => + loggedUser.value?.feedTokens.filter( + (token: IFeedToken) => token.actor === null + ) ); const { result: webPushEnabledResult } = useQuery<{ diff --git a/js/src/views/Todos/TodoLists.vue b/js/src/views/Todos/TodoLists.vue index 4d3805218..b3f7b8108 100644 --- a/js/src/views/Todos/TodoLists.vue +++ b/js/src/views/Todos/TodoLists.vue @@ -75,8 +75,9 @@ import { useI18n } from "vue-i18n"; import { useMutation } from "@vue/apollo-composable"; const props = defineProps<{ preferredUsername: string }>(); +const preferredUsername = computed(() => props.preferredUsername); -const { group } = useGroup(props.preferredUsername); +const { group } = useGroup(preferredUsername); const { t } = useI18n({ useScope: "global" }); diff --git a/js/src/views/User/ResendConfirmation.vue b/js/src/views/User/ResendConfirmation.vue index aa811c174..ec5457dee 100644 --- a/js/src/views/User/ResendConfirmation.vue +++ b/js/src/views/User/ResendConfirmation.vue @@ -13,7 +13,7 @@ required type="email" id="emailAddress" - v-model="credentials.email" + v-model="emailValue" />

@@ -34,7 +34,7 @@ {{ $t( "If an account with this email exists, we just sent another confirmation email to {email}", - { email: credentials.email } + { email: emailValue } ) }} @@ -50,7 +50,7 @@ diff --git a/js/src/views/User/SendPasswordReset.vue b/js/src/views/User/SendPasswordReset.vue index b0ea7dda3..76870f553 100644 --- a/js/src/views/User/SendPasswordReset.vue +++ b/js/src/views/User/SendPasswordReset.vue @@ -25,7 +25,7 @@ aria-required="true" required type="email" - v-model="credentials.email" + v-model="emailValue" />

@@ -41,7 +41,7 @@ {{ t("We just sent an email to {email}", { - email: credentials.email, + email: emailValue, }) }} @@ -57,7 +57,7 @@