Skip to content

Commit

Permalink
fix(ui): display value of config even if type is empty (#2347)
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Coenen <[email protected]>
  • Loading branch information
bnjjj authored and fsamin committed Mar 2, 2018
1 parent 207886d commit f79868a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
24 changes: 12 additions & 12 deletions ui/src/app/shared/workflow/node/hook/form/hook.form.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h3>{{ 'workflow_node_hook_form_config' | translate }}</h3>
<div class="inline fields" *ngFor="let k of hook.config | keys">
<div class="four wide field"><label>{{k}}</label></div>
<div class="twelve wide field">
<input type="text" [(ngModel)]="_hook.config[k].value" [readonly]="!_hook.config[k].configurable || readonly" *ngIf="k !== 'payload' && _hook.config[k].type ==='string'">
<input type="text" [(ngModel)]="_hook.config[k].value" [readonly]="!_hook.config[k].configurable || readonly" *ngIf="k !== 'payload' && (_hook.config[k].type === 'string' || !_hook.config[k].type)">
<ng-container *ngIf="k === 'payload' && _hook.config[k].type === 'string'">
<codemirror
[class.invalid]="invalidJSON"
Expand All @@ -45,17 +45,17 @@ <h3>{{ 'workflow_node_hook_form_config' | translate }}</h3>
#textareaCodeMirror>
</codemirror>
</ng-container>
<ng-container *ngIf="_hook.config[k].type==='platform'">
<sui-select class="selection" placeholder="{{'platform_name' | translate}}"
[(ngModel)]="_hook.config[k].value"
[options]="project.platforms"
[isSearchable]="true"
labelField="name"
valueField="name" #select>
<sui-select-option *ngFor="let option of select.filteredOptions" [value]="option">{{option.name}}
</sui-select-option>
</sui-select>
</ng-container>
<ng-container *ngIf="_hook.config[k].type === 'platform'">
<sui-select class="selection" placeholder="{{'platform_name' | translate}}"
[(ngModel)]="_hook.config[k].value"
[options]="project.platforms"
[isSearchable]="true"
labelField="name"
valueField="name" #select>
<sui-select-option *ngFor="let option of select.filteredOptions" [value]="option">{{option.name}}
</sui-select-option>
</sui-select>
</ng-container>
</div>
</div>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,13 @@ export class PipelineWorkflowComponent implements OnInit, OnDestroy {

switch (event.type) {
case 'update':
this._pipelineStore.updateJob(this.project.key, this.pipeline.name, this.selectedStage.id, job).subscribe(() => {
this._pipelineStore.updateJob(this.project.key, this.pipeline.name, this.selectedStage.id, job).subscribe((pip) => {
this._toast.success('', this._translate.instant('stage_job_updated'));
job.action.loading = false;
job.action.hasChanged = false;

this.pipeline = pip;
this.selectedStage = this.pipeline.stages.find((s) => this.selectedStage.id === s.id) || this.selectedStage;
this.selectedJob = this.selectedStage.jobs.find((j) => this.selectedJob.action.id === j.action.id) || this.selectedJob;
}, () => {
job.action.loading = false;
});
Expand Down

0 comments on commit f79868a

Please sign in to comment.