-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Display title and description in archived view
Already working in normal workflow view via #9805 - create shared react component for workflow row name to dry up usage of this code in both normal and archive workflow lists - add documentation regarding title and description annotations Signed-off-by: jmeridth <jmeridth@gmail.com>
- Loading branch information
Showing
6 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Title and Description | ||
|
||
If you add specific title and description annotations to your workflow they will show up on the workflow lists. It will also work with markdown. | ||
|
||
```yaml | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
name: my-wf | ||
annotations: | ||
workflows.argoproj.io/title: 'Test Title' | ||
workflows.argoproj.io/description: 'Test Description' | ||
``` | ||
|
||
Note: | ||
|
||
- no title or description, defaults to `workflow.metadata.name` | ||
- no title, description (title defaults to `workflow.metadata.name`) | ||
- title, no description | ||
- title and description | ||
|
||
![Workflow Title And Description](assets/workflow-title-and-description.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
ui/src/app/shared/components/workflows-row-name/workflows-row-name.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@import 'node_modules/argo-ui/src/styles/config'; | ||
|
||
.wf-rows-name { | ||
white-space: pre-line; | ||
line-height: 1.5em; | ||
display: inline-block; | ||
vertical-align: middle; | ||
} |
12 changes: 12 additions & 0 deletions
12
ui/src/app/shared/components/workflows-row-name/workflows-row-name.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import * as kubernetes from 'argo-ui/src/models/kubernetes'; | ||
import * as React from 'react'; | ||
import {ANNOTATION_DESCRIPTION, ANNOTATION_TITLE} from '../../../shared/annotations'; | ||
|
||
require('./workflows-row-name.scss'); | ||
|
||
export const WorkflowsRowName = ({metadata}: {metadata: kubernetes.ObjectMeta}) => { | ||
const title = (metadata.annotations && metadata.annotations[ANNOTATION_TITLE]) || metadata.name; | ||
const description = (metadata.annotations && metadata.annotations[ANNOTATION_DESCRIPTION] && `\n${metadata.annotations[ANNOTATION_DESCRIPTION]}`) || ''; | ||
const content = `${title}${description}`; | ||
return <div className='wf-rows-name'>{content}</div>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters