Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-96685

As a Marketer I can specify fragment configuration values for fields of type select

    Description

    Motivation/Context

    Currently, it is not possible to create fragments with configuration.

    This leads to situations where the Web Developer needs to create multiple fragments which are very similar to each other but with only some minor differences (e.g. a dark and a lite version of a banner)

    Giving the possibility to the Web Developer to define a configuration for fragments would reduce the number of fragments created, therefore reducing the effort required to maintain those fragments.

    The configuration is comprised of a set of fields, which may be of different types.

    This first story focuses on fields of type select. Upcoming stories will add additional field types such as checkbox, color, item-selector or text.

    Once this story is complete it should be possible to perform a demo where:

    • The Web Developer using a text editor defines a fragment configuration with several fields of type select.
      e.g:
      Field style with possible values: dark, light
      Field numberOfColumns with possible values: 1,3,5
    • The Web Developer uploads that fragment to Liferay Portal using the fragment development CLI
    • The Marketer can drag the fragment and specify values for the configuration fields in the Page Editor (for the default experience).
    • The Page displays the rendered fragment according to the values specified by the Marketer
    • The Marketer can drag the fragment and specify values for the configuration fields in the Page Editor for a non-default experience.
    • The Page displays the rendered fragment according to the values specified by the Marketer (in the non-default experience)
    • When switching back to the default experience, the configuration values for the default experience are applied.

    Design Deliverables

    Figma Mockup: https://www.figma.com/file/GS45Vn3fV5mUtz3ir5VVGxYI/LPS-97124-fragment-configuration-form?node-id=0%3A1

    Technical considerations

    • A fragment developer can make a fragment configurable by creating a JSON file
    • There should be a formal definition for the JSON file that allows doing validation (for example in JSON Schema)
    • The configurable fragment can be loaded into Liferay by using the Fragment Toolkit (using watch or import)

    Acceptance Criteria

    1. Configuration import with Fragment Toolkit with a configuration

    • Given a fragment with a configuration,
    • when the fragment is imported with the fragment toolkit, 
    • then the import succeeds
    • and the configuration is imported along with the fragment code.

    2. Configuration creation with Fragment application with a configuration

    • Given a user with access to the Fragments admin application in a site,
    • when the fragment is created with a configuration
    • then the when the fragment is used in a page, the page author has access to the fragment configuration in a floating panel.

    3. Fragment configuration in Page Editor

    • Given a configurable fragment is added to a page within page editor,
    • when the page author clicks on the fragment (and not inside an editable element),
    • then a floating panel with the configuration form is shown, allowing the author to change the configuration.

    4. Staging with one experience in a page

    • Given a site with local or remote staging enabled
    • and a page of the site which has configurable fragments with an specific configuration
    • when the page is published to live
    • then the page should be published with the fragment
    • and its specific configuration

    5. Staging with several experiences in a page

    • Given a site with local or remote staging enabled
    • and a page of the site which has configurable fragments with a specific configuration
    • and several experiences in a page
    • when the page is published to live
    • then the page should be published with the fragment
    • and its specific configuration for each experience

    6. Default configuration of a new Personalized Experience

    • Given a page of a site with a configurable fragment which a specific configuration change
    • when the a new experience is created
    • then the configuration of the fragment in the new experience has been copied from the default experience

    7. Personalized Experiences for a specific experience

    • Given a page of a site with several personalized experiences
    • when the configuration of a fragment is changed for a specific experience
    • then the configuration change should only affect that experience
    • and not others.

    8. Personalized Experiences for a default experience

    • Given a page of a site with several personalized experiences
    • when the configuration of a fragment is changed for the default experience
    • then the configuration change should not affect any other experience of the page.

      Attachments

        Issue Links

        1.
        Define format in which a fragment configuration is defined LPS-96686 Technical Task Closed Ruben Pulido  
        2.
        Add column to fragment table in database to store fragment configuration LPS-96687 Technical Task Closed Brian Chan  
        3.
        Fragment Import & Export should take into account fragment configuration LPS-96688 Technical Task Closed Brian Chan  
        4.
        In the Page editor the configuration values can be visualized and updated LPS-96690 Technical Task Closed Brian Chan  
        5.
        Make Fragment configuration available in freemarker taking into account the selected experience LPS-96691 Technical Task Closed Brian Chan  
        6.
        Add upgrade proccess for new configuration column LPS-96704 Technical Task Closed Brian Chan  
        7.
        Modify Fragment Generator so it handles new configuration file LPS-96729 Technical Task Closed Pablo Molina  
        8.
        Give the possibility of manual changing .html extension to.ftl in Fragment Generator LPS-96813 Technical Task Closed Sandro Chinea  
        9.
        Create component for configuration panel LPS-96731 Technical Task Closed Brian Chan  
        10.
        Show configuration selects on panel reading from config json LPS-96732 Technical Task Closed Brian Chan  
        11.
        Send configuration to server (taking into account experiences) LPS-96740 Technical Task Closed Brian Chan  
        12.
        Define visually the component on which the fragment configuration form will be displayed LPS-97124 Technical Task Closed Juan Anton  
        13.
        Define format in which configuration values are stored LPS-97279 Technical Task Closed SE Support  
        14.
        Add column to fragmentEntryLink table in database to store fragmentEntryLink configuration LPS-97404 Technical Task Closed Brian Chan  
        15.
        Make restore default values button work LPS-97735 Technical Task Closed Brian Chan  
        16.
        Return default configuration values in the same format as editableValues to support restoring them in front end LPS-97758 Technical Task Closed Brian Chan  
        17.
        Send configuration to server (taking into account experiences) LPS-97740 Technical Task Closed Pablo Molina  
        18.
        When creating/updating/importing fragments take into account configuration to validate whether html field is syntactically correct Freemarker code LPS-97700 Technical Task Closed Brian Chan  
        19.
        Copy configuration when copying a fragment LPS-97696 Technical Task Closed Brian Chan  
        20.
        Fragment preview using CLI should handle correctly fragments with configuration LPS-97995 Technical Task Closed Pablo Molina  
        21.
        Render fragments after modifying config values or switching experience LPS-97527 Technical Task Closed Brian Chan  
        22.
        Site Import & Export should take into account fragment configuration LPS-97989 Technical Task Closed Brian Chan  
        23.
        FieldSets in fragment configuration should not have a name attribute LPS-98043 Technical Task Closed SE Support  
        24.
        Update FragmentsEditor to handle new configuration json LPS-98089 Technical Task Closed Victor Galan  
        25.
        Store in database only the configuration values which are different from default values LPS-97744 Technical Task Closed Brian Chan  
        26.
        When propagating changes make sure configuration values are propagated correctly LPS-97730 Technical Task Closed Eudaldo Alonso  
        27.
        Publishing to local staging should take into account fragment configuration LPS-97990 Technical Task Closed Brian Chan  
        28.
        Adapt existing tests to take into account fragment configuration and create additional ones LPS-97731 Technical Task Closed Brian Chan  
        29.
        Publishing to remote staging should take into account fragment configuration LPS-97991 Technical Task Closed Ruben Pulido  
        30.
        Fields values in configuration should have an attribute "value" and an attribute "label" LPS-98044 Technical Task Closed SE Support  
        31.
        When creating a new experience it should be based on the snapshot of the configuration values of the default experience LPS-98498 Technical Task Closed Brian Chan  
        32.
        Make Fragment Configuration feature revertible LPS-98529 Technical Task Closed Brian Chan  
        33.
        Manual Testing LPS-98909 Technical Testing Closed Brooke Dalton  
        34.
        As a web developer I can add a field of type checkbox to my fragment configuration LPS-98980 Technical Documentation Closed Cody Hoag  

          Activity

            People

            Assignee:
            support-qa Support QA
            Reporter:
            jorge.ferrer Jorge Ferrer
            Recent user:
            Harry Chai
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Packages

                Version Package
                7.2.X
                Master