Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaanus committed Jan 30, 2024
1 parent 4e1cba8 commit c20913f
Show file tree
Hide file tree
Showing 20 changed files with 48 additions and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ export const ApplicationList = () => {
() => [
{
id: 'Icon',
Cell: ({
row: {
original: { icon },
},
}: any) => (
Cell: ({ row: { original: { icon } } }: any) => (
<IconCell
icon={
<Avatar>
Expand All @@ -76,9 +72,7 @@ export const ApplicationList = () => {
accessor: 'appName',
width: '50%',
Cell: ({
row: {
original: { appName, description },
},
row: { original: { appName, description } },
}: any) => (
<LinkCell
title={appName}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,7 @@ export const ChangeRequestsTabs = ({
.includes(feature.name.toLowerCase()),
);
},
Cell: ({
value,
row: {
original: { title },
},
}: any) => (
Cell: ({ value, row: { original: { title } } }: any) => (
<FeaturesCell
project={projectId}
value={value}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ const ContextList: VFC = () => {
Header: 'Name',
accessor: 'name',
width: '70%',
Cell: ({
row: {
original: { name, description },
},
}: any) => (
Cell: ({ row: { original: { name, description } } }: any) => (
<LinkCell
title={name}
to={`/context/edit/${name}`}
Expand All @@ -95,11 +91,7 @@ const ContextList: VFC = () => {
Header: 'Actions',
id: 'Actions',
align: 'center',
Cell: ({
row: {
original: { name },
},
}: any) => (
Cell: ({ row: { original: { name } } }: any) => (
<ContextActionsCell
name={name}
onDelete={() => {
Expand Down
21 changes: 12 additions & 9 deletions frontend/src/component/demo/DemoSteps/DemoSteps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@ export const EnvironmentVariantsTable = ({
{
Header: 'Weight',
accessor: 'weight',
Cell: ({
row: {
original: { name, weight },
},
}: any) => {
Cell: ({ row: { original: { name, weight } } }: any) => {
return (
<TextCell data-testid={`VARIANT_WEIGHT_${name}`}>
{calculateVariantWeight(weight)} %
Expand Down
6 changes: 1 addition & 5 deletions frontend/src/component/featureTypes/FeatureTypesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<LinkCell
data-loading
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,7 @@ export const VariantInformation: VFC<IVariantInformationProps> = ({
const COLUMNS = [
{
id: 'Icon',
Cell: ({
row: {
original: { selected },
},
}: any) => (
Cell: ({ row: { original: { selected } } }: any) => (
<>
<ConditionallyRender
condition={selected}
Expand All @@ -136,11 +132,9 @@ const COLUMNS = [
Header: 'Name',
accessor: 'name',
searchable: true,
Cell: ({
row: {
original: { name },
},
}: any) => <TextCell>{name}</TextCell>,
Cell: ({ row: { original: { name } } }: any) => (
<TextCell>{name}</TextCell>
),
maxWidth: 175,
width: 175,
},
Expand All @@ -150,10 +144,8 @@ const COLUMNS = [
sortType: 'alphanumeric',
searchable: true,
maxWidth: 75,
Cell: ({
row: {
original: { weight },
},
}: any) => <TextCell>{weight}</TextCell>,
Cell: ({ row: { original: { weight } } }: any) => (
<TextCell>{weight}</TextCell>
),
},
];
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IProject } from '../../../../interfaces/project';
import { IProject } from 'interfaces/project';

export type ListItemType = Pick<
IProject['features'][number],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@ export const ProjectDoraMetrics = () => {
Header: 'Name',
accessor: 'name',
width: '40%',
Cell: ({
row: {
original: { name },
},
}: any) => {
Cell: ({ row: { original: { name } } }: any) => {
return (
<Box
data-loading
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,7 @@ const getColumns = () => [
Header: 'Name',
accessor: 'name',
width: '60%',
Cell: ({
row: {
original: { name, description, id },
},
}: any) => (
Cell: ({ row: { original: { name, description, id } } }: any) => (
<LinkCell
title={name}
to={`/segments/edit/${id}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,7 @@ export const StrategiesList = () => {
accessor: (row: any) => formatStrategyName(row.name),
width: '90%',
Cell: ({
row: {
original: { name, description, deprecated },
},
row: { original: { name, description, deprecated } },
}: any) => {
return (
<LinkCell
Expand Down
6 changes: 1 addition & 5 deletions frontend/src/component/tags/TagTypeList/TagTypeList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,7 @@ export const TagTypeList = () => {
Header: 'Name',
accessor: 'name',
width: '90%',
Cell: ({
row: {
original: { name, description },
},
}: any) => {
Cell: ({ row: { original: { name, description } } }: any) => {
return (
<LinkCell
data-loading
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/types/react-table-config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ import {
declare module 'react-table' {
// take this file as-is, or comment out the sections that don't apply to your plugin configuration

export interface TableOptions<D extends Record<string, unknown>>
extends UseExpandedOptions<D>,
export interface TableOptions<
D extends Record<string, unknown>,
> extends UseExpandedOptions<D>,
UseFiltersOptions<D>,
UseGlobalFiltersOptions<D>,
UseGroupByOptions<D>,
Expand Down
4 changes: 1 addition & 3 deletions src/lib/db/client-applications-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 1 addition & 4 deletions src/lib/proxy/proxy-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/lib/routes/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
19 changes: 8 additions & 11 deletions src/lib/services/state-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions src/lib/util/omit-keys.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
export interface OmitKeys {
<T extends object, K extends [...(keyof T)[]]>(
obj: T,
...keys: K
): {
<T extends object, K extends [...(keyof T)[]]>(obj: T, ...keys: K): {
[K2 in Exclude<keyof T, K[number]>]: T[K2];
};
}
Expand Down
4 changes: 1 addition & 3 deletions src/test/fixtures/fake-favorite-features-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<IFavoriteFeature> {
Expand Down
4 changes: 1 addition & 3 deletions src/test/fixtures/fake-favorite-projects-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<IFavoriteProject> {
Expand Down

0 comments on commit c20913f

Please sign in to comment.