Skip to content

Commit

Permalink
Fix feature to add a selection on id or a search in titles on top of …
Browse files Browse the repository at this point in the history
…a filtered tree
  • Loading branch information
ErikVerheul committed Aug 3, 2024
1 parent 43462de commit 75e7e19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/views/coarse_product/c_filters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ import store from '../../../store/store.js'
const methods = {
/* Apply the AND logic to the included filters */
onApplyMyFilters() {
// return if a filer is already set or no filter is selected
// return if a filter is already set or no filter is selected
if (store.state.resetFilter || !this.filterOnReqAreas && !this.filterOnTeams && !this.filterOnState && !this.filterOnTime) return
// save node display state; scan all products
Expand Down
9 changes: 6 additions & 3 deletions src/store/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,12 +556,13 @@ const store = createStore({
// the node was found in another product
commit('switchCurrentProduct', prevSelectedNode.productId)
} else {
commit('restoreTreeView', { type: 'findId', nodesToScan: undefined })
if (!store.resetFilter) {
commit('restoreTreeView', { type: 'findId', nodesToScan: undefined })
} else commit('restoreTreeView', { type: 'filter', nodesToScan: state.helpersRef.getCurrentProductModel() })
}
commit('updateNodesAndCurrentDoc', { selectNode: prevSelectedNode })
commit('addToEventList', { txt: 'The search for an item on Id is cleared', severity: SEV.INFO })
state.itemId = ''
console.log('resetFindOnId: resetSearchOnId is set to null')
state.resetSearchOnId = null
}
})
Expand All @@ -580,7 +581,9 @@ const store = createStore({
// load and select the previous selected document
dispatch('loadDoc', {
id: prevSelectedNode._id, toDispatch, onSuccessCallback: () => {
commit('restoreTreeView', { type: 'titles', nodesToScan: state.resetSearchOnTitle.productNodes })
if (!store.resetFilter) {
commit('restoreTreeView', { type: 'titles', nodesToScan: state.resetSearchOnTitle.productNodes })
} else commit('restoreTreeView', { type: 'filter', nodesToScan: state.helpersRef.getCurrentProductModel() })
commit('updateNodesAndCurrentDoc', { selectNode: prevSelectedNode })
commit('addToEventList', { txt: `The search for item titles is cleared`, severity: SEV.INFO })
state.keyword = ''
Expand Down

0 comments on commit 75e7e19

Please sign in to comment.