Difference between revisions of "Widget:DCTList"
From LINKS Community Center
Line 395: | Line 395: | ||
// Passing an empty object (as with applyFilters(true)) should result in an unfiltered table. | // Passing an empty object (as with applyFilters(true)) should result in an unfiltered table. | ||
− | // TEMPORARY!!! | + | // // TEMPORARY!!! |
− | const dctFunctions = Array.from(dct.functions.values()).map(val => val.functions).flat() | + | // const dctFunctions = Array.from(dct.functions.values()).map(val => val.functions).flat() |
− | // TEMPORARY!!! | + | // // TEMPORARY!!! |
− | // TODO: REWORK | + | // // TODO: REWORK |
− | // If filterState has a category but subfunctions array is empty, we only care about the category. | + | // // If filterState has a category but subfunctions array is empty, we only care about the category. |
− | const emptyCategories = [], nonemptyCategories = []; | + | // const emptyCategories = [], nonemptyCategories = []; |
− | Array.from(filterState.functions).forEach(([key, subs]) => { | + | // Array.from(filterState.functions).forEach(([key, subs]) => { |
− | + | // if (subs.length > 0) { nonemptyCategories.push(key); } else { emptyCategories.push(key); } | |
− | }); | + | // }); |
− | console.log(emptyCategories, nonemptyCategories) | + | // console.log(emptyCategories, nonemptyCategories) |
− | return true | + | // return true |
// Otherwise, we only care about the subfunctions and category shouldn't be checked. | // Otherwise, we only care about the subfunctions and category shouldn't be checked. | ||
Line 455: | Line 455: | ||
} | } | ||
}); | }); | ||
− | filterState.functions = funcOpts; | + | // filterState.functions = funcOpts; |
// TEMPORARY! Restores original functionality. Delete after fixing the 'dataFiltered' hook. | // TEMPORARY! Restores original functionality. Delete after fixing the 'dataFiltered' hook. | ||
− | + | filterState.functions = Array.from(funcOpts).flat(2); | |
} | } | ||
Revision as of 18:19, 18 November 2022
Development verstion of the DCT List.
Not ready for production!