Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/development'
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Tervala authored and Justin Tervala committed Mar 14, 2018
2 parents a9ab60c + aee6c42 commit 1bc8f4b
Show file tree
Hide file tree
Showing 27 changed files with 137 additions and 74 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,16 @@
<!-- Use the tags Added, Changed, Deprecated, Removed, Fixed, Security, and
Contributor to describe changes -->

## [0.7.3]
###### 2018-03-14

### Fixed
* Bug where NO_CONTENT return codes were failing on Werkzeug WSGI 0.14

### Changed
* All node modules are now bundled into webpack


## [0.7.2]
###### 2018-03-12

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
@@ -1,4 +1,4 @@
version: 0.7.2.{build}
version: 0.7.3.{build}

branches:
only:
Expand Down
2 changes: 1 addition & 1 deletion walkoff/__init__.py
@@ -1,4 +1,4 @@
__version__ = '0.7.2'
__version__ = '0.7.3'


def initialize_databases():
Expand Down
1 change: 0 additions & 1 deletion walkoff/client/package.json
Expand Up @@ -66,7 +66,6 @@
"jqueryui": "~1.11.1",
"json-editor": "~0.7.28",
"jstree": "~3.3.4",
"lodash": "~4.17.4",
"moment": "~2.20.1",
"ng-pick-datetime": "~4.3.2",
"ng2-dnd": "^4.2.0",
Expand Down
10 changes: 6 additions & 4 deletions walkoff/client/src/cases/cases.component.ts
Expand Up @@ -7,6 +7,7 @@ import { Select2OptionData } from 'ng2-select2';
import 'rxjs/add/operator/debounceTime';

import { CasesService } from './cases.service';
import { UtilitiesService } from '../utilities.service';

import { CasesModalComponent } from './cases.modal.component';

Expand All @@ -31,7 +32,7 @@ interface ICaseHierarchy {
styleUrls: [
'./cases.css',
],
providers: [CasesService],
providers: [CasesService, UtilitiesService],
})
export class CasesComponent implements OnInit {
cases: Case[] = [];
Expand Down Expand Up @@ -115,6 +116,7 @@ export class CasesComponent implements OnInit {
constructor(
private casesService: CasesService, private modalService: NgbModal,
private toastyService: ToastyService, private toastyConfig: ToastyConfig,
private utils: UtilitiesService,
) {}

ngOnInit(): void {
Expand Down Expand Up @@ -214,7 +216,7 @@ export class CasesComponent implements OnInit {
modalRef.componentInstance.submitText = 'Add Case';
modalRef.componentInstance.workingCase = new Case();
modalRef.componentInstance.availableSubscriptions = this.availableSubscriptions;
modalRef.componentInstance.subscriptionTree = _.cloneDeep(this.subscriptionTree);
modalRef.componentInstance.subscriptionTree = this.utils.cloneDeep(this.subscriptionTree);

this._handleModalClose(modalRef);
}
Expand All @@ -226,10 +228,10 @@ export class CasesComponent implements OnInit {
const modalRef = this.modalService.open(CasesModalComponent, { windowClass: 'casesModal' });
modalRef.componentInstance.title = `Edit Case: ${caseToEdit.name}`;
modalRef.componentInstance.submitText = 'Save Changes';
modalRef.componentInstance.workingCase = _.cloneDeep(caseToEdit);
modalRef.componentInstance.workingCase = this.utils.cloneDeep(caseToEdit);
delete modalRef.componentInstance.workingCase.$$index;
modalRef.componentInstance.availableSubscriptions = this.availableSubscriptions;
modalRef.componentInstance.subscriptionTree = _.cloneDeep(this.subscriptionTree);
modalRef.componentInstance.subscriptionTree = this.utils.cloneDeep(this.subscriptionTree);

this._handleModalClose(modalRef);
}
Expand Down
14 changes: 14 additions & 0 deletions walkoff/client/src/main.ts
Expand Up @@ -3,6 +3,20 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { MainModule } from './main.module';

// Import global JS packages
import 'jquery';
import 'bootstrap';
import 'select2';

// Import global CSS packages
import 'bootstrap/dist/css/bootstrap.min.css';
import '@swimlane/ngx-datatable/release/index.css';
import '@swimlane/ngx-datatable/release/themes/material.css';
import '@swimlane/ngx-datatable/release/assets/icons.css';
import 'font-awesome/css/font-awesome.min.css';
import 'ng2-toasty/style-bootstrap.css';
import 'select2/dist/css/select2.min.css';

document.addEventListener('DOMContentLoaded', event => {
if (sessionStorage.getItem('refresh_token')) {
//TODO: figure out a good way of handling this
Expand Down
10 changes: 7 additions & 3 deletions walkoff/client/src/main/main.css
@@ -1,6 +1,10 @@
@import '/client/node_modules/@swimlane/ngx-datatable/release/index.css';
@import '/client/node_modules/@swimlane/ngx-datatable/release/themes/material.css';
@import '/client/node_modules/@swimlane/ngx-datatable/release/assets/icons.css';
/* @import '~@swimlane/ngx-datatable/release/index.css';
@import '~@swimlane/ngx-datatable/release/themes/material.css';
@import '~@swimlane/ngx-datatable/release/assets/icons.css';
@import '~bootstrap/dist/css/bootstrap.min.css';
@import '~font-awesome/css/font-awesome.min.css';
@import '~ng2-toasty/style-bootstrap.css';
@import '~select2/dist/css/select2.min.css'; */

/* h1 {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, sans-serif;
Expand Down
24 changes: 20 additions & 4 deletions walkoff/client/src/playbook/playbook.component.ts
Expand Up @@ -8,6 +8,13 @@ import 'rxjs/Rx';
import { saveAs } from 'file-saver';
import { plainToClass } from 'class-transformer';

import * as cytoscape from 'cytoscape';
import * as clipboard from 'cytoscape-clipboard';
import * as edgehandles from 'cytoscape-edgehandles';
import * as gridGuide from 'cytoscape-grid-guide';
import * as panzoom from 'cytoscape-panzoom';
import * as undoRedo from 'cytoscape-undo-redo';

import { PlaybookService } from './playbook.service';
import { AuthService } from '../auth/auth.service';
import { UtilitiesService } from '../utilities.service';
Expand Down Expand Up @@ -37,6 +44,8 @@ import { ActionStatusEvent } from '../models/execution/actionStatusEvent';
templateUrl: './playbook.html',
styleUrls: [
'./playbook.css',
'../../node_modules/cytoscape-panzoom/cytoscape.js-panzoom.css',
'../../node_modules/ng2-dnd/bundles/style.css',
],
encapsulation: ViewEncapsulation.None,
providers: [PlaybookService, AuthService, UtilitiesService],
Expand Down Expand Up @@ -112,6 +121,13 @@ export class PlaybookComponent implements OnInit, AfterViewChecked, OnDestroy {
ngOnInit(): void {
this.toastyConfig.theme = 'bootstrap';

const cyDummy = cytoscape();
if (!cyDummy.clipboard) { clipboard(cytoscape, $); }
if (!cyDummy.edgehandles) { cytoscape.use(edgehandles); }
if (!cyDummy.gridGuide) { cytoscape.use(gridGuide); }
if (!cyDummy.panzoom) { cytoscape.use(panzoom); }
if (!cyDummy.undoRedo) { cytoscape.use(undoRedo); }

this.playbookService.getDevices().then(devices => this.devices = devices);
this.playbookService.getApis().then(appApis => this.appApis = appApis.sort((a, b) => a.name > b.name ? 1 : -1));
this.getActionStatusSSE();
Expand Down Expand Up @@ -509,7 +525,7 @@ export class PlaybookComponent implements OnInit, AfterViewChecked, OnDestroy {
});

const nodes = this.loadedWorkflow.actions.map(action => {
const node: any = { group: 'nodes', position: _.clone(action.position) };
const node: any = { group: 'nodes', position: this.utils.cloneDeep(action.position) };
node.data = {
id: action.id,
_id: action.id,
Expand Down Expand Up @@ -569,7 +585,7 @@ export class PlaybookComponent implements OnInit, AfterViewChecked, OnDestroy {

// Clone the loadedWorkflow first, so we don't change the parameters
// in the editor when converting it to the format the backend expects.
const workflowToSave: Workflow = _.cloneDeep(this.loadedWorkflow);
const workflowToSave: Workflow = this.utils.cloneDeep(this.loadedWorkflow);

if (!workflowToSave.start) {
this.toastyService.warning('Workflow cannot be saved without a starting action.');
Expand Down Expand Up @@ -600,7 +616,7 @@ export class PlaybookComponent implements OnInit, AfterViewChecked, OnDestroy {
savePromise = this.playbookService.newWorkflow(this.loadedPlaybook.id, workflowToSave);
}
} else {
const playbookToSave: Playbook = _.cloneDeep(this.loadedPlaybook);
const playbookToSave: Playbook = this.utils.cloneDeep(this.loadedPlaybook);
playbookToSave.workflows = [workflowToSave];
savePromise = this.playbookService.newPlaybook(playbookToSave)
.then(newPlaybook => {
Expand Down Expand Up @@ -1060,7 +1076,7 @@ export class PlaybookComponent implements OnInit, AfterViewChecked, OnDestroy {

newNodes.forEach((n: any) => {
// Get a copy of the action we just copied
const pastedAction: Action = _.clone(this.loadedWorkflow.actions.find(a => a.id === n.data('_id')));
const pastedAction: Action = this.utils.cloneDeep(this.loadedWorkflow.actions.find(a => a.id === n.data('_id')));

const newActionUuid = UUID.UUID();

Expand Down
4 changes: 2 additions & 2 deletions walkoff/client/src/playbook/playbook.css
@@ -1,5 +1,5 @@
@import '/client/node_modules/cytoscape-panzoom/cytoscape.js-panzoom.css';
@import '/client/node_modules/ng2-dnd/bundles/style.css';
/* @import '/client/node_modules/cytoscape-panzoom/cytoscape.js-panzoom.css';
@import '/client/node_modules/ng2-dnd/bundles/style.css'; */

#main.playbookMain {
padding: 10px 15px 0 15px;
Expand Down
3 changes: 1 addition & 2 deletions walkoff/client/src/playbook/playbook.d.ts
@@ -1,7 +1,6 @@
declare var cytoscape: any;
declare module 'cytoscape';
declare module 'cytoscape-clipboard';
declare module 'cytoscape-edgehandles';
declare module 'cytoscape-grid-guide';
declare module 'cytoscape-panzoom';
declare module 'cytoscape-undo-redo';
declare var _: any;
1 change: 1 addition & 0 deletions walkoff/client/src/polyfills.ts
Expand Up @@ -27,6 +27,7 @@ import 'zone.js/dist/zone';

import 'event-source-polyfill';
import 'reflect-metadata';

// if ('production' === ENV) {
// // Production
// } else {
Expand Down
7 changes: 5 additions & 2 deletions walkoff/client/src/scheduler/scheduler.component.ts
Expand Up @@ -9,6 +9,7 @@ import 'rxjs/add/operator/debounceTime';
import { SchedulerModalComponent } from './scheduler.modal.component';

import { SchedulerService } from './scheduler.service';
import { UtilitiesService } from '../utilities.service';

import { ScheduledTask } from '../models/scheduler/scheduledTask';

Expand All @@ -17,9 +18,10 @@ import { ScheduledTask } from '../models/scheduler/scheduledTask';
templateUrl: './scheduler.html',
styleUrls: [
'./scheduler.css',
'../../node_modules/ng-pick-datetime/styles/picker.min.css',
],
encapsulation: ViewEncapsulation.None,
providers: [SchedulerService],
providers: [SchedulerService, UtilitiesService],
})
export class SchedulerComponent implements OnInit {
schedulerStatus: string;
Expand All @@ -32,6 +34,7 @@ export class SchedulerComponent implements OnInit {
constructor(
private schedulerService: SchedulerService, private modalService: NgbModal,
private toastyService: ToastyService, private toastyConfig: ToastyConfig,
private utils: UtilitiesService,
) {}

/**
Expand Down Expand Up @@ -120,7 +123,7 @@ export class SchedulerComponent implements OnInit {
modalRef.componentInstance.title = `Edit Task ${task.name}`;
modalRef.componentInstance.submitText = 'Save Changes';
modalRef.componentInstance.availableWorkflows = this.availableWorkflows;
modalRef.componentInstance.workingScheduledTask = _.cloneDeep(task);
modalRef.componentInstance.workingScheduledTask = this.utils.cloneDeep(task);
delete modalRef.componentInstance.workingScheduledTask.$$index;

this._handleModalClose(modalRef);
Expand Down
2 changes: 1 addition & 1 deletion walkoff/client/src/scheduler/scheduler.css
@@ -1,4 +1,4 @@
@import '/client/node_modules/ng-pick-datetime/styles/picker.min.css';
/* @import '/client/node_modules/ng-pick-datetime/styles/picker.min.css'; */

.schedulerMain {
padding: 10px 15px;
Expand Down
4 changes: 0 additions & 4 deletions walkoff/client/src/settings/settings.css
@@ -1,7 +1,3 @@
/*@import '/client/node_modules/@swimlane/ngx-datatable/release/index.css';
@import '/client/node_modules/@swimlane/ngx-datatable/release/themes/material.css';
@import '/client/node_modules/@swimlane/ngx-datatable/release/assets/icons.css';*/

.settingsMain {
padding: 10px 15px;
}
Expand Down
6 changes: 4 additions & 2 deletions walkoff/client/src/settings/settings.roles.component.ts
Expand Up @@ -5,6 +5,7 @@ import { ToastyService, ToastyConfig } from 'ng2-toasty';
import 'rxjs/add/operator/debounceTime';

import { SettingsService } from './settings.service';
import { UtilitiesService } from '../utilities.service';

import { SettingsRoleModalComponent } from './settings.roles.modal.component';

Expand All @@ -19,7 +20,7 @@ import { GenericObject } from '../models/genericObject';
'./settings.css',
],
encapsulation: ViewEncapsulation.None,
providers: [SettingsService],
providers: [SettingsService, UtilitiesService],
})
export class SettingsRolesComponent {
availableResourceActions: AvailableResourceAction[] = [];
Expand All @@ -31,6 +32,7 @@ export class SettingsRolesComponent {
constructor(
private settingsService: SettingsService, private modalService: NgbModal,
private toastyService: ToastyService, private toastyConfig: ToastyConfig,
private utils: UtilitiesService,
) {
this.toastyConfig.theme = 'bootstrap';

Expand Down Expand Up @@ -80,7 +82,7 @@ export class SettingsRolesComponent {
modalRef.componentInstance.title = `Edit Role: ${role.name}`;
modalRef.componentInstance.submitText = 'Save Changes';
modalRef.componentInstance.availableResourceActions = this.availableResourceActions;
modalRef.componentInstance.workingRole = _.cloneDeep(role);
modalRef.componentInstance.workingRole = this.utils.cloneDeep(role);

this._handleModalClose(modalRef);
}
Expand Down
6 changes: 4 additions & 2 deletions walkoff/client/src/settings/settings.roles.modal.component.ts
Expand Up @@ -4,6 +4,7 @@ import { ToastyService, ToastyConfig } from 'ng2-toasty';
import { Select2OptionData } from 'ng2-select2';

import { SettingsService } from './settings.service';
import { UtilitiesService } from '../utilities.service';

import { Role } from '../models/role';
import { AvailableResourceAction } from '../models/availableResourceAction';
Expand All @@ -15,7 +16,7 @@ import { Resource } from '../models/resource';
styleUrls: [
'./settings.css',
],
providers: [SettingsService],
providers: [SettingsService, UtilitiesService],
})
export class SettingsRoleModalComponent {
@Input() workingRole: Role;
Expand All @@ -32,6 +33,7 @@ export class SettingsRoleModalComponent {
constructor(
private settingsService: SettingsService, private activeModal: NgbActiveModal,
private toastyService: ToastyService, private toastyConfig: ToastyConfig,
private utils: UtilitiesService,
) {
this.toastyConfig.theme = 'bootstrap';

Expand Down Expand Up @@ -109,7 +111,7 @@ export class SettingsRoleModalComponent {
return;
}

const toSubmit: Role = _.cloneDeep(this.workingRole);
const toSubmit: Role = this.utils.cloneDeep(this.workingRole);

// Remove temp Ids for new resources
toSubmit.resources.forEach(resource => {
Expand Down
19 changes: 16 additions & 3 deletions walkoff/client/webpack.common.js
Expand Up @@ -19,6 +19,7 @@ const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin;
// const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin');
// const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin');
// const ngcWebpack = require('ngc-webpack');
const ProvidePlugin = require('webpack/lib/ProvidePlugin')

/**
* Webpack Constants
Expand Down Expand Up @@ -83,7 +84,7 @@ module.exports = function (options) {
},
{
test: /\.css$/,
use: ['to-string-loader', 'css-loader'],
use: ['to-string-loader', 'style-loader', 'css-loader'],
exclude: [helpers.root('styles')]
},
{
Expand All @@ -101,8 +102,15 @@ module.exports = function (options) {
use: 'file-loader'
},
{
test: /\.(eot|woff2?|svg|ttf)([\?]?.*)$/,
use: 'file-loader'
test: /.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
// outputPath: 'dist/', // where the fonts will go
publicPath: '/client/dist/' // override the default path
}
}]
}
]
},
Expand Down Expand Up @@ -131,6 +139,11 @@ module.exports = function (options) {
name: ['polyfills', 'vendor'].reverse()
}),

new ProvidePlugin({
$: "jquery",
jQuery: "jquery",
}),

// new ContextReplacementPlugin(
// // The (\\|\/) piece accounts for path separators in *nix and Windows
// /angular(\\|\/)core(\\|\/)@angular/,
Expand Down

0 comments on commit 1bc8f4b

Please sign in to comment.