mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
visgraph: adding node whitelist
This commit is contained in:
parent
1a00798da0
commit
9a00e13532
@ -143,7 +143,7 @@ export default {
|
|||||||
...mapGetters(['nodes', 'edges']),
|
...mapGetters(['nodes', 'edges']),
|
||||||
...mapState(['households', 'courses', 'excludedNodesIds', 'persons',
|
...mapState(['households', 'courses', 'excludedNodesIds', 'persons',
|
||||||
// not used
|
// not used
|
||||||
'links', 'relationships', 'personLoadedIds', 'householdLoadingIds', 'courseLoadedIds', 'relationshipLoadedIds',
|
'links', 'relationships', 'whitelistIds', 'personLoadedIds', 'householdLoadingIds', 'courseLoadedIds', 'relationshipLoadedIds',
|
||||||
]),
|
]),
|
||||||
|
|
||||||
visgraph_data() {
|
visgraph_data() {
|
||||||
|
@ -12,6 +12,7 @@ const persons = JSON.parse(container.dataset.persons)
|
|||||||
|
|
||||||
persons.forEach(person => {
|
persons.forEach(person => {
|
||||||
store.dispatch('addPerson', person)
|
store.dispatch('addPerson', person)
|
||||||
|
store.commit('markInWhitelist', person)
|
||||||
})
|
})
|
||||||
|
|
||||||
const app = createApp({
|
const app = createApp({
|
||||||
|
@ -13,6 +13,7 @@ const store = createStore({
|
|||||||
courses: [],
|
courses: [],
|
||||||
relationships: [],
|
relationships: [],
|
||||||
links: [],
|
links: [],
|
||||||
|
whitelistIds: [],
|
||||||
personLoadedIds: [],
|
personLoadedIds: [],
|
||||||
householdLoadingIds: [],
|
householdLoadingIds: [],
|
||||||
courseLoadedIds: [],
|
courseLoadedIds: [],
|
||||||
@ -44,6 +45,9 @@ const store = createStore({
|
|||||||
})
|
})
|
||||||
return edges
|
return edges
|
||||||
},
|
},
|
||||||
|
isInWhitelist: (state) => (person_id) => {
|
||||||
|
return state.whitelistIds.includes(person_id)
|
||||||
|
},
|
||||||
isHouseholdLoading: (state) => (household_id) => {
|
isHouseholdLoading: (state) => (household_id) => {
|
||||||
return state.householdLoadingIds.includes(household_id)
|
return state.householdLoadingIds.includes(household_id)
|
||||||
},
|
},
|
||||||
@ -151,6 +155,9 @@ const store = createStore({
|
|||||||
},
|
},
|
||||||
|
|
||||||
//// id markers
|
//// id markers
|
||||||
|
markInWhitelist(state, person) {
|
||||||
|
state.whitelistIds.push(person.id)
|
||||||
|
},
|
||||||
markPersonLoaded(state, id) {
|
markPersonLoaded(state, id) {
|
||||||
state.personLoadedIds.push(id)
|
state.personLoadedIds.push(id)
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user