Skip to content

Commit

Permalink
Cleanup frontend merge
Browse files Browse the repository at this point in the history
  • Loading branch information
tjohnson-bah committed May 17, 2019
1 parent e705358 commit ab75148
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 28 deletions.
9 changes: 2 additions & 7 deletions api_gateway/client/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,5 @@
<link rel="stylesheet" href="client/dist/styles.742a6a1aa8c96b0fb631.css"></head>
<body>
<main-component>Loading...</main-component>
<<<<<<< HEAD
<script type="text/javascript" src="client/dist/runtime.0cd64862052be0d1bb28.js"></script><script type="text/javascript" src="client/dist/polyfills.f6ae3e8b63939c618130.js"></script><script type="text/javascript" src="client/dist/scripts.88dd31992d945374bfe1.js"></script><script type="text/javascript" src="client/dist/main.30a81b2dca2a1ab05959.js"></script></body>
</html>
=======
<script type="text/javascript" src="client/dist/runtime.0cd64862052be0d1bb28.js"></script><script type="text/javascript" src="client/dist/polyfills.f6ae3e8b63939c618130.js"></script><script type="text/javascript" src="client/dist/scripts.88dd31992d945374bfe1.js"></script><script type="text/javascript" src="client/dist/main.1e3e45e9b22e673a52bf.js"></script></body>
</html>
>>>>>>> 96e551f13925e76de1e8fb835aaed0999ef25b1b
<script type="text/javascript" src="client/dist/runtime.0cd64862052be0d1bb28.js"></script><script type="text/javascript" src="client/dist/polyfills.f6ae3e8b63939c618130.js"></script><script type="text/javascript" src="client/dist/scripts.88dd31992d945374bfe1.js"></script><script type="text/javascript" src="client/dist/main.b1ea7b67e39e00a3d6f8.js"></script></body>
</html>
1 change: 0 additions & 1 deletion api_gateway/client/dist/main.1e3e45e9b22e673a52bf.js

This file was deleted.

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions api_gateway/client/src/app/models/playbook/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ export class Workflow extends ExecutionElement {
return this.environment_variables.filter(variable => this.all_arguments.some(arg => arg.value == variable.id));
}

addNode(node: Action | Condition | Trigger) {
if (node instanceof Action )
this.actions.push(node);
else if (node instanceof Condition)
this.conditions.push(node);
else if (node instanceof Trigger)
this.triggers.push(node);
}

deleteVariable(deletedVariable: EnvironmentVariable) {
this.environment_variables = this.environment_variables.filter(variable => variable.id !== deletedVariable.id);
this.all_arguments.filter(arg => arg.value == deletedVariable.id).forEach(arg => arg.value = '');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { GenericObject } from '../models/genericObject';
import { User } from '../models/user';
import { Role } from '../models/role';
import { Global } from '../models/global';
import { Trigger } from '../models/playbook/trigger';
import { Condition } from '../models/playbook/condition';

const AVAILABLE_TYPES = ['string', 'number', 'boolean'];

Expand Down Expand Up @@ -282,7 +284,7 @@ export class PlaybookArgumentComponent implements OnChanges {
}

// TODO: maybe somehow recursively find actions that may occur before. Right now it just returns all of them.
getPreviousActions(): Action[] {
getPreviousActions(): (Action | Condition | Trigger)[] {
return this.loadedWorkflow.getPreviousActions(this.selectedAction);
}

Expand Down
6 changes: 0 additions & 6 deletions api_gateway/client/src/app/playbook/playbook.argument.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
<div class="form-group argument {{id % 2 ? 'odd' : 'even'}}">
<!-- Label for argument with optional required icon -->
<<<<<<< HEAD
<label for="{{argument.name}}">
Argument {{id+1}}: {{argument.name}} ({{parameterSchema.type}})
<i *ngIf="parameterApi.description != null" class="fa fa-info-circle" [title]="parameterApi.description"></i>
=======
<label *ngIf="!isGlobalArgument" for="{{argument.name}}">
<b class="text-capitalize">{{argument.name}}</b> ({{parameterSchema.type}})
<i *ngIf="parameterApi.description != null" class="fa fa-info-circle" [ngbTooltip]="parameterApi.description" container="body"></i>
>>>>>>> parallel_actions
<i *ngIf="parameterApi.required" class="fa fa-asterisk required" title="This field is required."></i>
</label>

Expand Down
16 changes: 4 additions & 12 deletions api_gateway/client/src/app/playbook/workflow.editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ export class WorkflowEditorComponent implements OnInit, AfterViewChecked, OnDest
_id: action.id,
label: action.name,
isStartNode: action.id === this.loadedWorkflow.start,
isParallelized: action.parallelized,
isParallelized: action instanceof Action && action.parallelized,
hasErrors: action.has_errors,
type: action.action_type
};
Expand Down Expand Up @@ -824,16 +824,7 @@ export class WorkflowEditorComponent implements OnInit, AfterViewChecked, OnDest
action.position = cyData.find(cyAction => cyAction.data._id === action.id).position;

// Properly sanitize arguments through the tree
<<<<<<< HEAD
if (action.arguments) this._sanitizeArgumentsForSave(action, workflowToSave);
<<<<<<< HEAD

// if (action.trigger) this._sanitizeExpressionAndChildren(action.trigger);
=======
if (action.arguments) this._sanitizeArgumentsForSave(action.arguments);
>>>>>>> parallel_actions
=======
>>>>>>> 96e551f13925e76de1e8fb835aaed0999ef25b1b
});


Expand Down Expand Up @@ -913,7 +904,7 @@ export class WorkflowEditorComponent implements OnInit, AfterViewChecked, OnDest
* Sanitizes an argument so we don't have bad data on save, such as a value when reference is specified.
* @param argument The argument to sanitize
*/
_sanitizeArgumentsForSave(action: Action | Condition, workflow: Workflow): void {
_sanitizeArgumentsForSave(action: Action | Condition | Trigger, workflow: Workflow): void {
const args = action.arguments;

// Filter out any arguments that are blank, essentially
Expand Down Expand Up @@ -1114,6 +1105,7 @@ export class WorkflowEditorComponent implements OnInit, AfterViewChecked, OnDest
// Delete the action from the workflow and delete any branches that reference this action
this.loadedWorkflow.actions = this.loadedWorkflow.actions.filter(a => a.id !== data._id);
this.loadedWorkflow.conditions = this.loadedWorkflow.conditions.filter(a => a.id !== data._id);
this.loadedWorkflow.triggers = this.loadedWorkflow.triggers.filter(a => a.id !== data._id);
this.loadedWorkflow.branches = this.loadedWorkflow.branches
.filter(ns => !(ns.source_id === data._id || ns.destination_id === data._id));
}
Expand Down Expand Up @@ -1299,7 +1291,7 @@ export class WorkflowEditorComponent implements OnInit, AfterViewChecked, OnDest
pastedAction.id = newActionUuid;
pastedAction.name = this.loadedWorkflow.getNextActionName(pastedAction.action_name)
pastedAction.arguments.forEach(argument => delete argument.id);
this.loadedWorkflow.actions.push(pastedAction);
this.loadedWorkflow.addNode(pastedAction);

n.data({
id: newActionUuid,
Expand Down

0 comments on commit ab75148

Please sign in to comment.