Skip to content

Commit

Permalink
fix(api): compute outgoing name (#3647)
Browse files Browse the repository at this point in the history
  • Loading branch information
yesnault authored and sguiheux committed Nov 27, 2018
1 parent b12ddfa commit 4883128
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
6 changes: 3 additions & 3 deletions engine/api/workflow/dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -700,13 +700,13 @@ func RenameNode(db gorp.SqlExecutor, w *sdk.Workflow) error {
case sdk.NodeTypeOutGoingHook:
model := w.OutGoingHookModels[nodes[i].OutGoingHookContext.HookModelID]
// Check if node is named pipName_12
if nodes[i].Name == model.Type || strings.HasPrefix(nodes[i].Name, model.Type+"_") {
if nodes[i].Name == model.Name || strings.HasPrefix(nodes[i].Name, model.Name+"_") {
var hookNumber int
if nodes[i].Name == model.Type {
if nodes[i].Name == model.Name {
hookNumber = 1
} else {
// Retrieve Number
current, errI := strconv.Atoi(strings.Replace(nodes[i].Name, model.Type+"_", "", 1))
current, errI := strconv.Atoi(strings.Replace(nodes[i].Name, model.Name+"_", "", 1))
if errI == nil {
hookNumber = current
}
Expand Down
11 changes: 5 additions & 6 deletions ui/src/app/shared/workflow/sidebar/edit-node/sidebar.edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

<h3 class="ui header ml5">
<i class="settings icon"></i>
<!-- PIPELINE AND FORK -->
<ng-container *ngIf="node.type === 'pipeline' || node.type === 'fork'">
<!-- PIPELINE AND OUTGOINGHOOK -->
<ng-container *ngIf="node.type === 'pipeline' || node.type === 'outgoinghook'">
<div class="content">
<ng-container *ngIf="!displayInputName">
<div class="line">
Expand All @@ -14,7 +14,6 @@ <h3 class="ui header ml5">
<i class="pencil icon float"></i>
</a>
</div>

</ng-container>
<ng-container *ngIf="displayInputName">
<div class="ui fluid mini action input">
Expand All @@ -36,10 +35,10 @@ <h3 class="ui header ml5">
</div>
</div>
</ng-container>
<!-- JOIN -->
<ng-container *ngIf="node.type === 'join' || node.type === 'outgoinghook'">
<!-- JOIN AND FORK -->
<ng-container *ngIf="node.type === 'join' || node.type === 'fork'">
<div class="content">
<span>{{ node.type | titlecase}}</span>
<span>{{ node.name | titlecase}}</span>
<div class="sub header">
<span>{{ 'workflow_node_edition' | translate }}</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
<h3 class="ui header ml5">
<i class="cubes icon"></i>
<div class="content">
<span>{{node.name}}</span>
<ng-container *ngIf="node.type === 'pipeline' || node.type === 'outgoinghook'">
<span>{{node.name}}</span>
</ng-container>
<ng-container *ngIf="node.type !== 'pipeline' && node.type !== 'outgoinghook'">
<span>{{node.type}}</span>
</ng-container>
<a class="inline pointing ml5"
*ngIf="displayEditOption"
(click)="goToEditNode()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[class.success]="noderun?.status === pipelineStatus.SUCCESS"
[class.fail]="noderun?.status === pipelineStatus.FAIL || noderun?.status === pipelineStatus.STOPPED">
<div class="name">
<i class="{{icon}} icon"></i> <span class="hook">{{model.name}}</span>
<i class="{{icon}} icon"></i> <span class="hook">{{node.name}}</span>
</div>

<ng-container *ngIf="model.name === 'WebHook'" >
Expand Down

0 comments on commit 4883128

Please sign in to comment.