-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Format the code and fix failing build
- Loading branch information
Showing
55 changed files
with
1,305 additions
and
1,215 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
42 changes: 21 additions & 21 deletions
42
src/component-library/features/badges/Rule/RuleStateBadge.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
import {RuleState} from "@/lib/core/entity/rucio"; | ||
import React from "react"; | ||
import {Badge} from "@/component-library/atoms/misc/Badge"; | ||
import {cn} from "@/component-library/utils"; | ||
import { RuleState } from '@/lib/core/entity/rucio'; | ||
import React from 'react'; | ||
import { Badge } from '@/component-library/atoms/misc/Badge'; | ||
import { cn } from '@/component-library/utils'; | ||
|
||
const stateString: Record<RuleState, string> = { | ||
[RuleState.REPLICATING]: "Replicating", | ||
[RuleState.OK]: "OK", | ||
[RuleState.STUCK]: "Stuck", | ||
[RuleState.SUSPENDED]: "Suspended", | ||
[RuleState.WAITING_APPROVAL]: "Waiting", | ||
[RuleState.INJECT]: "Inject", | ||
[RuleState.UNKNOWN]: "Unknown" | ||
[RuleState.REPLICATING]: 'Replicating', | ||
[RuleState.OK]: 'OK', | ||
[RuleState.STUCK]: 'Stuck', | ||
[RuleState.SUSPENDED]: 'Suspended', | ||
[RuleState.WAITING_APPROVAL]: 'Waiting', | ||
[RuleState.INJECT]: 'Inject', | ||
[RuleState.UNKNOWN]: 'Unknown', | ||
}; | ||
|
||
const stateColorClasses: Record<RuleState, string> = { | ||
[RuleState.REPLICATING]: "bg-base-warning-400", | ||
[RuleState.OK]: "bg-base-success-500", | ||
[RuleState.STUCK]: "bg-base-error-500", | ||
[RuleState.SUSPENDED]: "bg-neutral-500", | ||
[RuleState.WAITING_APPROVAL]: "bg-extra-indigo-500", | ||
[RuleState.INJECT]: "bg-base-info-500", | ||
[RuleState.UNKNOWN]: "bg-neutral-0 dark:bg-neutral-800" | ||
[RuleState.REPLICATING]: 'bg-base-warning-400', | ||
[RuleState.OK]: 'bg-base-success-500', | ||
[RuleState.STUCK]: 'bg-base-error-500', | ||
[RuleState.SUSPENDED]: 'bg-neutral-500', | ||
[RuleState.WAITING_APPROVAL]: 'bg-extra-indigo-500', | ||
[RuleState.INJECT]: 'bg-base-info-500', | ||
[RuleState.UNKNOWN]: 'bg-neutral-0 dark:bg-neutral-800', | ||
}; | ||
|
||
export const RuleStateBadge = (props: { value: RuleState, className?: string }) => { | ||
export const RuleStateBadge = (props: { value: RuleState; className?: string }) => { | ||
const classes = cn(stateColorClasses[props.value], props.className); | ||
return <Badge value={stateString[props.value]} className={classes}/> | ||
} | ||
return <Badge value={stateString[props.value]} className={classes} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,4 @@ export const formatSeconds = (seconds: number): string => { | |
} else { | ||
return DEFAULT_VALUE; | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 15 additions & 13 deletions
28
src/component-library/pages/Rule/list/ListRule.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,32 @@ | ||
import {StoryFn, Meta} from '@storybook/react'; | ||
import {fixtureRuleViewModel} from '@/test/fixtures/table-fixtures'; | ||
import {ListRule} from "@/component-library/pages/Rule/list/ListRule"; | ||
import {ToastedTemplate} from "@/component-library/templates/ToastedTemplate/ToastedTemplate"; | ||
import {getDecoratorWithWorker} from "@/test/mocks/handlers/story-decorators"; | ||
import {getMockStreamEndpoint} from "@/test/mocks/handlers/streaming-handlers"; | ||
import { StoryFn, Meta } from '@storybook/react'; | ||
import { fixtureRuleViewModel } from '@/test/fixtures/table-fixtures'; | ||
import { ListRule } from '@/component-library/pages/Rule/list/ListRule'; | ||
import { ToastedTemplate } from '@/component-library/templates/ToastedTemplate/ToastedTemplate'; | ||
import { getDecoratorWithWorker } from '@/test/mocks/handlers/story-decorators'; | ||
import { getMockStreamEndpoint } from '@/test/mocks/handlers/streaming-handlers'; | ||
|
||
export default { | ||
title: 'Components/Pages/Rule/List', | ||
component: ListRule, | ||
} as Meta<typeof ListRule>; | ||
|
||
const Template: StoryFn<typeof ListRule> = args => <ToastedTemplate> | ||
<ListRule {...args} /> | ||
</ToastedTemplate>; | ||
const Template: StoryFn<typeof ListRule> = args => ( | ||
<ToastedTemplate> | ||
<ListRule {...args} /> | ||
</ToastedTemplate> | ||
); | ||
|
||
export const InitialDataNoEndpoint = Template.bind({}); | ||
InitialDataNoEndpoint.args = { | ||
initialData: Array.from({length: 50}, () => fixtureRuleViewModel()), | ||
} | ||
initialData: Array.from({ length: 50 }, () => fixtureRuleViewModel()), | ||
}; | ||
|
||
export const RegularStreaming = Template.bind({}); | ||
RegularStreaming.decorators = [ | ||
getDecoratorWithWorker([ | ||
getMockStreamEndpoint('/api/feature/list-rules', { | ||
data: Array.from({length: 500}, fixtureRuleViewModel), | ||
data: Array.from({ length: 500 }, fixtureRuleViewModel), | ||
delay: 1, | ||
}), | ||
]), | ||
]; | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.