Skip to content
Snippets Groups Projects
Commit 293f6472 authored by Bastien Abadie's avatar Bastien Abadie
Browse files

Merge branch 'fix-typeerror-select' into 'master'

Avoid TypeErrors on FolderPicker select mutation

Closes #304

See merge request !626
parents fb11bacf 62810090
No related branches found
No related tags found
1 merge request!626Avoid TypeErrors on FolderPicker select mutation
......@@ -54,7 +54,7 @@ export const mutations = {
if (folder) Vue.set(state.folderPagination, folder, pagination)
else Vue.set(state.corpusPagination, corpus, pagination)
},
select (state, { id = null } = {}) {
select (state, id = null) {
state.selectedFolderId = id
},
reset (state) {
......
......@@ -149,7 +149,7 @@ describe('folderpicker', () => {
describe('select', () => {
it('selects a folder', () => {
const state = initialState()
mutations.select(state, { id: 'folderid', name: 'Parent folder' })
mutations.select(state, 'folderid')
assert.strictEqual(state.selectedFolderId, 'folderid')
})
......
......@@ -17,7 +17,7 @@
<a
class="line"
:class="{ 'has-text-primary': selected }"
v-on:click="select(folder)"
v-on:click="select(folder.id)"
>
<span class="has-text-grey">
{{ typeName(folder.type) | truncateShort }}
......
......@@ -53,7 +53,7 @@ export default {
}),
mounted () {
// Deselect any previously selected folders from previous usage of this component
this.select({ id: null })
this.select()
},
methods: {
...mapMutations('folderpicker', ['select'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment