From 33c51ed17250d2a7b66bfd02badbd012ee33dfb3 Mon Sep 17 00:00:00 2001 From: panicboat Date: Sun, 18 Feb 2024 13:41:36 +0900 Subject: [PATCH] feat: CronWorkflow/WorkflowTemplate title/description in list view (#12674) Signed-off-by: panicboat Co-authored-by: Anton Gilgur <4970083+agilgur5@users.noreply.github.com> --- .../components/cron-workflow-list/cron-workflow-list.tsx | 6 +++++- .../workflow-template-list/workflow-template-list.tsx | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ui/src/app/cron-workflows/components/cron-workflow-list/cron-workflow-list.tsx b/ui/src/app/cron-workflows/components/cron-workflow-list/cron-workflow-list.tsx index 5ecd5b3ee17f..054ef285a242 100644 --- a/ui/src/app/cron-workflows/components/cron-workflow-list/cron-workflow-list.tsx +++ b/ui/src/app/cron-workflows/components/cron-workflow-list/cron-workflow-list.tsx @@ -3,6 +3,7 @@ import * as React from 'react'; import {useContext, useEffect, useState} from 'react'; import {Link, RouteComponentProps} from 'react-router-dom'; import {CronWorkflow} from '../../../../models'; +import {ANNOTATION_DESCRIPTION, ANNOTATION_TITLE} from '../../../shared/annotations'; import {uiUrl} from '../../../shared/base'; import {ErrorNotice} from '../../../shared/components/error-notice'; import {ExampleManifests} from '../../../shared/components/example-manifests'; @@ -145,7 +146,10 @@ export function CronWorkflowList({match, location, history}: RouteComponentProps key={`${w.metadata.namespace}/${w.metadata.name}`} to={uiUrl(`cron-workflows/${w.metadata.namespace}/${w.metadata.name}`)}>
{w.spec.suspend ? : }
-
{w.metadata.name}
+
+ {w.metadata.annotations?.[ANNOTATION_TITLE] ?? w.metadata.name} + {w.metadata.annotations?.[ANNOTATION_DESCRIPTION] ?

{w.metadata.annotations[ANNOTATION_DESCRIPTION]}

: null} +
{w.metadata.namespace}
{w.spec.timezone}
{w.spec.schedule}
diff --git a/ui/src/app/workflow-templates/components/workflow-template-list/workflow-template-list.tsx b/ui/src/app/workflow-templates/components/workflow-template-list/workflow-template-list.tsx index 47eb3822d928..2aa8f7a3f675 100644 --- a/ui/src/app/workflow-templates/components/workflow-template-list/workflow-template-list.tsx +++ b/ui/src/app/workflow-templates/components/workflow-template-list/workflow-template-list.tsx @@ -4,6 +4,7 @@ import {useContext, useEffect, useState} from 'react'; import {Link, RouteComponentProps} from 'react-router-dom'; import {WorkflowTemplate} from '../../../../models'; +import {ANNOTATION_DESCRIPTION, ANNOTATION_TITLE} from '../../../shared/annotations'; import {uiUrl} from '../../../shared/base'; import {ErrorNotice} from '../../../shared/components/error-notice'; import {ExampleManifests} from '../../../shared/components/example-manifests'; @@ -146,7 +147,10 @@ export function WorkflowTemplateList({match, location, history}: RouteComponentP
-
{t.metadata.name}
+
+ {t.metadata.annotations?.[ANNOTATION_TITLE] ?? t.metadata.name} + {t.metadata.annotations?.[ANNOTATION_DESCRIPTION] ?

{t.metadata.annotations[ANNOTATION_DESCRIPTION]}

: null} +
{t.metadata.namespace}