Uploaded image for project: 'GPII - Global Public Inclusive Infrastructure'
  1. GPII - Global Public Inclusive Infrastructure
  2. GPII-4296

Settings Loader is not sufficiently amenable to interception

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: FlowManager
    • Labels:
      None

      Description

      The new "DefaultSettingsLoader" component at https://github.com/GPII/universal/blob/master/gpii/node_modules/flowManager/src/DefaultSettingsLoader.js is not sufficiently amenable to interception from elsewhere in the codebase. It uses some hard-coded, synchronous I/O which ends up loading the file into a member.

      fluid.defaults("gpii.defaultSettingsLoader", {
          gradeNames: ["fluid.component"],
          // The path to the file that has all QSS supported settings.
          defaultSettingsInCodeBase: "%gpii-universal/testData/defaultSettings/defaultSettings.json5",
          members: {
              gpiiSettingsDir: "@expand:{settingsDir}.getGpiiSettingsDir()",
              // It points to the default settings file in the settings directory. GPII should read from this file instead of defaultSettingsInCodeBase.
              defaultSettingsFile: "@expand:gpii.defaultSettingsLoader.prepareSettingsFile({that}.options.defaultSettingsInCodeBase,{that}.gpiiSettingsDir)"
          },
      

      In the days before options modification was prohibited Javier Hernández used to have an options distribution out in the app which distributed a URL for the settings loader which it had fetched out of the site config file in https://github.com/javihernandez/gpii-app/commit/df874131fc0f7c222691c0e7543d5fce0b3eb830#diff-f0a67c6c5193d9c050cde8a1c5aecc83R99. The site config itself now loads asynchronously so this is no longer directly possible.

      We need to move the default settings loader over to asychronous I/O, and in addition enable the contribution of the URL itself via a promise.

        Attachments

          Activity

            People

            Assignee:
            cli@ocad.ca Cindy Qi Li
            Reporter:
            amb26 Antranig Basman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: