Widget: DCTList: Difference between revisions

From LINKS Community Center
Jump to: navigation, search
Eschmidt (talk | contribs)
No edit summary
Eschmidt (talk | contribs)
No edit summary
Line 359: Line 359:
                     );
                     );
                 });
                 });
                console.log(functionsData)


             const allFunctions = Array.from(functionsData.values(), entry => entry[FUNC_KEY]).flat();
             const allFunctions = Array.from(functionsData.values(), entry => entry[FUNC_KEY]).flat();
Line 436: Line 434:
             }
             }


            // const functionsCheck = filterState.functions
            //    ? dctFunctions.some(func => filterState.functions.includes(func))
            //    : true;
             const sourcesCheck = filterState.dataSources
             const sourcesCheck = filterState.dataSources
                 ? dct.dataSources.some(source => filterState.dataSources.includes(source))
                 ? dct.dataSources.some(source => filterState.dataSources.includes(source))
Line 484: Line 479:
                 });
                 });
                 filterState.functions = funcOpts;
                 filterState.functions = funcOpts;
                // TEMPORARY! Restores original functionality. Delete after fixing the 'dataFiltered' hook.
                // filterState.functions = Array.from(funcOpts).flat(2);
             }
             }


Line 499: Line 491:
             filterState.usedByDmo = document.getElementById('used-by-practitioners').checked ? 'yes' : undefined;
             filterState.usedByDmo = document.getElementById('used-by-practitioners').checked ? 'yes' : undefined;
             filterState.hasUC = document.getElementById('has-use-case').checked ? 'yes' : undefined;
             filterState.hasUC = document.getElementById('has-use-case').checked ? 'yes' : undefined;
            // const dmUseOptions = Array.from(document.querySelectorAll('#dm-use-filter input[type="checkbox"]'));
            // const selectedDmUseOptions = dmUseOptions.filter(checkbox => checkbox.checked).map(checkbox => checkbox.value);
            // filterState.usedByDmo = selectedDmUseOptions.length === dmUseOptions.length ? undefined : selectedDmUseOptions;


             table.setFilter(dctFilter, filterState);
             table.setFilter(dctFilter, filterState);
Line 521: Line 507:
                         <div>
                         <div>
                             <input type="checkbox" checked id="${identifier}" value="${fnCat}" class="func-cat">
                             <input type="checkbox" checked id="${identifier}" value="${fnCat}" class="func-cat">
                             <label for="${identifier}"><img src="${fnImages[fnCat]}"> ${fnCat}</label>
                             <label for="${identifier}" title="${fnInfo[DESC_KEY]}"><img src="${fnImages[fnCat]}"> ${fnCat}</label>
                         </div>`;
                         </div>`;



Revision as of 10:48, 8 December 2022

Current version of the DCT List.
Not ready for production!