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

Improve usability of arrayToSetMembership and setMembershipToArray transforms

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • None
    • None

    Description

      These are a powerful set of transforms but their documentation is a little ropy and the configuration required is rather bureaucratic. They should be updated so that 

      i) They have some reasonable JSDoc comments in the implementation explaining their requirements, and that 

      ii) The requirement to fully list all participating fields in the "options" structure is relaxed.

      In particular, they should be improved so that the output of the function call

      fluid.transforms.arrayToSetMembership(["thing1", "thing2"])

      applies sensible defaults to that it produces the result

      {
          "thing1": true,
          "thing2": true
      }

      and similarly for the inverse call of setMembershipToArray

       

      This implies that the use of the 3rd arg "transformer" should be eliminated - I think the use of resolverSetConfig is not going to produce any helpfully different results, and the argument "transformSpec" should be made wholly optional.

      Attachments

        Activity

          People

            the-t-in-rtf Tony Atkins
            antranig Antranig Basman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: