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 259: Line 259:


         /** @type FuncData */
         /** @type FuncData */
         const functionsData = new Map();
         const functionsData = new Map();   // Data on functions and function categories


         /**
         /**
Line 267: Line 267:
         * @property {string[]} dataSources
         * @property {string[]} dataSources
         * @property {string[]} businessModel
         * @property {string[]} businessModel
         * @property {string[]} functions
         * @property {FuncData} functions
         * @property {string} usedByDmo
         * @property {string} usedByDmo
         * @property {string} logo
         * @property {string} logo
         */
         */


         let table;
         let table; // Tabulator instance


         // This defines how sources are grouped in the filter.
         // This defines how sources are grouped in the filter.
Line 371: Line 371:
                 dct.usedByDmo = dctResult.printouts[DMO_PROP][0] ? dctResult.printouts[DMO_PROP][0].fulltext : 'Unknown';
                 dct.usedByDmo = dctResult.printouts[DMO_PROP][0] ? dctResult.printouts[DMO_PROP][0].fulltext : 'Unknown';


                 dct.functions = [];
                 dct.functions = new Map();
                 functionsData.forEach((categoryData, funcCategory) => {
                 functionsData.forEach((categoryData, funcCategory) => {
                     if (categoryData[FUNC_KEY].some(
                     const confirmedFunctions = categoryData[FUNC_KEY]
                        func => dctResult.printouts[func][0] && dctResult.printouts[func][0].fulltext.toLowerCase() === 'yes'
                        .filter(func => dctResult.printouts[func][0] && dctResult.printouts[func][0].fulltext.toLowerCase() === 'yes');
                     )) {
 
                         dct.functions.push(funcCategory);
                     if (confirmedFunctions.length > 0) {
                         dct.functions.set(funcCategory, Object.assign(categoryData, { [FUNC_KEY]: confirmedFunctions }));
                     }
                     }
                 });
                 });
Line 382: Line 383:
                 return dct;
                 return dct;
             });
             });
            console.log(dctList)


             return dctList;
             return dctList;

Revision as of 15:48, 17 November 2022

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