From 69dfe4954d0e59917aa2d79f712936679c864e57 Mon Sep 17 00:00:00 2001 From: dartcafe Date: Thu, 3 Oct 2024 09:40:25 +0200 Subject: [PATCH 1/7] repplace shareStore by sessionStore.share Signed-off-by: dartcafe --- lib/Controller/UserController.php | 1 + src/components/Cards/modules/CardRegister.vue | 8 +- src/components/Poll/PollInformation.vue | 8 +- src/components/Public/PublicRegisterModal.vue | 26 +-- .../Subscription/ActionSubscription.vue | 8 +- src/components/Subscription/Subscription.vue | 8 +- .../User/ActionInputDisplayName.vue | 12 +- .../User/ActionInputEmailAddress.vue | 14 +- src/components/User/UserMenu.vue | 40 ++-- src/router.ts | 4 +- src/stores/session.ts | 131 ++++++++++--- src/stores/share.ts | 174 ------------------ src/stores/shares.ts | 21 ++- 13 files changed, 191 insertions(+), 264 deletions(-) delete mode 100644 src/stores/share.ts diff --git a/lib/Controller/UserController.php b/lib/Controller/UserController.php index 383e80eb0..430d54167 100644 --- a/lib/Controller/UserController.php +++ b/lib/Controller/UserController.php @@ -67,6 +67,7 @@ public function getSession(): JSONResponse { 'currentUser' => $this->acl->getCurrentUser(), 'appPermissions' => $this->acl->getPermissionsArray(), 'appSettings' => $this->acl->getAppSettings(), + 'share' => null, ]); } diff --git a/src/components/Cards/modules/CardRegister.vue b/src/components/Cards/modules/CardRegister.vue index 36f133186..fce6819a7 100644 --- a/src/components/Cards/modules/CardRegister.vue +++ b/src/components/Cards/modules/CardRegister.vue @@ -8,16 +8,16 @@ import { CardDiv } from '../../Base/index.js' import ActionRegister from '../../Actions/modules/ActionRegister.vue' import { t } from '@nextcloud/l10n' - import { useShareStore } from '../../../stores/share.ts' + import { useSessionStore } from '../../../stores/session.ts' - const shareStore = useShareStore() + const sessionStore = useSessionStore() const cardType = 'info' const registrationInvitationText = computed(() => { - if (shareStore.publicPollEmail === 'mandatory') { + if (sessionStore.share.publicPollEmail === 'mandatory') { return t('polls', 'To participate, register with your email address and a name.') } - if (shareStore.publicPollEmail === 'optional') { + if (sessionStore.share.publicPollEmail === 'optional') { return t('polls', 'To participate, register a name and optionally with your email address.') } return t('polls', 'To participate, register with a name.') diff --git a/src/components/Poll/PollInformation.vue b/src/components/Poll/PollInformation.vue index d143bd7be..a77deca77 100644 --- a/src/components/Poll/PollInformation.vue +++ b/src/components/Poll/PollInformation.vue @@ -10,7 +10,7 @@ import { NcUserBubble } from '@nextcloud/vue' import { BadgeDiv } from '../Base/index.js' - import { useShareStore } from '../../stores/share.ts' + import { useSessionStore } from '../../stores/session.ts' import { usePollStore, AccessType } from '../../stores/poll.ts' import { useSubscriptionStore } from '../../stores/subscription.ts' import { useOptionsStore } from '../../stores/options.ts' @@ -36,7 +36,7 @@ import { MaybeIcon } from '../AppIcons/index.js' const pollStore = usePollStore() - const shareStore = useShareStore() + const sessionStore = useSessionStore() const subscriptionStore = useSubscriptionStore() const optionsStore = useOptionsStore() const votesStore = useVotesStore() @@ -173,11 +173,11 @@ {{ n('polls', 'Only %n vote per option.', 'Only %n votes per option.', pollStore.configuration.maxVotesPerOption) }} - + - {{ shareStore.user.emailAddress }} + {{ sessionStore.share.user.emailAddress }}