Uploaded image for project: 'Fluid Infusion'
  1. Fluid Infusion
  2. FLUID-6514

Simplify the process to override default values from UIO primary schema

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Prefs Framework, UI Options
    • None

    Description

      When changing the default values defined in the primary schema of the preferences framework, for example, to set the minimum value of the line space to 1, the current working approaches are:

      1. Rewrite and override "fluid.prefs.schemas.lineSpace":

      fluid.defaults("fluid.prefs.schemas.lineSpace", {
        gradeNames: ["fluid.prefs.schemas"],
        schema: {
          "fluid.prefs.lineSpace": {
            "type": "number",
            "default": 1,
            "minimum": 1,
            "maximum": 2,
            "multipleOf": 0.1
          }
        }
      });
      

      2. Override transformed options at instantiate "fluid.uiOptions":

      fluid.uiOptions(".flc-prefsEditor-separatedPanel", {
        schema: {
          properties: {
            "fluid.prefs.lineSpace": {
              "minimum": 1
            }
          }
        }
      });
      

      Either of above requires knowledge of the internal implementation of the preferences framework.

      It would be more integrator friendly to simplify the API, such as:

      fluid.uiOptions(".flc-prefsEditor-separatedPanel", {
        "fluid.prefs.lineSpace": {
          minimum: 1
        }
      });
      

      Reference: This issue is initially discovered with a WeCount website requirement. See discussions in its pull request.

      Attachments

        Activity

          People

            Unassigned Unassigned
            cli@ocad.ca Cindy Qi Li
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: