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 282: Line 282:
         * @property {FuncData} functions
         * @property {FuncData} functions
         * @property {string} usedByDmo
         * @property {string} usedByDmo
        * @property {string} archived
         * @property {string} hasUC
         * @property {string} hasUC
         * @property {string} logo
         * @property {string} logo
Line 366: Line 367:
             const DMO_PROP = 'Used by Practitioners';
             const DMO_PROP = 'Used by Practitioners';
             const UC_PROP = 'Use Cases available';
             const UC_PROP = 'Use Cases available';
            const ARCHIVED = 'Is Archived';
             const dctQuery = '[[Category:Disaster Community Technology]]'
             const dctQuery = '[[Category:Disaster Community Technology]]'
                 + '[[Is Archived::No]]'
                 // + '[[Is Archived::No]]'
                 + '|limit=500'
                 + '|limit=500'
                + '|?' + ARCHIVED
                 + '|?' + IMG_PROP
                 + '|?' + IMG_PROP
                 + '|?' + DATASRC_PROP
                 + '|?' + DATASRC_PROP
Line 377: Line 380:


             const dctResponse = await fetch(getQueryUrl(dctQuery)).then(response => response.json());
             const dctResponse = await fetch(getQueryUrl(dctQuery)).then(response => response.json());
            console.dir(dctResponse)


             const dctList = Object.keys(dctResponse.query.results).map(dctName => {
             const dctList = Object.keys(dctResponse.query.results).map(dctName => {
Line 390: Line 395:
                 dct.usedByDmo = dctResult.printouts[DMO_PROP][0] === 't' ? 'yes' : 'no';    // not quite, but we only care about yes
                 dct.usedByDmo = dctResult.printouts[DMO_PROP][0] === 't' ? 'yes' : 'no';    // not quite, but we only care about yes
                 dct.hasUC = dctResult.printouts[UC_PROP][0] === 't' ? 'yes' : 'no';    // not quite, but we only care about yes
                 dct.hasUC = dctResult.printouts[UC_PROP][0] === 't' ? 'yes' : 'no';    // not quite, but we only care about yes
                dct.archived = dctResult.printouts[ARCHIVED][0] === 't' ? 'yes' : 'no';    // not quite, but we only care about yes


                 dct.functions = new Map();
                 dct.functions = new Map();

Revision as of 14:23, 2 August 2023

DCT list widget.
Currently in use – do not modify!