From c20913f4e315303a2100e063814e0ae29379dd69 Mon Sep 17 00:00:00 2001 From: sjaanus Date: Tue, 30 Jan 2024 14:58:51 +0200 Subject: [PATCH] Fix --- .../ApplicationList/ApplicationList.tsx | 10 ++------- .../ChangeRequestsTabs/ChangeRequestsTabs.tsx | 7 +----- .../ContextList/ContextList/ContextList.tsx | 12 ++-------- .../component/demo/DemoSteps/DemoSteps.tsx | 21 ++++++++++-------- .../EnvironmentVariantsTable.tsx | 6 +---- .../featureTypes/FeatureTypesList.tsx | 6 +---- .../VariantInformation/VariantInformation.tsx | 22 ++++++------------- .../ProjectFeatureToggles.types.ts | 2 +- .../ProjectDoraMetrics/ProjectDoraMetrics.tsx | 6 +---- .../segments/SegmentTable/SegmentTable.tsx | 6 +---- .../StrategiesList/StrategiesList.tsx | 4 +--- .../tags/TagTypeList/TagTypeList.tsx | 6 +---- frontend/src/types/react-table-config.d.ts | 5 +++-- src/lib/db/client-applications-store.ts | 4 +--- src/lib/proxy/proxy-repository.ts | 5 +---- src/lib/routes/controller.ts | 3 +-- src/lib/services/state-util.ts | 19 +++++++--------- src/lib/util/omit-keys.ts | 5 +---- .../fixtures/fake-favorite-features-store.ts | 4 +--- .../fixtures/fake-favorite-projects-store.ts | 4 +--- 20 files changed, 48 insertions(+), 109 deletions(-) diff --git a/frontend/src/component/application/ApplicationList/ApplicationList.tsx b/frontend/src/component/application/ApplicationList/ApplicationList.tsx index c316390430d2..35c0562234d6 100644 --- a/frontend/src/component/application/ApplicationList/ApplicationList.tsx +++ b/frontend/src/component/application/ApplicationList/ApplicationList.tsx @@ -56,11 +56,7 @@ export const ApplicationList = () => { () => [ { id: 'Icon', - Cell: ({ - row: { - original: { icon }, - }, - }: any) => ( + Cell: ({ row: { original: { icon } } }: any) => ( @@ -76,9 +72,7 @@ export const ApplicationList = () => { accessor: 'appName', width: '50%', Cell: ({ - row: { - original: { appName, description }, - }, + row: { original: { appName, description } }, }: any) => ( ( + Cell: ({ value, row: { original: { title } } }: any) => ( { Header: 'Name', accessor: 'name', width: '70%', - Cell: ({ - row: { - original: { name, description }, - }, - }: any) => ( + Cell: ({ row: { original: { name, description } } }: any) => ( { Header: 'Actions', id: 'Actions', align: 'center', - Cell: ({ - row: { - original: { name }, - }, - }: any) => ( + Cell: ({ row: { original: { name } } }: any) => ( { diff --git a/frontend/src/component/demo/DemoSteps/DemoSteps.tsx b/frontend/src/component/demo/DemoSteps/DemoSteps.tsx index bb318e3218f7..8a5af3678081 100644 --- a/frontend/src/component/demo/DemoSteps/DemoSteps.tsx +++ b/frontend/src/component/demo/DemoSteps/DemoSteps.tsx @@ -211,15 +211,18 @@ export const DemoSteps = ({ const currentStep = currentTopic.steps[step]; if (!currentStep) return; - setTimeout(() => { - if ( - currentStep.href && - !location.pathname.endsWith(currentStep.href.split('?')[0]) - ) { - navigate(currentStep.href); - } - waitForLoad(currentStep); - }, currentStep.delay ?? 0); + setTimeout( + () => { + if ( + currentStep.href && + !location.pathname.endsWith(currentStep.href.split('?')[0]) + ) { + navigate(currentStep.href); + } + waitForLoad(currentStep); + }, + currentStep.delay ?? 0, + ); }, [topic, step]); useEffect(() => { diff --git a/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsCard/EnvironmentVariantsTable/EnvironmentVariantsTable.tsx b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsCard/EnvironmentVariantsTable/EnvironmentVariantsTable.tsx index d8118d97d46a..d5deb79dc80b 100644 --- a/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsCard/EnvironmentVariantsTable/EnvironmentVariantsTable.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsCard/EnvironmentVariantsTable/EnvironmentVariantsTable.tsx @@ -70,11 +70,7 @@ export const EnvironmentVariantsTable = ({ { Header: 'Weight', accessor: 'weight', - Cell: ({ - row: { - original: { name, weight }, - }, - }: any) => { + Cell: ({ row: { original: { name, weight } } }: any) => { return ( {calculateVariantWeight(weight)} % diff --git a/frontend/src/component/featureTypes/FeatureTypesList.tsx b/frontend/src/component/featureTypes/FeatureTypesList.tsx index 5469cfdc2a9d..ebef75bd348c 100644 --- a/frontend/src/component/featureTypes/FeatureTypesList.tsx +++ b/frontend/src/component/featureTypes/FeatureTypesList.tsx @@ -54,11 +54,7 @@ export const FeatureTypesList = () => { Header: 'Name', accessor: 'name', width: '90%', - Cell: ({ - row: { - original: { name, description }, - }, - }: any) => { + Cell: ({ row: { original: { name, description } } }: any) => { return ( = ({ const COLUMNS = [ { id: 'Icon', - Cell: ({ - row: { - original: { selected }, - }, - }: any) => ( + Cell: ({ row: { original: { selected } } }: any) => ( <> {name}, + Cell: ({ row: { original: { name } } }: any) => ( + {name} + ), maxWidth: 175, width: 175, }, @@ -150,10 +144,8 @@ const COLUMNS = [ sortType: 'alphanumeric', searchable: true, maxWidth: 75, - Cell: ({ - row: { - original: { weight }, - }, - }: any) => {weight}, + Cell: ({ row: { original: { weight } } }: any) => ( + {weight} + ), }, ]; diff --git a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.types.ts b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.types.ts index 0531079d65d8..124d4b0d25be 100644 --- a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.types.ts +++ b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.types.ts @@ -1,4 +1,4 @@ -import { IProject } from '../../../../interfaces/project'; +import { IProject } from 'interfaces/project'; export type ListItemType = Pick< IProject['features'][number], diff --git a/frontend/src/component/project/Project/ProjectDoraMetrics/ProjectDoraMetrics.tsx b/frontend/src/component/project/Project/ProjectDoraMetrics/ProjectDoraMetrics.tsx index 9219075a1673..5cfb217d61b0 100644 --- a/frontend/src/component/project/Project/ProjectDoraMetrics/ProjectDoraMetrics.tsx +++ b/frontend/src/component/project/Project/ProjectDoraMetrics/ProjectDoraMetrics.tsx @@ -57,11 +57,7 @@ export const ProjectDoraMetrics = () => { Header: 'Name', accessor: 'name', width: '40%', - Cell: ({ - row: { - original: { name }, - }, - }: any) => { + Cell: ({ row: { original: { name } } }: any) => { return ( [ Header: 'Name', accessor: 'name', width: '60%', - Cell: ({ - row: { - original: { name, description, id }, - }, - }: any) => ( + Cell: ({ row: { original: { name, description, id } } }: any) => ( { accessor: (row: any) => formatStrategyName(row.name), width: '90%', Cell: ({ - row: { - original: { name, description, deprecated }, - }, + row: { original: { name, description, deprecated } }, }: any) => { return ( { Header: 'Name', accessor: 'name', width: '90%', - Cell: ({ - row: { - original: { name, description }, - }, - }: any) => { + Cell: ({ row: { original: { name, description } } }: any) => { return ( > - extends UseExpandedOptions, + export interface TableOptions< + D extends Record, + > extends UseExpandedOptions, UseFiltersOptions, UseGlobalFiltersOptions, UseGroupByOptions, diff --git a/src/lib/db/client-applications-store.ts b/src/lib/db/client-applications-store.ts index 1ca45fdd23f4..dbce4e66e043 100644 --- a/src/lib/db/client-applications-store.ts +++ b/src/lib/db/client-applications-store.ts @@ -104,9 +104,7 @@ const remapUsageRow = (input) => { }; }; -export default class ClientApplicationsStore - implements IClientApplicationsStore -{ +export default class ClientApplicationsStore implements IClientApplicationsStore { private db: Db; private logger: Logger; diff --git a/src/lib/proxy/proxy-repository.ts b/src/lib/proxy/proxy-repository.ts index 5289ddbe9cab..e490cfd89af7 100644 --- a/src/lib/proxy/proxy-repository.ts +++ b/src/lib/proxy/proxy-repository.ts @@ -24,10 +24,7 @@ type Services = Pick< 'featureToggleServiceV2' | 'segmentService' | 'configurationRevisionService' >; -export class ProxyRepository - extends EventEmitter - implements RepositoryInterface -{ +export class ProxyRepository extends EventEmitter implements RepositoryInterface { private readonly config: Config; private readonly logger: Logger; diff --git a/src/lib/routes/controller.ts b/src/lib/routes/controller.ts index 37f2995e7f21..d7a77192041f 100644 --- a/src/lib/routes/controller.ts +++ b/src/lib/routes/controller.ts @@ -39,8 +39,7 @@ interface IRouteOptionsNonGet extends IRouteOptionsBase { type IRouteOptions = IRouteOptionsNonGet | IRouteOptionsGet; const checkPermission = - (permission: Permission = []) => - async (req, res, next) => { + (permission: Permission = []) => async (req, res, next) => { const permissions = ( Array.isArray(permission) ? permission : [permission] ).filter((p) => p !== NONE); diff --git a/src/lib/services/state-util.ts b/src/lib/services/state-util.ts index 730521c2a24a..38993efece9c 100644 --- a/src/lib/services/state-util.ts +++ b/src/lib/services/state-util.ts @@ -17,19 +17,16 @@ export const parseFile: (file: string, data: string) => any = ( export const filterExisting: ( keepExisting: boolean, existingArray: any[], -) => (item: any) => boolean = - (keepExisting, existingArray = []) => - (item) => { - if (keepExisting) { - const found = existingArray.find((t) => t.name === item.name); - return !found; - } - return true; - }; +) => (item: any) => boolean = (keepExisting, existingArray = []) => (item) => { + if (keepExisting) { + const found = existingArray.find((t) => t.name === item.name); + return !found; + } + return true; +}; export const filterEqual: (existingArray: any[]) => (item: any) => boolean = - (existingArray = []) => - (item) => { + (existingArray = []) => (item) => { const toggle = existingArray.find((t) => t.name === item.name); if (toggle) { return JSON.stringify(toggle) !== JSON.stringify(item); diff --git a/src/lib/util/omit-keys.ts b/src/lib/util/omit-keys.ts index 5268fbe7f26a..ded3ad4bc3ce 100644 --- a/src/lib/util/omit-keys.ts +++ b/src/lib/util/omit-keys.ts @@ -1,8 +1,5 @@ export interface OmitKeys { - ( - obj: T, - ...keys: K - ): { + (obj: T, ...keys: K): { [K2 in Exclude]: T[K2]; }; } diff --git a/src/test/fixtures/fake-favorite-features-store.ts b/src/test/fixtures/fake-favorite-features-store.ts index 2a31b1f23c1e..603a7d46bc31 100644 --- a/src/test/fixtures/fake-favorite-features-store.ts +++ b/src/test/fixtures/fake-favorite-features-store.ts @@ -2,9 +2,7 @@ import { IFavoriteFeaturesStore } from '../../lib/types'; import { IFavoriteFeatureKey } from '../../lib/types/stores/favorite-features'; import { IFavoriteFeature } from '../../lib/types/favorites'; /* eslint-disable @typescript-eslint/no-unused-vars */ -export default class FakeFavoriteFeaturesStore - implements IFavoriteFeaturesStore -{ +export default class FakeFavoriteFeaturesStore implements IFavoriteFeaturesStore { addFavoriteFeature( favorite: IFavoriteFeatureKey, ): Promise { diff --git a/src/test/fixtures/fake-favorite-projects-store.ts b/src/test/fixtures/fake-favorite-projects-store.ts index e78889de36af..a609190f508f 100644 --- a/src/test/fixtures/fake-favorite-projects-store.ts +++ b/src/test/fixtures/fake-favorite-projects-store.ts @@ -2,9 +2,7 @@ import { IFavoriteProjectsStore } from '../../lib/types'; import { IFavoriteProjectKey } from '../../lib/types/stores/favorite-projects'; import { IFavoriteProject } from '../../lib/types/favorites'; /* eslint-disable @typescript-eslint/no-unused-vars */ -export default class FakeFavoriteProjectsStore - implements IFavoriteProjectsStore -{ +export default class FakeFavoriteProjectsStore implements IFavoriteProjectsStore { addFavoriteProject( favorite: IFavoriteProjectKey, ): Promise {