Widget: UseCaseList: Difference between revisions
From LINKS Community Center
Eschmidt (talk | contribs) No edit summary |
Eschmidt (talk | contribs) No edit summary |
||
Line 314: | Line 314: | ||
const filterState = {}; | const filterState = {}; | ||
const | const selectedTypes = Array.from(document.querySelectorAll('#type-filter input[type="checkbox"]:checked')) | ||
.map(checkbox => checkbox.value); | |||
filterState.type = | if (selectedTypes.length > 0) filterState.type = selectedTypes; | ||
const | const selectedEvents = Array.from(document.querySelectorAll('#event-type-filter input[type="checkbox"]:checked')) | ||
.map(checkbox => checkbox.value); | |||
filterState.eventType = | if (selectedEvents.length > 0) filterState.eventType = selectedEvents; | ||
const | const selectedCats = Array.from(document.querySelectorAll('#category-filter input[type="checkbox"]:checked')) | ||
.map(checkbox => checkbox.value); | |||
filterState.category = | if (selectedCats.length > 0) filterState.category = selectedCats; | ||
const | const selectedScales = Array.from(document.querySelectorAll('#scale-filter input[type="checkbox"]:checked')) | ||
.map(checkbox => checkbox.value); | |||
filterState.scale = | if (selectedScales.length > 0) filterState.scale = selectedScales; | ||
const | const selectedThematics = Array.from(document.querySelectorAll('#thematic-filter input[type="checkbox"]:checked')) | ||
.map(checkbox => checkbox.value); | |||
filterState.thematics = | if (selectedThematics.length > 0) filterState.thematics = selectedThematics; | ||
const | const selectedPhases = Array.from(document.querySelectorAll('#phases-filter input[type="checkbox"]:checked')) | ||
.map(checkbox => checkbox.value); | |||
filterState.phases = | if (selectedPhases.length > 0) filterState.phases = selectedPhases; | ||
table.setFilter(useCaseFilter, filterState); | table.setFilter(useCaseFilter, filterState); | ||
Line 351: | Line 351: | ||
const typeCheck = filterState.type | const typeCheck = filterState.type | ||
? | ? filterState.type.every(type => useCase[TYPE_PROP].includes(type)) | ||
: true; | : true; | ||
const eventTypeCheck = filterState.eventType | const eventTypeCheck = filterState.eventType | ||
? | ? filterState.eventType.every(event => useCase[EVENT_PROP].includes(event)) | ||
: true; | : true; | ||
const categoryCheck = filterState.category | const categoryCheck = filterState.category | ||
? useCase[CAT_PROP] | ? filterState.category.every(cat => useCase[CAT_PROP].includes(cat)) | ||
: true; | : true; | ||
const scaleCheck = filterState.scale | const scaleCheck = filterState.scale | ||
? useCase[SCALE_PROP]. | ? filterState.scale.every(scale => useCase[SCALE_PROP].includes(scale)) | ||
: true; | : true; | ||
const thematicCheck = filterState.thematics | const thematicCheck = filterState.thematics | ||
? useCase[THEME_PROP] | ? filterState.thematics.every(thematic => useCase[THEME_PROP].includes(thematic)) | ||
: true; | : true; | ||
const phaseCheck = filterState.phases | const phaseCheck = filterState.phases | ||
? | ? filterState.phases.every(phase => useCase[PHASE_PROP].includes(phase)) | ||
: true; | : true; | ||
return typeCheck && eventTypeCheck && categoryCheck && scaleCheck && thematicCheck && phaseCheck; | return typeCheck && eventTypeCheck && categoryCheck && scaleCheck && thematicCheck && phaseCheck; |
Revision as of 15:23, 21 March 2023
Current version of the List of Use Cases.
currently in use!