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

Use PanelSection component to wrap error panels in tabs #777

Merged
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
@@ -1,6 +1,7 @@
import { useParams } from 'next/navigation';

import ErrorPanel from '@/components/error-panel/error-panel';
import PanelSection from '@/components/panel-section/panel-section';

import domainPageTabsErrorConfig from '../config/domain-page-tabs-error.config';
import { type DomainTabName } from '../domain-page-content/domain-page-content.types';
Expand All @@ -13,22 +14,26 @@ export default function DomainPageTabsError({ error, reset }: Props) {

if (typeof getConfig !== 'function') {
return (
<ErrorPanel
error={error}
message={'Failed to load domain content'}
reset={reset}
/>
<PanelSection>
<ErrorPanel
error={error}
message={'Failed to load domain content'}
reset={reset}
/>
</PanelSection>
);
}

const errorConfig = getConfig(error);
return (
<ErrorPanel
error={error}
message={errorConfig.message}
actions={errorConfig.actions}
omitLogging={errorConfig.omitLogging}
reset={reset}
/>
<PanelSection>
<ErrorPanel
error={error}
message={errorConfig.message}
actions={errorConfig.actions}
omitLogging={errorConfig.omitLogging}
reset={reset}
/>
</PanelSection>
);
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import React from 'react';

import ErrorPanel from '@/components/error-panel/error-panel';
import PanelSection from '@/components/panel-section/panel-section';
import SectionLoadingIndicator from '@/components/section-loading-indicator/section-loading-indicator';
import usePageQueryParams from '@/hooks/use-page-query-params/use-page-query-params';
import domainPageQueryParamsConfig from '@/views/domain-page/config/domain-page-query-params.config';
import WorkflowsTable from '@/views/shared/workflows-table/workflows-table';

import useListWorkflowsBasic from '../hooks/use-list-workflows-basic';

import { styled } from './domain-workflows-basic-table.styles';
import { type Props } from './domain-workflows-basic-table.types';
import getWorkflowsBasicErrorPanelProps from './helpers/get-workflows-basic-error-panel-props';

Expand Down Expand Up @@ -46,9 +46,9 @@ export default function DomainWorkflowsBasicTable({ domain, cluster }: Props) {

if (errorPanelProps) {
return (
<styled.ErrorPanelContainer>
<PanelSection>
<ErrorPanel {...errorPanelProps} reset={refetch} />
</styled.ErrorPanelContainer>
</PanelSection>
);
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import React from 'react';

import ErrorPanel from '@/components/error-panel/error-panel';
import PanelSection from '@/components/panel-section/panel-section';
import SectionLoadingIndicator from '@/components/section-loading-indicator/section-loading-indicator';
import usePageQueryParams from '@/hooks/use-page-query-params/use-page-query-params';
import domainPageQueryParamsConfig from '@/views/domain-page/config/domain-page-query-params.config';
Expand All @@ -12,7 +13,6 @@ import DOMAIN_WORKFLOWS_PAGE_SIZE from '../config/domain-workflows-page-size.con
import { type Props } from '../domain-workflows-table/domain-workflows-table.types';
import getNextSortOrder from '../helpers/get-next-sort-order';

import { styled } from './domain-workflows-table.styles';
import getWorkflowsErrorPanelProps from './helpers/get-workflows-error-panel-props';

export default function DomainWorkflowsTable({ domain, cluster }: Props) {
Expand Down Expand Up @@ -60,9 +60,9 @@ export default function DomainWorkflowsTable({ domain, cluster }: Props) {

if (errorPanelProps) {
return (
<styled.ErrorPanelContainer>
<PanelSection>
<ErrorPanel {...errorPanelProps} reset={refetch} />
</styled.ErrorPanelContainer>
</PanelSection>
);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useParams } from 'next/navigation';

import ErrorPanel from '@/components/error-panel/error-panel';
import PanelSection from '@/components/panel-section/panel-section';

import workflowPageTabsErrorConfig from '../config/workflow-page-tabs-error.config';
import { type WorkflowPageTabName } from '../workflow-page-tab-content/workflow-page-tab-content.types';
Expand All @@ -14,24 +15,26 @@ export default function WorkflowPageTabsError({ error, reset }: Props) {

if (typeof getConfig !== 'function') {
return (
<div>
<PanelSection>
<ErrorPanel
error={error}
message={'Failed to load workflow content'}
reset={reset}
/>
</div>
</PanelSection>
);
}

const errorConfig = getConfig(error);
return (
<ErrorPanel
error={error}
message={errorConfig.message}
actions={errorConfig.actions}
omitLogging={errorConfig.omitLogging}
reset={reset}
/>
<PanelSection>
<ErrorPanel
error={error}
message={errorConfig.message}
actions={errorConfig.actions}
omitLogging={errorConfig.omitLogging}
reset={reset}
/>
</PanelSection>
);
}
Loading