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