Skip to content

Commit

Permalink
Hide revert option for latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
Gürkan Güran authored and Gürkan Güran committed Sep 6, 2022
1 parent c275b69 commit f874185
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ export class WorkflowDefinitionVersionHistory {
</thead>
<tbody>
{this.workflowVersions.map(v => {
let menuItems = [];
menuItems.push({text: 'Delete', clickHandler: e => this.onDeleteVersionClick(e, v), icon: <DeleteIcon/>});

if(!v.isLatest)
menuItems.push({text: 'Revert', clickHandler: e => this.onRevertVersionClick(e, v), icon: <RevertIcon/>});

return (
<tr>
<td>{v.isPublished ? <PublishedIcon/> : ""}</td>
Expand All @@ -78,14 +84,7 @@ export class WorkflowDefinitionVersionHistory {
</button>
</td>
<td>
{v.isPublished || v.isPublished ? undefined :
<elsa-context-menu
menuItems={[
{text: 'Delete', clickHandler: e => this.onDeleteVersionClick(e, v), icon: <DeleteIcon/>},
{text: 'Revert', clickHandler: e => this.onRevertVersionClick(e, v), icon: <RevertIcon/>},
]}
/>
}
{v.isPublished || v.isPublished ? undefined : <elsa-context-menu menuItems={menuItems}/>}
</td>
</tr>
);
Expand Down

0 comments on commit f874185

Please sign in to comment.