@sonic-equipment/ui 0.0.85 → 0.0.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -126,8 +126,9 @@ declare const request: Request;
126
126
 
127
127
  declare const features: {
128
128
  readonly pdp: "pdpV2";
129
- readonly plp: "plpV2";
130
- readonly search: "searchV2";
129
+ readonly pdpv1: "pdpV1";
130
+ readonly plpv1: "plpV1";
131
+ readonly searchv1: "searchV1";
131
132
  };
132
133
  type FeatureKeys = keyof typeof features;
133
134
  type FeatureValues = (typeof features)[FeatureKeys];
package/dist/index.js CHANGED
@@ -364,8 +364,9 @@ const request = (function createRequestFunction() {
364
364
 
365
365
  const features = {
366
366
  pdp: 'pdpV2',
367
- plp: 'plpV2',
368
- search: 'searchV2',
367
+ pdpv1: 'pdpV1',
368
+ plpv1: 'plpV1',
369
+ searchv1: 'searchV1',
369
370
  };
370
371
  const HAS_LOCAL_STORAGE_SUPPORT = typeof localStorage !== 'undefined';
371
372
  function useFeatureFlags() {
@@ -376,9 +377,8 @@ function useFeatureFlags() {
376
377
  };
377
378
  return useMemo(() => {
378
379
  const queryParams = qs.parse(search);
379
- const showNewPageQueryValue = String(queryParams['new']).toLowerCase() === 'true';
380
- const hasQueryStringFeatures = Boolean(queryParams['features']);
381
- if (!showNewPageQueryValue && !hasQueryStringFeatures) {
380
+ const hasQueryStringFeatures = queryParams['features'] !== undefined && queryParams['features'] !== null;
381
+ if (!hasQueryStringFeatures) {
382
382
  /* When no new feature flags are set get them from localStorage */
383
383
  return Object.entries(features).reduce((acc, [, value]) => ({
384
384
  ...acc,
@@ -392,7 +392,7 @@ function useFeatureFlags() {
392
392
  .split(',');
393
393
  const featureResults = Object.entries(features).map(([key, value]) => ({
394
394
  key: key,
395
- selected: showNewPageQueryValue || queryStringFeatures.includes(key),
395
+ selected: queryStringFeatures.includes(key),
396
396
  value: value,
397
397
  }));
398
398
  featureResults.forEach(({ selected, value }) => {
@@ -1,7 +1,8 @@
1
1
  declare const features: {
2
2
  readonly pdp: "pdpV2";
3
- readonly plp: "plpV2";
4
- readonly search: "searchV2";
3
+ readonly pdpv1: "pdpV1";
4
+ readonly plpv1: "plpV1";
5
+ readonly searchv1: "searchV1";
5
6
  };
6
7
  type FeatureKeys = keyof typeof features;
7
8
  type FeatureValues = (typeof features)[FeatureKeys];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonic-equipment/ui",
3
- "version": "0.0.85",
3
+ "version": "0.0.86",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {