forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow markdown title and description in CronWorkflows, Workflow…
…Templates, & ClusterWorkflowTemplates. Fixes argoproj#12644 (argoproj#12697) Signed-off-by: panicboat <panicboat@gmail.com> Co-authored-by: Anton Gilgur <4970083+agilgur5@users.noreply.github.com>
- Loading branch information
Showing
23 changed files
with
379 additions
and
122 deletions.
There are no files selected for viewing
Binary file added
BIN
+14.5 KB
docs/assets/title-and-description-markdown-cluster-workflow-template.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
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
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
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/cluster-workflow-templates/cluster-workflow-template-markdown.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 { | ||
line-height: 1.5em; | ||
display: inline-block; | ||
vertical-align: middle; | ||
white-space: pre-line; | ||
} |
22 changes: 22 additions & 0 deletions
22
ui/src/cluster-workflow-templates/cluster-workflow-template-markdown.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,22 @@ | ||
import * as React from 'react'; | ||
|
||
import {ANNOTATION_DESCRIPTION, ANNOTATION_TITLE} from '../shared/annotations'; | ||
import {SuspenseReactMarkdownGfm} from '../shared/components/suspense-react-markdown-gfm'; | ||
import {ClusterWorkflowTemplate} from '../shared/models'; | ||
|
||
require('./cluster-workflow-template-markdown.scss'); | ||
|
||
interface ClusterWorkflowTemplateMarkdownProps { | ||
workflow: ClusterWorkflowTemplate; | ||
} | ||
|
||
export function ClusterWorkflowTemplateMarkdown(props: ClusterWorkflowTemplateMarkdownProps) { | ||
const wf = props.workflow; | ||
// title + description vars | ||
const title = wf.metadata.annotations?.[ANNOTATION_TITLE] ?? wf.metadata.name; | ||
const description = (wf.metadata.annotations?.[ANNOTATION_DESCRIPTION] && `\n${wf.metadata.annotations[ANNOTATION_DESCRIPTION]}`) || ''; | ||
const hasAnnotation = title !== wf.metadata.name || description !== ''; | ||
const markdown = `${title}${description}`; | ||
|
||
return <div className='wf-rows-name'>{hasAnnotation ? <SuspenseReactMarkdownGfm markdown={markdown} /> : markdown}</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
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
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 { | ||
line-height: 1.5em; | ||
display: inline-block; | ||
vertical-align: middle; | ||
white-space: pre-line; | ||
} |
Oops, something went wrong.