From 96090ea98f070f8844bcd2c70e26bd5c82331812 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 15 Aug 2022 21:03:27 +0300 Subject: [PATCH 1/3] fix anon user issues --- src/modules/serverSideStorage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/serverSideStorage.js b/src/modules/serverSideStorage.js index 5581783fa..eb089be67 100644 --- a/src/modules/serverSideStorage.js +++ b/src/modules/serverSideStorage.js @@ -26,7 +26,7 @@ export const defaultState = { collapseNav: false }, collections: { - pinnedNavItems: ['home', 'dms', 'chats', 'about'] + pinnedNavItems: ['home', 'dms', 'chats'] } }, // raw data @@ -262,7 +262,7 @@ export const mutations = { const live = userData.storage state.raw = live let cache = state.cache - if (cache._user !== userData.fqn) { + if (cache && cache._user !== userData.fqn) { console.warn('cache belongs to another user! reinitializing local cache!') cache = null } From 14292d7ed12a806efcf766895bc1c3aa56fd53f8 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 15 Aug 2022 21:56:07 +0300 Subject: [PATCH 2/3] edit mode --- src/boot/routes.js | 2 +- src/components/nav_panel/nav_panel.js | 10 ++++++++-- src/components/nav_panel/nav_panel.vue | 14 +++++++++++--- src/i18n/en.json | 3 ++- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/boot/routes.js b/src/boot/routes.js index 178bb937a..39372ab94 100644 --- a/src/boot/routes.js +++ b/src/boot/routes.js @@ -80,7 +80,7 @@ export default (store) => { { name: 'lists', path: '/lists', component: Lists }, { name: 'lists-timeline', path: '/lists/:id', component: ListsTimeline }, { name: 'lists-edit', path: '/lists/:id/edit', component: ListsEdit }, - { name: 'edit-navigation', path: '/nav-edit', component: NavPanel, props: () => ({ forceExpand: true }), beforeEnter: validateAuthenticatedRoute } + { name: 'edit-navigation', path: '/nav-edit', component: NavPanel, props: () => ({ forceExpand: true, forceEditMode: true }), beforeEnter: validateAuthenticatedRoute } ] if (store.state.instance.pleromaChatMessagesAvailable) { diff --git a/src/components/nav_panel/nav_panel.js b/src/components/nav_panel/nav_panel.js index b11a258bb..1e68561fd 100644 --- a/src/components/nav_panel/nav_panel.js +++ b/src/components/nav_panel/nav_panel.js @@ -4,6 +4,7 @@ import { TIMELINES, ROOT_ITEMS } from 'src/components/navigation/navigation.js' import { getListEntries, filterNavigation } from 'src/components/navigation/filter.js' import NavigationEntry from 'src/components/navigation/navigation_entry.vue' import NavigationPins from 'src/components/navigation/navigation_pins.vue' +import Checkbox from 'src/components/checkbox/checkbox.vue' import { library } from '@fortawesome/fontawesome-svg-core' import { @@ -34,16 +35,18 @@ library.add( faList ) const NavPanel = { - props: ['forceExpand'], + props: ['forceExpand', 'forceEditMode'], created () { }, components: { ListsMenuContent, NavigationEntry, - NavigationPins + NavigationPins, + Checkbox }, data () { return { + editMode: false, showTimelines: false, showLists: false, timelinesList: Object.entries(TIMELINES).map(([k, v]) => ({ ...v, name: k })), @@ -57,6 +60,9 @@ const NavPanel = { toggleLists () { this.showLists = !this.showLists }, + toggleEditMode () { + this.editMode = !this.editMode + }, toggleCollapse () { this.$store.commit('setPreference', { path: 'simple.collapseNav', value: !this.collapsed }) this.$store.dispatch('pushServerSideStorage') diff --git a/src/components/nav_panel/nav_panel.vue b/src/components/nav_panel/nav_panel.vue index 077f97fc3..01a407c13 100644 --- a/src/components/nav_panel/nav_panel.vue +++ b/src/components/nav_panel/nav_panel.vue @@ -46,7 +46,7 @@ @@ -83,7 +83,7 @@ class="timelines-background" > @@ -91,9 +91,17 @@ + diff --git a/src/i18n/en.json b/src/i18n/en.json index f042d5621..a7c86e6c6 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -150,7 +150,8 @@ "timelines": "Timelines", "chats": "Chats", "lists": "Lists", - "edit_nav_mobile": "Customize navigation bar" + "edit_nav_mobile": "Customize navigation bar", + "edit_pinned": "Edit pinned items" }, "notifications": { "broken_favorite": "Unknown status, searching for it…", From 50f5afbce1f2bc4dbd0ddf6c951c7e519dfc6ce3 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 15 Aug 2022 23:19:33 +0300 Subject: [PATCH 3/3] add and remove users to/from lists from their profile --- .../account_actions/account_actions.js | 4 +- .../account_actions/account_actions.vue | 1 + src/components/lists_edit/lists_edit.js | 10 +- src/components/lists_new/lists_new.js | 4 +- src/components/popover/popover.js | 25 ++++- src/i18n/en.json | 3 +- src/modules/lists.js | 97 +++++++++++++------ src/modules/users.js | 9 ++ src/services/api/api.service.js | 35 ++++--- .../entity_normalizer.service.js | 1 + 10 files changed, 134 insertions(+), 55 deletions(-) diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js index 99762562c..735dd81c1 100644 --- a/src/components/account_actions/account_actions.js +++ b/src/components/account_actions/account_actions.js @@ -1,6 +1,7 @@ import { mapState } from 'vuex' import ProgressButton from '../progress_button/progress_button.vue' import Popover from '../popover/popover.vue' +import UserListMenu from 'src/components/user_list_menu/user_list_menu.vue' import { library } from '@fortawesome/fontawesome-svg-core' import { faEllipsisV @@ -19,7 +20,8 @@ const AccountActions = { }, components: { ProgressButton, - Popover + Popover, + UserListMenu }, methods: { showRepeats () { diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue index 23547f2c3..770740e0b 100644 --- a/src/components/account_actions/account_actions.vue +++ b/src/components/account_actions/account_actions.vue @@ -28,6 +28,7 @@ class="dropdown-divider" /> +