1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-19 17:52:45 +02:00
unleash.unleash/frontend/src/utils
Nuno Góis db61a8a40c
feat: message banner (variants) (#3788)
-
https://linear.app/unleash/issue/2-546/fetch-the-payload-from-a-real-feature-flag
-
https://linear.app/unleash/issue/2-547/adapt-ui-to-use-the-feature-flag-information-were-fetching

Tackles the 2 tasks above. 

Adapts our `FlagResolver` logic to support variants, so we can use them
for our message banner project but also anything else in the future.
Also adapts MessageBanner to the new logic.

 - Add support for variants in `FlagResolver`;
 - Adapt `MessageBanner` to a variants flag;
 - Adds `sticky` support for the `MessageBanner`;
- Adds our first variants flag to `uiConfig` and `experimental`:
`messageBanner`;
- Adds a `variant-flag-schema` to make it easy to represent the variant
output that we specify in `uiConfig`;
- Adapts `experimental` to be able to represent default variants while
still maintaining type safety;
- Adds helpers to make it easy to use variants in our project, such as
`getVariantValue` and the `useVariant` hook;
 - Adapts and adds new tests in `flag-resolver.test.ts`;
 
### Notes

- ~~The `as PayloadType` assertions need
https://github.com/Unleash/unleash-client-node/pull/454 since it
includes https://github.com/Unleash/unleash-client-node/pull/452~~
(50ccf60893);
 - ~~Enterprise needs a PR that will follow soon~~;
 
 

![image](https://github.com/Unleash/unleash/assets/14320932/034ff64f-3020-4ed0-863b-ed1fd9190430)
2023-05-18 09:38:59 +01:00
..
apiUtils.ts
arraysHaveSameItems.test.ts
arraysHaveSameItems.ts
calculatePercentage.ts
cleanConstraint.test.ts
cleanConstraint.ts
createFeatureStrategy.test.ts feat: Project scoped stickiness (#3289) 2023-03-10 12:28:02 +02:00
createFeatureStrategy.ts feat: Project scoped stickiness (#3289) 2023-03-10 12:28:02 +02:00
createLocalStorage.ts
cyclicIterator.test.ts feat: first draft of chart for instance traffic in frontend (#2670) 2022-12-15 08:47:07 +00:00
cyclicIterator.ts feat: first draft of chart for instance traffic in frontend (#2670) 2022-12-15 08:47:07 +00:00
env.test.ts
env.ts
formatAccessText.test.ts
formatAccessText.ts
formatConstraintValue.ts
formatDate.ts linter fixes (#2561) 2022-11-30 10:52:13 +01:00
formatPath.test.ts Revert "formatApiPath / formatAssetPath - Implement smart functionality to detect double subpath" (#3001) 2023-01-26 15:34:42 +01:00
formatPath.ts Revert "formatApiPath / formatAssetPath - Implement smart functionality to detect double subpath" (#3001) 2023-01-26 15:34:42 +01:00
formatUnknownError.test.ts
formatUnknownError.ts
getFeatureMetrics.ts
getFeatureTypeIcons.ts
instanceTrial.test.ts
instanceTrial.ts
nonEmptyArray.ts
objectId.test.ts
objectId.ts
oneOf.ts
operatorsForContext.ts feat: expand constraint operator descriptions (2) (#858) 2022-04-07 10:31:06 +02:00
paginate.test.ts
paginate.ts
parseParameter.test.ts
parseParameter.ts
projectFilterGenerator.ts
removeEmptyStringFields.test.ts
removeEmptyStringFields.ts
routePathHelpers.ts UI Flags cleanup (#2778) 2023-01-02 15:41:43 +02:00
search.ts
sortStrategyParameters.test.ts
sortStrategyParameters.ts
sortTypes.test.ts feat: favorite feature table icons (#2525) 2022-11-30 12:44:38 +00:00
sortTypes.ts feat: favorite feature table icons (#2525) 2022-11-30 12:44:38 +00:00
storage.ts Allow hiding environments from the feature overview screen (#2727) 2023-01-03 15:41:34 +02:00
strategyNames.tsx refactor: styles batch 3 (#2821) 2023-01-11 17:44:21 +01:00
testIds.ts Feat: default strategy UI (#3682) 2023-05-05 14:32:44 +03:00
testRenderer.tsx
testServer.ts feat: CR title from review page (#3509) 2023-04-13 12:24:31 +03:00
unknownify.ts perf: Simplify queries to prometheus (#2706) 2022-12-19 17:06:59 +01:00
validateParameterValue.test.ts
validateParameterValue.ts
variants.ts feat: message banner (variants) (#3788) 2023-05-18 09:38:59 +01:00