Widget: DCTList: Difference between revisions
From LINKS Community Center
Eschmidt (talk | contribs) No edit summary |
Eschmidt (talk | contribs) No edit summary |
||
Line 68: | Line 68: | ||
* @property {string} url | * @property {string} url | ||
* @property {string[]} dataSources | * @property {string[]} dataSources | ||
* @property {string[]} functions | |||
* @property {string} logo | * @property {string} logo | ||
*/ | */ | ||
let table; | let table; | ||
const FN_SEARCH = 'Search & Monitor'; | |||
const FN_POST = 'Post & Schedule'; | |||
/** @param {string} title */ | /** @param {string} title */ | ||
Line 129: | Line 133: | ||
/** @type {DCT} */ | /** @type {DCT} */ | ||
const dct = {}; | const dct = {}; | ||
console.log('result for', dctKey, x) | console.log('result for', dctKey, x) | ||
dct.name = dctKey; | dct.name = dctKey; | ||
Line 139: | Line 138: | ||
dct.dataSources = results[dctKey].printouts['Data Sources'].map(source => source.fulltext).sort(); | dct.dataSources = results[dctKey].printouts['Data Sources'].map(source => source.fulltext).sort(); | ||
dct.logo = results[dctKey].printouts['Image'][0] ? getUrl(results[dctKey].printouts['Image'][0].fulltext) : void 0; | dct.logo = results[dctKey].printouts['Image'][0] ? getUrl(results[dctKey].printouts['Image'][0].fulltext) : void 0; | ||
dct.functions = []; | |||
const testFunc = (dct, subfunctions) => subfunctions.some(func => { | |||
const printoutValue = dct.printouts[func][0]; | |||
if (printoutValue) console.log(dct.name, func, printoutValue.fulltext); | |||
return printoutValue && printoutValue.fulltext.toLowerCase() === 'yes'; | |||
}) | |||
let x = testFunc(results[dctKey], searchFunctions) | |||
console.log('result for', dctKey, x) | |||
return dct; | return dct; | ||
}) | }) |
Revision as of 14:48, 9 June 2022
Development verstion of the DCT List.
Not ready for production!