mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-15 17:50:48 +02:00
refactor: not used cleanup (#3347)
This commit is contained in:
parent
2f4c618292
commit
9969433f8c
@ -1,4 +1,4 @@
|
|||||||
import { AttachMoneyRounded, MonetizationOn } from '@mui/icons-material';
|
import { AttachMoneyRounded } from '@mui/icons-material';
|
||||||
import { styled, Tooltip } from '@mui/material';
|
import { styled, Tooltip } from '@mui/material';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import { TextCell } from 'component/common/Table/cells/TextCell/TextCell';
|
import { TextCell } from 'component/common/Table/cells/TextCell/TextCell';
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import Settings from '@mui/icons-material/Settings';
|
import { Typography, styled, Box } from '@mui/material';
|
||||||
import { Typography, IconButton, styled, Box } from '@mui/material';
|
import { FC } from 'react';
|
||||||
import { flexRow } from 'themes/themeStyles';
|
|
||||||
|
|
||||||
const StyledOuterContainerBox = styled(Box)(({ theme }) => ({
|
const StyledOuterContainerBox = styled(Box)(({ theme }) => ({
|
||||||
padding: theme.spacing(1.5, 3, 0.5, 3),
|
padding: theme.spacing(1.5, 3, 0.5, 3),
|
||||||
@ -15,7 +14,7 @@ const StyledInnerBox = styled(Box)(({ theme }) => ({
|
|||||||
height: '4px',
|
height: '4px',
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const NotificationsHeader: React.FC = ({ children }) => {
|
export const NotificationsHeader: FC = ({ children }) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<StyledOuterContainerBox>
|
<StyledOuterContainerBox>
|
||||||
|
@ -11,7 +11,6 @@ import {
|
|||||||
Switch,
|
Switch,
|
||||||
styled,
|
styled,
|
||||||
Theme,
|
Theme,
|
||||||
Box,
|
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import MenuIcon from '@mui/icons-material/Menu';
|
import MenuIcon from '@mui/icons-material/Menu';
|
||||||
import SettingsIcon from '@mui/icons-material/Settings';
|
import SettingsIcon from '@mui/icons-material/Settings';
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
import { colors } from 'themes/colors';
|
|
||||||
import { Alert, styled } from '@mui/material';
|
|
||||||
import { SdkContextSchema } from 'openapi';
|
|
||||||
|
|
||||||
interface IContextBannerProps {
|
|
||||||
environment: string;
|
|
||||||
projects?: string | string[];
|
|
||||||
context: SdkContextSchema;
|
|
||||||
}
|
|
||||||
|
|
||||||
const StyledContextFieldList = styled('ul')(({ theme }) => ({
|
|
||||||
color: theme.palette.text.primary,
|
|
||||||
listStyleType: 'none',
|
|
||||||
padding: theme.spacing(2),
|
|
||||||
}));
|
|
||||||
|
|
||||||
export const ContextBanner = ({
|
|
||||||
environment,
|
|
||||||
projects = [],
|
|
||||||
context,
|
|
||||||
}: IContextBannerProps) => {
|
|
||||||
return (
|
|
||||||
<Alert severity="info" sx={{ mt: 4, mb: 2, mx: 4 }}>
|
|
||||||
Your results are generated based on this configuration:
|
|
||||||
<StyledContextFieldList>
|
|
||||||
<li>environment: {environment}</li>
|
|
||||||
<li>
|
|
||||||
projects:{' '}
|
|
||||||
{Array.isArray(projects) ? projects.join(', ') : projects}
|
|
||||||
</li>
|
|
||||||
{Object.entries(context).map(([key, value]) => (
|
|
||||||
<li key={key}>
|
|
||||||
<span>{key}:</span> {value}
|
|
||||||
</li>
|
|
||||||
))}
|
|
||||||
</StyledContextFieldList>
|
|
||||||
</Alert>
|
|
||||||
);
|
|
||||||
};
|
|
@ -52,7 +52,6 @@ export const ProjectStats = ({ stats }: IProjectStatsProps) => {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
avgTimeToProdCurrentWindow,
|
avgTimeToProdCurrentWindow,
|
||||||
avgTimeToProdPastWindow,
|
|
||||||
projectActivityCurrentWindow,
|
projectActivityCurrentWindow,
|
||||||
projectActivityPastWindow,
|
projectActivityPastWindow,
|
||||||
createdCurrentWindow,
|
createdCurrentWindow,
|
||||||
@ -61,15 +60,6 @@ export const ProjectStats = ({ stats }: IProjectStatsProps) => {
|
|||||||
archivedPastWindow,
|
archivedPastWindow,
|
||||||
} = stats;
|
} = stats;
|
||||||
|
|
||||||
const calculatePercentage = (partial: number, total: number) => {
|
|
||||||
const percentage = (partial * 100) / total;
|
|
||||||
|
|
||||||
if (Number.isInteger(percentage)) {
|
|
||||||
return percentage;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledBox>
|
<StyledBox>
|
||||||
<StyledWidget>
|
<StyledWidget>
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { NotificationsSchemaItem } from 'openapi';
|
|
||||||
import useAPI from '../useApi/useApi';
|
import useAPI from '../useApi/useApi';
|
||||||
|
|
||||||
export const useNotificationsApi = () => {
|
export const useNotificationsApi = () => {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import useSWR, { SWRConfiguration } from 'swr';
|
import useSWR, { SWRConfiguration } from 'swr';
|
||||||
import { useCallback, useMemo } from 'react';
|
import { useCallback } from 'react';
|
||||||
import { formatApiPath } from 'utils/formatPath';
|
import { formatApiPath } from 'utils/formatPath';
|
||||||
import handleErrorResponses from '../httpErrorResponseHandler';
|
import handleErrorResponses from '../httpErrorResponseHandler';
|
||||||
import { NotificationsSchema } from 'openapi';
|
import { NotificationsSchema } from 'openapi';
|
||||||
|
@ -17,7 +17,6 @@ const fallbackProject: IProject = {
|
|||||||
archivedCurrentWindow: 0,
|
archivedCurrentWindow: 0,
|
||||||
archivedPastWindow: 0,
|
archivedPastWindow: 0,
|
||||||
avgTimeToProdCurrentWindow: 0,
|
avgTimeToProdCurrentWindow: 0,
|
||||||
avgTimeToProdPastWindow: 0,
|
|
||||||
createdCurrentWindow: 0,
|
createdCurrentWindow: 0,
|
||||||
createdPastWindow: 0,
|
createdPastWindow: 0,
|
||||||
projectActivityCurrentWindow: 0,
|
projectActivityCurrentWindow: 0,
|
||||||
|
@ -11,4 +11,6 @@ export interface CreateFeatureStrategySchema {
|
|||||||
sortOrder?: number;
|
sortOrder?: number;
|
||||||
constraints?: ConstraintSchema[];
|
constraints?: ConstraintSchema[];
|
||||||
parameters?: ParametersSchema;
|
parameters?: ParametersSchema;
|
||||||
|
/** Ids of segments to use for this strategy */
|
||||||
|
segments?: number[];
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
* Do not edit manually.
|
* Do not edit manually.
|
||||||
* See `gen:api` script in package.json
|
* See `gen:api` script in package.json
|
||||||
*/
|
*/
|
||||||
|
import type { HealthOverviewSchemaDefaultStickiness } from './healthOverviewSchemaDefaultStickiness';
|
||||||
|
import type { HealthOverviewSchemaMode } from './healthOverviewSchemaMode';
|
||||||
import type { FeatureSchema } from './featureSchema';
|
import type { FeatureSchema } from './featureSchema';
|
||||||
import type { ProjectStatsSchema } from './projectStatsSchema';
|
import type { ProjectStatsSchema } from './projectStatsSchema';
|
||||||
|
|
||||||
@ -10,6 +12,10 @@ export interface HealthOverviewSchema {
|
|||||||
version: number;
|
version: number;
|
||||||
name: string;
|
name: string;
|
||||||
description?: string | null;
|
description?: string | null;
|
||||||
|
/** A default stickiness for the project affecting the default stickiness value for variants and Gradual Rollout strategy */
|
||||||
|
defaultStickiness?: HealthOverviewSchemaDefaultStickiness;
|
||||||
|
/** A mode of the project affecting what actions are possible in this project. During a rollout of project modes this feature can be optional or `null` */
|
||||||
|
mode?: HealthOverviewSchemaMode;
|
||||||
members?: number;
|
members?: number;
|
||||||
health?: number;
|
health?: number;
|
||||||
environments?: string[];
|
environments?: string[];
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* Generated by Orval
|
||||||
|
* Do not edit manually.
|
||||||
|
* See `gen:api` script in package.json
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A default stickiness for the project affecting the default stickiness value for variants and Gradual Rollout strategy
|
||||||
|
*/
|
||||||
|
export type HealthOverviewSchemaDefaultStickiness =
|
||||||
|
typeof HealthOverviewSchemaDefaultStickiness[keyof typeof HealthOverviewSchemaDefaultStickiness];
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
||||||
|
export const HealthOverviewSchemaDefaultStickiness = {
|
||||||
|
default: 'default',
|
||||||
|
userId: 'userId',
|
||||||
|
sessionId: 'sessionId',
|
||||||
|
random: 'random',
|
||||||
|
} as const;
|
18
frontend/src/openapi/models/healthOverviewSchemaMode.ts
Normal file
18
frontend/src/openapi/models/healthOverviewSchemaMode.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/**
|
||||||
|
* Generated by Orval
|
||||||
|
* Do not edit manually.
|
||||||
|
* See `gen:api` script in package.json
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A mode of the project affecting what actions are possible in this project. During a rollout of project modes this feature can be optional or `null`
|
||||||
|
*/
|
||||||
|
export type HealthOverviewSchemaMode =
|
||||||
|
typeof HealthOverviewSchemaMode[keyof typeof HealthOverviewSchemaMode];
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
||||||
|
export const HealthOverviewSchemaMode = {
|
||||||
|
open: 'open',
|
||||||
|
protected: 'protected',
|
||||||
|
null: null,
|
||||||
|
} as const;
|
@ -3,6 +3,8 @@
|
|||||||
* Do not edit manually.
|
* Do not edit manually.
|
||||||
* See `gen:api` script in package.json
|
* See `gen:api` script in package.json
|
||||||
*/
|
*/
|
||||||
|
import type { HealthReportSchemaDefaultStickiness } from './healthReportSchemaDefaultStickiness';
|
||||||
|
import type { HealthReportSchemaMode } from './healthReportSchemaMode';
|
||||||
import type { FeatureSchema } from './featureSchema';
|
import type { FeatureSchema } from './featureSchema';
|
||||||
import type { ProjectStatsSchema } from './projectStatsSchema';
|
import type { ProjectStatsSchema } from './projectStatsSchema';
|
||||||
|
|
||||||
@ -10,6 +12,10 @@ export interface HealthReportSchema {
|
|||||||
version: number;
|
version: number;
|
||||||
name: string;
|
name: string;
|
||||||
description?: string | null;
|
description?: string | null;
|
||||||
|
/** A default stickiness for the project affecting the default stickiness value for variants and Gradual Rollout strategy */
|
||||||
|
defaultStickiness?: HealthReportSchemaDefaultStickiness;
|
||||||
|
/** A mode of the project affecting what actions are possible in this project. During a rollout of project modes this feature can be optional or `null` */
|
||||||
|
mode?: HealthReportSchemaMode;
|
||||||
members?: number;
|
members?: number;
|
||||||
health?: number;
|
health?: number;
|
||||||
environments?: string[];
|
environments?: string[];
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* Generated by Orval
|
||||||
|
* Do not edit manually.
|
||||||
|
* See `gen:api` script in package.json
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A default stickiness for the project affecting the default stickiness value for variants and Gradual Rollout strategy
|
||||||
|
*/
|
||||||
|
export type HealthReportSchemaDefaultStickiness =
|
||||||
|
typeof HealthReportSchemaDefaultStickiness[keyof typeof HealthReportSchemaDefaultStickiness];
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
||||||
|
export const HealthReportSchemaDefaultStickiness = {
|
||||||
|
default: 'default',
|
||||||
|
userId: 'userId',
|
||||||
|
sessionId: 'sessionId',
|
||||||
|
random: 'random',
|
||||||
|
} as const;
|
18
frontend/src/openapi/models/healthReportSchemaMode.ts
Normal file
18
frontend/src/openapi/models/healthReportSchemaMode.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/**
|
||||||
|
* Generated by Orval
|
||||||
|
* Do not edit manually.
|
||||||
|
* See `gen:api` script in package.json
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A mode of the project affecting what actions are possible in this project. During a rollout of project modes this feature can be optional or `null`
|
||||||
|
*/
|
||||||
|
export type HealthReportSchemaMode =
|
||||||
|
typeof HealthReportSchemaMode[keyof typeof HealthReportSchemaMode];
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
||||||
|
export const HealthReportSchemaMode = {
|
||||||
|
open: 'open',
|
||||||
|
protected: 'protected',
|
||||||
|
null: null,
|
||||||
|
} as const;
|
@ -120,7 +120,11 @@ export * from './groupsSchema';
|
|||||||
export * from './healthCheckSchema';
|
export * from './healthCheckSchema';
|
||||||
export * from './healthCheckSchemaHealth';
|
export * from './healthCheckSchemaHealth';
|
||||||
export * from './healthOverviewSchema';
|
export * from './healthOverviewSchema';
|
||||||
|
export * from './healthOverviewSchemaDefaultStickiness';
|
||||||
|
export * from './healthOverviewSchemaMode';
|
||||||
export * from './healthReportSchema';
|
export * from './healthReportSchema';
|
||||||
|
export * from './healthReportSchemaDefaultStickiness';
|
||||||
|
export * from './healthReportSchemaMode';
|
||||||
export * from './idSchema';
|
export * from './idSchema';
|
||||||
export * from './importTogglesSchema';
|
export * from './importTogglesSchema';
|
||||||
export * from './importTogglesValidateItemSchema';
|
export * from './importTogglesValidateItemSchema';
|
||||||
@ -178,6 +182,7 @@ export * from './projectCreatedSchema';
|
|||||||
export * from './projectEnvironmentSchema';
|
export * from './projectEnvironmentSchema';
|
||||||
export * from './projectOverviewSchema';
|
export * from './projectOverviewSchema';
|
||||||
export * from './projectSchema';
|
export * from './projectSchema';
|
||||||
|
export * from './projectSchemaDefaultStickiness';
|
||||||
export * from './projectSchemaMode';
|
export * from './projectSchemaMode';
|
||||||
export * from './projectStatsSchema';
|
export * from './projectStatsSchema';
|
||||||
export * from './projectUsers';
|
export * from './projectUsers';
|
||||||
@ -223,7 +228,6 @@ export * from './setUiConfigSchemaFrontendSettings';
|
|||||||
export * from './sortOrderSchema';
|
export * from './sortOrderSchema';
|
||||||
export * from './splashSchema';
|
export * from './splashSchema';
|
||||||
export * from './stateSchema';
|
export * from './stateSchema';
|
||||||
export * from './stickinessSchema';
|
|
||||||
export * from './strategiesSchema';
|
export * from './strategiesSchema';
|
||||||
export * from './strategySchema';
|
export * from './strategySchema';
|
||||||
export * from './strategySchemaParametersItem';
|
export * from './strategySchemaParametersItem';
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
* See `gen:api` script in package.json
|
* See `gen:api` script in package.json
|
||||||
*/
|
*/
|
||||||
import type { ProjectSchemaMode } from './projectSchemaMode';
|
import type { ProjectSchemaMode } from './projectSchemaMode';
|
||||||
|
import type { ProjectSchemaDefaultStickiness } from './projectSchemaDefaultStickiness';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A definition of the project used for projects listing purposes
|
* A definition of the project used for projects listing purposes
|
||||||
@ -25,6 +26,8 @@ export interface ProjectSchema {
|
|||||||
updatedAt?: string | null;
|
updatedAt?: string | null;
|
||||||
/** `true` if the project was favorited, otherwise `false`. */
|
/** `true` if the project was favorited, otherwise `false`. */
|
||||||
favorite?: boolean;
|
favorite?: boolean;
|
||||||
/** A mode of the project affecting what actions are possible in this project. During a rollout of project modes this feature can be optional or `null` */
|
/** A mode of the project affecting what actions are possible in this project */
|
||||||
mode?: ProjectSchemaMode;
|
mode?: ProjectSchemaMode;
|
||||||
|
/** A default stickiness for the project affecting the default stickiness value for variants and Gradual Rollout strategy */
|
||||||
|
defaultStickiness?: ProjectSchemaDefaultStickiness;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* Generated by Orval
|
||||||
|
* Do not edit manually.
|
||||||
|
* See `gen:api` script in package.json
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A default stickiness for the project affecting the default stickiness value for variants and Gradual Rollout strategy
|
||||||
|
*/
|
||||||
|
export type ProjectSchemaDefaultStickiness =
|
||||||
|
typeof ProjectSchemaDefaultStickiness[keyof typeof ProjectSchemaDefaultStickiness];
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
||||||
|
export const ProjectSchemaDefaultStickiness = {
|
||||||
|
default: 'default',
|
||||||
|
userId: 'userId',
|
||||||
|
sessionId: 'sessionId',
|
||||||
|
random: 'random',
|
||||||
|
} as const;
|
@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A mode of the project affecting what actions are possible in this project. During a rollout of project modes this feature can be optional or `null`
|
* A mode of the project affecting what actions are possible in this project
|
||||||
*/
|
*/
|
||||||
export type ProjectSchemaMode =
|
export type ProjectSchemaMode =
|
||||||
typeof ProjectSchemaMode[keyof typeof ProjectSchemaMode];
|
typeof ProjectSchemaMode[keyof typeof ProjectSchemaMode];
|
||||||
@ -14,5 +14,4 @@ export type ProjectSchemaMode =
|
|||||||
export const ProjectSchemaMode = {
|
export const ProjectSchemaMode = {
|
||||||
open: 'open',
|
open: 'open',
|
||||||
protected: 'protected',
|
protected: 'protected',
|
||||||
null: null,
|
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -14,8 +14,6 @@ Stats are divided into current and previous **windows**.
|
|||||||
export interface ProjectStatsSchema {
|
export interface ProjectStatsSchema {
|
||||||
/** The average time from when a feature was created to when it was enabled in the "production" environment during the current window */
|
/** The average time from when a feature was created to when it was enabled in the "production" environment during the current window */
|
||||||
avgTimeToProdCurrentWindow: number;
|
avgTimeToProdCurrentWindow: number;
|
||||||
/** The average time from when a feature was created to when it was enabled in the "production" environment during the previous window */
|
|
||||||
avgTimeToProdPastWindow: number;
|
|
||||||
/** The number of feature toggles created during the current window */
|
/** The number of feature toggles created during the current window */
|
||||||
createdCurrentWindow: number;
|
createdCurrentWindow: number;
|
||||||
/** The number of feature toggles created during the previous window */
|
/** The number of feature toggles created during the previous window */
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
/**
|
|
||||||
* Generated by Orval
|
|
||||||
* Do not edit manually.
|
|
||||||
* See `gen:api` script in package.json
|
|
||||||
*/
|
|
||||||
|
|
||||||
export interface StickinessSchema {
|
|
||||||
stickiness: string;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user