Skip to content

Commit

Permalink
Add history tab to workflow page (#643)
Browse files Browse the repository at this point in the history
* add history tab to workflow page

* fix linting issues
  • Loading branch information
Assem-Hafez authored Sep 4, 2024
1 parent 6f9c89e commit 4d2458f
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 2 deletions.
28 changes: 28 additions & 0 deletions src/views/workflow-history/workflow-history.styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import type {
StyletronCSSObject,
StyletronCSSObjectOf,
} from '@/hooks/use-styletron-classes';

const cssStylesObj = {
pageContainer: {
display: 'flex',
flexDirection: 'column',
},
eventsContainer: (theme) => ({
display: 'flex',
marginTop: theme.sizing.scale500,
}),
compactSection: {
display: 'flex',
flexDirection: 'column',
width: '370px',
},
timelineSection: {
display: 'flex',
flexDirection: 'column',
flex: 1,
},
} satisfies StyletronCSSObject;

export const cssStyles: StyletronCSSObjectOf<typeof cssStylesObj> =
cssStylesObj;
26 changes: 26 additions & 0 deletions src/views/workflow-history/workflow-history.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use client';
import React from 'react';

import { HeadingXSmall } from 'baseui/typography';

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

import { cssStyles } from './workflow-history.styles';

export default function WorkflowHistory() {
const { cls } = useStyletronClasses(cssStyles);

return (
<div className={cls.pageContainer}>
<HeadingXSmall>Workflow history</HeadingXSmall>
<div className={cls.eventsContainer}>
<section className={cls.compactSection}>
<p>compact</p>
</section>
<section className={cls.timelineSection}>
<p>timeline</p>
</section>
</div>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import WorkflowHistory from '@/views/workflow-history/workflow-history';
import WorkflowSummaryTab from '@/views/workflow-summary-tab/workflow-summary-tab';

import type { WorkflowPageTabsContentsMap } from '../workflow-page-tab-content/workflow-page-tab-content.types';

const workflowPageTabsContentsMapConfig = {
summary: WorkflowSummaryTab,
history: WorkflowHistory,
} as const satisfies WorkflowPageTabsContentsMap;

export default workflowPageTabsContentsMapConfig;
7 changes: 6 additions & 1 deletion src/views/workflow-page/config/workflow-page-tabs.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MdListAlt } from 'react-icons/md';
import { MdListAlt, MdOutlineHistory } from 'react-icons/md';

import type { WorkflowPageTabs } from '../workflow-page-tabs/workflow-page-tabs.types';

Expand All @@ -8,6 +8,11 @@ const workflowPageTabsConfig = [
title: 'Summary',
artwork: MdListAlt,
},
{
key: 'history',
title: 'History',
artwork: MdOutlineHistory,
},
] as const satisfies WorkflowPageTabs;

export default workflowPageTabsConfig;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, createElement } from 'react';
import { createElement } from 'react';

import WorkflowStatusTag from '@/views/shared/workflow-status-tag/workflow-status-tag';
import getWorkflowIsCompleted from '@/views/workflow-page/helpers/get-workflow-is-completed';
Expand Down

0 comments on commit 4d2458f

Please sign in to comment.