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

Remove useFeatureFlag hook in favor of referencing global object Liferay.FeatureFlags

    Details

    • Story Points:
      1
    • Sprint:
      S05E05 - Tetris

      Description

      The useFeatureFlag hook is limited in that it can only be using in React applications. In order to enforce consistency of feature flags across DXP in javascript code, it is better that each feature flag is referenced off of the global Liferay object directly. This both reduces the LOC and the complexity of needing an additional hook.

      Old:

      import {useFeatureFlag} from 'data-engine-js-components-web';
      
      //...
      
      const flags = useFeatureFlag();
      
      //...
      
      if (flag['LPS-xxxx']) {
      

      New:

      if (Liferay.FeatureFlags['LPS-xxxx']) {
      

        Attachments

          Activity

            People

            Assignee:
            bryce.osterhaus Bryce Osterhaus
            Reporter:
            bryce.osterhaus Bryce Osterhaus
            Engineering Assignee:
            SE Support
            Recent user:
            Felipe Lins
            Participants of an Issue:
            Frontend Developer(s) Assigned:
            Bryce Osterhaus
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Packages

                Version Package
                Master