From 837d916dae94fb34195bf5471cc3839e202f1a36 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 11 Sep 2019 09:59:01 +0200 Subject: [PATCH] Add identity pickers on event creation & join Also it now saves current actor in localStorage and initalizes it in Apollo Cache (just like user stuff). This allows not relying on loggedPerson query anymore. Signed-off-by: Thomas Citharel --- js/src/App.vue | 44 +++++++--- js/src/apollo/user.ts | 20 +++++ js/src/components/Account/Identities.vue | 2 +- js/src/components/Editor.vue | 12 +-- .../components/Event/ParticipationModal.vue | 86 +++++++++++++++++++ js/src/components/NavBar.vue | 85 ++++++++++++------ js/src/components/Report/ReportModal.vue | 8 +- js/src/constants.ts | 2 +- js/src/graphql/actor.ts | 19 ++++ js/src/graphql/user.ts | 2 +- js/src/plugins/notifier.ts | 13 ++- js/src/types/actor/actor.model.ts | 2 +- js/src/types/event.model.ts | 4 +- js/src/utils/auth.ts | 25 +++++- js/src/views/Account/IdentityPicker.vue | 59 +++++++++++++ js/src/views/Account/MyAccount.vue | 31 +++---- js/src/views/Account/Profile.vue | 11 +-- .../views/Account/children/EditIdentity.vue | 78 ++++++++++++----- js/src/views/Event/Edit.vue | 25 ++++-- js/src/views/Event/Event.vue | 53 ++++++++---- js/src/views/Group/Create.vue | 12 +-- js/src/views/Group/Group.vue | 6 +- js/src/views/Moderation/Report.vue | 16 ++-- 23 files changed, 469 insertions(+), 146 deletions(-) create mode 100644 js/src/components/Event/ParticipationModal.vue create mode 100644 js/src/views/Account/IdentityPicker.vue diff --git a/js/src/App.vue b/js/src/App.vue index cf47cef3b..f08a75f4c 100644 --- a/js/src/App.vue +++ b/js/src/App.vue @@ -11,11 +11,20 @@ @@ -77,6 +100,7 @@ export default class App extends Vue { @import "~bulma/sass/components/pagination.sass"; @import "~bulma/sass/components/dropdown.sass"; @import "~bulma/sass/components/breadcrumb.sass"; +@import "~bulma/sass/components/list.sass"; @import "~bulma/sass/elements/box.sass"; @import "~bulma/sass/elements/button.sass"; @import "~bulma/sass/elements/container.sass"; diff --git a/js/src/apollo/user.ts b/js/src/apollo/user.ts index d13baaae5..be3273999 100644 --- a/js/src/apollo/user.ts +++ b/js/src/apollo/user.ts @@ -12,6 +12,13 @@ export function buildCurrentUserResolver(cache: ApolloCache { + const data = { + currentActor: { + id, + preferredUsername, + avatar, + name, + __typename: 'CurrentActor', + }, + }; + cache.writeData({ data }); }, }, diff --git a/js/src/components/Account/Identities.vue b/js/src/components/Account/Identities.vue index fb0870efa..2360c5105 100644 --- a/js/src/components/Account/Identities.vue +++ b/js/src/components/Account/Identities.vue @@ -55,7 +55,7 @@ + \ No newline at end of file diff --git a/js/src/components/NavBar.vue b/js/src/components/NavBar.vue index eb4348471..185c359ad 100644 --- a/js/src/components/NavBar.vue +++ b/js/src/components/NavBar.vue @@ -27,26 +27,42 @@