@import '../../_variables.scss';
-.input-wrap {
- display: flex;
- margin: 0.7em 0.5em 0.7em 0.5em;
+.ListsUserSearch {
+ .input-wrap {
+ display: flex;
+ margin: 0.7em 0.5em 0.7em 0.5em;
- input {
- width: 100%;
+ input {
+ width: 100%;
+ }
+ }
+
+ .search-icon {
+ margin-right: 0.3em;
}
}
-.search-icon {
- margin-right: 0.3em;
-}
-
diff --git a/src/components/mobile_post_status_button/mobile_post_status_button.js b/src/components/mobile_post_status_button/mobile_post_status_button.js
index ecf79b645..f7f96cd67 100644
--- a/src/components/mobile_post_status_button/mobile_post_status_button.js
+++ b/src/components/mobile_post_status_button/mobile_post_status_button.js
@@ -10,7 +10,8 @@ library.add(
const HIDDEN_FOR_PAGES = new Set([
'chats',
- 'chat'
+ 'chat',
+ 'lists-edit'
])
const MobilePostStatusButton = {
diff --git a/src/components/tab_switcher/tab_switcher.scss b/src/components/tab_switcher/tab_switcher.scss
index 7a086b260..d930368c0 100644
--- a/src/components/tab_switcher/tab_switcher.scss
+++ b/src/components/tab_switcher/tab_switcher.scss
@@ -17,6 +17,7 @@
overflow-x: auto;
padding-top: 5px;
flex-direction: row;
+ flex: 0 0 auto;
&::after, &::before {
content: '';
diff --git a/src/components/user_list_menu/user_list_menu.vue b/src/components/user_list_menu/user_list_menu.vue
index f90c5f87f..d8da16ea5 100644
--- a/src/components/user_list_menu/user_list_menu.vue
+++ b/src/components/user_list_menu/user_list_menu.vue
@@ -7,18 +7,18 @@
>
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 7352b75c8..733bd7ac9 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -80,6 +80,9 @@
"confirm": "Confirm",
"verify": "Verify",
"close": "Close",
+ "undo": "Undo",
+ "yes": "Yes",
+ "no": "No",
"peek": "Peek",
"role": {
"admin": "Admin",
@@ -981,7 +984,15 @@
"save": "Save changes",
"delete": "Delete list",
"following_only": "Limit to Following",
- "manage_lists": "Manage lists"
+ "manage_lists": "Manage lists",
+ "manage_members": "Manage list members",
+ "add_members": "Search for more users",
+ "remove_from_list": "Remove from list",
+ "add_to_list": "Add to list",
+ "is_in_list": "Already in list",
+ "editing_list": "Editing list {listTitle}",
+ "update_title": "Save Title",
+ "really_delete": "Really delete list?"
},
"file_type": {
"audio": "Audio",
diff --git a/src/modules/lists.js b/src/modules/lists.js
index d9fab9695..22fed8005 100644
--- a/src/modules/lists.js
+++ b/src/modules/lists.js
@@ -15,10 +15,11 @@ export const mutations = {
}
state.allListsObject[listId].title = title
- if (!find(state.allLists, { id: listId })) {
+ const entry = find(state.allLists, { id: listId })
+ if (!entry) {
state.allLists.push({ id: listId, title })
} else {
- find(state.allLists, { id: listId }).title = title
+ entry.title = title
}
},
setListAccounts (state, { listId, accountIds }) {
diff --git a/src/modules/serverSideStorage.js b/src/modules/serverSideStorage.js
index 08b11b0ba..56164be7a 100644
--- a/src/modules/serverSideStorage.js
+++ b/src/modules/serverSideStorage.js
@@ -132,7 +132,15 @@ export const _mergeFlags = (recent, stale, allFlagKeys) => {
}
const _mergeJournal = (...journals) => {
- const allJournals = flatten(journals.map(j => Array.isArray(j) ? j : []))
+ // Ignore invalid journal entries
+ const allJournals = flatten(
+ journals.map(j => Array.isArray(j) ? j : [])
+ ).filter(entry =>
+ Object.prototype.hasOwnProperty.call(entry, 'path') &&
+ Object.prototype.hasOwnProperty.call(entry, 'operation') &&
+ Object.prototype.hasOwnProperty.call(entry, 'args') &&
+ Object.prototype.hasOwnProperty.call(entry, 'timestamp')
+ )
const grouped = groupBy(allJournals, 'path')
const trimmedGrouped = Object.entries(grouped).map(([path, journal]) => {
// side effect
diff --git a/test/unit/specs/modules/lists.spec.js b/test/unit/specs/modules/lists.spec.js
index ac9af1b6b..e43106eac 100644
--- a/test/unit/specs/modules/lists.spec.js
+++ b/test/unit/specs/modules/lists.spec.js
@@ -17,13 +17,13 @@ describe('The lists module', () => {
const list = { id: '1', title: 'testList' }
const modList = { id: '1', title: 'anotherTestTitle' }
- mutations.setList(state, list)
- expect(state.allListsObject[list.id]).to.eql({ title: list.title })
+ mutations.setList(state, { listId: list.id, title: list.title })
+ expect(state.allListsObject[list.id]).to.eql({ title: list.title, accountIds: [] })
expect(state.allLists).to.have.length(1)
expect(state.allLists[0]).to.eql(list)
- mutations.setList(state, modList)
- expect(state.allListsObject[modList.id]).to.eql({ title: modList.title })
+ mutations.setList(state, { listId: modList.id, title: modList.title })
+ expect(state.allListsObject[modList.id]).to.eql({ title: modList.title, accountIds: [] })
expect(state.allLists).to.have.length(1)
expect(state.allLists[0]).to.eql(modList)
})
@@ -33,10 +33,10 @@ describe('The lists module', () => {
const list = { id: '1', accountIds: ['1', '2', '3'] }
const modList = { id: '1', accountIds: ['3', '4', '5'] }
- mutations.setListAccounts(state, list)
+ mutations.setListAccounts(state, { listId: list.id, accountIds: list.accountIds })
expect(state.allListsObject[list.id]).to.eql({ accountIds: list.accountIds })
- mutations.setListAccounts(state, modList)
+ mutations.setListAccounts(state, { listId: modList.id, accountIds: modList.accountIds })
expect(state.allListsObject[modList.id]).to.eql({ accountIds: modList.accountIds })
})
@@ -47,9 +47,9 @@ describe('The lists module', () => {
1: { title: 'testList', accountIds: ['1', '2', '3'] }
}
}
- const id = '1'
+ const listId = '1'
- mutations.deleteList(state, { id })
+ mutations.deleteList(state, { listId })
expect(state.allLists).to.have.length(0)
expect(state.allListsObject).to.eql({})
})
diff --git a/test/unit/specs/modules/serverSideStorage.spec.js b/test/unit/specs/modules/serverSideStorage.spec.js
index 7adce20d4..be249eede 100644
--- a/test/unit/specs/modules/serverSideStorage.spec.js
+++ b/test/unit/specs/modules/serverSideStorage.spec.js
@@ -107,7 +107,7 @@ describe('The serverSideStorage module', () => {
})
})
describe('setPreference', () => {
- const { setPreference, updateCache, addToCollection, removeFromCollection } = mutations
+ const { setPreference, updateCache, addCollectionPreference, removeCollectionPreference } = mutations
it('should set preference and update journal log accordingly', () => {
const state = cloneDeep(defaultState)
@@ -127,12 +127,12 @@ describe('The serverSideStorage module', () => {
const state = cloneDeep(defaultState)
setPreference(state, { path: 'simple.testing', value: 1 })
setPreference(state, { path: 'simple.testing', value: 2 })
- addToCollection(state, { path: 'collections.testing', value: 2 })
- removeFromCollection(state, { path: 'collections.testing', value: 2 })
+ addCollectionPreference(state, { path: 'collections.testing', value: 2 })
+ removeCollectionPreference(state, { path: 'collections.testing', value: 2 })
updateCache(state, { username: 'test' })
expect(state.prefsStorage.simple.testing).to.eql(2)
expect(state.prefsStorage.collections.testing).to.eql([])
- expect(state.prefsStorage._journal.length).to.eql(1)
+ expect(state.prefsStorage._journal.length).to.eql(2)
expect(state.prefsStorage._journal[0]).to.eql({
path: 'simple.testing',
operation: 'set',
@@ -141,14 +141,13 @@ describe('The serverSideStorage module', () => {
timestamp: state.prefsStorage._journal[0].timestamp
})
expect(state.prefsStorage._journal[1]).to.eql({
- path: 'collection.testing',
- operation: 'remove',
+ path: 'collections.testing',
+ operation: 'removeFromCollection',
args: [2],
// should have A timestamp, we don't really care what it is
timestamp: state.prefsStorage._journal[1].timestamp
})
})
- })
})
})