Difference between revisions of "Widget:DCTList"

From LINKS Community Center
Jump to: navigation, search
Line 390: Line 390:
 
         /**
 
         /**
 
         * @param {DCT} dct
 
         * @param {DCT} dct
        * @param {Partial<DCT>} filterState
 
 
         */
 
         */
 
         function dctFilter(dct, filterState) {
 
         function dctFilter(dct, filterState) {
Line 400: Line 399:
 
             // TEMPORARY!!!
 
             // TEMPORARY!!!
 
             // TODO: REWORK
 
             // TODO: REWORK
 +
 +
            // If filterState has a category but subfunctions array is empty, we only care about the category.
 +
            const emptyCategories = Array.from(filterState.functions)
 +
            console.log(emptyCategories)
 +
            return true
 +
 +
            // Otherwise, we only care about the subfunctions and category shouldn't be checked.
 +
 
             const functionsCheck = filterState.functions
 
             const functionsCheck = filterState.functions
 
                 ? dctFunctions.some(func => filterState.functions.includes(func))
 
                 ? dctFunctions.some(func => filterState.functions.includes(func))
Line 444: Line 451:
 
                     }
 
                     }
 
                 });
 
                 });
                 console.log(funcOpts)
+
                 filterState.functions = funcOpts;
 
             }
 
             }
 
            const functionOptions = Array.from(document.querySelectorAll('#functions-filter input[type="checkbox"]'));
 
            const selectedFunctions = functionOptions.filter(checkbox => checkbox.checked).map(checkbox => checkbox.value);
 
 
            filterState.functions = selectedFunctions.length === functionOptions.length ? undefined : selectedFunctions;
 
  
 
             const sourceOptions = Array.from(document.querySelectorAll('#data-source-filter input[type="checkbox"]'));
 
             const sourceOptions = Array.from(document.querySelectorAll('#data-source-filter input[type="checkbox"]'));
Line 730: Line 732:
 
                 // TODO: Check the bugfix for a possible infinite event loop.
 
                 // TODO: Check the bugfix for a possible infinite event loop.
 
                 // This will help detect it, in case it happens.
 
                 // This will help detect it, in case it happens.
                 console.log('Table height bugfix: render complete.');
+
                 // console.log('Table height bugfix: render complete.');
 
                  
 
                  
 
                 try {
 
                 try {

Revision as of 17:58, 18 November 2022

Development verstion of the DCT List.
Not ready for production!