Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend: fix drawer #2730

Merged
merged 4 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default {
displayName: "EC2",
group: "AWS",
path: "ec2",
icon: { path: "" },
routes: [
{
component: () => null,
Expand Down
6 changes: 3 additions & 3 deletions frontend/packages/core/src/Table/stories/table.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export default {
const Template = ({ row, ...props }: TableProps & { row: React.ReactElement }) => (
<div style={{ maxHeight: "300px", display: "flex" }}>
<Table {...props} columns={["Column 1", "Column 2", "Column 3", "Column 4", "Column 5"]}>
{
{Array(10)
.fill(null)
// eslint-disable-next-line react/no-array-index-key
[...Array(10)].map((_, index: number) => React.cloneElement(row, { key: index }))
}
.map((_, index: number) => React.cloneElement(row, { key: index }))}
</Table>
</div>
);
Expand Down
26 changes: 15 additions & 11 deletions frontend/packages/core/src/stories/stepper.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ const PrimaryTemplate = ({ stepCount, activeStep }: StepperProps & { stepCount:
return (
<>
<Stepper activeStep={curStep}>
{[...Array(stepCount)].map((_, index: number) => (
// eslint-disable-next-line react/no-array-index-key
<Step key={index} label={`Step ${index + 1}`} />
))}
{Array(stepCount)
.fill(null)
.map((_, index: number) => (
// eslint-disable-next-line react/no-array-index-key
<Step key={index} label={`Step ${index + 1}`} />
))}
</Stepper>
<div>
<Text>Step{curStep + 1} content</Text>
Expand Down Expand Up @@ -73,13 +75,15 @@ const FailureTemplate = ({ failedStep = 2, activeStep }: StepperProps & { failed
return (
<>
<Stepper activeStep={curStep}>
{[...Array(stepCount)].map((_, index: number) => (
<Step
error={curStep === failedStep && index === failedStep}
key={index} // eslint-disable-line react/no-array-index-key
label={`Step ${index + 1}`}
/>
))}
{Array(stepCount)
.fill(null)
.map((_, index: number) => (
<Step
error={curStep === failedStep && index === failedStep}
key={index} // eslint-disable-line react/no-array-index-key
label={`Step ${index + 1}`}
/>
))}
</Stepper>
<div>
<Text>Step{curStep + 1} content</Text>
Expand Down
14 changes: 8 additions & 6 deletions frontend/packages/core/src/stories/tabs.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ export default {

const Template = ({ tabCount, value, variant }: TabsProps & { tabCount: number }) => (
<Tabs value={value - 1} variant={variant}>
{[...Array(tabCount)].map((_, index: number) => (
// eslint-disable-next-line react/no-array-index-key
<Tab key={index} label={`Tab ${index + 1}`} value={index}>
<div>Tab{index + 1} Content</div>
</Tab>
))}
{Array(tabCount)
.fill(null)
.map((_, index: number) => (
// eslint-disable-next-line react/no-array-index-key
<Tab key={index} label={`Tab ${index + 1}`} value={index}>
<div>Tab{index + 1} Content</div>
</Tab>
))}
</Tabs>
);

Expand Down