From d28d2ee187b2f960a8b6ab5cd0d0927342f1ad66 Mon Sep 17 00:00:00 2001 From: jmeridth Date: Tue, 4 Oct 2022 13:21:07 -0500 Subject: [PATCH] feat: Workflow title/description in workflow list view. Fixes #6529 Fixes #6529 - [x] title and description in list view Signed-off-by: jmeridth --- ui/src/app/shared/annotations.ts | 2 ++ ui/src/app/shared/services/workflows-service.ts | 2 ++ .../workflows/components/workflows-row/workflows-row.tsx | 6 +++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/src/app/shared/annotations.ts b/ui/src/app/shared/annotations.ts index 95e7e033000c..777aa2dbe6b8 100644 --- a/ui/src/app/shared/annotations.ts +++ b/ui/src/app/shared/annotations.ts @@ -1 +1,3 @@ export const ANNOTATION_KEY_POD_NAME_VERSION = 'workflows.argoproj.io/pod-name-format'; +export const ANNOTATION_TITLE = 'workflows.argoproj.io/title'; +export const ANNOTATION_DESCRIPTION = 'workflows.argoproj.io/description'; diff --git a/ui/src/app/shared/services/workflows-service.ts b/ui/src/app/shared/services/workflows-service.ts index 3fe85808abd7..a599fcc3e70b 100644 --- a/ui/src/app/shared/services/workflows-service.ts +++ b/ui/src/app/shared/services/workflows-service.ts @@ -33,6 +33,7 @@ export class WorkflowsService { 'items.metadata.namespace', 'items.metadata.creationTimestamp', 'items.metadata.labels', + 'items.metadata.annotations', 'items.status.phase', 'items.status.message', 'items.status.finishedAt', @@ -90,6 +91,7 @@ export class WorkflowsService { 'result.object.status.progress', 'result.type', 'result.object.metadata.labels', + 'result.object.metadata.annotations', 'result.object.spec.suspend' ]; params.push(`fields=${fields.join(',')}`); diff --git a/ui/src/app/workflows/components/workflows-row/workflows-row.tsx b/ui/src/app/workflows/components/workflows-row/workflows-row.tsx index 950fd740f03f..32515a099d7d 100644 --- a/ui/src/app/workflows/components/workflows-row/workflows-row.tsx +++ b/ui/src/app/workflows/components/workflows-row/workflows-row.tsx @@ -2,6 +2,7 @@ import {Ticker} from 'argo-ui/src/index'; import * as React from 'react'; import {Link} from 'react-router-dom'; import {Workflow} from '../../../../models'; +import {ANNOTATION_DESCRIPTION, ANNOTATION_TITLE} from '../../../shared/annotations'; import {uiUrl} from '../../../shared/base'; import {DurationPanel} from '../../../shared/components/duration-panel'; import {PhaseIcon} from '../../../shared/components/phase-icon'; @@ -48,7 +49,10 @@ export class WorkflowsRow extends React.Component -
{wf.metadata.name}
+
+ {(wf.metadata.annotations && wf.metadata.annotations[ANNOTATION_TITLE]) || wf.metadata.name} + {wf.metadata.annotations && wf.metadata.annotations[ANNOTATION_DESCRIPTION] ?

{wf.metadata.annotations[ANNOTATION_DESCRIPTION]}

: null} +
{wf.metadata.namespace}