Skip to content

Commit

Permalink
fix: link templates not replacing multiple templates with same name (a…
Browse files Browse the repository at this point in the history
…rgoproj#4516)

Signed-off-by: Ludovic Cleroux <[email protected]>
  • Loading branch information
ludydoo committed Nov 13, 2020
1 parent 411bde3 commit d0082e8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions USERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Currently, the following organizations are **officially** using Argo Workflows:
1. [Mixpanel](https://mixpanel.com)
1. [New Relic](https://newrelic.com/)
1. [Nikkei](https://www.nikkei.co.jp/nikkeiinfo/en/)
1. [Norwegian Refugee Council](https://www.nrc.no/)
1. [nrd.io](https://nrd.io/)
1. [NVIDIA](https://www.nvidia.com/)
1. [Onepanel](https://docs.onepanel.ai)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ export class ArchivedWorkflowDetails extends BasePage<RouteComponentProps<any>,

private openLink(link: Link) {
document.location.href = link.url
.replace('${metadata.namespace}', this.state.workflow.metadata.namespace)
.replace('${metadata.name}', this.state.workflow.metadata.name)
.replace('${status.startedAt}', this.state.workflow.status.startedAt)
.replace('${status.finishedAt}', this.state.workflow.status.finishedAt);
.replace(/\${metadata\.namespace}/g, this.state.workflow.metadata.namespace)
.replace(/\${metadata\.name}/g, this.state.workflow.metadata.name)
.replace(/\${status\.startedAt}/g, this.state.workflow.status.startedAt)
.replace(/\${status\.finishedAt}/g, this.state.workflow.status.finishedAt);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,10 @@ export class WorkflowDetails extends React.Component<RouteComponentProps<any>, W

private openLink(link: Link) {
const url = link.url
.replace('${metadata.namespace}', this.state.workflow.metadata.namespace)
.replace('${metadata.name}', this.state.workflow.metadata.name)
.replace('${status.startedAt}', this.state.workflow.status.startedAt)
.replace('${status.finishedAt}', this.state.workflow.status.finishedAt);
.replace(/\${metadata\.namespace}/g, this.state.workflow.metadata.namespace)
.replace(/\${metadata\.name}/g, this.state.workflow.metadata.name)
.replace(/\${status\.startedAt}/g, this.state.workflow.status.startedAt)
.replace(/\${status\.finishedAt}/g, this.state.workflow.status.finishedAt);
if ((window.event as MouseEvent).ctrlKey) {
window.open(url, '_blank');
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ export const WorkflowNodeSummary = (props: Props) => {
<a
className='argo-button argo-button--base-o'
href={link.url
.replace('${metadata.namespace}', props.workflow.metadata.namespace)
.replace('${metadata.name}', props.node.id)
.replace('${status.startedAt}', props.node.startedAt)
.replace('${status.finishedAt}', props.node.finishedAt)}>
.replace(/\${metadata\.namespace}/g, props.workflow.metadata.namespace)
.replace(/\${metadata\.name}/g, props.node.id)
.replace(/\${status\.startedAt}/g, props.node.startedAt)
.replace(/\${status\.finishedAt}/g, props.node.finishedAt)}>
<i className='fa fa-link' /> {link.name}
</a>
))}
Expand Down

0 comments on commit d0082e8

Please sign in to comment.