diff --git a/ui/src/app/cron-workflows/components/cron-workflow-details/cron-workflow-details.scss b/ui/src/app/cron-workflows/components/cron-workflow-details/cron-workflow-details.scss new file mode 100644 index 000000000000..611e623ebe22 --- /dev/null +++ b/ui/src/app/cron-workflows/components/cron-workflow-details/cron-workflow-details.scss @@ -0,0 +1,14 @@ +@import 'node_modules/argo-ui/src/styles/config'; + +.workflows-cron-list .workflows-list { + &__status { + max-width: 80px; + display: flex; + align-items: center; + + /* checkboxes are not visible and are unused on this page */ + &--checkbox { + appearance: none; + } + } +} diff --git a/ui/src/app/cron-workflows/components/cron-workflow-details/cron-workflow-details.tsx b/ui/src/app/cron-workflows/components/cron-workflow-details/cron-workflow-details.tsx index 65ef99dbb2e9..521a1771f179 100644 --- a/ui/src/app/cron-workflows/components/cron-workflow-details/cron-workflow-details.tsx +++ b/ui/src/app/cron-workflows/components/cron-workflow-details/cron-workflow-details.tsx @@ -2,19 +2,23 @@ import {NotificationType, Page, SlidingPanel} from 'argo-ui'; import * as React from 'react'; import {useContext, useEffect, useState} from 'react'; import {RouteComponentProps} from 'react-router'; -import {CronWorkflow, Link} from '../../../../models'; +import * as models from '../../../../models'; +import {CronWorkflow, Link, Workflow} from '../../../../models'; import {uiUrl} from '../../../shared/base'; import {ErrorNotice} from '../../../shared/components/error-notice'; import {Loading} from '../../../shared/components/loading'; import {useCollectEvent} from '../../../shared/components/use-collect-event'; +import {ZeroState} from '../../../shared/components/zero-state'; import {Context} from '../../../shared/context'; import {historyUrl} from '../../../shared/history'; import {services} from '../../../shared/services'; import {useQueryParams} from '../../../shared/use-query-params'; import {WidgetGallery} from '../../../widgets/widget-gallery'; +import {WorkflowsRow} from '../../../workflows/components/workflows-row/workflows-row'; import {CronWorkflowEditor} from '../cron-workflow-editor'; require('../../../workflows/components/workflow-details/workflow-details.scss'); +require('./cron-workflow-details.scss'); export const CronWorkflowDetails = ({match, location, history}: RouteComponentProps) => { // boiler-plate @@ -25,6 +29,8 @@ export const CronWorkflowDetails = ({match, location, history}: RouteComponentPr const [name] = useState(match.params.name); const [sidePanel, setSidePanel] = useState(queryParams.get('sidePanel')); const [tab, setTab] = useState(queryParams.get('tab')); + const [workflows, setWorkflows] = useState([]); + const [columns, setColumns] = useState([]); const [cronWorkflow, setCronWorkflow] = useState(); const [edited, setEdited] = useState(false); @@ -62,6 +68,16 @@ export const CronWorkflowDetails = ({match, location, history}: RouteComponentPr useEffect(() => setEdited(true), [cronWorkflow]); + useEffect(() => { + (async () => { + const workflowList = await services.workflows.list(namespace, null, [`${models.labels.cronWorkflow}=${name}`], null); + const workflowsInfo = await services.info.getInfo(); + + setWorkflows(workflowList.items); + setColumns(workflowsInfo.columns); + })(); + }, []); + useCollectEvent('openedCronWorkflowDetails'); const suspendButton = @@ -207,6 +223,42 @@ export const CronWorkflowDetails = ({match, location, history}: RouteComponentPr setSidePanel(null)}> {sidePanel === 'share' && } + <> + + {!workflows ? ( + +

You can create new cron workflows here or using the CLI.

+
+ ) : ( +
+
+
+
+
NAME
+
NAMESPACE
+
STARTED
+
FINISHED
+
DURATION
+
PROGRESS
+
MESSAGE
+
DETAILS
+
ARCHIVED
+ {(columns || []).map(col => { + return ( +
+ {col.name} +
+ ); + })} +
+
+ {/* checkboxes are not visible and are unused on this page */} + {workflows.map(wf => { + return ; + })} +
+ )} + );