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 342: Line 342:
                     console.log(results.printouts[FUNC_KEY].map(func => removePrefix(func.fulltext)))
                     console.log(results.printouts[FUNC_KEY].map(func => removePrefix(func.fulltext)))
                 });
                 });
                console.log('done', functionsData)


             // TODO: Remove properties that are not relevant for the filter? (e.g. 'Supported content types')
             // TODO: Remove properties that are not relevant for the filter? (e.g. 'Supported content types')
Line 361: Line 360:


             const dctResponse = await fetch(getQueryUrl(dctQuery)).then(response => response.json());
             const dctResponse = await fetch(getQueryUrl(dctQuery)).then(response => response.json());
            console.log('prefill', functionsData)


             const dctList = Object.keys(dctResponse.query.results).map(dctName => {
             const dctList = Object.keys(dctResponse.query.results).map(dctName => {
                 const dctResult = dctResponse.query.results[dctName];
                 const dctResult = dctResponse.query.results[dctName];
               


                 /** @type {DCT} */
                 /** @type {DCT} */
Line 382: Line 375:
                 dct.functions = new Map();
                 dct.functions = new Map();
                 functionsData.forEach((categoryData, funcCategory) => {
                 functionsData.forEach((categoryData, funcCategory) => {
                    console.log('checking', categoryData[FUNC_KEY])
                     const confirmedFunctions = categoryData[FUNC_KEY]
                     const confirmedFunctions = categoryData[FUNC_KEY]
                         .filter(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');
           


                     if (confirmedFunctions.length > 0) {
                     if (confirmedFunctions.length > 0) {

Revision as of 16:21, 17 November 2022

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