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 1: Line 1:
<noinclude>Current version of the DCT List.<br><span style="color: red; font-weight: bold;">Not ready for production!</span></noinclude>
<noinclude>Current version of the DCT List.<br><span style="color: red; font-weight: bold;">Not ready for
        production!</span></noinclude>
<includeonly>
<includeonly>
     <link href="/resources/assets/tabulator.min.css" rel="stylesheet">
     <link href="/resources/assets/tabulator.min.css" rel="stylesheet">
Line 261: Line 262:
             font-weight: 300;
             font-weight: 300;
         }
         }
     </style>
     </style>


Line 414: Line 414:
             // If filtering property is empty, don't apply the filter (set the check to true).
             // If filtering property is empty, don't apply the filter (set the check to true).
             // 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.
            console.log('FILT', filterState)


             let functionsCheck = true;  // automatically pass functions check if the filter missing
             let functionsCheck = true;  // automatically pass functions check if the filter missing
Line 425: Line 423:
                 });
                 });


                 // Empty categories should only be checked by their name, nonempty - ONLY by subfunctions.
                 // Empty categories should only be checked by their name
                 const checkEmpty = emptyCategories.some(cat => dct.functions.has(cat));
                 const checkEmpty = emptyCategories.every(cat => dct.functions.has(cat));
                 const checkNonempty = nonemptyCategories.some(cat => {
 
                // Nonempty categories should only be checked for presence of their subfunctions. Category itself is irrelevant.
                 const checkNonempty = nonemptyCategories.every(cat => {
                     const selectedSubs = filterState.functions.get(cat);
                     const selectedSubs = filterState.functions.get(cat);
                     const dctCat = dct.functions.get(cat);
                     const dctSubs = dct.functions.get(cat);
                     return dctCat && dctCat[FUNC_KEY] && dctCat[FUNC_KEY].some(sub => selectedSubs.includes(sub));
                     return dctSubs && dctSubs[FUNC_KEY] && selectedSubs.every(sub => dctSubs[FUNC_KEY].includes(sub));
                 });
                 });


                 functionsCheck = checkEmpty || checkNonempty;
                 functionsCheck = checkEmpty && checkNonempty;
             }
             }


             const sourcesCheck = filterState.dataSources
             const sourcesCheck = filterState.dataSources
                 ? dct.dataSources.some(source => filterState.dataSources.includes(source))
                 ? filterState.dataSources.every(source => dct.dataSources.includes(source))
                 : true;
                 : true;
             const businessModelCheck = filterState.businessModel
             const businessModelCheck = filterState.businessModel
Line 615: Line 615:
                                     alt="${fn}"  
                                     alt="${fn}"  
                                     title="${fn}\n\n${functionsData.get(fn)[DESC_KEY]}">`
                                     title="${fn}\n\n${functionsData.get(fn)[DESC_KEY]}">`
                                    )
                                )
                                 .join('');
                                 .join('');
                         }
                         }
Line 891: Line 891:
         <div id="dct-intro">
         <div id="dct-intro">
             <p>The overall goal of the Social Media and Crowdsourcing (SMCS) Technologies Library is to face the growing
             <p>The overall goal of the Social Media and Crowdsourcing (SMCS) Technologies Library is to face the growing
                 heterogeneous use of technologies in disasters and the overwhelming number of technologies on the market. It
                 heterogeneous use of technologies in disasters and the overwhelming number of technologies on the
                 gathers and structures information about existing technologies to provide an up-to-date overview and thus
                market. It
                 gathers and structures information about existing technologies to provide an up-to-date overview and
                thus
                 support the selection of suitable technologies.
                 support the selection of suitable technologies.
             </p>
             </p>
             <p>
             <p>
                 You can use the filters to identify relevant technologies according to your needs and then click on the name of
                 You can use the filters to identify relevant technologies according to your needs and then click on the
                name of
                 the technology to get further information.
                 the technology to get further information.
             </p>
             </p>
Line 981: Line 984:
                     </div>
                     </div>
                 </div> -->
                 </div> -->
                 <div id="bool-filters" style="border-top: 1px solid var(--links-blue); margin-top: 1em; padding-top: 1em;">
                 <div id="bool-filters"
                    style="border-top: 1px solid var(--links-blue); margin-top: 1em; padding-top: 1em;">
                     <div>
                     <div>
                         <input type="checkbox" id="used-by-practitioners" value="yes">
                         <input type="checkbox" id="used-by-practitioners" value="yes">

Revision as of 14:58, 9 March 2023

Current version of the DCT List.
Not ready for

       production!