diff --git a/ui/src/app/shared/action/action.component.ts b/ui/src/app/shared/action/action.component.ts index bb66bdb715..6a09687c87 100644 --- a/ui/src/app/shared/action/action.component.ts +++ b/ui/src/app/shared/action/action.component.ts @@ -1,4 +1,4 @@ -import {Component, Input, Output, EventEmitter, OnDestroy} from '@angular/core'; +import {Component, Input, Output, EventEmitter, OnDestroy, OnInit} from '@angular/core'; import {Action} from '../../model/action.model'; import {SharedService} from '../shared.service'; import {RequirementEvent} from '../requirements/requirement.event.model'; @@ -18,7 +18,7 @@ import {cloneDeep} from 'lodash'; templateUrl: './action.html', styleUrls: ['./action.scss'] }) -export class ActionComponent implements OnDestroy { +export class ActionComponent implements OnDestroy, OnInit { editableAction: Action; steps: Array = new Array(); publicActions: Array; @@ -48,10 +48,6 @@ export class ActionComponent implements OnDestroy { collapsed = true; configRequirements: {disableModel?: boolean, disableHostname?: boolean} = {}; constructor(private sharedService: SharedService, private _actionStore: ActionStore, private dragulaService: DragulaService) { - this._actionStore.getActions().subscribe(mapActions => { - this.publicActions = mapActions.toArray(); - }); - dragulaService.setOptions('bag-nonfinal', { moves: function (el, source, handle) { return handle.classList.contains('move'); @@ -68,6 +64,12 @@ export class ActionComponent implements OnDestroy { }); } + ngOnInit() { + this._actionStore.getActions().subscribe(mapActions => { + this.publicActions = mapActions.toArray().filter((action) => action.name !== this.editableAction.name); + }); + } + ngOnDestroy() { this.dragulaService.destroy('bag-nonfinal'); this.dragulaService.destroy('bag-final'); @@ -167,13 +169,14 @@ export class ActionComponent implements OnDestroy { } let indexAdd = this.editableAction.parameters.findIndex(param => p.parameter.name === param.name); if (indexAdd === -1) { - this.editableAction.parameters.push(p.parameter); + this.editableAction.parameters = this.editableAction.parameters.concat([p.parameter]); } break; case 'delete': let indexDelete = this.editableAction.parameters.indexOf(p.parameter); if (indexDelete >= 0) { this.editableAction.parameters.splice(indexDelete, 1); + this.editableAction.parameters = this.editableAction.parameters.concat([]); } break; } diff --git a/ui/src/app/shared/action/action.html b/ui/src/app/shared/action/action.html index be8886dc04..11008546f7 100644 --- a/ui/src/app/shared/action/action.html +++ b/ui/src/app/shared/action/action.html @@ -62,8 +62,13 @@

{{ 'requirement_add' | translate }}

- + +
@@ -73,7 +78,7 @@

{{ 'requirement_add' | translate }}

{{ 'action_step_title' | translate }}

-
+
diff --git a/ui/src/app/shared/parameter/form/parameter.form.html b/ui/src/app/shared/parameter/form/parameter.form.html index fdbe6323c0..5fc5db924d 100644 --- a/ui/src/app/shared/parameter/form/parameter.form.html +++ b/ui/src/app/shared/parameter/form/parameter.form.html @@ -19,7 +19,7 @@
- +
diff --git a/ui/src/app/shared/parameter/list/parameter.component.ts b/ui/src/app/shared/parameter/list/parameter.component.ts index 550fb1e8a6..b92964203e 100644 --- a/ui/src/app/shared/parameter/list/parameter.component.ts +++ b/ui/src/app/shared/parameter/list/parameter.component.ts @@ -33,6 +33,7 @@ export class ParameterListComponent extends Table { @Input() suggest: Array; @Input() keys: AllKeys; @Input() canDelete: boolean; + @Input() hideSave = false; // edit/launcher/ro/job @Input() mode = 'edit'; diff --git a/ui/src/app/shared/parameter/list/parameter.html b/ui/src/app/shared/parameter/list/parameter.html index a4a95834f9..a7f7fb4631 100644 --- a/ui/src/app/shared/parameter/list/parameter.html +++ b/ui/src/app/shared/parameter/list/parameter.html @@ -65,7 +65,7 @@ -
+