Skip to content

Rename workflow-summary-tab to workflow-summary #994

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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 @@ -4,7 +4,7 @@ import { render } from '@/test-utils/rtl';

import losslessJsonStringify from '@/utils/lossless-json-stringify';

import WorkflowSummaryTabJsonView from '../workflow-history-event-details-json';
import WorkflowHistoryEventDetailsJson from '../workflow-history-event-details-json';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀


jest.mock('@/components/copy-text-button/copy-text-button', () =>
jest.fn(({ textToCopy }) => <div>Copy Button: {textToCopy}</div>)
Expand All @@ -22,15 +22,15 @@ describe('WorkflowHistoryEventDetailsJson', () => {

it('renders correctly with initial props', () => {
const { getByText } = render(
<WorkflowSummaryTabJsonView entryValue={losslessInputJson} />
<WorkflowHistoryEventDetailsJson entryValue={losslessInputJson} />
);

expect(getByText('PrettyJson Mock')).toBeInTheDocument();
});

it('renders copy text button and pass the correct text', () => {
const { getByText } = render(
<WorkflowSummaryTabJsonView entryValue={losslessInputJson} />
<WorkflowHistoryEventDetailsJson entryValue={losslessInputJson} />
);

const copyButton = getByText(/Copy Button/);
Expand Down
4 changes: 2 additions & 2 deletions src/views/workflow-page/config/workflow-page-tabs.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import WorkflowDiagnostics from '@/views/workflow-diagnostics/workflow-diagnosti
import WorkflowHistoryWrapper from '@/views/workflow-history/workflow-history-wrapper/workflow-history-wrapper';
import WorkflowQueries from '@/views/workflow-queries/workflow-queries';
import WorkflowStackTrace from '@/views/workflow-stack-trace/workflow-stack-trace';
import WorkflowSummaryTab from '@/views/workflow-summary-tab/workflow-summary-tab';
import WorkflowSummary from '@/views/workflow-summary/workflow-summary';

import getWorkflowPageErrorConfig from '../helpers/get-workflow-page-error-config';
import WorkflowPageDiagnosticsBadge from '../workflow-page-diagnostics-badge/workflow-page-diagnostics-badge';
Expand All @@ -24,7 +24,7 @@ const workflowPageTabsConfig: WorkflowPageTabsConfig<
summary: {
title: 'Summary',
artwork: MdListAlt,
content: WorkflowSummaryTab,
content: WorkflowSummary,
getErrorConfig: (err) =>
getWorkflowPageErrorConfig(
err,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,22 @@ import { type GetWorkflowExecutionHistoryResponse } from '@/__generated__/proto-
import { startWorkflowExecutionEvent } from '@/views/workflow-history/__fixtures__/workflow-history-single-events';
import { type WorkflowPageTabContentProps } from '@/views/workflow-page/workflow-page-tab-content/workflow-page-tab-content.types';

import WorkflowSummaryTab from '../workflow-summary-tab';
import WorkflowSummary from '../workflow-summary';

jest.mock('../workflow-summary-tab-details/workflow-summary-tab-details', () =>
jest.fn(() => <div>MockWorkflowSummaryTabDetails</div>)
jest.mock('../workflow-summary-details/workflow-summary-details', () =>
jest.fn(() => <div>MockWorkflowSummaryDetails</div>)
);

jest.mock(
'../workflow-summary-tab-json-view/workflow-summary-tab-json-view',
() => jest.fn(() => <div>MockWorkflowSummaryTabJsonView</div>)
jest.mock('../workflow-summary-json-view/workflow-summary-json-view', () =>
jest.fn(() => <div>MockWorkflowSummaryJsonView</div>)
);

jest.mock(
'../workflow-summary-tab-diagnostics-banner/workflow-summary-tab-diagnostics-banner',
() => jest.fn(() => <div>MockWorkflowSummaryTabDiagnosticsBanner</div>)
'../workflow-summary-diagnostics-banner/workflow-summary-diagnostics-banner',
() => jest.fn(() => <div>MockWorkflowSummaryDiagnosticsBanner</div>)
);

describe('WorkflowSummaryTab', () => {
describe('WorkflowSummary', () => {
beforeEach(() => {
jest.clearAllMocks();
});
Expand All @@ -39,7 +38,7 @@ describe('WorkflowSummaryTab', () => {
it('should render tab deatils, JSON view, and diagnostics banner', async () => {
render(
<Suspense>
<WorkflowSummaryTab params={params} />
<WorkflowSummary params={params} />
</Suspense>,
{
endpointsMocks: [
Expand Down Expand Up @@ -70,13 +69,13 @@ describe('WorkflowSummaryTab', () => {
}
);
expect(
await screen.findByText('MockWorkflowSummaryTabDetails')
await screen.findByText('MockWorkflowSummaryDetails')
).toBeInTheDocument();
expect(
await screen.findByText('MockWorkflowSummaryTabJsonView')
await screen.findByText('MockWorkflowSummaryJsonView')
).toBeInTheDocument();
expect(
await screen.findByText('MockWorkflowSummaryTabDiagnosticsBanner')
await screen.findByText('MockWorkflowSummaryDiagnosticsBanner')
).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import WorkflowStatusTag from '@/views/shared/workflow-status-tag/workflow-statu
import getWorkflowStatusTagProps from '@/views/workflow-page/helpers/get-workflow-status-tag-props';

import WorkflowEventDetailsExecutionLink from '../../shared/workflow-event-details-execution-link/workflow-event-details-execution-link';
import { type WorkflowSummaryTabDetailsConfig } from '../workflow-summary-tab-details/workflow-summary-tab-details.types';
import { type WorkflowSummaryDetailsConfig } from '../workflow-summary-details/workflow-summary-details.types';

const workflowSummaryTabDetailsConfig: WorkflowSummaryTabDetailsConfig[] = [
const workflowSummaryDetailsConfig: WorkflowSummaryDetailsConfig[] = [
{
key: 'status',
getLabel: () => 'Status',
Expand Down Expand Up @@ -146,4 +146,4 @@ const workflowSummaryTabDetailsConfig: WorkflowSummaryTabDetailsConfig[] = [
},
];

export default workflowSummaryTabDetailsConfig;
export default workflowSummaryDetailsConfig;
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import {
startWorkflowExecutionEvent,
} from '@/views/workflow-history/__fixtures__/workflow-history-single-events';

import WorkflowSummaryTabDetails from '../workflow-summary-tab-details';
import WorkflowSummaryDetails from '../workflow-summary-details';
import {
type WorkflowSummaryTabDetailsConfig,
type WorkflowSummaryDetailsConfig,
type Props,
} from '../workflow-summary-tab-details.types';
} from '../workflow-summary-details.types';

jest.mock(
'../../config/workflow-summary-tab-details.config',
'../../config/workflow-summary-details.config',
() =>
[
{
Expand All @@ -37,7 +37,7 @@ jest.mock(
getLabel: () => 'Hidden Label 3',
valueComponent: () => <span>Hidden Value 3</span>,
},
] satisfies WorkflowSummaryTabDetailsConfig[]
] satisfies WorkflowSummaryDetailsConfig[]
);

const params: Props['decodedPageUrlParams'] = {
Expand All @@ -56,7 +56,7 @@ const mockWorkflowDetails: DescribeWorkflowResponse = {
workflowExecutionInfo: null,
};

describe('WorkflowSummaryTabDetails', () => {
describe('WorkflowSummaryDetails', () => {
// TODO @assem.hafez enhance typing for formattedFirstHistoryEvent
//@ts-expect-error - TS is complaining about the type of formattedFirstHistoryEvent
const formattedFirstHistoryEvent: FormattedHistoryEventForType<'WorkflowExecutionStarted'> =
Expand All @@ -66,7 +66,7 @@ describe('WorkflowSummaryTabDetails', () => {
);
it('should render workflow type name from firstHistoryEvent', () => {
render(
<WorkflowSummaryTabDetails
<WorkflowSummaryDetails
firstHistoryEvent={startWorkflowExecutionEvent}
closeHistoryEvent={completeWorkflowExecutionEvent}
formattedFirstHistoryEvent={formattedFirstHistoryEvent}
Expand All @@ -82,7 +82,7 @@ describe('WorkflowSummaryTabDetails', () => {

it('should render all detail rows that are not hidden', () => {
render(
<WorkflowSummaryTabDetails
<WorkflowSummaryDetails
firstHistoryEvent={startWorkflowExecutionEvent}
closeHistoryEvent={completeWorkflowExecutionEvent}
formattedFirstHistoryEvent={formattedFirstHistoryEvent}
Expand All @@ -100,7 +100,7 @@ describe('WorkflowSummaryTabDetails', () => {

it('should not render detail rows that are hidden', () => {
render(
<WorkflowSummaryTabDetails
<WorkflowSummaryDetails
firstHistoryEvent={startWorkflowExecutionEvent}
closeHistoryEvent={completeWorkflowExecutionEvent}
formattedFirstHistoryEvent={formattedFirstHistoryEvent}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { LabelMedium } from 'baseui/typography';

import useStyletronClasses from '@/hooks/use-styletron-classes';

import workflowSummaryTabDetailsConfig from '../config/workflow-summary-tab-details.config';
import workflowSummaryDetailsConfig from '../config/workflow-summary-details.config';

import { cssStyles } from './workflow-summary-tab-details.styles';
import { type Props } from './workflow-summary-tab-details.types';
import { cssStyles } from './workflow-summary-details.styles';
import { type Props } from './workflow-summary-details.types';

export default function WorkflowSummaryTabDetails({
export default function WorkflowSummaryDetails({
firstHistoryEvent,
closeHistoryEvent,
formattedFirstHistoryEvent,
Expand All @@ -32,7 +32,7 @@ export default function WorkflowSummaryTabDetails({
</LabelMedium>
</div>
<div>
{workflowSummaryTabDetailsConfig
{workflowSummaryDetailsConfig
.filter(
(c) =>
!c.hide ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ export type Props = {
decodedPageUrlParams: WorkflowPageTabContentProps['params'];
};

export type WorkflowSummaryTabDetailsComponent =
export type WorkflowSummaryDetailsComponent =
| keyof JSX.IntrinsicElements
| React.JSXElementConstructor<any>;

export type WorkflowSummaryTabDetailsConfig = {
export type WorkflowSummaryDetailsConfig = {
key: string;
getLabel: () => string;
valueComponent: React.ComponentType<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { render, screen } from '@/test-utils/rtl';

import * as useWorkflowDiagnosticsIssuesCountModule from '@/views/shared/hooks/use-workflow-diagnostics-issues-count';

import WorkflowSummaryTabDiagnosticsBanner from '../workflow-summary-tab-diagnostics-banner';
import WorkflowSummaryDiagnosticsBanner from '../workflow-summary-diagnostics-banner';

jest.mock('@/views/shared/hooks/use-workflow-diagnostics-issues-count', () =>
jest.fn(() => undefined)
);

describe(WorkflowSummaryTabDiagnosticsBanner.name, () => {
describe(WorkflowSummaryDiagnosticsBanner.name, () => {
afterEach(() => {
jest.restoreAllMocks();
});
Expand Down Expand Up @@ -62,7 +62,7 @@ function setup({ mockIssuesCount }: { mockIssuesCount?: number }) {
.mockReturnValue(mockIssuesCount);

const result = render(
<WorkflowSummaryTabDiagnosticsBanner
<WorkflowSummaryDiagnosticsBanner
domain="mock-domain"
cluster="cluster_1"
workflowId="mock-workflow-id"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { RiStethoscopeLine } from 'react-icons/ri';

import useWorkflowDiagnosticsIssuesCount from '@/views/shared/hooks/use-workflow-diagnostics-issues-count';

import { styled } from './workflow-summary-tab-diagnostics-banner.styles';
import { type Props } from './workflow-summary-tab-diagnostics-banner.types';
import { styled } from './workflow-summary-diagnostics-banner.styles';
import { type Props } from './workflow-summary-diagnostics-banner.types';

export default function WorkflowSummaryTabDiagnosticsBanner({
export default function WorkflowSummaryDiagnosticsBanner({
domain,
cluster,
workflowId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';

import { render, fireEvent, screen, queryByRole } from '@/test-utils/rtl';
import { render, fireEvent, screen } from '@/test-utils/rtl';

import losslessJsonStringify from '@/utils/lossless-json-stringify';

import WorkflowSummaryTabJsonView from '../workflow-summary-tab-json-view';
import { type Props } from '../workflow-summary-tab-json-view.types';
import WorkflowSummaryJsonView from '../workflow-summary-json-view';
import { type Props } from '../workflow-summary-json-view.types';

jest.mock('@/components/copy-text-button/copy-text-button', () =>
jest.fn(({ textToCopy }) => <div>Copy Button: {textToCopy}</div>)
Expand All @@ -27,7 +27,7 @@ jest.mock('@/components/pretty-json-skeleton/pretty-json-skeleton', () =>
jest.fn(() => <div>Mock JSON skeleton</div>)
);

describe('WorkflowSummaryTabJsonView Component', () => {
describe('WorkflowSummaryJsonView Component', () => {
it('renders correctly with initial props', () => {
const { getByText } = setup({});

Expand Down Expand Up @@ -115,7 +115,7 @@ const setup = ({
isArchived = false,
}: Partial<Props>) => {
return render(
<WorkflowSummaryTabJsonView
<WorkflowSummaryJsonView
inputJson={inputJson}
resultJson={resultJson}
isWorkflowRunning={isWorkflowRunning}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import SegmentedControlRounded from '@/components/segmented-control-rounded/segm
import useStyletronClasses from '@/hooks/use-styletron-classes';
import losslessJsonStringify from '@/utils/lossless-json-stringify';

import { jsonViewTabsOptions } from './workflow-summary-tab-json-view.constants';
import { cssStyles, overrides } from './workflow-summary-tab-json-view.styles';
import type { Props } from './workflow-summary-tab-json-view.types';
import { jsonViewTabsOptions } from './workflow-summary-json-view.constants';
import { cssStyles, overrides } from './workflow-summary-json-view.styles';
import type { Props } from './workflow-summary-json-view.types';

export default function WorkflowSummaryTabJsonView({
export default function WorkflowSummaryJsonView({
inputJson,
resultJson,
isWorkflowRunning,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import getWorkflowIsCompleted from '../workflow-page/helpers/get-workflow-is-com
import { useDescribeWorkflow } from '../workflow-page/hooks/use-describe-workflow';

import getWorkflowResultJson from './helpers/get-workflow-result-json';
import WorkflowSummaryTabDetails from './workflow-summary-tab-details/workflow-summary-tab-details';
import WorkflowSummaryTabDiagnosticsBanner from './workflow-summary-tab-diagnostics-banner/workflow-summary-tab-diagnostics-banner';
import WorkflowSummaryTabJsonView from './workflow-summary-tab-json-view/workflow-summary-tab-json-view';
import { cssStyles } from './workflow-summary-tab.styles';
import WorkflowSummaryDetails from './workflow-summary-details/workflow-summary-details';
import WorkflowSummaryDiagnosticsBanner from './workflow-summary-diagnostics-banner/workflow-summary-diagnostics-banner';
import WorkflowSummaryJsonView from './workflow-summary-json-view/workflow-summary-json-view';
import { cssStyles } from './workflow-summary.styles';

export default function WorkflowSummaryTab({
export default function WorkflowSummary({
params,
}: WorkflowPageTabContentProps) {
const { cls } = useStyletronClasses(cssStyles);
Expand Down Expand Up @@ -88,8 +88,8 @@ export default function WorkflowSummaryTab({
<PageSection>
<div className={cls.pageContainer}>
<div className={cls.mainContent}>
<WorkflowSummaryTabDiagnosticsBanner {...params} />
<WorkflowSummaryTabDetails
<WorkflowSummaryDiagnosticsBanner {...params} />
<WorkflowSummaryDetails
firstHistoryEvent={firstEvent}
closeHistoryEvent={closeEvent}
formattedFirstHistoryEvent={formattedStartEvent}
Expand All @@ -100,7 +100,7 @@ export default function WorkflowSummaryTab({
{/* <div>Taskslist</div> */}
</div>
<div className={cls.jsonArea}>
<WorkflowSummaryTabJsonView
<WorkflowSummaryJsonView
inputJson={
formattedStartEvent && 'input' in formattedStartEvent
? (formattedStartEvent?.input as PrettyJsonValue)
Expand Down