Skip to content

Commit

Permalink
refactor: not used cleanup (#3347)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaanus committed Mar 21, 2023
1 parent 2f4c618 commit 9969433
Show file tree
Hide file tree
Showing 21 changed files with 122 additions and 73 deletions.
@@ -1,4 +1,4 @@
import { AttachMoneyRounded, MonetizationOn } from '@mui/icons-material';
import { AttachMoneyRounded } from '@mui/icons-material';
import { styled, Tooltip } from '@mui/material';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import { TextCell } from 'component/common/Table/cells/TextCell/TextCell';
Expand Down
@@ -1,6 +1,5 @@
import Settings from '@mui/icons-material/Settings';
import { Typography, IconButton, styled, Box } from '@mui/material';
import { flexRow } from 'themes/themeStyles';
import { Typography, styled, Box } from '@mui/material';
import { FC } from 'react';

const StyledOuterContainerBox = styled(Box)(({ theme }) => ({
padding: theme.spacing(1.5, 3, 0.5, 3),
Expand All @@ -15,7 +14,7 @@ const StyledInnerBox = styled(Box)(({ theme }) => ({
height: '4px',
}));

export const NotificationsHeader: React.FC = ({ children }) => {
export const NotificationsHeader: FC = ({ children }) => {
return (
<>
<StyledOuterContainerBox>
Expand Down
1 change: 0 additions & 1 deletion frontend/src/component/menu/Header/Header.tsx
Expand Up @@ -11,7 +11,6 @@ import {
Switch,
styled,
Theme,
Box,
} from '@mui/material';
import MenuIcon from '@mui/icons-material/Menu';
import SettingsIcon from '@mui/icons-material/Settings';
Expand Down

This file was deleted.

Expand Up @@ -52,7 +52,6 @@ export const ProjectStats = ({ stats }: IProjectStatsProps) => {

const {
avgTimeToProdCurrentWindow,
avgTimeToProdPastWindow,
projectActivityCurrentWindow,
projectActivityPastWindow,
createdCurrentWindow,
Expand All @@ -61,15 +60,6 @@ export const ProjectStats = ({ stats }: IProjectStatsProps) => {
archivedPastWindow,
} = stats;

const calculatePercentage = (partial: number, total: number) => {
const percentage = (partial * 100) / total;

if (Number.isInteger(percentage)) {
return percentage;
}
return 0;
};

return (
<StyledBox>
<StyledWidget>
Expand Down
@@ -1,4 +1,3 @@
import { NotificationsSchemaItem } from 'openapi';
import useAPI from '../useApi/useApi';

export const useNotificationsApi = () => {
Expand Down
@@ -1,5 +1,5 @@
import useSWR, { SWRConfiguration } from 'swr';
import { useCallback, useMemo } from 'react';
import { useCallback } from 'react';
import { formatApiPath } from 'utils/formatPath';
import handleErrorResponses from '../httpErrorResponseHandler';
import { NotificationsSchema } from 'openapi';
Expand Down
1 change: 0 additions & 1 deletion frontend/src/hooks/api/getters/useProject/useProject.ts
Expand Up @@ -17,7 +17,6 @@ const fallbackProject: IProject = {
archivedCurrentWindow: 0,
archivedPastWindow: 0,
avgTimeToProdCurrentWindow: 0,
avgTimeToProdPastWindow: 0,
createdCurrentWindow: 0,
createdPastWindow: 0,
projectActivityCurrentWindow: 0,
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/openapi/models/createFeatureStrategySchema.ts
Expand Up @@ -11,4 +11,6 @@ export interface CreateFeatureStrategySchema {
sortOrder?: number;
constraints?: ConstraintSchema[];
parameters?: ParametersSchema;
/** Ids of segments to use for this strategy */
segments?: number[];
}
6 changes: 6 additions & 0 deletions frontend/src/openapi/models/healthOverviewSchema.ts
Expand Up @@ -3,13 +3,19 @@
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { HealthOverviewSchemaDefaultStickiness } from './healthOverviewSchemaDefaultStickiness';
import type { HealthOverviewSchemaMode } from './healthOverviewSchemaMode';
import type { FeatureSchema } from './featureSchema';
import type { ProjectStatsSchema } from './projectStatsSchema';

export interface HealthOverviewSchema {
version: number;
name: string;
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;
health?: number;
environments?: string[];
Expand Down
@@ -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 changes: 18 additions & 0 deletions frontend/src/openapi/models/healthOverviewSchemaMode.ts
@@ -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;
6 changes: 6 additions & 0 deletions frontend/src/openapi/models/healthReportSchema.ts
Expand Up @@ -3,13 +3,19 @@
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { HealthReportSchemaDefaultStickiness } from './healthReportSchemaDefaultStickiness';
import type { HealthReportSchemaMode } from './healthReportSchemaMode';
import type { FeatureSchema } from './featureSchema';
import type { ProjectStatsSchema } from './projectStatsSchema';

export interface HealthReportSchema {
version: number;
name: string;
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;
health?: number;
environments?: string[];
Expand Down
19 changes: 19 additions & 0 deletions frontend/src/openapi/models/healthReportSchemaDefaultStickiness.ts
@@ -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 changes: 18 additions & 0 deletions frontend/src/openapi/models/healthReportSchemaMode.ts
@@ -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;
6 changes: 5 additions & 1 deletion frontend/src/openapi/models/index.ts
Expand Up @@ -120,7 +120,11 @@ export * from './groupsSchema';
export * from './healthCheckSchema';
export * from './healthCheckSchemaHealth';
export * from './healthOverviewSchema';
export * from './healthOverviewSchemaDefaultStickiness';
export * from './healthOverviewSchemaMode';
export * from './healthReportSchema';
export * from './healthReportSchemaDefaultStickiness';
export * from './healthReportSchemaMode';
export * from './idSchema';
export * from './importTogglesSchema';
export * from './importTogglesValidateItemSchema';
Expand Down Expand Up @@ -178,6 +182,7 @@ export * from './projectCreatedSchema';
export * from './projectEnvironmentSchema';
export * from './projectOverviewSchema';
export * from './projectSchema';
export * from './projectSchemaDefaultStickiness';
export * from './projectSchemaMode';
export * from './projectStatsSchema';
export * from './projectUsers';
Expand Down Expand Up @@ -223,7 +228,6 @@ export * from './setUiConfigSchemaFrontendSettings';
export * from './sortOrderSchema';
export * from './splashSchema';
export * from './stateSchema';
export * from './stickinessSchema';
export * from './strategiesSchema';
export * from './strategySchema';
export * from './strategySchemaParametersItem';
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/openapi/models/projectSchema.ts
Expand Up @@ -4,6 +4,7 @@
* See `gen:api` script in package.json
*/
import type { ProjectSchemaMode } from './projectSchemaMode';
import type { ProjectSchemaDefaultStickiness } from './projectSchemaDefaultStickiness';

/**
* A definition of the project used for projects listing purposes
Expand All @@ -25,6 +26,8 @@ export interface ProjectSchema {
updatedAt?: string | null;
/** `true` if the project was favorited, otherwise `false`. */
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;
/** A default stickiness for the project affecting the default stickiness value for variants and Gradual Rollout strategy */
defaultStickiness?: ProjectSchemaDefaultStickiness;
}
19 changes: 19 additions & 0 deletions frontend/src/openapi/models/projectSchemaDefaultStickiness.ts
@@ -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;
3 changes: 1 addition & 2 deletions frontend/src/openapi/models/projectSchemaMode.ts
Expand Up @@ -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 =
typeof ProjectSchemaMode[keyof typeof ProjectSchemaMode];
Expand All @@ -14,5 +14,4 @@ export type ProjectSchemaMode =
export const ProjectSchemaMode = {
open: 'open',
protected: 'protected',
null: null,
} as const;
2 changes: 0 additions & 2 deletions frontend/src/openapi/models/projectStatsSchema.ts
Expand Up @@ -14,8 +14,6 @@ Stats are divided into current and previous **windows**.
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 */
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 */
createdCurrentWindow: number;
/** The number of feature toggles created during the previous window */
Expand Down
9 changes: 0 additions & 9 deletions frontend/src/openapi/models/stickinessSchema.ts

This file was deleted.

0 comments on commit 9969433

Please sign in to comment.