aboutsummaryrefslogtreecommitdiff
path: root/src/components/lists_new/lists_new.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2022-08-30 23:54:16 +0300
committerHenry Jameson <me@hjkos.com>2022-08-30 23:54:16 +0300
commit887fac5addc2416504593cb62a52a3b08f3638e2 (patch)
tree74711c1bc7ec9fe991ad15d51b3ecfab7e5e0749 /src/components/lists_new/lists_new.js
parentaf734afe3694ff3c77d4457b93b02309c4f55d6d (diff)
parent8b25febe36a97d113c846928dab22ab36158ee07 (diff)
Merge remote-tracking branch 'origin/develop' into scrolltotop
* origin/develop: (59 commits) a11y Use dedicated indicator for non-ascii domain names add a favorites "timeline" shortcut refactor navigation-entry and use them in other nav items Update dependency sinon-chai to v3 Update dependency semver to v7 Update dependency vue-router to v4.1.5 Update dependency eslint to v8.23.0 Update dependency vue-template-compiler to v2.7.10 Update dependency @vue/babel-helper-vue-jsx-merge-props to v1.4.0 Update dependency eslint-plugin-promise to v6.0.1 fix lists edit page change ugly checkbox to a list element that doesn't look too much out of place a11y squeeze/stretch pinned items as long as there's enough space for it, hide items that won't fitc Remove isparta lint fix being unable to edit timeline pins on mobile aria fix mobile side drawer causing issues ...
Diffstat (limited to 'src/components/lists_new/lists_new.js')
-rw-r--r--src/components/lists_new/lists_new.js79
1 files changed, 0 insertions, 79 deletions
diff --git a/src/components/lists_new/lists_new.js b/src/components/lists_new/lists_new.js
deleted file mode 100644
index 63dc28ad..00000000
--- a/src/components/lists_new/lists_new.js
+++ /dev/null
@@ -1,79 +0,0 @@
-import { mapState, mapGetters } from 'vuex'
-import BasicUserCard from '../basic_user_card/basic_user_card.vue'
-import UserAvatar from '../user_avatar/user_avatar.vue'
-import ListsUserSearch from '../lists_user_search/lists_user_search.vue'
-import { library } from '@fortawesome/fontawesome-svg-core'
-import {
- faSearch,
- faChevronLeft
-} from '@fortawesome/free-solid-svg-icons'
-
-library.add(
- faSearch,
- faChevronLeft
-)
-
-const ListsNew = {
- components: {
- BasicUserCard,
- UserAvatar,
- ListsUserSearch
- },
- data () {
- return {
- title: '',
- userIds: [],
- selectedUserIds: []
- }
- },
- computed: {
- users () {
- return this.userIds.map(userId => this.findUser(userId))
- },
- selectedUsers () {
- return this.selectedUserIds.map(userId => this.findUser(userId))
- },
- ...mapState({
- currentUser: state => state.users.currentUser
- }),
- ...mapGetters(['findUser'])
- },
- methods: {
- goBack () {
- this.$emit('cancel')
- },
- onInput () {
- this.search(this.query)
- },
- selectUser (user) {
- if (this.selectedUserIds.includes(user.id)) {
- this.removeUser(user.id)
- } else {
- this.addUser(user)
- }
- },
- isSelected (user) {
- return this.selectedUserIds.includes(user.id)
- },
- addUser (user) {
- this.selectedUserIds.push(user.id)
- },
- removeUser (userId) {
- this.selectedUserIds = this.selectedUserIds.filter(id => id !== userId)
- },
- onResults (results) {
- this.userIds = results
- },
- createList () {
- // the API has two different endpoints for "creating a list with a name"
- // and "updating the accounts on the list".
- this.$store.dispatch('createList', { title: this.title })
- .then((list) => {
- this.$store.dispatch('setListAccounts', { id: list.id, accountIds: this.selectedUserIds })
- this.$router.push({ name: 'lists-timeline', params: { id: list.id } })
- })
- }
- }
-}
-
-export default ListsNew