From 171f6f08943dd1d87120df3e4894ddcfd5e1d246 Mon Sep 17 00:00:00 2001 From: Alexander Tumin Date: Sat, 6 Aug 2022 17:26:43 +0300 Subject: Lists implementation --- src/components/lists/lists.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/components/lists/lists.js (limited to 'src/components/lists/lists.js') diff --git a/src/components/lists/lists.js b/src/components/lists/lists.js new file mode 100644 index 00000000..791b99b2 --- /dev/null +++ b/src/components/lists/lists.js @@ -0,0 +1,32 @@ +import ListsCard from '../lists_card/lists_card.vue' +import ListsNew from '../lists_new/lists_new.vue' + +const Lists = { + data () { + return { + isNew: false + } + }, + components: { + ListsCard, + ListsNew + }, + created () { + this.$store.dispatch('startFetchingLists') + }, + computed: { + lists () { + return this.$store.state.lists.allLists + } + }, + methods: { + cancelNewList () { + this.isNew = false + }, + newList () { + this.isNew = true + } + } +} + +export default Lists -- cgit v1.2.3-70-g09d2 From ebe095bd769481cc114009e8193494d482f9ff4d Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 15 Aug 2022 20:43:38 +0300 Subject: fix prod build again + fetch lists (and follow request) on login, stop fetching on logout, don't start fetching in components --- src/components/lists/lists.js | 3 --- src/components/lists_menu/lists_menu_content.js | 11 +---------- src/components/nav_panel/nav_panel.js | 3 --- src/modules/users.js | 7 +++++++ 4 files changed, 8 insertions(+), 16 deletions(-) (limited to 'src/components/lists/lists.js') diff --git a/src/components/lists/lists.js b/src/components/lists/lists.js index 791b99b2..9aed37f7 100644 --- a/src/components/lists/lists.js +++ b/src/components/lists/lists.js @@ -11,9 +11,6 @@ const Lists = { ListsCard, ListsNew }, - created () { - this.$store.dispatch('startFetchingLists') - }, computed: { lists () { return this.$store.state.lists.allLists diff --git a/src/components/lists_menu/lists_menu_content.js b/src/components/lists_menu/lists_menu_content.js index 99fea0f0..97b32210 100644 --- a/src/components/lists_menu/lists_menu_content.js +++ b/src/components/lists_menu/lists_menu_content.js @@ -1,20 +1,11 @@ import { mapState } from 'vuex' import NavigationEntry from 'src/components/navigation/navigation_entry.vue' - -export const getListEntries = state => state.lists.allLists.map(list => ({ - name: 'list-' + list.id, - routeObject: { name: 'lists-timeline', params: { id: list.id } }, - labelRaw: list.title, - iconLetter: list.title[0] -})) +import { getListEntries } from 'src/components/navigation/filter.js' export const ListsMenuContent = { props: [ 'showPin' ], - created () { - this.$store.dispatch('startFetchingLists') - }, components: { NavigationEntry }, diff --git a/src/components/nav_panel/nav_panel.js b/src/components/nav_panel/nav_panel.js index aeccd8a7..b11a258b 100644 --- a/src/components/nav_panel/nav_panel.js +++ b/src/components/nav_panel/nav_panel.js @@ -36,9 +36,6 @@ library.add( const NavPanel = { props: ['forceExpand'], created () { - if (this.currentUser && this.currentUser.locked) { - this.$store.dispatch('startFetchingFollowRequests') - } }, components: { ListsMenuContent, diff --git a/src/modules/users.js b/src/modules/users.js index fe92d697..c13beb29 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -502,6 +502,7 @@ const users = { store.dispatch('stopFetchingTimeline', 'friends') store.commit('setBackendInteractor', backendInteractorService(store.getters.getToken())) store.dispatch('stopFetchingNotifications') + store.dispatch('stopFetchingLists') store.dispatch('stopFetchingFollowRequests') store.commit('clearNotifications') store.commit('resetStatuses') @@ -556,6 +557,12 @@ const users = { store.dispatch('startFetchingChats') } + store.dispatch('startFetchingLists') + + if (user.locked) { + store.dispatch('startFetchingFollowRequests') + } + if (store.getters.mergedConfig.useStreamingApi) { store.dispatch('fetchTimeline', 'friends', { since: null }) store.dispatch('fetchNotifications', { since: null }) -- cgit v1.2.3-70-g09d2 From faefd05c03d20a892a47c27550fe6e23978993c7 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 17 Aug 2022 20:21:10 +0300 Subject: create new list UI --- src/boot/routes.js | 1 + src/components/lists/lists.js | 4 +- src/components/lists/lists.vue | 24 ++++---- src/components/lists_edit/lists_edit.js | 28 ++++++++-- src/components/lists_edit/lists_edit.vue | 24 ++++++-- src/components/lists_new/lists_new.js | 79 -------------------------- src/components/lists_new/lists_new.vue | 95 -------------------------------- src/i18n/en.json | 4 +- 8 files changed, 61 insertions(+), 198 deletions(-) delete mode 100644 src/components/lists_new/lists_new.js delete mode 100644 src/components/lists_new/lists_new.vue (limited to 'src/components/lists/lists.js') diff --git a/src/boot/routes.js b/src/boot/routes.js index 39372ab9..bf009be6 100644 --- a/src/boot/routes.js +++ b/src/boot/routes.js @@ -80,6 +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: 'lists-edit', path: '/lists/new', component: ListsEdit }, { name: 'edit-navigation', path: '/nav-edit', component: NavPanel, props: () => ({ forceExpand: true, forceEditMode: true }), beforeEnter: validateAuthenticatedRoute } ] diff --git a/src/components/lists/lists.js b/src/components/lists/lists.js index 9aed37f7..56d68430 100644 --- a/src/components/lists/lists.js +++ b/src/components/lists/lists.js @@ -1,5 +1,4 @@ import ListsCard from '../lists_card/lists_card.vue' -import ListsNew from '../lists_new/lists_new.vue' const Lists = { data () { @@ -8,8 +7,7 @@ const Lists = { } }, components: { - ListsCard, - ListsNew + ListsCard }, computed: { lists () { diff --git a/src/components/lists/lists.vue b/src/components/lists/lists.vue index fcc56447..cb98b017 100644 --- a/src/components/lists/lists.vue +++ b/src/components/lists/lists.vue @@ -1,21 +1,15 @@