Skip to content

Commit

Permalink
fix(ui): don't display raw payload (#3755)
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Coenen <benjamin.coenen@corp.ovh.com>
  • Loading branch information
bnjjj authored and yesnault committed Dec 20, 2018
1 parent a9b495e commit f2d1c14
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions ui/src/app/shared/workflow/node/run/node.run.param.component.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import {Component, Input, OnInit, ViewChild} from '@angular/core';
import {Router} from '@angular/router';
import {TranslateService} from '@ngx-translate/core';
import {cloneDeep} from 'lodash';
import {CodemirrorComponent} from 'ng2-codemirror-typescript/Codemirror';
import {ModalTemplate, SuiModalService, TemplateModalConfig} from 'ng2-semantic-ui';
import {ActiveModal} from 'ng2-semantic-ui/dist';
import {debounceTime, finalize, first} from 'rxjs/operators';
import {Parameter} from '../../../../model/parameter.model';
import {Pipeline} from '../../../../model/pipeline.model';
import {Project} from '../../../../model/project.model';
import {Commit} from '../../../../model/repositories.model';
import {WNode, WNodeContext, WNodeType, Workflow} from '../../../../model/workflow.model';
import {WorkflowNodeRun, WorkflowNodeRunManual, WorkflowRun, WorkflowRunRequest} from '../../../../model/workflow.run.model';
import {ApplicationWorkflowService} from '../../../../service/application/application.workflow.service';
import {WorkflowRunService} from '../../../../service/workflow/run/workflow.run.service';
import {WorkflowEventStore} from '../../../../service/workflow/workflow.event.store';
import {AutoUnsubscribe} from '../../../decorator/autoUnsubscribe';
import {ToastService} from '../../../toast/ToastService';
import { Component, Input, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { cloneDeep } from 'lodash';
import { CodemirrorComponent } from 'ng2-codemirror-typescript/Codemirror';
import { ModalTemplate, SuiModalService, TemplateModalConfig } from 'ng2-semantic-ui';
import { ActiveModal } from 'ng2-semantic-ui/dist';
import { debounceTime, finalize, first } from 'rxjs/operators';
import { Parameter } from '../../../../model/parameter.model';
import { Pipeline } from '../../../../model/pipeline.model';
import { Project } from '../../../../model/project.model';
import { Commit } from '../../../../model/repositories.model';
import { WNode, WNodeContext, WNodeType, Workflow } from '../../../../model/workflow.model';
import { WorkflowNodeRun, WorkflowNodeRunManual, WorkflowRun, WorkflowRunRequest } from '../../../../model/workflow.run.model';
import { ApplicationWorkflowService } from '../../../../service/application/application.workflow.service';
import { WorkflowRunService } from '../../../../service/workflow/run/workflow.run.service';
import { WorkflowEventStore } from '../../../../service/workflow/workflow.event.store';
import { AutoUnsubscribe } from '../../../decorator/autoUnsubscribe';
import { ToastService } from '../../../toast/ToastService';
declare var CodeMirror: any;

@Component({
Expand Down Expand Up @@ -175,6 +175,9 @@ export class WorkflowNodeRunParamComponent implements OnInit {
let currentPayload = payload;
if (!currentPayload) {
currentPayload = this.getCurrentPayload();
if (this.readOnly) {
delete currentPayload['payload'];
}
this.payloadString = JSON.stringify(currentPayload, undefined, 4);
}

Expand Down

0 comments on commit f2d1c14

Please sign in to comment.