1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-11-01 19:07:38 +01:00
unleash.unleash/frontend/src/interfaces/featureToggle.ts

93 lines
1.9 KiB
TypeScript
Raw Normal View History

Feat/environment strategies (#339) * feat: strategies list * feat: dnd * fix: resolve reference issues * feat: configure strategy wip * feat: rearrange list * feat: add debounce and execution plan * feat: add separator * feat: update strategy * fix: feature strategy accordion key * fix: localize parameter update logic * feat: ts conversion * fix: perf issues * feat: production guard * fix: clean up environment list * fix: implement markup hooks for environment list * feat: wip constraints * fix: handle nested data structure reference issue * fix: clone deep on child props * fix: remove constraints check * fix: revert to strategies length * fix: refactor useFeature * feat: cache revalidation * fix: set correct starting tab * fix: reset params on adding new strategy * fix: refactor to use useSWR instead of local cache * fix: check dirty directly from new params * fix: dialogue ts * fix: Clean-up typescript warnings * fix: some more typescript nits * feat: strategy execution * feat: strategy execution for environment * fix: refactor execution separator * fix: remove unused property * fix: add header * fix: 0 value for rollout * fix: update snapshots * fix: remove empty deps * fix: use constant for env type * fix: use default for useFeatureStrategy * fix: update snapshot * Update src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useDeleteStrategyMarkup.tsx Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai> * Update src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecution.tsx Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai> * Update src/component/feature/strategy/EditStrategyModal/general-strategy.jsx Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai> Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai> Co-authored-by: UnleashTeam <79193084+UnleashTeam@users.noreply.github.com>
2021-09-27 13:35:32 +02:00
import { IFeatureStrategy } from './strategy';
import { ITag } from './tags';
export interface IFeatureToggleListItem {
type: string;
name: string;
stale?: boolean;
lastSeenAt?: string;
createdAt: string;
environments: IEnvironments[];
tags?: ITag[];
2022-12-01 13:10:42 +01:00
favorite?: boolean;
}
export interface IEnvironments {
name: string;
enabled: boolean;
variantCount: number;
}
export interface IFeatureToggle {
stale: boolean;
archived: boolean;
enabled?: boolean;
createdAt: string;
lastSeenAt?: string;
description?: string;
environments: IFeatureEnvironment[];
name: string;
favorite: boolean;
project: string;
type: string;
variants: IFeatureVariant[];
impressionData: boolean;
strategies?: IFeatureStrategy[];
}
export interface IFeatureEnvironment {
2021-10-15 12:49:14 +02:00
type: string;
name: string;
enabled: boolean;
Feat/environment strategies (#339) * feat: strategies list * feat: dnd * fix: resolve reference issues * feat: configure strategy wip * feat: rearrange list * feat: add debounce and execution plan * feat: add separator * feat: update strategy * fix: feature strategy accordion key * fix: localize parameter update logic * feat: ts conversion * fix: perf issues * feat: production guard * fix: clean up environment list * fix: implement markup hooks for environment list * feat: wip constraints * fix: handle nested data structure reference issue * fix: clone deep on child props * fix: remove constraints check * fix: revert to strategies length * fix: refactor useFeature * feat: cache revalidation * fix: set correct starting tab * fix: reset params on adding new strategy * fix: refactor to use useSWR instead of local cache * fix: check dirty directly from new params * fix: dialogue ts * fix: Clean-up typescript warnings * fix: some more typescript nits * feat: strategy execution * feat: strategy execution for environment * fix: refactor execution separator * fix: remove unused property * fix: add header * fix: 0 value for rollout * fix: update snapshots * fix: remove empty deps * fix: use constant for env type * fix: use default for useFeatureStrategy * fix: update snapshot * Update src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useDeleteStrategyMarkup.tsx Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai> * Update src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecution.tsx Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai> * Update src/component/feature/strategy/EditStrategyModal/general-strategy.jsx Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai> Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai> Co-authored-by: UnleashTeam <79193084+UnleashTeam@users.noreply.github.com>
2021-09-27 13:35:32 +02:00
strategies: IFeatureStrategy[];
variants?: IFeatureVariant[];
}
export interface IFeatureEnvironmentWithCrEnabled extends IFeatureEnvironment {
crEnabled?: boolean;
}
export interface IFeatureVariant {
name: string;
stickiness: string;
weight: number;
weightType: 'fix' | 'variable';
overrides?: IOverride[];
payload?: IPayload;
}
export interface IOverride {
contextName: string;
values: string[];
}
export interface IPayload {
type: string;
value: string;
}
export interface IFeatureEnvironmentMetrics {
environment: string;
timestamp: string;
yes: number;
no: number;
}
export interface IFeatureMetrics {
refactor: fix misc TS errors (#729) * refactor: update test deps * refactor: remove unused ts-expect-error annotations * refactor: add missing arg and return types * refactor: the loading prop is optional * refactor: add missing arg and return types * reafactor: fix value arg type * refactor: fix missing array type * refactor: the parameters field is an array * refactor: use undefined instead of null in state * refactor: add missing params type * refactor: add missing children prop * refactor: add missing array type * refactor: add missing React imports * refactor: use correct IProjectEnvironment type * refactor: type errors as unknown * refactor: the index prop is required * refactor: fix date prop type * refactor: fix tooltip placement prop type * refactor: fix environments state type * refactor: add missing arg types * refactor: add guard for undefined field * refactor: fix ChangePassword prop types * refactor: fix MUI import paths * refactor: add missing arg type * refactor: fix showDialog prop type * refactor: remove unused openUpdateDialog prop * refactor: add missing non-null assertion * refactor: remove unused types prop * refactor: stricten API error handler types * refactor: add missing undefined check * refactor: add missing IProject id field * refactor: fix ConditionallyRender condition prop types * refactor: remove unused args * refactor: add AddVariant prop types * refactor: add types to UIContext * refactor: fix event arg type * refactor: add missing default impressionData field * refactor: fix handleDeleteEnvironment prop args * refactor: fix IFeatureMetrics field requirements * refactor: add missing element types to ConditionallyRender * refactor: remove unused ProjectAccess projectId prop * refactor: add missing undefined check * refactor: fix getCreateTogglePath arg type * refactor: add missing IStrategyPayload import * refactor: remove unused user arg * refactor: add missing event arg type * refactor: add missing style object types * refactor: improve userApiErrors prop type * refactor: the Dialogue onClose prop is optional * refactor: fix the AddonEvents setEventValue prop type
2022-02-25 10:55:39 +01:00
version?: number;
maturity?: string;
lastHourUsage: IFeatureEnvironmentMetrics[];
seenApplications: string[];
}
feat: add new feature metrics page (#716) * refactor: ensure that [hidden] overrides other display styles * refactor: use numeric font weights * refactor: remove unnecessary Jest mock * refactor: add a fullWidth prop to GeneralSelect * refactor: remove unnecessary label id prop * refactor: the showActive prop is optional * refactor: add hooks for managing query string state * refactor: add a hour/minute timestamp formatter * refactor: add labels to button icons * feat: add new feature metrics page * refactor: remove prev feature metrics page * refactor: use new metric boxes on overview page * refactor: lazy-load the new metrics page * refactor: fix type error when formatting unknown error * refactor: extract interfaces for props * refactor: destructure all props * refactor: expand arg names * refactor: reorg component dirs and files * refactor: improve chart element label * refactor: hide chart dots until hover * refactor: add section titles to environments/applications * refactor: simplify FeatureMetricsHours types * refactor: sort chart tooltip items * refactor: add more chart labels * refactor: always show a dot in single point charts * refactor: improve chart tooltip styles * refactor: adjut metric page spacing * refactor: decrease legend box size * refactor: move date fmt fn inline * refactor: improve chart legend styles * refactor: increase Cypress timeouts * refactor: sort environment and application chips * refactor: format files * refactor: use stable lists of apps and envs * refactor: fix FeatureMetrics dir name * refactor: avoid ScrollToTop on query string change * refactor: use ConditionallyRender instead of inline condition * refactor: use makeStyles instead of styled API
2022-02-21 13:47:54 +01:00
export interface IFeatureMetricsRaw {
featureName: string;
appName: string;
environment: string;
timestamp: string;
yes: number;
no: number;
variants: Record<string, number>;
feat: add new feature metrics page (#716) * refactor: ensure that [hidden] overrides other display styles * refactor: use numeric font weights * refactor: remove unnecessary Jest mock * refactor: add a fullWidth prop to GeneralSelect * refactor: remove unnecessary label id prop * refactor: the showActive prop is optional * refactor: add hooks for managing query string state * refactor: add a hour/minute timestamp formatter * refactor: add labels to button icons * feat: add new feature metrics page * refactor: remove prev feature metrics page * refactor: use new metric boxes on overview page * refactor: lazy-load the new metrics page * refactor: fix type error when formatting unknown error * refactor: extract interfaces for props * refactor: destructure all props * refactor: expand arg names * refactor: reorg component dirs and files * refactor: improve chart element label * refactor: hide chart dots until hover * refactor: add section titles to environments/applications * refactor: simplify FeatureMetricsHours types * refactor: sort chart tooltip items * refactor: add more chart labels * refactor: always show a dot in single point charts * refactor: improve chart tooltip styles * refactor: adjut metric page spacing * refactor: decrease legend box size * refactor: move date fmt fn inline * refactor: improve chart legend styles * refactor: increase Cypress timeouts * refactor: sort environment and application chips * refactor: format files * refactor: use stable lists of apps and envs * refactor: fix FeatureMetrics dir name * refactor: avoid ScrollToTop on query string change * refactor: use ConditionallyRender instead of inline condition * refactor: use makeStyles instead of styled API
2022-02-21 13:47:54 +01:00
}