added svcapi ui and camunda code
Signed-off-by: Rohan Patel <rp5811@att.com>
Change-Id: I197b4b40fe3d047a417479214e471ae26d51fb2b
diff --git a/otf-frontend/client/.gitignore b/otf-frontend/client/.gitignore
new file mode 100644
index 0000000..f94aed4
--- /dev/null
+++ b/otf-frontend/client/.gitignore
@@ -0,0 +1,45 @@
+# See http://help.github.com/ignore-files/ for more about ignoring files.
+
+# compiled output
+/tmp
+/out-tsc
+/dist
+/test
+
+# dependencies
+/node_modules
+/test
+package-lock.json
+
+# IDEs and editors
+/.idea
+.project
+.classpath
+.c9/
+*.launch
+.settings/
+*.sublime-workspace
+
+# IDE - VSCode
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+
+# misc
+/.sass-cache
+/connect.lock
+/coverage
+/libpeerconnection.log
+npm-debug.log
+testem.log
+/typings
+
+# e2e
+/e2e/*.js
+/e2e/*.map
+
+# System Files
+.DS_Store
+Thumbs.db
diff --git a/otf-frontend/client/config/.editorconfig b/otf-frontend/client/config/.editorconfig
new file mode 100644
index 0000000..a0e8f5a
--- /dev/null
+++ b/otf-frontend/client/config/.editorconfig
@@ -0,0 +1,13 @@
+# Editor configuration, see http://editorconfig.org
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 4
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.md]
+max_line_length = off
+trim_trailing_whitespace = false
diff --git a/otf-frontend/client/config/.travis.yml b/otf-frontend/client/config/.travis.yml
new file mode 100644
index 0000000..01e3108
--- /dev/null
+++ b/otf-frontend/client/config/.travis.yml
@@ -0,0 +1,14 @@
+language: node_js
+node_js:
+ - '9'
+ - '10'
+
+install:
+ - npm install
+
+script:
+ - npm run test-ci
+
+cache:
+ directories:
+ - node_modules
diff --git a/otf-frontend/client/config/karma.conf.js b/otf-frontend/client/config/karma.conf.js
new file mode 100644
index 0000000..3be39c4
--- /dev/null
+++ b/otf-frontend/client/config/karma.conf.js
@@ -0,0 +1,50 @@
+// Karma configuration file, see link for more information
+// https://karma-runner.github.io/1.0/config/configuration-file.html
+
+module.exports = function (config) {
+ const defaults = {
+ basePath: '',
+ frameworks: ['jasmine', '@angular-devkit/build-angular'],
+ plugins: [
+ require('karma-jasmine'),
+ require('karma-chrome-launcher'),
+ require('karma-jasmine-html-reporter'),
+ require('karma-coverage-istanbul-reporter'),
+ require('@angular-devkit/build-angular/plugins/karma')
+ ],
+ client:{
+ clearContext: false // leave Jasmine Spec Runner output visible in browser
+ },
+ coverageIstanbulReporter: {
+ dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
+ fixWebpackSourcePaths: true
+ },
+ angularCli: {
+ environment: 'dev'
+ },
+ reporters: ['progress', 'kjhtml'],
+ port: 9876,
+ colors: true,
+ logLevel: config.LOG_INFO,
+ autoWatch: true,
+ browsers: ['Chrome'],
+ singleRun: false,
+ }
+
+ if (process.env.TEST_CI) {
+ Object.assign(defaults, {
+ autoWatch: false,
+ browsers: ['ChromeHeadlessNoSandbox'],
+ singleRun: true,
+ customLaunchers: {
+ ChromeHeadlessNoSandbox: {
+ base: 'ChromeHeadless',
+ flags: ['--no-sandbox']
+ }
+ },
+ browserNoActivityTimeout: 60000,
+ })
+ }
+
+ config.set(defaults)
+};
diff --git a/otf-frontend/client/config/protractor.conf.js b/otf-frontend/client/config/protractor.conf.js
new file mode 100644
index 0000000..b1a56c1
--- /dev/null
+++ b/otf-frontend/client/config/protractor.conf.js
@@ -0,0 +1,28 @@
+// Protractor configuration file, see link for more information
+// https://github.com/angular/protractor/blob/master/lib/config.ts
+
+const { SpecReporter } = require('jasmine-spec-reporter');
+
+exports.config = {
+ allScriptsTimeout: 11000,
+ specs: [
+ './e2e/**/*.e2e-spec.ts'
+ ],
+ capabilities: {
+ 'browserName': 'chrome'
+ },
+ directConnect: true,
+ baseUrl: 'http://localhost:4200/',
+ framework: 'jasmine',
+ jasmineNodeOpts: {
+ showColors: true,
+ defaultTimeoutInterval: 30000,
+ print: function() {}
+ },
+ onPrepare() {
+ require('ts-node').register({
+ project: 'e2e/tsconfig.e2e.json'
+ });
+ jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
+ }
+};
diff --git a/otf-frontend/client/config/tsconfig.json b/otf-frontend/client/config/tsconfig.json
new file mode 100644
index 0000000..bcd2543
--- /dev/null
+++ b/otf-frontend/client/config/tsconfig.json
@@ -0,0 +1,19 @@
+{
+ "compileOnSave": false,
+ "compilerOptions": {
+ "outDir": "./dist/out-tsc",
+ "sourceMap": true,
+ "declaration": false,
+ "moduleResolution": "node",
+ "emitDecoratorMetadata": true,
+ "experimentalDecorators": true,
+ "target": "es5",
+ "typeRoots": [
+ "node_modules/@types"
+ ],
+ "lib": [
+ "es2017",
+ "dom"
+ ]
+ }
+}
diff --git a/otf-frontend/client/config/tslint.json b/otf-frontend/client/config/tslint.json
new file mode 100644
index 0000000..9e1157b
--- /dev/null
+++ b/otf-frontend/client/config/tslint.json
@@ -0,0 +1,139 @@
+{
+ "rulesDirectory": [
+ "../../node_modules/codelyzer"
+ ],
+ "rules": {
+ "arrow-return-shorthand": true,
+ "callable-types": true,
+ "class-name": true,
+ "comment-format": [
+ true,
+ "check-space"
+ ],
+ "curly": true,
+ "eofline": true,
+ "forin": true,
+ "import-blacklist": [
+ true
+ ],
+ "import-spacing": true,
+ "indent": [
+ true,
+ "spaces"
+ ],
+ "interface-over-type-literal": true,
+ "label-position": true,
+ "max-line-length": [
+ true,
+ 140
+ ],
+ "member-access": false,
+ "member-ordering": [
+ true,
+ {
+ "order": [
+ "static-field",
+ "instance-field",
+ "static-method",
+ "instance-method"
+ ]
+ }
+ ],
+ "no-arg": true,
+ "no-bitwise": true,
+ "no-console": [
+ true,
+ "debug",
+ "info",
+ "time",
+ "timeEnd",
+ "trace"
+ ],
+ "no-construct": true,
+ "no-debugger": true,
+ "no-duplicate-super": true,
+ "no-empty": false,
+ "no-empty-interface": true,
+ "no-eval": true,
+ "no-inferrable-types": [
+ true,
+ "ignore-params"
+ ],
+ "no-misused-new": true,
+ "no-non-null-assertion": true,
+ "no-shadowed-variable": true,
+ "no-string-literal": false,
+ "no-string-throw": true,
+ "no-switch-case-fall-through": true,
+ "no-trailing-whitespace": true,
+ "no-unnecessary-initializer": true,
+ "no-unused-expression": true,
+ "no-use-before-declare": true,
+ "no-var-keyword": true,
+ "object-literal-sort-keys": false,
+ "one-line": [
+ true,
+ "check-open-brace",
+ "check-catch",
+ "check-else",
+ "check-whitespace"
+ ],
+ "prefer-const": true,
+ "quotemark": [
+ true,
+ "single"
+ ],
+ "radix": true,
+ "semicolon": [
+ true,
+ "always"
+ ],
+ "triple-equals": [
+ true,
+ "allow-null-check"
+ ],
+ "typedef-whitespace": [
+ true,
+ {
+ "call-signature": "nospace",
+ "index-signature": "nospace",
+ "parameter": "nospace",
+ "property-declaration": "nospace",
+ "variable-declaration": "nospace"
+ }
+ ],
+ "typeof-compare": true,
+ "unified-signatures": true,
+ "variable-name": false,
+ "whitespace": [
+ true,
+ "check-branch",
+ "check-decl",
+ "check-operator",
+ "check-separator",
+ "check-type"
+ ],
+ "directive-selector": [
+ true,
+ "attribute",
+ "app",
+ "camelCase"
+ ],
+ "component-selector": [
+ true,
+ "element",
+ "app",
+ "kebab-case"
+ ],
+ "use-input-property-decorator": true,
+ "use-output-property-decorator": true,
+ "use-host-property-decorator": true,
+ "no-input-rename": true,
+ "no-output-rename": true,
+ "use-life-cycle-interface": true,
+ "use-pipe-transform-interface": true,
+ "component-class-suffix": true,
+ "directive-class-suffix": true,
+ "invoke-injectable": true
+ }
+}
diff --git a/otf-frontend/client/e2e/app.e2e-spec.ts b/otf-frontend/client/e2e/app.e2e-spec.ts
new file mode 100644
index 0000000..64bb730
--- /dev/null
+++ b/otf-frontend/client/e2e/app.e2e-spec.ts
@@ -0,0 +1,14 @@
+import { AppPage } from './app.po';
+
+describe('test-ng4 App', () => {
+ let page: AppPage;
+
+ beforeEach(() => {
+ page = new AppPage();
+ });
+
+ it('should display welcome message', () => {
+ page.navigateTo();
+ expect(page.getParagraphText()).toEqual('SB Admin BS4 Angular5');
+ });
+});
diff --git a/otf-frontend/client/e2e/app.po.ts b/otf-frontend/client/e2e/app.po.ts
new file mode 100644
index 0000000..625420f
--- /dev/null
+++ b/otf-frontend/client/e2e/app.po.ts
@@ -0,0 +1,11 @@
+import { browser, by, element } from 'protractor';
+
+export class AppPage {
+ navigateTo() {
+ return browser.get('/');
+ }
+
+ getParagraphText() {
+ return element(by.css('app-root h1')).getText();
+ }
+}
diff --git a/otf-frontend/client/e2e/tsconfig.e2e.json b/otf-frontend/client/e2e/tsconfig.e2e.json
new file mode 100644
index 0000000..a7da750
--- /dev/null
+++ b/otf-frontend/client/e2e/tsconfig.e2e.json
@@ -0,0 +1,14 @@
+{
+ "extends": "../config/tsconfig.json",
+ "compilerOptions": {
+ "outDir": "../out-tsc/e2e",
+ "baseUrl": "./",
+ "module": "commonjs",
+ "target": "es5",
+ "types": [
+ "jasmine",
+ "jasminewd2",
+ "node"
+ ]
+ }
+}
diff --git a/otf-frontend/client/src/app/access-denied/access-denied-routing.module.ts b/otf-frontend/client/src/app/access-denied/access-denied-routing.module.ts
new file mode 100644
index 0000000..23e7bcc
--- /dev/null
+++ b/otf-frontend/client/src/app/access-denied/access-denied-routing.module.ts
@@ -0,0 +1,32 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { AccessDeniedComponent } from './access-denied.component';
+
+const routes: Routes = [
+ {
+ path: '', component: AccessDeniedComponent
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class AccessDeniedRoutingModule {
+}
diff --git a/otf-frontend/client/src/app/access-denied/access-denied.component.html b/otf-frontend/client/src/app/access-denied/access-denied.component.html
new file mode 100644
index 0000000..ba588bd
--- /dev/null
+++ b/otf-frontend/client/src/app/access-denied/access-denied.component.html
@@ -0,0 +1,19 @@
+<!-- Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+#############################################################################-->
+
+
+<p>
+ access-denied works!
+</p>
diff --git a/otf-frontend/client/src/app/access-denied/access-denied.component.scss b/otf-frontend/client/src/app/access-denied/access-denied.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/access-denied/access-denied.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/access-denied/access-denied.component.spec.ts b/otf-frontend/client/src/app/access-denied/access-denied.component.spec.ts
new file mode 100644
index 0000000..249d493
--- /dev/null
+++ b/otf-frontend/client/src/app/access-denied/access-denied.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { AccessDeniedComponent } from './access-denied.component';
+
+describe('AccessDeniedComponent', () => {
+ let component: AccessDeniedComponent;
+ let fixture: ComponentFixture<AccessDeniedComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ AccessDeniedComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(AccessDeniedComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/access-denied/access-denied.component.ts b/otf-frontend/client/src/app/access-denied/access-denied.component.ts
new file mode 100644
index 0000000..070c3e9
--- /dev/null
+++ b/otf-frontend/client/src/app/access-denied/access-denied.component.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-access-denied',
+ templateUrl: './access-denied.component.html',
+ styleUrls: ['./access-denied.component.scss']
+})
+export class AccessDeniedComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+}
diff --git a/otf-frontend/client/src/app/access-denied/access-denied.module.spec.ts b/otf-frontend/client/src/app/access-denied/access-denied.module.spec.ts
new file mode 100644
index 0000000..e52e1ee
--- /dev/null
+++ b/otf-frontend/client/src/app/access-denied/access-denied.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { AccessDeniedModule } from './access-denied.module';
+
+describe('AccessDeniedModule', () => {
+ let accessDeniedModule: AccessDeniedModule;
+
+ beforeEach(() => {
+ accessDeniedModule = new AccessDeniedModule();
+ });
+
+ it('should create an instance', () => {
+ expect(accessDeniedModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/access-denied/access-denied.module.ts b/otf-frontend/client/src/app/access-denied/access-denied.module.ts
new file mode 100644
index 0000000..f914e1c
--- /dev/null
+++ b/otf-frontend/client/src/app/access-denied/access-denied.module.ts
@@ -0,0 +1,30 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+import { AccessDeniedRoutingModule } from './access-denied-routing.module';
+import { AccessDeniedComponent } from './access-denied.component';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ AccessDeniedRoutingModule
+ ],
+ declarations: [AccessDeniedComponent]
+})
+export class AccessDeniedModule { }
diff --git a/otf-frontend/client/src/app/account/account-routing.module.ts b/otf-frontend/client/src/app/account/account-routing.module.ts
new file mode 100644
index 0000000..695939d
--- /dev/null
+++ b/otf-frontend/client/src/app/account/account-routing.module.ts
@@ -0,0 +1,32 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { AccountComponent } from './account.component';
+
+
+const routes: Routes = [
+ {
+ path: '', component: AccountComponent
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class AccountRoutingModule { }
diff --git a/otf-frontend/client/src/app/account/account.component.html b/otf-frontend/client/src/app/account/account.component.html
new file mode 100644
index 0000000..b7e38af
--- /dev/null
+++ b/otf-frontend/client/src/app/account/account.component.html
@@ -0,0 +1,25 @@
+<!-- Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+#############################################################################-->
+
+
+<div class="account-page" [@routerTransition]>
+ <div class="row justify-content-md-center">
+ <div class="col-md-4">
+ <img src="assets/images/NetworkLogo.jpg" width="200px" class="user-avatar" />
+ <h1>Open Testing Framework</h1>
+ <h3 id="verifyMessage">{{message}}</h3>
+ </div>
+ </div>
+</div>
diff --git a/otf-frontend/client/src/app/account/account.component.scss b/otf-frontend/client/src/app/account/account.component.scss
new file mode 100644
index 0000000..0db25da
--- /dev/null
+++ b/otf-frontend/client/src/app/account/account.component.scss
@@ -0,0 +1,115 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+$topnav-background-color: #222;
+:host {
+ display: block;
+}
+.account-page {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ overflow: auto;
+ background: $topnav-background-color;
+ text-align: center;
+ color: #fff;
+ padding: 3em;
+ .col-lg-4 {
+ padding: 0;
+ }
+ .input-lg {
+ height: 46px;
+ padding: 10px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+ border-radius: 0;
+ }
+ .input-underline {
+ background: 0 0;
+ border: none;
+ box-shadow: none;
+ border-bottom: 2px solid rgba(255, 255, 255, 0.5);
+ color: #fff;
+ border-radius: 0;
+ }
+ .input-underline:focus {
+ border-bottom: 2px solid #fff;
+ box-shadow: none;
+ }
+ .rounded-btn {
+ -webkit-border-radius: 50px;
+ border-radius: 50px;
+ color: rgba(255, 255, 255, 0.8);
+ background: $topnav-background-color;
+ border: 2px solid rgba(255, 255, 255, 0.8);
+ font-size: 18px;
+ line-height: 40px;
+ padding: 0 25px;
+ }
+ .rounded-btn:hover,
+ .rounded-btn:focus,
+ .rounded-btn:active,
+ .rounded-btn:visited {
+ color: rgba(255, 255, 255, 1);
+ border: 2px solid rgba(255, 255, 255, 1);
+ outline: none;
+ }
+
+ h1 {
+ font-weight: 300;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ font-size: 36px;
+ small {
+ color: rgba(255, 255, 255, 0.7);
+ }
+ }
+
+ .form-group {
+ padding: 8px 0;
+ input::-webkit-input-placeholder {
+ color: rgba(255, 255, 255, 0.6) !important;
+ }
+
+ input:-moz-placeholder {
+ /* Firefox 18- */
+ color: rgba(255, 255, 255, 0.6) !important;
+ }
+
+ input::-moz-placeholder {
+ /* Firefox 19+ */
+ color: rgba(255, 255, 255, 0.6) !important;
+ }
+
+ input:-ms-input-placeholder {
+ color: rgba(255, 255, 255, 0.6) !important;
+ }
+ }
+ .form-content {
+ padding: 30px 0;
+ }
+ .user-avatar {
+ -webkit-border-radius: 50%;
+ border-radius: 50%;
+ border: 2px solid #fff;
+ }
+
+ #verifyMessage{
+ margin-top: 100px
+ }
+}
diff --git a/otf-frontend/client/src/app/account/account.component.spec.ts b/otf-frontend/client/src/app/account/account.component.spec.ts
new file mode 100644
index 0000000..b8b6b46
--- /dev/null
+++ b/otf-frontend/client/src/app/account/account.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { AccountComponent } from './account.component';
+
+describe('AccountComponent', () => {
+ let component: AccountComponent;
+ let fixture: ComponentFixture<AccountComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ AccountComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(AccountComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/account/account.component.ts b/otf-frontend/client/src/app/account/account.component.ts
new file mode 100644
index 0000000..a285598
--- /dev/null
+++ b/otf-frontend/client/src/app/account/account.component.ts
@@ -0,0 +1,60 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit } from '@angular/core';
+import {ActivatedRoute} from "@angular/router";
+import {AccountService} from "../shared/services/account.service";
+import { Router} from '@angular/router';
+import { routerTransition } from '../router.animations';
+
+
+@Component({
+ selector: 'app-account',
+ templateUrl: './account.component.html',
+ styleUrls: ['./account.component.scss'],
+ animations: [routerTransition()]
+
+})
+export class AccountComponent implements OnInit {
+ private action: string;
+ private token: string;
+ public message: string;
+ constructor(private router: Router, private route: ActivatedRoute, private accountService: AccountService) { }
+
+ ngOnInit() {
+ this.message = "";
+ this.action = this.route.snapshot.paramMap.get("action");
+ this.route.queryParamMap.subscribe(queryParams => {
+ this.token = queryParams.get("token");
+ });
+ if(this.action && this.token){
+ this.accountService.verify(this.token)
+ .subscribe(
+ data => {
+ this.message = "Thanks for verifying your email. You will be notified when your account is enabled by an admin."
+ },
+ error => {
+ this.router.navigate(['/dashboard']);
+ }
+ );
+ }
+ else{
+ this.router.navigate(['/dashboard']);
+ }
+
+ }
+
+}
diff --git a/otf-frontend/client/src/app/account/account.module.spec.ts b/otf-frontend/client/src/app/account/account.module.spec.ts
new file mode 100644
index 0000000..3c1abda
--- /dev/null
+++ b/otf-frontend/client/src/app/account/account.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { AccountModule } from './account.module';
+
+describe('AccountModule', () => {
+ let accountModule: AccountModule;
+
+ beforeEach(() => {
+ accountModule = new AccountModule();
+ });
+
+ it('should create an instance', () => {
+ expect(accountModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/account/account.module.ts b/otf-frontend/client/src/app/account/account.module.ts
new file mode 100644
index 0000000..c744693
--- /dev/null
+++ b/otf-frontend/client/src/app/account/account.module.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+import { AccountRoutingModule } from './account-routing.module';
+import { AccountComponent } from './account.component';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ AccountRoutingModule,
+ FormsModule
+ ],
+ declarations: [AccountComponent]
+})
+export class AccountModule { }
diff --git a/otf-frontend/client/src/app/app-routing.module.ts b/otf-frontend/client/src/app/app-routing.module.ts
new file mode 100644
index 0000000..03f22df
--- /dev/null
+++ b/otf-frontend/client/src/app/app-routing.module.ts
@@ -0,0 +1,39 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { AppComponent } from './app.component';
+import { AuthGuard } from './shared';
+
+const routes: Routes = [
+ { path: '', loadChildren: './layout/layout.module#LayoutModule', canActivate: [AuthGuard] },
+ { path: 'login', loadChildren: './login/login.module#LoginModule' },
+ { path: 'signup', loadChildren: './signup/signup.module#SignupModule' },
+ { path: 'error', loadChildren: './server-error/server-error.module#ServerErrorModule' },
+ { path: 'access-denied', loadChildren: './access-denied/access-denied.module#AccessDeniedModule' },
+ { path: 'not-found', loadChildren: './not-found/not-found.module#NotFoundModule' },
+ { path: 'account/:action', loadChildren: './account/account.module#AccountModule' },
+ { path: '**', redirectTo: 'not-found' }
+
+
+];
+
+@NgModule({
+ imports: [RouterModule.forRoot(routes)],
+ exports: [RouterModule]
+})
+export class AppRoutingModule {}
diff --git a/otf-frontend/client/src/app/app.component.html b/otf-frontend/client/src/app/app.component.html
new file mode 100644
index 0000000..9450cf2
--- /dev/null
+++ b/otf-frontend/client/src/app/app.component.html
@@ -0,0 +1,17 @@
+<!-- Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+#############################################################################-->
+
+
+<router-outlet></router-outlet>
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/app.component.scss b/otf-frontend/client/src/app/app.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/app.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/app.component.spec.ts b/otf-frontend/client/src/app/app.component.spec.ts
new file mode 100644
index 0000000..4236461
--- /dev/null
+++ b/otf-frontend/client/src/app/app.component.spec.ts
@@ -0,0 +1,47 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing'
+import { APP_BASE_HREF } from '@angular/common'
+
+import { AppComponent } from './app.component'
+import { AppModule } from './app.module'
+
+describe('AppComponent', () => {
+ let component: AppComponent
+ let fixture: ComponentFixture<AppComponent>
+
+ beforeEach(
+ async(() => {
+ TestBed.configureTestingModule({
+ imports: [AppModule],
+ providers: [
+ { provide: APP_BASE_HREF, useValue: '/' },
+ ]
+ }).compileComponents()
+ })
+ )
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(AppComponent)
+ component = fixture.componentInstance
+ fixture.detectChanges()
+ })
+
+ it('should create', () => {
+ expect(component).toBeTruthy()
+ })
+})
diff --git a/otf-frontend/client/src/app/app.component.ts b/otf-frontend/client/src/app/app.component.ts
new file mode 100644
index 0000000..bdd0c1d
--- /dev/null
+++ b/otf-frontend/client/src/app/app.component.ts
@@ -0,0 +1,35 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit } from '@angular/core';
+import { AppGlobals } from './app.global';
+
+
+@Component({
+ selector: 'app-root',
+ templateUrl: './app.component.html',
+ providers: [AppGlobals],
+ styleUrls: ['./app.component.scss']
+})
+export class AppComponent implements OnInit {
+
+ constructor() {
+
+ }
+
+ ngOnInit() {
+ }
+}
diff --git a/otf-frontend/client/src/app/app.global.ts b/otf-frontend/client/src/app/app.global.ts
new file mode 100644
index 0000000..5fde648
--- /dev/null
+++ b/otf-frontend/client/src/app/app.global.ts
@@ -0,0 +1,23 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from "@angular/core";
+import { HttpHeaders } from "@angular/common/http";
+
+export class AppGlobals {
+ public static baseAPIUrl: string = '/otf/api/v1/';
+ public static version: string = 'Camille.1.0';
+}
diff --git a/otf-frontend/client/src/app/app.module.spec.ts b/otf-frontend/client/src/app/app.module.spec.ts
new file mode 100644
index 0000000..eadbb3c
--- /dev/null
+++ b/otf-frontend/client/src/app/app.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { AppModule } from './app.module';
+
+describe('AppModule', () => {
+ let appModule: AppModule;
+
+ beforeEach(() => {
+ appModule = new AppModule();
+ });
+
+ it('should create an instance', () => {
+ expect(appModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/app.module.ts b/otf-frontend/client/src/app/app.module.ts
new file mode 100644
index 0000000..ff1baba
--- /dev/null
+++ b/otf-frontend/client/src/app/app.module.ts
@@ -0,0 +1,90 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {CommonModule} from '@angular/common';
+import {HTTP_INTERCEPTORS, HttpClient, HttpClientModule} from '@angular/common/http';
+import {NgModule} from '@angular/core';
+import {BrowserModule} from '@angular/platform-browser';
+import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
+import {TranslateLoader, TranslateModule} from '@ngx-translate/core';
+import {TranslateHttpLoader} from '@ngx-translate/http-loader';
+import {AppRoutingModule} from './app-routing.module';
+import {AppComponent} from './app.component';
+import {AuthGuard, AdminGuard, SharedPipesModule, PageHeaderModule} from './shared';
+import {FormsModule} from '@angular/forms';
+import {ListService} from './shared/services/list.service';
+import {MatButtonModule, MatDatepickerModule, MatDialogModule, MatIconModule, MatInputModule, MatRadioModule, MatMenu, MatMenuModule} from '@angular/material';
+import {AppGlobals} from './app.global';
+import {ErrorInterceptor} from './error.interceptor';
+import {CookieService} from 'ngx-cookie-service';
+import {NgxMaterialTimepickerModule} from 'ngx-material-timepicker';
+import { SocketIoModule, SocketIoConfig } from 'ngx-socket-io';
+import { FeathersService } from './shared/services/feathers.service';
+import { CoreModule } from './core/core.module';
+import { AbilityModule } from '@casl/angular'
+
+
+const config: SocketIoConfig = { url: '/', options: {transports: ['websocket']} };
+
+// AoT requires an exported function for factories
+export const createTranslateLoader = (http: HttpClient) => {
+ /* for development
+ return new TranslateHttpLoader(
+ http,
+ '/start-angular/SB-Admin-BS4-Angular-6/master/dist/assets/i18n/',
+ '.json'
+ ); */
+ return new TranslateHttpLoader(http, './assets/i18n/', '.json');
+};
+
+@NgModule({
+ imports: [
+ CommonModule,
+ BrowserModule,
+ FormsModule,
+ PageHeaderModule,
+ BrowserAnimationsModule,
+ HttpClientModule,
+ TranslateModule.forRoot({
+ loader: {
+ provide: TranslateLoader,
+ useFactory: createTranslateLoader,
+ deps: [HttpClient]
+ }
+ }),
+ AppRoutingModule,
+ SharedPipesModule,
+ NgxMaterialTimepickerModule.forRoot(),
+ MatButtonModule,
+ MatDialogModule,
+ MatRadioModule,
+ MatInputModule,
+ MatIconModule,
+ MatDatepickerModule,
+ SocketIoModule.forRoot(config),
+ CoreModule,
+ MatMenuModule,
+ AbilityModule.forRoot()
+ ],
+ declarations: [
+ AppComponent,
+ ],
+ providers: [
+ FeathersService, {provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true}, AuthGuard, AdminGuard, ListService, AppGlobals, CookieService],
+ bootstrap: [AppComponent]
+})
+export class AppModule {
+}
diff --git a/otf-frontend/client/src/app/core/core.module.spec.ts b/otf-frontend/client/src/app/core/core.module.spec.ts
new file mode 100644
index 0000000..201e873
--- /dev/null
+++ b/otf-frontend/client/src/app/core/core.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { CoreModule } from './core.module';
+
+describe('CoreModule', () => {
+ let coreModule: CoreModule;
+
+ beforeEach(() => {
+ coreModule = new CoreModule();
+ });
+
+ it('should create an instance', () => {
+ expect(coreModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/core/core.module.ts b/otf-frontend/client/src/app/core/core.module.ts
new file mode 100644
index 0000000..d050a07
--- /dev/null
+++ b/otf-frontend/client/src/app/core/core.module.ts
@@ -0,0 +1,56 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FeathersService } from 'app/shared/services/feathers.service';
+import { ModelService } from 'app/shared/services/model.service';
+import { TestDefinitionService } from 'app/shared/services/test-definition.service';
+import { TestHeadService } from 'app/shared/services/test-head.service';
+import { TestInstanceService } from 'app/shared/services/test-instance.service';
+import { TestExecutionService } from 'app/shared/services/test-execution.service';
+import { AccountService } from 'app/shared/services/account.service';
+import { AuthService } from 'app/shared/services/auth.service';
+import { ExecuteService } from 'app/shared/services/execute.service';
+import { FeedbackService } from 'app/shared/services/feedback.service';
+import { FileTransferService } from 'app/shared/services/file-transfer.service';
+import { FileService } from 'app/shared/services/file.service';
+import { GroupService } from 'app/shared/services/group.service';
+import { SchedulingService } from 'app/shared/services/scheduling.service';
+import { UserService } from 'app/shared/services/user.service';
+
+@NgModule({
+ imports: [
+ CommonModule
+ ],
+ providers: [
+ TestDefinitionService,
+ TestHeadService,
+ TestInstanceService,
+ TestExecutionService,
+ AccountService,
+ AuthService,
+ ExecuteService,
+ FeedbackService,
+ FileTransferService,
+ FileService,
+ GroupService,
+ SchedulingService,
+ UserService
+ ],
+ declarations: []
+})
+export class CoreModule { }
diff --git a/otf-frontend/client/src/app/error.interceptor.ts b/otf-frontend/client/src/app/error.interceptor.ts
new file mode 100644
index 0000000..85f10d0
--- /dev/null
+++ b/otf-frontend/client/src/app/error.interceptor.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from '@angular/core';
+import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
+import { Observable, throwError } from 'rxjs';
+import { catchError } from 'rxjs/operators';
+import { Router } from '@angular/router';
+import { AuthService } from './shared/services/auth.service';
+
+
+@Injectable()
+export class ErrorInterceptor implements HttpInterceptor {
+ constructor(private auth: AuthService, private router: Router) {}
+
+ intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
+ return next.handle(request).pipe(catchError(err => {
+ if (err.status === 401) {
+ // auto logout if 401 response returned from api
+ this.auth.logout();
+ this.router.navigateByUrl('/login');
+ }
+
+ const error = err.error.message || err.statusText;
+ return throwError(error);
+ }))
+ }
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/components/header/header.component.html b/otf-frontend/client/src/app/layout/components/header/header.component.html
new file mode 100644
index 0000000..81f8614
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/header/header.component.html
@@ -0,0 +1,111 @@
+<!-- Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+#############################################################################-->
+
+
+<nav class="navbar navbar-expand-lg fixed-top">
+ <img src="../../../../assets/images/NetworkLogo.jpg" class="rounded-circle mr-2" style="width:40px; height: 40px;" />
+ <a class="navbar-brand" href="#">Open Test Framework</a>
+ <span *ngIf="groups">
+ <button mat-button style="color:white" #goupMenuTrigger="matMenuTrigger" [matMenuTriggerFor]="groupMenu">{{ selectedGroup?.groupName || 'Select Group' }} <mat-icon>arrow_drop_down</mat-icon></button>
+ <mat-menu #groupMenu="matMenu">
+ <span style="margin-left: 15px; cursor: pointer; color: #007bff" (click)="createGroup()">+ New Group</span>
+ <span *ngFor="let group of groups">
+ <!-- Handle branch node buttons here -->
+ <span *ngIf="group.children && group.children.length > 0" style="z-index:1031">
+ <button mat-menu-item [matMenuTriggerFor]="menu.childMenu" (click)="changeGroup(group)" [disabled]="group.disabled">
+ {{group.displayName}}
+ </button>
+ <app-menu-item #menu [items]="group.children" (dataEvent)="changeGroup($event)"></app-menu-item>
+ </span>
+ <!-- Leaf node buttons here -->
+ <span *ngIf="!group.children || group.children.length === 0" style="z-index:1031">
+ <button mat-menu-item color="primary" (click)="changeGroup(group)">
+ {{group.displayName}}
+ </button>
+ </span>
+ </span>
+ </mat-menu>
+ </span>
+ <button class="navbar-toggler" type="button" (click)="toggleSidebar()">
+ <!-- <span class="navbar-toggler-icon"></span> -->
+ <i class="fa fa-bars text-muted" aria-hidden="true"></i>
+ </button>
+ <div class="collapse navbar-collapse">
+ <ul class="navbar-nav ml-auto">
+ <!-- <li class="nav-item dropdown" ngbDropdown>
+ <a href="javascript:void(0)" class="nav-link" ngbDropdownToggle>
+ <i class="fa fa-language"></i> {{ 'Language' | translate }} <b class="caret"></b>
+ </a>
+ <div class="dropdown-menu-right" ngbDropdownMenu>
+ <a class="dropdown-item" href="javascript:void(0)" (click)="changeLang('en')">
+ {{ 'English' | translate }}
+ </a>
+ <a class="dropdown-item" href="javascript:void(0)" (click)="changeLang('fr')">
+ {{ 'French' | translate }}
+ </a>
+ <a class="dropdown-item" href="javascript:void(0)" (click)="changeLang('ur')">
+ {{ 'Urdu' | translate }}
+ </a>
+ <a class="dropdown-item" href="javascript:void(0)" (click)="changeLang('es')">
+ {{ 'Spanish' | translate }}
+ </a>
+ <a class="dropdown-item" href="javascript:void(0)" (click)="changeLang('it')">
+ {{ 'Italian' | translate }}
+ </a>
+ <a class="dropdown-item" href="javascript:void(0)" (click)="changeLang('fa')">
+ {{ 'Farsi' | translate }}
+ </a>
+ <a class="dropdown-item" href="javascript:void(0)" (click)="changeLang('de')">
+ {{ 'German' | translate }}
+ </a>
+ <a class="dropdown-item" href="javascript:void(0)" (click)="changeLang('zh-CHS')">
+ {{ 'Simplified Chinese' | translate }}
+ </a>
+ </div>
+ </li> -->
+ <!--<li *ngIf="groups && selectedGroup">
+ <span *ngFor="let group of groups">
+ <!-- Handle branch node buttons here --
+ <span *ngIf="group.children && group.children.length > 0" style="z-index:1031">
+ <button mat-button [matMenuTriggerFor]="menu.childMenu" [disabled]="group.disabled">
+ {{group.displayName}}
+ </button>
+ <app-menu-item #menu [items]="group.children"></app-menu-item>
+ </span>
+ <!-- Leaf node buttons here --
+ <span *ngIf="!group.children || group.children.length === 0" style="z-index:1031">
+ <button mat-button color="primary" (click)="group.click()">
+ {{group.displayName}}
+ </button>
+ </span>
+ </span>
+ </li> -->
+ <li class="nav-item dropdown" ngbDropdown>
+ <a href="javascript:void(0)" class="nav-link" ngbDropdownToggle>
+ <i class="fa fa-user"></i> {{username}} <b class="caret"></b>
+ </a>
+ <div class="dropdown-menu-right" ngbDropdownMenu>
+ <a class="dropdown-item" [routerLink]="['/settings']" >
+ <i class="fa fa-fw fa-cog"></i> {{ 'Settings' | translate }}
+ </a>
+ <a class="dropdown-item" [routerLink]="['/login']" (click)="onLoggedout()">
+ <i class="fa fa-fw fa-power-off"></i> {{ 'Log Out' | translate }}
+ </a>
+ </div>
+ </li>
+ </ul>
+ </div>
+ </nav>
+
diff --git a/otf-frontend/client/src/app/layout/components/header/header.component.scss b/otf-frontend/client/src/app/layout/components/header/header.component.scss
new file mode 100644
index 0000000..591097a
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/header/header.component.scss
@@ -0,0 +1,62 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+$topnav-background-color: #045C87;
+
+:host {
+ .navbar {
+
+ background-color: $topnav-background-color;
+ .navbar-brand {
+ color: #fff;
+ font-size: 1.5em !important;
+ }
+ .nav-item > a {
+ color: #fff;
+ &:hover {
+ color: lighten($topnav-background-color, 50%);
+ }
+ }
+ }
+ .messages {
+ width: 300px;
+ .media {
+ border-bottom: 1px solid #ddd;
+ padding: 5px 10px;
+ &:last-child {
+ border-bottom: none;
+ }
+ }
+ .media-body {
+ h5 {
+ font-size: 13px;
+ font-weight: 600;
+ }
+ .small {
+ margin: 0;
+ }
+ .last {
+ font-size: 12px;
+ margin: 0;
+ }
+ }
+ }
+}
+.my-class{
+ line-height: 25px;
+ height: 25px!important;
+ min-height: unset!important;
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/components/header/header.component.spec.ts b/otf-frontend/client/src/app/layout/components/header/header.component.spec.ts
new file mode 100644
index 0000000..8d9d5ef
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/header/header.component.spec.ts
@@ -0,0 +1,48 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing'
+import { RouterTestingModule } from '@angular/router/testing'
+import { TranslateModule } from '@ngx-translate/core'
+
+import { HeaderComponent } from './header.component'
+import { LayoutModule } from '../../layout.module'
+
+describe('HeaderComponent', () => {
+ let component: HeaderComponent
+ let fixture: ComponentFixture<HeaderComponent>
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ imports: [
+ LayoutModule,
+ RouterTestingModule,
+ TranslateModule.forRoot(),
+ ],
+ })
+ .compileComponents()
+ }))
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(HeaderComponent)
+ component = fixture.componentInstance
+ fixture.detectChanges()
+ })
+
+ it('should create', () => {
+ expect(component).toBeTruthy()
+ })
+})
diff --git a/otf-frontend/client/src/app/layout/components/header/header.component.ts b/otf-frontend/client/src/app/layout/components/header/header.component.ts
new file mode 100644
index 0000000..924d50e
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/header/header.component.ts
@@ -0,0 +1,205 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { Router, NavigationEnd } from '@angular/router';
+import { TranslateService } from '@ngx-translate/core';
+import { AuthService } from 'app/shared/services/auth.service';
+import { CookieService } from 'ngx-cookie-service';
+import { GroupService } from 'app/shared/services/group.service';
+import { UserService } from 'app/shared/services/user.service';
+//import { group } from '@angular/animations';
+import { CreateGroupModalComponent } from 'app/shared/modules/create-group-modal/create-group-modal.component';
+import { MatDialog } from '@angular/material/dialog';
+import { NavItem } from 'app/shared/components/menu-item/menu-item.component';
+import { MatMenuTrigger } from '@angular/material';
+
+
+@Component({
+ selector: 'app-header',
+ templateUrl: './header.component.html',
+ styleUrls: ['./header.component.scss']
+})
+
+export class HeaderComponent implements OnInit {
+ pushRightClass: string = 'push-right';
+ myStyle: object = {};
+ myParams: object = {};
+ width: number = 100;
+ height: number = 100;
+
+ public groups: Array<NavItem>;
+ public selectedGroup;
+
+ @ViewChild('goupMenuTrigger') groupMenu: MatMenuTrigger;
+
+
+ constructor(
+ private translate: TranslateService,
+ public router: Router,
+ private auth: AuthService,
+ private cookie: CookieService,
+ public _groups: GroupService,
+ private user: UserService,
+ private modal: MatDialog
+
+ ) {
+
+ this.translate.addLangs(['en', 'fr', 'ur', 'es', 'it', 'fa', 'de', 'zh-CHS']);
+ this.translate.setDefaultLang('en');
+ const browserLang = this.translate.getBrowserLang();
+ this.translate.use(browserLang.match(/en|fr|ur|es|it|fa|de|zh-CHS/) ? browserLang : 'en');
+
+
+ this.router.events.subscribe(val => {
+ if (
+ val instanceof NavigationEnd &&
+ window.innerWidth <= 992 &&
+ this.isToggled()
+ ) {
+ this.toggleSidebar();
+ }
+ });
+ }
+ public currentUser;// = {};
+ public username;
+
+
+ ngOnInit() {
+
+
+ this.currentUser = JSON.parse(this.cookie.get('currentUser'));
+ this.username = this.currentUser["firstName"] + " " + this.currentUser["lastName"];
+
+
+
+ this._groups.setUp();
+
+ this._groups.listChange().subscribe(res => {
+ this.groups = res;
+ });
+
+ // if (!window.localStorage.getItem("currentGroupId"))
+ // {
+ // if (!(this.currentUser.defaultGroup)){
+ // let userPatch = {
+ // _id : this.currentUser._id,
+ // defaultGroup : this.currentUser.groups[0].groupId,
+ // defaultGroupEnabled: false
+ // };
+
+ // this.user.patch(userPatch).subscribe((res) => {
+ // console.log(res)
+ // console.log("Created first default group for user. Default group has been added!")
+ // })
+
+ // }
+ // else {
+
+ // this._groups.setGroup({_id: this.currentUser.defaultGroup})
+
+ // }
+ // }
+
+ //this._groups.setUp();
+
+ this._groups.listChange().subscribe(res => {
+ res = this._groups.format(res);
+ //set menu fields
+ this.setNavFields(res);
+ this.groups = res as Array<NavItem>;
+ });
+
+ this._groups.groupChange().subscribe(res => {
+
+ this.selectedGroup = res;
+ });
+
+ }
+
+ setNavFields(groups){
+ groups.forEach((elem, val) => {
+ groups[val].displayName = elem.groupName;
+ this.setNavFields(groups[val].children);
+ });
+ }
+
+ print(){
+
+ }
+
+ changeGroup(group) {
+ this.groupMenu.closeMenu();
+ // Patch to add update Default Group
+
+ // If the Default Group Enabled does not exist (users havent saved a default group)
+ if (!this.currentUser.defaultGroupEnabled)
+ {
+ let userPatch = {
+ _id : this.currentUser._id,
+ defaultGroup: group._id
+ };
+
+ this.user.patch(userPatch).subscribe((res) =>{
+
+
+ })
+ }
+ // If the default Group Enabled exists (Users saved a default group)
+ else{
+
+ //Take the default group from the user input
+ }
+
+
+
+ this._groups.setGroup(group);
+
+ }
+
+ createGroup(){
+ this.modal.open(CreateGroupModalComponent, {
+ width: '50%'
+ }).afterClosed().subscribe((result) => {
+ if(result){
+ this.groups.push(result);
+ }
+ });
+ }
+
+ isToggled(): boolean {
+ const dom: Element = document.querySelector('body');
+ return dom.classList.contains(this.pushRightClass);
+ }
+
+ toggleSidebar() {
+ const dom: any = document.querySelector('body');
+ dom.classList.toggle(this.pushRightClass);
+ }
+
+ rltAndLtr() {
+ const dom: any = document.querySelector('body');
+ dom.classList.toggle('rtl');
+ }
+
+ onLoggedout() {
+ this.auth.logout();
+ }
+
+ changeLang(language: string) {
+ this.translate.use(language);
+ }
+}
diff --git a/otf-frontend/client/src/app/layout/components/right-sidebar/right-sidebar.component.html b/otf-frontend/client/src/app/layout/components/right-sidebar/right-sidebar.component.html
new file mode 100644
index 0000000..a664a3c
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/right-sidebar/right-sidebar.component.html
@@ -0,0 +1,26 @@
+<!-- Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+#############################################################################-->
+
+
+<nav class="sidebar">
+ <div class="list-group">
+ <a routerLink="/dashboard" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-dashboard"></i>No
+ </a>
+ <a routerLink="/onboarding" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-user"></i>Yes
+ </a>
+ </div>
+</nav>
diff --git a/otf-frontend/client/src/app/layout/components/right-sidebar/right-sidebar.component.scss b/otf-frontend/client/src/app/layout/components/right-sidebar/right-sidebar.component.scss
new file mode 100644
index 0000000..66102b3
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/right-sidebar/right-sidebar.component.scss
@@ -0,0 +1,176 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+$topnav-background-color: #000;
+.sidebar {
+ display: none;
+ font-size: 1em;
+ border-radius: 0;
+ position: fixed;
+ z-index: 1000;
+ top: 56px;
+ right: 235px;
+ width: 235px;
+ margin-right: -235px;
+ border: none;
+ border-radius: 0;
+ overflow-y: auto;
+ background-color: $topnav-background-color;
+ bottom: 43px;
+ overflow-x: hidden;
+ padding-bottom: 40px;
+ -webkit-transition: all 0.2s ease-in-out;
+ -moz-transition: all 0.2s ease-in-out;
+ -ms-transition: all 0.2s ease-in-out;
+ -o-transition: all 0.2s ease-in-out;
+ transition: all 0.2s ease-in-out;
+ // border-top: 1px solid rgba(255,255,255,0.3);
+ .list-group {
+ a.list-group-item {
+ background: $topnav-background-color;
+ border: 0;
+ border-radius: 0;
+ color: #999;
+ text-decoration: none;
+ .fa {
+ margin-right: 10px;
+ }
+ }
+ a:hover {
+ background: lighten($topnav-background-color, 10%);
+ color: #fff;
+ }
+ a.router-link-active {
+ background: lighten($topnav-background-color, 10%);
+ color: #fff;
+ }
+ .header-fields {
+ padding-top: 10px;
+
+ > .list-group-item:first-child {
+ border-top: 1px solid rgba(255, 255, 255, 0.2);
+ }
+ }
+ }
+ .sidebar-dropdown {
+ *:focus {
+ border-radius: none;
+ border: none;
+ }
+ .panel-title {
+ font-size: 1rem;
+ height: 50px;
+ margin-bottom: 0;
+ a {
+ color: #999;
+ text-decoration: none;
+ font-weight: 400;
+ background: $topnav-background-color;
+ span {
+ position: relative;
+ display: block;
+ padding: 0.75rem 1.5rem;
+ padding-top: 1rem;
+ }
+ }
+ a:hover,
+ a:focus {
+ color: #fff;
+ outline: none;
+ outline-offset: -2px;
+ }
+ }
+ .panel-title:hover {
+ background: lighten($topnav-background-color, 10%);
+ }
+ .panel-collapse {
+ border-radious: 0;
+ border: none;
+ .panel-body {
+ .list-group-item {
+ border-radius: 0;
+ background-color: $topnav-background-color;
+ border: 0 solid transparent;
+ a {
+ color: #999;
+ }
+ a:hover {
+ color: #fff;
+ }
+ }
+ .list-group-item:hover {
+ background: lighten($topnav-background-color, 10%);
+ }
+ }
+ }
+ }
+}
+.nested-menu {
+ .list-group-item {
+ cursor: pointer;
+ }
+ .nested {
+ list-style-type: none;
+ }
+ ul.submenu {
+ display: none;
+ height: 0;
+ }
+ & .expand {
+ ul.submenu {
+ display: block;
+ list-style-type: none;
+ height: auto;
+ li {
+ a {
+ color: #fff;
+ padding: 10px;
+ display: block;
+ }
+ }
+ }
+ }
+}
+@media screen and (max-width: 992px) {
+ .sidebar {
+ top: 54px;
+ left: 0px;
+ }
+}
+@media print {
+ .sidebar {
+ display: none !important;
+ }
+}
+@media (min-width: 992px) {
+ .header-fields {
+ display: none;
+ }
+}
+
+::-webkit-scrollbar {
+ width: 8px;
+}
+
+::-webkit-scrollbar-track {
+ -webkit-box-shadow: inset 0 0 0px rgba(255, 255, 255, 1);
+ border-radius: 3px;
+}
+
+::-webkit-scrollbar-thumb {
+ border-radius: 3px;
+ -webkit-box-shadow: inset 0 0 3px rgba(255, 255, 255, 1);
+}
diff --git a/otf-frontend/client/src/app/layout/components/right-sidebar/right-sidebar.component.spec.ts b/otf-frontend/client/src/app/layout/components/right-sidebar/right-sidebar.component.spec.ts
new file mode 100644
index 0000000..bce5b0d
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/right-sidebar/right-sidebar.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { RightSidebarComponent } from './right-sidebar.component';
+
+describe('RightSidebarComponent', () => {
+ let component: RightSidebarComponent;
+ let fixture: ComponentFixture<RightSidebarComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ RightSidebarComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(RightSidebarComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/components/right-sidebar/right-sidebar.component.ts b/otf-frontend/client/src/app/layout/components/right-sidebar/right-sidebar.component.ts
new file mode 100644
index 0000000..cf800fa
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/right-sidebar/right-sidebar.component.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-right-sidebar',
+ templateUrl: './right-sidebar.component.html',
+ styleUrls: ['./right-sidebar.component.scss']
+})
+export class RightSidebarComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/components/sidebar/sidebar.component.html b/otf-frontend/client/src/app/layout/components/sidebar/sidebar.component.html
new file mode 100644
index 0000000..8f38669
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/sidebar/sidebar.component.html
@@ -0,0 +1,160 @@
+<!-- Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+#############################################################################-->
+
+
+<nav class="sidebar" [ngClass]="{sidebarPushRight: isActive}">
+ <div class="list-group">
+ <a routerLink="/dashboard" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-dashboard"></i> {{ 'Dashboard' | translate }}
+ </a>
+
+ <a [routerLink]="['/test-definitions']" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-object-group"></i> {{ 'Test Definitions' | translate }}
+ </a>
+ <!--<div class="nested-menu">
+ <a class="list-group-item" (click)="addExpandClass('definition')">
+ <span><i class="fa fa-fw fa-object-group"></i> {{ 'Test Definitions' | translate }}</span>
+ </a>
+ <li class="nested" [class.expand]="showMenu === 'definition'">
+ <ul class="submenu">
+ <li>
+ <a [routerLink]="['/test-definitions']" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-list-ul"></i> {{ 'Collection' | translate }}
+ </a>
+ </li>
+ <li>
+ <a [routerLink]="['/modeler']" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa bpmn-icon-bpmn-io"></i> {{ 'BPMN Modeler' | translate }}
+ </a>
+ </li>
+ </ul>
+ </div> -->
+ <a [routerLink]="['/test-instances']" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-clone"></i> {{ 'Test Instances' | translate }}
+ </a>
+ <!--<a [routerLink]="['/test-executions']" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-bolt"></i> {{ 'Test Executions' | translate }}
+ </a>
+ <a routerLink="/onboarding" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-user"></i> {{ 'Onboarding' | translate }}
+ </a>-->
+ <!--<div class="nested-menu">
+ <a class="list-group-item" (click)="addExpandClass('pages1')">
+ <span><i class="fa fa-fw fa-user"></i> {{ 'Onboarding' | translate }}</span>
+ </a>
+ <li class="nested" [class.expand]="showMenu === 'pages1'">
+ <ul class="submenu">
+ <li>
+ <a [routerLink]="['/onboarding/test-head']" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-gears"></i> {{ 'Onboard Test Head' | translate }}
+ </a>
+ </li>
+ <li>
+ <a [routerLink]="['/onboarding/test-definition']" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-object-group"></i> {{ 'Onboard Test Definition' | translate }}
+ </a>
+ </li>
+ <li>
+ <a [routerLink]="['/onboarding/test-instances']" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-clone"></i> {{ 'Create Test Instance' | translate }}
+ </a>
+ </li>
+ </ul>
+ </li>
+ </div> -->
+ <div class="nested-menu">
+ <a class="list-group-item" (click)="addExpandClass('pages2')">
+ <span><i class="fa fa-folder"></i> {{ 'Resources' | translate }}</span>
+ </a>
+ <li class="nested" [class.expand]="showMenu === 'pages2'">
+ <ul class="submenu">
+ <li>
+ <a [routerLink]="['/test-heads']" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-gears"></i> {{ 'Virtual Test Heads' | translate }}
+ </a>
+ </li>
+ <!--<li>
+ <a [routerLink]="['/test-definitions']" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-object-group"></i> {{ 'Test Definitions' | translate }}
+ </a>
+ </li>
+ <li>
+ <a [routerLink]="['/test-instances']" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-clone"></i> {{ 'Test Instances' | translate }}
+ </a>
+ </li>
+ <li>
+ <a [routerLink]="['/test-executions']" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-bolt"></i> {{ 'Test Executions' | translate }}
+ </a>
+ </li>-->
+ </ul>
+ </div>
+ <!--<a routerLink="/scheduling" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-calendar"></i> {{ 'Scheduling' | translate }}
+ </a>-->
+ <a [routerLink]="['/modeler']" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa bpmn-icon-bpmn-io"></i> Test Designer <small style="color: green">beta</small>
+ </a>
+ <a *ngIf="canManageGroup" [routerLink]="['/manage-group']" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-group"></i> {{ 'Manage Group' | translate }}
+ </a>
+ <a [routerLink]="['/feedback']" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-comment-o"></i> {{ 'Feedback' | translate }}
+ </a>
+
+
+ <div *ngIf="checkIsAdmin()" class="nested-menu">
+ <a class="list-group-item" (click)="addExpandClass('admin')">
+ <span><i class="fa fa-fw fa-shield"></i> {{ 'Admin' | translate }}</span>
+ </a>
+ <li class="nested" [class.expand]="showMenu === 'admin'">
+ <ul class="submenu">
+ <li>
+ <a [routerLink]="['/user-management']" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-user"></i> {{ 'User Management' | translate }}
+ </a>
+ </li>
+ </ul>
+ </div>
+ <!--<div class="nested-menu">
+ <a class="list-group-item" (click)="addExpandClass('pages3')">
+ <span><i class="fa fa-fw fa-users"></i> {{ 'Manage Group' | translate }}</span>
+ </a>
+ <li class="nested" [class.expand]="showMenu === 'pages3'">
+ <ul class="submenu">
+ <li>
+ <a [routerLink]="['/manageGroupUsers']" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-user"></i> {{ 'User Management' | translate }}
+ </a>
+ </li>
+ <li>
+ <a [routerLink]="['/manageGroup']" [routerLinkActive]="['router-link-active']" class="list-group-item">
+ <i class="fa fa-fw fa-object-group"></i> {{ 'Manage Group' | translate }}
+ </a>
+ </li>
+
+ </ul>
+ </div> -->
+
+ <a style="position:absolute; bottom: 80px; width: 100%" class="list-group-item" (click)="setHealthStatus()">
+ TCU Engine <small *ngIf="tcuengine" style="color:green">Running</small><small *ngIf="!tcuengine" style="color: red">Down</small>
+ </a>
+ <a style="position:absolute; bottom: 40px; width: 100%" class="list-group-item" (click)="setHealthStatus()">
+ TCU API <small *ngIf="tcuapi" style="color:green">Running</small><small *ngIf="!tcuapi" style="color: red">Down</small>
+ </a>
+ <a style="position:absolute; bottom: 0px; width:100%" class="list-group-item"> {{version}} </a>
+ </div>
+</nav>
diff --git a/otf-frontend/client/src/app/layout/components/sidebar/sidebar.component.scss b/otf-frontend/client/src/app/layout/components/sidebar/sidebar.component.scss
new file mode 100644
index 0000000..427e2f4
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/sidebar/sidebar.component.scss
@@ -0,0 +1,175 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+$topnav-background-color: #000;
+.sidebar {
+ font-size: 1em;
+ border-radius: 0;
+ position: fixed;
+ z-index: 1000;
+ top: 56px;
+ left: 235px;
+ width: 235px;
+ margin-left: -235px;
+ border: none;
+ border-radius: 0;
+ overflow-y: auto;
+ background-color: $topnav-background-color;
+ bottom: 0;
+ overflow-x: hidden;
+ padding-bottom: 40px;
+ -webkit-transition: all 0.2s ease-in-out;
+ -moz-transition: all 0.2s ease-in-out;
+ -ms-transition: all 0.2s ease-in-out;
+ -o-transition: all 0.2s ease-in-out;
+ transition: all 0.2s ease-in-out;
+ // border-top: 1px solid rgba(255,255,255,0.3);
+ .list-group {
+ a.list-group-item {
+ background: $topnav-background-color;
+ border: 0;
+ border-radius: 0;
+ color: #999;
+ text-decoration: none;
+ .fa {
+ margin-right: 10px;
+ }
+ }
+ a:hover {
+ background: lighten($topnav-background-color, 10%);
+ color: #fff;
+ }
+ a.router-link-active {
+ background: lighten($topnav-background-color, 10%);
+ color: #fff;
+ }
+ .header-fields {
+ padding-top: 10px;
+
+ > .list-group-item:first-child {
+ border-top: 1px solid rgba(255, 255, 255, 0.2);
+ }
+ }
+ }
+ .sidebar-dropdown {
+ *:focus {
+ border-radius: none;
+ border: none;
+ }
+ .panel-title {
+ font-size: 1rem;
+ height: 50px;
+ margin-bottom: 0;
+ a {
+ color: #999;
+ text-decoration: none;
+ font-weight: 400;
+ background: $topnav-background-color;
+ span {
+ position: relative;
+ display: block;
+ padding: 0.75rem 1.5rem;
+ padding-top: 1rem;
+ }
+ }
+ a:hover,
+ a:focus {
+ color: #fff;
+ outline: none;
+ outline-offset: -2px;
+ }
+ }
+ .panel-title:hover {
+ background: lighten($topnav-background-color, 10%);
+ }
+ .panel-collapse {
+ border-radious: 0;
+ border: none;
+ .panel-body {
+ .list-group-item {
+ border-radius: 0;
+ background-color: $topnav-background-color;
+ border: 0 solid transparent;
+ a {
+ color: #999;
+ }
+ a:hover {
+ color: #fff;
+ }
+ }
+ .list-group-item:hover {
+ background: lighten($topnav-background-color, 10%);
+ }
+ }
+ }
+ }
+}
+.nested-menu {
+ .list-group-item {
+ cursor: pointer;
+ }
+ .nested {
+ list-style-type: none;
+ }
+ ul.submenu {
+ display: none;
+ height: 0;
+ }
+ & .expand {
+ ul.submenu {
+ display: block;
+ list-style-type: none;
+ height: auto;
+ li {
+ a {
+ color: #fff;
+ padding: 10px;
+ display: block;
+ }
+ }
+ }
+ }
+}
+@media screen and (max-width: 992px) {
+ .sidebar {
+ top: 54px;
+ left: 0px;
+ }
+}
+@media print {
+ .sidebar {
+ display: none !important;
+ }
+}
+@media (min-width: 992px) {
+ .header-fields {
+ display: none;
+ }
+}
+
+::-webkit-scrollbar {
+ width: 8px;
+}
+
+::-webkit-scrollbar-track {
+ -webkit-box-shadow: inset 0 0 0px rgba(255, 255, 255, 1);
+ border-radius: 3px;
+}
+
+::-webkit-scrollbar-thumb {
+ border-radius: 3px;
+ -webkit-box-shadow: inset 0 0 3px rgba(255, 255, 255, 1);
+}
diff --git a/otf-frontend/client/src/app/layout/components/sidebar/sidebar.component.spec.ts b/otf-frontend/client/src/app/layout/components/sidebar/sidebar.component.spec.ts
new file mode 100644
index 0000000..994bb5e
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/sidebar/sidebar.component.spec.ts
@@ -0,0 +1,48 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing'
+import { RouterTestingModule } from '@angular/router/testing'
+import { TranslateModule } from '@ngx-translate/core'
+
+import { SidebarComponent } from './sidebar.component'
+import { LayoutModule } from '../../layout.module'
+
+describe('SidebarComponent', () => {
+ let component: SidebarComponent
+ let fixture: ComponentFixture<SidebarComponent>
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ imports: [
+ LayoutModule,
+ RouterTestingModule,
+ TranslateModule.forRoot(),
+ ],
+ })
+ .compileComponents()
+ }))
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SidebarComponent)
+ component = fixture.componentInstance
+ fixture.detectChanges()
+ })
+
+ it('should create', () => {
+ expect(component).toBeTruthy()
+ })
+})
diff --git a/otf-frontend/client/src/app/layout/components/sidebar/sidebar.component.ts b/otf-frontend/client/src/app/layout/components/sidebar/sidebar.component.ts
new file mode 100644
index 0000000..8034055
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/sidebar/sidebar.component.ts
@@ -0,0 +1,147 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit } from '@angular/core';
+import { Router, NavigationEnd } from '@angular/router';
+import { TranslateService } from '@ngx-translate/core';
+import { AppGlobals } from 'app/app.global';
+import {CookieService} from "ngx-cookie-service";
+import { HealthService } from 'app/shared/services/health.service';
+import { UserService } from 'app/shared/services/user.service';
+import { GroupService } from 'app/shared/services/group.service';
+import { Group, Groups } from 'app/shared/models/group.model';
+
+@Component({
+ selector: 'app-sidebar',
+ templateUrl: './sidebar.component.html',
+ styleUrls: ['./sidebar.component.scss']
+})
+export class SidebarComponent implements OnInit {
+ isActive: boolean = false;
+ showMenu: string = '';
+ pushRightClass: string = 'push-right';
+ version = AppGlobals.version
+ tcuapi: boolean;
+ tcuengine: boolean;
+ isAdmin: boolean = false;
+
+ canManageGroup = false;
+
+ currentGroupId;
+
+ constructor(private translate: TranslateService, public router: Router, public user: UserService, private health: HealthService, private cookie: CookieService, public group: GroupService) {
+ this.translate.addLangs(['en', 'fr', 'ur', 'es', 'it', 'fa', 'de']);
+ this.translate.setDefaultLang('en');
+ const browserLang = this.translate.getBrowserLang();
+ this.translate.use(browserLang.match(/en|fr|ur|es|it|fa|de/) ? browserLang : 'en');
+ this.checkIsAdmin();
+ this.router.events.subscribe(val => {
+ if (
+ val instanceof NavigationEnd &&
+ window.innerWidth <= 992 &&
+ this.isToggled()
+ ) {
+ this.toggleSidebar();
+ }
+ });
+ }
+
+ ngOnInit(){
+ if(this.group.getGroup()){
+ this.checkManage(this.group.getGroup());
+ }
+ this.group.groupChange().subscribe(group => {
+ this.checkManage(group);
+ })
+ this.setHealthStatus();
+ }
+
+ checkManage(group){
+ this.canManageGroup = this.user.ability.can('management', new Groups(group));
+ }
+
+ setHealthStatus(){
+ this.health.get('tcu-api').subscribe(res => {
+ if(res['code'] == 200 || res['statusCode'] == 200){
+ this.tcuapi = true;
+ }else{
+ this.tcuapi = false;
+ }
+ }, err => {
+ this.tcuapi = false;
+ });
+
+ this.health.get('tcu-engine').subscribe(res => {
+
+ if(res['code'] == 200 || res['statusCode'] == 200){
+ this.tcuengine = true;
+ }else{
+ this.tcuengine = false;
+ }
+ }, err => {
+
+ this.tcuengine = false;
+ });
+ }
+
+ eventCalled() {
+ this.isActive = !this.isActive;
+ }
+
+ addExpandClass(element: any) {
+ if (element === this.showMenu) {
+ this.showMenu = '0';
+ } else {
+ this.showMenu = element;
+ }
+ }
+
+ isToggled(): boolean {
+ const dom: Element = document.querySelector('body');
+ return dom.classList.contains(this.pushRightClass);
+ }
+
+ toggleSidebar() {
+ const dom: any = document.querySelector('body');
+ dom.classList.toggle(this.pushRightClass);
+ }
+
+ rltAndLtr() {
+ const dom: any = document.querySelector('body');
+ dom.classList.toggle('rtl');
+ }
+
+ changeLang(language: string) {
+ this.translate.use(language);
+ }
+
+ onLoggedout() {
+ localStorage.removeItem('isLoggedin');
+ }
+
+ checkIsAdmin() {
+ if (this.cookie.get('access_token') && this.cookie.get('currentUser')) {
+ let currentUser = JSON.parse(this.cookie.get('currentUser'));
+ if (currentUser['permissions'].indexOf('admin') >= 0) {
+ this.isAdmin = true;
+ return true;
+ }
+ }
+ this.isAdmin = false;
+ return false;
+ }
+
+}
diff --git "a/otf-frontend/client/src/app/layout/components/stats/assets/icons/ProfessionalHeadshot\0502\051.png" "b/otf-frontend/client/src/app/layout/components/stats/assets/icons/ProfessionalHeadshot\0502\051.png"
new file mode 100644
index 0000000..6fc07ef
--- /dev/null
+++ "b/otf-frontend/client/src/app/layout/components/stats/assets/icons/ProfessionalHeadshot\0502\051.png"
Binary files differ
diff --git a/otf-frontend/client/src/app/layout/components/stats/assets/icons/download.jfif b/otf-frontend/client/src/app/layout/components/stats/assets/icons/download.jfif
new file mode 100644
index 0000000..2fad5ae
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/assets/icons/download.jfif
Binary files differ
diff --git a/otf-frontend/client/src/app/layout/components/stats/assets/icons/equalizer.gif b/otf-frontend/client/src/app/layout/components/stats/assets/icons/equalizer.gif
new file mode 100644
index 0000000..22ccbe3
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/assets/icons/equalizer.gif
Binary files differ
diff --git a/otf-frontend/client/src/app/layout/components/stats/assets/icons/loading-pies.gif b/otf-frontend/client/src/app/layout/components/stats/assets/icons/loading-pies.gif
new file mode 100644
index 0000000..5d979f7
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/assets/icons/loading-pies.gif
Binary files differ
diff --git a/otf-frontend/client/src/app/layout/components/stats/assets/icons/loading-pies.svg b/otf-frontend/client/src/app/layout/components/stats/assets/icons/loading-pies.svg
new file mode 100644
index 0000000..d34f7b3
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/assets/icons/loading-pies.svg
@@ -0,0 +1 @@
+<svg width="200px" height="200px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="lds-wedges" style="background: none;"><g transform="translate(50,50)"><g ng-attr-transform="scale({{config.scale}})" transform="scale(0.7)"><g transform="translate(-50,-50)"><g transform="rotate(327.872 50.0001 50)"><animateTransform attributeName="transform" type="rotate" calcMode="linear" values="0 50 50;360 50 50" keyTimes="0;1" dur="0.75s" begin="0s" repeatCount="indefinite"></animateTransform><path ng-attr-fill-opacity="{{config.opacity}}" ng-attr-fill="{{config.c1}}" d="M50 50L50 0A50 50 0 0 1 100 50Z" fill-opacity="0.8" fill="#1d3f72"></path></g><g transform="rotate(245.904 50 50)"><animateTransform attributeName="transform" type="rotate" calcMode="linear" values="0 50 50;360 50 50" keyTimes="0;1" dur="1s" begin="0s" repeatCount="indefinite"></animateTransform><path ng-attr-fill-opacity="{{config.opacity}}" ng-attr-fill="{{config.c2}}" d="M50 50L50 0A50 50 0 0 1 100 50Z" transform="rotate(90 50 50)" fill-opacity="0.8" fill="#5699d2"></path></g><g transform="rotate(163.936 50 50)"><animateTransform attributeName="transform" type="rotate" calcMode="linear" values="0 50 50;360 50 50" keyTimes="0;1" dur="1.5s" begin="0s" repeatCount="indefinite"></animateTransform><path ng-attr-fill-opacity="{{config.opacity}}" ng-attr-fill="{{config.c3}}" d="M50 50L50 0A50 50 0 0 1 100 50Z" transform="rotate(180 50 50)" fill-opacity="0.8" fill="#d8ebf9"></path></g><g transform="rotate(81.9679 50 50)"><animateTransform attributeName="transform" type="rotate" calcMode="linear" values="0 50 50;360 50 50" keyTimes="0;1" dur="3s" begin="0s" repeatCount="indefinite"></animateTransform><path ng-attr-fill-opacity="{{config.opacity}}" ng-attr-fill="{{config.c4}}" d="M50 50L50 0A50 50 0 0 1 100 50Z" transform="rotate(270 50 50)" fill-opacity="0.8" fill="#71c2cc"></path></g></g></g></g></svg>
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/components/stats/filter-modal/filter-modal.component.pug b/otf-frontend/client/src/app/layout/components/stats/filter-modal/filter-modal.component.pug
new file mode 100644
index 0000000..d895b76
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/filter-modal/filter-modal.component.pug
@@ -0,0 +1,139 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div(style="position: relative;", ng-model)
+
+ .row()
+
+ h4(mat-dialog-title, style="padding-left: 15px;") Statistics Filters
+
+ button(mat-icon-button, (click)="close()", style="position: absolute; right: 0px;")
+ mat-icon close
+
+ div(mat-dialog-content)
+
+ //- mat-expansion-panel(style="margin-top: 5px;")
+ //- mat-expansion-panel-header
+ //- mat-panel-title(style="font-weight: bold") Overall
+ //- //- mat-panel-description Filters for all charts.
+ //- .row
+ //- .col-3
+ //- mat-form-field
+ //- input(matInput, [matDatepicker]="allStartPicker", [(ngModel)]="allFilters.startDate", [min]="minDate", [max]="maxDate", placeholder="Start Date")
+ //- mat-datepicker-toggle(matSuffix [for]="allStartPicker")
+ //- mat-datepicker(#allStartPicker)
+
+ //- mat-form-field
+ //- input(matInput, [matDatepicker]="allEndPicker", [(ngModel)]="allFilters.endDate", [min]="minDate", [max]="maxDate", placeholder="End Date")
+ //- mat-datepicker-toggle(matSuffix [for]="allEndPicker")
+ //- mat-datepicker(#allEndPicker)
+
+ mat-expansion-panel
+ mat-expansion-panel-header
+ mat-panel-title(style="font-weight: bold") Test Definitions
+ //- mat-panel-description Filters for test definition charts.
+ .row
+ .col-6
+
+ .row
+ mat-form-field(style="margin-left: auto; margin-right: auto; width: 90%")
+ mat-label Test Definitions
+ mat-select( [(value)]="tdFilters.selected", multiple)
+ mat-option(*ngFor="let testDefinition of testDefinitions", [value]="testDefinition") {{testDefinition.viewValue}}
+
+ .col-6
+ .row
+ mat-form-field(style="margin-left: auto; margin-right: auto; width: 90%")
+ input(matInput, [matDatepicker]="TDStartPicker", [(ngModel)]="tdFilters.startDate", [min]="minDate", [max]="maxDate", placeholder="Start Date")
+ mat-datepicker-toggle(matSuffix [for]="TDStartPicker")
+ mat-datepicker(#TDStartPicker)
+ .row
+ mat-form-field(style="margin-left: auto; margin-right: auto; width: 90%")
+ input(matInput, [matDatepicker]="TDEndPicker", [(ngModel)]="tdFilters.endDate", [min]="minDate", [max]="maxDate", placeholder="End Date")
+ mat-datepicker-toggle(matSuffix [for]="TDEndPicker")
+ mat-datepicker(#TDEndPicker)
+
+ mat-expansion-panel
+ mat-expansion-panel-header
+ mat-panel-title(style="font-weight: bold") Test Instances
+ //- mat-panel-description Filters for test instance charts.
+ .row
+
+ .col-6
+ .row
+ mat-form-field(style="margin-left: auto; margin-right: auto; width: 90%")
+ mat-label Test Definitions
+ mat-select([(value)]="tiFilters.selectedTDs", multiple)
+ mat-option(*ngFor="let testDefinition of testDefinitions", [value]="testDefinition.id") {{testDefinition.viewValue}}
+ .row
+ mat-form-field(style="margin-left: auto; margin-right: auto; width: 90%")
+ mat-label Test Instances
+ mat-select([(value)]="tiFilters.selectedTIs", multiple)
+ mat-option(*ngFor="let testInstance of testInstances", [value]="testInstance.id") {{testInstance.viewValue}}
+
+ .col-6
+ .row
+ mat-form-field(style="margin-left: auto; margin-right: auto; width: 90%")
+ input(matInput, [matDatepicker]="TIStartPicker", [(ngModel)]="tiFilters.startDate", [min]="minDate", [max]="maxDate", placeholder="Start Date")
+ mat-datepicker-toggle(matSuffix [for]="TIStartPicker")
+ mat-datepicker(#TIStartPicker)
+ .row
+ mat-form-field(style="margin-left: auto; margin-right: auto; width: 90%")
+ input(matInput, [matDatepicker]="TIEndPicker", [(ngModel)]="tiFilters.endDate", [min]="minDate", [max]="maxDate", placeholder="End Date")
+ mat-datepicker-toggle(matSuffix [for]="TIEndPicker")
+ mat-datepicker(#TIEndPicker)
+
+ mat-expansion-panel(style="margin-bottom: 5px;")
+ mat-expansion-panel-header
+ mat-panel-title(style="font-weight: bold") Scheduled Tests
+ //- mat-panel-description Filters for test schedule table.
+
+ .row
+
+ .col-6
+ .row
+ mat-form-field(style="margin-left: auto; margin-right: auto; width: 90%")
+ mat-label Test Instances
+ mat-select([(value)]="scheduleFilters.selectedInstances", multiple)
+ mat-option(*ngFor="let instance of testInstances", [value]="instance.id") {{instance.viewValue}}
+
+ .col-6
+ .row
+ mat-form-field(style="margin-left: auto; margin-right: auto; width: 90%")
+ input(matInput, [matDatepicker]="scheduleStartPicker", [(ngModel)]="scheduleFilters.startDate", placeholder="Start Date")
+ mat-datepicker-toggle(matSuffix [for]="scheduleStartPicker")
+ mat-datepicker(#scheduleStartPicker)
+ .row
+ mat-form-field(style="margin-left: auto; margin-right: auto; width: 90%")
+ input(matInput, [matDatepicker]="scheduleEndPicker", [(ngModel)]="scheduleFilters.endDate", placeholder="End Date")
+ mat-datepicker-toggle(matSuffix [for]="scheduleEndPicker")
+ mat-datepicker(#scheduleEndPicker)
+
+ //- .col-3
+ //- .row
+ //- mat-form-field(style="margin-left: auto; margin-right: auto; width: 90%")
+ //- input(matInput, [matDatepicker]="scheduleStartTimePicker", [(ngModel)]="scheduleFilters.timeRangeStart", [min]="minDate", [max]="maxDate", placeholder="Time Range Start")
+ //- mat-datepicker-toggle(matSuffix [for]="scheduleStartTimePicker")
+ //- mat-datepicker(#scheduleStartTimePicker)
+ //- .row
+ //- mat-form-field(style="margin-left: auto; margin-right: auto; width: 90%")
+ //- input(matInput, [matDatepicker]="scheduleEndTimePicker", [(ngModel)]="scheduleFilters.timeRangeEnd", [min]="minDate", [max]="maxDate", placeholder="Time Range End")
+ //- mat-datepicker-toggle(matSuffix [for]="scheduleEndTimePicker")
+ //- mat-datepicker(#scheduleEndTimePicker)
+
+ .row(style="padding: 10px;")
+ //- button(mat-raised-button, style="margin-left: auto; margin-right: 5px;") Clear All
+ button(mat-raised-button, color="primary", style="margin-right: auto; margin-left: auto;", (click)="onConfirm()") Set
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/components/stats/filter-modal/filter-modal.component.scss b/otf-frontend/client/src/app/layout/components/stats/filter-modal/filter-modal.component.scss
new file mode 100644
index 0000000..20ad5c4
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/filter-modal/filter-modal.component.scss
@@ -0,0 +1,23 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+*{
+ //border: 1px solid black;
+}
+
+hr{
+ padding: 0px;
+}
diff --git a/otf-frontend/client/src/app/layout/components/stats/filter-modal/filter-modal.component.spec.ts b/otf-frontend/client/src/app/layout/components/stats/filter-modal/filter-modal.component.spec.ts
new file mode 100644
index 0000000..c04bb71
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/filter-modal/filter-modal.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { FilterModalComponent } from './filter-modal.component';
+
+describe('FilterModalComponent', () => {
+ let component: FilterModalComponent;
+ let fixture: ComponentFixture<FilterModalComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ FilterModalComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(FilterModalComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/components/stats/filter-modal/filter-modal.component.ts b/otf-frontend/client/src/app/layout/components/stats/filter-modal/filter-modal.component.ts
new file mode 100644
index 0000000..c1ab2c7
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/filter-modal/filter-modal.component.ts
@@ -0,0 +1,151 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit } from '@angular/core';
+import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
+import { FormControl } from '@angular/forms';
+import * as moment from 'moment';
+
+import { StatsService } from '../stats.service';
+import { TestDefinitionService } from 'app/shared/services/test-definition.service';
+import { TestInstanceService } from 'app/shared/services/test-instance.service';
+import { GroupService } from 'app/shared/services/group.service';
+
+@Component({
+ selector: 'app-filter-modal',
+ templateUrl: './filter-modal.component.pug',
+ styleUrls: ['./filter-modal.component.scss']
+})
+
+export class FilterModalComponent implements OnInit {
+
+ public group;
+ public allFilters = {
+ startDate: "",
+ endDate: ""
+ };
+ public tdFilters = {
+ selected: [],
+ startDate: "",
+ endDate: "",
+ };
+ public tiFilters = {
+ selectedTDs: [],
+ selectedTIs: [],
+ startDate: "",
+ endDate: "",
+ multiLineLimit: 5
+ };
+ public scheduleFilters = {
+ startDate: "",
+ endDate: "",
+ timeRangeStart: "",
+ timeRangeEnd: "",
+ selectedInstances: [],
+ }
+ // public vthFilters = {
+ // selected: [],
+ // startDate: "",
+ // endDate: "",
+ // };
+
+ public minDate;
+ public maxDate;
+
+ public testDefinitions: Array<any> = [];
+ public testInstances: Array<any> = [];
+ //public scheduleInstances: Array<any> = [];
+ //public vths = [];
+
+ constructor(
+ public dialogRef: MatDialogRef<FilterModalComponent>,
+ public statsService: StatsService,
+ public tdService: TestDefinitionService,
+ public groupService: GroupService,
+ public tiService: TestInstanceService
+ ) {
+ this.minDate = new Date(moment().subtract(1, 'year').format('L'));
+ this.maxDate = new Date(moment().format('L'));
+
+ }
+
+ ngOnInit() {
+ //populate the td, ti, and vth arrays up there. or import them?
+ this.setTDList();
+ this.setTIList();
+ }
+
+ setTDList() {
+ this.tdService.find({
+ groupId: this.groupService.getGroup()["_id"],
+ $select: ['testName', 'testDescription', "_id"],
+ $limit: -1,
+ $sort:{
+ testName:1
+ }
+ }).subscribe(result => {
+ for (let index in result) {
+ this.testDefinitions.push({id: result[index]._id, viewValue: result[index].testName });
+ }
+ })
+ }
+
+ setTIList() {
+ this.tiService.find({
+ groupId: this.groupService.getGroup()["_id"],
+ $select: ['testInstanceName', 'testInstanceDescription', "_id"],
+ $limit: -1,
+ $sort:{
+ testInstanceName:1
+ }
+ }).subscribe(result => {
+ //console.log(result);
+ for (let index in result) {
+ this.testInstances.push({ id: result[index]._id, viewValue: result[index].testInstanceName })
+ }
+ //this.testInstances.sort((a, b) => b.viewValue - a.viewValue);
+ })
+ }
+
+ checkDates() {
+ let allSet = true;
+
+ if (this.scheduleFilters.startDate > this.scheduleFilters.endDate) {
+ allSet = false;
+ alert("Schedule Filters: Your end date cannot be earlier than your start date.");
+ } else if (this.tdFilters.startDate > this.tdFilters.endDate) {
+ allSet = false;
+ alert("Test Definition Filters: Your end date cannot be earlier than your start date.");
+ } else if (this.tiFilters.startDate > this.tiFilters.endDate) {
+ allSet = false;
+ alert("Test Instance Filters: Your end date cannot be earlier than your start date.");
+ }
+ return allSet;
+ }
+
+ onConfirm() {
+ if (this.checkDates() == true) {
+ this.close();
+ this.statsService.filterData(this.allFilters, this.tdFilters, this.tiFilters, this.scheduleFilters);
+ //console.log(this.tdFilters);
+ }
+ }
+
+ close() {
+ this.dialogRef.close();
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/components/stats/horiz-bar-chart/horiz-bar-chart.component.pug b/otf-frontend/client/src/app/layout/components/stats/horiz-bar-chart/horiz-bar-chart.component.pug
new file mode 100644
index 0000000..d2f9bbd
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/horiz-bar-chart/horiz-bar-chart.component.pug
@@ -0,0 +1,17 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div(#horizBarChartDiv, [style.height]="height")
diff --git a/otf-frontend/client/src/app/layout/components/stats/horiz-bar-chart/horiz-bar-chart.component.scss b/otf-frontend/client/src/app/layout/components/stats/horiz-bar-chart/horiz-bar-chart.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/horiz-bar-chart/horiz-bar-chart.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/layout/components/stats/horiz-bar-chart/horiz-bar-chart.component.spec.ts b/otf-frontend/client/src/app/layout/components/stats/horiz-bar-chart/horiz-bar-chart.component.spec.ts
new file mode 100644
index 0000000..79d017d
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/horiz-bar-chart/horiz-bar-chart.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { HorizBarChartComponent } from './horiz-bar-chart.component';
+
+describe('HorizBarChartComponent', () => {
+ let component: HorizBarChartComponent;
+ let fixture: ComponentFixture<HorizBarChartComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ HorizBarChartComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(HorizBarChartComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/components/stats/horiz-bar-chart/horiz-bar-chart.component.ts b/otf-frontend/client/src/app/layout/components/stats/horiz-bar-chart/horiz-bar-chart.component.ts
new file mode 100644
index 0000000..af6175e
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/horiz-bar-chart/horiz-bar-chart.component.ts
@@ -0,0 +1,175 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, NgZone, Input, ViewChild, ElementRef, OnDestroy, } from '@angular/core';
+import * as am4core from "@amcharts/amcharts4/core";
+import * as am4charts from "@amcharts/amcharts4/charts";
+import { StatsService } from '../stats.service'
+
+// am4core.useTheme(am4themes_animated);
+
+@Component({
+ selector: 'app-horiz-bar-chart',
+ templateUrl: './horiz-bar-chart.component.pug',
+ styleUrls: ['./horiz-bar-chart.component.scss']
+})
+export class HorizBarChartComponent implements OnInit, OnDestroy {
+
+ @ViewChild('horizBarChartDiv') HorizBarChartDiv: ElementRef;
+ @Input() height: string;
+
+ public chart: am4charts.XYChart;
+ public testInstanceData;
+ public loadingIndicator;
+ protected stats: StatsService;
+
+ constructor(private statsService: StatsService) {
+ this.stats = statsService;
+ }
+
+
+ ngOnInit() {
+ this.renderChart();
+
+ this.stats.onDefaultDataCallStarted().subscribe(res => {
+ this.showLoadingIndicator();
+ })
+
+ this.stats.onTIExecutionChangeStarted().subscribe(res => {
+ this.showLoadingIndicator();
+ })
+
+ this.stats.onDefaultDataCallFinished().subscribe(res => {
+ this.setChartData();
+ })
+
+ this.stats.onTIExecutionChangeFinished().subscribe(res => {
+ this.setChartData()
+ })
+
+ }
+
+ ngOnDestroy() {
+ this.chart.dispose();
+ }
+
+ showLoadingIndicator() {
+ if(!this.loadingIndicator){
+ this.loadingIndicator = this.chart.tooltipContainer.createChild(am4core.Container);
+ this.loadingIndicator.background.fill = am4core.color("#fff");
+ this.loadingIndicator.background.fillOpacity = 0.8;
+ this.loadingIndicator.width = am4core.percent(100);
+ this.loadingIndicator.height = am4core.percent(100);
+
+ let indicatorLabel = this.loadingIndicator.createChild(am4core.Label);
+ indicatorLabel.text = "Loading..";
+ indicatorLabel.align = "center";
+ indicatorLabel.valign = "middle";
+ indicatorLabel.fontSize = 18;
+ indicatorLabel.fontWeight= "bold";
+ indicatorLabel.dy = 50;
+
+ let loadingImage = this.loadingIndicator.createChild(am4core.Image);
+ //loadingImage.href = "https://img.devrant.com/devrant/rant/r_647810_4FeCH.gif";
+ loadingImage.href = "/assets/images/equalizer.gif";
+ //loadingImage.dataSource = "/loading-pies.svg"
+ loadingImage.align = "center";
+ loadingImage.valign = "middle";
+ loadingImage.horizontalCenter = "middle";
+ loadingImage.verticalCenter = "middle";
+ loadingImage.scale = 3.0;
+ }else{
+ this.loadingIndicator.show();
+ }
+
+ }
+
+ hideLoadingIndicator() {
+ this.loadingIndicator.hide();
+ }
+
+ setChartData() {
+ this.testInstanceData = this.stats.getData('testInstances');
+ this.chart.data = this.testInstanceData;
+
+ // Displays the average time for each bar.
+ // If there is no time recorded for the Test Instance, display No Time Recorded.
+ let series = this.chart.series.values[0] as am4charts.ColumnSeries;
+
+
+ series.columns.template.adapter.add("tooltipText", (text, target) => {
+ if (target.dataItem) {
+ if (this.chart.data[target.dataItem.index].Average > 0) {
+ return this.chart.data[target.dataItem.index].Count.toString() + " Executions \n Avg Time: " + this.chart.data[target.dataItem.index].Average.toFixed(2).toString() + " seconds";
+ } else
+ return this.chart.data[target.dataItem.index].Count.toString() + " Executions \n No Time Recorded";
+ }
+ });
+ series.columns.template.adapter.add("fill", (fill, target) => this.chart.colors.getIndex(target.dataItem.index));
+ // console.log(this.chart.yAxes);
+ this.chart.yAxes.values[0].zoomToIndexes(0, 6, false, true);
+ this.hideLoadingIndicator();
+
+ }
+
+ renderChart() {
+ this.chart = am4core.create(this.HorizBarChartDiv.nativeElement, am4charts.XYChart);
+ this.chart.cursor = new am4charts.XYCursor();
+ this.showLoadingIndicator();
+
+ this.chart.responsive.enabled = true;
+
+ // Create axes
+ var categoryAxis = this.chart.yAxes.push(new am4charts.CategoryAxis());
+ categoryAxis.dataFields.category = "Name";
+ categoryAxis.numberFormatter.numberFormat = "#";
+ categoryAxis.renderer.inversed = true;
+ categoryAxis.renderer.minGridDistance = 5;
+ categoryAxis.title.text = "Test Instances";
+ categoryAxis.title.fontSize = "10px";
+
+ var valueAxis = this.chart.xAxes.push(new am4charts.ValueAxis());
+ valueAxis.renderer.minWidth = 10;
+
+ // Create series
+ var series = this.chart.series.push(new am4charts.ColumnSeries());
+ series.dataFields.valueX = "Count";
+ series.dataFields.categoryY = "Name";
+ series.columns.template.tooltipText = " ";
+
+ let label = categoryAxis.renderer.labels.template;
+ label.truncate = true;
+ label.maxWidth = 130;
+ label.fontSize = 13;
+
+ //Scrollbar on the right.
+ let scrollBarY = new am4charts.XYChartScrollbar();
+ scrollBarY.series.push(series);
+ this.chart.scrollbarY = scrollBarY;
+ this.chart.scrollbarY.contentHeight = 100;
+ this.chart.scrollbarY.minWidth = 20;
+ this.chart.scrollbarY.thumb.minWidth = 20;
+
+ //set initial Scrollbar Zoom to the Top 6 Instances.
+ // this.chart.events.on("ready", () => {
+ // console.log("here")
+ // categoryAxis.zoomToIndexes(0, 6, false, true);
+ // });
+ }
+
+}
+
+
diff --git a/otf-frontend/client/src/app/layout/components/stats/line-chart/line-chart.component.pug b/otf-frontend/client/src/app/layout/components/stats/line-chart/line-chart.component.pug
new file mode 100644
index 0000000..e26fb12
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/line-chart/line-chart.component.pug
@@ -0,0 +1,17 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div(#linechartdiv, [style.height]="height")
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/components/stats/line-chart/line-chart.component.scss b/otf-frontend/client/src/app/layout/components/stats/line-chart/line-chart.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/line-chart/line-chart.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/layout/components/stats/line-chart/line-chart.component.spec.ts b/otf-frontend/client/src/app/layout/components/stats/line-chart/line-chart.component.spec.ts
new file mode 100644
index 0000000..4201928
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/line-chart/line-chart.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { LineChartComponent } from './line-chart.component';
+
+describe('LineChartComponent', () => {
+ let component: LineChartComponent;
+ let fixture: ComponentFixture<LineChartComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ LineChartComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(LineChartComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/components/stats/line-chart/line-chart.component.ts b/otf-frontend/client/src/app/layout/components/stats/line-chart/line-chart.component.ts
new file mode 100644
index 0000000..e7f0780
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/line-chart/line-chart.component.ts
@@ -0,0 +1,172 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Input, ViewChild, ElementRef, OnDestroy } from '@angular/core';
+import { StatsService } from '../stats.service';
+import * as am4core from "@amcharts/amcharts4/core";
+import * as am4charts from "@amcharts/amcharts4/charts";
+import { _ } from 'ag-grid-community';
+import * as moment from 'moment';
+import { Subscription } from 'rxjs';
+
+// am4core.useTheme(am4themes_animated);
+
+@Component({
+ selector: 'app-line-chart',
+ templateUrl: './line-chart.component.pug',
+ styleUrls: ['./line-chart.component.scss']
+})
+export class LineChartComponent implements OnInit, OnDestroy {
+
+ private toDestroy: Array<Subscription> = [];
+
+ @ViewChild('linechartdiv') LineChartDiv: ElementRef;
+ @Input() height: string;
+
+ //public testDefinitionName = "Hello";
+ private chart: am4charts.XYChart;
+ private loadingIndicator;
+
+ constructor(private stats: StatsService) {
+ }
+
+ ngOnInit() {
+
+ this.renderChart();
+
+ this.toDestroy.push(this.stats.onTDExecutionChangeStarted().subscribe(res => {
+ this.showLoadingIndicator();
+ }));
+
+ this.toDestroy.push(this.stats.onDefaultDataCallStarted().subscribe(res => {
+ this.showLoadingIndicator();
+ }));
+
+ this.toDestroy.push(this.stats.onDefaultDataCallFinished().subscribe(res => {
+ this.setChartData();
+ }));
+
+ this.toDestroy.push(this.stats.onTDExecutionChangeFinished().subscribe(res => {
+ this.setChartData();
+ }));
+
+ }
+
+ ngOnDestroy(){
+ //destory chart
+ this.chart.dispose();
+ }
+
+ //Sets count to 0 for any dates that dont have data
+ setupPoints(rawData) {
+
+ let formattedData = [];
+ let dayRange = moment(this.stats.filters.endDate).add(1, 'days').diff(moment(this.stats.filters.startDate), 'days');
+
+ for(let i = 0; i < dayRange; i++){
+ //find date in raw data
+ let d = rawData.find(e => moment(e.date).isSame(moment(this.stats.filters.startDate).add(i, 'days'), 'day'));
+ let count = 0;
+ if(d){
+ count = d.count;
+ }
+ formattedData.push({
+ date: moment(this.stats.filters.startDate).startOf('day').add(i, 'days').toDate(),
+ count: count
+ })
+ }
+
+ return formattedData;
+ }
+
+ showLoadingIndicator() {
+
+ //this.height = "380px";
+ if(!this.loadingIndicator){
+ this.loadingIndicator = this.chart.tooltipContainer.createChild(am4core.Container);
+ this.loadingIndicator.background.fill = am4core.color("#fff");
+ this.loadingIndicator.background.fillOpacity = 0.8;
+ this.loadingIndicator.width = am4core.percent(100);
+ this.loadingIndicator.height = am4core.percent(100);
+
+ let indicatorLabel = this.loadingIndicator.createChild(am4core.Label);
+ indicatorLabel.text = "Loading..";
+ indicatorLabel.align = "center";
+ indicatorLabel.valign = "middle";
+ indicatorLabel.fontSize = 18;
+ indicatorLabel.fontWeight = "bold";
+ indicatorLabel.dy = 50;
+
+ let loadingImage = this.loadingIndicator.createChild(am4core.Image);
+ //loadingImage.href = "https://img.devrant.com/devrant/rant/r_647810_4FeCH.gif";
+ loadingImage.href = "/assets/images/equalizer.gif";
+ //loadingImage.dataSource = "/loading-pies.svg"
+ loadingImage.align = "center";
+ loadingImage.valign = "middle";
+ loadingImage.horizontalCenter = "middle";
+ loadingImage.verticalCenter = "middle";
+ loadingImage.scale = 3.0;
+ }else{
+ this.loadingIndicator.show();
+ }
+ }
+
+ hideLoadingIndicator() {
+ this.loadingIndicator.hide();
+ }
+
+ setChartData() {
+ let executions = this.stats.getData('TD_Executions');
+ this.chart.data = this.setupPoints(executions);
+
+ this.hideLoadingIndicator();
+ }
+
+ renderChart() {
+
+ if(this.chart){
+ this.chart.dispose();
+ }
+ this.chart = am4core.create(this.LineChartDiv.nativeElement, am4charts.XYChart);
+ this.chart.preloader.disabled = true;
+ this.showLoadingIndicator();
+
+ let dateAxis = this.chart.xAxes.push(new am4charts.DateAxis());
+ dateAxis.fontSize = "10px";
+
+ let valueAxis = this.chart.yAxes.push(new am4charts.ValueAxis());
+ valueAxis.title.text = "Executions";
+ valueAxis.title.fontSize = "10px";
+
+ let series = this.chart.series.push(new am4charts.LineSeries());
+ series.dataFields.dateX = "date";
+ series.dataFields.valueY = "count";
+ series.strokeWidth = 3;
+
+ series.fillOpacity = .5;
+ // series.tensionX = 0.8;
+ series.sequencedInterpolation = false;
+ series.tooltipText = "{valueY.value}";
+
+ this.chart.cursor = new am4charts.XYCursor();
+
+ this.chart.responsive.enabled = true;
+ }
+
+
+
+
+}
diff --git a/otf-frontend/client/src/app/layout/components/stats/multi-line-chart/multi-line-chart.component.pug b/otf-frontend/client/src/app/layout/components/stats/multi-line-chart/multi-line-chart.component.pug
new file mode 100644
index 0000000..940e640
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/multi-line-chart/multi-line-chart.component.pug
@@ -0,0 +1,19 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+p(style="width: 100%; text-align: center;") Test Instance Executions over time
+hr
+div(#multilinechartdiv, [style.height]="height")
diff --git a/otf-frontend/client/src/app/layout/components/stats/multi-line-chart/multi-line-chart.component.scss b/otf-frontend/client/src/app/layout/components/stats/multi-line-chart/multi-line-chart.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/multi-line-chart/multi-line-chart.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/layout/components/stats/multi-line-chart/multi-line-chart.component.spec.ts b/otf-frontend/client/src/app/layout/components/stats/multi-line-chart/multi-line-chart.component.spec.ts
new file mode 100644
index 0000000..e43604d
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/multi-line-chart/multi-line-chart.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { MultiLineChartComponent } from './multi-line-chart.component';
+
+describe('MultiLineChartComponent', () => {
+ let component: MultiLineChartComponent;
+ let fixture: ComponentFixture<MultiLineChartComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ MultiLineChartComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(MultiLineChartComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/components/stats/multi-line-chart/multi-line-chart.component.ts b/otf-frontend/client/src/app/layout/components/stats/multi-line-chart/multi-line-chart.component.ts
new file mode 100644
index 0000000..e9782c4
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/multi-line-chart/multi-line-chart.component.ts
@@ -0,0 +1,336 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Input, ViewChild, ElementRef } from '@angular/core';
+import { StatsService } from '../stats.service';
+import * as am4core from "@amcharts/amcharts4/core";
+import * as am4charts from "@amcharts/amcharts4/charts";
+import * as moment from 'moment';
+
+//am4core.useTheme(am4themes_animated);
+
+@Component({
+ selector: 'app-multi-line-chart',
+ templateUrl: './multi-line-chart.component.pug',
+ styleUrls: ['./multi-line-chart.component.scss']
+})
+export class MultiLineChartComponent implements OnInit {
+
+ @ViewChild('multilinechartdiv') MultiLineChartDiv: ElementRef;
+ @Input() height: string;
+
+ public chart: am4charts.XYChart;
+ public loadingIndicator;
+ public chartData;
+ protected stats: StatsService;
+ public dataIsEmpty = 0;
+ constructor(private statsService: StatsService) {
+ this.stats = statsService;
+ }
+
+ ngOnInit() {
+
+ this.stats.onDefaultDataCallStarted().subscribe(res => {
+ this.showLoadingIndicator();
+ })
+
+ this.stats.onTIExecutionChangeStarted().subscribe(res => {
+ this.showLoadingIndicator();
+ })
+
+ this.stats.onDefaultDataCallFinished().subscribe(res => {
+ this.renderChart();
+ this.hideLoadingIndicator();
+ })
+
+ this.stats.onTIExecutionChangeFinished().subscribe(res => {
+ this.renderChart();
+ this.hideLoadingIndicator();
+ })
+ this.renderChart();
+
+ //Resize if screen size changes.
+ // this.stats.checkWindow().subscribe(res=>{
+ // this.renderChart();
+ // })
+ }
+
+
+ // Rearrange the data to match the format needed for amcharts. Need to group by date. Each object has a date and a list of the lines and its count.
+ reformatData() {
+ var newData = [];
+
+ //Names of the test instances.
+ var InstanceStrings = {};
+
+ //Go through the instances and add the names to the InstanceStrings Array.
+ for (var numberInstances = 0; numberInstances < this.chartData.length; numberInstances++) {
+ var instanceName = this.chartData[numberInstances].testInstanceName;
+ InstanceStrings[instanceName] = 0;
+ }
+
+ // Iterate through the test instances.
+ for (var instanceLength = 0; instanceLength < this.chartData.length; instanceLength++) {
+
+ //For each instance go through the dates.
+ for (var numDates = 0; numDates < this.chartData[instanceLength].dateData.length; numDates++) {
+
+ //Check newData to see if date has been pushed.
+ var dateIndex = newData.findIndex((element) => {
+ return (
+ this.chartData[instanceLength].dateData[numDates].date.getFullYear() === element.date.getFullYear() &&
+ this.chartData[instanceLength].dateData[numDates].date.getMonth() === element.date.getMonth() &&
+ this.chartData[instanceLength].dateData[numDates].date.getDate() === element.date.getDate()
+ )
+ });
+
+ //If date is not present push the new date and the count for the test instance.
+ if (newData[dateIndex] == undefined) {
+ //date is not present
+ var newDate = {
+ date: new Date(this.chartData[instanceLength].dateData[numDates].date.getFullYear(),
+ this.chartData[instanceLength].dateData[numDates].date.getMonth(),
+ this.chartData[instanceLength].dateData[numDates].date.getDate())
+ };
+ newDate = Object.assign(newDate, InstanceStrings);
+ newDate[this.chartData[instanceLength].testInstanceName] = this.chartData[instanceLength].dateData[numDates].count;
+ newData.push(newDate);
+ } else {
+
+ //If the date is present update the count for that test instance.
+ newData[dateIndex][this.chartData[instanceLength].testInstanceName] += this.chartData[instanceLength].dateData[numDates].count;
+ }
+ }
+ }
+ return newData;
+ }
+
+ //fill in dates that have no data. If a specific date is not present, we need to fill in the date and set a count for 0.
+ async setupPoints(rawData): Promise<any> {
+ let formattedData = [];
+
+ //If the chart is supposed to be empty push in a line with a count of 0.
+ if (rawData.length == 0) {
+ return new Promise((resolve, reject) => {
+
+ let days = this.daysDuration(this.stats.filters.startDate, this.stats.filters.endDate);
+
+ if (!days) {
+ days = 62;
+ this.stats.filters.startDate = (moment().subtract(2, "months").toDate());
+ }
+
+ // Go through 62 days and push a count of 0/
+ for (let day = 0; day < days; day++) {
+ let newDate = this.addDaysToDate(this.stats.filters.startDate, day);
+ formattedData.push({
+ date: new Date(newDate.getFullYear(), newDate.getMonth(), newDate.getDate()),
+ count: 0,
+ testInstancename: "empty"
+ })
+ }
+ resolve(formattedData);
+ })
+
+
+
+
+
+ //Data is not empty. push in empty days for each instance. Some instances might not have executions for each day.
+ } else return new Promise((resolve, reject) => {
+ //get list of test instances.
+ var InstanceStrings = {};
+ for (var numberInstances = 0; numberInstances < this.chartData.length; numberInstances++) {
+ var instanceName = this.chartData[numberInstances].testInstanceName;
+ InstanceStrings[instanceName] = 0;
+ }
+
+
+ //Go through the data
+ for (let i = 0; i < rawData.length; i++) {
+
+ //for the first iteration,
+ if (i == 0) {
+ formattedData.push(rawData[0]);
+
+ // if the date is before the startDate specified by the filter or two months be default.
+ if (formattedData[0].date > this.stats.filters.startDate) {
+
+ // Go through the difference in days and push the date and count of 0.
+ let days = this.daysDuration(this.stats.filters.startDate, formattedData[0].date)
+ for (let k = days - 1; k >= 0; k--) {
+ let newDate = this.addDaysToDate(this.stats.filters.startDate, k);
+ var objectToAdd = {
+ date: new Date(newDate.getFullYear(), newDate.getMonth(), newDate.getDate()),
+ };
+ //push the new date and all the strings for the test instances.
+ objectToAdd = Object.assign(objectToAdd, InstanceStrings);
+
+ //add date to the beginning of the array.
+ formattedData.unshift(objectToAdd)
+
+ }
+ }
+
+ //for all other iterations
+ } else {
+
+ //get the difference in days.
+ let days = this.daysDuration(rawData[i].date, rawData[i - 1].date);
+ if (days > 1) {
+ //push the new dates.
+ for (let j = 1; j < days; j++) {
+ let newDate = this.addDaysToDate(rawData[i - 1].date, j);
+ var objectToAdd = {
+ date: new Date(newDate.getFullYear(), newDate.getMonth(), newDate.getDate()),
+ };
+ //push the new date and all the strings for the test instances.
+ objectToAdd = Object.assign(objectToAdd, InstanceStrings);
+ formattedData.push(objectToAdd);
+ }
+ }
+ formattedData.push(rawData[i]);
+ }
+ }
+
+ if (rawData.length >= 1) {
+ var days = this.daysDuration(rawData[rawData.length - 1].date, this.stats.filters.endDate);
+ if (days >= 1) {
+ for (let j = 1; j < days; j++) {
+ let newDate = this.addDaysToDate(rawData[rawData.length - 1].date, j);
+ var objectToAdd = {
+ date: new Date(newDate.getFullYear(), newDate.getMonth(), newDate.getDate()),
+ };
+ objectToAdd = Object.assign(objectToAdd, InstanceStrings);
+ formattedData.push(objectToAdd);
+ }
+ }
+ }
+
+
+ resolve(formattedData);
+ })
+ }
+
+ daysDuration(date1, date2) {
+ return Math.ceil(Math.abs((date1 - date2) / (60 * 60 * 24 * 1000)));
+ }
+
+ addDaysToDate(date, days) {
+ let newDate = new Date(date);
+ newDate.setDate(date.getDate() + days);
+ return newDate;
+ }
+
+ //initialize loading indicator
+ showLoadingIndicator() {
+
+ this.height = "380px";
+ this.loadingIndicator = this.chart.tooltipContainer.createChild(am4core.Container);
+ this.loadingIndicator.background.fill = am4core.color("#fff");
+ this.loadingIndicator.background.fillOpacity = 0.8;
+ this.loadingIndicator.width = am4core.percent(100);
+ this.loadingIndicator.height = am4core.percent(100);
+
+ let indicatorLabel = this.loadingIndicator.createChild(am4core.Label);
+ indicatorLabel.text = "Loading..";
+ indicatorLabel.align = "center";
+ indicatorLabel.valign = "middle";
+ indicatorLabel.fontSize = 18;
+ indicatorLabel.fontWeight= "bold";
+ indicatorLabel.dy = 50;
+
+ let loadingImage = this.loadingIndicator.createChild(am4core.Image);
+ //loadingImage.href = "https://img.devrant.com/devrant/rant/r_647810_4FeCH.gif";
+ loadingImage.href = "https://loading.io/spinners/equalizer/lg.equalizer-bars-loader.gif";
+ //loadingImage.dataSource = "/loading-pies.svg"
+ loadingImage.align = "center";
+ loadingImage.valign = "middle";
+ loadingImage.horizontalCenter = "middle";
+ loadingImage.verticalCenter = "middle";
+ loadingImage.scale = 3.0;
+
+ }
+
+ hideLoadingIndicator() {
+ this.loadingIndicator.hide();
+ }
+
+ async renderChart() {
+ //console.log("here")
+
+ am4core.options.minPolylineStep = 5;
+
+ this.chart = am4core.create(this.MultiLineChartDiv.nativeElement, am4charts.XYChart);
+ this.chart.hiddenState.properties.opacity = 0; // this creates initial fade-in
+
+ this.chart.paddingRight = 20;
+ this.chartData = this.stats.getData("multiLineData");
+
+ //reformat the data to match the format needed for amcharts.
+ var formattedData = this.reformatData();
+
+ //sort the data.
+ formattedData.sort((a, b) => a.date - b.date);
+
+ //fill in gaps in the data
+ await this.setupPoints(formattedData).then(res => {
+ formattedData = res;
+ }, err => console.log(err));
+
+ this.chart.data = formattedData;
+
+ let dateAxis = this.chart.xAxes.push(new am4charts.DateAxis());
+ dateAxis.title.text = "Date";
+
+ let valueAxis = this.chart.yAxes.push(new am4charts.ValueAxis());
+ valueAxis.title.text = "Executions";
+
+ this.chart.cursor = new am4charts.XYCursor();
+ this.chart.cursor.xAxis = dateAxis;
+
+ //if the data is empty, push in a line and set the count to 0.
+ if (this.chartData.length == 0) {
+ this.chartData.push({ testInstanceName: "empty" })
+ let newSeries = this.chart.series.push(new am4charts.LineSeries());
+ newSeries.name = "empty";
+ newSeries.dataFields.dateX = "date";
+ newSeries.dataFields.valueY = "count";
+ newSeries.tooltipText = "{valueY.value}";
+ newSeries.sequencedInterpolation = true;
+ newSeries.defaultState.transitionDuration = 1000;
+ newSeries.strokeWidth = 3;
+ newSeries.tensionX = 0.8;
+ } else {
+
+ //initialize the lines for the series
+ for (let index = 0; index < this.chartData.length; index++) {
+ let newSeries = this.chart.series.push(new am4charts.LineSeries());
+ newSeries.name = this.chartData[index].testInstanceName;
+ newSeries.dataFields.dateX = "date";
+ newSeries.dataFields.valueY = (this.chartData[index].testInstanceName).toString();
+ newSeries.tooltipText = "{valueY.value}";
+ newSeries.sequencedInterpolation = true;
+ newSeries.defaultState.transitionDuration = 1000;
+ newSeries.strokeWidth = 3;
+ newSeries.tensionX = 0.8;
+ }
+ this.chart.legend = new am4charts.Legend();
+ this.chart.legend.labels.template.text = "[bold {color}]{name}";
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/components/stats/pie-chart/pie-chart.component.pug b/otf-frontend/client/src/app/layout/components/stats/pie-chart/pie-chart.component.pug
new file mode 100644
index 0000000..0456731
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/pie-chart/pie-chart.component.pug
@@ -0,0 +1,17 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div(#pieChartDiv, [style.height]="height")
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/components/stats/pie-chart/pie-chart.component.scss b/otf-frontend/client/src/app/layout/components/stats/pie-chart/pie-chart.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/pie-chart/pie-chart.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/layout/components/stats/pie-chart/pie-chart.component.spec.ts b/otf-frontend/client/src/app/layout/components/stats/pie-chart/pie-chart.component.spec.ts
new file mode 100644
index 0000000..28b4c37
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/pie-chart/pie-chart.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { PieChartComponent } from './pie-chart.component';
+
+describe('PieChartComponent', () => {
+ let component: PieChartComponent;
+ let fixture: ComponentFixture<PieChartComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ PieChartComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(PieChartComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/components/stats/pie-chart/pie-chart.component.ts b/otf-frontend/client/src/app/layout/components/stats/pie-chart/pie-chart.component.ts
new file mode 100644
index 0000000..16e7166
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/pie-chart/pie-chart.component.ts
@@ -0,0 +1,181 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, NgZone, Input, ViewChild, ElementRef, OnDestroy, } from '@angular/core';
+import * as am4core from "@amcharts/amcharts4/core";
+import * as am4charts from "@amcharts/amcharts4/charts";
+import { StatsService } from '../stats.service';
+import { Router } from '@angular/router';
+import { Subscription } from 'rxjs';
+
+//am4core.useTheme(frozen);
+//am4core.useTheme(am4themes_animated);
+
+@Component({
+ selector: 'app-pie-chart',
+ templateUrl: './pie-chart.component.pug',
+ styleUrls: ['./pie-chart.component.scss']
+})
+export class PieChartComponent implements OnInit, OnDestroy {
+
+ private toDestroy: Array<Subscription> = [];
+
+ @ViewChild('pieChartDiv') PieChartDiv: ElementRef;
+ @ViewChild('legendDiv') legendDiv: ElementRef;
+ @Input() height: string;
+
+ protected stats: StatsService;
+ public chart: am4charts.PieChart;
+ private chartData: Array<Object>;
+ public loadingIndicator;
+
+ constructor(private statsService: StatsService, private route: Router) {
+ this.stats = statsService;
+ }
+
+ ngOnInit() {
+
+ this.renderChart();
+
+ this.toDestroy.push(this.stats.onDefaultDataCallStarted().subscribe(res => {
+ this.showLoadingIndicator();
+ }));
+
+ this.toDestroy.push(this.stats.onTDExecutionChangeStarted().subscribe(res => {
+ this.showLoadingIndicator();
+ }));
+
+ this.toDestroy.push(this.stats.onDefaultDataCallFinished().subscribe(res => {
+ this.setChartData();
+ }));
+
+ this.toDestroy.push(this.stats.onTDExecutionChangeFinished().subscribe(res => {
+ this.setChartData()
+ }));
+
+
+ // //Resize if screen size changes.
+ // this.stats.checkWindow().subscribe(res=>{
+ // this.renderChart();
+ // })
+
+ }
+
+ ngOnDestroy() {
+ this.toDestroy.forEach(e => e.unsubscribe());
+ this.chart.dispose();
+ }
+
+ showLoadingIndicator() {
+
+ if(!this.loadingIndicator){
+ this.loadingIndicator = this.chart.tooltipContainer.createChild(am4core.Container);
+ this.loadingIndicator.background.fill = am4core.color("#fff");
+ this.loadingIndicator.background.fillOpacity = 0.8;
+ this.loadingIndicator.width = am4core.percent(100);
+ this.loadingIndicator.height = am4core.percent(100);
+
+ let indicatorLabel = this.loadingIndicator.createChild(am4core.Label);
+ indicatorLabel.text = "Loading..";
+ indicatorLabel.align = "center";
+ indicatorLabel.valign = "middle";
+ indicatorLabel.fontSize = 18;
+ indicatorLabel.fontWeight= "bold";
+ indicatorLabel.dy = 50;
+
+ let loadingImage = this.loadingIndicator.createChild(am4core.Image);
+ //loadingImage.href = "https://img.devrant.com/devrant/rant/r_647810_4FeCH.gif";
+ loadingImage.href = "/assets/images/equalizer.gif";
+ //loadingImage.dataSource = "/loading-pies.svg"
+ loadingImage.align = "center";
+ loadingImage.valign = "middle";
+ loadingImage.horizontalCenter = "middle";
+ loadingImage.verticalCenter = "middle";
+ loadingImage.scale = 3.0;
+ }else{
+ this.loadingIndicator.show();
+ }
+
+
+ }
+
+ hideLoadingIndicator() {
+ this.loadingIndicator.hide();
+ }
+
+ setChartData(){
+ this.chartData = this.stats.getData("TD_Results") as Array<Object>;
+ if (this.chartData.length == 0) {
+ this.chart.data = [{
+ Name: "N/A",
+ Count: 1,
+ }]
+
+ this.chart.series.values[0].tooltipText = "No Executions Found"
+ } else {
+ this.chart.data = this.chartData;
+ //OnClick open page for that result.
+ this.chart.series.values[0].slices.template.events.on("doublehit", (clickedSlice) => {
+ this.route.navigate(['/test-executions', { filter: clickedSlice.target.dataItem.dataContext['Name'].toString().toLowerCase() }]);
+ });
+ }
+ this.hideLoadingIndicator();
+
+ }
+
+ renderChart() {
+
+ this.chart = am4core.create(this.PieChartDiv.nativeElement, am4charts.PieChart);
+ let series = this.chart.series.push(new am4charts.PieSeries());
+ this.chart.scale = 1;
+ this.chart.align = "center";
+ this.showLoadingIndicator();
+
+ // this.chart.legend = new am4charts.Legend();
+ // this.chart.legend.position = "right";
+ // this.chart.legend.scale = .7;
+ // this.chart.legend.markers.template.width = 10;
+ // this.chart.legend.markers.template.height = 10;
+
+ //chart.preloader.disabled = false;
+ //chart.hiddenState.properties.opacity = 0; // this creates initial fade-in
+
+ // var legendContainer = am4core.create(this.legendDiv.nativeElement, am4core.Container);
+ // legendContainer.width = am4core.percent(100);
+ // legendContainer.height = am4core.percent(100);
+ // this.chart.legend.parent = legendContainer;
+ series.dataFields.value = "Count";
+ series.dataFields.category = "Name";
+ series.slices.template.strokeWidth = 1;
+ series.slices.template.strokeOpacity = 1;
+ series.slices.template.propertyFields.fill = "color"
+ series.scale = .8;
+
+ // This creates initial animation
+ series.hiddenState.properties.opacity = 1;
+ series.hiddenState.properties.endAngle = -90;
+ series.hiddenState.properties.startAngle = -90;
+ series.ticks.template.disabled = false;
+ series.labels.template.disabled = false;
+ series.titleElement.textContent = 'Total Test Results'
+
+ //responsive pie chart. if size of chart is less than 450 pixels remove legend.
+ this.chart.responsive.enabled = true;
+
+
+
+ }
+}
diff --git a/otf-frontend/client/src/app/layout/components/stats/schedule/schedule.component.pug b/otf-frontend/client/src/app/layout/components/stats/schedule/schedule.component.pug
new file mode 100644
index 0000000..b612b28
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/schedule/schedule.component.pug
@@ -0,0 +1,34 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+hr
+div(*ngIf=dataSource).container
+ table(mat-table [dataSource]="dataSource")
+ ng-container(matColumnDef="name")
+ th(mat-header-cell *matHeaderCellDef) Name
+ td(mat-cell *matCellDef='let element') {{element.name}}
+
+ ng-container(matColumnDef="dateExec")
+ th(mat-header-cell *matHeaderCellDef) Date
+ td(mat-cell *matCellDef='let element') {{element.dateExec}}
+
+ ng-container(matColumnDef="timeExec")
+ th(mat-header-cell *matHeaderCellDef) Time
+ td(mat-cell *matCellDef='let element') {{element.timeExec}}
+
+
+ tr(mat-header-row *matHeaderRowDef="displayedColumns")
+ tr(mat-row *matRowDef="let row; columns: displayedColumns;")
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/components/stats/schedule/schedule.component.scss b/otf-frontend/client/src/app/layout/components/stats/schedule/schedule.component.scss
new file mode 100644
index 0000000..1291718
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/schedule/schedule.component.scss
@@ -0,0 +1,28 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.container{
+ overflow: auto;
+}
+
+table{
+ height: 100%;
+ width: 100%;
+}
+
+td, th{
+ font-size: 14px;
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/components/stats/schedule/schedule.component.spec.ts b/otf-frontend/client/src/app/layout/components/stats/schedule/schedule.component.spec.ts
new file mode 100644
index 0000000..14cb457
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/schedule/schedule.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ScheduleComponent } from './schedule.component';
+
+describe('ScheduleComponent', () => {
+ let component: ScheduleComponent;
+ let fixture: ComponentFixture<ScheduleComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ScheduleComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ScheduleComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/components/stats/schedule/schedule.component.ts b/otf-frontend/client/src/app/layout/components/stats/schedule/schedule.component.ts
new file mode 100644
index 0000000..a8a04ce
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/schedule/schedule.component.ts
@@ -0,0 +1,71 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, NgZone, ChangeDetectorRef } from '@angular/core';
+//import material from "@amcharts/amcharts4/themes/material";
+import am4themes_animated from "@amcharts/amcharts4/themes/animated";
+import { GroupService } from 'app/shared/services/group.service';
+import { StatsService } from '../stats.service';
+import { Observable, Subject } from 'rxjs';
+
+export interface ScheduleElement {
+ name: string;
+ dateExec: string;
+ timeExec: string;
+}
+
+@Component({
+ selector: 'app-schedule',
+ templateUrl: './schedule.component.pug',
+ styleUrls: ['./schedule.component.scss']
+})
+
+export class ScheduleComponent implements OnInit {
+
+ protected stats: StatsService;
+ public doneLoadingfalse;
+ public dataSource;
+
+ displayedColumns: string[] = ['name', 'dateExec', 'timeExec'];
+
+ constructor(private zone: NgZone, private _groups: GroupService, private statsService: StatsService, private changeDetector: ChangeDetectorRef) {
+ this.stats = statsService;
+ }
+
+ ngOnInit() {
+
+ this.stats.onDefaultDataCallFinished().subscribe(res => {
+ this.dataSource = this.stats.getData("Schedule");
+ })
+ this.dataSource = this.stats.getData("Schedule");
+
+ this.refresh();
+ }
+
+ defaultDataListener(): Observable<Object> {
+ return this.stats.finishedDefaultData;
+ }
+
+ refresh(){
+ this.stats.onScheduleChangeFinished().subscribe(res => {
+ this.dataSource = this.stats.getData("Schedule");
+ this.dataSource = this.dataSource.slice();
+
+ this.changeDetector.detectChanges();
+ })
+ }
+
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/components/stats/stats.service.spec.ts b/otf-frontend/client/src/app/layout/components/stats/stats.service.spec.ts
new file mode 100644
index 0000000..59cd997
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/stats.service.spec.ts
@@ -0,0 +1,28 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestBed } from '@angular/core/testing';
+
+import { StatsService } from './stats.service';
+
+describe('StatsService', () => {
+ beforeEach(() => TestBed.configureTestingModule({}));
+
+ it('should be created', () => {
+ const service: StatsService = TestBed.get(StatsService);
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/components/stats/stats.service.ts b/otf-frontend/client/src/app/layout/components/stats/stats.service.ts
new file mode 100644
index 0000000..31d872c
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/stats.service.ts
@@ -0,0 +1,765 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from '@angular/core';
+import { FeathersService } from 'app/shared/services/feathers.service';
+import { TestExecutionService } from 'app/shared/services/test-execution.service';
+import { Observable, Subject, from } from 'rxjs';
+import { MatDialog } from '@angular/material';
+import { GroupService } from 'app/shared/services/group.service';
+import * as moment from 'moment';
+import { SchedulingService } from 'app/shared/services/scheduling.service';
+import { TestInstanceService } from 'app/shared/services/test-instance.service';
+import { string, number } from '@amcharts/amcharts4/core';
+import { group } from '@angular/animations';
+export interface StatsFilter {
+ startDate?: Date,
+ endDate?: Date,
+ selectedTestDefinitions?: Array<any>,
+ selectedTestInstances?: Array<any>
+}
+
+@Injectable({
+ providedIn: 'root'
+})
+
+//this service serves as the controller between the dashboard's data management and the components' UI.
+export class StatsService {
+
+ //set default filters
+ public filters: StatsFilter = {
+ startDate: moment().subtract(1, 'weeks').toDate(),
+ endDate: moment().toDate()
+ }
+
+ public executionList: Array<any> = [];
+
+ public testDefinitionData = {
+ //Executions Array thats made of objects with date, test definition name, and count
+ "Executions": [],
+ //Array of Results for the Pie Chart
+ "Results": [],
+ }
+ public testInstanceData = {
+ //Executions for Each Test Instance
+ "Executions": [],
+ //For multilinechart, objects made of test instance names, and execution count for each one.
+ "Individual_Exec": []
+ };
+
+ //list if test instance names
+ public testInstances = [];
+ //list of scheduled tests gotten from agenda in db.
+ public scheduledTests = [];
+
+ //these are filter objects attached to stats service that are updated whenever user confirms from filter modal.
+ //They are updated in the filter functions below.
+ // public tdFilters = {
+ // startDate: {},
+ // endDate: {},
+ // selected: [],
+ // }
+ // public tiFilters = {
+ // startDate: {},
+ // endDate: {},
+ // selectedTDs: [],
+ // selectedTIs: [],
+ // //this limit is for the amount of multiple series being displayed on the multiline chart according to default/filters.
+ // multiLineLimit: 5,
+ // }
+ // public scheduleFilters = {
+ // startDate: {},
+ // endDate: {},
+ // timeRangeStart: {},
+ // timeRangeEnd: {},
+ // selectedInstances: [],
+ // }
+
+ //these are for triggering the listeners located in the chart components.
+ //executionsChange subjects are triggered when user filters.
+ public tdExecutionsChange: Subject<Object> = new Subject<Object>();
+ public tiExecutionsChange: Subject<Object> = new Subject<Object>();
+ public scheduleChange: Subject<Object> = new Subject<Object>();
+ public finishedDefaultData: Subject<Object> = new Subject<Object>();
+ public startDefaultData: Subject<Object> = new Subject<Object>();
+ public startTDExecutionCall: Subject<Object> = new Subject<Object>();
+ public startTIExecutionCall: Subject<Object> = new Subject<Object>();
+ public windowResized: Subject<Object> = new Subject<Object>();
+ public startScheduleCall: Subject<Object> = new Subject<Object>();
+
+ constructor(public feathers: FeathersService, public testExecution: TestExecutionService,
+ public _groups: GroupService, public testInstanceService: TestInstanceService, public schedService: SchedulingService) {
+
+ //listening for whether user changes group, if so, variables are reset (rest are inside defaultData, we can work on consistency).
+ //and we get default data for the new group passed in.
+ // this.getDefaultData(this._groups.getGroup());
+ // this._groups.groupChange().subscribe(group => {
+ // this.getDefaultData(group);
+ // });
+
+ }
+
+
+
+ //these are trigger functions that we call in the data manipulating functions below.
+ //the purpose of these functions is to let the listeners set up in the chart components know that the data has been updated.
+ //then the chart components recall the data using getData().
+ checkWindow() {
+ return this.windowResized;
+ }
+
+ onDefaultDataCallStarted() {
+ return this.startDefaultData;
+ }
+
+ onTDExecutionChangeStarted() {
+ return this.startTDExecutionCall;
+ }
+
+ onTIExecutionChangeStarted() {
+ return this.startTIExecutionCall;
+ }
+
+ onScheduleChangeStarted() {
+ return this.startScheduleCall;
+ }
+
+ onDefaultDataCallFinished() {
+ return this.finishedDefaultData;
+ }
+
+ onTDExecutionChangeFinished() {
+ return this.tdExecutionsChange;
+ }
+
+ onTIExecutionChangeFinished() {
+ return this.tiExecutionsChange;
+ }
+
+ onScheduleChangeFinished() {
+ return this.scheduleChange;
+ }
+
+ //one giant getter where we pass in the name of what we want and switch case it.
+
+ //This function is called in the components and returns the relavent array for the component.
+ getData(name: string) {
+ let outputData = {};
+
+ switch (name) {
+ case "TD_Executions":
+ return this.testDefinitionData.Executions;
+ case "TD_Results":
+ return this.testDefinitionData.Results;
+ case "testInstances":
+ return this.testInstanceData.Executions;
+ case "Schedule":
+ return this.scheduledTests;
+ // case "multiLineData":
+ // //limitting the series being displayed.
+ // return this.testInstanceData.Individual_Exec.slice(0, this.tiFilters.multiLineLimit);
+ }
+ //console.log(outputData);
+ return outputData;
+ }
+
+ //this gets called from the filter modal when the user confirms their filters.
+ filterData(allFilters, tdFilters, tiFilters, schedFilters) {
+ //this.filterAll(allFilters);
+ this.filterTDs(tdFilters);
+ this.filterTIs(tiFilters);
+ this.filterSchedule(schedFilters)
+ }
+
+ //this is still under the works, the purpose of this is to filter ALL the components of the dashboard if they have common filtering grounds.
+ filterAll(allFilters) {
+ //console.log('Filtering everything')
+ //console.log(allFilters);
+ if (allFilters.startDate != "" || allFilters.endDate != "") {
+ if (allFilters.endDate == "") {
+ this.testDefinitionData.Executions = this.testDefinitionData.Executions.filter(execution => (
+ execution.startTime >= allFilters.startDate
+ ))
+ } else if (allFilters.startDate == "") {
+ this.testDefinitionData.Executions = this.testDefinitionData.Executions.filter(execution => (
+ execution.startTime <= allFilters.endDate
+ ))
+ } else {
+ this.testDefinitionData.Executions = this.testDefinitionData.Executions.filter(execution => (
+ execution.startTime >= allFilters.startDate &&
+ execution.date <= allFilters.endDate
+ ))
+ }
+ }
+ }
+
+ /*
+ this function takes in test definition filters and queries data accordingly.
+ improvement needed: if the filters provided do not require querying at all, the function should narrow the currently existing data. This
+ will be faster than requerying in those cases and improve loading times.
+ */
+ async filterTDs(tdFilters) {
+
+ /*
+ checking if the filters passed in are empty, if so do nothing, if not, trigger a start call that lets the components know querying is going to begin.
+ these start..Call() functions are so chart components can turn on their loading indicators.
+ */
+ // if (tdFilters.startDate == "" && tdFilters.endDate == "" && tdFilters.selected.length == 0) return;
+ // else this.startTDExecutionCall.next(tdFilters);
+
+ // //updating filter objects attached to stats service so we can use the service getters to get them where we want in the charts component code.
+ // this.tdFilters = tdFilters;
+
+ // //if no range is passed in we use the default range of past 2 months.
+ // let startDate = tdFilters.startDate == "" ? new Date(moment().subtract(2, 'weeks').format('L')) : new Date(tdFilters.startDate);
+ // let endDate = tdFilters.endDate == "" ? moment().toDate() : new Date(tdFilters.endDate);
+ // //update service filters accordingly.
+ // this.tdFilters.startDate = startDate;
+ // this.tdFilters.endDate = endDate;
+ //variable of id's of the test definitions selected in the filters.
+ let selectedIDs = this.filters.selectedTestDefinitions.map(item => item.id);
+
+ //Promise that queries the data according the filters. We use a promise so we wait for the data to query before the components render.
+ await new Promise((resolve, reject) => {
+
+ //feathers query time.
+ this.testExecution.find({
+ //get the data relevant to the group.
+ groupId: this._groups.getGroup()["_id"],
+ //thse are gonna go in the data objects.
+ $select: [
+ 'historicTestDefinition.testName',
+ 'startTime',
+ 'testResult'
+ ],
+ //UNLIMITED DATA BABY.
+ $limit: -1,
+ //sort according to ascending dates.
+ $sort: {
+ startTime: 1,
+ },
+ //select the start and end dates from the filter dates.
+ startTime: {
+ $gte: this.filters.startDate,
+ $lte: this.filters.endDate,
+ },
+ //select the test definitions according to the selected ones in the filters.
+ 'historicTestDefinition._id': {
+ $in: selectedIDs
+ }
+ }).subscribe(result => {
+
+ //console.log(result)
+
+ //resetting real quick cuz why not.
+ this.testDefinitionData = {
+ "Executions": [],
+ "Results": [],
+ }
+
+ //pretty self explanitory.
+ let fetchedData = result as Array<any>;
+ let currentExecutionsData = this.testDefinitionData.Executions;
+
+ /*
+ for each new fetched json we got with the selected stuff we specified in the feathers query,
+ we need to organize and distribute them accordingly to our service's data objects. For example, the json objects consist of
+ 'historicTestDefinition.testName',
+ 'startTime',
+ 'testResult',
+ test results belong in the results array, the rest needs to be organzied in the executions array,
+ thats what the populate methods are for.
+ */
+ for (let index in fetchedData) {
+ let newItem = fetchedData[index];
+
+ //for consistency we're supposed to pass current data to both we'll fix that later, but for now the piechart one just calls the current results data
+ //inside itself.
+ this.populateLineChartData(newItem, currentExecutionsData);
+ this.populatePieChartData(newItem);
+ }
+ resolve();
+ })
+ }).then(res => {
+ //console.log(res);
+
+ //trigger that querying is done and the test definition executions data has been changed. Line chart and pie chart listen for this.
+ this.tdExecutionsChange.next(res);
+ })
+ }
+
+ //similar stuffies. just small differences.
+ async filterTIs(tiFilters) {
+
+ // if (tiFilters.startDate == "" && tiFilters.endDate == "" && tiFilters.selectedTDs.length == 0 && tiFilters.selectedTIs.length == 0) return;
+ // else this.startTIExecutionCall.next(tiFilters);
+
+ // this.tiFilters = tiFilters;
+ // if (tiFilters.selectedTIs.length > 0 && tiFilters.selectedTDs.length > 0) this.tiFilters.multiLineLimit = tiFilters.selectedTIs.length + tiFilters.selectedTDs.length;
+ // else if (tiFilters.selectedTIs.length > 0) this.tiFilters.multiLineLimit = tiFilters.selectedTIs.length;
+ // else if (tiFilters.selectedTDs.length > 0) this.tiFilters.multiLineLimit = tiFilters.selectedTDs.length;
+ // else this.tiFilters.multiLineLimit = 5;
+
+ // let startDate = tiFilters.startDate == "" ? new Date(moment().subtract(2, 'weeks').format('L')) : new Date(tiFilters.startDate);
+ // let endDate = tiFilters.endDate == "" ? moment().toDate() : new Date(tiFilters.endDate);
+
+ // this.tiFilters.startDate = startDate;
+ // this.tiFilters.endDate = endDate;
+ // console.log(tiFilters.selectedTDs)
+
+ await new Promise((resolve, reject) => {
+ this.testExecution.find({
+ groupId: this._groups.getGroup()["_id"],
+ $limit: -1,
+ startTime: {
+ $gte: this.filters.startDate,
+ $lte: this.filters.endDate,
+ },
+ $select: [
+ 'startTime',
+ 'endTime',
+ 'historicTestDefinition.testName',
+ 'historicTestInstance.testInstanceName',
+ ],
+ $or: [
+ {
+ 'historicTestDefinition._id': {
+ $in: tiFilters.selectedTDs
+ }
+ },
+ {
+ 'historicTestInstance._id': {
+ $in: tiFilters.selectedTIs
+ }
+ }
+ ]
+
+ }).subscribe(result => {
+ this.testInstanceData = {
+ "Executions": [],
+ "Individual_Exec": []
+ }
+ //console.log(result)
+ let fetchedData = result as Array<any>;
+ for (let index in fetchedData) {
+ let newItem = fetchedData[index];
+ this.populateBarChartData(newItem);
+ this.populateMultiLineChartData(newItem);
+ }
+ this.testInstanceData.Executions.sort((a, b) => b.Count - a.Count);
+ this.testInstanceData.Individual_Exec.sort((a, b) => b.total - a.total);
+
+ resolve();
+ })
+ }).then(res => {
+ this.tiExecutionsChange.next(res);
+ //console.log(this.testInstanceData.Executions);
+ })
+
+ }
+
+ //similar stuffies just smol differneces.
+ async filterSchedule(schedFilters) {
+
+ //console.log(schedFilters);
+ // this.scheduleFilters = schedFilters;
+ // //console.log(schedFilters.selectedInstances);
+
+ // if (schedFilters.startDate == "" &&
+ // schedFilters.endDate == "" &&
+ // schedFilters.selectedInstances.length == 0) {
+ // return;
+ // } else this.startScheduleCall.next(schedFilters);
+
+ // let startDate = schedFilters.startDate == "" ? new Date(moment().toDate()) : new Date(schedFilters.startDate);
+ // let endDate = schedFilters.endDate == "" ? new Date(moment().add(2, 'weeks').format('L')) : new Date(schedFilters.endDate);
+
+ // this.scheduleFilters.startDate = startDate;
+ // this.scheduleFilters.endDate = endDate;
+
+
+ this.schedService.find({
+ $select: ["data.testSchedule._testInstanceId", 'nextRunAt'],
+ $limit: -1,
+ }).subscribe(result => {
+ this.scheduledTests = [];
+ //console.log(result);
+ let fetchedData = result as Array<any>;
+ let resultingData: Array<any> = fetchedData;
+ if (schedFilters.selectedInstances.length !== 0) {
+ resultingData = fetchedData.filter(el => {
+ let fetchedID = el.data.testSchedule._testInstanceId;
+ let selectedIDs = schedFilters.selectedInstances as Array<any>;
+ let condition = selectedIDs.includes(fetchedID.toString());
+ //console.log(condition);
+ return condition;
+ })
+ }
+
+ resultingData = resultingData.filter(el => {
+ let schedDate = new Date(el.nextRunAt);
+ return schedDate >= this.filters.startDate && schedDate <= this.filters.endDate;
+ })
+
+ for (let index in resultingData) {
+ let checkIfTestBelongsToUserGroup = this.testInstances.findIndex(testInstances => testInstances.id === resultingData[index].data.testSchedule._testInstanceId);
+ if (checkIfTestBelongsToUserGroup >= 0) {
+ if (resultingData[index].nextRunAt) {
+ let d1 = new Date(resultingData[index].nextRunAt);
+ this.scheduledTests.push({
+ id: resultingData[index].data.testSchedule._testInstanceId,
+ name: this.testInstances[checkIfTestBelongsToUserGroup].name,
+ dateExec: d1.toDateString(),
+ timeExec: d1.toLocaleTimeString()
+ })
+ }
+ }
+ }
+ this.scheduleChange.next();
+ });
+
+
+
+ }
+
+ //getters for the filter objects.
+ // getTDFilters() {
+ // return this.tdFilters;
+ // }
+
+ // getTIFilters() {
+ // return this.tiFilters;
+ // }
+
+ // getSchedFilters() {
+ // return this.scheduleFilters;
+ // }
+
+ calcTime(execution) {
+ var end = new Date(execution.endTime);
+ var start = new Date(execution.startTime);
+ var executionTime = (end.getTime() - start.getTime()) / 1000;
+ return executionTime;
+ }
+
+ //This function takes an execution that was retrieved from the Database and takes the data it needs for the line chart.
+ populateLineChartData(execution, currentData) {
+ let executionDate = new Date(execution.startTime)
+
+ // Looks to see if the date already has an execution./
+ let indexOfItemFound = currentData.findIndex((element) => {
+
+ return (
+ executionDate.getFullYear() === element.date.getFullYear() &&
+ executionDate.getMonth() === element.date.getMonth() &&
+ executionDate.getDate() === element.date.getDate()
+ )
+ })
+
+ //If the date is not found. Push a new date into the array with a count of one
+ if (currentData[indexOfItemFound] == undefined) {
+ currentData.push({
+ date: new Date(executionDate.getFullYear(), executionDate.getMonth(), executionDate.getDate()),
+ count: 1
+ })
+ // else update the count
+ } else currentData[indexOfItemFound].count += 1;
+ }
+
+
+ //Takes an execution and pushes the result/count or updates the count. For the Pie Chart
+ populatePieChartData(execution) {
+
+ //Check if result is already present in the array.
+ var checkIfPresent = this.testDefinitionData.Results.find(Results => Results.Name === execution.testResult);
+
+ //If not present, add it to TOPSTATs with a default count of 1.
+ if (!checkIfPresent) {
+
+ var color;
+ //Set the color for the pie chart.
+ if (execution.testResult == "COMPLETED"){
+ color = "#0D47A1";
+ }else if (execution.testResult == "FAILED")
+ color = "#DD2C00";
+ else if (execution.testResult == "UNKNOWN")
+ color = "#C4CBD4";
+ else if (execution.testResult == "SUCCESS")
+ color = "#42d660";
+ else if (execution.testResult == "success")
+ color = "#42d660";
+ else if (execution.testResult == "STARTED")
+ color = "#29E3E8";
+ else if (execution.testResult == "FAILURE")
+ color = "#FC9100";
+ else if (execution.testResult == "STOPPED")
+ color = "#900C3F";
+ else if (execution.testResult == "TERMINATED")
+ color = "#AC00FC";
+ else if (execution.testResult == "UNAUTHORIZED")
+ color = "#7A6E6E";
+ else if (execution.testResult == "DOES_NOT_EXIST")
+ color = "#000000";
+ else if (execution.testResult == "ERROR")
+ color = "#eb2acd"
+ else if (execution.testResult == "WORKFLOW_ERROR")
+ color = "#194f24"
+ else
+ color = "#000000".replace(/0/g, function () { return (~~(Math.random() * 16)).toString(16); });
+
+ //Push the execution with the count and color.
+ this.testDefinitionData.Results.push({ Name: execution.testResult, Count: 1, color: color });
+ } else {
+
+ //Find index of the testResult and update the count by 1.
+ var position = this.testDefinitionData.Results.findIndex(Results => Results.Name === execution.testResult);
+ this.testDefinitionData.Results[position].Count += 1;
+ }
+ }
+
+ //Takes an execution and pushes result into the barchart.
+ populateBarChartData(execution) {
+
+ //check if test instance is present in the array.
+ var checkIfPresent = this.testInstanceData.Executions.find(Instances => Instances.id === execution.historicTestInstance._id);
+
+ //calculates the time it took for the execution/
+ var executionTime = this.calcTime(execution);
+
+ //If execution is not present, push the test instance with a count of 1.
+ if (!checkIfPresent) {
+ //If not present, add it to testInstanceData with a default count of 1.
+
+ this.testInstanceData.Executions.push({
+ Name: execution.historicTestInstance.testInstanceName,
+ id: execution.historicTestInstance._id,
+ testResult: execution.testResult,
+ executionTime: executionTime,
+ Count: 1,
+ Average: executionTime
+ });
+ } else {
+ // If Present update count and execution time.
+ var position = this.testInstanceData.Executions.findIndex(Instances => Instances.id === execution.historicTestInstance._id);
+ this.testInstanceData.Executions[position].Count += 1;
+ this.testInstanceData.Executions[position].executionTime += executionTime;
+ this.testInstanceData.Executions[position].Average = this.testInstanceData.Executions[position].executionTime / this.testInstanceData.Executions[position].Count;
+ }
+
+ }
+
+ //queries data for the scheduled tests.
+ getScheduledTests(groupId) {
+
+ //Queries a list of test instances by group ID
+ this.testInstanceService.find({
+ groupId: groupId['_id'],
+ $select: ["_id", "testInstanceName", "groupId"],
+ $limit: -1
+ }).subscribe(result => {
+
+ //Iterate through the list and add the test instances to the list.
+ for (var index in result) {
+ var checkIfPresent = this.testInstances.find(id => id === result[index]._id);
+ if (!checkIfPresent)
+ this.testInstances.push({ id: result[index]._id, name: result[index].testInstanceName });
+ }
+ });
+
+ //Queries all of the scheduled tests.
+ this.schedService.find({
+
+ $select: ["data.testSchedule._testInstanceId", 'nextRunAt'],
+ $limit: -1,
+ $sort: {
+ startTime: 1
+ },
+
+ }).subscribe(result => {
+
+ this.scheduledTests = [];
+ for (var index in result) {
+
+ //If the scheduled testinstance is owned by the group, push the result.
+ var checkIfTestBelongsToUserGroup = this.testInstances.findIndex(testInstances => testInstances.id === result[index].data.testSchedule._testInstanceId);
+ if (checkIfTestBelongsToUserGroup >= 0) {
+
+ //If the next run at is valid, the test is scheduled.
+ if (result[index].nextRunAt) {
+ let d1 = new Date(result[index].nextRunAt);
+ this.scheduledTests.push({
+ id: result[index].data.testSchedule._testInstanceId,
+ name: this.testInstances[checkIfTestBelongsToUserGroup].name,
+ dateExec: d1.toDateString(),
+ timeExec: d1.toLocaleTimeString()
+ });
+ }
+ }
+ }
+ });
+ }
+
+ //populate multi line chart
+ populateMultiLineChartData(execution) {
+
+ let executionDate = new Date(execution.startTime)
+ let currentData = this.testInstanceData.Individual_Exec;
+ let count = 1;
+ //find if Instance is already present in the array.
+ let position = this.testInstanceData.Individual_Exec.findIndex(Instances => Instances.id === execution.historicTestInstance._id);
+
+ //First execution for this instance
+ if (currentData[position] == undefined) {
+ currentData.push({
+ testInstanceName: execution.historicTestInstance.testInstanceName,
+ testDefinitionName: execution.historicTestDefinition.testDefintionName,
+ id: execution.historicTestInstance._id,
+ dateData: [{ date: executionDate, count: count, name: execution.historicTestInstance.testInstanceName }],
+ total: 1
+ })
+ //execution already present
+ } else {
+ //find index of Date
+ let indexOfDate = currentData[position].dateData.findIndex((element) => {
+ return (
+ executionDate.getFullYear() === element.date.getFullYear() &&
+ executionDate.getMonth() === element.date.getMonth() &&
+ executionDate.getDate() === element.date.getDate()
+ )
+ });
+
+ //Check if the exeuction date is valid for this instance. If it is not present, push a new date and count.
+ if (currentData[position].dateData[indexOfDate] == undefined) {
+ let count = 1;
+ //Push the new Date
+ currentData[position].dateData.push({ date: executionDate, count: count, name: execution.historicTestInstance.testInstanceName, id: execution.historicTestInstance._id});
+ currentData[position].total++;
+ } else {
+ //date is already present
+ currentData[position].dateData[indexOfDate].count++;
+ currentData[position].total++;
+ }
+ }
+ }
+ //Gets the initial data for the default page.
+ async getDefaultData(group, query?) {
+ if(!group){
+ return;
+ }
+
+ this.scheduledTests = [];
+
+ this.startDefaultData.next(group);
+ let groupId = group;
+ //let startDate = moment().subtract(2, 'weeks').toDate();
+
+ //query sheduled tests
+ //this.getScheduledTests(group);
+
+ if(!query){
+ query = {
+ groupId: groupId['_id'],
+ $select: [
+ 'startTime',
+ 'endTime',
+ "historicTestDefinition._id",
+ "historicTestDefinition.testName",
+ "historicTestInstance._id",
+ "historicTestInstance.testInstanceName",
+ "testHeadResults.startTime",
+ "testHeadResults.endTime",
+ "testHeadResults.testHeadName",
+ "testHeadResults.testHeadId",
+ "testHeadResults.testHeadGroupId",
+ "testHeadResults.statusCode",
+ 'testResult'
+ ],
+ $limit: -1,
+ $sort: {
+ startTime: 1
+ },
+ startTime: {
+ $gte: this.filters.startDate,
+ $lte: this.filters.endDate
+ }
+ }
+ }
+
+ //Query test Executions
+ await new Promise((resolve, reject) => {
+ this.testExecution.find(query).subscribe(result => {
+
+ //reset arrays
+ this.testDefinitionData = {
+ //Executions Array thats made of objects with date, tdName, result
+ "Executions": [],
+ "Results": [],
+ }
+ this.testInstanceData = {
+ "Executions": [],
+ "Individual_Exec": []
+ };
+
+ this.executionList = result as Array<any>;
+ let currentData = this.testDefinitionData.Executions;
+
+
+
+ //iterate through the results and populate the appropriate arrays.
+ for (let index in this.executionList) {
+
+ let newItem = this.executionList[index];
+
+ //get default line chart Data
+ this.populateLineChartData(newItem, currentData);
+
+ //get pie chart data.
+ this.populatePieChartData(newItem);
+
+ //Get BarChart Data
+ //this.populateBarChartData(newItem);
+
+ //get multi line chart data
+ //this.populateMultiLineChartData(newItem);
+ }
+
+ //sort the two arrays descending.
+ this.testInstanceData.Executions.sort((a, b) => b.Count - a.Count);
+ this.testInstanceData.Individual_Exec.sort((a, b) => b.total - a.total);
+ resolve();
+ }, err => {
+ reject(err);
+ });
+ }).then(res => {
+
+ // this.tdFilters = {
+ // startDate: moment().subtract(2, 'weeks').toDate(),
+ // endDate: moment().toDate(),
+ // selected: [],
+ // };
+ // this.tiFilters = {
+ // startDate: moment().subtract(2, 'weeks').toDate(),
+ // endDate: moment().toDate(),
+ // selectedTDs: [],
+ // selectedTIs: [],
+ // multiLineLimit: 5,
+ // }
+ this.finishedDefaultData.next(res);
+ })
+ }
+
+
+}
diff --git a/otf-frontend/client/src/app/layout/components/stats/test-definition-executions-bar-chart/test-definition-executions-bar-chart.component.pug b/otf-frontend/client/src/app/layout/components/stats/test-definition-executions-bar-chart/test-definition-executions-bar-chart.component.pug
new file mode 100644
index 0000000..b44afa2
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/test-definition-executions-bar-chart/test-definition-executions-bar-chart.component.pug
@@ -0,0 +1,17 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div(#chart, [style.height]="height")
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/components/stats/test-definition-executions-bar-chart/test-definition-executions-bar-chart.component.scss b/otf-frontend/client/src/app/layout/components/stats/test-definition-executions-bar-chart/test-definition-executions-bar-chart.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/test-definition-executions-bar-chart/test-definition-executions-bar-chart.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/layout/components/stats/test-definition-executions-bar-chart/test-definition-executions-bar-chart.component.spec.ts b/otf-frontend/client/src/app/layout/components/stats/test-definition-executions-bar-chart/test-definition-executions-bar-chart.component.spec.ts
new file mode 100644
index 0000000..70410d8
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/test-definition-executions-bar-chart/test-definition-executions-bar-chart.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TestDefinitionExecutionsBarChartComponent } from './test-definition-executions-bar-chart.component';
+
+describe('TestDefinitionExecutionsBarChartComponent', () => {
+ let component: TestDefinitionExecutionsBarChartComponent;
+ let fixture: ComponentFixture<TestDefinitionExecutionsBarChartComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TestDefinitionExecutionsBarChartComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TestDefinitionExecutionsBarChartComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/components/stats/test-definition-executions-bar-chart/test-definition-executions-bar-chart.component.ts b/otf-frontend/client/src/app/layout/components/stats/test-definition-executions-bar-chart/test-definition-executions-bar-chart.component.ts
new file mode 100644
index 0000000..866de65
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/test-definition-executions-bar-chart/test-definition-executions-bar-chart.component.ts
@@ -0,0 +1,198 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, ViewChild, ElementRef, Input, OnDestroy } from '@angular/core';
+import { StatsService } from '../stats.service';
+import * as am4core from "@amcharts/amcharts4/core";
+import * as am4charts from "@amcharts/amcharts4/charts";
+import { e } from '@angular/core/src/render3';
+import * as moment from 'moment';
+import { Router } from '@angular/router';
+import { Subscription } from 'rxjs';
+
+@Component({
+ selector: 'app-test-definition-executions-bar-chart',
+ templateUrl: './test-definition-executions-bar-chart.component.pug',
+ styleUrls: ['./test-definition-executions-bar-chart.component.scss']
+})
+export class TestDefinitionExecutionsBarChartComponent implements OnInit, OnDestroy {
+
+ private toDestroy: Array<Subscription> = [];
+
+ @ViewChild('chart') chartElement: ElementRef;
+ @Input() height: string;
+
+ public chart: am4charts.XYChart;
+ public testInstanceData;
+ public loadingIndicator;
+
+ constructor(private stats: StatsService, private router: Router) {}
+
+
+ ngOnInit() {
+ this.renderChart();
+
+ this.toDestroy.push(this.stats.onDefaultDataCallStarted().subscribe(res => {
+ this.showLoadingIndicator();
+ }));
+
+ this.toDestroy.push(this.stats.onTIExecutionChangeStarted().subscribe(res => {
+ this.showLoadingIndicator();
+ }));
+
+ this.toDestroy.push(this.stats.onDefaultDataCallFinished().subscribe(res => {
+ this.setChartData();
+ }));
+
+ this.toDestroy.push(this.stats.onTIExecutionChangeFinished().subscribe(res => {
+ this.setChartData()
+ }));
+
+ }
+
+ ngOnDestroy() {
+ this.toDestroy.forEach(e => e.unsubscribe());
+ this.chart.dispose();
+ }
+
+ showLoadingIndicator() {
+ if(!this.loadingIndicator){
+ this.loadingIndicator = this.chart.tooltipContainer.createChild(am4core.Container);
+ this.loadingIndicator.background.fill = am4core.color("#fff");
+ this.loadingIndicator.background.fillOpacity = 0.8;
+ this.loadingIndicator.width = am4core.percent(100);
+ this.loadingIndicator.height = am4core.percent(100);
+
+ let indicatorLabel = this.loadingIndicator.createChild(am4core.Label);
+ indicatorLabel.text = "Loading..";
+ indicatorLabel.align = "center";
+ indicatorLabel.valign = "middle";
+ indicatorLabel.fontSize = 18;
+ indicatorLabel.fontWeight= "bold";
+ indicatorLabel.dy = 50;
+
+ let loadingImage = this.loadingIndicator.createChild(am4core.Image);
+ //loadingImage.href = "https://img.devrant.com/devrant/rant/r_647810_4FeCH.gif";
+ loadingImage.href = "/assets/images/equalizer.gif";
+ //loadingImage.dataSource = "/loading-pies.svg"
+ loadingImage.align = "center";
+ loadingImage.valign = "middle";
+ loadingImage.horizontalCenter = "middle";
+ loadingImage.verticalCenter = "middle";
+ loadingImage.scale = 3.0;
+ }else{
+ this.loadingIndicator.show();
+ }
+
+ }
+
+ hideLoadingIndicator() {
+ this.loadingIndicator.hide();
+ }
+
+ setChartData() {
+
+ let data = [];
+ this.stats.executionList.forEach((execution, i) => {
+ let index = data.findIndex(e => e.id === execution.historicTestDefinition._id);
+ let executionTime = moment(execution.endTime).diff(moment(execution.startTime), 'seconds');
+ if(index == -1){
+ data.push({
+ id: execution.historicTestDefinition._id,
+ name: execution.historicTestDefinition.testName,
+ testResult: execution.testResult,
+ executionTime: executionTime,
+ count: 1,
+ average: executionTime
+ })
+ }else{
+ data[index].count += 1;
+ data[index].executionTime += executionTime;
+ data[index].average = (data[index].executionTime / data[index].count);
+ }
+ });
+ data.sort((a, b) => b.count - a.count);
+ this.chart.data = data;
+
+
+ // Displays the average time for each bar.
+ // If there is no time recorded for the Test Instance, display No Time Recorded.
+ let series = this.chart.series.values[0] as am4charts.ColumnSeries;
+
+ series.columns.template.adapter.add("tooltipText", (text, target) => {
+ if (target.dataItem) {
+ if (this.chart.data[target.dataItem.index].average > 0) {
+ return this.chart.data[target.dataItem.index].count.toString() + " Executions \n Avg Time: " + this.chart.data[target.dataItem.index].average.toFixed(2).toString() + " seconds";
+ } else
+ return this.chart.data[target.dataItem.index].count.toString() + " Executions \n No Time Recorded";
+ }
+ });
+ series.columns.template.adapter.add("fill", (fill, target) => this.chart.colors.getIndex(target.dataItem.index));
+
+
+ series.columns.template.events.on("doublehit", (click) => {
+ this.router.navigate(['/test-definitions', click.target.dataItem.dataContext['id']]);
+ });
+ this.chart.appear();
+ this.hideLoadingIndicator();
+
+ }
+
+ renderChart() {
+ this.chart = am4core.create(this.chartElement.nativeElement, am4charts.XYChart);
+ this.chart.cursor = new am4charts.XYCursor();
+ this.showLoadingIndicator();
+
+ this.chart.responsive.enabled = true;
+
+ // Create axes
+ var categoryAxis = this.chart.yAxes.push(new am4charts.CategoryAxis());
+ categoryAxis.dataFields.category = "name";
+ categoryAxis.numberFormatter.numberFormat = "#";
+ categoryAxis.renderer.inversed = true;
+ categoryAxis.renderer.minGridDistance = 5;
+ categoryAxis.title.fontSize = "10px";
+
+ var valueAxis = this.chart.xAxes.push(new am4charts.ValueAxis());
+ valueAxis.renderer.minWidth = 10;
+
+ // Create series
+ var series = this.chart.series.push(new am4charts.ColumnSeries());
+ series.dataFields.valueX = "count";
+ series.dataFields.categoryY = "name";
+ series.columns.template.tooltipText = " ";
+
+ let label = categoryAxis.renderer.labels.template;
+ label.truncate = true;
+ label.maxWidth = 130;
+ label.fontSize = 13;
+
+ //Scrollbar on the right.
+ let scrollBarY = new am4charts.XYChartScrollbar();
+ //scrollBarY.series.push(series);
+ this.chart.scrollbarY = scrollBarY;
+ this.chart.scrollbarY.contentHeight = 100;
+ this.chart.scrollbarY.minWidth = 20;
+ this.chart.scrollbarY.thumb.minWidth = 20;
+
+ //set initial Scrollbar Zoom to the Top 6 Instances.
+ this.chart.events.on("appeared", () => {
+
+ categoryAxis.zoomToIndexes(0, 6, false, true);
+ });
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/components/stats/test-head-execution-bar-chart/test-head-execution-bar-chart.component.pug b/otf-frontend/client/src/app/layout/components/stats/test-head-execution-bar-chart/test-head-execution-bar-chart.component.pug
new file mode 100644
index 0000000..b44afa2
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/test-head-execution-bar-chart/test-head-execution-bar-chart.component.pug
@@ -0,0 +1,17 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div(#chart, [style.height]="height")
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/components/stats/test-head-execution-bar-chart/test-head-execution-bar-chart.component.scss b/otf-frontend/client/src/app/layout/components/stats/test-head-execution-bar-chart/test-head-execution-bar-chart.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/test-head-execution-bar-chart/test-head-execution-bar-chart.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/layout/components/stats/test-head-execution-bar-chart/test-head-execution-bar-chart.component.spec.ts b/otf-frontend/client/src/app/layout/components/stats/test-head-execution-bar-chart/test-head-execution-bar-chart.component.spec.ts
new file mode 100644
index 0000000..351d650
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/test-head-execution-bar-chart/test-head-execution-bar-chart.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TestHeadExecutionBarChartComponent } from './test-head-execution-bar-chart.component';
+
+describe('TestHeadExecutionBarChartComponent', () => {
+ let component: TestHeadExecutionBarChartComponent;
+ let fixture: ComponentFixture<TestHeadExecutionBarChartComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TestHeadExecutionBarChartComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TestHeadExecutionBarChartComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/components/stats/test-head-execution-bar-chart/test-head-execution-bar-chart.component.ts b/otf-frontend/client/src/app/layout/components/stats/test-head-execution-bar-chart/test-head-execution-bar-chart.component.ts
new file mode 100644
index 0000000..9b17262
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/test-head-execution-bar-chart/test-head-execution-bar-chart.component.ts
@@ -0,0 +1,236 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, ViewChild, ElementRef, Input, OnDestroy } from '@angular/core';
+import * as moment from 'moment';
+import { Subscription } from 'rxjs';
+import { StatsService } from '../stats.service';
+import { Router } from '@angular/router';
+import * as am4core from "@amcharts/amcharts4/core";
+import * as am4charts from "@amcharts/amcharts4/charts";
+@Component({
+ selector: 'app-test-head-execution-bar-chart',
+ templateUrl: './test-head-execution-bar-chart.component.pug',
+ styleUrls: ['./test-head-execution-bar-chart.component.scss']
+})
+export class TestHeadExecutionBarChartComponent implements OnInit, OnDestroy {
+
+ private toDestroy: Array<Subscription> = [];
+
+ @ViewChild('chart') chartElement: ElementRef;
+ @Input() height: string;
+
+ public chart: am4charts.XYChart;
+ public testInstanceData;
+ public loadingIndicator;
+
+ constructor(private stats: StatsService, private router: Router) {}
+
+
+ ngOnInit() {
+
+ this.renderChart();
+
+ this.toDestroy.push(this.stats.onDefaultDataCallStarted().subscribe(res => {
+ this.showLoadingIndicator();
+ }));
+
+ this.toDestroy.push(this.stats.onTIExecutionChangeStarted().subscribe(res => {
+ this.showLoadingIndicator();
+ }));
+
+ this.toDestroy.push(this.stats.onDefaultDataCallFinished().subscribe(res => {
+ this.setChartData();
+ }));
+
+ this.toDestroy.push(this.stats.onTIExecutionChangeFinished().subscribe(res => {
+ this.setChartData()
+ }));
+
+ }
+
+ ngOnDestroy() {
+ this.toDestroy.forEach(e => e.unsubscribe());
+ this.chart.dispose();
+ }
+
+ showLoadingIndicator() {
+ if(!this.loadingIndicator){
+ this.loadingIndicator = this.chart.tooltipContainer.createChild(am4core.Container);
+ this.loadingIndicator.background.fill = am4core.color("#fff");
+ this.loadingIndicator.background.fillOpacity = 0.8;
+ this.loadingIndicator.width = am4core.percent(100);
+ this.loadingIndicator.height = am4core.percent(100);
+
+ let indicatorLabel = this.loadingIndicator.createChild(am4core.Label);
+ indicatorLabel.text = "Loading..";
+ indicatorLabel.align = "center";
+ indicatorLabel.valign = "middle";
+ indicatorLabel.fontSize = 18;
+ indicatorLabel.fontWeight= "bold";
+ indicatorLabel.dy = 50;
+
+ let loadingImage = this.loadingIndicator.createChild(am4core.Image);
+ //loadingImage.href = "https://img.devrant.com/devrant/rant/r_647810_4FeCH.gif";
+ loadingImage.href = "/assets/images/equalizer.gif";
+ //loadingImage.dataSource = "/loading-pies.svg"
+ loadingImage.align = "center";
+ loadingImage.valign = "middle";
+ loadingImage.horizontalCenter = "middle";
+ loadingImage.verticalCenter = "middle";
+ loadingImage.scale = 3.0;
+ }else{
+ this.loadingIndicator.show();
+ }
+
+ }
+
+ hideLoadingIndicator() {
+ this.loadingIndicator.hide();
+ }
+
+ incrementStatus(data, code){
+
+ if(code >= 200 && code < 300){
+ data["200"]++;
+ }else if(code >= 300 && code < 400){
+ data["300"]++;
+ }else if(code >= 400 && code < 500){
+ data["400"]++;
+ }else if(code >= 500 && code < 600){
+ data["500"]++;
+ }else{
+
+ data["other"]++;
+ }
+ }
+
+ setChartData() {
+
+ let data = [];
+ this.stats.executionList.forEach((execution, i) => {
+ execution.testHeadResults.forEach((result, val) => {
+ let index = data.findIndex(e => e.id === result.testHeadId);
+ let executionTime = moment(result.endTime).diff(moment(result.startTime), 'seconds');
+ if(index == -1){
+ let toPush = {
+ id: result.testHeadId,
+ name: result.testHeadName,
+ executionTime: executionTime,
+ count: 1,
+ average: executionTime,
+ "200": 0,
+ "300": 0,
+ "400": 0,
+ "500": 0,
+ "other": 0
+ }
+ this.incrementStatus(toPush, result.statusCode);
+ data.push(toPush);
+ }else{
+ this.incrementStatus(data[index], result.statusCode);
+ data[index].count += 1;
+ data[index].executionTime += executionTime;
+ data[index].average = (data[index].executionTime / data[index].count);
+ }
+ });
+ });
+ data.sort((a, b) => b.count - a.count);
+ this.chart.data = data;
+
+ // Displays the average time for each bar.
+ // If there is no time recorded for the Test Instance, display No Time Recorded.
+ let series = this.chart.series.values as Array<am4charts.ColumnSeries>;
+
+ // series.columns.template.adapter.add("tooltipText", (text, target) => {
+ // if (target.dataItem) {
+ // if (this.chart.data[target.dataItem.index].average > 0) {
+ // return this.chart.data[target.dataItem.index].count.toString() + " Executions \n Avg Time: " + this.chart.data[target.dataItem.index].average.toFixed(2).toString() + " seconds";
+ // } else
+ // return this.chart.data[target.dataItem.index].count.toString() + " Executions \n No Time Recorded";
+ // }
+ // });
+
+ series.forEach(elem => {
+ // elem.columns.template.adapter.add("fill", (fill, target) => this.chart.colors.getIndex(target.dataItem.index));
+
+
+ elem.columns.template.events.on("doublehit", (click) => {
+ this.router.navigate(['/test-heads', click.target.dataItem.dataContext['id']]);
+ });
+ })
+
+ this.chart.appear();
+ this.hideLoadingIndicator();
+ }
+
+ renderChart() {
+ this.chart = am4core.create(this.chartElement.nativeElement, am4charts.XYChart);
+
+ this.showLoadingIndicator();
+
+ this.chart.responsive.enabled = true;
+
+ // Create axes
+ var categoryAxis = this.chart.yAxes.push(new am4charts.CategoryAxis());
+ categoryAxis.dataFields.category = "name";
+ categoryAxis.numberFormatter.numberFormat = "#";
+ categoryAxis.renderer.inversed = true;
+ categoryAxis.renderer.minGridDistance = 5;
+ categoryAxis.title.fontSize = "10px";
+
+ var valueAxis = this.chart.xAxes.push(new am4charts.ValueAxis());
+ valueAxis.renderer.minWidth = 10;
+
+ this.createSeries("200", "200s")
+ this.createSeries("300", "300s")
+ this.createSeries("400", "400s")
+ this.createSeries("500", "500s")
+ this.createSeries("other", "Other")
+
+ this.chart.legend = new am4charts.Legend();
+ this.chart.legend.scale = .7;
+ this.chart.legend.width = am4core.percent(150);
+
+ let label = categoryAxis.renderer.labels.template;
+ label.truncate = true;
+ label.maxWidth = 130;
+ label.fontSize = 13;
+
+ //Scrollbar on the right.
+ let scrollBarY = new am4charts.XYChartScrollbar();
+ //scrollBarY.series.push(series);
+ this.chart.scrollbarY = scrollBarY;
+ this.chart.scrollbarY.contentHeight = 100;
+ this.chart.scrollbarY.minWidth = 20;
+ this.chart.scrollbarY.thumb.minWidth = 20;
+
+ //set initial Scrollbar Zoom to the Top 6 Instances.
+ this.chart.events.on("appeared", () => {
+ categoryAxis.zoomToIndexes(0, 6, false, true);
+ });
+ }
+
+ createSeries(field, name){
+ // Create series
+ var series = this.chart.series.push(new am4charts.ColumnSeries());
+ series.dataFields.valueX = field;
+ series.dataFields.categoryY = "name";
+ series.stacked = true;
+ series.name = name;
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/components/stats/test-head-executions-line-chart/test-head-executions-line-chart.component.pug b/otf-frontend/client/src/app/layout/components/stats/test-head-executions-line-chart/test-head-executions-line-chart.component.pug
new file mode 100644
index 0000000..b44afa2
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/test-head-executions-line-chart/test-head-executions-line-chart.component.pug
@@ -0,0 +1,17 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div(#chart, [style.height]="height")
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/components/stats/test-head-executions-line-chart/test-head-executions-line-chart.component.scss b/otf-frontend/client/src/app/layout/components/stats/test-head-executions-line-chart/test-head-executions-line-chart.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/test-head-executions-line-chart/test-head-executions-line-chart.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/layout/components/stats/test-head-executions-line-chart/test-head-executions-line-chart.component.spec.ts b/otf-frontend/client/src/app/layout/components/stats/test-head-executions-line-chart/test-head-executions-line-chart.component.spec.ts
new file mode 100644
index 0000000..af1de53
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/test-head-executions-line-chart/test-head-executions-line-chart.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TestHeadExecutionsLineChartComponent } from './test-head-executions-line-chart.component';
+
+describe('TestHeadExecutionsLineChartComponent', () => {
+ let component: TestHeadExecutionsLineChartComponent;
+ let fixture: ComponentFixture<TestHeadExecutionsLineChartComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TestHeadExecutionsLineChartComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TestHeadExecutionsLineChartComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/components/stats/test-head-executions-line-chart/test-head-executions-line-chart.component.ts b/otf-frontend/client/src/app/layout/components/stats/test-head-executions-line-chart/test-head-executions-line-chart.component.ts
new file mode 100644
index 0000000..a214c87
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/components/stats/test-head-executions-line-chart/test-head-executions-line-chart.component.ts
@@ -0,0 +1,219 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Input, ViewChild, ElementRef, OnDestroy } from '@angular/core';
+import { StatsService } from '../stats.service';
+import * as am4core from "@amcharts/amcharts4/core";
+import * as am4charts from "@amcharts/amcharts4/charts";
+import { _ } from 'ag-grid-community';
+import * as moment from 'moment';
+import { Subscription } from 'rxjs';
+import { GroupService } from 'app/shared/services/group.service';
+
+@Component({
+ selector: 'app-test-head-executions-line-chart',
+ templateUrl: './test-head-executions-line-chart.component.pug',
+ styleUrls: ['./test-head-executions-line-chart.component.scss']
+})
+export class TestHeadExecutionsLineChartComponent implements OnInit {
+
+ private toDestroy: Array<Subscription> = [];
+
+ @ViewChild('chart') chartElement: ElementRef;
+ @Input() height: string;
+
+ //public testDefinitionName = "Hello";
+ private chart: am4charts.XYChart;
+ private loadingIndicator;
+
+ constructor(private stats: StatsService, private _groups: GroupService) {
+ }
+
+ ngOnInit() {
+ this.renderChart();
+
+ this.toDestroy.push(this.stats.onTDExecutionChangeStarted().subscribe(res => {
+ this.showLoadingIndicator();
+ }));
+
+ this.toDestroy.push(this.stats.onDefaultDataCallStarted().subscribe(res => {
+ this.showLoadingIndicator();
+ }));
+
+ this.toDestroy.push(this.stats.onDefaultDataCallFinished().subscribe(res => {
+ this.setChartData();
+ }));
+
+ this.toDestroy.push(this.stats.onTDExecutionChangeFinished().subscribe(res => {
+ this.setChartData();
+ }));
+
+ }
+
+ ngOnDestroy() {
+ //destory chart
+ this.toDestroy.forEach(e => e.unsubscribe());
+ this.chart.dispose();
+ }
+
+ //Sets count to 0 for any dates that dont have data
+ setupPoints(rawData) {
+ let formattedData = [];
+ let dayRange = moment(this.stats.filters.endDate).add(1, 'days').diff(moment(this.stats.filters.startDate), 'days');
+ for (let i = 0; i < dayRange; i++) {
+ //find date in raw data
+ let d = rawData.find(e => moment(e.date).isSame(moment(this.stats.filters.startDate).add(i, 'days'), 'day'));
+ let myTestHeads = 0;
+ let otherTestHeads = 0;
+ if (d) {
+ myTestHeads = d.myTestHeads || 0;
+ otherTestHeads = d.otherTestHeads || 0;
+ }
+ formattedData.push({
+ date: moment(this.stats.filters.startDate).startOf('day').add(i, 'days').toDate(),
+ myTestHeads: myTestHeads,
+ otherTestHeads: otherTestHeads
+ })
+ }
+
+ return formattedData;
+ }
+
+ showLoadingIndicator() {
+
+ //this.height = "380px";
+ if (!this.loadingIndicator) {
+ this.loadingIndicator = this.chart.tooltipContainer.createChild(am4core.Container);
+ this.loadingIndicator.background.fill = am4core.color("#fff");
+ this.loadingIndicator.background.fillOpacity = 0.8;
+ this.loadingIndicator.width = am4core.percent(100);
+ this.loadingIndicator.height = am4core.percent(100);
+
+ let indicatorLabel = this.loadingIndicator.createChild(am4core.Label);
+ indicatorLabel.text = "Loading..";
+ indicatorLabel.align = "center";
+ indicatorLabel.valign = "middle";
+ indicatorLabel.fontSize = 18;
+ indicatorLabel.fontWeight = "bold";
+ indicatorLabel.dy = 50;
+
+ let loadingImage = this.loadingIndicator.createChild(am4core.Image);
+ //loadingImage.href = "https://img.devrant.com/devrant/rant/r_647810_4FeCH.gif";
+ loadingImage.href = "/assets/images/equalizer.gif";
+ //loadingImage.dataSource = "/loading-pies.svg"
+ loadingImage.align = "center";
+ loadingImage.valign = "middle";
+ loadingImage.horizontalCenter = "middle";
+ loadingImage.verticalCenter = "middle";
+ loadingImage.scale = 3.0;
+ } else {
+ this.loadingIndicator.show();
+ }
+ }
+
+ hideLoadingIndicator() {
+ this.loadingIndicator.hide();
+ }
+
+ async setChartData() {
+ let data = [];
+
+ this.stats.executionList.forEach((e, i) => {
+ if (e.testHeadResults && e.testHeadResults.length > 0) {
+
+ e.testHeadResults.forEach((result, index) => {
+
+ let isMyTestHead = result.testHeadGroupId == this._groups.getGroup()['_id'];
+
+
+
+ let dataIndex = data.findIndex(d => moment(d.date).isSame(result.startTime, 'day'));
+
+ if (dataIndex == -1) {
+ dataIndex = data.push({ date: moment(result.startTime).toDate() }) - 1;
+ }
+
+ if (isMyTestHead) {
+ if (data[dataIndex]['myTestHeads']) {
+ data[dataIndex]['myTestHeads'] += 1;
+ } else {
+ data[dataIndex]['myTestHeads'] = 1;
+ }
+ }else{
+ if (data[dataIndex]['otherTestHeads']) {
+ data[dataIndex]['otherTestHeads'] += 1;
+ } else {
+ data[dataIndex]['otherTestHeads'] = 1;
+ }
+ }
+
+ })
+ }
+ });
+
+
+
+ this.chart.data = this.setupPoints(data);
+
+ this.hideLoadingIndicator();
+ }
+
+ renderChart() {
+
+ if (this.chart) {
+ this.chart.dispose();
+ }
+ this.chart = am4core.create(this.chartElement.nativeElement, am4charts.XYChart);
+ this.chart.preloader.disabled = true;
+ this.showLoadingIndicator();
+
+ let dateAxis = this.chart.xAxes.push(new am4charts.DateAxis());
+ dateAxis.fontSize = "10px";
+
+ let valueAxis = this.chart.yAxes.push(new am4charts.ValueAxis());
+ valueAxis.title.text = "Executions";
+ valueAxis.title.fontSize = "10px";
+
+ let series = this.chart.series.push(new am4charts.LineSeries());
+ series.name = "My Group's VTHs"
+ series.dataFields.dateX = "date";
+ series.dataFields.valueY = "myTestHeads";
+ series.strokeWidth = 3;
+
+ series.fillOpacity = .5;
+ // series.tensionX = 0.8;
+ series.sequencedInterpolation = false;
+ series.tooltipText = "{valueY.value}";
+
+ let seriesOthers = this.chart.series.push(new am4charts.LineSeries());
+ seriesOthers.name = "Other VTHs";
+ seriesOthers.dataFields.dateX = "date";
+ seriesOthers.dataFields.valueY = "otherTestHeads";
+ seriesOthers.strokeWidth = 3;
+ seriesOthers.tooltipText = "{valueY.value}";
+
+ this.chart.cursor = new am4charts.XYCursor();
+
+ this.chart.responsive.enabled = true;
+
+ this.chart.legend = new am4charts.Legend();
+ this.chart.legend.labels.template.text = "[bold {color}]{name}";
+ this.chart.legend.scale = .8;
+ }
+
+
+
+}
diff --git a/otf-frontend/client/src/app/layout/control-panel/control-panel-routing.module.ts b/otf-frontend/client/src/app/layout/control-panel/control-panel-routing.module.ts
new file mode 100644
index 0000000..29b38ef
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/control-panel/control-panel-routing.module.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { ControlPanelComponent } from './control-panel.component';
+
+const routes: Routes = [
+ { path: '', component: ControlPanelComponent }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class ControlPanelRoutingModule { }
diff --git a/otf-frontend/client/src/app/layout/control-panel/control-panel.component.pug b/otf-frontend/client/src/app/layout/control-panel/control-panel.component.pug
new file mode 100644
index 0000000..56b688f
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/control-panel/control-panel.component.pug
@@ -0,0 +1,270 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div([@routerTransition], style="margin-top: -15px")
+ .row.fullWidth.mb-4(style="position:relative")
+ div.pull-tab
+ div.arrow
+ mat-card#canvas-card(style="width: 100%; resize:vertical; overflow: hidden")
+ mat-card-content#canvas(style="height: 100%")
+ div(style="position: absolute; bottom: 5px; left: 10px")
+ div.small.text-muted Test Definition: {{ testResult?.historicTestDefinition?.testName }}
+ div.small.text-muted Version: {{ testResult?.historicTestDefinition?.bpmnInstances[0]?.version }}
+ div(style="position: absolute; bottom: 5px; right: 25px")
+ div.small.text-muted(*ngIf="processState")
+ | Status: {{ processState }}
+ .row.mb-4
+ .col
+ .pull-left
+ h3 {{ testResult?.historicTestInstance?.testInstanceName }} Execution Log
+ div {{ testResult?.historicTestInstance?.testInstanceDescription }}
+ button.mr-2.pull-right(color="accent", mat-raised-button, (click)="refreshAllData()") Refresh
+ i.fa.fa-2x.fa-fw.fa-refresh.fast-spin(*ngIf="spin")
+ button.mr-2.pull-right(*ngIf="processState && processState == 'Running'", color="warn", mat-raised-button, (click)="cancelExecution()") Cancel Execution
+ .row.mb-4
+ .col-12
+ mat-tab-group([selectedIndex]="0", dinamicHeight, color="accent", backgroundColor="primary")
+ mat-tab(label="Overview")
+ .col-12.mt-2
+ .row.mb-4(style="text-align:center")
+ .col
+ b Test Result:
+ div {{ testResult?.testResult }}
+ .col
+ b Start Time:
+ div {{ testResult?.startTime }}
+ .col
+ b End Time:
+ div {{ testResult?.endTime }}
+ .col
+ b Total Time:
+ div {{ testResult?.totalTime }}
+ .col
+ b Date Executed:
+ div {{ testResult?.date }}
+ .col
+ b Executed By:
+ div {{ testResult?.historicEmail }}
+ hr
+ .row.mb-4(*ngIf="testResult?.testResultMessage")
+ .col-12
+ h5 Test Result Message
+ | {{ testResult?.testResultMessage }}
+ .row
+ .col-12
+ h5 Test Details
+ //- table(datatable, [dtOptions]="dtOptions", class="row-border hover")
+ //- thead
+ //- tr
+ //- th(*ngFor="let column of columns") {{ column.title }}
+ //- tbody
+ //- tr(*ngFor="let key of data")
+ //- td(*ngFor="let column of columns") {{ key[column.data] }}
+ ngx-json-viewer(*ngIf="testResult && testResult.testDetails != {}", [json]="testResult.testDetails", style="font-size: 1.3em")
+ //- div(*ngIf="testResult && testResult.testDetails != {}", [innerHTML]="json2html(testResult.testDetails)")
+ //- div(*ngIf="testResult") {{ json2html(testResult.testDetails) != '' ? '' : 'No test details were set during execution.' }}
+
+ mat-tab(*ngIf="testResult?.testInstanceResults.length > 0", label="Test Instance Results")
+ .col-12.mt-2
+ .row
+ .col-3
+ h5 Test Instances
+ mat-list
+ mat-list-item(style="cursor: pointer", *ngFor="let key of objectKeys(instanceDataSource); last as last; first as first", (click)="selectTestInstance(key)")
+ h5 {{ instanceDataSource[key][0].historicTestInstance.testInstanceName }}
+ mat-icon([hidden]="selectedTestInstance != key") keyboard_arrow_left
+ mat-divider([inset]="true", *ngIf="!last")
+ mat-divider(vertical)
+
+ .col-9
+ mat-accordion([multi]="true")
+ mat-expansion-panel(*ngFor="let element of instanceDataSource[selectedTestInstance]; let i = index;")
+ mat-expansion-panel-header()
+ mat-panel-title {{ '#' + (i + 1)}}
+ mat-panel-description
+ | {{ element.testResult }}
+ .col-12
+ .row(style="text-align:center")
+ .col
+ b Test Result:
+ div {{ element.testResult }}
+ .col
+ b Start Time:
+ div {{ element.startTime }}
+ .col
+ b End Time:
+ div {{ element.endTime }}
+ .col
+ b Total Time:
+ div {{ element.totalTime }}
+ .col
+ b Date Executed:
+ div {{ element.date }}
+ hr
+ div(style="float:right")
+ button(mat-raised-button, color="primary", [routerLink]="['/control-panel']", [queryParams]="{id: element._id}") Full Execution
+ .row.mb-4(*ngIf="element.testResultMessage")
+ .col-12
+ h5 Test Result Message
+ | {{ element.testResultMessage }}
+ .row
+ .col-12
+ h5 Test Details
+ ngx-json-viewer(*ngIf="element && element.testDetails != {}", [json]="element.testDetails")
+ //- div(*ngIf="element && element.testDetails != {}", [innerHTML]="json2html(element.testDetails)")
+ //- div(*ngIf="testResult") {{ json2html(element.testDetails) != '' ? '' : 'No test details were set during execution.' }}
+
+ mat-tab(*ngIf="testResult?.testHeadResults.length > 0", label="Test Head Results")
+ .col-12.mt-2
+ .row
+ .col-3
+ h5 Test Heads
+ mat-list
+ mat-list-item(style="cursor: pointer", *ngFor="let key of objectKeys(dataSource); last as last; first as first", (click)="selectTestHead(key)")
+ div
+ h5 {{ dataSource[key][0].testHeadName }}
+ div.small(style="margin-top:-11px;") {{ dataSource[key][0].bpmnVthTaskId }}
+ mat-icon([hidden]="selectedTestHead != key") keyboard_arrow_left
+ mat-divider([inset]="true", *ngIf="!last")
+ mat-divider(vertical)
+
+ .col-9
+ div(*ngFor="let testHead of testHeads")
+ mat-accordion([multi]="true", *ngIf="selectedTestHead == testHead.testHeadId + testHead.bpmnVthTaskId")
+ mat-expansion-panel(*ngFor="let element of dataSource[testHead.testHeadId + testHead.bpmnVthTaskId]; let i = index;")
+ mat-expansion-panel-header()
+ mat-panel-title {{ '#' + (i + 1)}}
+ mat-panel-description
+ | {{ element.totalTime }}
+ ngx-json-viewer([json]="element.testHeadRequestResponse")
+ app-robot-report(*ngIf="element.testHeadResponse", [response]="element.testHeadResponse")
+
+ //- (*ngFor="let testHead of testHeads")
+ //- mat-card
+ //- mat-card-header.COMPLETED-dash
+ //- mat-card-title.pull-left {{testHead.testHeadName}} Results
+ //- .pull-right {{testHead.bpmnVthTaskId}}
+ //- mat-card-content
+ //- table(mat-table, multiTemplateDataRows, [dataSource]="dataSource[testHead.testHeadId + testHead.bpmnVthTaskId]")
+
+ //- ng-container(matColumnDef="startTime")
+ //- th(mat-header-cell, *matHeaderCellDef) Start Time
+ //- td(mat-cell, *matCellDef="let element") {{ element.startTime}}
+
+ //- ng-container(matColumnDef="endTime")
+ //- th(mat-header-cell, *matHeaderCellDef) End Time
+ //- td(mat-cell, *matCellDef="let element") {{ element.endTime }}
+
+ //- ng-container(matColumnDef="totalTime")
+ //- th(mat-header-cell, *matHeaderCellDef) Total Time
+ //- td(mat-cell, *matCellDef="let element") {{ element.totalTime }}
+
+ //- ng-container(matColumnDef="expandedDetail")
+ //- td(mat-cell, style="padding:0px", *matCellDef="let element; let i = dataIndex", [attr.colspan]="displayedColumns.length")
+ //- div([@detailExpand]="(testHead.testHeadId + testHead.bpmnVthTaskId + i) == expandedElement ? 'expanded' : 'collapsed'")
+ //- codemirror([config]="codeConfig", [value]='element.testHeadResponse', name="testHeadResult")
+ //- app-robot-report(*ngIf="element.testHeadResponse", [response]="element.testHeadResponse")
+
+ //- tr(mat-header-row, *matHeaderRowDef="displayedColumns")
+ //- tr.example-element-row(mat-row, *matRowDef="let element; columns: displayedColumns; let i = dataIndex", [class.example-expanded-row]="expandedElement === element", (click)="expand(testHead.testHeadId + testHead.bpmnVthTaskId + i)")
+ //- tr.example-detail-row(mat-row, *matRowDef="let row; columns: ['expandedDetail']")
+
+ mat-tab(label="Task Log", *ngIf="taskLog != ''")
+ .col-12.mt-2
+ h5 Task Logs
+ div {{ taskLog }}
+
+ mat-tab(label="Test Parameters", *ngIf="testResult?.historicTestInstance")
+ .col-12.mt-2
+ h5 Test Data
+ ngx-json-viewer([json]="testResult.historicTestInstance.testData", [expanded]="false", style="font-size: 1.3em")
+ //- div([innerHTML]="json2html(testResult.historicTestInstance.testData, 1)")
+ //- | {{ testResult.historicTestInstance.testData ? '' : 'No test data set.'}}
+ h5.mt-1 Test Head Input
+ ngx-json-viewer([json]="testResult.historicTestInstance.vthInput", [expanded]="false", style="font-size: 1.3em")
+ //- div([innerHTML]="json2html(testResult.historicTestInstance.vthInput, 1)")
+ //- | {{ testResult.historicTestInstance.vthInput ? '' : 'No test head input set.'}}
+
+
+ mat-tab(*ngIf="executionJobLogDataSource != undefined", label="Execution Job Log")
+ .col-12.mt-2
+ .row
+ .col-3
+ h5 Execution Job Log
+ mat-list
+ mat-list-item(style="cursor: pointer", *ngFor="let key of objectKeys(executionJobLogDataSource); last as last; first as first", (click)="selectExecutionJobLog(key)")
+ h5 {{ executionJobLogDataSource[key][0].activityId }}
+ mat-icon([hidden]="selectedExecutionJobLog != key") keyboard_arrow_left
+ mat-divider([inset]="true", *ngIf="!last")
+ mat-divider(vertical)
+
+ .col-9
+ mat-accordion([multi]="true")
+ mat-expansion-panel(*ngFor="let element of executionJobLogDataSource[selectedExecutionJobLog]; let i = index;")
+ mat-expansion-panel-header()
+ mat-panel-title {{ '#' + (i + 1)}}
+ mat-panel-description
+ | {{ element.id }}
+ ngx-json-viewer([json]="element")
+ //- div([innerHTML]="json2html(element)")
+ //- | {{ element ? '' : 'No job log' }}
+
+ mat-tab(*ngIf="executionExternalTaskLogDataSource != undefined", label="Execution External Task Log")
+ .col-12.mt-2
+ .row
+ .col-3
+ h5 Execution External Task Log
+ mat-list
+ mat-list-item(style="cursor: pointer", *ngFor="let key of objectKeys(executionExternalTaskLogDataSource); last as last; first as first", (click)="selectExecutionExternalTaskLog(key)")
+ h5 {{ executionExternalTaskLogDataSource[key][0].activityId }}
+ mat-icon([hidden]="selectedExecutionExternalTaskLog != key") keyboard_arrow_left
+ mat-divider([inset]="true", *ngIf="!last")
+ mat-divider(vertical)
+
+ .col-9
+ mat-accordion([multi]="true")
+ mat-expansion-panel(*ngFor="let element of executionExternalTaskLogDataSource[selectedExecutionExternalTaskLog]; let i = index;")
+ mat-expansion-panel-header()
+ mat-panel-title {{ '#' + (i + 1)}}
+ mat-panel-description
+ | {{ element.id }}
+ ngx-json-viewer([json]="element")
+ //- div([innerHTML]="json2html(element)")
+ //- | {{ element ? '' : 'No external task log' }}
+
+
+ mat-tab(*ngIf="executionVariablesDataSource != undefined", label="Execution Variables")
+ .col-12.mt-2
+ .row
+ .col-3
+ h5 Execution Variables
+ mat-list
+ mat-list-item(style="cursor: pointer", *ngFor="let key of objectKeys(executionVariablesDataSource); last as last; first as first", (click)="selectExecutionVariable(key)")
+ h5 {{ executionVariablesDataSource[key][0].variableName }}
+ mat-icon([hidden]="selectedExecutionVariable != key") keyboard_arrow_left
+ mat-divider([inset]="true", *ngIf="!last")
+ mat-divider(vertical)
+
+ .col-9
+ mat-accordion([multi]="true")
+ mat-expansion-panel(*ngFor="let element of executionVariablesDataSource[selectedExecutionVariable]; let i = index;")
+ mat-expansion-panel-header()
+ mat-panel-title {{ '#' + (i + 1)}}
+ mat-panel-description
+ | {{ element.id }}
+ ngx-json-viewer([json]="element")
+ //- div([innerHTML]="json2html(element)")
+ //- | {{ element ? '' : 'No variables' }}
diff --git a/otf-frontend/client/src/app/layout/control-panel/control-panel.component.scss b/otf-frontend/client/src/app/layout/control-panel/control-panel.component.scss
new file mode 100644
index 0000000..eae8b37
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/control-panel/control-panel.component.scss
@@ -0,0 +1,132 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.COMPLETED-dash {
+ background-color: #0d47a1;
+ color: white;
+}
+
+.SUCCESS-dash {
+ background-color: #199700;
+ color: white;
+}
+
+.FAILURE-dash {
+ background-color: #dd2c00 !important;
+ color: white;
+}
+
+.fast-spin {
+ -webkit-animation: fa-spin 1s infinite linear;
+ animation: fa-spin 1s infinite linear;
+}
+
+.STOPPED-dash {
+ background-color: #ff9100;
+ color: white;
+}
+
+.UNAUTHORIZED-dash {
+ background-color: #000000;
+ color: white;
+}
+
+.UNKNOWN-dash {
+ background-color: White;
+}
+
+table {
+ width: 100%;
+ table-layout:fixed;
+ }
+
+ tr.example-detail-row {
+ height: 0;
+ }
+
+ tr.example-element-row:not(.example-expanded-row):hover {
+ background: #f5f5f5;
+ cursor: pointer;
+ }
+
+ tr.example-element-row:not(.example-expanded-row):active {
+ background: #efefef;
+ cursor: pointer;
+ }
+
+ .example-element-row td {
+ border-bottom-width: 0;
+ }
+
+ .example-element-detail {
+ //overflow: hidden;
+ //display: flex;
+ }
+
+ .example-element-diagram {
+ min-width: 80px;
+ border: 2px solid black;
+ padding: 8px;
+ font-weight: lighter;
+ margin: 8px 0;
+ height: 104px;
+ }
+
+ .example-element-symbol {
+ font-weight: bold;
+ font-size: 40px;
+ line-height: normal;
+ }
+
+ .example-element-description {
+ padding: 16px;
+ }
+
+ .example-element-description-attribution {
+ opacity: 0.5;
+ }
+
+
+.active-testHead {
+ background-color: #f8f9fa;
+}
+
+.pull-tab {
+ height: 0px;
+ width: 0px;
+ border-top: 20px solid #007bff;
+ border-left: 20px solid transparent;
+ border-right: 20px solid transparent;
+ -webkit-transform: rotate(-45deg);
+ position: absolute;
+ bottom: 0px;
+ right: -15px;
+ pointer-events: none;
+ z-index: 1;
+ margin-bottom: -4px;
+}
+
+.arrow {
+ border: solid black;
+ border-width: 0 3px 3px 0;
+ display: inline-block;
+ padding: 3px;
+ position: absolute;
+ transform: rotate(45deg);
+ -webkit-transform: rotate(45deg);
+ right: -2px;
+ bottom: 11px;
+}
diff --git a/otf-frontend/client/src/app/layout/control-panel/control-panel.component.spec.ts b/otf-frontend/client/src/app/layout/control-panel/control-panel.component.spec.ts
new file mode 100644
index 0000000..abaf3dd
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/control-panel/control-panel.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ControlPanelComponent } from './control-panel.component';
+
+describe('ControlPanelComponent', () => {
+ let component: ControlPanelComponent;
+ let fixture: ComponentFixture<ControlPanelComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ControlPanelComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ControlPanelComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/control-panel/control-panel.component.ts b/otf-frontend/client/src/app/layout/control-panel/control-panel.component.ts
new file mode 100644
index 0000000..f9144be
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/control-panel/control-panel.component.ts
@@ -0,0 +1,564 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, OnDestroy, HostListener, ViewChild, ElementRef } from '@angular/core';
+import { routerTransition } from 'app/router.animations';
+import { ActivatedRoute } from '@angular/router';
+import { TestExecutionService } from 'app/shared/services/test-execution.service';
+import { TestDefinitionService } from 'app/shared/services/test-definition.service';
+import BpmnJS from 'bpmn-js/lib/NavigatedViewer';
+import beautify from 'json-beautify';
+import { trigger, state, style, transition, animate } from '@angular/animations';
+import { interval } from 'rxjs';
+import { FileTransferService } from 'app/shared/services/file-transfer.service';
+import { Buffer } from 'buffer';
+import 'codemirror/mode/javascript/javascript.js';
+import { toInteger } from '@ng-bootstrap/ng-bootstrap/util/util';
+import { RequiredValidator } from '@angular/forms';
+import { UserService } from 'app/shared/services/user.service';
+import { ExecuteService } from 'app/shared/services/execute.service';
+import { BpmnFactoryService } from 'app/shared/factories/bpmn-factory.service';
+import { Bpmn } from 'app/shared/models/bpmn.model';
+
+//import 'datatables.net';
+
+@Component({
+ selector: 'app-control-panel',
+ templateUrl: './control-panel.component.pug',
+ styleUrls: ['./control-panel.component.scss'],
+ animations: [routerTransition(),
+ trigger('detailExpand', [
+ state('collapsed', style({ height: '0px', minHeight: '0', display: 'none' })),
+ state('expanded', style({ height: '*' })),
+ transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
+ ])
+ ]
+})
+export class ControlPanelComponent implements OnInit, OnDestroy {
+
+ @ViewChild('canvas-card') canvas: ElementRef;
+
+ public params;
+ public displayedColumns = ['startTime', 'endTime', 'totalTime'];
+ public dataSource = {};
+ public instanceDataSource = {};
+ public data = {};
+ public testHeads = [];
+ public testResult;
+ public expandedElement;
+ public selectedTestHead;
+ public selectedTestInstance;
+ public objectKeys = Object.keys;
+ private pullData = true;
+ public showFireworks = false;
+ public refreshData = false;
+ public spin = false;
+ public lastVTHResultsLength = 0;
+ // Create an Observable that will publish a value on an interval
+ public refreshCounter = interval(5000);
+
+ public isResizing = false;
+ public lastDownY;
+
+ public viewer: Bpmn;
+ public taskLog = '';
+
+ public executionJobLog = [];
+ public executionExternalTaskLog = [];
+ public executionVariables = [];
+
+ public executionJobLogDataSource;
+ public executionExternalTaskLogDataSource;
+ public executionVariablesDataSource;
+
+ public selectedExecutionJobLog;
+ public selectedExecutionExternalTaskLog;
+ public selectedExecutionVariable;
+
+
+ public codeConfig = {
+ mode: "application/json",
+ theme: "eclipse",
+ readonly: true,
+ lineNumbers: true
+ };
+
+ public taskLogConfig = {
+ mode: "Shell",
+ theme: "3024-night",
+ readonly: true
+ };
+
+ private processInstanceId;
+ public processState;
+
+
+ constructor(
+ private route: ActivatedRoute,
+ private executionService: ExecuteService,
+ private user: UserService,
+ private testExecution: TestExecutionService,
+ private fileTransfer: FileTransferService,
+ private bpmnFactory: BpmnFactoryService
+ ) { }
+
+ ngOnInit() {
+ this.route.queryParams.subscribe(params => {
+ this.params = params;
+ if(params.id){
+ this.refreshData = false;
+ this.populateData();
+
+ this.refreshCounter.subscribe(n => {
+ if (this.pullData){
+ this.populateData(n + 1);
+ this.updateFlowData();
+
+ }
+ });
+ }
+ });
+
+ $('#canvas-card').on('mousedown', (e) => {
+ this.isResizing = true;
+ this.lastDownY = $('#canvas-card').position().top + $('#canvas-card').outerHeight(true);
+ })
+
+ $(document).on('mousemove', (e) => {
+ if(!this.isResizing){
+ return;
+ }
+
+ var bottom = $('#canvas-card').position().top + $('#canvas-card').outerHeight(true);//$('#canvas-card').height() - (e.clientY - $('#canvas-card').offset().top);
+
+ if(bottom != this.lastDownY){
+ this.lastDownY = $('#canvas-card').position().top + $('#canvas-card').outerHeight(true);
+ this.onResize(null);
+ }
+
+ }).on('mouseup', () => {
+ this.isResizing = false;
+ })
+ }
+
+ ngOnDestroy() {
+ this.pullData = false;
+ }
+
+ refreshAllData() {
+ this.spin = true;
+ this.refreshData = true;
+ this.populateData();
+ this.updateFlowData();
+
+ }
+
+ populateData(loopNum = 0) {
+ this.testExecution.get(this.params.id).subscribe(
+ data => {
+ console.log(data);
+ let result = JSON.parse(JSON.stringify(data));
+
+ this.processInstanceId = result['processInstanceId'];
+
+ this.calcTime(result);
+
+ if(result['testInstanceResults']){
+ this.instanceDataSource = {};
+ for(var val = 0; val < result['testInstanceResults'].length; val++){
+ var elem = result['testInstanceResults'][val];
+ this.calcTime(elem);
+ let exists = false;
+ Object.keys(this.instanceDataSource).forEach((e, val) => {
+ if(e == elem.historicTestInstance._id){
+ exists = true;
+ return;
+ }
+ });
+
+ if(!exists){
+ this.instanceDataSource[elem.historicTestInstance._id] = [elem];
+ }
+ else{
+ var found = false;
+
+ this.instanceDataSource[elem.historicTestInstance._id].forEach( (value, index) => {
+ if(this.instanceDataSource[elem.historicTestInstance._id][index]._id == elem._id){
+ this.instanceDataSource[elem.historicTestInstance._id][index] = elem;
+ found = true;
+ }
+ })
+ if(!found){
+ this.instanceDataSource[elem.historicTestInstance._id].push(elem);
+ }
+ }
+ if(val == 0){
+ this.selectTestInstance(elem.historicTestInstance._id);
+ }
+ };
+ }
+
+ if (result['testHeadResults']) {
+ for (var i = 0 + this.lastVTHResultsLength; i < result['testHeadResults'].length; i++) {
+
+ var exists = false;
+ this.testHeads.forEach(elem => {
+ if (elem.testHeadId == result['testHeadResults'][i].testHeadId && elem.bpmnVthTaskId == result['testHeadResults'][i].bpmnVthTaskId) {
+ exists = true;
+ }
+ });
+
+ if (!exists) {
+ this.testHeads.push(result['testHeadResults'][i]);
+ this.dataSource[result['testHeadResults'][i].testHeadId + result['testHeadResults'][i].bpmnVthTaskId] = [];
+ }
+
+ let sDate = new Date(result['testHeadResults'][i].startTime);
+ let eDate = new Date(result['testHeadResults'][i].endTime);
+ let tDate = (eDate.getTime() - sDate.getTime()) / 1000;
+
+ result['testHeadResults'][i].startTime = sDate.getHours() + ":" + sDate.getMinutes() + ":" + sDate.getSeconds(); // + " " + sDate.getMonth() + "/" + sDate.getDate() + "/" + sDate.getFullYear();
+ result['testHeadResults'][i].endTime = eDate.getHours() + ":" + eDate.getMinutes() + ":" + eDate.getSeconds(); // + " " + eDate.getMonth() + "/" + eDate.getDate() + "/" + eDate.getFullYear();
+ result['testHeadResults'][i].totalTime = tDate + " secs";
+ result['testHeadResults'][i].testHeadRequestResponse = {
+ "testHeadRequest": result['testHeadResults'][i].testHeadRequest,
+ "testHeadResponse": result['testHeadResults'][i].testHeadResponse,
+ "statusCode": result['testHeadResults'][i].statusCode
+ };
+ //result['testHeadResults'][i].testHeadResponse = beautify(result['testHeadResults'][i].testHeadResponse, null, 2, 50);
+
+ this.dataSource[result['testHeadResults'][i].testHeadId + result['testHeadResults'][i].bpmnVthTaskId].push(result['testHeadResults'][i]);
+
+ if (i == 0) {
+ this.selectTestHead(result['testHeadResults'][i].testHeadId + result['testHeadResults'][i].bpmnVthTaskId);
+ }
+ }
+ //keep track of previous results so you don't reload them
+ this.lastVTHResultsLength = result['testHeadResults'].length;
+
+ this.testResult = Object.assign({}, result);
+ // this.user.get(result['executor']).subscribe(res => {
+ // this.testResult['executor'] = res;
+ // });
+ //
+
+
+ this.spin = false;
+ }
+
+
+ //only gets called once
+ if (!this.refreshData && loopNum == 0 && (result['historicTestDefinition'] && result['historicTestDefinition']['bpmnInstances'][0])) {
+ let id = result['historicTestDefinition']['bpmnInstances'][0]['bpmnFileId']
+
+ if(!this.viewer){
+ this.bpmnFactory.setup({
+ mode: 'viewer',
+ options: {
+ container: '#canvas'
+ },
+ fileId: id
+ }).then(res => {
+ this.viewer = res;
+ this.updateFlowData();
+ });
+ }else{
+ this.bpmnFactory.getXml({
+ fileId: id
+ }).then(res => {
+ this.viewer.setBpmnXml(res);
+ this.updateFlowData();
+ })
+ }
+
+ }
+ }
+ );
+
+ }
+
+ updateExecutionData(){
+ if(this.executionJobLog){
+ this.executionJobLogDataSource = {};
+ for(var val = 0; val < this.executionJobLog.length; val++){
+ var elem = this.executionJobLog[val];
+
+ let exists = false;
+ Object.keys(this.executionJobLogDataSource).forEach((e, val) => {
+ if(e == elem.activityId){
+ exists = true;
+ return;
+ }
+ });
+
+ if(!exists){
+ this.executionJobLogDataSource[elem.activityId] = [elem];
+ }
+ else{
+ var found = false;
+
+ this.executionJobLogDataSource[elem.activityId].forEach( (value, index) => {
+ if(this.executionJobLogDataSource[elem.activityId][index].id == elem.id){
+ this.executionJobLogDataSource[elem.activityId][index] = elem;
+ found = true;
+ }
+ })
+ if(!found){
+ this.executionJobLogDataSource[elem.activityId].push(elem);
+ }
+ }
+ if(val == 0){
+ this.selectExecutionJobLog(elem.activityId);
+ }
+ };
+ }
+
+ if(this.executionExternalTaskLog){
+ this.executionExternalTaskLogDataSource = {};
+ for(var val = 0; val < this.executionExternalTaskLog.length; val++){
+ var elem = this.executionExternalTaskLog[val];
+
+ let exists = false;
+ Object.keys(this.executionExternalTaskLogDataSource).forEach((e, val) => {
+ if(e == elem.activityId){
+ exists = true;
+ return;
+ }
+ });
+
+ if(!exists){
+ this.executionExternalTaskLogDataSource[elem.activityId] = [elem];
+ }
+ else{
+ var found = false;
+
+ this.executionExternalTaskLogDataSource[elem.activityId].forEach( (value, index) => {
+ if(this.executionExternalTaskLogDataSource[elem.activityId][index].id == elem.id){
+ this.executionExternalTaskLogDataSource[elem.activityId][index] = elem;
+ found = true;
+ }
+ })
+ if(!found){
+ this.executionExternalTaskLogDataSource[elem.activityId].push(elem);
+ }
+ }
+ if(val == 0){
+ this.selectExecutionExternalTaskLog(elem.activityId);
+ }
+ };
+ }
+
+
+
+ if(this.executionVariables){
+ this.executionVariablesDataSource = {};
+ for(var val = 0; val < this.executionVariables.length; val++){
+ var elem = this.executionVariables[val];
+
+ let exists = false;
+ Object.keys(this.executionVariablesDataSource).forEach((e, val) => {
+ if(e == elem.variableName){
+ exists = true;
+ return;
+ }
+ });
+
+ if(!exists){
+ this.executionVariablesDataSource[elem.variableName] = [elem];
+ }
+ else{
+ var found = false;
+
+ this.executionVariablesDataSource[elem.variableName].forEach( (value, index) => {
+ if(this.executionVariablesDataSource[elem.variableName][index].id == elem.id){
+ this.executionVariablesDataSource[elem.variableName][index] = elem;
+ found = true;
+ }
+ })
+ if(!found){
+ this.executionVariablesDataSource[elem.variableName].push(elem);
+ }
+ }
+ if(val == 0){
+ this.selectExecutionVariable(elem.variableName);
+ }
+ };
+ }
+
+ }
+
+ calcTime(result) {
+ let tsDate = new Date(result['startTime']);
+ let teDate = new Date(result['endTime']);
+ let ttDate = (teDate.getTime() - tsDate.getTime()) / 1000;
+
+ result['date'] = tsDate.getMonth() + 1 + "/" + tsDate.getDate() + "/" + tsDate.getFullYear();
+ result['startTime'] = tsDate.getHours() + ":" + tsDate.getMinutes() + ":" + tsDate.getSeconds();
+ result['endTime'] = teDate.getHours() + ":" + teDate.getMinutes() + ":" + teDate.getSeconds();
+ result['totalTime'] = ttDate + ' secs';
+
+
+ }
+
+ updateFlowData() {
+ console.log(this.processInstanceId);
+ this.testExecution.status(this.processInstanceId).subscribe(
+ result => {
+ if (result) {
+ let data = result['body'];
+ //check process state
+ if (data.historicProcessInstance.state == 'COMPLETED') {
+ this.processState = 'Completed';
+ this.pullData = false;
+ } else if (data.historicProcessInstance.state == 'ACTIVE') {
+ this.processState = 'Running';
+ } else {
+ this.processState = 'Failed';
+ this.pullData = false;
+ }
+
+ if(data.historicJobLog){
+ this.executionJobLog = data.historicJobLog;
+ }
+ if(data.historicExternalTaskLog){
+ this.executionExternalTaskLog = data.historicExternalTaskLog;
+ }
+ if(data.historicVariableInstance){
+ this.executionVariables = data.historicVariableInstance;
+ }
+ //update execution tabs -- job log, external task log, variables
+ this.updateExecutionData();
+
+
+ //loop through processes to get their info
+ for (let i = 0; i < data.historicActivityInstance.length; i++) {
+ let p = data.historicActivityInstance[i];
+ let state = null;
+ if (p.startTime && p.endTime && !p.canceled) { // process completed successfully
+ state = 'completed';
+ } else if (p.startTime && !p.endTime) { // process is still running
+ state = 'running';
+ } else if (p.canceled) {
+ state = 'failed';
+ }
+
+ //get task id
+
+ //highlight task boxes based on their state
+ this.viewer.getModel().get('canvas').addMarker(p.activityId, 'highlight-task-' + state);
+ }
+
+
+
+ for (let i = 0; i < data.historicIncident.length; i++) {
+ let p = data.historicIncident[i];
+ if (p.incidentMessage) {
+ this.taskLog += p.activityId + ': ' + p.incidentMessage + '\n';
+ }
+ this.viewer.getModel().get('canvas').addMarker(p.activityId, 'highlight-task-failed');
+ }
+ }
+ },
+ err => {
+
+ }
+ );
+ }
+
+ cancelExecution() {
+ this.executionService.delete(this.testResult._id).subscribe(result => {
+ this.updateFlowData();
+ });
+ }
+
+ expand(element) {
+ if (this.expandedElement == element)
+ this.expandedElement = null;
+ else
+ this.expandedElement = element;
+ }
+
+ beauty(json) {
+ return beautify(json, null, 2, 50);
+ }
+
+ @HostListener('window:resize', ['$event'])
+ onResize(event){
+ // console.log("hi")
+ if(this.viewer)
+ this.viewer.resize();
+ }
+
+
+ json2html(json: any = [{ }], tabs = 0) {
+ var html = '';
+ var tabHtml = '';
+ if (typeof json === 'string') {
+ json = JSON.parse(json);
+ }
+ for (let i = 0; i < tabs; i++) {
+ tabHtml += ' ';
+ }
+ for (let key in json) {
+ if (json.hasOwnProperty(key)) {
+ if (typeof json[key] === "object") {
+ html += tabHtml + '<b><u>' + key + ':</u></b><br/>';
+ if (json.constructor === Array && toInteger(key) > 0) {
+ tabs--;
+ }
+ html += this.json2html(json[key], ++tabs);
+ } else {
+ html += tabHtml + '<b><u>' + key + ':</u></b>' + '<br/>';
+ if (typeof json[key] === 'string') {
+ json[key] = json[key].replace(/\\n/g, '<br/>' + tabHtml);
+ }
+ html += tabHtml + json[key] + '<br/>';
+ html += '<br/>';
+ }
+ }
+ }
+ return html;
+ }
+
+ selectTestHead(key) {
+ this.selectedTestHead = key;
+ }
+
+ selectTestInstance(key){
+ this.selectedTestInstance = key;
+
+ }
+
+ selectExecutionJobLog(key){
+ this.selectedExecutionJobLog = key;
+
+ }
+
+ selectExecutionExternalTaskLog(key){
+ this.selectedExecutionExternalTaskLog = key;
+
+ }
+
+ selectExecutionVariable(key){
+ this.selectedExecutionVariable = key;
+
+ }
+
+ call() {
+ //
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/control-panel/control-panel.module.spec.ts b/otf-frontend/client/src/app/layout/control-panel/control-panel.module.spec.ts
new file mode 100644
index 0000000..ee11f53
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/control-panel/control-panel.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { ControlPanelModule } from './control-panel.module';
+
+describe('ControlPanelModule', () => {
+ let controlPanelModule: ControlPanelModule;
+
+ beforeEach(() => {
+ controlPanelModule = new ControlPanelModule();
+ });
+
+ it('should create an instance', () => {
+ expect(controlPanelModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/control-panel/control-panel.module.ts b/otf-frontend/client/src/app/layout/control-panel/control-panel.module.ts
new file mode 100644
index 0000000..05f7b91
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/control-panel/control-panel.module.ts
@@ -0,0 +1,67 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+import { ControlPanelRoutingModule } from './control-panel-routing.module';
+import { ControlPanelComponent } from './control-panel.component';
+import { FormsModule } from '@angular/forms';
+import { FilterPipeModule } from 'ngx-filter-pipe';
+import { MatButtonModule, MatTableModule, MatFormFieldModule, MatInputModule, MatPaginatorModule, MatBadgeModule, MatCardModule, MatSelectModule, MatOptionModule, MatIconModule, MatTabsModule, MatListModule, MatDividerModule, MatExpansionModule } from '@angular/material';
+import { TestHeadModalModule } from 'app/shared/modules/test-head-modal/test-head-modal.module';
+import { AlertModalModule } from 'app/shared/modules/alert-modal/alert-modal.module';
+import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
+import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
+import { CodemirrorModule } from 'ng2-codemirror';
+import { RobotReportComponent } from '../robot-report/robot-report.component';
+import { DataTablesModule } from 'angular-datatables';
+import { ResizableModule } from 'angular-resizable-element';
+import { NgxJsonViewerModule } from 'ngx-json-viewer';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ ControlPanelRoutingModule,
+ FormsModule,
+ FilterPipeModule,
+ MatButtonModule,
+ MatTableModule,
+ MatFormFieldModule,
+ MatInputModule,
+ MatPaginatorModule,
+ TestHeadModalModule,
+ AlertModalModule,
+ MatBadgeModule,
+ PerfectScrollbarModule,
+ MatCardModule,
+ MatSelectModule,
+ MatOptionModule,
+ MatIconModule,
+ NgbModule,
+ CodemirrorModule,
+ MatTabsModule,
+ MatListModule,
+ MatDividerModule,
+ MatExpansionModule,
+ DataTablesModule,
+ ResizableModule,
+ NgxJsonViewerModule
+ ],
+ declarations: [ControlPanelComponent, RobotReportComponent],
+ entryComponents: [RobotReportComponent]
+})
+export class ControlPanelModule { }
diff --git a/otf-frontend/client/src/app/layout/dashboard/dashboard-routing.module.ts b/otf-frontend/client/src/app/layout/dashboard/dashboard-routing.module.ts
new file mode 100644
index 0000000..187bd80
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/dashboard/dashboard-routing.module.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { DashboardComponent } from './dashboard.component';
+
+const routes: Routes = [
+ {
+ path: '', component: DashboardComponent
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class DashboardRoutingModule { }
diff --git a/otf-frontend/client/src/app/layout/dashboard/dashboard.component.pug b/otf-frontend/client/src/app/layout/dashboard/dashboard.component.pug
new file mode 100644
index 0000000..a823e68
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/dashboard/dashboard.component.pug
@@ -0,0 +1,115 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div(style="position: relative")
+ .row
+ .col-12
+ .pull-left
+ mat-form-field(style="width:110px")
+ input(matInput, [matDatepicker]="fromPicker", placeholder="From Date", [(ngModel)]="stats.filters.startDate")
+ mat-datepicker-toggle(matSuffix, [for]="fromPicker")
+ mat-datepicker(#fromPicker)
+ mat-form-field.ml-2(style="width:110px")
+ input(matInput, [matDatepicker]="toPicker", placeholder="To Date", [(ngModel)]="stats.filters.endDate")
+ mat-datepicker-toggle(matSuffix, [for]="toPicker")
+ mat-datepicker(#toPicker)
+ button.ml-2(mat-icon-button, (click)="stats.getDefaultData(_groups.getGroup())")
+ mat-icon arrow_forward
+
+ .pull-right
+ mat-form-field
+ input(matInput, [ngModel]="stats.executionList?.length", placeholder="Total Executions", disabled)
+ //- div
+ //- button.pull-right(mat-button, (click)="openFilterModal()")
+ //- mat-icon() filter_list
+ //- span(style="font-size: 13px") Filter
+
+ //- button.pull-right(mat-button, (click)="resetData()")
+ //- mat-icon() refresh
+ //- span(style="font-size: 13px") Reset
+
+ .row
+ .col-12
+ mat-card
+ mat-card-content
+ app-line-chart(height="201px")
+
+ .row.mt-2
+ .col-lg-5
+ mat-card
+ mat-card-header
+ mat-card-title
+ h5 Test Results
+ mat-card-content
+ app-pie-chart(height="230px")
+
+ .col-lg-7
+ mat-card
+ mat-card-header
+ mat-card-title
+ h5 Test Definition Usage
+ mat-card-content
+ app-test-definition-executions-bar-chart(height="230px")
+ .row.mt-2
+
+ .col-lg-7
+ mat-card
+ mat-card-header
+ mat-card-title
+ h5 Virtual Test Head Executions
+ mat-card-content
+ app-test-head-executions-line-chart(height="230px")
+
+ .col-lg-5
+ mat-card
+ mat-card-header
+ mat-card-title
+ h5 Virtual Test Head Usage & Status Codes
+ mat-card-content
+ app-test-head-execution-bar-chart(height="230px")
+ //- mat-card.w-100
+ //- mat-card-header
+ //- mat-card-title(style="font-weight: bold") Selected Definitions:
+ //- span(style="color: #4F8CA9") {{TD_selectedTDs}}
+
+ //- .row.mb-4
+ //- .col-md-7
+ //- app-line-chart(height="380px")
+
+ //- .col-md-5
+ //- app-pie-chart(height="380px")
+
+ //- mat-card.w-100
+ //- mat-card-header
+ //- mat-card-title(style="font-weight: bold") Selected Instances:
+ //- span(style="color: #4F8CA9") {{TI_selectedTIs}}
+ //- mat-card-title(style="font-weight: bold") Selected Definitions:
+ //- span(style="color: #4F8CA9") {{TI_selectedTDs}}
+ //- .row.mb-4
+ //- .col-md-7
+ //- app-multi-line-chart(height="380px")
+ //- .col-md-5
+ //- app-horiz-bar-chart(height="380px")
+
+ //- mat-card.w-100
+ //- mat-card-header
+ //- mat-card-title(style="font-weight: bold") Scheduled Tests
+ //- mat-card-title(style="font-weight: bold") Selected Instances:
+ //- span(style="color: #4F8CA9") {{sched_selectedTIs}}
+ //- .row
+ //- .col-md-4
+ //- app-schedule
+
diff --git a/otf-frontend/client/src/app/layout/dashboard/dashboard.component.scss b/otf-frontend/client/src/app/layout/dashboard/dashboard.component.scss
new file mode 100644
index 0000000..8099e27
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/dashboard/dashboard.component.scss
@@ -0,0 +1,82 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+
+mat-card img{
+ object-fit: cover; /*this makes de image in src fit to the size of specified below*/
+ width: 100%; /* Here you can use wherever you want to specify the width and also the height of the <img>*/
+ margin: 0;
+}
+
+.dropdown-toggle::after {
+ display:none;
+}
+
+mat-card-content {
+ padding: 0px !important;
+ padding-top: 0px !important;
+}
+
+.mat-icon-button {
+ height: 20px !important;
+ padding: 0px !important;
+}
+
+.col-md-4, .col-md-5{
+ padding: 0px;
+ margin: 0px;
+}
+.col-md-3{
+
+ padding:0px;
+ margin: 0px;
+}
+
+//
+.shadow{
+ -moz-box-shadow: inset 0 0 0 4px #2b2b2b;
+ -webkit-box-shadow: inset 0 0 0 4px #2b2b2b;
+ box-shadow: inset 0 0 0 4px #2b2b2b;
+}
+
+.COMPLETED-dash {
+ background-color: #0d47a1;
+ color: white;
+}
+
+.SUCCESS-dash {
+ background-color: #199700;
+ color: white;
+}
+
+.FAILURE-dash {
+ background-color: #dd2c00 !important;
+ color: white;
+}
+
+.STOPPED-dash {
+ background-color: #ff9100;
+ color: white;
+}
+
+.UNAUTHORIZED-dash {
+ background-color: #000000;
+ color: white;
+}
+
+.UNKNOWN-dash {
+ background-color: White;
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/dashboard/dashboard.component.spec.ts b/otf-frontend/client/src/app/layout/dashboard/dashboard.component.spec.ts
new file mode 100644
index 0000000..ec9b2eb
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/dashboard/dashboard.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { DashboardComponent } from './dashboard.component';
+
+describe('DashboardComponent', () => {
+ let component: DashboardComponent;
+ let fixture: ComponentFixture<DashboardComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ DashboardComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(DashboardComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/dashboard/dashboard.component.ts b/otf-frontend/client/src/app/layout/dashboard/dashboard.component.ts
new file mode 100644
index 0000000..a01d427
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/dashboard/dashboard.component.ts
@@ -0,0 +1,173 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, ViewChild, HostListener, EventEmitter, OnDestroy } from '@angular/core';
+import { routerTransition } from '../../router.animations';
+import { MatPaginator, MatDialog } from '@angular/material';
+import { ListService } from 'app/shared/services/list.service';
+import { TestExecutionService } from 'app/shared/services/test-execution.service';
+import { TestDefinitionService } from 'app/shared/services/test-definition.service';
+import { SchedulingService } from 'app/shared/services/scheduling.service';
+import { Subject, Observable, Subscription } from 'rxjs';
+import { UserService } from 'app/shared/services/user.service';
+import { FeathersService } from 'app/shared/services/feathers.service';
+import { GroupService } from 'app/shared/services/group.service';
+import { FilterModalComponent } from '../components/stats/filter-modal/filter-modal.component';
+import { StatsService } from '../components/stats/stats.service';
+
+@Component({
+ selector: 'app-dashboard',
+ templateUrl: './dashboard.component.pug',
+ styleUrls: ['./dashboard.component.scss'],
+ animations: [routerTransition()]
+})
+
+export class DashboardComponent implements OnInit, OnDestroy {
+
+ private toDestroy: Array<Subscription> = [];
+
+ // Top of the page stats
+ public topStats = {
+ COMPLETED: 0,
+ UNKNOWN: 0,
+ FAILURE: 0,
+ STOPPED: 0,
+ UNAUTHORIZED: 0,
+ FAILED: 0
+ };
+
+ public testDefinitionList = null;
+ public testExecutions;
+ public displayedColumns = ['name', 'result', 'startTime'];
+ public displayedScheduleColumns = ['name', 'nextRun'];
+ public weekExecutions = 0;
+ public weekSchedules = 0;
+ public filter = { testResult: '' }; // for dropdown in html
+ public group;
+
+ public eventsSubject: Subject<void>;
+
+ public TD_selectedTDs = "All";
+ public TI_selectedTDs = "All";
+ public TI_selectedTIs = "Top 5";
+ public sched_selectedTIs = "All";
+
+ public viewers = [];
+
+ @ViewChild(MatPaginator) executionsPaginator: MatPaginator;
+ @ViewChild(MatPaginator) scheduledPaginator: MatPaginator;
+
+ constructor(
+ private _groups: GroupService,
+ private filterModal: MatDialog,
+ private stats: StatsService
+ ) { }
+
+ async ngOnInit() {
+
+ this.stats.getDefaultData(this._groups.getGroup());
+ this.toDestroy.push(this._groups.groupChange().subscribe(group => {
+ this.stats.getDefaultData(group);
+ }));
+
+ //this.resetData();
+
+ // this.stats.onTDExecutionChangeFinished().subscribe(res => {
+ // this.TD_selectedTDs = "";
+ // this.stats.getTDFilters().selected.forEach(item => {
+ // this.TD_selectedTDs += (item.viewValue + ", ");
+ // })
+ // let charLimit = 200;
+ // if (this.TD_selectedTDs.length > charLimit) {
+ // this.TD_selectedTDs = this.TD_selectedTDs.slice(0, charLimit) + "...";
+ // } else this.TD_selectedTDs = this.TD_selectedTDs.slice(0, this.TD_selectedTDs.length - 2);
+ // })
+
+ // this.stats.onTIExecutionChangeFinished().subscribe(res => {
+ // let selectedTIs = this.stats.getTIFilters().selectedTIs;
+ // let selectedTDs = this.stats.getTIFilters().selectedTDs;
+
+ // if (selectedTIs.length == 0) this.TI_selectedTIs = "All";
+ // else {
+ // this.TI_selectedTIs = "";
+ // this.stats.getTIFilters().selectedTIs.forEach(item => {
+ // this.TI_selectedTIs += (item + ", ");
+ // })
+ // let charLimit = 200;
+ // if (this.TI_selectedTIs.length > charLimit) {
+ // this.TI_selectedTIs = this.TI_selectedTIs.slice(0, charLimit) + "...";
+ // } else this.TI_selectedTIs = this.TI_selectedTIs.slice(0, this.TI_selectedTIs.length - 2);
+ // }
+
+ // if (selectedTDs.length == 0) this.TI_selectedTDs = "All";
+ // else {
+ // this.TI_selectedTDs = "";
+ // this.stats.getTIFilters().selectedTDs.forEach(item => {
+ // this.TI_selectedTDs += (item + ", ");
+ // })
+ // let charLimit = 200;
+ // if (this.TI_selectedTDs.length > charLimit) {
+ // this.TI_selectedTDs = this.TI_selectedTDs.slice(0, charLimit) + "...";
+ // } else this.TI_selectedTDs = this.TI_selectedTDs.slice(0, this.TI_selectedTDs.length - 2);
+ // }
+ // })
+
+ // this.stats.onScheduleChangeFinished().subscribe(res => {
+ // let selectedTIs = this.stats.scheduledTests.map(el => el.name);
+ // //console.log(selectedTIs);
+ // if (selectedTIs.length == 0) this.sched_selectedTIs = "All";
+ // else {
+ // this.sched_selectedTIs = "";
+ // this.stats.scheduledTests.map(el => el.name).forEach(item => {
+ // this.sched_selectedTIs += (item + ", ");
+ // })
+ // let charLimit = 200;
+ // if (this.sched_selectedTIs.length > charLimit) {
+ // this.sched_selectedTIs = this.sched_selectedTIs.slice(0, charLimit) + "...";
+ // } else this.sched_selectedTIs = this.sched_selectedTIs.slice(0, this.sched_selectedTIs.length - 2);
+ // }
+ // })
+ }
+
+ ngOnDestroy(){
+ this.toDestroy.forEach(elem => {
+ elem.unsubscribe();
+ });
+ }
+
+ openFilterModal() {
+ let open = this.filterModal.open(FilterModalComponent, {
+ width: '50%',
+ height: '60%',
+ disableClose: true
+ })
+
+ open.afterClosed().subscribe(res => {
+ this.ngOnInit();
+ })
+ }
+
+ resetData() {
+ //console.log("resetting");
+ this.TD_selectedTDs = "All";
+ this.TI_selectedTDs = "All";
+ this.TI_selectedTIs = "Top 5";
+ this.sched_selectedTIs = "All";
+ this.stats.getDefaultData(this._groups.getGroup());
+ }
+
+}
+
diff --git a/otf-frontend/client/src/app/layout/dashboard/dashboard.module.spec.ts b/otf-frontend/client/src/app/layout/dashboard/dashboard.module.spec.ts
new file mode 100644
index 0000000..9db6f12
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/dashboard/dashboard.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { DashboardModule } from './dashboard.module';
+
+describe('DashboardModule', () => {
+ let dashboardModule: DashboardModule;
+
+ beforeEach(() => {
+ dashboardModule = new DashboardModule();
+ });
+
+ it('should create an instance', () => {
+ expect(dashboardModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/dashboard/dashboard.module.ts b/otf-frontend/client/src/app/layout/dashboard/dashboard.module.ts
new file mode 100644
index 0000000..d6545e9
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/dashboard/dashboard.module.ts
@@ -0,0 +1,110 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { DashboardRoutingModule } from './dashboard-routing.module';
+import { DashboardComponent } from './dashboard.component';
+import { FormsModule } from '@angular/forms';
+import { FilterPipeModule } from 'ngx-filter-pipe';
+
+import {
+ MatBadgeModule,
+ MatButtonModule,
+ MatCardModule,
+ MatFormFieldModule,
+ MatIconModule,
+ MatInputModule,
+ MatOptionModule,
+ MatPaginatorModule,
+ MatSelectModule,
+ MatTableModule,
+ MatTabsModule,
+ MatCheckboxModule,
+ MatDialogModule,
+ MAT_DIALOG_DEFAULT_OPTIONS,
+ MatExpansionModule,
+ MatDatepickerModule,
+ MatNativeDateModule,
+ MatProgressSpinnerModule,
+} from '@angular/material';
+import { TestHeadModalModule } from 'app/shared/modules/test-head-modal/test-head-modal.module';
+import { AlertModalModule } from 'app/shared/modules/alert-modal/alert-modal.module';
+import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
+import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
+import { TestDefinitionExpandedDetailsComponent } from '../test-definition-expanded-details/test-definition-expanded-details.component';
+import { ViewWorkflowModalModule } from 'app/shared/modules/view-workflow-modal/view-workflow-modal.module';
+import { PieChartComponent } from '../components/stats/pie-chart/pie-chart.component';
+import { LineChartComponent } from '../components/stats/line-chart/line-chart.component'
+import { ScheduleComponent } from '../components/stats/schedule/schedule.component';;
+import { HorizBarChartComponent } from '../components/stats/horiz-bar-chart/horiz-bar-chart.component';
+import { FilterModalComponent } from '../components/stats/filter-modal/filter-modal.component';
+import { MultiLineChartComponent } from '../components/stats/multi-line-chart/multi-line-chart.component';
+import { TestDefinitionExecutionsBarChartComponent } from '../components/stats/test-definition-executions-bar-chart/test-definition-executions-bar-chart.component';
+import { TestHeadExecutionsLineChartComponent } from '../components/stats/test-head-executions-line-chart/test-head-executions-line-chart.component';
+import { TestHeadExecutionBarChartComponent } from '../components/stats/test-head-execution-bar-chart/test-head-execution-bar-chart.component';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ DashboardRoutingModule,
+ FormsModule,
+ FilterPipeModule,
+ MatButtonModule,
+ MatTableModule,
+ MatFormFieldModule,
+ MatInputModule,
+ MatPaginatorModule,
+ TestHeadModalModule,
+ AlertModalModule,
+ MatBadgeModule,
+ PerfectScrollbarModule,
+ MatCardModule,
+ MatSelectModule,
+ MatOptionModule,
+ MatIconModule,
+ NgbModule,
+ MatCheckboxModule,
+ MatTabsModule,
+ ViewWorkflowModalModule,
+ MatDialogModule,
+ MatExpansionModule,
+ MatDatepickerModule,
+ MatNativeDateModule,
+ MatProgressSpinnerModule
+ ],
+ declarations: [
+ DashboardComponent,
+ TestDefinitionExpandedDetailsComponent,
+ LineChartComponent,
+ MultiLineChartComponent,
+ ScheduleComponent,
+ PieChartComponent,
+ HorizBarChartComponent,
+ FilterModalComponent,
+ TestDefinitionExecutionsBarChartComponent,
+ TestHeadExecutionsLineChartComponent,
+ TestHeadExecutionBarChartComponent
+ ],
+ entryComponents: [TestDefinitionExpandedDetailsComponent, FilterModalComponent],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ exports: [FilterModalComponent, LineChartComponent],
+ providers: [{ provide: MAT_DIALOG_DEFAULT_OPTIONS, useValue: { hasBackdrop: true } }, MatDatepickerModule]
+
+
+})
+export class DashboardModule {
+}
diff --git a/otf-frontend/client/src/app/layout/feedback/feedback-routing.module.ts b/otf-frontend/client/src/app/layout/feedback/feedback-routing.module.ts
new file mode 100644
index 0000000..92fee59
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/feedback/feedback-routing.module.ts
@@ -0,0 +1,30 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+import {FeedbackComponent} from './feedback.component';
+
+const routes: Routes = [
+ {path: '', component: FeedbackComponent}
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class FeedbackRoutingModule {
+}
diff --git a/otf-frontend/client/src/app/layout/feedback/feedback.component.pug b/otf-frontend/client/src/app/layout/feedback/feedback.component.pug
new file mode 100644
index 0000000..b38e410
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/feedback/feedback.component.pug
@@ -0,0 +1,45 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div([@routerTransition])
+ h2 Submit Feedback
+ hr
+
+// name label & form input
+form([formGroup]='FeedbackFormGroup')
+ .row
+ .col-sm-2
+ mat-form-field(style='width:100%')
+ input(matInput, placeholder='First Name', formControlName='firstName', required)
+ mat-error Required
+ .col-sm-2
+ mat-form-field(style='width:100%')
+ input(matInput, placeholder='Last Name', formControlName='lastName', required)
+ mat-error Required
+ .row
+ .col-sm-4
+ // email label & form input
+ mat-form-field(style='width:100%')
+ input(matInput, placeholder='example@.com', type='email', formControlName='email', required)
+ .row
+ .col-sm-4
+ // message label & form input
+ mat-form-field(style='width:100%')
+ textarea(matInput, placeholder='Message', formControlName='message', required, rows=15)
+ .row
+ .col-sm-4
+ // button for submitting the information in the form
+ button(mat-raised-button='', color='primary', class='pull-right', (click)='onSubmitFeedback()') Send Feedback
diff --git a/otf-frontend/client/src/app/layout/feedback/feedback.component.scss b/otf-frontend/client/src/app/layout/feedback/feedback.component.scss
new file mode 100644
index 0000000..70fad06
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/feedback/feedback.component.scss
@@ -0,0 +1,17 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+
diff --git a/otf-frontend/client/src/app/layout/feedback/feedback.component.spec.ts b/otf-frontend/client/src/app/layout/feedback/feedback.component.spec.ts
new file mode 100644
index 0000000..c79e8c3
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/feedback/feedback.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {async, ComponentFixture, TestBed} from '@angular/core/testing';
+
+import {FeedbackComponent} from './feedback.component';
+
+describe('FeedbackComponent', () => {
+ let component: FeedbackComponent;
+ let fixture: ComponentFixture<FeedbackComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [FeedbackComponent]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(FeedbackComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/feedback/feedback.component.ts b/otf-frontend/client/src/app/layout/feedback/feedback.component.ts
new file mode 100644
index 0000000..ed1be7f
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/feedback/feedback.component.ts
@@ -0,0 +1,98 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {Component, OnInit} from '@angular/core';
+import {routerTransition} from 'app/router.animations';
+import {FormControl, FormGroup, Validators} from '@angular/forms';
+import {MatDialog} from '@angular/material';
+import {AlertModalComponent} from '../../shared/modules/alert-modal/alert-modal.component';
+import {FeedbackService} from "../../shared/services/feedback.service";
+
+@Component({
+ selector: 'app-feedback',
+ templateUrl: './feedback.component.pug',
+ styleUrls: ['./feedback.component.scss'],
+ animations: [routerTransition()]
+})
+export class FeedbackComponent implements OnInit {
+ private firstName: string;
+ private lastName: string;
+ private email: string;
+ private message: string;
+
+ public FeedbackFormGroup: FormGroup;
+ private FirstNameFormControl: FormControl;
+ private LastNameFormControl: FormControl;
+ private EmailFormControl: FormControl;
+ private MessageFormControl: FormControl;
+
+ constructor(
+ private ResponseMatDialog: MatDialog,
+ private feedback: FeedbackService
+ ) {
+ }
+
+
+ // @ViewChild('feedbackForm') private FeedBackForm;
+
+ ngOnInit(): void {
+ this.createFormControls();
+ this.createFormGroup();
+ }
+
+ private createFormControls() {
+ this.FirstNameFormControl = new FormControl('', [Validators.required]);
+ this.LastNameFormControl = new FormControl('', [Validators.required]);
+ this.EmailFormControl = new FormControl('', [Validators.required, Validators.email]);
+ this.MessageFormControl = new FormControl('', [Validators.required]);
+ }
+
+ private createFormGroup() {
+ this.FeedbackFormGroup = new FormGroup({
+ firstName: this.FirstNameFormControl,
+ lastName: this.LastNameFormControl,
+ email: this.EmailFormControl,
+ message: this.MessageFormControl
+ });
+ }
+
+ // submit button action
+ public onSubmitFeedback() {
+ if (!this.FeedbackFormGroup.invalid) {
+ // console.log(this.FeedbackFormGroup.getRawValue())
+ this.feedback.sendFeedback(this.FeedbackFormGroup.getRawValue()).subscribe(
+ (result) => {
+ this.sendFeedbackAlert('ok', 'Feedback sent!');
+ },
+ (error) => {
+ this.sendFeedbackAlert('warning', 'Please verify form fields are correct.');
+ }
+ ) }
+ else{
+ this.sendFeedbackAlert('warning', 'Please verify form fields are correct.');
+ }
+ }
+
+ private sendFeedbackAlert(type: string, message: string) {
+ this.ResponseMatDialog.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: type,
+ message: message
+ }
+ });
+ }
+}
diff --git a/otf-frontend/client/src/app/layout/feedback/feedback.module.spec.ts b/otf-frontend/client/src/app/layout/feedback/feedback.module.spec.ts
new file mode 100644
index 0000000..b27d504
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/feedback/feedback.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {FeedbackModule} from './feedback.module';
+
+describe('FeedbackModule', () => {
+ let feedbackModule: FeedbackModule;
+
+ beforeEach(() => {
+ feedbackModule = new FeedbackModule();
+ });
+
+ it('should create an instance', () => {
+ expect(feedbackModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/feedback/feedback.module.ts b/otf-frontend/client/src/app/layout/feedback/feedback.module.ts
new file mode 100644
index 0000000..d614de2
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/feedback/feedback.module.ts
@@ -0,0 +1,49 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {NgModule} from '@angular/core';
+import {CommonModule} from '@angular/common';
+import {FeedbackComponent} from './feedback.component';
+import {FormsModule, ReactiveFormsModule} from '@angular/forms';
+import {FilterPipeModule} from 'ngx-filter-pipe';
+import {MatBadgeModule, MatButtonModule, MatCardModule, MatIconModule, MatInputModule} from '@angular/material';
+import {AlertModalModule} from 'app/shared/modules/alert-modal/alert-modal.module';
+import {PerfectScrollbarModule} from 'ngx-perfect-scrollbar';
+import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
+import {FeedbackRoutingModule} from './feedback-routing.module';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FeedbackRoutingModule,
+ FormsModule,
+ ReactiveFormsModule,
+ FilterPipeModule,
+ MatButtonModule,
+ MatInputModule,
+ AlertModalModule,
+ MatBadgeModule,
+ PerfectScrollbarModule,
+ MatCardModule,
+ MatIconModule,
+ NgbModule,
+ ],
+ declarations: [
+ FeedbackComponent
+ ]
+})
+export class FeedbackModule {
+}
diff --git a/otf-frontend/client/src/app/layout/layout-routing.module.ts b/otf-frontend/client/src/app/layout/layout-routing.module.ts
new file mode 100644
index 0000000..278d3b7
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/layout-routing.module.ts
@@ -0,0 +1,51 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+import {LayoutComponent} from './layout.component';
+import {AdminGuard} from "../shared/guard/admin.guard";
+
+const routes: Routes = [
+ {
+ path: '',
+ component: LayoutComponent,
+ children: [
+ {path: '', redirectTo: 'dashboard', pathMatch: 'prefix'},
+ {path: 'test-definitions', loadChildren: './tests/tests.module#TestsModule'},
+ {path: 'settings', loadChildren: './settings/settings.module#SettingsModule'},
+ {path: 'manage-group', loadChildren: './manage-group/manage-group.module#ManageGroupModule'},
+ {path: 'feedback', loadChildren: './feedback/feedback.module#FeedbackModule'},
+ {path: 'dashboard', loadChildren: './dashboard/dashboard.module#DashboardModule'},
+ {path: 'scheduling', loadChildren: './scheduling/scheduling.module#SchedulingModule'},
+ {path: 'onboarding', loadChildren: './onboarding/onboarding.module#OnboardingModule'},
+ {path: 'control-panel', loadChildren: './control-panel/control-panel.module#ControlPanelModule'},
+ {path: 'test-heads', loadChildren: './virtual-test-heads/virtual-test-heads.module#VirtualTestHeadsModule'},
+ {path: 'test-instances', loadChildren: './test-instances-catalog/test-instances-catalog.module#TestInstancesCatalogModule'},
+ {path: 'test-executions', loadChildren: './test-executions-catalog/test-executions-catalog.module#TestExecutionsCatalogModule'},
+ {path: 'user-management', loadChildren: './user-management/user-management.module#UserManagementModule', canActivate: [AdminGuard]},
+ {path: 'modeler', loadChildren: './modeler/modeler.module#ModelerModule'}
+
+ ]
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class LayoutRoutingModule {
+}
diff --git a/otf-frontend/client/src/app/layout/layout.component.html b/otf-frontend/client/src/app/layout/layout.component.html
new file mode 100644
index 0000000..a809598
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/layout.component.html
@@ -0,0 +1,21 @@
+<!-- Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+#############################################################################-->
+
+
+<app-header></app-header>
+<app-sidebar></app-sidebar>
+<section class="main-container">
+ <router-outlet></router-outlet>
+</section>
diff --git a/otf-frontend/client/src/app/layout/layout.component.scss b/otf-frontend/client/src/app/layout/layout.component.scss
new file mode 100644
index 0000000..2ac9020
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/layout.component.scss
@@ -0,0 +1,37 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.main-container {
+ margin-top: 56px;
+ margin-left: 235px;
+ padding: 15px;
+ -ms-overflow-x: hidden;
+ overflow-x: hidden;
+ overflow-y: scroll;
+ position: relative;
+ overflow: hidden;
+}
+@media screen and (max-width: 992px) {
+ .main-container {
+ margin-left: 0px !important;
+ }
+}
+@media print {
+ .main-container {
+ margin-top: 0px !important;
+ margin-left: 0px !important;
+ }
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/layout.component.spec.ts b/otf-frontend/client/src/app/layout/layout.component.spec.ts
new file mode 100644
index 0000000..5fd88f2
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/layout.component.spec.ts
@@ -0,0 +1,55 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {async, ComponentFixture, TestBed} from '@angular/core/testing';
+import {RouterTestingModule} from '@angular/router/testing';
+import {TranslateModule} from '@ngx-translate/core';
+
+import {LayoutComponent} from './layout.component';
+import {LayoutModule} from './layout.module';
+
+describe('LayoutComponent', () => {
+ let component: LayoutComponent;
+ let fixture: ComponentFixture<LayoutComponent>;
+
+ beforeEach(
+ async(() => {
+ TestBed.configureTestingModule({
+ imports: [
+ LayoutModule,
+ RouterTestingModule,
+ TranslateModule.forRoot(),
+ ]
+ }).compileComponents()
+ .then((arg) => {
+ // handle
+ })
+ .catch((err) => {
+ // handle
+ });
+ })
+ );
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(LayoutComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/layout.component.ts b/otf-frontend/client/src/app/layout/layout.component.ts
new file mode 100644
index 0000000..07e06c1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/layout.component.ts
@@ -0,0 +1,28 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-layout',
+ templateUrl: './layout.component.html',
+ styleUrls: ['./layout.component.scss']
+})
+export class LayoutComponent implements OnInit {
+ constructor() {}
+
+ ngOnInit() {}
+}
diff --git a/otf-frontend/client/src/app/layout/layout.module.spec.ts b/otf-frontend/client/src/app/layout/layout.module.spec.ts
new file mode 100644
index 0000000..ff64010
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/layout.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { LayoutModule } from './layout.module';
+
+describe('LayoutModule', () => {
+ let layoutModule: LayoutModule;
+
+ beforeEach(() => {
+ layoutModule = new LayoutModule();
+ });
+
+ it('should create an instance', () => {
+ expect(layoutModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/layout.module.ts b/otf-frontend/client/src/app/layout/layout.module.ts
new file mode 100644
index 0000000..1de7fa6
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/layout.module.ts
@@ -0,0 +1,49 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { TranslateModule } from '@ngx-translate/core';
+import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
+
+import { LayoutRoutingModule } from './layout-routing.module';
+import { LayoutComponent } from './layout.component';
+import { SidebarComponent } from './components/sidebar/sidebar.component';
+import { HeaderComponent } from './components/header/header.component';
+import { RightSidebarComponent } from './components/right-sidebar/right-sidebar.component';
+import { CreateGroupModalModule } from 'app/shared/modules/create-group-modal/create-group-modal.module';
+import { MatMenuModule, MatIconModule, MatButtonModule } from '@angular/material';
+import { MenuItemComponent } from 'app/shared/components/menu-item/menu-item.component';
+@NgModule({
+ imports: [
+ CommonModule,
+ LayoutRoutingModule,
+ TranslateModule,
+ NgbDropdownModule.forRoot(),
+ CreateGroupModalModule,
+ MatMenuModule,
+ MatIconModule,
+ MatButtonModule
+ ],
+ declarations: [
+ LayoutComponent,
+ SidebarComponent,
+ HeaderComponent,
+ RightSidebarComponent,
+ MenuItemComponent
+ ]
+})
+export class LayoutModule {}
diff --git a/otf-frontend/client/src/app/layout/manage-group/dropdown-multiselect.component.pug b/otf-frontend/client/src/app/layout/manage-group/dropdown-multiselect.component.pug
new file mode 100644
index 0000000..03ba7da
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/manage-group/dropdown-multiselect.component.pug
@@ -0,0 +1,26 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+
+h4.mb-2.ml-1(style="font-weight: bold;") Change Roles - {{user?.firstName}} {{user?.lastName}}
+ //input.ml-1(matInput, type='search', placeholder='Search...', color='blue', [(ngModel)]='search.roleName')
+div(style="max-height: 300px; overflow-y: scroll")
+ .px-4.py-3
+ .mr-2.ml-2(*ngFor="let role of roles")
+ mat-checkbox([(ngModel)]="role.isSelected") {{role.roleName}}
+div(style="text-align: center")
+ button.primary.mr-1(mat-raised-button, [disabled]= "", aria-label='Edit', color="primary", (click)='saveRoles()') Save
+
diff --git a/otf-frontend/client/src/app/layout/manage-group/dropdown-multiselect.component.scss b/otf-frontend/client/src/app/layout/manage-group/dropdown-multiselect.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/manage-group/dropdown-multiselect.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/layout/manage-group/dropdown-multiselect.component.spec.ts b/otf-frontend/client/src/app/layout/manage-group/dropdown-multiselect.component.spec.ts
new file mode 100644
index 0000000..1eca9b5
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/manage-group/dropdown-multiselect.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { DropdownMultiselectComponent } from './dropdown-multiselect.component';
+
+describe('DropdownMultiselectComponent', () => {
+ let component: DropdownMultiselectComponent;
+ let fixture: ComponentFixture<DropdownMultiselectComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ DropdownMultiselectComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(DropdownMultiselectComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/manage-group/dropdown-multiselect.component.ts b/otf-frontend/client/src/app/layout/manage-group/dropdown-multiselect.component.ts
new file mode 100644
index 0000000..df065cb
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/manage-group/dropdown-multiselect.component.ts
@@ -0,0 +1,96 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Inject } from '@angular/core';
+import { GroupService } from 'app/shared/services/group.service';
+import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
+import { UserService } from 'app/shared/services/user.service';
+
+
+@Component({
+ selector: 'app-dropdown-multiselect',
+ templateUrl: './dropdown-multiselect.component.pug',
+ styleUrls: ['./dropdown-multiselect.component.scss']
+})
+export class DropdownMultiselectComponent implements OnInit {
+
+ public group;
+ public memberRoles;
+ private params;
+ public roles;
+ public user;
+ public userId;
+ public search;
+ constructor(private groupService: GroupService, public dialogRef: MatDialogRef<DropdownMultiselectComponent>,
+ private userService: UserService,
+ @Inject(MAT_DIALOG_DATA) public input_data
+ ) {
+
+ }
+
+ ngOnInit() {
+ this.search = {};
+ this.userId = this.input_data["user"][0]["_id"];
+ this.group = this.input_data["group"];
+ this.memberRoles = this.group["members"].filter(member => member.userId == this.userId)["roles"];
+ this.userService.get(this.userId).subscribe((result) => {
+ this.user = result;
+ });
+ this.roles = this.group.roles;
+
+ this.memberRoles = this.group.members.filter(member => member.userId.toString() == this.userId.toString())[0].roles;
+ if(this.memberRoles){
+ for(let i = 0; i < this.roles.length; i++){
+ this.roles[i].isSelected = false;
+ for(let j = 0; j < this.memberRoles.length; j++){
+ if(this.roles[i].roleName == this.memberRoles[j]){
+ this.roles[i].isSelected = true;
+ }
+ }
+ }
+ }
+ }
+
+ saveRoles(){
+ let member = {
+ userId : this.userId,
+ roles : []
+ }
+
+ member.roles = this.roles.filter(role => role.isSelected).map(item => {return item.roleName});
+
+ // the logic to remove the one member from the array of members and then push the new member roles
+ this.groupService.get(this.group._id).subscribe((res) => {
+ let group = res;
+
+ let newMembers = [];
+ if(group["members"]){
+ newMembers = group["members"].filter(member => member.userId.toString() != this.userId.toString());
+ }
+ newMembers.push(member)
+ let groupPatch = {
+ _id : this.group._id,
+ members : newMembers
+ }
+ this.groupService.patch(groupPatch).subscribe((response) => {
+ this.dialogRef.close();
+ });
+ });
+
+
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/manage-group/manage-group-roles/manage-group-roles.component.pug b/otf-frontend/client/src/app/layout/manage-group/manage-group-roles/manage-group-roles.component.pug
new file mode 100644
index 0000000..d4de15a
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/manage-group/manage-group-roles/manage-group-roles.component.pug
@@ -0,0 +1,96 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div([@routerTransition])
+ .card-md-12
+ .pull-left
+ app-page-header([heading]="'Custom Role Management'")
+ h5 {{ groupName }}
+
+
+
+ .pull-right
+ button(mat-raised-button color="primary", (click)="update()") Update All Rows
+
+ .card-md-12.mt-3
+
+ div(style="width: 100%", [hidden]="!loading")
+ mat-spinner(style="margin: auto", color="primary")
+ table(mat-table, [dataSource]="dataSource", style="width: 100%", [hidden]="loading")
+
+ ng-container(matColumnDef="roleName")
+ th(mat-header-cell, *matHeaderCellDef) Role Name
+ td(mat-cell, *matCellDef="let element") {{ element.roleName }}
+
+ ng-container(matColumnDef="read")
+ th(mat-header-cell, *matHeaderCellDef) Read
+ td(mat-cell, *matCellDef="let element")
+ mat-checkbox([(ngModel)]="element.readPermission", [disabled]="true")
+
+
+
+
+ ng-container(matColumnDef="write")
+ th(mat-header-cell, *matHeaderCellDef) Write
+ td(mat-cell, *matCellDef="let element")
+ mat-checkbox([(ngModel)]="element.writePermission", [disabled]="(element.roleName == 'admin')")
+
+ ng-container(matColumnDef="execute")
+ th(mat-header-cell, *matHeaderCellDef) Execute
+ td(mat-cell, *matCellDef="let element")
+ mat-checkbox([(ngModel)]="element.executePermission", [disabled]="(element.roleName == 'admin')")
+
+ ng-container(matColumnDef="delete")
+ th(mat-header-cell, *matHeaderCellDef) Delete
+ td(mat-cell, *matCellDef="let element")
+ mat-checkbox([(ngModel)]="element.deletePermission", [disabled]="(element.roleName == 'admin')")
+
+ ng-container(matColumnDef="management")
+ th(mat-header-cell, *matHeaderCellDef) Management
+ td(mat-cell, *matCellDef="let element")
+ mat-checkbox([(ngModel)]="element.managementPermission", [disabled]="true")
+
+ ng-container(matColumnDef="actions")
+ th(mat-header-cell, *matHeaderCellDef) Actions
+ td(mat-cell, *matCellDef="let element")
+ button(color="warn", matTooltip="Delete Role Permissions", mat-icon-button, (click)="deleteRole(element)", [disabled]="((element.roleName == 'admin') || (element.roleName == 'user') || (element.roleName == 'developer'))")
+ mat-icon delete_forever
+ button(color="primary", matTooltip="Save Role Permissions", mat-icon-button, (click)="update()", [disabled]="(element.roleName == 'admin')")
+ mat-icon save
+
+
+
+
+ tr(mat-header-row *matHeaderRowDef="displayedColumns")
+ tr(mat-row *matRowDef="let row; columns: displayedColumns;")
+
+
+
+
+
+ div(style="width: 100%;height:50px")
+
+ .card-md-12
+ .row
+ .col-sm-4
+ h3 Add New Role
+ .row
+ .col-sm-4
+ mat-form-field
+ input(matInput [(ngModel)]="roleName", id="roleName", name="roleName", placeholder="Role Name", required)
+ button(mat-raised-button color="primary", (click)="create()", style="margin-left:20px;", [disabled]="!roleName") Add Role
+
+
diff --git a/otf-frontend/client/src/app/layout/manage-group/manage-group-roles/manage-group-roles.component.scss b/otf-frontend/client/src/app/layout/manage-group/manage-group-roles/manage-group-roles.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/manage-group/manage-group-roles/manage-group-roles.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/layout/manage-group/manage-group-roles/manage-group-roles.component.spec.ts b/otf-frontend/client/src/app/layout/manage-group/manage-group-roles/manage-group-roles.component.spec.ts
new file mode 100644
index 0000000..f6bab0d
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/manage-group/manage-group-roles/manage-group-roles.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ManageGroupRolesComponent } from './manage-group-roles.component';
+
+describe('ManageGroupRolesComponent', () => {
+ let component: ManageGroupRolesComponent;
+ let fixture: ComponentFixture<ManageGroupRolesComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ManageGroupRolesComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ManageGroupRolesComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/manage-group/manage-group-roles/manage-group-roles.component.ts b/otf-frontend/client/src/app/layout/manage-group/manage-group-roles/manage-group-roles.component.ts
new file mode 100644
index 0000000..c637e2b
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/manage-group/manage-group-roles/manage-group-roles.component.ts
@@ -0,0 +1,243 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit } from '@angular/core';
+import { routerLeftTransition } from 'app/router.animations';
+import { ActivatedRoute } from '@angular/router';
+import { GroupService } from 'app/shared/services/group.service';
+import { CookieService } from 'ngx-cookie-service';
+import { MatTableDataSource } from '@angular/material/table';
+import { MatDialog } from '@angular/material';
+import {AlertModalComponent} from '../../../shared/modules/alert-modal/alert-modal.component';
+import { NEXT } from '@angular/core/src/render3/interfaces/view';
+import { convertPropertyBindingBuiltins } from '@angular/compiler/src/compiler_util/expression_converter';
+import { extractDirectiveDef } from '@angular/core/src/render3/definition';
+import { take } from 'rxjs/operators';
+
+
+
+
+
+@Component({
+ selector: 'app-manage-group-roles',
+ templateUrl: './manage-group-roles.component.pug',
+ styleUrls: ['./manage-group-roles.component.scss'],
+ animations: [routerLeftTransition()]
+})
+
+export class ManageGroupRolesComponent implements OnInit {
+
+
+ public selectedGroup;
+ public groupRoles;
+ public roleName = null;
+ public loading = false;
+ public groupPermissions;
+ public element = {};
+ public groupName;
+
+ public dataSource;
+ public displayedColumns;
+ public readPermission = false;
+ public writePermission = false;
+ public executePermission = false;
+ public deletePermission = false;
+ public managementPermission = false;
+
+
+
+
+
+ constructor(
+ public _groups: GroupService,
+ private cookie: CookieService,
+ private modal: MatDialog,
+ private ResponseMatDialog: MatDialog
+
+ ) {
+
+
+ }
+
+ ngOnInit() {
+
+ this.setComponentData(this._groups.getGroup());
+ this._groups.groupChange().subscribe(group => {
+ this.setComponentData(group);
+
+ });
+
+
+ }
+
+ setComponentData(group) {
+ if(!group){
+ return;
+ }
+ this.groupName = group.groupName;
+ this.loading = true;
+ this.dataSource = new MatTableDataSource();
+ this._groups.find({
+ $limit: -1,
+ _id: group['_id'],
+ $select: ['_id', 'roles']
+ }).subscribe((res) => {
+
+ this.selectedGroup = res[0];
+ this.groupRoles = res[0].roles;
+
+ //If current group does not have any roles
+ if ( (this.groupRoles == null) || (this.groupRoles.length < 1))
+ {
+ this.groupRoles = [
+ {roleName: "admin", permissions: "read, write, execute, delete, management"},
+ {roleName: "user", permissions: "read"},
+ {roleName: "developer", permissions: "read, write, execute, delete"}
+ ];
+
+ }
+
+
+ for (let i = 0; i < this.groupRoles.length; i++){
+ this.groupRoles[i].readPermission = false;
+ this.groupRoles[i].writePermission = false;
+ this.groupRoles[i].executePermission = false;
+ this.groupRoles[i].deletePermission = false;
+ this.groupRoles[i].managementPermission = false;
+ if (this.groupRoles[i].permissions.includes('read')){
+ this.groupRoles[i].readPermission = true;
+ }
+ if (this.groupRoles[i].permissions.includes('write')){
+ this.groupRoles[i].writePermission = true;
+ }
+ if (this.groupRoles[i].permissions.includes('execute')){
+ this.groupRoles[i].executePermission = true;
+ }
+ if (this.groupRoles[i].permissions.includes('delete')){
+ this.groupRoles[i].deletePermission = true;
+ }
+ if (this.groupRoles[i].permissions.includes('management')){
+ this.groupRoles[i].managementPermission = true;
+ }
+ }
+
+ this.dataSource.data = this.groupRoles;
+ this.loading = false;
+ this.update();
+
+
+
+
+ })
+
+ this.displayedColumns = ['roleName', 'read', 'write', 'execute', 'delete', 'management', 'actions']
+
+ }
+
+
+ async create(){
+
+ for (let i = 0; i < this.groupRoles.length; i++){
+ if (this.groupRoles[i].roleName == this.roleName){
+ this.sendFeedbackAlert('warning', 'Please do not add a duplicate role name.');
+ return;
+ }
+ }
+
+ this.groupRoles.push({roleName: this.roleName, readPermission: true, writePermission: false, executePermission: false, deletePermission: false, managementPermission: false});
+ await this.update();
+ this.setComponentData(this._groups.getGroup());
+
+
+ }
+
+ async update(){
+
+
+ for (let i = 0; i < this.groupRoles.length; i++) {
+ this.groupRoles[i].permissions = [];
+ if(this.groupRoles[i].readPermission){
+ this.groupRoles[i].permissions.push('read');
+ }
+ if(this.groupRoles[i].writePermission){
+ this.groupRoles[i].permissions.push('write');
+ }
+ if(this.groupRoles[i].executePermission){
+ this.groupRoles[i].permissions.push('execute');
+ }
+ if(this.groupRoles[i].deletePermission){
+ this.groupRoles[i].permissions.push('delete');
+ }
+ if(this.groupRoles[i].managementPermission){
+ this.groupRoles[i].permissions.push('management');
+ }
+
+ }
+
+ this.groupPermissions = this.groupRoles.map(({ roleName, permissions }) => ({roleName, permissions}));
+
+ let groupPatch = {
+ '_id': this.selectedGroup._id,
+ 'roles': this.groupPermissions
+ };
+ //console.log(groupPatch);
+ await this._groups.patch(groupPatch).pipe(take(1)).toPromise();
+
+
+
+ }
+
+ async deleteRole(element){
+
+ for (let i = 0; i < this.groupRoles.length; i++){
+ if (this.groupRoles[i].roleName == element.roleName){
+ this.groupRoles.splice(i, 1);
+ break;
+ }
+ }
+ await this.update();
+ this.setComponentData(this._groups.getGroup());
+
+
+
+
+ }
+
+ public sendFeedbackAlert(type: string, message: string) {
+ this.ResponseMatDialog.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: type,
+ message: message
+ }
+ });
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
diff --git a/otf-frontend/client/src/app/layout/manage-group/manage-group-routing.module.ts b/otf-frontend/client/src/app/layout/manage-group/manage-group-routing.module.ts
new file mode 100644
index 0000000..f8f1398
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/manage-group/manage-group-routing.module.ts
@@ -0,0 +1,36 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+import {ManageGroupComponent} from './manage-group.component';
+import { ManageGroupRolesComponent } from './manage-group-roles/manage-group-roles.component';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: ManageGroupComponent
+ },
+ {
+ path: 'manage-group-roles', component: ManageGroupRolesComponent
+ },
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class ManageGroupRoutingModule { }
diff --git a/otf-frontend/client/src/app/layout/manage-group/manage-group.component.pug b/otf-frontend/client/src/app/layout/manage-group/manage-group.component.pug
new file mode 100644
index 0000000..e4b7700
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/manage-group/manage-group.component.pug
@@ -0,0 +1,40 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div([@routerTransition]).mb-3
+ h2 Manage Group
+
+ .card-mb-12
+ div.mb-1
+ mat-card-title(*ngIf="hasMembers") {{ group.groupName }}
+
+ button.mr-2.pull-right(matTooltip="Remove user", color="warn", mat-raised-button, (click)="removeMembers()", [disabled] = "!hasSelectedRows") Remove
+ button.mr-2.pull-right(matTooltip="Edit user roles", color="accent", mat-raised-button, (click)="editRoles()", [disabled]="!hasSelectedRows || multipleRowsSelected") Edit Roles
+ button.mr-2.pull-right(mat-raised-button, color="primary", (click)="openUserSelect()") Add Users
+ //button.mr-2.pull-right(mat-raised-button, color="primary", (click)="onboardMechid()") Add Mech Id
+ button.mr-2.pull-right(mat-raised-button, color="primary", [routerLink]="['manage-group-roles']") Manage Group Roles
+
+ mat-card-content
+ .clearfix
+ ag-grid-angular.ag-theme-material(
+ style="width:100%; height: 600px",
+ [rowData]="rowData",
+ [columnDefs]="columnDefs",
+ rowSelection="multiple",
+ [rowMultiSelectWithClick]="true",
+ (cellClicked)="onCellClicked($event)",
+ (rowSelected)="onRowSelected($event)",
+ (gridReady)="onGridReady($event)")
diff --git a/otf-frontend/client/src/app/layout/manage-group/manage-group.component.scss b/otf-frontend/client/src/app/layout/manage-group/manage-group.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/manage-group/manage-group.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/layout/manage-group/manage-group.component.spec.ts b/otf-frontend/client/src/app/layout/manage-group/manage-group.component.spec.ts
new file mode 100644
index 0000000..dd3ba91
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/manage-group/manage-group.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ManageGroupComponent } from './manage-group.component';
+
+describe('ManageGroupComponent', () => {
+ let component: ManageGroupComponent;
+ let fixture: ComponentFixture<ManageGroupComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ManageGroupComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ManageGroupComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/manage-group/manage-group.component.ts b/otf-frontend/client/src/app/layout/manage-group/manage-group.component.ts
new file mode 100644
index 0000000..e6ea356
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/manage-group/manage-group.component.ts
@@ -0,0 +1,234 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit } from '@angular/core';
+import { GroupService } from 'app/shared/services/group.service';
+import { UserService } from 'app/shared/services/user.service';
+import { routerTransition } from '../../router.animations';
+import { MatDialog } from '@angular/material';
+import { UserSelectComponent } from 'app/shared/modules/user-select/user-select.component';
+import { MulticastOperator } from 'rxjs/internal/operators/multicast';
+import { forEach } from '@angular/router/src/utils/collection';
+import { OnboardMechidComponent } from 'app/shared/modules/onboard-mechid/onboard-mechid.component';
+import { DropdownMultiselectComponent } from './dropdown-multiselect.component';
+import { TabbedLayout } from 'ag-grid-community';
+import value from '*.json';
+import { take } from 'rxjs/operators';
+import { object } from '@amcharts/amcharts4/core';
+import { AlertModalComponent } from 'app/shared/modules/alert-modal/alert-modal.component';
+
+
+@Component({
+ selector: 'app-manage-group',
+ templateUrl: './manage-group.component.pug',
+ styleUrls: ['./manage-group.component.scss'],
+ animations: [routerTransition()]
+})
+export class ManageGroupComponent implements OnInit {
+
+ public group;
+ public loading = false;
+ public users;
+ public tableData;
+ public hasMembers = false;
+ public hasSelectedRows = false;
+ private gridApi;
+ private gridColumnApi;
+ public memberTable;
+ public rowData;
+ public multipleRowsSelected = false;
+
+
+ public columnDefs = [
+ { headerName: 'First Name', field: 'firstName', sortable: true, sort: "asc", filter: true, checkboxSelection: true, headerCheckboxSelection: true, headerCheckboxSelectionFilteredOnly: true},
+ { headerName: 'Last Name', field: 'lastName', sortable: true, filter: true },
+ { headerName: 'Email', field: 'email', sortable: true, filter: true },
+ { headerName: 'Roles', field:'roles', sortable: true, filter: true, editable: true, cellEditor: "DropdownMultiselectComponent", cellEditorParams: function (params) {
+ return {
+ roles: params.roles,
+ userId: params._id
+ };
+ }
+ },
+ ];
+
+ constructor(private groupService: GroupService, private userService: UserService, private modal: MatDialog,) { }
+
+ ngOnInit() {
+ this.group = {};
+ //this.tableData = [];
+ this.group = this.groupService.getGroup();
+
+
+ this.groupService.groupChange().subscribe(group => {
+ this.tableData = undefined;
+ this.rowData = undefined;
+ this.setComponentData(group);
+ });
+
+ this.groupService.get(this.group._id).subscribe((res) => {
+ this.group = res;
+ this.setComponentData(this.group);
+ });
+
+
+ }
+
+ openUserSelect(){
+ this.modal.open(UserSelectComponent, {
+ width: "500px",
+ data: {
+ groupId: this.group._id
+ }
+ }).afterClosed().subscribe((response) => {
+ this.groupService.get(this.group._id).subscribe((res) => {
+ this.group = res;
+ this.setComponentData(this.group);
+ });
+
+ });
+
+
+ }
+
+ onboardMechid(){
+ this.modal.open(OnboardMechidComponent, {
+ width: "500px",
+ data: {
+ groupId: this.group._id
+ }
+ }).afterClosed().subscribe((response) => {
+
+ });
+ }
+
+ removeMembers(){
+ let membersToRemove = this.gridApi.getSelectedRows().map(({_id}) => ({_id}));
+ this.group.members = this.group.members.filter(member => membersToRemove.filter(user => member.userId.toString() == user._id.toString()).length <= 0);
+ let groupPatch = {
+ _id : this.group._id,
+ members: this.group.members
+ }
+ //removes the members from the group
+ this.groupService.patch(groupPatch).subscribe(
+ (res) => {
+ this.gridApi.deselectAll();
+ this.tableData = this.tableData.filter(member => membersToRemove.filter(user => member._id.toString() == user._id.toString()).length <= 0);
+ this.rowData = Object.assign([], this.tableData);
+ },
+ (err) => {
+ this.modal.open(AlertModalComponent, {
+ data: {
+ type: "alert",
+ message: "The was an error removing the user. " + err
+ }
+ });
+ });
+
+ }
+
+ setComponentData(group){
+ this.gridApi.deselectAll();
+ if(!group){
+ return;
+ }
+ this.loading = true;
+ this.group = group;
+ this.users = [];
+ //this.tableData = [];
+ //console.log("Running Data")
+ this.hasMembers = true;
+ this.columnDefs[this.columnDefs.length-1]["cellEditorParams"]["values"] = this.group.roles;
+ if(this.group.members){
+
+ //console.log(this.group)
+ for(let i = 0; i < this.group.members.length; i++){
+ let temp = this.group.members[i]["userId"];
+ this.userService.get(temp).subscribe(
+ (res) => {
+ let member = res;
+ member["roles"] = this.group.members[i].roles.join();
+ if(!this.tableData){
+ this.tableData = [];
+ }
+ if(this.tableData.filter(user => user['_id'].toString() == member["_id"].toString()).length <= 0){
+ this.tableData.push(member);
+ }else{
+ this.tableData = this.tableData.filter(user => user['_id'].toString() != member["_id"].toString())
+ this.tableData.push(member);
+ }
+ // console.log(this.tableData);
+ this.rowData = Object.assign([], this.tableData);
+ });
+
+
+ }
+ }else{
+ this.hasMembers = false;
+ }
+
+
+ //need to either populate user or pull each user's info
+ //this.rowData = this.tableData;
+ //console.log(this.rowData);
+ }
+
+ editRoles(){
+ //console.log(this.tableData);
+ this.gridApi.refreshCells();
+ let memberToEdit = this.gridApi.getSelectedRows().map(({_id}) => ({_id}));
+ this.modal.open(DropdownMultiselectComponent, {
+ width: "500px",
+ data : {
+ user : memberToEdit,
+ group: this.group
+ }
+ }).afterClosed().subscribe((res) => {
+ this.groupService.get(this.group._id).subscribe((res) => {
+ this.group = res;
+ this.setComponentData(this.group);
+ });
+ })
+ }
+
+ onCellClicked(event) {
+ //console.log(event.colDef.field)
+ }
+
+ onRowSelected(event){
+ if(event.api.getSelectedNodes().length > 0){
+ this.hasSelectedRows = true;
+ if(event.api.getSelectedNodes().length > 1){
+ this.multipleRowsSelected = true;
+ }else{
+ this.multipleRowsSelected = false;
+ }
+ }else{
+ this.hasSelectedRows = false;
+ this.multipleRowsSelected = false;
+ }
+ }
+
+ onGridReady(params){
+ this.gridApi = params.api;
+ //console.log(params.columnApi.autoSizeColumns)
+ this.gridColumnApi = params.columnApi;
+
+ //auto size the column widths
+ this.gridColumnApi.autoSizeColumns(['name']);
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/manage-group/manage-group.module.spec.ts b/otf-frontend/client/src/app/layout/manage-group/manage-group.module.spec.ts
new file mode 100644
index 0000000..1c86cf2
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/manage-group/manage-group.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { ManageGroupModule } from './manage-group.module';
+
+describe('ManageGroupModule', () => {
+ let manageGroupModule: ManageGroupModule;
+
+ beforeEach(() => {
+ manageGroupModule = new ManageGroupModule();
+ });
+
+ it('should create an instance', () => {
+ expect(manageGroupModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/manage-group/manage-group.module.ts b/otf-frontend/client/src/app/layout/manage-group/manage-group.module.ts
new file mode 100644
index 0000000..b0c4580
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/manage-group/manage-group.module.ts
@@ -0,0 +1,60 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule, ReactiveFormsModule } from '@angular/forms';
+import { ManageGroupComponent } from './manage-group.component';
+import { ManageGroupRoutingModule } from './manage-group-routing.module';
+import { AgGridModule } from 'ag-grid-angular';
+import { UserSelectModule } from 'app/shared/modules/user-select/user-select.module';
+import { DropdownMultiselectComponent } from './dropdown-multiselect.component';
+import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
+import { MatProgressSpinnerModule, MatIconModule, MatCardModule, MatCheckboxModule, MatTableModule, MatButtonModule, MatInputModule, MatFormFieldModule, MatTooltipModule} from '@angular/material';
+import { ManageGroupRolesComponent } from './manage-group-roles/manage-group-roles.component';
+import {PageHeaderModule} from '../../shared';
+import {AlertModalModule} from 'app/shared/modules/alert-modal/alert-modal.module';
+import { OnboardMechidModule } from 'app/shared/modules/onboard-mechid/onboard-mechid.module';
+
+
+@NgModule({
+ imports: [
+ CommonModule,
+ MatCardModule,
+ ManageGroupRoutingModule,
+ AgGridModule.withComponents([DropdownMultiselectComponent]),
+ NgbDropdownModule,
+ UserSelectModule,
+ OnboardMechidModule,
+ MatCheckboxModule,
+ MatTableModule,
+ MatInputModule,
+ MatFormFieldModule,
+ MatTooltipModule,
+ PageHeaderModule,
+ FormsModule,
+ MatButtonModule,
+ MatIconModule,
+ MatProgressSpinnerModule,
+ ReactiveFormsModule,
+ AlertModalModule
+
+ ],
+ declarations: [ManageGroupComponent, DropdownMultiselectComponent, ManageGroupRolesComponent]
+
+
+})
+export class ManageGroupModule { }
diff --git a/otf-frontend/client/src/app/layout/modeler/color-picker/ColorPicker.js b/otf-frontend/client/src/app/layout/modeler/color-picker/ColorPicker.js
new file mode 100644
index 0000000..3495cdd
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/color-picker/ColorPicker.js
@@ -0,0 +1,80 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {
+ is
+ } from 'bpmn-js/lib/util/ModelUtil';
+
+
+ /**
+ * A basic color picker implementation.
+ *
+ * @param {EventBus} eventBus
+ * @param {ContextPad} contextPad
+ * @param {CommandStack} commandStack
+ */
+ export default function ColorPicker(eventBus, contextPad, commandStack) {
+
+ contextPad.registerProvider(this);
+
+ commandStack.registerHandler('shape.updateColor', UpdateColorHandler);
+
+ function changeColor(event, element) {
+
+ var color = window.prompt('type a color code');
+
+ commandStack.execute('shape.updateColor', { element: element, color: color });
+ }
+
+
+ this.getContextPadEntries = function(element) {
+
+ if (is(element, 'bpmn:Event')) {
+ return {
+ 'changeColor': {
+ group: 'edit',
+ className: 'icon-red',
+ title: 'Change element color',
+ action: {
+ click: changeColor
+ }
+ }
+ };
+ }
+ };
+ }
+
+
+
+ /**
+ * A handler updating an elements color.
+ */
+ function UpdateColorHandler() {
+
+ this.execute = function(context) {
+ context.oldColor = context.element.color;
+ context.element.color = context.color;
+
+ return context.element;
+ };
+
+ this.revert = function(context) {
+ context.element.color = context.oldColor;
+
+ return context.element;
+ };
+
+ }
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/modeler/color-picker/ColoredRenderer.js b/otf-frontend/client/src/app/layout/modeler/color-picker/ColoredRenderer.js
new file mode 100644
index 0000000..957e8b9
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/color-picker/ColoredRenderer.js
@@ -0,0 +1,67 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import inherits from 'inherits';
+
+import {
+ attr as svgAttr
+} from 'tiny-svg';
+
+import BpmnRenderer from 'bpmn-js/lib/draw/BpmnRenderer';
+
+import {
+ is
+} from 'bpmn-js/lib/util/ModelUtil';
+
+
+export default function ColoredRenderer(
+ config, eventBus, styles,
+ pathMap, canvas, textRenderer) {
+
+ BpmnRenderer.call(
+ this,
+ config, eventBus, styles,
+ pathMap, canvas, textRenderer,
+ 1400
+ );
+
+ this.canRender = function(element) {
+ return is(element, 'bpmn:BaseElement') && element.color;
+ };
+
+ this.drawShape = function(parent, shape) {
+
+ var bpmnShape = this.drawBpmnShape(parent, shape);
+
+ svgAttr(bpmnShape, { fill: shape.color });
+
+ return bpmnShape;
+ };
+}
+
+inherits(ColoredRenderer, BpmnRenderer);
+
+ColoredRenderer.prototype.drawBpmnShape = BpmnRenderer.prototype.drawShape;
+
+
+ColoredRenderer.$inject = [
+ 'config.bpmnRenderer',
+ 'eventBus',
+ 'styles',
+ 'pathMap',
+ 'canvas',
+ 'textRenderer'
+];
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/modeler/color-picker/index.js b/otf-frontend/client/src/app/layout/modeler/color-picker/index.js
new file mode 100644
index 0000000..049e921
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/color-picker/index.js
@@ -0,0 +1,24 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import ColorPicker from './ColorPicker';
+import ColoredRenderer from './ColoredRenderer';
+
+export default {
+ __init__: [ 'colorPicker', 'coloredRenderer' ],
+ colorPicker: [ 'type', ColorPicker ],
+ coloredRenderer: [ 'type', ColoredRenderer ]
+};
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/draw/LogTestResultRenderer.js b/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/draw/LogTestResultRenderer.js
new file mode 100644
index 0000000..607cd08
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/draw/LogTestResultRenderer.js
@@ -0,0 +1,60 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import inherits from 'inherits';
+
+import BaseRenderer from 'diagram-js/lib/draw/BaseRenderer';
+
+import {
+ is
+} from 'bpmn-js/lib/util/ModelUtil';
+
+import Cat from '../image';
+
+import {
+ append as svgAppend,
+ create as svgCreate
+} from 'tiny-svg';
+
+
+export default function NyanRender(eventBus) {
+ BaseRenderer.call(this, eventBus, 1500);
+
+ this.canRender = function(element) {
+ return is(element, 'custom:Log');
+ };
+
+
+ this.drawShape = function(parent, shape) {
+ var url = Cat.dataURL;
+
+ var catGfx = svgCreate('image', {
+ x: 0,
+ y: 0,
+ width: shape.width,
+ height: shape.height,
+ href: url
+ });
+
+ svgAppend(parent, catGfx);
+
+ return catGfx;
+ };
+}
+
+inherits(NyanRender, BaseRenderer);
+
+NyanRender.$inject = [ 'eventBus' ];
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/draw/index.js b/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/draw/index.js
new file mode 100644
index 0000000..a73db29
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/draw/index.js
@@ -0,0 +1,22 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import LogTestResultRenderer from './LogTestResultRenderer';
+
+export default {
+ __init__: [ 'logTestResultRenderer' ],
+ logTestResultRenderer: [ 'type', LogTestResultRenderer ]
+};
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/image/cat.gif b/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/image/cat.gif
new file mode 100644
index 0000000..bf0314f
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/image/cat.gif
Binary files differ
diff --git a/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/image/index.js b/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/image/index.js
new file mode 100644
index 0000000..29fce79
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/image/index.js
@@ -0,0 +1,19 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+// inlined and base64 encoded ./cat.gif
+
+module.exports.dataURL = 'data:image/gif;base64,R0lGODlh9AFeAaIHAAAAAP+Z/5mZmf/Mmf8zmf+Zmf///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJBwAHACwAAAAA9AFeAUAD/3i63P4wykmrvTjrzbv/YCiOZGmeaKqubOu+cCzPdG3fQK7vfO//wKBwSCwaj8ikcsks3p7QqFTSrFqv2Kx2yxVOv+AwiTgom8/otHrNbrvf8Lh8Tq/b7/j4UMzv04x5eAGDhIWGh4iJiouMjY6PkJGSk4+BdkZ+mZocgJZ1lKChoqOkpaaGnnSYm6ytVEWpZaeztAEEt7i5urW6vQS1wI2xq67Fxp2pwcqgvs28zbjL0oXDTsbXrchtz9C509/g4eKLb8TY533abNzdt+Pv8PG15dbo9mHqa/L7/IhZs+280aJH5IKWewhfkXnTr6EyIwIiSpxIsWJFIw4TEcxisf+jx4nmErLKpyajyVMQP6qkiPEkNTdcVsqUGHJKlywjSKZxqSzgL1opZwpVSUTeRiFDk36sKeUmlpywGPIE5rNWUKVYIxaNdzRI1q9a64EhArYjTgs60UxdK+lq2bcgnVaBS9ci0yhk64a9YjCqG7aAHbnVC1buXMJ670LRgtiwDzjyAgYWXASx5cuYMy8V+4UxYcc9IMeTPJnRYM2oU6tWqlhTTLpcRJee5vPW6dW4c+u23DrTa7hpz0Cq/XM2qNuZDShfzrx53t11m0tn/rxubz+/3wY3M7y28VDIMU8fXx362/HTywPnLJIB6CWyv/MLf9nz7iFC7Vtn317BeyX/8cknD328cQQdfjPpBxt//UGlRYACEjcLgRIVYOGFGGaooYbmdZjahiCGqOF1DXYQm1QCEiIhSpXNJOKLHHoo42Uw1pghiSWqsB0d3VWVYgAURmRjjfkhmFiL66ln0ZBD4pgjCjvO0SNpKQYpAJMvFonUZ0hq16VHWNbo5JMmRBkLdz9a9WVq/7XJxJEFkTmDmzmcaeedeFbj1Yx83segnHjRmeeghBYK05Z9JqramICWYCRudEYq6aSUVupUo9ghCqmlnHbq6aecYpqOpgs+hdaaXzHaGaqp/umAlSupKqpNpCbJ16lKZiVrU6zq6moDsBL166yjglqmm8Qq1Oax/7cm6+yz0EYr7bTUVmvttdhmq+223Hbr7bfghivuuOSWa+656Kar7rrstuvuu/DGK68roNZr771nzesuvvz2668X+oa7kKEEF2zwwQh31UPA1Q6c8MMQRyxxHnsw/KSZdqapMVcI72oxDn4dvPHI4iTs8cc1YAwhyYasCFA7I+tZMcojhbwOLS6zrPM+Cv9AczY264OzdzsXzXEbJ/8cQ5RGy/fPKTmb0rMPfZmqdAZMN23c06ZEXcrUC+Pa7NVVD7Gy1u8Eu9lWU4G9BJwzX5012vuo7VFLbR+qYFlJ64ivg2ajSLctVLKYa2Zsv+P2Dn7Gic/fIsw9uI8T9opZ4v/jLK5D43GvWquXY08g+eBpW24evoqyNGzKBsL93tnfFP6j3anXrlvfKewN+n+w0wbzxrTbLjybq/ORHd9b9E56y7UFP/zz0O/VeaC6+/qg4MsvQpzz0XdfO+6sV4/V6NoTTTf3WKEn3eHeq+/co6VOD7T4rAVd0iNeG42+Uu5TB7/3E+nfcthnPfn1B1/Ky15bTFcgLJzuc2Zp3X4c960T/UVj+QMPAysUJhABEIAdfBH4GmXBbWDQfKWwUgg39EHvrTBEI7SWyrBXPsoJSIUvxJCW9uQ6Hu4OghTJ4YZi2DD7CQJ/KHTaBoUkRAvtEAiNWaJMKNTEGxVvXDNMhgL/TSPFCf7LMT0EAtn8Y8RCbZGLBGzgFw0TRp/BK1ITi6McB/C/FtoxLhRUGhznyMeH1fGOdyTitf6omTUa8pCIpNMY3QPEVlmNAvuTHsCuEUlJBqFsjUyKIOVFSEeGTlmZHMomX1BJATipkqN8Y72Y9R8ZKtJRj1wk4DzFyve4Elmw/KQsd8nLXvryl8AMpjCHScxiGvOYyEymMpfJzGY685nQjKY0p0nNalqTmonMpjZxec0cbfOb4LxJNy8WznKaswnj9OY518nOPKZzEw7rozznSU+ZufGdtBJCPffJz37KwYD4DF8Q/EnQghYUoAEdQxkJdcaGvuRgqZRmFj3h/9CKmuyKCX3VQgdVUYde1J0ZFZs+E9bRhn4UoSGNwERvRrcMikJ2KbLnJVOKtY3yaHJJLAVMBSRTMdIUAysVWktzSoqdyqen9/xpBYJ6v6HasGu/0xhSqaZUkQ6UhkUlakm3OgjN5aCqVgVCAifhUq521KsAAOtSbToAdkTVrHBFq1ohyVa3dgOueA2AXOcKyqteMK+lu8LLnvo1vaGUkbEcJvkA+w2u6VSrotjrWhMrzMUyVhqOzSphSSFZulI2mJa97CRQWQS2oLWUEfVWaEUbCdJi7iSn7WKsMKrKeAqVtRpM4xODYFrDOtCLkxwL5EKw2p1tdhSlTNAQjOJbH/+uJrUe4Ncs/WpC0h1XFMmd4nKPxobsahek1LPXdMWK1aZdN7edrM924YFWzgXXc+KNXF2Xd97jyNZWQGAu0u6L35k+LpT10yUEiovbRnj3h58aHnRNlN7xffYBBC7wIg6MPHspmLYw0K0mH6xR2zZVwqPlL2pQJ7wFc0KC8XtdeWP31tmJGJAwFhZ4F4Pi/jpmrMEw6ncoHOMWmngD9Cugiv/6Dh1v7cU9TjIeDytQK0SxTTimSourhGQlK/nHJzheYZK34oZur8pWDnOK/ZvPGnsSC1G2bvPALOY2n5nMvAqyKLlM5K1+WcNuzjNw4Rze39q4CmnGqU94rOdC0wT/w2X2M4LJW+caGpllhLaIAJWDZ+FN2gCVVu6MXbOFPTO6uo0oK6TZnJRLZ7p2pm5wgJlsvE6P+dMsDTVkdRbpiqQawM+7tXP/TFVKuprXoeky8+pLslpTRNdQjDGyf/BkVqMDgcK+rLGX7OQD4dqUZq6ws88B7UZLeNqHVnRuVG3JJjT7vSXqNqhBDCRSz1ncm9r13bK95U1jq4SxTpGoF4jnKhbA0Obx94WwbA9831bfsw5xv6sIcOgI3EIEfzad1x2hhPOb3FdieMN18/ACRBxQTN0JEonNFhw2cbc+OLe8hbzyID7843IKuVpG/mjAmFyIKO+BypMNbB7IpOMw/yeTzIVD8ykfeeEn13TL38zzRTN7JUBHtGrZKocpGX02N89hzn3OpVPPW7dRt7e5hv4JuIK73O10N7bFri+y39SsZ1972pHQxl7LjeoZM7valT531Eq9W3s0qODngPGN3+7v6wr84BffXJ0b/nuIV5fiGU/5NBT+8c+NfLomX/nO0/HamM882891+Vf3/fSolxQvS9/z1Lv+9V1YPeg9Dfva257DKGO902/P+94fQfZLZzk6w/r01uuA22o/pbuDjsXZf1fAEF6+5m3g99EfwLXbXqTu1wb9Dm//ItNvcvA3bH3so1uxzp8t7hH7fdVZ/7/td7+zzc9n9Bsrl60sIv83x7uEbsZXocuifwEIgFbgf6uEf7YkgPlHgFXAVw74gBAYgRI4gRRYgRZ4gRiYgRq4gRzYgR74gSAYgiI4giRYgiZ4giiYgiq4gizYgi74gjAYgzI4gzRYgzZ4g8bkezp4LzgYXTv4g7TUgycGhERIKUI4hEWYhPt3hJikhE5oGEyoAU84hY4RhTVFhVjIBVa4AB7meV74hRRzfi7YhWBYhma4ODVIhme4hmxYBtlHgmrYhnIIhm84gnE4h3hYeXUogneYh34oeHsYgn34h4TYT4EYgW4nJewWMx0TfuOUiFW3iBtzUmL4gJAYB5I4iY34fj91iYGWiS5BifUHgZ7/GG2g2FsQ5YgGOIh5d4o8tYmHGFCl6G2uOBmi6FMVmIhqRnKSUHO2mArMV0y6KGi+2ItX9x1TFTa5iHefWHG8GAnFCBjJyAMXOIxOFY1W5wuM6AnBSEzWiDb7RlbHaBzTuAPVyIymuDHhaIx3pYncqIrX9I1as47QOI6zUY7HZ4HyaF4WJ47tKFXACI/WFGHsiI21eFSNl1QTSJD1+IwHiZD7xYk0xZDZCA0P2TSdtZDzNVgGeZGlkZESSJFF948eyTIgiYgbCTX9WJLkmJB2p5F9aFcWyZIm6ZLKSIEiSZOEkFmjQI+QcJIDli/CmJI6CQk8+VIrGQlAGX3rB3yB/0OLRTlhWMCR9kgJS+l9BXhMOVmURxkKPlkJNkmNxNd/WkmUUWlgU6mSDgmWETl/QumNZnmWUilYatmRwhCW5jiWSoBMW8lu9JdfaxFbXvd1sbh5cVmSf/kDqNhdv2Z8XzVGfQliiekDi7kGWlZvhYkukflt0vdaJiGY8Udto/gxm1lgk9kDlakGl8l0CvkzpYlbp8kDqWl5jbl7N6lHh+mRsbkDs4kGqyl8rUkzr8lau6kDvXkGv+lgEklKwwUCw1kaa0kZg4mZgMleeLk5h7ecLiBd8hWT9GWXaBSa5Mdb3GWZe8d3o/kE3ElcuVk00YmW08maslmeqnmez1eJ6v/ZnB/wnJPxnuGZftpWnYpznTngXukJMjzYnU9JcfMInnMpnu9GntbZlgAaoAdKffrpg965iyRpCnHnmeDQXtmZmVCSoQy2ocQ4k5UTn8A5nxPKmCzaoreZaMVHe3uplzzQjH5pn7ZZKRemnS0Qo+DXfcDSng8Zd/eZYCUmkPzHdXWXBE0IawdHk0iqfvXyoySaZRAablk5WQuab1TKoxbqKViKnwg6fqvWgDi6AzoqmWJKnUpqO92oUluKdjfqpSMFlRdZpTJ2pUsKpCwgpPKnpnhKXWDKknzKfaBSphcqfubWdbyTjlLWoVQmqKGXOnMalPDWo13QppqlommSqJf/ejlMqqDV9qQ34ak9WZWTIaqjqkZmiqGbOqaGoapISak39KavaqC4KFyzCqc3JqkyuQvAo6u7Om6lyp6/Kp9OYateyaqB4arHaqMzGmdXsHO1KqxDg6tKZKnT6iGZioTLOp5opq3X2A7S+q2YmqwaSm9pegXOyjJ3VqfqmmThyn7jGqHlqqdnNK8VWq95dq9cWJvACmjmCo5r5q0A22MCS0ZytnVMEK8k469ourAb17DXR7DMCh8H26CDZqwW2z0Ym5zkCq8dy48fq7AhG0jseqLuWrJWILEjQ7FNt7KjirFRehiOCQBR9pWVSq8rsWwpp2yTprI4u6ZJQK05Kqk+/5urKhu0RQu0uSG0joeqeelrD4ueUvphjNC03Sq1H0G1TgpIYss4kBqrxfKy+mqoU6oIXrtjIHtsUfuvfFK22Gm1+Yi1aguxS8uvhfC2Rwe2HmG3BUq0AmS0LbsCJLu2WytyjgC4WBe3ATS3FTs8hAsA2PqS9KKxMtq3DJoIkFsacXe5PUa6Z9uoBXcvMps9H7q36lW5Wcu4wXlAqnuyHdW6+UqqsOu6squ5DaJuh2qaksulpzqiNdqnxWt6vku79rK6y4O712ptu5u7MDu77QG8bSu8T4u8Omu8Q5ukj4q3jyl0teu3jAW9yRtvNauo3au81botBse1zuig/iBF/v9ms2URdlkKchMXvMYRuoWQdS+Ev2Chv2irgCZrvoABwDtpvxpHwFhhwKhLLfHruD/CwIMgwCsEwVkhwb06ddejwGyBwe2GdDjHwUrhwdabLRU8c2lCwhocQiicwi+XuCLRwkT3wkkpnRh3vzM8FCq8vNqCw2iiw/6ZCDHcQT8MxDUMqPCLjiJMwoHVww9spevLqXeLxYWrEkH8vobJij27wy6RxGHCt1ustGa7sz/XxPuLwI17BxXpDC5mwlqntVWLxllMq9/7EV0slu+yj24rxidBxlhixph7ulfcuWnMx2x8wM0HxkwryCZByExiyJl7x3qMyR3Rx1e7L1D8uYj/IMXjQMlDYsmIfLwFu8dg0sgTLC6ADLqSnBGkbCOmLL6HrMZQx8ofzC6zCMoNhb46aMva98mWgFfA7HvCDJnEHAjGPLx2envJTDa97L+/7Mxyt4PRfHeQrEVwZ81FmM24uc0UpXfby77IjMfjq81fWjDNXM6Eic3onFa1BWWFWE+Cy8FHy79uUs/2TLdLbBc2/MT7zM/zdM8QnM8xJygELU8GTcAITb4DvdB81ND4+9DkFNESLUcUbbMWrU4YndETs9Er29F6i8rEk4UoPXdOadIjltIuzU4rrcqL8tI0XU4xrcknXdM6nU03Pbait9NAbUg9vcg/HdRG3S9Dnccz/33UTG2i4ZzIhdTUUn2AskSvB4G0Z5zJfnwMyXdFxZnOQ1m5hqx8lkrSTLmlZA2hZg0tVv2WfQXV77rL84PWXt2ZbTwvbd2UDqvWAV2i3prW/ky8rTzMYm3HZFmocF29Qsxpf13XZd3XX5zYykmk+FrY5rzCvtHV5WfXjlzVgT2ohOpZfO3EZ/rZz7zVosPZg63M98eAoHFLA9ikUBqPVC3b4uTGVYiAwzeQtW2qr43bUKjbTLCKn1JLv03Br+Taw03brW3bsQfccmHcy83bze3buY3cS6isXbqF3N3d3v3d4B3e4j3e5F3e5n3e6J3e6r3e7N3e7v3e8B3f8j3f9Ctd3/Z93/id3/q93/zd3/793wAe4AI+4ARe4AZ+4Aie4Aq+4Aze4A7u4AkAACH5BAkHAAcALAAAAAD0AV4BQAP/eLrc/jDKSau9OOvNu/9gKI5kaZ5oqq5s675wLM90bd9Aru987//AoHBILBqPyKRyySzentCoVNKsWq/YrHbLFU6/4DCJOCibz+i0es1uu9/wuHxOr9vv+PhQzO/TjHl4AYOEhYaHiImKi4yNjo+QkZKTj4F2Rn6ZmhyAlnWUoKGio6SlpoaedJibrK1URallp7O0AQS3uLm6tbq9BLXAjbGrrsXGnanByqC+zbzNuMvShcNOxtetyG3P0LnT3+Dh4otvxNjnfdps3N234++0XPCQ5dZjWejo6mvz/f6i8hq180arHhETWvKd26fmn8OHAYYImEixosWLGCcagWdw/48FIxlDihRgTmEUhmkgqpwncaTLixvfdfTyscjLmyTtmTwJ681KaQN/sRSCs+hNIrVmXjHKNGPJnTh6uvm5LGi/lk2zVkRa0A0XrWCfSkkYAyUaqminYQXLVmQXLG3jhhTLE4sMs2fS6g22Vq7fnG+r/B0M2CMMkH7pbsBrpt/AvbX6Ep5MubJlpzpdIJarWANjWfMeQ54l+bLp06i1dkaxOW5gK3BGiwvq7lHr1Lhz67Zs+G7p3Rg/D4BEW6jsb7dPG1jOvLlzIsD/Op/eHPrg3mV/R98qdduj4sfBJTdNvbz17W3LUz+fmKaYr5y7rwtPf9D4y1p03w+ehTD2L//wuSYfP/XRt19l+eV2oEUJ/vUfVA689kNsBRoC3jsLClDAhhx26OGHIG6I3oiVhWjiiRw+CCEDEvpAYYWEXDhOhijWCCJO7MUXhH82uWTjjym6t6IKwslBHG0wSkIjkD/iqJ1qRF3X40hM/qjikPeQEcuRViXJ5UBP4tfimHC1dxCWNhQZC2hewhMmb2TG2YSDmaGZHRZr5qnnnnyqkSGJgFK2mp1QaNHnoYgmesmUgTZ62qCEssZoW3JWaumlmGaqaZ2RTvGnk5uGKuqopJZ6RKd8fHoUpxC8ydSZneYoIKwRqPoSpKimY6lvleZaQaYjXOorNsLeKeewEwArQrH/yDbr7LPQRivttNRWa+212Gar7bbcduvtt+CGK+645JZr7rnopqvuuuy26+678Ma7k6n01msvPvLCe+++/PYrZL7faqnowAQXbPDBaVwJcLMCI+zwwxBHrMq/Cw+p5pptZiyTwbhWDMbFW2os8jcHd+yxpwPmMfIiMp4iWpvV0HryJsKx087KOP+jFBAzu1IzLS3nLHQ4O//QczYppzT0ygExEnQpRfuAEL5HL/Dz0iI3zTKSXbVhck12VW110mdhfZyrRsU0TtQ9XGCrS1+De7XZkKE9GVezsL3EbnEHTHZedA/SpZtR8j1EUl5tYbjM7M5t9uAYFu6oRvZOzh3j/2NR/YLjgaNl9+L0Wk5R3x+8PRLpD3AezsuBfy7668Ch3oHpbrG62N+NhXZz5xFJDvvvjcrOyaRs3fsi71tDzgjtwDcPvMLDyxqWvccjn8jTijDv/PaWQ0+k67ipfj3X1mdPPHnqPQf+5Omr7/usPP+xPmriI4J9+YRoD2WZ4Z+PGf9mit97FKejIVQPf8vQX1YalBpVMbCARksVAeEnhAMW6H7SWFKVUMQ97m2wRt6DiqUsWB8MJtB/FfkgBzvoPBWeKITYAtlUvkM+rGnQhR8C1Y6ktEM6Se8iOAwRDK8lQ+84woQju2EQOaRDIPCohwF8H0aW+KEhWquIlkDgKP/mR0F/vcaHVgwXFgOhRYBIkX5eHBMYKbYuQ0nsjXBkgwJZODnhpcuNccxjHudIx+DZDl18HF0aB0nIQtpLbGP74QL/2AAuziWMC3Hk/7wXSMphDpGvUGRTOiZJ/rARS5pc5CVZhMJNMhKTjdyVseJ0RUwFS5Wo/BUsNzdLaSkrBMyKpS53ycte+vKXwAymMIdJzGIa85jITKYyl8nMZjrzmdCMpjSnSc1q6tKQ2Mxmr6xpJ21685tv4WY3wUnOcjZBnGgypzrXeUp0hqFheoynPOcZCEi6kwXwpKc+98nPhH3ynjXIZz8HSlA92hOgnsEdn8qIv5K1E6GtUuieGFr/PoeOEqLJkqieKGo9ix4UomNUGUd559F/YjSTBgzZ42poCtYlKWYfRWhIlbZS5ZXCpTCCqUlPGlGBCoJuSKQETiuk0yDwNAMzLVtNhzoKptanqAI8qix9qlSXsXSkHNXbDqTqNonarBtYDWsAtKoDroItpTOcRVDFStLEXdSsiUSrEa1qU7YWQmtUIWsOphY2RNbPrlfZwhGvSgq9AoCvV0DlXwFLOC0Mtq6jMCxiraBYrzJWJXgdH2RFIdkSkMWvlr0scs44PbyJo7NT7eTlYrqtxYr2FKplUBE44tYhVrIwOzWXa19bitiuVgi09dpDD3BbO2ZrtyLbrFpIaxrT/5rCsLdtolH1FVqgOnW5UFTQ4bomxwn27626re5SoRHY7H43CIgT7gPRCN5yIVdjys0gc8UEXO6uIUDnzW1ANacZ8fIWGL69W+VeZ1xJ9ZWWVAXcf5UR4CeGjsDD5VViVxkEEi7YFA3m4YNFV+ATfBbBcp0PPK6bswz38cQwifCySvkqFaO0gj7RHVh5Z2IU2xi30z0Mi9Pm4lr5d3W761yNb3ziDnc1lDxu71lhnNZ3kBhnQyYyHY28ZPOWll4Wxt9a7bNjKXu5gfpFapelS6osl2/LvUPyl9dM36iuWM1kHpWZrYfm6LL5zqvK8SvhnGcsx3ikdR6zdNrHHD6/jv/Qhc4waz1gaO0mOHePfTLy7OwSRC+n0ZaztAEwDbcwezjKxfuxZiVNY0H7RdOcdhSqFe3pyf4Awo9mk0AIq0VKj2TV820erq0caj1T2AewDjGBIh1kjtq6dgBkr93WS6lWSzjZV2byXC9sG1NDUDCOXnZ/NBzBATJblMJuCLUjcexHQru5gv52tKUmQXW3ONbDGTckyj1JK+gn3dteI7tRNcI/JwnNpNkxFT2E5xENvEOLRpqc5jwagMNW4AcXUcG3E/ENJZwV/W4yjByOYYhHfOIUr/jFh5VUBc86vlnz+MHjzAMHv5rbvLZIxQswcl+VHNInJ3WblEhFlu/A5cD/hrkTfSRyZ1Pr5rJ2Gq2hrPKB+1wHQO9B1F9OpaL7Wm4ajcOXir00ni/x6TmY+s+FTnWRzLzmuUL6HOQNamSzMwn6dnPjso6xcbfd3G9HQty77S61G8nuuUZQ3uEexau3MQsFTfya6A3yLsq9Z3hUvOTxwPjG9xrt44r85Dc/h8pbfn+YF5fmOU/62gb+87HrsbeKO/jWu56QlU11vV9P+9qXKvYBtr3udx8q3J++z7wP/r7gCgLWK5m4vwf7YfnNavAaP/TUlb0nbZt84POdUNKf/eNTmX3ZHt/3MTfl8ZtveFCSP7fPN7rYctnfbR7dlW8+ljHZ3wL6Q+uWxa+l/zDtvwL+Owv/paN/weR/KUCAyAKAjCaAxLeADNiADviAEBiBEjiBFFiBFniBGJiBGriBHNiBHviBIBiCIjiCJFiCJniCKJiCKriCLNiCLviCMBiDMjiDNNhMwneDw1eDCYiDPHh7Ojg7PRiEovKDQCiERgh/RJhQR7iE8peEYsaEUNgiTqiEUViFXTCFpCRtpbeFXJgH0DeB8NaFYjiGZ/CFEhiGZJiGXGiGEYiGaviGm8eGEOiGcFiHBSWHD0iHdriH+4SHDqiHfBiI8eSH9+R3WidvL8UxqgdSdKdSiFggJVV+DWiIDPeIaBGJ2zeJjZgMlgiJivh9R0WJ/taJx/+Bidc3h5voCaT4VJ9IiMskihq3ipBhivt2hqkoYljDcTnnDBkDVaeYh7c4bLm4dKGgc3vhi7XYhsEobuM1Y2rFdTmVClRWTWoXOLqodM7oJcjYNhRYjdaFcpNgjHqxjTxQgd7YjOQFNNBIVNK4iDK1jDQ1jOAoCeKYFuS4Vd0Ij1W1NNeYPOkIM+0Iijz1XluXjbIoMqhli/D2Vf94kAhpepLIgARJQ/PokKUIkZkokaImCv1okXmFkb/4hxtZjMTokfSRkMq4kOpYkSZ5jCCZjKioks/IkhSVWSuBkrjEX0czkS3ZCDZ5CB2ZCDiZfwdWNTzZk4vwkxZSkpQwlAH/WJQ7OZJIqSSCtYsGCTUvyY1ZMmGgJZNTuUVViY31KAxZWY6epZOQJ5VfWW2OZZUN+VxliY9bSVmYdJRraQhKWQhBiQhOuYNcuX5quZbnh14bo17U132/FZHnYpcWOZhAEFzdNX7Wdjru2FqB+ZWO+QOQeV/DlX6KGV5eeZeIkJk+sJl+0pmT6Xbqt3qXOZWk2QOm6U+SiZiCJJB+E5qiiZfVdyuzVZiReZi5V5nawpgO+Zo8EJtowEmpiXer2S3EeZB3p32waV+n6W6CZ5usiZv8OJYdF35t9pjUKZv5ll+f6V6tmTE0GXDeCSf1lTdxSXjZ1pzc8pz0kZ4Pt57X/0mY7mmY54Zu2Omc59km9tmdQwc64Lmfv9mf31me5EKf4TGgvbWbhVea4Zmc3gVm/zmfAeolEEoK0Tl9B3oK0LWclyeflqmdQ9OhYImf0XEvsDONe/aX7Rdu8ZibusmiqVcvLyqcBYiW/behJvmh4rdh3cOjBiaj9QekHimk70akdWSknwaV+KSkjSmhGOqkjgKj8UeXOoaiNsqkSYalfpShPyqlZUqj+2ij+WOlymYqO0qm32OmcYqmJqema4qjBloqb+qKT4ikU+ql08CdMAKmqJejfIp8tGlJI+egzLCOXcemhco9WvpieNppcBpXWiiM4yCoFUKokRqfDDqXlf9KmZeqAIwqVI46NJ76qVdqoreTqDiWkX2aqczoZKkqNKvKqo8CpUcWnKWKqHSKc5t6qyUGqbr6O5PqY7DaYacajsTKdKN6rM6TrD3lq34Wi2UUaLAqrWyGeZ5ZZqPIUNqaq9yKrK4aISQKoqVSiZ0zrsZargXnremaYvXCrtbIlHdKrvDKYefKfdZqKvb6jTrnefsqqf2ahf+6ruGarfjKZdtasDcmr8tKPQurRe4arWyxawV6YhpbdtemlTH6rokJrthqsQ2bZmDasUGHYiordWQnl8/msWMarEnnj886afPaFC3bcja2s2O3dzD7ay5bpIC6lCoKrSlraQ+rGz7/C3UvW1byI7KC0pp7yTQ5yxRNG3Y9q7TGuXwzsLQfOyEVaz8n2zpXaxRZCwA3lrZiB7Vfq6/MWWFjC5RlSzcESxFsu7WI9rCHiqkyGyjvVbVJdLZFkbcsy7VSO7Jm+baJ27Y8wK6Cm3Jgq5rYRp4bS6pL8bR71W7jWaJyW7KyeLeKam+germUOyea67XvdKHrBgQBS22iG6tMcG98Zp1DGpJ10bmtK7agu4qxa7uO+7OWmrlA67arC7zW57pzS4q/q7v+qW0KCnq4WyisK72fO21VOrlxi7qW+7fSuTepqyvIy5tF24nNG71TW7vO67kg+zHVC260WqMVErnk1nQ9/wexfnF2Bxul63u714uLG1e3BJprM4e/+Wt1sgohGYe9FyTAEYpkBWzAcaG/oaoQCwzA8+vAHmq/XyfBbUHBCSxClfK6VEG/88bBQeTBH4zA07siF6ypGXy0lOB1KazCYAHCLazAI7y8smHCbPkmEWzDWYHDMDlOC8fDDafBKwrEFad8wRu8Tlt1Ede3+XCObsmLZkPDOOTEqQvFWivFB0fF+qCPdWqzV4mrKLzFyTu0E8qzxevGZsfCRZydNLt2FMmp4aHFLsTFb6y2qRvFcTzF+5t2ZCysZvyWqprGe7zGcBy2wuvIbBwSRNy+WAeIGKwIPuw5iqxCfNzGj+x43v8rc3JMybdZx39HbGdcrBDcxIz8yc2Gsacbyik0yosreoVcs5isxPVJG6tqhH1svO0Ciwz8Wr0shL+8ue8izJdMzI0bpjx4zKobzLdsx7DbzEXhy55MyuqizDDMW8UchNAcL9xcqwv2zT0YztFnynnCdtasfLWHzsk8zad8Yeb8zNlcy9KMJ4I4ebGLv9QKoPq8z4rXzxD7zxoa0AJ9h4QrxNubwwAzegnNTwRdsAZ9olcQ0Yk30fta0cOJeBhNUBoNrxx9XB790f0U0uU60oQ8sVbY0kEIfqa7uy4907YH07LcpDSd0zVdlwut0z69012ZsD891Otk0ysLykSd1N//ZNSRzL5KrdQh+K1PndRR3dOoCcsNjc9GjNXfq80I27gqDZpC7dCmas2/mgl8e0pSPce/tNZeja5cra5s7cJdC8ypY9VnnS9urdXKGtNOzdfmZ9ZqjddibMssDZw37b9zrcOC7XyEPcjystdBS6lN/coVPMaNTUmPfdlBzUpCKyGtZIAYINq7RNpn6X7TgoBF2ITEZNqiOiahrYCvytrD5NohSyaxjdpPSdv7J9s9qtvRotrRw9sD6NtH6tnvZ9sZBdzFzdxnitypjYRESdxYWN3Wfd3Ynd3avd3c3d3e/d3gHd7iPd7kXd7mfd7ond7qvd7s3d7u/d7wHd/yPd/0Il3f9n3f+J3f+r3f/N3f/v3fAB7gAj7gBF7gBn7gCM4BCQAAIfkECQcABwAsAAAAAPQBXgFAA/94utz+MMpJq7046827/2AojmRpnmiqrmzrvnAsz3Rt33iu73zv/8CgcEgsGo9IHGDJbDqf0Kh0Sq1ar9isdsvteq/JsJhmHZjP6LR6zW673/C4fE6v2+/4vLw67vs/ZXqCg4SFhoeIiW58f41/WIpwAZOUlZaXmJmam5ydnp+goaKjn5GLYI6pPJCmbaSvsLGys7S1lq1sWKq7OayFtsDBAQTExcbHwsfKBMLNnYa6vNJkV4fO16/L2snaxdjfldCo0+Qvvm7c3cbg7O3u75tw0eX0K+euwerI8PzAX1H9QMkbF+IflHpD7rEJyLBhLINPPOlbF2ygFRIQnSAUonD/jcOPIANUEUCypMmTKFOStMLQIqMKVlTKnFly3kZz1SSF3NlvJM2fKFkGdEnlQkygSFcSvNmioxqe3yYyC+gzqdWZWIQRhXi1q0qbTFk4TQMVm1SGVb2qFZC14puMTdbKBRtWxVg0ZfOCSyu3r0y4gJf4Hfx3ad0Ud8/oXeyML+HHgQE/nlzT8OETic0wnMhYmGPKoEOLHv2T7mUNcON0hieVGCgspGPLnk1b7cvTEFLrXN2u9VRPsGsLH0589m0fkZNTUf3JN293wYUbmE69OvXoxQlb3z4dO+HjPZSLh8JcYuvn7bzP5r5dfXa57K277wsehOT3NDMPQM+f0nzS//cJ919QcIFWHyAF4odVTm/019+AogVYG4QmSfhdUSVQGNp4UZTnICXO8UNhASSWaOKJKKZIooIsjqbiizCWeKAHGhrI4RMefjjMeSJe8VOMQKbY4pCUBWmkjBjOcOMXFOg3Bygh6viajzQdeSRQNVr1GX1bpmSlkTPiBhODuJAlJVpUFLfkmlxRZpqYIjiJyJloTqEmm3h2YeNFcGKmW5mABipoGlkSaehgb/bpAmCDNupoK4UeKqltlim6KJX55anpppx26umnT1iaEKYLgmrqqaimquoUonJEql+JOtDlWnxudNRksSoQaaa1toqcpjJs2mqnIwjr6w/GwpCsov/ExgnssdBGK+201FZr7bXYZqvtttx26+234IYr7rjklmvuueimq+667Lbr7rvwxrvBqvTWa+8/8n5777789ntQvtAG8ujABBdssB1hAlyOwAc37PDDAyesMBJyWkPnxfA4muvESpA5CMadRGkLZxeL0yvHvzL8McibiFwLyXSaLDHKNeiXDsws59zQVlLQDITN+fCo89D98ByFz8h6vBDROkdm3llunXIygoBxDDTTLDsdstC2GP2vs1VPfDXWvM1KKRUtvVXpA7dCtra+SntE9nNmeyVU0WpPHUHbF+od7thzQ91TmsS1BYzXXtzpN7iAz71Y3fjZO2lli8Ot8tL/jncG+XuST87W29427g7Ojm/u+enZbcyt6L3pk7l/hKMuu6GqH/snOq8/Tfomu87uO+ozH3Y7Prlz4jLvr/6u/PKU9xyEv1Pk2DLXxWfSe1/xVXe9odlflzysSRab4KSsY3J89ZZsT+v4E37/Fft9O48R/LTH/RT60LkPIP2yZWkhouEDm+lwlSfpOeh8e9FfSb4UJOb5joFACh4G1Lc+PBmwPwj8xoggCCMHzo6DMJKgCe7VJPvhAUrUY9oGQSik0ijwbFLYk52QwkIViTBD9irh5fSAQsGRbYU1NBGWXmi32LnNiFUK4oluaKmKGQJ/sxjgEaE3HhkGcFxO/AUU/x+CRNpQ8UZWZNW5GAWxMj6Mgh6sX+XapaEvuvGNcDQV0ibQxjja8Y54VM4cJYDGCoGOAVIc4hUXFkgXrvEAfWzeIPeoKyJq6Y8LKCSvxGgrSZZKYolUyiF9tqxL5WlYnBLfJxnJtmcpy5TMCqUA2UTKVrrylbCMpSxnScta2vKWuMylLnfJy1768pfADKYwh0nMYhrzmMhMpjKXycxm2ieP0Iwmk5zpB2la85qQpObzsMnNbjZBm33wpji5Cc6kLceM6EynOvXAxHI+85zrjKc850moRboTMVWgpz73mc523lNWJmzFFqGosWxqM4uEGCj+CrpJcCJ0ZQotHkP9qf/MhwoiotWbqD3/aVG5BS6Fs9jdh2S20Xt29H4f9eHLXFeyQtTuoAG1Q+YyCAuROoiklPwnQHeYh5mCVBY27Q9O5afTBpSvpj/FqEIRp5Gi7jSfuxlZUpW6RaZ+06lGjalmgqZSqkbUqkzAalZ5aiav5kVrxpvqK8C6hPmFTWFHNWtD0Dq9rs6CrQBwK1ysptX9yLUsdNUETdeaN4qW8q0Ai+tfm2HJwqBtKIUtKSAb+76Gakuxiw0GZVNyN37g1SibJZBls4XZzNoitCfpbMYim1M6otaPo8VWaU1Li9cqEiCQlZoE+QbA2F5rtheza3q6aJwraIW1BlGcYaUFXDr/CZcdtk2K4bqG3H8oV7Kr62vunpvAGQ5nurXAayYf6VtrNfdM3NUgcYnUucm9lLTapS101zuk9pLPoPAlK17k290Yes6+knqvbOPLX2xE1031Op2Af0tgfgSVaAdOo4Rhu9xonVeq6ihehCc84QWbt8GsYenrNszhNHq4WhdeaYZzR+ISO/DEcBoe5jA62EqM18U45lJrm5iRC0KxxrDjbY6H/F3sCq/HUY0okCdxYyI7GSkVnoaMPUpjtdrYkU/OcvyOtk07+vgSSx4xlifTve6M2XNlNkCTo4xPLye5rg9GX5N/kuY5D6fOZ4aykanh5gY1x8oazvNg8Czk5RH6/8BsnmxG/gviAk+p0PtbdJEhLdo2EXDH77R0gBvtaOAIGnySFtCY/wdqoq7Suu7ldKc5YedLJnfSpiO1jk1dkE+Xek1ffk6Y/UFEJZ5Iy/jxtYkSHUlbzxrXbz4goD3Ta2GvCNjZcTaJiN1ISo9GU7nmza5P22xnQzva0qY2Io09lwImG4PL1my3hf3t4ki7AOIGbb10CFUt6k7EP1y3rwWJaPpW0Ls/CveeR5hD1+pXpn9OL8iAuG9D9hvgW45CUt4dbwuQ0OD1TmjC47xwfSuR3/6GocQRHHKTUHzgOJw3xuGp8XuvOKUTabFjx2ntIpYXxX1NxKqZXPIN0Zzclf+teIxzPqedyzzoP4d4b4UuppOe0Og9D2PSoSB1LpuLjPzM+iBa3e5bYxpeWNe62O/A9a6X++ZYnPLY115dqpt902gXV9jZTnfdRv3too773xw59b77HVSzrOPfB0/4JQWe74VPvOIDc/iaf27xkI88Fxpv25c+/OtSvrxkxwvjeHHeoJq3OkIcf5WNfV7v7zr9bu8uXaaHJ/S0firrHY5yuKLSk3gCZSdpdHtX7l4svW+6Kms9ylj+3h7Bx02ziJ97sTr/+dCPvvSnT/3qW//62M++9rfP/e57//vgD7/4x0/+8pv//OhPv/rXz/72u//98I+//OdP//rb//74z7///vfP//77v5aSF4DD93+yJ4AGyCEEmBsHuIAImIAFyIAQmBEO+IARWIFeMIFjZYEaeIEYWGwb+IFb0IEeCIIkiHrjd3B1l4IqaFXvh4Ir+IIwaAauh1UuGIM2WHcz6FQ1eIM8KHY5WFQ72INCqE8/qFNBOIRIuE5FaExOdwc7FzON0nnI1IQI94Q6olGYx1FEZzFWOFJRiF/ORIV10IVX+IUmWExiSAdk6IWDIoXHlIZPsoZCZYZLaEtwKAdyOIdtCIbNdIfZloc8gYWxB4RbeG46s20upwwYM1SiJ1Zp6FMKNwocxxuM+DXO94iOg4hb83JnUomhAn2YCHP4pmLd/7CILsWHzBSKZKOJacWJUuKJTfV8qog1rAhn29BShOCGTFiIfiaKrkgLk7gasHhVsqhqsVCLgLgYnwWKxohUkZiM/LGMxeiCNzOK0AiFdpeFJtWM2ZBu1yiMbfeJ05hxxINhwfiN4JiNg2iE3EgKyIiOOyGNl9iOkuiNERVYUCGPmSaBYkOPovCO1YOPgRiOsch8/Gh71AiPvAYYiXiLh0OQxGiQEMFXCamQtSCQYGaPnqCPVLNX/ViRFhlFgdGQy3Bc6tiIHXmQieWPIdkJGGkJAHkJHMl7iJUvKdaS6TOSm3iOAgGRYSVKHomQ5DhjOPkKL1kJMXkLPtlWQKmSNv/JkhYJexGRW21geVJpieRyk9B4lU2QNieJlXzElQWZlVCpkGK5BF5ZlaB3lj95dWUJj2yZlrmwlrMHctrYLVqZjHFJlXNpWaRHXnV4E3kJiHuJN18pjvTmX5cWmJUEkkWJCYXpWUuZVxbHlkzplo65ijypbkpXXKpFC+IFdCJ3l9mVmbS4mQupmHlXBSaplrIWG7poO28pJc/IWHW5dI/1kIepJ4WDijhnmkxTm8zWmf1jXFHjmvxTnGfoK4OJHsLJmarZPp95V5NZdkhHmtvSnLqGmtxGnLBpnLqJnKG2mrX3YcBJNM+ZmiMHa7lJXbvJBdeFnZc1mzqSnt0ZnYf/AmD56ZvUop1reHRntyoKxp/T4p9kCKD/pioDupy6N5RU9piXgKCjiSoLypijR5/XKKE2J6CMxqCiYqBdqKFdoZ9qZKH1AKJWKKKll2AdaqL0gKI9VIosdpt4pzyxyZwYGlLWmG/eWaMldqMNynLlGGK/yKP46aM4BqQfmqNAtaNYo6JI6kUEylxMeoxOqkI0GqXAM6UWVqXOKKNi1qNa6kFKymPnCQ7cKSVQOqaR5qKEdKZRcaUQlqVsel8eKphI1otVVpvWWafM46Y/k6e4o1Rh1qd+aqPleaEQ8YfblW6Geqi+A6jmZBCM+jqFKpqQmqSJeqKCOqQKdal/manA/yapKUOphog/oLqmorqf8hkWaldWe3qOj7qqLYqSq3BHlZqUHReq2lFmsyoah0an14mYpQpHuaqRRiqsXhGsYjo7zHqkxwaWt9png7qTcipnmHoVz7qeabStbreYtroDeHSs9vmk2WoV3voEHJauTlB1EVmsb0SuaYqlvDpovnqu78GucUFy69gLuHqqMIms5lqvfqGvTLCu90qwkxSuNKlprOqgKGWtRbpFv/p4DuuZsZacAcqwHfCaLDJbuooxFeuxETJqGpug0pqSqGanEAur3ziyJ1uyf0myG8qxHECznOOlmQWz4ymlMxuzNZuyDftqLCukRJmh+KpnPYuxd/+HsyvaqpW5tOyls4vFsxernBkrtdFKrBL5BbUaPQD7n0lrl17Lns16W2ULrkLbsUCbs3Aqtgq7sSsrnVl7tVs7ll3LrXSLbHpanwIrCwz3cbQqFycHtWMSt3J7I5W6GCH7aHXzboNLuAJnuIl5tu4qHourF437CYEbRJG7FoXbrzc7tmTLIZmbF5vraTUHuZ/rFaFrs/NCurS3JKdbFqnrkh7nua3bFa+7tqOLuCiruGG7GrfLarlbQ7vLu5MrurELvBNqusPbGcWLPKsrbcl7Fb3LtTihcmF5hH1rixPbNMfLQqX7rVOkt7iJvjKRvXi7vfRSuVLAhRILpsnarKz/u7CWC5jqe7ftSkPLC7tt9r4rB7b2Nr8OWb/QanLWO7sJHLz9q7bmm0TOZqIX170t64Qbd627+rgLjL8N/Lz7CsHq6r8TvKn7qCrw2yFPlMHhmzOdi7wMvL+J+8DnK8Mowb7vekrcuze8WK2tOK/88cLkG8MRnL4jLMI0LMHCRsEFZ8FGy0MsTL8Dy8HeRsRHXMNXHHFFvL7/67t20cQ87L0+DL5SHJytAaWSd7ntu3diDFGdhsaRp8Y5LHc97MaOBseQJ8dtWS5+GL1mhceLp8eXycd1fFFQl79I/HeCTJmYecGm8ISArHiLjC59/L38FcmJN8lj9KpJOE8VC6ll/5pfi9rJPii7yRvKA9appEyEpry7qMxgqrzKntzKrfvK5jnKsrxPn3yotvybuJzL9LTLftrL/cnJwGxGwlynxFygxnzMEJPMbLrMVOp4JVjN3kR5PWfN2nxN2Hy22/zN0NTNH6xJ4FzObyTONoy25rzO+4LOW1xp7BzPFQxLgifP9izAxoevVonISku5Y+C88HyXqmfCYKfPdDnOI0qqTWGZjBzGlcel7jLQ8smWTAHQqfVHEs28nGTQfqmsAe3FqmDRFLZ5HK3QzCzSFrtnFI2nHn3Rh5TRAEwzMA3S1YbQT+vPYoDS5EzSKC3NjJN8X1x8qXR8zdt8+SzUuMdKS4hK1KgB1HvE1CgA1XWxfCdseLIk1QSH1EOH1VFr1PTs1FEN1lM9gCpr1Uft1Um9JkGK1kOr1lct1lnN1sLH1Ycr16RE103p1mYK112t1CL414Ad2II92IRd2IZ92Iid2Iq92Izd2I792JAd2ZI92ZRd2ZZ92Zid2Zq92Zzd2Z792aAd2qJNAgkAACH5BAkHAAcALAAAAAD0AV4BQAP/eLrc/jDKSau9OOvNu/9gKI5kaZ5oqq5s675wLM90bd94ru987//AoHBILBqPSBxgyWw6n9CodEqtWq/YrHbL7XqvybCYZh2Yz+i0es1uu9/wuHxOr9vv+Ly8Ou77P2V6goOEhYaHiIlufH+Nf1iKcAGTlJWWl5iZmpucnZ6foKGio5+Ri2COqTyQpm2kr7CxsrO0tZatbFiquzmshbbAwQEExMXGx8LHygTCzZ2GurzSZFeHztevy9rJ2sXY35XQqNPkL75u3N3G4Ozt7u+bcNHl9CvnrsHqyPD8wF9R/UDJGzfin5N6Q+6xCciwYSyDTzzpWxdsoBUTEJkgFKJw/43DjyADVBFAsqTJkyhTksTSzyKjClhUypwpYN5Gc9UkhdzZbyTNnyhZ8nNJ5UJMoEht3mzRUQ3PbxOZBfSJtGrSKsKIQrTKdabSpfZyvnmKLSpDql3TnrSS9U3GJmrjriQINmygsWTzfkMrt6/Mt4CX+B38l27dFE3T6F3sjC/hx4EBP55c8uvhE4nRMJzIWJhjyqBDix790/JlBZGrxOkMLyoxUEdJy55Nu3bXlxtTU1nN2p1rqZ5i2x5OvLhs3D4iQxaL7tPv3u6E1zZAvbr161aMU77O3Xp2ysh7KCec+Qyo59DZSafdvf137YTbd3+/fEoN+vBVljeTvj+l9f+zSUYcgPq9BVp4OFGRH037DeCffwSSJuBwEQZlIHhFlVDhbboZxNuDlaAHz4YCFGDiiSimqOKKJi7o4mgsxijjiQgCcsVkHXqoE4iUiPgOiTMGuWJV+A32WV8klijkkibW6EGSRBrWQYNznOcaj6IAyeSSUSqI4RQH3vjTlks6yQJgMlCJCJYNHUlbjnCmhqOUOqAZg5rWsDmVl8bF6eeF5NF5WkFv4WLooYi6JeaLjBZn2qB3FpropJQaCmWjmAZ6EaQoXArUn6CGKuqopJZqJ6f3LWqkqay26uqrUtRnJqpIeFqaoA7Y6hWuqui666Yw8SmrFLQSQWqqoRaL2qj/hIqqLEfMUpOssseKUO2z2Gar7bbcduvtt+CGK+645JZr7rnopqvuuuy26+678MYr77z01mvvvfjmqy2s/PbrL6j6rvvvwAQX/E/A3d5V6cIMN+ywHrMiTI/CD1ds8cUPRyxxEngaoufHQ1H66MarMDcIyJ34WAtnH4sDLMlBdIwXypqoTAvLerqsMcw2NJgOzjQH3ZBWxPIcs8kL5XOl0EwHRHQURh9NcdJNBx2ZREsD8zQUGL3Fs89VWx0Y1mZVpOjL1noNM9hhQ+dmXELBs/UTRqnq18jost02a28fh5XZp0xIIa/n6r132T0JO+DfWp8N6OBot2v43ov1vWDB/5muRbi5k1Oel+X5YZ55ZZuX23k7QFMO+uisv4h34Uh7FFDqe6/e+u3avQ7WqB96nnLWnfiK+/DE15ThTbzv6DsnNmsivFzycVdk8SZFj53tXRYNxHirTi072bQvj8nzcVnvHfasm1/d9Egenyb6kKumPPPAi58J+WoJXtul+nev/fuKw9Tp7HcN/KWlfwGy26+28qX/pY19+SNY73jUPHBoiUwzop4GlYRBGe0MAwY0ScEmCKIK7kWBKOlgBjdYPBV60H0PhN8CYfik2OXBSohr2wVdqKLsxaqBUQgTBE3CQxZ9sG5D5FDkpmRDPOAwfEzbYRFP5MMgAhEKQgTdFP9VdEQNqQ0GMiMEAWkhQ00ZDFRzWmKdvpgg+VFqjLMoo//O6Kc0djFcgMGYHvc4gBCyUIClI5cf50LHQhrykIjUyNpQCLdEOvKRkHTV1xgZQTU+YJC6a8QgjWfJXAXwbnfc2CYzeQBMBtIPowykHAtDw6hdMlozgCWtrgUCWroSArYEo7OoJUsb7fKWwAymMIdJzGIa85jITKYyl8nMZjrzmdCMpjSnSc1qWvOa2MymNrfJzW5685vg1GYkx0lOOIWzV+VMpzohcs5UrPOd8NRCOx0Rz3raE2rzhNZu+MjPfvoTYq3MZxul8M+CGvSgawilQGNIUIQ69KH8VOhCIxD/xpPBEY6VIqVAKyqIi2JUZKfMJ0f14NExZjSk8xzpDUtqv5N2cqILUKliKGdCWEDRPzoLKEwZIFPN0LR+N9MHyHJqn51KoKfm+WkOVybUlhVCoyJt4h08V9NsNDVnT0VpOwdoU6Cy9KsBmNtBjEpRqSYVGFUFq0kdp1OyctWqS1UrS8XaBLKW1XtOkaterva7uM6CrookwalEaVb+6PVzY+vrTWEB2CV0LSOTxOtMD/sUvtLPr7JoLAAey85FStanlP3RJ9vHlpAF7oOpfCnsPnvW0LZjlQUqrdzYWtRgJZErUMVjYR3k2uiMVi5xe4dmkQhbzamWc7vtrW/BdEUp/7SEtg48KiUPqNVvvTVomFXPbxNIhbacNiN9qq63rkuz7Fpwu37rLuDawL34tTVvyfWdeU/I3PCqt3HfZeDijmu6+FJ1sfT9IetEN2DxJsy/yg2wFQs8sNvlFlzkTXAc0Xs5gjnYwNyKsIQfQuHQWbh1D7YugltzVc8V948ovgp/BTnidwBYaCdOsYxZKdEDs9aw/Xix2Oo74x4Pq7bv0vDPtrG8GPv4yCEmR/Jm9tW0/me6R47yfqM7MVGR0KNOnsQmpcxl6gIZIUtuDlizLBIod/nMoqlxGMKMjzF79X5mBo36qHPb4c3ZAHXG7Xtv0F7SulHMii0xS7cMlDvn+f92hjYy6b4snsD8uKFMvqyOixzn7cz50K1LdIf1zOiSIbCSf25zoNUhV0L/RNM8RjGqBfzoscZS0c2NwpU3HJxK29EgjrL1p4G7Z8TA+tZTmDWtOWFqBj1uf7o+9hy5Jq1UA/LGvB12KIo9w3/k+tC7bmSnfanoEc6vhG9WsLNTuEUUodlF5UaRml+J6VsNTNjpIbM/zJxuKp47P/VuUq8zkNp/wRs68raFFLd4b3zne92ebLex3/3tBwW8FgOfYsHhk+8CILwB/d63bUPdUeeEe8eWq3gVsRhruJT8CUCp+MV5autPYZjl0K6Sx+eLsogXceQoP7lgdG5ymqhc48T/3bSKV45UHI+6Gyamd75x7oQsLrjVJPf5wYFugYxvewNFj/bRiXw41/ya6fcct7ZXzlmDAJDjh5K2loXu9LArvNpUXiNkIxXzNan960N3+9tpTHVdzt3vaDeU2sss9jfp3epxV1ceIcp4QlB74mbse5Al1fjK4+HxkAfliuW1eMt7ng6YzzyvNx+vzn/+9NB9uuifTXZe7j22h4+97P8V2W7P/va4b1Xt2e7u3Pv+93HafeG9DPzi+wvqdLMm4vG5cd7DnflVfn1KSPlr0pNs+cxu/vA53frttbz3Gq9+9zn//YWjtvx8v/ousJ987ecc2Nk/Zi4H6qdnzZ8D9xdm//7P9MtZ9rKG/WdM+2cXAON60xICA2hXCriADNiADviAEBiBEjiBFFiBFniBGJiBGriBHNiBHviBIBiCIjiCJFiCJniCKJiCKriCLNiCLviCMBiDMjiDNFiDNniDOJiDOriDkmN8PsgvPEgBPziEkhSE0kWESPh/RghzSdiE9beEuOSEUmhOUMhuU3iFgVGFVoiFXGh2WohxXRiGB6ODdYd6ZniGuSB5HFiGaNiGaDh+EMiGbjiHnweHDyiHdJiHjGeHDoiHeviHB8WHDeiHgFiI/SSI4ZR1Mjd4POJSiBhNiigHjIgljqiGibhbiTCJjQhS1rdVmGh3mohTnPiI0P8Uif8WinlRiepnVKbYcKjIGKqYeG71iXnyitARi9A3iLToMbZ4i6NoieCUdf9Fc6MwaZ1BVLLIirsYaVXzcFtHEVjleC/XTcKoVMb4RFzHJsiYiwxYjV1HjKJwjYuxjfGni4T4PW3jjJKWjZSYVZ14Tt6Yjh8HV0jnVNL4jpd4jnn1jeIIPuy4ifdIis8kZDPXj714jKlXjt3YYrOgjgepF8MVhwwpCw75kGQRkXc4kbFQkRbJExjZhxrZVeDYkQiZX8m4UwTpj6RGktHIXtPITSn5jMowbJaVignZfs3SWdcXkvQoaMpVkxd5k66Wk164k9DGkvMGGCpZj/jlkvj/eFc6SVhHiZQQl1jruJJNmYZPGYV/J5WBN1lUKQtAmQkciQkfyVBjaJRfCVphyWFKKZP7kJUJ9ZJMWJReuU/M2JajMJaYUJaXcJYIyEYSE5N6WQl8eQl+eQtCWVde1JWDyZN6KX6yJVyLGVhCiH7pd5LINZWFCWfbR3z3RZkmyY1Q6XzPp5DsQpgPKZmMI5pOeX7SZyFbuS2qeZCsGZruAJil+ZlWkWQ2tpat1ZmWcJtT8FyjiZpcaXuzuS+Q2ZbE6Vym9Zrhh5mwB4wZ1pxhiXcuh5u0oFmhN310aX/YCTIj6RmmGXkAsV5aqWyGt5zZUpv+UZ7BoJ3gl55yqQZ9/4Zs7okt8Nkf8pmUrDZl0HmfaZCf7SmQuzOeH/OfAneeywYF3iWd+uVeq7hawGl0/MiU/ECf5jegtuCd1Dl6CLoU/RlvBlmVvJlmrVkLIBqboGadtKmgesKgKBqgFAqh6jmX2TYavnmdnGmNGjoiDnqgxwdi4WmAeAlowmmYQ8pd/3Jh+ymeP7qkT5aiufNhDDaiyCOjJMmhflakWQqjzDmlVEp4Nsp6YDo6PRqjZEqlXiqiaZo5azqmF6p1ZWqmqpcpBKamR1osJdqTyyA+b7p6LjKn78mltnCiPDKohOphUYqkweaK7KCoIMKojXqlj+qniMpUWJl0Vnqpf2So/P+5qUHVqarTpKAKpVqaG6TakD6pQ6iaqmFaoZtZp5vxqmFjqbJqG6IqpbY6O7haNbq6q0RKqyRqZZI6RmT2ncQaqmJ6BGxGNU02j0zqos16ZquKLKByiuKzrCF6rWiWrc32J9y6PN5qreAqZeL6aqFSrvJFrVU6rOmqqqRZDtGKjix1rvI6r7OKk2CGrHl5Ufoaq1yxannKQgYbdcjnWFLDni8aqQHbl/BKaehqFQn7fil2sU3Hc/rksKAJsUq6CYlZc9+aFhrbcxl7ac85lMnhaOgJaSFbMxPrO8xaPSpLsPlxskzQdv7aaDvam+M5siBTsyWhszsnY0YLADzLsj7/67FK9KtL+Y8eRbQkkbQ9ZrUc27Dg9bKylqyWILQfQ7UCgLVIe7OfmnfIyRT7up1QC5fQ+FVi+7NLq7Adam1Zy65ne6NdG7GIObOeOqxyy3M7i7ZfMLeWSXd5y6utmmBx67Qqim2O+7E9S390i6YgK2oW2bhbq7eVm5leYLgMi7dnyih/GlqaO6H6aTuBC7TGihlrW58wi7mrWbJPi2sCaqWrC3ahe3aj6zqL+5O0y322y7kYW7eFe7e8e7Ck+7u9dbrDq7iQu7kLu1mNqZz+5rW9AbafYHM8xK+E8XOtG3SJ67mv4q6Lob21dlsi571+Ab6ayW/BS0jXy7cA57cN/6q+S8e+feG+9QqA1usv5qsX6Bs8Sldv+ru/Uxe+VRe/nDS/MRuf9lujFLa+B6wW/Ju2TFSxDQzA2MsaA0xsBZxuFRwXFzy53IazG9wvAZwXH7wJ3OtCunu00wu6KCsTJcy0tcTAohqPVxmkwhrC5RbDSstzNDy4Uldv3cd+OIx/y/jAEkujEALEBEe4xfugGwt/ynsSN8yYgqXDdMnDIhvBlSrFEkfFVzzDgivDNpzA7wtCXryfYCyzUNwfL6xCQkzDRazGKrHFhxuYGrzDTSy7ckyp6VHHHXTHRJzGQ3zE6ZbEb0x0gSytPSy1UUTGN2fGNWzFmax5WsTG/ZvB//+rwEdYp4vott5wqvhrwJhsxGiMxZ1Lbkj8rHU5vtUpyrsZux0XtYEKpOqwtkToyibcC4KptvroRHeHwsJbfMC8xMLsmMRMyqBIk8jMuj64zFzcss7Mf8U8VcdMy5xsfNbcxzswWC7QivRrutMsxLIXzrvbtHZZzpFMUt3cu04KztMrznIXlfC8zXYweL48hOxMvfBieobYeGI7r73aXxlR0J530Oma0Cy20AxdeQ4NrhA9LgQ90Q5V0dd60eKS0RodiAw8wuCZqRhNeSG90SNN0sa1rqgC0in9TxzdrB6tWxId0wg108Ra05CixGL40/UkfPRcu0Bd1Pck1FksuUb/vdTrhNSv/LBMHdXl5NRVDKdSfdWRRNVn/M1Y3dWJpNWbPHZevdT33M7S5NP4vIXe3NKy3LEoTH3TbNKl98jTWbE8Pc503bory8zBhNZmfctJncxtjEp53cZ7fc0CWNifDIZ23ac/4NcCfZlrXdK2/Jh/rErxe9f5/NaYPdmyWdkIA9niO9TU3NZa69mLBpukTdQYDEwJ6GsH6H8B6L8FiEyv3Smz3dNKyMS5PUy37bqx/dK7jXXD3dfFTYB/4qu1ncO9rX/HrQLPnaDNrQG/Ddapoa3JDalP6MfBXUzVXb3ZranTDb/jfUvf3cXdrdvlPdrB94Xu/d7wHd/yPd/0L13f9n3f+J3f+r3f/N3f/v3fAB7gAj7gBF7gBn7gCJ7gCr7gDN7gDv7gEB7hyJQAACH5BAkHAAcALAAAAAD0AV4BQAP/eLrc/jDKSau9OOvNu/9gKI5kaZ5oqq5s675wLM90bd94ru987//AoHBILBqPSBxgyWw6n9CodEqtWq/YrHbL7XqvybCYZh2Yz+i0es1uu9/wuHxOr9vv+Ly8Ou77P2V6goOEhYaHiIlufH+Nf1iKcAGTlJWWl5iZmpucnZ6foKGio5+Ri2COqTyQpm2kr7CxsrO0tZatbFiquzmshbbAwQEExMXGx8LHygTCzZ2GurzSZFeHztevy9rJ2sXY35XQqNPkL75u3N3G4Ozt7u+bcNHl9CvnrsHqyPD8nl9R/YTJG0fhn5N6qe6xCciwISaDT4DpWxdsoJULEJkgdKRw/43Dj9+qCBhJsqTJkyhHYgGpyWJGACljyhQwb6OPjmpY6gwmcqbPkyt33nrzksnPozQJ2lxVTZLQaxOZ8aSCtOpRKwxdUrXKFWXNpTtwpnkKdaKwnl3TlsQaUOsUtXC/Mi1adIRYNGTzkkILt69MukX9Co4pNyzgl3abvtHLGBTfwZCTHjYYubJkRjCwWP45GWIchmYb+9u6ubTp06iBKm0ROHVawJ9Fu4tKTLPr27hz615LxUTr3ZzpxpbNjjYB28CTK1/+uneQzpSvKkb3yThxWchxG9jOvbt3K8wFex/fHXxlzD+g/0N69wwo69dhZb9Nvr758HDrk78PGT3YCf/qQTFcfB/N59pvuBlI2EuW+fdfBAE+MSCBDSmIGoK3WegVg+c596AL7ZlB4SXw1aIhSQWkqOKKLLboYor4xVjZizTWqKKDH6YQ4gAjWlIiLSeOZOOQLrL3mGBH+hWkkEQ2mSKOOZ6w4xzv0dbjJEs66aSRpPXX5WBLCqBlk1BGaQFsuHh05Vlf5hbhmxBFVpiZIqCZ5lhrTvVWcnD26YWcq9F5pp+B3GnooYWEKeOiXl4kqI6EVoHopJTeoSijmMYV6KMAXrFbpKCGKuqopPbJKQqXNlrqqqy26uqpNqU605wNyBrcFGAl2ZejFdi6IK+wpufnDITCGqlvwwYLRLH/MjDL6bElOKvstNRWa+212Gar7bbcduvtt+CGK+645JZr7rnopqvuuuy26+678MYr77z0EuHqvfjmi1i94err778Ae8hvsIVWavDBCCdcR5kD01OwwhBHLHGlDDecxJSI5KkxP5TSarEOGE+4MSY/1hJanuIA+/FN0w0yMicl03LymilXvLINO6Yz88s8Z0XUpjcr0fJC+VjZ89Ft/axy0CAPrSbSsgEmkdHAuCUFRvsyDaHTOUEdNV1TRyWQ0jYvUJfWWz9MtNcO6aopW3lZvZ6qAvObM9ttt5lgFT6fwt/eS9N7N96TiK2nFMrBzTHZeqfm8Q3+Jqb204T34zZ+//pmStLjOOsruaROVW554zFmrvlldbPm6af5ijybPhtffvrs4XGO7N8Zth46Pzv3KDvtwANne7QcZmondaJ3YpyvwTc/e9k1mH4r6IslrzxtzOen33e/A78996SrBT01+HJJPfLXG4539mp9X173tLvPHe5Kpv4ooa5nEjPS7DeXEev0SwmGkGQ/QeFvd9bDzurcVDzAwQ91cwMUrto1uCvtTz4LjMmYiOS8DoppgzYa37cq2KMLviJLIKyRB52XwhqJ0FshQ+AmTPi1AJakhTQyH+I6tCcJdg+HL3pht2JYPU/QUDQoBCKLdBiFBoXPfz9UIouEeD/hUCqBnHigE/8DFiEfFnBcxzsUFjehRR5yUT1enOAQ7zWxNt6pfyvE1PAIlsHcnfGOeMzjqyhYxwPp8Y+ADOSb3AXHzQGNAYU0CRX7UMbpXW1QNuTKHFeWSAg+slORhGIUcvXErgQOApWc5MekZY5kPYuUIUAl2hBpysy00oCqBMQrV0nLWtrylrjMpS53ycte+vKXwAymMIdJzGIa85jITKYyl8nMZjrzmdCMpjSnSU1YCvKa2MxaNRmZzW56kwvbfMQ3x0lONYZTDOVMpzqXcM5lnc+N8IynPC31xXaqYHLzzKc+97lIe3oAn/sMqEAl1k9/1opruBijQifRsUMalIiEWKhCG/r/SYMqAKIukygWKVpQaGJUEBrd6KREWc2PUs5rRyRF70ZUs3o+FKF3qFxKR7FSCrXUnBY9KEBjSriZiqKmBLrpJXOq03eCtKdUswVQ4yPUTRLVASSUWVJDSlVKyA0KT4UqTN1TNPVV9atXfUJWi0qF/MXCp19NXlgPMlazbVVEaYWH1JQ6VVqstQlYy8guoxrXkICNrl6txV01AkmI7PWtPOqrO+ZqsrrOYrDsLKxBDrtTrioWSJ2U5BUYA9kspHGodkPsZU2UWasEJW6MixPdcFovvo52FI30yWnJ0tlKWtKpDXPta0MR21ltVi+17ePbOgpG0YousJjtIQCn0Lc2/9iWiaBtrXFlutQTlnYzioNHZ4Xn0Hfp9mjInUVvCUiF5uZCuI7rbvQ8V6fpIhV2h2vi6aRnPPWSD1+fK6sMdyuK8fqxfPO1L7HYm0r38he21+UugDVH0lLmK79TMOuBO+Hf9C64vhWFVCZLoy8Jf6O6xKlwHEcMXdw6WMSe1F0ReQffPKGYxDD+FXE18Fzp4MvD2ABxDXcY4x5/1sQgaiCjwrg2Fqsjdgn2sZL/ImAIfyHARcGx9ZaH3iVbWTczJmsE5WjFFYeUyhu+sphNk2VW/o/BXUbfl7FX5TG7mcMuhVy+Siyg/S4UzC+uivy2E+b47bnPVSmzlOZsY6OedP+Gjj1ajX2yZwMA+nSNfnShgdwD+vq2snA1YqJ7tuiZRDrPyvl0kh2J1ecQmtRSkHLhNs2zTstE1ModMax5vFqxKuuAXp6wq2UcHQYCeoD1Y20V+6TquO5agEL+7wOBvas4fwjXatZ1m+F8Zl8vO9nBji66vksctI5mw1Jc4puXE+4VCfrWBh6Rtyk87Q+WuwDjJve7C3BuOmI6sWtadxbbPW94xzs5/a63sdJNIX2Tkd/z/jfA5y3wU5m0a5oO73WSWG46N2GLtAZTu91d7oaf8t5Uqg6rkYjwd1vcKGaU74+h8JOAO7tfiA15xHWsF4qH++RLwLjKa71zDTL85fb/fok1RC5xTo+a5+vMeLMzDPMoX/GroDZt0m3bYGwR+U5pjXqgp75xnBM2XVdPU9aPrnGug7rqdLrxQNe+XYVD2ePDbhXb5+7crrtdwXC3ptzpznc0HPvu4msyDNnY98L/HfApZjq1Dq9Iszv+8aQipN2RDvnKW/4wkpc0eS/P+c6fjV2M543nR3/GcIZSvTXOe6XJzmSgn17xTHt92VIPdI6wnteUTlue0S5dzeNe21r1/aWBTw6tw/6ikx9+7Uc5S9WZyuGx/Gfzaxn9e04/R9AiQfXRtn1UXf/Z3afx99tK/vKb//zoT7/618/+9rv//fCPv/znT//62//++M+///73z//++///ABiAAjiABFiABniACJiACriADNiADviAEBiBEjiBFEhJpHeBo1KBoISBHJh9GmhmHRiCEfKBwSeCJtgZJKhlJ7iCepWCbsWCMNiCLngAMViDkzWDNGiDOghODwhyhfeDQDgHqvdUPhiERniEaTCERFWESNiEQaiEOcWETjiFfAeFFiWFVJiFA2WFL6VfWviFR8iFzPRweDBhL8NRy1dSMZcxZrgxaChsS7iGQ9eGKDNSgqeGWJhRdEgzdnh850SGPLWHV/KGxHeFcmgIgsiHiMJ7HnWIv5CIPUKIuReHeXhUkGhTfSiGvASIlsU2BgczLaaIg8CIz//EiZnmiSOnUqE4iIlyh9RkiviGikUHCzTXGE1VauQHi9Q1i9mwipHYin5oeo4YbUjziYh2ZBpzi7aWi8OID3hjjJpQi5wFjJpIWYaWB7sojUTXDW5IjWn4igQnC9B4iaLRWebHbarIi+QoiucVjNuEjjSViuv4i35TjboEjz8lj/OIifX4jdOEj6EwjvtIW6lViF14jXgSNto4kOVYkJMYheF4Vvq4Pn9Vh/0Ihw/webgEkFWijpXDWOy4BnOkkbfEkQyJJRUpVR4pCuYoWf9gjV5IjCd5cEWhkL74WA6JiwWhTSUZkTP5ECk5CwJ5CS3ZKzxpSyZ5kiAplBMJCkX/uZMyuJE++ZOWsJTi2JSlkJPLCJWGdY9TSZWUYJUSuZKh8JSY1JW5lJRtaHy/hVoX2Wub54/mopZmyJbZJRTBJXzI5o5g95WXaJd8A1xa2QUrt5WhdW9gGQCAWV6C+ZZblm1yWS50KW2xFpfM1Zh1x2yahJHxMpkHtpiX6ZaZiW2Bx5fb5peQqHVeZ14imXxlZ49xF5PO+F7ICAyqOWkAkTSOyXLLFZnk4pkEQpaOcXtLF5qLs5tPgHe+WVyIeVwLyW6V6UBSwJpqEHqiB5t6J5tF9ozPuW/RaUfGqV2DeXG9yZnwApzxIZyfcJuoFhG6OZrEuZkG6V2ouTHq+W1K/yedudkPbYdlrngu6Hkd9wmd+Qme0/me7cierYedEhA57dWc2ciN8cWbaHZhXGaaQfZgD4qQeAGWCgqZrfI8/+l8+LWh2nloDPmhxekqIoqhJHovThYFxSaIKjpcLPp2y6lhJVpgEPqTNVqa99KiDKp7MGqiEWZn+/ij8rkqQpqj3qehPMqhnTiTSpp4QYqj5jloemmje5drr1Oba1KliMcnI9oB1mlIauel7dCdQiGmY1qe83k7bnpbpTKjXSWhLhafb9qkWSqneqpZaSqTxXGTFDKne2qgfUo8WwqkrmKnNrkMSPadh9pjpCh+i7qkdYqk4MCmO2Gok3ohZcoBmv9ZO2k2m/DAqTrhqZ9KZqG6AaPKHGGXkEaGp2H6p6sqI5WaAa+6HLHaoVWFZ7Z6q1ZWb7uaOKW6nRoFrJIqrIdKrKSJOceKonfGZpfKrFfmrNV2oUKnqVikrAVqrXuKraqFYduqpgrlrT0HrpMqrnA5ZNEKcVSFrhSqrp86pEQaoriZatyaQPKanLoxa+m6QgA7r6/5kL1warJVn0NJctVqFQPrrzD2sE6gczrJMha6oCcKr6A4oIXqmn4hseQZsX8Gmoa5ehf7ezK6r5SwsI1xpgIAsignsvLTsNdpsEJzsnsppae4sagaYh7bFzCbczEWtDCRchVrslfannVmriT/gpW+87PaM7OqOhhES7ElOxdJm7A9yrOEanQ0ixRVO7QjG6wq4aS8AG2meow9u2Nkq7RcAKcBm7PtaplXm50RUmwsyxguW6xG+62qka0Fe7Sxebcq21d7+6ys+muIi6lfN3DEVrjGBrWM+pjKdl18u3WJ+h9oi6yfKbmMuwVwS7AYS7kgWrdp5yeOSlWHC7iVu6yNx7qly1ZB9yapG1KrO6766bevi7uBa7pmsrnSulu3O7cWdm2wu6KCC6D1qRd5a3NSRK+C4XKZO0LLmxfNW3IVB719Ib1x2nQ6G4sl5LQ0+Tv9pr3b+3PTO3hbq27iqwnOq0TmCxfca7PM+b0a/3O94JZw8ZsW85u8c1m9ZIG/5Ku/+8sV/eu7vwnATyHAnVS++QqxlCe0hTmxPnHAsrsuuriNXcu2rstxN/fAFDzBRSvCMSsTFoxXfFSJwdu0HMsS7wtEXme1IRzBIWvC6Nu94JLBM7fBDDvAJgfCNdy7MyzEoosSJ9y46qLD6bO2DPHCOBTDfTvEdBu3JnHEkQV6zci5+tO+Loy9H+y2JUzEYTzFRXwSVgwAmfe9MrfEPNyyXvy8QDzGsRvEZAzBPvdu9lp8WbzCPsLFIOHELQTFIizDZVzFN0y/09KrdtCRTOzGHZy4o0fCV3yaTjcpY/fI1BbJNIzE/1vJiHLJuv97GhgoyWicxO+aUFDXtl5ndqSMwafcCqBMxcXrea1syp4sRqmMydh1gbXcl7dsKLFcyLPceb3MLYEKhm3ksuCaq4tHeMjsRspsrcycyM78zBMTzcw6zejWqNaczJ5bwMqXvmvEzd1MUN8Mzijrv5JZzeWsMNgsrNo8u6vSzub8tehcs+JszOxMzwfzzrcazxsxvDs40OSUxqoczgSd0Nlk0Lq8yQr90KWXwm4K0RR9TQwdyoRc0Rr9Lxcty5m80SANMB0tzB8d0iYtjDRrO7SXz9zU0HE8yWdpqwDtyimNeue8u4isCiSLwCAo060qL7LnbCuNw7bn0mAM0w1603TQytOxp9QqrdRoStSNsNMXHNNGnc5MHTRB3adDndMJ0bZ+uNVSbTFijchdrc7SQNUobJQ17aK9BycD9nwfJ9cxCh2bOH5PCtfQh9eWqtdeSdcnNkh7DdhRKth/7deuRNi/G366ytda7diKith2O4KRbdhpCdnah9kI4YFGGiB3rdgswNixItp5Jdk9Cdr2oNn1wNmFTdk4+NqwHduyPdu0Xdu2fdu4ndu6vdu83du+/dvAHdzCPdzEXdzGfdzIndzKvdzM3dzO/dzQHd3SrQIJAAAh+QQJBwAHACwAAAAA9AFeAUAD/3i63P4wykmrvTjrzbv/YCiOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSCwaj0gcYMlsOp/QqHRKrVqv2Kx2y+16r8mwmGYdmM/otHrNbrvf8Lh8Tq/b7/i8vDru+z9leoKDhIWGh4iJbnx/jX9YinABk5SVlpeYmZqbnJ2en6ChoqOfkYtgjqk8kKZtpK+wsbKztLWWrWxYqrs5rIW2wMEBBMTFxsfCx8oEws2dhrq80mRXh87Xr8vatl9R2LPQqBXdTtPSvm7J2srf7bXkT+7tcNHj8EvmvOiuwevs8gAxVRFAsKDBgwgTEsQScBS9e0wUSpwooF4+IfvYNNzIsf/SQIogETLs5A9ZsIcQAYRcWVHcxSAZ13Sc2fAjy5sgrcxEaROnz4MWX/6IqYamUXc9fypdWGXnGyxLowYVk1IG0TRHAZYkJixp1K8KU4oFS1bi1DBVY1xFk1XeVmbBvJYtKzbl3LsFz+qAOlfvhrVn2gqOSwWv4cOIE/v0q+TKXcYZAJsZTJmWXMWYM2sGC9kGX7p178WZubWyR8ebU6tevZoRxsusE0oeYJr0WwKfUxvYzbu3byux8foe3hs4XtcwYQc3OLt2x9u4UasmTt34crLUiVvvS8VRXe6B3oCC7hxY7s12W0vPCdEw8j7fQYdP94l8+Xfr0bdXv51i+sf/3QmlQWhUjHafaeclVMCCDDbo4IMQLnjdhJhFaOGFDL4noD0ERmHggZQliBCGJELIUn9kKaeUiCOW6OKCGm7oQnMgbmIffii2+GKJJ6r4k4+L5afQji7GKCMLNNaYyY0BAYlYh1B2CKAVR/ow2xzj3aZkLE4eFuWXY4FnZJUm1IWLRlsaxSKFbOpHJZk7mHlmUWnStGabeCbWGZwjdJnSnIAGKugZYBZqqFh89uAnRIM26qgih0YqaReJtnDnk5NmqummnBLI3puVGnGpl52WauqpqELx6ZihWinkUnuOGuQUR3bZY4Ac2uqfS62+digJmva6gKQzECvsEMaKEOyx/8nC0Oyx0EYr7bTUVmvttdhmq+223Hbr7bfghivuuOSWa+656Kar7rrstuvuu/DGK2+ZqdZr7733zEsuvvz26y+u+k4736MEF2zwwU8BHHCVAyPs8MMQA8rqwlRV02idGA/W6J4UN9awHhmLwmQtpYVMSTigdpzcx3mYnOVb6vjj8iQoT6yyx1V8aMvIM79SV888KSxBWjfnWqAk/WjZsyw/zxw0rRYQXfQESS4dYmHHXeEJz+Ak/F+KvAZctdWC6TrlFFzL8rQUsXHM7thkZ2W2mFI4dUqOmbm9Ltxxq4l1nszdCzhQYaMFkVUWi9f3kiWb9/fgLdkLeV6F7/UqrP+V/5U4fYvL/fjkoE+ut1qXr5j5gJvz0/lRc4fuumajO1v6j/fq3FDjCM7++u68yyb0C7LeWq/tAeFeWfC9J++6zTizLXrqaK4u8m3Iz5XdcHgnf/1vrU/E/A3ZU8i39JxAV7188LCG/NfoR+FdmGCzjFV9SpN/fvzp87foPe79bjj7UoGeTOgHM/IFYFRE4pHyeJdAEn2PYZEingEtozsBNBBDC2TgBS30wG+Nb0tp81kFN2gh4TnvbFHoX/gKQsIIddBbH1RSCEmBwBY+yIQpzNoUVAgkGz7ohd26khxeZrzOdY8z/yoUCqHWMSFKkHEFtN/nVJNEJdKNieiS06D/JsiNCmYwebHLolgcxUUcHfGLgAvjtvYHj4i50WFVjGMW3HU/JMrxjnjk16r8NzUH1PEreQykIE+1Ryz2MQJ/9F3KEOlFnADRD2dUpCGH1siQqHFhiRTJ6YZVSRw+oVZTtOMkGbnCm1xSbJECVqag9awZpfKQVHulslbJLFnK7lewzKUud8nLXvryl8AMpjCHScxiGvOYyEymMpfJzGY685nQjKY0p0nNalrzmtjMZjMHyc1uIkqb7/OmOMe5BXCGk5zoTKf7zPkIdbrznQBgp6+m8MZ62vOed3ikPGd5NHz6858AHYA+9wkC+QX0oAh91EAJ+gAnGqKMEN3ExjbJ/9ADOPQXEc3oLQZ1ymtelBAaDSnNOEpRhn50ECIN6UQXWVE/CrBlBpxhNkoCtEJ01JonjZ70ZEqKImKsZnxsqUVfiocJ8nQUPq0TUEcpVAXkdIDkO+onmlabpUrhAlLzZQxnGsWUUtVka1un0bohzK32tH5eFUtN7/bArPbSrEhFq0i/GrKwQgGrhwsmXFPKtFACUmskkSst7OqFJV5VZXvlKywiqUmdBLartSBsFwwrVoolVrE09GsAHVs+wXaNrfy74mGbSFS2YNYZjDUdFezWhkxijqX6uuxpQ5Fa2q22I5JtQttK2i7Zznaqms1bU3DrtdqakrdvK21gfkuYHf8Gh7MbyW1E1IfclcEDcQZdrlGTyqXgik9woLtp88hKuuxOhouQpaBznye58FYXCG5FknLPu12aNveEkMNX6MQLvrzeMmdIq6/M7ptDNBoYU7C1XCmPm2DNmZc2zHXceg9MYdFWVlGdLORoCzpfCEfYjAWusIj/2uDx4leUQY1Mhz/cxQmP+MWzWugKXEs4ez3RHdz13IJhzGMEb7i8xsXXjduRY9ZluMdIRvFdqbHjlQg5wBspst+anOQqb/bH//WuI2sH5dvZtzY09sn2imPc4IyZN1R2cop7UWbKQmHIGTXfkcFy5t2kGXJ1NsCdNVwOZLXZwm/uMl/lvOev5Ln/0Hk6dJtlbKk/t4+egk4poR09EUVr+XWWdjH+LjwUSitZCnCO6KQvrcP8UbGSAPx0n9uZatUCWHFb82zfwrzl0J66ya2+MqcrlusY95Nzj5Vyz2jNYFOnZn37cTMTzmlrVQca1sH+svSI7cnC6o/UkTP2oz8pLUmF+sM19CGDrLwccTeI0dPwdqRZfJpSmnvc5I7Nu2G0ZjipG9rsvkS4zR1vec8b3dXybWWkClx3z7vaTuBhiLe98CH9u97hEjhlCO6JfYsb4botdcOd/YSQzLsAAKeWxAdD8U5Y3IcYn66yl6BwTSvo4Uw118gFU3JOnNyGKWe5xlW18xM7/N0h/xdYh7FEQGHPzNO7gie1+Quup9Ip1uldHNK9p/SlvzddTp8f1I3usqmbpepz/nqJIz7GhxZd2qvbCrX73fNdz0uLgsq3vsPOduGO/V1wD5TcLbH2ujN8yaT908X2Tom++53jq94btgWf0MbrAez46iMbyeH4yuMB8veS/OIZZfnOzwHz9tK8y8PCec+b/vSDCLrovV5j0Lt+nHwGPDANn/TX256bsee2Xun+2tv7Po+5T/wvaU/13xtfjsFvwjCJHSvekz7m6cZ2zuMZNecH7u6HZH5J+656P49e125vqPUph/3VS7/29eY+xFOx6LaOnynln1orPbAsYc1fvrjcff/+Q1D/Xt1/xrY0fAEICLRkfwPYaPvXVAq4gAzYgA74gBAYgRI4gRRYgRZ4gRiYgRq4gRzYgR74gSAYgiI4giRYgiZ4giiYgiq4gizYgi74gjAYgzI4gzRYgzZ4gziYgzq4g2V1fD5YKjxIAT84hJsShLFEhEiYgEbYAEnYhIWyhKTkhFIYGlAIAVN4hXVRheKHhVxIDlroUl0YhpSigw+GemZ4hmjQfRFYhmjYhqenhhDIhm44h5UHhw8oh3SYhwdlhw6Ih3r4h/jEhw3oh4BYiG4kiNmUdXdAeGSzUoiYTIpoB4xoNY64fvIUiXUwiUtTidDXUphIB5q4VoHCdNL/9IlEF4pgRVLxd4lDhwio6DKciGULaIpD9Ip1pYqPiEy0+G22WFW4aIns9IkChna0wHXlYVXhJ1TCGFOyFgvG6BzIKHuD2Iq86DI1F23LIIqCQIrRtIxR1Yyw8Iy+SAjcCE3euFPgyFXroI2Pd3XgdI5pl45nNWCwaFPuqE3w2DnXmAl0RRnRqHtC6F8C+GAxI45Sp1ZOU1zrF1+7NHNQZJCzhpD1CFqdyAAMqUsOiQn7GDf9+FMKWZGclC/692rARjLyOEEdqVQfKYtWKJBatWJJE3UZlZJpIl34UH0iOXswCQwbSTY0uSU2SX1j9QU9SJAxCZFp0n7QVRlBaXWr/6guGXkJPakkSjlc49ha8LNpINlbO9mLm1CVt9VZMhkLTfl+8JeLIteVXsmP52dJgCWWSKkJZYlokgSMWKeWazl339d7YWkjJykKcxlk9yhzeJmX7eZziNcEW0eMn4WVveZrW5lcRmmYAtGWyccEi0mPthCYlil2aCl0k0mZfNeZWgkFU4kJQblbT3mXoSmahUeaiQkArJULZllsdilGremaBwSbJDYFs7kGxFd8n9lthSmarFeX3kBcFImYdjec0RKV7HacjeWbyumY0kl+zslKxUmZ13l91MkRqUldq4mbJKk6ujkJ3YmddVOdtEmXfBmZipebrpme05cp+zWYcf/ikghYnjr1jYzZV3v5Xe3FXtlZAheZAtAJImO5WLyJGfrlXuOJYTkJPNvZNwsqQgE6IQ9KoLcpodcFZL9mnv6pmSDGcxyKKvcZoaugn/jHn1DFjP/ZXRl6HRuaX/ipYB+aZZCGb+gYoww6o8tRo4NTjtiVoxQqn/oYl2wJpM8FXifKkkhwoCiQoAdyoZnFpIf3RUTKT4KpomDook93nruJpVm6QFvKf7XJdFQaYfRZprBzoyrglCG3pszVpm7qoHCKoGmap05VoXlpp3eqJ3x6AnLaoVsIplonpoAaqKTipQDonq1nqF8aov2pm4vKqG0njSsKqd6ZKtVYkNvgHMH/ialoVKBDxanqiSqfepShCma1SaoiZqqFqqrrhmM+amSoCqsjJqt7amO1SmS3OmWXqqt4wqu5mm2e+qvfoKTfMKrECkaSSoDH+mQ8qhXBaiev+qylGq3016vDo6zYwKzY4KwIkWnMqT11dqxnmYyP2qXfWq1uca0zQa4HYa4bpzz2aqKAtmzeR6a3hqimdVqj5q90lq7DGhX52nGZyq/zdK4CCrDahVkD67CIkbAJd2AWm3ErJ5TWRbE06qeiRj3ZChIZq3JoVLI6t7FEoK4bywSrOqIlQa8GgbIqgbEG26DTya5shrM+RqkvqlgTe6+KQbMURrQLe5MNK7QP67Nh/wq0IsuyJHuzBAs4Rquy/eqxQQqyEBW0+uom2vamuJZs+4q0kJSVvcm0iQqX8tp1I4t+3SCek/e2R8ux8GG24Adq4EoJpwkiMpuqXwC3m9dsf8ewZfuYtrmjJemXVjpsbSuc5AC4TGq4kAmQdSu5aoakGvmXbAu1bvu31xa5Yju4ZFu5oXu3HpK3k7C3B9K36yq3/xq4X5uYzBa7roa2AYuN62hArIusrntsqFa6stsI8VGapwuvmbu4RzdCB6etYPFxpqpKluuWmCuVmmsyN9dCzNu8MAellXJviUt410tC2fsVzsut0XcoL4tZ4btB4xsV5QufMuK9IsqI63tB7f+7FO/LvYkiv5UKvsr7bverFPmrs/YWQahbp//LbwHsEwOsqf5nwMabb/XbQNPXcgrbsik7EQ1MuawJsfQVMqqLngl8cZc7tY7btcSLwi8HdOYbcFp7HyE8pj7ycRU8txastCy0vQRMdtNbIzE8wQlUwxt7wyqsI+b2vEJBp1FWvSY3wihXwlhba1F8uFi7wcLXwbYbsRnzw06Mc1CMw7Y1xfVZsxRhxcrHlT2soExsc12MvV9cxKarsWMrxxJhxoQLlS9cHjEMCm06hBhMt6hEiPOrCXvsqiYcm5D3xzeTj4S8xhjTxz+oyIhFjQdcyLlzyGf7e5IceB4MimdHokb/xLNhbHybbFmUHMGWYMnHI8qTe3uljEmn/L0PubbWy8pSTMpzfMeB3MmniLutOm22TMWunMujS5iMB1KfnLswuwy7S6xnmi15Byia2My6+szYEs1zMs2Nu8DWfC3YfCbazLkLzLv6i3dlt0WTSM2w2s3W8s24EM4HW6bs7MLHrHfpvM0BPM98ErdfYIh1KIbfVDT87AX+7HgAHdCLDLuUV9AJddBSKi8D3QUM3dAOPaGTDLqiMdF7WNFGetFTXM8aHYgc7YXyp9DdENIoXU9I7NFg7LcEndIw/TArjcWYPMojfdMVpM/jsrs43dOjotPiwtM+PdQZCtQ83J1EndRw/+zSDsxLQq3UUE3GntnC8PLUUZ3Ul1nMb4XPyHnVPZ3VgLzVudp8LDvTRyrGb8zBUSjKRt10ZknWYNnU5hDXcj2pNc3Uau3Ub7192WrWrnTXkbrDp1pbbe1Be4196ge/rIbW0huZ2ueob3fYzJPY5bwLdJ3Xh8rWg2rOY83XZU3VRXDZV7zWgE3Ogi3QB9gB/dcq/xenqd2Qr+1grU0msz2lsZ1LtY0Bqx0quU0vSijWhgK9vb0hwy3cT1iUwd0nBfjAv92ixz2Sz42mk6Kdzd2u0T2Qyc2ltw1B1e3a3Y3b263by83a4e3b2f2F6J3e6r3e7N3e7v3e8B3f8j3f9CZd3/Z93/id3/q93/zd3/793wAe4AI+4ARe4AZ+4Aie4Aq+4NqUAAA7';
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/palette/LogTestResultPaletteProvider.js b/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/palette/LogTestResultPaletteProvider.js
new file mode 100644
index 0000000..7254c21
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/palette/LogTestResultPaletteProvider.js
@@ -0,0 +1,61 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import Cat from '../image';
+
+
+/**
+ * A provider for quick service task production
+ */
+export default function LogTestResultPaletteProvider(palette, create, elementFactory) {
+
+ this._create = create;
+ this._elementFactory = elementFactory;
+
+ palette.registerProvider(this);
+}
+
+LogTestResultPaletteProvider.$inject = [
+ 'palette',
+ 'create',
+ 'elementFactory'
+];
+
+LogTestResultPaletteProvider.prototype.getPaletteEntries = function() {
+
+ var elementFactory = this._elementFactory,
+ create = this._create;
+
+ function startCreate(event) {
+ var serviceTaskShape = elementFactory.create(
+ 'shape', { type: 'custom:Log' }
+ );
+
+ create.start(event, serviceTaskShape);
+ }
+
+ return {
+ 'create-task': {
+ group: 'activity',
+ title: 'Create a new nyan CAT!',
+ imageUrl: Cat.dataURL,
+ action: {
+ dragstart: startCreate,
+ click: startCreate
+ }
+ }
+ };
+};
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/palette/index.js b/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/palette/index.js
new file mode 100644
index 0000000..205eb71
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/palette/index.js
@@ -0,0 +1,22 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import LogTestResultPaletteProvider from './LogTestResultPaletteProvider';
+
+export default {
+ __init__: [ 'logTestResultPaletteProvider' ],
+ logTestResultPaletteProvider: [ 'type', LogTestResultPaletteProvider ]
+};
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/modeler/modeler-routing.module.ts b/otf-frontend/client/src/app/layout/modeler/modeler-routing.module.ts
new file mode 100644
index 0000000..5439019
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/modeler-routing.module.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { ModelerComponent } from './modeler.component';
+
+const routes: Routes = [
+ {
+ path: '', component: ModelerComponent
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class ModelerRoutingModule { }
diff --git a/otf-frontend/client/src/app/layout/modeler/modeler.component.pug b/otf-frontend/client/src/app/layout/modeler/modeler.component.pug
new file mode 100644
index 0000000..a62cd9d
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/modeler.component.pug
@@ -0,0 +1,162 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div(#container, style="width:100%;height:100%")
+ form(#testDefinitionForm="ngForm")
+
+ //- Tool Bar
+ div#tool-bar
+ input#file(type="file", #file, hidden, (change)="open()")
+ input#fileForVersion(type="file", #fileForVersion, hidden, (change)="newVersion({fromFile: true})")
+ .row.pl-2
+
+ //- BPMN Diagram items
+
+ .col(style="flex: 0 0 180px;-ms-flex: 0 0 180px;")
+ .row.no-margin.pl-1
+ .small.text-muted BPMN Diagram
+ .row.p-0.pl-2(style="margin-top: -10px")
+ button(mat-icon-button, [matMenuTriggerFor]="newMenu")
+ mat-icon insert_drive_file
+ span(style="margin-left: -7px") arrow_drop_down
+ mat-menu(#newMenu="matMenu")
+ button.text-small(mat-menu-item, (click)="newWorkflow()") New Workflow
+ button(mat-icon-button, matTooltip="Open BPMN", (click)="file.click()")
+ mat-icon folder_open
+ button(mat-icon-button, matTooltip="Download BPMN", (click)="download()")
+ mat-icon cloud_download
+ button(mat-icon-button, matTooltip="View XML", disabled)
+ mat-icon code
+
+
+ mat-divider([vertical]="true")
+
+ //- Test Definition items
+
+ .col-3()
+ .row.no-margin.pl-1
+ .small.text-muted Test Definition
+ .row.p-0.pl-2(style="margin-top: -10px")
+ //- Save & Update
+ button(mat-icon-button, matTooltip="Save Test Definition", [disabled]="inProgress || !testDefinitionForm.form.valid || (hasBeenSaved && !testDefinitionForm.dirty)", (click)="save()")
+ mat-icon save
+ //- Deploy
+ button(mat-icon-button, matTooltip="Deploy Test Definition", [disabled]="!testDefinitionForm.form.valid || ptd?.currentInstance?.isDeployed || !hasBeenSaved || !testDefinitionForm.pristine || inProgress", (click)="deploy()")
+ mat-icon cloud_upload
+ //- Delete Version
+ button(mat-icon-button, matTooltip="Delete Version", [disabled]="!hasBeenSaved || inProgress", (click)="deleteVersion()")
+ mat-icon delete_forever
+
+ //- Version Select
+ mat-form-field(*ngIf="ptd", style="width: 80px")
+ mat-select(disableOptionCentering, (selectionChange)="setVersion(ptd.currentVersionName)", placeholder="Version", name="selectedVersion", [(ngModel)]="ptd.currentVersionName")
+ mat-option(*ngFor="let instance of ptd.bpmnInstances.slice().reverse()", value="{{instance.version}}") {{ instance.version }}
+ button(mat-icon-button, [matMenuTriggerFor]="versionMenu", matTooltip="New Version")
+ mat-icon add
+ mat-menu(#versionMenu="matMenu")
+ button(mat-menu-item, [matMenuTriggerFor]="fromVersion") Create from version
+ button(mat-menu-item, (click)="newVersion()") Create blank version
+ button(mat-menu-item, (click)="fileForVersion.click()") Create from file
+ mat-menu(#fromVersion="matMenu")
+ button(mat-menu-item, *ngFor="let instance of ptd?.bpmnInstances.slice().reverse(); let i = index", (click)="newVersion({versionIndex: ptd.bpmnInstances.length - i - 1})") {{ instance.version }}
+
+
+ div#left_panel(#modeler)
+ .panel-buttons
+ .properties-panel-button((click)="toggleProperties()") Properties Panel
+ .properties-panel-button((click)="toggleTestDefinition()") Test Definition
+ div.properties-panel(#sidebar, [hidden]="!showSidebar")
+ div#properties(#properties, [hidden]="!showProperties", style="width:100%")
+ div(#testDefinition, *ngIf="ptd", [hidden]="!showTestDefinition", style="width:100%;")
+ .col-12
+ .row.mt-2
+ .col-12
+
+ //- Test Definition Form
+
+ h4 Details
+
+ mat-form-field(style="width:100%")
+ input(matInput, type="text", placeholder="Name", name="name", [disabled]="(existingTd && !hasBeenSaved)", [(ngModel)]="ptd.testName", required)
+ mat-error Required
+ mat-form-field(style="width:100%")
+ input(matInput, type="text", placeholder="Description", name="description", [disabled]="(existingTd && !hasBeenSaved)", [(ngModel)]="ptd.testDescription", required)
+ mat-error Required
+ mat-form-field(style="width:100%")
+ mat-select((selectionChange)="markFormAs('dirty')", name="ns", [disabled]="(existingTd && !hasBeenSaved)", placeholder="Group", [(value)]="ptd.groupId", required)
+ mat-option(*ngFor="let group of groups", value="{{group._id}}") {{ group.groupName }}
+ mat-error Required
+ //- mat-form-field(style="width:100%")
+ //- input(matInput, type="text", *ngIf="!hasBeenSaved", placeholder="Version", name="version", [(ngModel)]="ptd.currentInstance.version", (keyup)="checkVersionUnique()", required)
+ //- mat-select((selectionChange)="switchVersion(ptd.currentVersionName)", placeholder="Version", name="selectedVersion", *ngIf="hasBeenSaved", [(value)]="ptd.currentVersionName", required)
+ //- mat-option(*ngFor="let instance of ptd.bpmnInstances", value="{{instance.version}}") {{ instance.version }}
+ //- mat-error Required
+ //- button(mat-button, matSuffix, color="primary", *ngIf="hasBeenSaved", (click)="newVersion(this.ptd.processDefinitionKey)", onclick="file.click();") New
+
+ //- .row.mt-2
+ //- .col-12
+ //- h4 Resources
+ //- .text-muted A single .zip file with scripts
+ //- input(type="file", #scripts, id="scripts", name="scripts", hidden, (change)="markFormAs('dirty')", ng2FileSelect, [uploader]="uploader", accept="application/zip")
+ //- .row.mt-1(*ngIf="ptd.currentInstance.resourceFileId")
+ //- .col-12
+ //- mat-list
+ //- mat-list-item
+ //- mat-icon(mat-list-icon) insert_drive_file
+ //- h4(mat-line) {{ptd.currentInstance.resourceFileName }}
+ //- .row(*ngIf="!ptd.currentInstance.isDeployed")
+ //- .col-md-12
+ //- button(mat-raised-button, onclick="scripts.click()", color="primary")
+ //- | {{ !ptd.currentInstance.resourceFileId ? 'Choose File' : 'Replace File' }}
+
+ //- .col-md-12
+ //- div(*ngIf="uploader?.queue.length > 0")
+ //- label File:
+ //- ul.list-group(style="position:relative")
+ //- li.list-group-item(*ngFor="let item of uploader.queue")
+ //- | {{ item?.file?.name }}
+ //- div.upload-progress([ngStyle]="{'width': item.progress + '%'}")
+ //- //- button.pull-right(mat-button, (click)="upload()") Upload All
+ //- label(*ngIf="ptd.currentInstance.resourceFileId && uploader.queue.length > 0 && !saved") This will replace the previous resouce file
+ //- button.pull-right(mat-button, color="primary", (click)="clearQueue()") Remove All
+ //- .row(*ngIf="ptd.currentInstance.isDeployed")
+ //- .col-12(*ngIf="!ptd.currentInstance.resourceFileId")
+ //- | No resources were deployed with this version
+
+ .row.mt-3
+ .col-12(*ngIf="ptd.currentInstance.testDataTemplate != {}")
+ h4 testInputTemplate.yaml
+ div(style="border: 1px solid lightgrey; font-size: 12px !important")
+ codemirror(*ngIf="isRefreshed", [config]="codeConfig", [(ngModel)]="ptd.currentInstance.testDataTemplate", name="testConfig")
+
+
+ #drag(#handle)
+
+div(style="position:absolute; bottom: 5px; left: 5px")
+ div(*ngIf="inProgress")
+ mat-spinner([diameter]="15", style="display:inline")
+ div.ml-4(style="display:inline") In Progress
+ div(*ngIf="ptd?.currentInstance?.isDeployed") Deployed
+ div(*ngIf="hasBeenSaved && !testDefinitionForm.dirty") saved
+ mat-icon(style="color:green") check
+
+ //- div Form valid: {{ form.valid }}
+ //- div Form dirty: {{ form.dirty }}
+ //- div hasBeenSaved: {{ hasBeenSaved }}
+ //- div(*ngIf="ptd?.currentInstance?.bpmnHasChanged") ptd.currentInstance.bpmnHasChanged
+ //-
+ //- button((click)="popup()") popup
+ //- button((click)="nav()") nav
diff --git a/otf-frontend/client/src/app/layout/modeler/modeler.component.scss b/otf-frontend/client/src/app/layout/modeler/modeler.component.scss
new file mode 100644
index 0000000..61cbddc
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/modeler.component.scss
@@ -0,0 +1,97 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.properties-panel {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ right: 0;
+ width: 300px;
+ z-index: 10;
+ border-left: 1px solid #ccc;
+ overflow: auto;
+ background: white;
+}
+
+.properties-panel:empty {
+ display: none;
+}
+
+.properties-panel > .djs-properties-panel {
+ padding-bottom: 70px;
+ min-height: 100%;
+}
+
+.properties-toggle {
+ position: absolute;
+ top: 0;
+ right: 280px;
+}
+
+#left_panel {
+ position: absolute;
+ left: 0;
+ top: 40px;
+ bottom: 0;
+ right: 300px;
+}
+
+#drag {
+ position: absolute;
+ left: -4px;
+ top: 0;
+ bottom: 0;
+ width: 15px;
+ cursor: w-resize;
+ z-index: 1000;
+}
+
+.panel-buttons {
+ position:absolute;
+ right: -103px;
+ z-index: 5;
+ top: 30%;
+ transform: rotate(270deg);
+}
+
+.properties-panel-button {
+ cursor: pointer;
+ padding: 5px 10px;
+ user-select: none;
+ background: lightgrey;
+ margin-right: 10px;
+ display: inline;
+}
+
+#tool-bar {
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ background: #f8f8f8;
+}
+
+#tool-bar button mat-icon {
+ font-size: 18px;
+}
+
+#tool-bar button {
+ line-height: 30px !important;
+}
+
+.no-margin{
+ margin: 0px !important;
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/modeler/modeler.component.spec.ts b/otf-frontend/client/src/app/layout/modeler/modeler.component.spec.ts
new file mode 100644
index 0000000..0c62b8f
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/modeler.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ModelerComponent } from './modeler.component';
+
+describe('ModelerComponent', () => {
+ let component: ModelerComponent;
+ let fixture: ComponentFixture<ModelerComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ModelerComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ModelerComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/modeler/modeler.component.ts b/otf-frontend/client/src/app/layout/modeler/modeler.component.ts
new file mode 100644
index 0000000..c090769
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/modeler.component.ts
@@ -0,0 +1,821 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, ViewChild, ElementRef, AfterViewInit, HostListener } from '@angular/core';
+import minimapModule from 'diagram-js-minimap';
+import { FileTransferService } from 'app/shared/services/file-transfer.service';
+import { Buffer } from 'buffer';
+import propertiesPanelModule from 'bpmn-js-properties-panel';
+import propertiesProviderModule from 'bpmn-js-properties-panel/lib/provider/camunda';
+import * as camundaModdleDescriptor from 'camunda-bpmn-moddle/resources/camunda.json';
+import * as vthTemplate from './templates/elements.json';
+import * as $ from 'jquery';
+import { MatDialog, MatSnackBar } from '@angular/material';
+import { TestHeadService } from 'app/shared/services/test-head.service';
+import { GroupService } from 'app/shared/services/group.service';
+import { TestDefinitionService } from 'app/shared/services/test-definition.service';
+import { CookieService } from 'ngx-cookie-service';
+import { FileService } from 'app/shared/services/file.service';
+import { ActivatedRoute, Router } from '@angular/router';
+import { BpmnFactoryService } from 'app/shared/factories/bpmn-factory.service';
+import { Bpmn } from 'app/shared/models/bpmn.model';
+import { TestDefinitionElement, BpmnInstanceElement } from './test-definition-element.class.js';
+import { FileUploader } from 'ng2-file-upload';
+import { Group } from 'app/shared/models/group.model.js';
+import { AlertSnackbarComponent } from 'app/shared/modules/alert-snackbar/alert-snackbar.component';
+import { AlertModalComponent } from 'app/shared/modules/alert-modal/alert-modal.component';
+
+interface NewVersionOptions {
+ versionIndex: number,
+ fromFile: Boolean
+}
+
+@Component({
+ selector: 'app-modeler',
+ templateUrl: './modeler.component.pug',
+ styleUrls: [
+ './modeler.component.scss',
+ ]
+})
+
+export class ModelerComponent implements OnInit {
+
+ @ViewChild('container') containerElement: ElementRef;
+ @ViewChild('modeler') modelerElement: ElementRef;
+ @ViewChild('sidebar') sidebarElement: ElementRef;
+ @ViewChild('properties') propertiesElement: ElementRef;
+ @ViewChild('handle') handleElement: ElementRef;
+
+ @ViewChild('testDefinitionForm') form: any;
+ @ViewChild('scripts') scripts: ElementRef;
+ @ViewChild('file') bpmnFileInput: ElementRef;
+
+ public qpTestDefinitionId;
+
+ public ptd: TestDefinitionElement;
+ public uploader: FileUploader;
+ public bpmnUploader: FileUploader;
+ public pStatus: String;
+ public inProgress: Boolean;
+ public groups: Array<Group>;
+ public modeler: Bpmn;
+ public showProperties = true;
+ public isResizing = false;
+ public lastDownX = 0;
+ public propertiesWidth = '500px';
+ public showSidebar = true;
+ public showTestDefinition = false;
+ public bpmnId; //javascript input element
+ public isRefreshed = false;
+ public hasBeenSaved: Boolean = false;
+
+ constructor(
+ public _dialog: MatDialog,
+ private _testHeads: TestHeadService,
+ private _groups: GroupService,
+ private _testDefinitions: TestDefinitionService,
+ private _snack: MatSnackBar,
+ private _fileTransfer: FileTransferService,
+ private _route: ActivatedRoute,
+ private _router: Router,
+ private _bpmnFactory: BpmnFactoryService) {
+ }
+
+ @HostListener('window:beforeunload', ['$event'])
+ canLeavePage($event) {
+ $event.preventDefault();
+ alert('are you sure')
+ }
+
+ async ngOnInit() {
+
+ this._route.queryParams.subscribe(res => {
+ if (res.testDefinitionId) {
+ this.qpTestDefinitionId = res.testDefinitionId;
+ } else {
+ this.qpTestDefinitionId = null;
+ }
+ this.setup();
+ })
+
+ //set groups list
+ this._groups.find({
+ $limit: -1,
+ lookup: 'both'
+ }).subscribe(res => {
+ this.groups = res as Array<Group>;
+ this.groups = this._groups.organizeGroups(this.groups);
+
+ });
+
+ }
+
+ async setup() {
+
+ this.setInProgress(true);
+
+ await this.setTestDefinition();
+
+ const modelerOptions = {
+ container: this.modelerElement.nativeElement,
+ propertiesPanel: {
+ parent: '#properties'
+ },
+ elementTemplates: [vthTemplate],
+ additionalModules: [
+ minimapModule,
+ propertiesPanelModule,
+ propertiesProviderModule
+ // colorPickerModule,
+ // logTestResultDrawModule,
+ // logTestResultPaletteModule
+ ],
+ moddleExtensions: {
+ camunda: camundaModdleDescriptor
+ },
+ keyboard: {
+ bindTo: document
+ }
+ };
+
+ // Set up empty modeler
+ await this.setModeler({
+ mode: 'modeler',
+ options: modelerOptions
+ });
+
+ this.setBpmn(false);
+
+ //set ups draggable properties container
+ $(this.handleElement.nativeElement).on('mousedown', e => {
+ this.lastDownX = e.clientX;
+ this.isResizing = true;
+ });
+
+ $(document).on('mousemove', e => {
+ if (!this.isResizing)
+ return;
+
+ var offsetRight = $(this.containerElement.nativeElement).width() - (e.clientX - $(this.containerElement.nativeElement).offset().left);
+
+ $(this.modelerElement.nativeElement).css('right', offsetRight);
+ $(this.sidebarElement.nativeElement).css('width', offsetRight);
+ }).on('mouseup', e => {
+ this.isResizing = false;
+ });
+
+
+ }
+
+ /*****************************************
+ * Form Functionality Methods
+ ****************************************/
+
+ /*** BUTTONS ***/
+
+ async newWorkflow() {
+ if (this.qpTestDefinitionId) {
+ this._router.navigate([], {
+ queryParams: {}
+ });
+ } else {
+ this.setup();
+ }
+ }
+
+ async download() {
+ this.modeler.download();
+ }
+
+ async save() {
+ this.setInProgress(true);
+ let validResult = await this.validateFile();
+
+ if (validResult) {
+ if (this.hasBeenSaved) {
+ await this.updateDefinition();
+ } else {
+ let td = await this.saveDefinition();
+ this._router.navigate([], {
+ queryParams: {
+ testDefinitionId: td['_id']
+ }
+ });
+ }
+ }
+
+ this.snackAlert('Version ' + this.ptd.currentVersionName + ' has been saved');
+ this.setInProgress(false);
+ this.markFormAs('pristine');
+ }
+
+ async deploy(versionName?) {
+ this.inProgress = true;
+
+ this._testDefinitions.deploy(this.ptd, versionName)
+ .subscribe(
+ result => {
+ this.inProgress = false;
+ if (result['statusCode'] == 200) {
+ this.snackAlert('Test Definition Deployed Successfully')
+ this.ptd.currentInstance.isDeployed = true;
+ } else {
+ this.errorPopup(result.toString());
+ }
+ },
+ err => {
+ this.errorPopup(err.toString());
+ this.setInProgress(false);
+ }
+
+ );
+ }
+
+ async deleteVersion() {
+ let deleteDialog = this._dialog.open(AlertModalComponent, {
+ width: '250px',
+ data: { type: 'confirmation', message: 'Are you sure you want to delete version ' + this.ptd.currentVersionName }
+ });
+
+ deleteDialog.afterClosed().subscribe(
+ result => {
+ if (result) {
+ this.setInProgress(true);
+ if (this.ptd.bpmnInstances.length == 1) {
+ this._testDefinitions.delete(this.ptd._id).subscribe(
+ result => {
+ this.snackAlert('Test definition was deleted');
+ this.setInProgress(false);
+ this.newWorkflow();
+ },
+ err => {
+ this.setInProgress(false);
+ this.errorPopup(err.toString());
+ }
+ )
+ } else {
+ let version = this.ptd.currentVersionName;
+ // if deleting a version from a definition that has more than 1 version
+ this.ptd.removeBpmnInstance(this.ptd.currentVersionName);
+
+ //prepare patch request
+ let request = {
+ _id: this.ptd._id,
+ bpmnInstances: this.ptd.bpmnInstances
+ }
+
+ this._testDefinitions.patch(request).subscribe(
+ res => {
+ this.setVersion();
+ this.setInProgress(false);
+ this.snackAlert('Version ' + version + ' was deleted');
+ },
+ err => {
+ this.setInProgress(false);
+ this.errorPopup(err.toString());
+ }
+ );
+ }
+ }
+ }
+ )
+ }
+
+
+ /*** UTILITY METHODS ***/
+
+ //Looks for the definition supplied in the url, or pulls up default workflow
+ async setTestDefinition() {
+ return new Promise((resolve, reject) => {
+ if (this.qpTestDefinitionId) {
+ this._testDefinitions.get(this.qpTestDefinitionId).subscribe(
+ result => {
+
+ this.ptd = new TestDefinitionElement();
+ this.ptd.setAll(result);
+ this.setAsSaved(true);
+ resolve(this.ptd);
+ },
+ err => {
+ this.errorPopup(err.toString());
+ reject(err);
+ }
+ )
+ } else {
+ //set new test definition
+ this.ptd = new TestDefinitionElement();
+ resolve(this.ptd);
+ }
+ });
+
+ }
+
+ //will set the selected version. If no version is given, the latest will be selected
+ async setVersion(version?) {
+
+ //if version not supplied, grab latest
+ this.ptd.switchVersion(version);
+
+ this.setBpmn(true);
+
+ }
+
+
+
+ async newVersion(options?: NewVersionOptions) {
+
+ if (options && options.versionIndex != null) {
+
+ //create new instance and copy xml
+ let instance = this.ptd.newInstance();
+ instance.bpmnFileId = this.ptd.bpmnInstances[options.versionIndex].bpmnFileId;
+ instance.bpmnXml = this.ptd.bpmnInstances[options.versionIndex].bpmnXml;
+
+ this.ptd.addBpmnInstance(instance);
+
+ } else if ( options && options.fromFile) {
+
+ let instance = this.ptd.newInstance();
+
+ instance.bpmnFileId = '0';
+ let xml = await new Promise((resolve, reject) => {
+ this.fetchFileContents('fileForVersion', xml => {
+ resolve(xml);
+ });
+ });
+
+ instance.bpmnXml = xml as String;
+
+ //set the files process definition key
+ let parser = new DOMParser();
+ let xmlDoc = parser.parseFromString(instance.bpmnXml.toString(), "text/xml");
+ //set the process definition key in xml
+ xmlDoc.getElementsByTagName("bpmn:process")[0].attributes.getNamedItem("id").value = this.ptd.processDefinitionKey as string;
+ //save the xml
+ instance.bpmnXml = (new XMLSerializer()).serializeToString(xmlDoc);
+
+ this.ptd.addBpmnInstance(instance);
+
+ } else {
+ this.ptd.addBpmnInstance();
+ }
+
+ this.setVersion();
+ this.markFormAs('dirty');
+ this.ptd.currentInstance.bpmnHasChanged = true;
+ }
+
+ popup() {
+
+ }
+
+ async validateFile() {
+ return new Promise((resolve, reject) => {
+
+ this.modeler.getBpmnXml().then(xml => {
+
+ this.ptd.currentInstance.bpmnXml = xml.toString();
+
+ this._testDefinitions.validate(this.ptd)
+ .subscribe(
+ result => {
+
+ if (result['body'].errors && result['body'].errors != {}) {
+ this.errorPopup(JSON.stringify(result['body'].errors));
+ resolve(false);
+ }
+ //this.handleResponse(result, false);
+ //this.ptd.currentInstance.bpmnHasChanged = true;
+
+ // If any VTH or PFLOs were detected, add to object
+ // Update list of test heads
+ if (result['body']['bpmnVthTaskIds']) {
+ this.ptd.currentInstance.testHeads = result['body'].bpmnVthTaskIds;
+ this.ptd.currentInstance.testHeads.forEach((elem, val) => {
+ this.ptd.currentInstance.testHeads[val]['testHeadId'] = elem['testHead']._id;
+ delete this.ptd.currentInstance.testHeads[val]['testHead'];
+ })
+
+ }
+
+ //Update plfos list
+ if(result['body']['bpmnPfloTaskIds']){
+ this.ptd.currentInstance.pflos = result['body'].bpmnPfloTaskIds;
+ }
+
+ resolve(true);
+ },
+ err => {
+ reject(false);
+ }
+ );
+
+ }).catch(err => {
+ this.errorPopup(err);
+ });
+
+ });
+
+ }
+
+ //returns promise for file object
+ async saveBpmnFile() {
+ return new Promise((resolve, reject) => {
+
+ this.modeler.getBpmnXml().then(
+ res => {
+ this.ptd.currentInstance.bpmnXml = res as String;
+ this._testDefinitions.validateSave(this.ptd).subscribe(
+ result => {
+ resolve(JSON.parse(result.toString())[0]._id);
+ },
+ err => {
+ this.errorPopup(err.toString());
+ reject(err);
+ }
+ )
+ }
+ )
+ });
+ }
+
+ async saveDefinition() {
+
+ return new Promise(async (resolve, reject) => {
+
+ let fileId = await this.saveBpmnFile();
+
+ if (fileId) {
+ this.ptd.currentInstance.bpmnFileId = fileId as String;
+ }
+
+ delete this.ptd._id;
+
+ this._testDefinitions.create(this.ptd).subscribe(
+ res => {
+
+ resolve(res);
+ },
+ err => {
+ this.errorPopup(err.message);
+ this.setInProgress(false);
+ reject(err);
+ }
+ )
+ });
+
+ }
+
+ async updateDefinition() {
+ return new Promise(async (resolve, reject) => {
+
+ let versionIndex = this.ptd.currentVersion;
+
+ // set parameters to be sent with the patch
+ let request = {
+ _id: this.ptd._id,
+ testName: this.ptd.testName,
+ testDescription: this.ptd.testDescription,
+ groupId: this.ptd.groupId
+ }
+
+ // If xml has changed, upload file and patch definition details, else just updated details
+ if (this.ptd.currentInstance.bpmnHasChanged) {
+
+ //upload file
+ let fileId = await this.saveBpmnFile();
+
+ //set file id in the bpmn instance
+ if (fileId) {
+ this.ptd.currentInstance.bpmnFileId = fileId as String;
+ }
+ }
+
+ //check if this bpmn version has been saved, else its a new version
+ if (this.ptd.currentInstance.createdAt) {
+ this.ptd.currentInstance.updatedAt = new Date().toISOString();
+ request['bpmnInstances.' + this.ptd.currentVersion] = this.ptd.currentInstance;
+ } else {
+ this.ptd.currentInstance.createdAt = new Date().toISOString();
+ this.ptd.currentInstance.updatedAt = new Date().toISOString();
+ request['$push'] = {
+ bpmnInstances: this.ptd.currentInstance
+ }
+ }
+
+ //patch with updated fields
+ this._testDefinitions.patch(request).subscribe(res => {
+ this.ptd.currentInstance.bpmnHasChanged = false;
+ resolve(res);
+ },
+ err => {
+ reject(err);
+ });
+ });
+ }
+
+ markFormAs(mode: 'dirty' | 'pristine') {
+ if (mode == 'dirty') {
+ this.form.control.markAsDirty();
+ } else {
+ this.form.control.markAsPristine();
+ }
+ }
+
+
+ async checkProcessDefinitionKey() {
+ let foundDefinition = null;
+
+ this._testDefinitions.check(this.ptd.processDefinitionKey).subscribe(async result => {
+ if (result['statusCode'] == 200) {
+ this.pStatus = 'unique';
+ } else {
+ this.pStatus = 'notUnique';
+ }
+
+
+ //If process definition key found
+ if (result['body'] && result['body'][0]) {
+
+ foundDefinition = result['body'][0];
+
+ } else {
+ //seach mongodb for td with pdk
+ await new Promise((resolve, reject) => {
+ this._testDefinitions.find({
+ processDefinitionKey: this.ptd.processDefinitionKey
+ }).subscribe(res => {
+
+ if (res['total'] > 0) {
+ foundDefinition = res['data'][0];
+ }
+ resolve()
+ }, err => {
+ reject();
+ })
+ });
+ }
+
+ if (foundDefinition) {
+ if (this.qpTestDefinitionId != foundDefinition._id) {
+ let confirm = this._dialog.open(AlertModalComponent, {
+ width: '400px',
+ data: {
+ type: 'confirmation',
+ message: 'The process definition key "' + this.ptd.processDefinitionKey + '" already exists. Would you like to load the test definition, ' + foundDefinition.testName + ' ? This will delete any unsaved work.'
+ }
+ });
+
+ confirm.afterClosed().subscribe(doChange => {
+ if (doChange) {
+ this._router.navigate([], {
+ queryParams: {
+ testDefinitionId: foundDefinition._id
+ }
+ })
+ } else {
+ this.bpmnId.value = '';
+ }
+ })
+ }
+ } else {
+ let tempPK = this.ptd.processDefinitionKey;
+ this.ptd.reset();
+
+ this.ptd.setProcessDefinitionKey(tempPK);
+
+ this.ptd.setId(null);
+ this.ptd.setName('');
+ this.ptd.setDescription('');
+ this.ptd.setGroupId('');
+ this.ptd.setVersion(1);
+ this.setAsSaved(false);
+ }
+
+ if (!this.ptd.currentInstance.version) {
+ this.ptd.setNewVersion();
+ }
+
+ this.markFormAs('pristine');
+
+ this.ptd.currentInstance.bpmnHasChanged = false;
+
+
+ });
+ }
+
+ setInProgress(mode: Boolean) {
+ this.inProgress = mode;
+ }
+
+ setAsSaved(mode: Boolean) {
+ this.hasBeenSaved = mode;
+ }
+
+ /*****************************************
+ * BPMN Modeler Functions
+ ****************************************/
+
+ async setBpmn(isNewVersion: Boolean, xml?) {
+
+ //If a test definition is loaded set bpmnXml with latest version, else set default flow
+ if (xml) {
+ this.ptd.currentInstance.bpmnXml = xml;
+ } else {
+ if (this.ptd._id && this.ptd.currentInstance.bpmnFileId) {
+ if (!this.ptd.currentInstance.bpmnXml) {
+ this.ptd.currentInstance.bpmnXml = await this.getVersionBpmn() as String;
+ }
+ } else {
+ this.ptd.currentInstance.bpmnXml = await this.getDefaultFlow() as String;
+
+ // If it is a blank new version, set the process definition key in xml
+ if (isNewVersion) {
+ let parser = new DOMParser();
+ //Parse xml
+ let xmlDoc = parser.parseFromString(this.ptd.currentInstance.bpmnXml.toString(), "text/xml");
+ //set the process definition key in xml
+ xmlDoc.getElementsByTagName("bpmn:process")[0].attributes.getNamedItem("id").value = this.ptd.processDefinitionKey as string;
+ //save the xml
+ this.ptd.currentInstance.bpmnXml = (new XMLSerializer()).serializeToString(xmlDoc);
+
+ }
+ }
+ }
+
+ await this.modeler.setBpmnXml(this.ptd.currentInstance.bpmnXml);
+
+ //Set bpmn id
+ this.bpmnId = (<HTMLInputElement>document.getElementById("camunda-id"));
+
+ if (!isNewVersion) {
+ //Set process Definition key
+ this.ptd.processDefinitionKey = this.bpmnId.value;
+
+ //Check the process Definition key to get its test definition loaded in.
+
+ this.checkProcessDefinitionKey();
+ }
+
+ //Listen for any changes made to the diagram and properties panel
+ this.modeler.getModel().on('element.changed', (event) => {
+ //check to see if process definition key has changed
+ if (event.element.type == 'bpmn:Process' && (this.ptd.processDefinitionKey != event.element.id)) {
+ this.ptd.processDefinitionKey = event.element.id;
+ this.checkProcessDefinitionKey();
+ }
+
+ // If it has been deployed, they cannot edit and save it
+ if (!this.ptd.currentInstance.isDeployed) {
+ this.ptd.currentInstance.bpmnHasChanged = true;
+ this.markFormAs('dirty');
+ }
+ });
+
+ this.setInProgress(false);
+
+ }
+
+ //Open a .bpmn file
+ async open() {
+
+ this.setInProgress(true);
+ this.ptd.reset();
+ this.ptd.switchVersion();
+
+ this.fetchFileContents('file', val => {
+ this.setBpmn(false, val);
+ });
+
+ }
+
+ //Get the xml of the default bpmn file
+ async getDefaultFlow() {
+ return new Promise((resolve, reject) => {
+ this._fileTransfer.get('5d0a5357e6624a3ef0d16164').subscribe(
+ data => {
+ let bpmn = new Buffer(data as Buffer);
+ resolve(bpmn.toString());
+ },
+ err => {
+ this.errorPopup(err.toString());
+ reject(err);
+ }
+ );
+ });
+ }
+
+ //set the Modeler
+ async setModeler(options) {
+ if (!this.modeler) {
+ this.modeler = await this._bpmnFactory.setup(options);
+ }
+ }
+
+ async getVersionBpmn() {
+ return new Promise((resolve, reject) => {
+ this._fileTransfer.get(this.ptd.currentInstance.bpmnFileId).subscribe(
+ result => {
+ let bpmn = new Buffer(result as Buffer);
+ resolve(bpmn.toString());
+ },
+ err => {
+ this.errorPopup(err.toString());
+ reject(err);
+ }
+ );
+ });
+ }
+
+ fetchFileContents(elementId, callback) {
+ var val = "x";
+ var fileToLoad = (document.getElementById(elementId))['files'][0];
+ var fileReader = new FileReader();
+ if (!fileToLoad) {
+ return null;
+ }
+
+ fileReader.onload = function (event) {
+ val = event.target['result'] as string;
+ callback(val);
+ }
+ fileReader.readAsText(fileToLoad);
+ }
+
+ /*****************************************
+ * Page Funtionality Methods
+ ****************************************/
+
+ toggleSidebar(set: Boolean) {
+ if (!set) {
+ this.showSidebar = false;
+ this.modelerElement.nativeElement.style.right = '0px';
+ } else {
+ this.showSidebar = true;
+ $(this.modelerElement.nativeElement).css('right', $(this.sidebarElement.nativeElement).width());
+ }
+ }
+
+ toggleProperties() {
+ if (!this.showProperties) {
+ this.toggleSidebar(true);
+ this.showTestDefinition = false;
+ this.showProperties = true;
+ } else {
+ this.toggleSidebar(false);
+ this.showProperties = false;
+ }
+ }
+
+ toggleTestDefinition() {
+ if (!this.showTestDefinition) {
+ this.toggleSidebar(true);
+ this.showProperties = false;
+ this.showTestDefinition = true;
+ } else {
+ this.toggleSidebar(false);
+ this.showTestDefinition = false;
+ }
+
+ this.refresh();
+ }
+
+ refresh() {
+ this.isRefreshed = false;
+ setTimeout(() => {
+ this.isRefreshed = true;
+ }, 1);
+ }
+
+ snackAlert(msg) {
+ this._snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: msg
+ }
+ });
+ }
+
+ errorPopup(err) {
+ return this._dialog.open(AlertModalComponent, {
+ width: '400px',
+ data: {
+ type: 'alert',
+ message: err
+ }
+ });
+ }
+}
diff --git a/otf-frontend/client/src/app/layout/modeler/modeler.module.spec.ts b/otf-frontend/client/src/app/layout/modeler/modeler.module.spec.ts
new file mode 100644
index 0000000..b37984d
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/modeler.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { ModelerModule } from './modeler.module';
+
+describe('ModelerModule', () => {
+ let modelerModule: ModelerModule;
+
+ beforeEach(() => {
+ modelerModule = new ModelerModule();
+ });
+
+ it('should create an instance', () => {
+ expect(modelerModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/modeler/modeler.module.ts b/otf-frontend/client/src/app/layout/modeler/modeler.module.ts
new file mode 100644
index 0000000..2dee340
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/modeler.module.ts
@@ -0,0 +1,67 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+import { ModelerRoutingModule } from './modeler-routing.module';
+import { ModelerComponent } from './modeler.component';
+import { MatButtonModule, MatIconModule, MatTableModule, MatFormFieldModule, MatInputModule, MatPaginatorModule, MatBadgeModule, MatCardModule, MatSelectModule, MatOptionModule, MatTabsModule, MatProgressSpinnerModule, MatListModule, MatMenuModule, MatTooltipModule, MatDialogModule } from '@angular/material';
+import { FormsModule } from '@angular/forms';
+import { FilterPipeModule } from 'ngx-filter-pipe';
+import { TestHeadModalModule } from 'app/shared/modules/test-head-modal/test-head-modal.module';
+import { AlertModalModule } from 'app/shared/modules/alert-modal/alert-modal.module';
+import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
+import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
+import { CodemirrorModule } from 'ng2-codemirror';
+import { FileUploadModule } from 'ng2-file-upload';
+import { AlertSnackbarModule } from 'app/shared/modules/alert-snackbar/alert-snackbar.module';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ ModelerRoutingModule,
+ MatButtonModule,
+ MatIconModule,
+ CommonModule,
+ FormsModule,
+ FilterPipeModule,
+ MatButtonModule,
+ MatTableModule,
+ MatFormFieldModule,
+ MatInputModule,
+ MatPaginatorModule,
+ TestHeadModalModule,
+ AlertModalModule,
+ MatBadgeModule,
+ PerfectScrollbarModule,
+ MatCardModule,
+ MatSelectModule,
+ MatOptionModule,
+ MatIconModule,
+ NgbModule,
+ CodemirrorModule,
+ MatTabsModule,
+ MatProgressSpinnerModule,
+ FileUploadModule,
+ MatListModule,
+ MatMenuModule,
+ MatTooltipModule,
+ AlertSnackbarModule
+ ],
+ declarations: [ModelerComponent],
+})
+export class ModelerModule { }
diff --git a/otf-frontend/client/src/app/layout/modeler/new.bpmn b/otf-frontend/client/src/app/layout/modeler/new.bpmn
new file mode 100644
index 0000000..73577a0
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/new.bpmn
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_0nye5hw" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.14.0">
+ <bpmn:process id="new_diagram" name="new_diagram" isExecutable="true">
+ <bpmn:startEvent id="StartEvent_1r2e4pd" camunda:asyncBefore="true">
+ <bpmn:outgoing>SequenceFlow_1gpkkbm</bpmn:outgoing>
+ </bpmn:startEvent>
+ <bpmn:endEvent id="EndEvent_0czvyun">
+ <bpmn:incoming>SequenceFlow_1psgifi</bpmn:incoming>
+ <bpmn:terminateEventDefinition id="TerminateEventDefinition_12nqmmc" />
+ </bpmn:endEvent>
+ <bpmn:task id="Task_0e68ysc" name="VTH:PING TEST">
+ <bpmn:incoming>SequenceFlow_1d4t09c</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_14b2mg6</bpmn:outgoing>
+ </bpmn:task>
+ <bpmn:scriptTask id="ScriptTask_1fwzn2i" name="JS Script inline" scriptFormat="JavaScript" camunda:resource="deployment://script.js">
+ <bpmn:incoming>SequenceFlow_14b2mg6</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0i9av57</bpmn:outgoing>
+ </bpmn:scriptTask>
+ <bpmn:task id="Task_10nhde5" name="UTIL:LogTestResult">
+ <bpmn:incoming>SequenceFlow_0i9av57</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1psgifi</bpmn:outgoing>
+ </bpmn:task>
+ <bpmn:task id="Task_1r783jz" name="VTH:PING TEST">
+ <bpmn:incoming>SequenceFlow_1gpkkbm</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1d4t09c</bpmn:outgoing>
+ </bpmn:task>
+ <bpmn:sequenceFlow id="SequenceFlow_1gpkkbm" sourceRef="StartEvent_1r2e4pd" targetRef="Task_1r783jz" />
+ <bpmn:sequenceFlow id="SequenceFlow_1psgifi" sourceRef="Task_10nhde5" targetRef="EndEvent_0czvyun" />
+ <bpmn:sequenceFlow id="SequenceFlow_1d4t09c" sourceRef="Task_1r783jz" targetRef="Task_0e68ysc" />
+ <bpmn:sequenceFlow id="SequenceFlow_14b2mg6" sourceRef="Task_0e68ysc" targetRef="ScriptTask_1fwzn2i" />
+ <bpmn:sequenceFlow id="SequenceFlow_0i9av57" sourceRef="ScriptTask_1fwzn2i" targetRef="Task_10nhde5" />
+ </bpmn:process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="new_diagram">
+ <bpmndi:BPMNShape id="StartEvent_1r2e4pd_di" bpmnElement="StartEvent_1r2e4pd">
+ <dc:Bounds x="354" y="117" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="416" y="153" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="EndEvent_0czvyun_di" bpmnElement="EndEvent_0czvyun">
+ <dc:Bounds x="1189" y="125" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1117" y="165" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="Task_09vptvw_di" bpmnElement="Task_0e68ysc">
+ <dc:Bounds x="673" y="95" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_1fwzn2i_di" bpmnElement="ScriptTask_1fwzn2i">
+ <dc:Bounds x="845" y="95" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="Task_10nhde5_di" bpmnElement="Task_10nhde5">
+ <dc:Bounds x="1010" y="95" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="Task_0myfoou_di" bpmnElement="Task_1r783jz">
+ <dc:Bounds x="493" y="95" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1gpkkbm_di" bpmnElement="SequenceFlow_1gpkkbm">
+ <di:waypoint x="390" y="135" />
+ <di:waypoint x="493" y="135" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="441.5" y="114" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1psgifi_di" bpmnElement="SequenceFlow_1psgifi">
+ <di:waypoint x="1110" y="135" />
+ <di:waypoint x="1150" y="135" />
+ <di:waypoint x="1150" y="143" />
+ <di:waypoint x="1189" y="143" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1165" y="133" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1d4t09c_di" bpmnElement="SequenceFlow_1d4t09c">
+ <di:waypoint x="593" y="136" />
+ <di:waypoint x="673" y="135" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="633" y="114.5" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_14b2mg6_di" bpmnElement="SequenceFlow_14b2mg6">
+ <di:waypoint x="773" y="135" />
+ <di:waypoint x="845" y="135" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="809" y="114" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0i9av57_di" bpmnElement="SequenceFlow_0i9av57">
+ <di:waypoint x="945" y="135" />
+ <di:waypoint x="1010" y="135" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="977.5" y="114" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/otf-frontend/client/src/app/layout/modeler/templates/elements.json b/otf-frontend/client/src/app/layout/modeler/templates/elements.json
new file mode 100644
index 0000000..5bdd240
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/templates/elements.json
@@ -0,0 +1,20 @@
+{
+ "name": "Virtual Test Head",
+ "id": "com.camunda.example.CallTestHeadTask",
+ "appliesTo": [
+ "bpmn:Task",
+ "bpmn:CallActivity"
+ ],
+ "properties": [
+ {
+ "label": "Name",
+ "type": "String",
+ "value": "VTH:",
+ "editable": true,
+ "binding": {
+ "type": "camunda:field",
+ "name": "camunda:name"
+ }
+ }
+ ]
+}
diff --git a/otf-frontend/client/src/app/layout/modeler/test-definition-element.class.ts b/otf-frontend/client/src/app/layout/modeler/test-definition-element.class.ts
new file mode 100644
index 0000000..06f62da
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/modeler/test-definition-element.class.ts
@@ -0,0 +1,203 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestDefinition, BpmnInstance, TestHeadRef, Pflow } from "app/shared/models/test-definition.model";
+import { toInteger } from "@ng-bootstrap/ng-bootstrap/util/util";
+
+export class TestDefinitionElement implements TestDefinition {
+
+ testName: String;
+ testDescription: String;
+ processDefinitionKey: String;
+ groupId: String;
+ bpmnInstances: BpmnInstanceElement[];
+ disabled: Boolean;
+ _id: String;
+ createdAt: String;
+ createdBy: String;
+ updatedAt: String;
+ updatedBy: String;
+
+ currentVersion; // int Array index of the bpmnInstances
+ currentVersionName;
+ currentInstance: BpmnInstanceElement;
+
+ constructor(testDefinition?){
+ if(testDefinition){
+ this.setAll(testDefinition);
+ }else{
+ this.reset();
+ }
+ }
+
+
+ reset(){
+ this._id = "";
+ this.testName = '';
+ this.testDescription = '';
+ this.groupId = '';
+ this.processDefinitionKey = '';
+ this.disabled = false;
+ this.createdAt = null;
+ this.createdBy = null;
+ this.updatedAt = null;
+ this.updatedBy = null;
+
+ this.bpmnInstances = [];
+ this.addBpmnInstance();
+
+ this.switchVersion();
+ }
+
+ switchVersion(version?){
+ if(version){
+ //find the version
+ this.bpmnInstances.forEach((elem, val) => {
+ if(elem['version'] == version){
+ this.currentVersion = val;
+ this.currentInstance = this.bpmnInstances[val];
+ this.currentVersionName = this.currentInstance.version;
+ }
+ });
+ }else{
+ //get latest version
+ this.currentVersion = this.bpmnInstances.length - 1;
+ this.currentInstance = this.bpmnInstances[this.currentVersion];
+ this.currentVersionName = this.currentInstance.version;
+ }
+ }
+
+ //Setter Methods
+
+ setAll(td){
+ this._id = td._id;
+ this.testName = td.testName;
+ this.testDescription = td.testDescription;
+ this.groupId = td.groupId;
+ this.processDefinitionKey = td.processDefinitionKey;
+ this.setBpmnInstances(td.bpmnInstances);
+ this.switchVersion();
+ }
+
+ setId(id: String){
+ this._id = id;
+ }
+
+ setName(testName: String){
+ this.testName = testName;
+ }
+
+ setDescription(testDescription: String){
+ this.testDescription = testDescription;
+ }
+
+ setGroupId(groupId: String){
+ this.groupId = groupId;
+ }
+
+ setProcessDefinitionKey(processDefinitionKey: String){
+ this.processDefinitionKey = processDefinitionKey;
+ }
+
+ setBpmnInstances(instances: BpmnInstanceElement[] = []){
+
+
+ this.bpmnInstances = instances;
+ }
+
+ setNewVersion(newVersion: number = null){
+ if(newVersion == null){
+ newVersion = this.bpmnInstances.length;
+ }
+ if(this.setVersion(newVersion) == -1){
+ this.setNewVersion(++newVersion);
+ }
+ return newVersion;
+ }
+
+ setVersion(version){
+ this.bpmnInstances.forEach((elem, val) => {
+ if(elem.version == version && this.currentVersion != val ){
+ return -1;
+ }
+ });
+ this.currentInstance.version = version;
+ return version;
+ }
+
+ addBpmnInstance(instance?){
+ if(!instance){
+ instance = this.newInstance();
+ }
+ //console.log(this.bpmnInstances[this.bpmnInstances.length - 1].version )
+ if(this.bpmnInstances[this.bpmnInstances.length - 1]){
+ instance['version'] = (toInteger(this.bpmnInstances[this.bpmnInstances.length - 1].version) + 1).toString();
+ }else{
+ instance['version'] = "1";
+ }
+ this.bpmnInstances.push(instance);
+
+ }
+
+ removeBpmnInstance(version){
+ this.bpmnInstances.forEach((elem, val) =>{
+ if(elem['version'] == version){
+ this.bpmnInstances.splice(val, 1);
+ }
+ });
+ }
+
+ getBpmnInstances(version: String = null){
+ if(!version)
+ return this.bpmnInstances;
+
+ this.bpmnInstances.forEach((elem, val) => {
+ if(elem['version'] == version){
+ return elem;
+ }
+ });
+ }
+
+ newInstance(): BpmnInstanceElement {
+ return {} as BpmnInstanceElement;
+ }
+
+
+
+
+
+}
+
+export class BpmnInstanceElement implements BpmnInstance {
+ createdAt: String;
+ updatedAt: String;
+ processDefinitionId: String;
+ deploymentId: String;
+ version: String;
+ bpmnFileId: String;
+ resourceFileId: String;
+ isDeployed: Boolean;
+ testHeads: TestHeadRef[];
+ pflos: Pflow[];
+ testDataTemplate: String;
+ testDataTemplateJSON: any;
+ updatedBy: String;
+ createdBy: String;
+
+ bpmnXml: String;
+ bpmnHasChanged: Boolean;
+
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/onboarding/create-test/create-test-routing.module.ts b/otf-frontend/client/src/app/layout/onboarding/create-test/create-test-routing.module.ts
new file mode 100644
index 0000000..cedbf19
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/create-test/create-test-routing.module.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { CreateTestComponent } from './create-test.component';
+
+const routes: Routes = [
+ {
+ path:'', component: CreateTestComponent
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class CreateTestRoutingModule { }
diff --git a/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.component.pug b/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.component.pug
new file mode 100644
index 0000000..38be727
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.component.pug
@@ -0,0 +1,92 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div
+ h2 Onboarding
+ ol.breadcrumb.bg-light
+ li.breadcrumb-item
+ a(href="#") Onboarding
+ li.breadcrumb-item
+ a(href="#") Test Heads
+ li.breadcrumb-item.active Test Definition
+
+ .row([@routerTransition])
+ .col-12
+ mat-card.mb-5
+ mat-card-header.bg-primary.text-white
+ mat-card-title
+ h4 Create Test Definition
+ mat-card-content
+ app-create-test-form([listKey]="listKey")
+ //.card.border-primary
+ .card-header.bg-primary.text-white.text-center
+ h4 Create New Tests
+ .card-body
+ app-create-test-form
+
+ //.col-sm-4
+ h4 Saved Tests
+
+ input.form-control.bg-light.mb-3([(ngModel)]="search.testName", type="text", placeholder="Search...")
+ .list-group
+ a.list-group-item.list-group-item-action(*ngFor="let test of test_list | filterBy: search", style="cursor:pointer")
+ b {{ test.testName }}
+
+
+//div
+
+
+ .row
+ .col-sm-10
+ app-page-header([heading]="'Onboarding'", [icon]="'fa-edit'")
+ ol.breadcrumb.bg-light
+ li.breadcrumb-item
+ a(href="#") Onboarding
+ li.breadcrumb-item
+ a(href="#") Test Heads
+ li.breadcrumb-item
+ a(href="#") Test Strategies
+ li.breadcrumb-item.active Create Test
+
+ // div
+ div.ps(style="position: relative; max-width: 600px; max-height: 40px;", [perfectScrollbar]="")
+ div hi
+
+ .footer.row.p-2.bg-light([@routerTransition], style="box-shadow:inset 0px 11px 8px -10px #CCC, inset 0px -11px 8px -10px #CCC; bottom:44px", )
+ .col-sm-12
+ div(style="width:100%")
+ div(style="dispaly:inline-block") Test Strategies
+ div(style="display:inline-block") hi
+ //input.form-control.col-sm-2(type="text", style="dispaly:inline-block")
+ .ps(style="position: relative; max-height: 110px", [perfectScrollbar]="config")
+ div.col-sm-12.mb-3(style="white-space: nowrap;")
+ .card.mr-3(*ngFor="let vts of vts_list", style="display:inline-block;border-color: #045C87")
+ .card-header.text-white(style="background:#045C87") {{ vts.test_strategy_name ? vts.test_strategy_name : vts.test_strategy_id }}
+ .card-body
+ img(src="assets/images/VNFHealth.PNG", style="width:100px")
+
+ //.sidebar-right.col-sm-2.bg-light.p-2(style="box-shadow:inset 11px 0px 8px -10px #CCC, inset -11px 0px 8px -10px #CCC;")
+ .ps(style="position: relative;", [perfectScrollbar]="")
+ .card.mb-3.border-primary(*ngFor="let vth of vth_list")
+ .card-header.text-white.bg-primary {{ vth.test_head_name ? vth.test_head_name : vth.test_head_id }}
+ .card-body
+ | {{ vth.description }}
+
+.footer.bg-primary
+ .row.p-2
+ .col-sm-12
+ // button(mat-raised-button, color="primary", (click)="back()") Back
+ button.pull-right(mat-raised-button, color="accent", (click)="next()") Next
diff --git a/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.component.scss b/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.component.scss
new file mode 100644
index 0000000..7d236e4
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.component.scss
@@ -0,0 +1,19 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.sidebar-right {
+ margin-top: -15px;
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.component.spec.ts b/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.component.spec.ts
new file mode 100644
index 0000000..ff339f5
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { CreateTestComponent } from './create-test.component';
+
+describe('CreateTestComponent', () => {
+ let component: CreateTestComponent;
+ let fixture: ComponentFixture<CreateTestComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ CreateTestComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(CreateTestComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.component.ts b/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.component.ts
new file mode 100644
index 0000000..abb9ee6
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.component.ts
@@ -0,0 +1,73 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Output } from '@angular/core';
+import { routerLeftTransition } from '../../../router.animations';
+import { ListService } from '../../../shared/services/list.service';
+import { HttpClient } from '@angular/common/http';
+import { AppGlobals } from '../../../app.global';
+import { Router, NavigationExtras } from '@angular/router';
+import { TestDefinitionService } from '../../../shared/services/test-definition.service';
+
+
+@Component({
+ selector: 'app-create-test',
+ templateUrl: './create-test.component.pug',
+ styleUrls: ['./create-test.component.scss', '../onboarding.component.scss'],
+ providers: [AppGlobals],
+ animations: [routerLeftTransition()]
+})
+export class CreateTestComponent implements OnInit {
+
+ public test_list = [];
+ public search;
+
+ @Output() public listKey;
+
+ constructor(private router: Router, private testDefinition: TestDefinitionService, private list: ListService, private http: HttpClient, private _global: AppGlobals) {
+
+ }
+
+ back() {
+ this.router.navigateByUrl('/onboarding/test-head');
+ }
+
+ next() {
+ let navigationExtras: NavigationExtras = {
+ queryParams: {
+ "testDefinition": JSON.stringify(this.test_list[this.test_list.length - 1])
+ }
+ };
+ this.router.navigate(['/onboarding/test-instances'], navigationExtras);
+ }
+
+ ngOnInit() {
+
+ this.search = {};
+ this.search.testName = "";
+
+ this.listKey = 'td';
+
+ //Create List with list service
+ this.list.createList(this.listKey);
+
+ //Subscribe to list service
+ this.list.listMap[this.listKey].currentList.subscribe((list) =>{
+ this.test_list = list;
+ });
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.module.spec.ts b/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.module.spec.ts
new file mode 100644
index 0000000..db72c89
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { CreateTestModule } from './create-test.module';
+
+describe('CreateTestModule', () => {
+ let createTestModule: CreateTestModule;
+
+ beforeEach(() => {
+ createTestModule = new CreateTestModule();
+ });
+
+ it('should create an instance', () => {
+ expect(createTestModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.module.ts b/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.module.ts
new file mode 100644
index 0000000..576948d
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.module.ts
@@ -0,0 +1,61 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+import { CreateTestRoutingModule } from './create-test-routing.module';
+import { CreateTestComponent } from './create-test.component';
+import { PageHeaderModule } from '../../../shared';
+import { PERFECT_SCROLLBAR_CONFIG, PerfectScrollbarConfigInterface } from 'ngx-perfect-scrollbar';
+import { FilterPipeModule } from 'ngx-filter-pipe';
+import { FormsModule } from '@angular/forms';
+import { MatCheckboxModule } from '@angular/material/checkbox';
+import { MatRadioModule } from '@angular/material/radio';
+import { MatInputModule } from '@angular/material/input';
+import { MatIconModule } from '@angular/material/icon';
+import { MatButtonModule, MatDialogModule, MAT_DIALOG_DEFAULT_OPTIONS, MAT_CHECKBOX_CLICK_ACTION, MatCardModule } from '@angular/material';
+import { CreateTestFormModule } from '../../../shared/modules/create-test-form/create-test-form.module';
+
+const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
+ suppressScrollY: true
+};
+
+@NgModule({
+ imports: [
+ CommonModule,
+ CreateTestRoutingModule,
+ CreateTestFormModule,
+ PageHeaderModule,
+ FilterPipeModule,
+ FormsModule,
+ MatButtonModule,
+ MatDialogModule,
+ MatCheckboxModule,
+ MatRadioModule,
+ MatInputModule,
+ MatIconModule,
+ CreateTestFormModule,
+ MatCardModule
+ ],
+ declarations: [CreateTestComponent],
+ providers: [
+ {provide: PERFECT_SCROLLBAR_CONFIG, useValue: DEFAULT_PERFECT_SCROLLBAR_CONFIG},
+ {provide: MAT_DIALOG_DEFAULT_OPTIONS, useValue: {hasBackdrop: true}},
+ {provide: MAT_CHECKBOX_CLICK_ACTION, useValue: 'check'}
+ ]
+})
+export class CreateTestModule { }
diff --git a/otf-frontend/client/src/app/layout/onboarding/onboarding-routing.module.ts b/otf-frontend/client/src/app/layout/onboarding/onboarding-routing.module.ts
new file mode 100644
index 0000000..92dabc3
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/onboarding-routing.module.ts
@@ -0,0 +1,38 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { OnboardingComponent } from './onboarding.component';
+
+const routes: Routes = [
+ {
+ path: '', component: OnboardingComponent,
+ children:[
+ { path: '', redirectTo: 'start', pathMatch: 'prefix' },
+ { path: 'test-definition', loadChildren: './create-test/create-test.module#CreateTestModule' },
+ { path: 'start', loadChildren: './start/start.module#StartModule' },
+ { path: 'test-head', loadChildren: './test-head/test-head.module#TestHeadModule' },
+ { path: 'test-instances', loadChildren: './test-instances/test-instances.module#TestInstancesModule' }
+ ]
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class OnboardingRoutingModule { }
diff --git a/otf-frontend/client/src/app/layout/onboarding/onboarding.component.pug b/otf-frontend/client/src/app/layout/onboarding/onboarding.component.pug
new file mode 100644
index 0000000..48d9530
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/onboarding.component.pug
@@ -0,0 +1,83 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+router-outlet
+//div([@routerTransition])
+ app-page-header([heading]="'Onboarding'", [icon]="'fa-edit'")
+ .row
+
+ .col-lg-6
+
+ .card.mb-12
+ .card-header
+ | Virtual Test Heads
+ .card-body
+ .list-group
+ a.list-group-item.list-group-item-action(href="#",*ngFor="let vth of vth_list")
+ b {{ vth.test_head_id }}
+ p {{ vth.description }}
+ a(href="{{ vth.url_path }}") {{ vth.url_path }}
+
+ .col-lg-6
+
+ .card.bg-light.mb-12
+ .card-header
+ | New Virtual Test Head
+ .card-body
+ form(role='form')
+ fieldset.form-group
+ label Test Head ID
+ input.form-control(type="text", )
+ p
+
+ label Test Head Name
+ input.form-control(type="text", )
+ p
+
+ label Description
+ input.form-control(type="text",)
+ p
+
+ label Test Head Type
+ select.form-control()
+ option Proxy
+ option Regular
+ option Script
+ option Adapter
+ p
+
+ label Implementation Language
+ select.form-control()
+ option Java
+ option Python
+ option Javascript/NodeJS
+ p
+
+ label Base URL
+ input.form-control(type="url")
+ p
+
+ label Request Method
+ input.form-control(type="url")
+ p
+
+ label Creator
+ input.form-control(type="text")
+ p
+
+ button.btn.btn-primary((click)='next($event)') Submit
+
+ <router-outlet></router-outlet>
diff --git a/otf-frontend/client/src/app/layout/onboarding/onboarding.component.scss b/otf-frontend/client/src/app/layout/onboarding/onboarding.component.scss
new file mode 100644
index 0000000..4e64050
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/onboarding.component.scss
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.footer {
+ position: fixed;
+ left: 235px;
+ bottom: 0px;
+ right: 0px;
+ z-index: 100;
+}
+
+@media screen and (max-width: 992px) {
+ .footer {
+ left: 0px;
+ }
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/onboarding/onboarding.component.spec.ts b/otf-frontend/client/src/app/layout/onboarding/onboarding.component.spec.ts
new file mode 100644
index 0000000..9268aab
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/onboarding.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { OnboardingComponent } from './onboarding.component';
+
+describe('OnboardingComponent', () => {
+ let component: OnboardingComponent;
+ let fixture: ComponentFixture<OnboardingComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ OnboardingComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(OnboardingComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/onboarding/onboarding.component.ts b/otf-frontend/client/src/app/layout/onboarding/onboarding.component.ts
new file mode 100644
index 0000000..9c3b288
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/onboarding.component.ts
@@ -0,0 +1,30 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit } from '@angular/core';
+import { routerLeftTransition } from '../../router.animations';
+
+@Component({
+ selector: 'app-onboarding',
+ templateUrl: './onboarding.component.pug',
+ styleUrls: ['./onboarding.component.scss'],
+ animations: [routerLeftTransition()]
+})
+export class OnboardingComponent implements OnInit {
+
+ constructor() {}
+ ngOnInit() {}
+}
diff --git a/otf-frontend/client/src/app/layout/onboarding/onboarding.module.spec.ts b/otf-frontend/client/src/app/layout/onboarding/onboarding.module.spec.ts
new file mode 100644
index 0000000..9a7068e
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/onboarding.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { OnboardingModule } from './onboarding.module';
+
+describe('OnboardingModule', () => {
+ let onboardingModule: OnboardingModule;
+
+ beforeEach(() => {
+ onboardingModule = new OnboardingModule();
+ });
+
+ it('should create an instance', () => {
+ expect(onboardingModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/onboarding/onboarding.module.ts b/otf-frontend/client/src/app/layout/onboarding/onboarding.module.ts
new file mode 100644
index 0000000..3e01611
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/onboarding.module.ts
@@ -0,0 +1,32 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+import { OnboardingRoutingModule } from './onboarding-routing.module';
+import { OnboardingComponent } from './onboarding.component';
+import { PageHeaderModule } from '../../shared';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ OnboardingRoutingModule,
+ PageHeaderModule
+ ],
+ declarations: [OnboardingComponent]
+})
+export class OnboardingModule { }
diff --git a/otf-frontend/client/src/app/layout/onboarding/onboarding.service.ts b/otf-frontend/client/src/app/layout/onboarding/onboarding.service.ts
new file mode 100644
index 0000000..43661d4
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/onboarding.service.ts
@@ -0,0 +1,32 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { Observable } from 'rxjs';
+
+@Injectable()
+export class OnboardingService {
+
+ private _url: string = 'http://localhost:3000/api/vth;';
+
+ constructor(private http: HttpClient) {}
+
+ getVirtualTestHeads() {
+ return this.http.get(this._url);
+ }
+
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/onboarding/start/start-routing.module.ts b/otf-frontend/client/src/app/layout/onboarding/start/start-routing.module.ts
new file mode 100644
index 0000000..93fe1ce
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/start/start-routing.module.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { StartComponent } from './start.component';
+
+const routes: Routes = [{
+ path:'', component: StartComponent
+}];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class StartRoutingModule { }
diff --git a/otf-frontend/client/src/app/layout/onboarding/start/start.component.pug b/otf-frontend/client/src/app/layout/onboarding/start/start.component.pug
new file mode 100644
index 0000000..23781db
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/start/start.component.pug
@@ -0,0 +1,24 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+.row.fullWidth(style="margin-top:-15px;background-image:url('assets/images/networkBackground.jpg'); background-size:cover; backgroung-repeat:no-repeat; min-height:970px;")
+ .col-sm-12
+ div.text-center(style="margin-top:15%;background-color: rgba(0,0,0,.5); padding: 30px; border-radius: 5px; max-width: 700px; margin-right:auto; margin-left:auto")
+ h1.text-center.text-white Onboarding
+
+ p.text-center.text-white Welcome to the Open Testing Framework. Click get started below to connect your first test head and create your first test!
+ div.text-center
+ button(mat-raised-button, color="accent", (click)="next()") Get Started
diff --git a/otf-frontend/client/src/app/layout/onboarding/start/start.component.scss b/otf-frontend/client/src/app/layout/onboarding/start/start.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/start/start.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/layout/onboarding/start/start.component.spec.ts b/otf-frontend/client/src/app/layout/onboarding/start/start.component.spec.ts
new file mode 100644
index 0000000..b3f164c
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/start/start.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { StartComponent } from './start.component';
+
+describe('StartComponent', () => {
+ let component: StartComponent;
+ let fixture: ComponentFixture<StartComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ StartComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(StartComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/onboarding/start/start.component.ts b/otf-frontend/client/src/app/layout/onboarding/start/start.component.ts
new file mode 100644
index 0000000..899f8dc
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/start/start.component.ts
@@ -0,0 +1,35 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+
+@Component({
+ selector: 'app-start',
+ templateUrl: './start.component.pug',
+ styleUrls: ['./start.component.scss']
+})
+export class StartComponent implements OnInit {
+
+ constructor(private router: Router) { }
+
+ public next(){
+ this.router.navigateByUrl('/onboarding/test-head');
+ }
+ ngOnInit() {
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/onboarding/start/start.module.spec.ts b/otf-frontend/client/src/app/layout/onboarding/start/start.module.spec.ts
new file mode 100644
index 0000000..b198e76
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/start/start.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { StartModule } from './start.module';
+
+describe('StartModule', () => {
+ let startModule: StartModule;
+
+ beforeEach(() => {
+ startModule = new StartModule();
+ });
+
+ it('should create an instance', () => {
+ expect(startModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/onboarding/start/start.module.ts b/otf-frontend/client/src/app/layout/onboarding/start/start.module.ts
new file mode 100644
index 0000000..4a236c1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/start/start.module.ts
@@ -0,0 +1,32 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+import { StartRoutingModule } from './start-routing.module';
+import { StartComponent } from './start.component';
+import { MatButtonModule } from '@angular/material';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ StartRoutingModule,
+ MatButtonModule
+ ],
+ declarations: [StartComponent]
+})
+export class StartModule { }
diff --git a/otf-frontend/client/src/app/layout/onboarding/test-head/test-head-routing.module.ts b/otf-frontend/client/src/app/layout/onboarding/test-head/test-head-routing.module.ts
new file mode 100644
index 0000000..c166661
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/test-head/test-head-routing.module.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { TestHeadComponent } from './test-head.component';
+
+const routes: Routes = [
+ {
+ path:'', component: TestHeadComponent
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class TestHeadRoutingModule { }
diff --git a/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.component.pug b/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.component.pug
new file mode 100644
index 0000000..69ef306
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.component.pug
@@ -0,0 +1,52 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div([@routerTransition])
+ app-page-header([heading]="'Onboarding'", [icon]="'fa-edit'")
+
+ ol.breadcrumb.bg-light
+ li.breadcrumb-item
+ a(href="#") Onboarding
+ li.breadcrumb-item.active Test Heads
+
+
+ .row.mb-5
+ .col-sm-8
+ mat-card
+ mat-card-header.bg-primary.text-white
+ mat-card-title
+ h4 Create Test Head
+ mat-card-content
+ app-create-test-head-form([options]="createFormOptions")
+ //.card.mb-12.bg-light.border-primary
+ .card-header.bg-primary.text-white.text-center
+ h4 New Virtual Test Head
+ .card-body
+ app-create-test-head-form([options]="createFormOptions")
+
+ .col-sm-4
+ h4 Saved Test Heads
+
+ input.form-control.bg-light.mb-3([(ngModel)]="search.testHeadName", type="text", placeholder="Search...")
+ .list-group
+ a.list-group-item.list-group-item-action((click)="openTestHead(vth)",*ngFor="let vth of vth_list | filterBy: search", style="cursor:pointer")
+ b {{ vth.testHeadName }}
+
+.footer.bg-primary
+ .row.p-2
+ .col-sm-12
+ //button(mat-raised-button, color="primary", (click)="back()") Back
+ //button.pull-right(mat-raised-button, color="accent", (click)="next()") Next
diff --git a/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.component.scss b/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.component.spec.ts b/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.component.spec.ts
new file mode 100644
index 0000000..766b121
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TestHeadComponent } from './test-head.component';
+
+describe('TestHeadComponent', () => {
+ let component: TestHeadComponent;
+ let fixture: ComponentFixture<TestHeadComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TestHeadComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TestHeadComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.component.ts b/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.component.ts
new file mode 100644
index 0000000..136932a
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.component.ts
@@ -0,0 +1,91 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, ViewContainerRef, Output, Input } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { routerLeftTransition } from '../../../router.animations';
+import { Router } from '@angular/router';
+import { ListService } from '../../../shared/services/list.service';
+import { TestHeadModalComponent } from '../../../shared/modules/test-head-modal/test-head-modal.component';
+import { MatDialog } from '@angular/material';
+import { TestHeadService } from '../../../shared/services/test-head.service';
+
+@Component({
+ selector: 'app-test-head',
+ templateUrl: './test-head.component.pug',
+ styleUrls: ['./test-head.component.scss', '../onboarding.component.scss'],
+ animations: [routerLeftTransition()]
+})
+export class TestHeadComponent implements OnInit {
+
+ public vth_list;
+ public search;
+
+ @Output() public createFormOptions = {
+ goal: 'create'
+ }
+
+ constructor(
+ private router: Router,
+ private list: ListService,
+ public dialog: MatDialog,
+ private testHead: TestHeadService
+ ) {
+
+ }
+
+ next() {
+ this.router.navigateByUrl('/onboarding/test-definition');
+ }
+
+ back() {
+ this.router.navigateByUrl('/onboarding');
+ }
+
+ openTestHead(testHead): void {
+ const dialogRef = this.dialog.open(TestHeadModalComponent, {
+ width: '450px',
+ data: {
+ goal: 'edit',
+ testHead: testHead
+ }
+ });
+
+ dialogRef.afterClosed().subscribe(result => {
+
+ });
+ }
+
+ ngOnInit() {
+
+ this.search = {};
+ this.search._id = "";
+ this.search.testHeadName = "";
+
+ this.list.createList('vth');
+
+ this.testHead.find({$limit: -1})
+ .subscribe((vth_list) => {
+ this.list.changeMessage('vth', vth_list);
+ });
+
+ this.list.listMap['vth'].currentList.subscribe((list) =>{
+ this.vth_list = list;
+ });
+
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.module.spec.ts b/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.module.spec.ts
new file mode 100644
index 0000000..a631784
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestHeadModule } from './test-head.module';
+
+describe('TestHeadModule', () => {
+ let testHeadModule: TestHeadModule;
+
+ beforeEach(() => {
+ testHeadModule = new TestHeadModule();
+ });
+
+ it('should create an instance', () => {
+ expect(testHeadModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.module.ts b/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.module.ts
new file mode 100644
index 0000000..96a3f40
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.module.ts
@@ -0,0 +1,51 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule, Pipe } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+import { TestHeadRoutingModule } from './test-head-routing.module';
+import { TestHeadComponent } from './test-head.component';
+import { PageHeaderModule, SharedPipesModule } from '../../../shared';
+import { FormsModule } from '@angular/forms';
+import { FilterPipeModule } from 'ngx-filter-pipe';
+import { ListService } from '../../../shared/services/list.service';
+import { CreateTestHeadFormModule } from '../../../shared/modules/create-test-head-form/create-test-head-form.module';
+import { CreateTestHeadFormComponent } from '../../../shared/modules/create-test-head-form/create-test-head-form.component';
+import { TestHeadModalModule } from '../../../shared/modules/test-head-modal/test-head-modal.module';
+import { MatButtonModule, MatCardModule } from '@angular/material';
+
+//import { CreateTestHeadFormComponent } from '../../../shared/modules/create-test-head-form/create-test-head-form.component';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ TestHeadRoutingModule,
+ CreateTestHeadFormModule,
+ PageHeaderModule,
+ FormsModule,
+ FilterPipeModule,
+ TestHeadModalModule,
+ MatButtonModule,
+ MatCardModule
+ ],
+ declarations: [
+ TestHeadComponent
+ ]
+
+})
+
+export class TestHeadModule { }
diff --git a/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances-routing.module.ts b/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances-routing.module.ts
new file mode 100644
index 0000000..93d3967
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances-routing.module.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { TestInstancesComponent } from './test-instances.component';
+
+const routes: Routes = [
+ {
+ path:'', component: TestInstancesComponent
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class TestInstancesRoutingModule { }
diff --git a/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances.component.pug b/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances.component.pug
new file mode 100644
index 0000000..dcf7bc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances.component.pug
@@ -0,0 +1,35 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div
+ app-page-header([heading]="'Onboarding'", [icon]="'fa-edit'")
+ script(src="../../../../../node_modules/codemirror/mode/yaml/yaml.js")
+ //- ol.breadcrumb.bg-light
+ //- li.breadcrumb-item
+ //- a(href="#") Onboarding
+ //- li.breadcrumb-item
+ //- a(href="#") Test Heads
+ //- li.breadcrumb-item
+ //- a(href="#") Test Definition
+ //- li.breadcrumb-item.active Test Instances
+
+ .col-12([@routerTransition])
+ app-create-test-instance-form([editInstance] = null)
+.footer.bg-primary
+ .row.p-2
+ .col-sm-12
+ //- button(mat-raised-button, color="primary", (click)="back()") Back
+ //- button.pull-right(mat-raised-button, color="accent", (click)="next()") Finish
diff --git a/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances.component.scss b/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances.component.spec.ts b/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances.component.spec.ts
new file mode 100644
index 0000000..481a5ce
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TestInstancesComponent } from './test-instances.component';
+
+describe('TestInstancesComponent', () => {
+ let component: TestInstancesComponent;
+ let fixture: ComponentFixture<TestInstancesComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TestInstancesComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TestInstancesComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances.component.ts b/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances.component.ts
new file mode 100644
index 0000000..0ab8c5a
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances.component.ts
@@ -0,0 +1,57 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Output } from '@angular/core';
+import { Router, ActivatedRoute } from '@angular/router';
+import { routerLeftTransition } from '../../../router.animations';
+import 'codemirror/mode/yaml/yaml.js';
+
+@Component({
+ selector: 'app-test-instances',
+ templateUrl: './test-instances.component.pug',
+ styleUrls: ['./test-instances.component.scss', '../onboarding.component.scss'],
+ animations: [routerLeftTransition()]
+})
+export class TestInstancesComponent implements OnInit {
+ yaml;
+
+ public codeConfig = {
+ mode: "yaml",
+ theme: "eclipse",
+ lineNumbers: true
+ };
+
+
+ //@Output() public createFormOptions;
+
+
+ constructor(private router: Router, private route: ActivatedRoute) { }
+
+ ngOnInit() {
+ // this.route.queryParams.subscribe(params => {
+ // this.createFormOptions = params["testDefinition"];
+ // });
+
+ }
+
+ // back() {
+ // this.router.navigateByUrl('/onboarding/test-definition');
+ // }
+
+ // next() {
+ // this.router.navigateByUrl('/dashboard');
+ // }
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances.module.spec.ts b/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances.module.spec.ts
new file mode 100644
index 0000000..f20101d
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestInstancesModule } from './test-instances.module';
+
+describe('TestInstancesModule', () => {
+ let testInstancesModule: TestInstancesModule;
+
+ beforeEach(() => {
+ testInstancesModule = new TestInstancesModule();
+ });
+
+ it('should create an instance', () => {
+ expect(testInstancesModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances.module.ts b/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances.module.ts
new file mode 100644
index 0000000..c0cd6d1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/onboarding/test-instances/test-instances.module.ts
@@ -0,0 +1,50 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+import { TestInstancesRoutingModule } from './test-instances-routing.module';
+import { TestInstancesComponent } from './test-instances.component';
+import { PageHeaderModule } from '../../../shared';
+import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
+import { FilterPipeModule } from 'ngx-filter-pipe';
+import { FormsModule } from '@angular/forms';
+import { MatButtonModule, MatDialogModule, MatCheckboxModule, MatRadioModule, MatInputModule, MatIconModule, MatExpansionModule, MatCardModule } from '@angular/material';
+import { CreateTestFormModule } from '../../../shared/modules/create-test-form/create-test-form.module';
+import { CodemirrorModule } from 'ng2-codemirror';
+import { CreateTestInstanceFormModule } from '../../../shared/modules/create-test-instance-form/create-test-instance-form.module';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ PageHeaderModule,
+ TestInstancesRoutingModule,
+ FilterPipeModule,
+ FormsModule,
+ MatButtonModule,
+ MatCheckboxModule,
+ MatRadioModule,
+ MatInputModule,
+ MatIconModule,
+ MatExpansionModule,
+ CodemirrorModule,
+ MatCardModule,
+ CreateTestInstanceFormModule
+ ],
+ declarations: [TestInstancesComponent]
+})
+export class TestInstancesModule { }
diff --git a/otf-frontend/client/src/app/layout/robot-report/robot-report.component.pug b/otf-frontend/client/src/app/layout/robot-report/robot-report.component.pug
new file mode 100644
index 0000000..9ea8f4b
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/robot-report/robot-report.component.pug
@@ -0,0 +1,24 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+mat-tab-group((selectedTabChange)="refresh()", dinamicHeight, color="", backgroundColor="")
+ mat-tab(label="Report", *ngIf="reports && reports.report", active='true')
+ iframe(#frame1, width="100%", height='500px', id="frame1", name="frame1", [srcdoc]="reports.report")
+ mat-tab(label="Log", *ngIf="reports && reports.log")
+ iframe(#frame2, width="100%", height='500px', id="frame2", name="frame2", [srcdoc]="reports.log")
+ mat-tab(label="Output", *ngIf="reports && reports.output")
+ codemirror(*ngIf="isRefreshed", [config]="codeConfig", [value]="reports.output")
+
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/robot-report/robot-report.component.scss b/otf-frontend/client/src/app/layout/robot-report/robot-report.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/robot-report/robot-report.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/layout/robot-report/robot-report.component.spec.ts b/otf-frontend/client/src/app/layout/robot-report/robot-report.component.spec.ts
new file mode 100644
index 0000000..8999f4d
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/robot-report/robot-report.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { RobotReportComponent } from './robot-report.component';
+
+describe('RobotReportComponent', () => {
+ let component: RobotReportComponent;
+ let fixture: ComponentFixture<RobotReportComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ RobotReportComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(RobotReportComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/robot-report/robot-report.component.ts b/otf-frontend/client/src/app/layout/robot-report/robot-report.component.ts
new file mode 100644
index 0000000..a790fd6
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/robot-report/robot-report.component.ts
@@ -0,0 +1,82 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Input, ViewChild, ElementRef, Renderer2, NgModule, Compiler, ViewContainerRef, Inject, Sanitizer } from '@angular/core';
+import { FileTransferService } from 'app/shared/services/file-transfer.service';
+import { DomSanitizer } from '@angular/platform-browser'
+import * as $ from 'jquery';
+import 'codemirror/mode/xml/xml.js';
+
+
+
+@Component({
+ selector: 'app-robot-report',
+ templateUrl: './robot-report.component.pug',
+ styleUrls: ['./robot-report.component.scss'],
+})
+export class RobotReportComponent implements OnInit {
+
+ @Input() public response;
+
+ @ViewChild('srcipts') scripts: ElementRef;
+ @ViewChild('frame1') frame1: ElementRef;
+ @ViewChild('frame2') frame2: ElementRef;
+ @ViewChild('codeMirror') codeMirror: ElementRef;
+
+ @ViewChild('container', {read: ViewContainerRef}) public container;
+
+ public reports = {
+ log: null,
+ report: null,
+ output: null
+ };
+
+ public codeConfig = {
+ mode: "application/xml",
+ theme: "eclipse",
+ readonly: true,
+ lineNumbers: true
+ };
+
+ public isRefreshed = false;
+ public noClick = "<script>$(document).ready(function(){ $('div a').removeAttr('href');}); $(document).click(function(){$('div a').removeAttr('href');} )</script>";
+
+ constructor(private fileTransfer: FileTransferService, private compiler: Compiler, private sanitizer: DomSanitizer) { }
+
+ ngOnInit() {
+ if(this.response){
+ if(this.response.vthResponse && this.response.vthResponse.resultData){
+ let fileId = this.response.vthResponse.resultData.robotResultFileId;
+ if(fileId){
+ this.fileTransfer.get(fileId, {robot: true}).subscribe(result => {
+ this.reports.log = this.sanitizer.bypassSecurityTrustHtml(result['log.html'] + this.noClick);
+ this.reports.report = this.sanitizer.bypassSecurityTrustHtml(result['report.html'] + this.noClick);
+ this.reports.output = result['output.xml'];
+ });
+ }
+ }
+ }
+
+ }
+
+ refresh(){
+ this.isRefreshed = false;
+ setTimeout(() => {
+ this.isRefreshed = true;
+ }, 500);
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/scheduling/scheduling-routing.module.ts b/otf-frontend/client/src/app/layout/scheduling/scheduling-routing.module.ts
new file mode 100644
index 0000000..7d299e3
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/scheduling/scheduling-routing.module.ts
@@ -0,0 +1,28 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { SchedulingComponent } from './scheduling.component';
+
+const routes: Routes = [{
+ path:'', component: SchedulingComponent}];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class SchedulingRoutingModule { }
diff --git a/otf-frontend/client/src/app/layout/scheduling/scheduling.component.pug b/otf-frontend/client/src/app/layout/scheduling/scheduling.component.pug
new file mode 100644
index 0000000..c70c807
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/scheduling/scheduling.component.pug
@@ -0,0 +1,52 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div([@routerTransition])
+ app-page-header([heading]="'Scheduling'", [icon]="'fa-edit'")
+ .card-mb-12
+ .card-body
+ .row
+ div.col-6
+ input.form-control.bg-light.mb-1( type="text", placeholder="Search...")
+ div.col-6
+ button.pull-right.mb-1(mat-raised-button, color="primary", (click)='createSchedule()') Schedule a Test
+
+ table.mat-elevation-z8.text-center(mat-table, [dataSource]="dataSource", style="width: 100%")
+
+ ng-container(matColumnDef="name")
+ th(mat-header-cell, *matHeaderCellDef) Instance Name
+ td(mat-cell, *matCellDef="let element") {{ element.testInstanceName}}
+
+ ng-container(matColumnDef="description")
+ th(mat-header-cell, *matHeaderCellDef) Date Last Run
+ td(mat-cell, *matCellDef="let element") {{ element.lastRunAt }}
+
+ ng-container(matColumnDef="testDefinition")
+ th(mat-header-cell, *matHeaderCellDef) Date Next Run
+ td(mat-cell, *matCellDef="let element") {{ element.nextRunAt }}
+
+ ng-container(matColumnDef="options")
+ th(mat-header-cell, *matHeaderCellDef) Options
+ td(mat-cell, *matCellDef="let element")
+ button.mr-3(mat-mini-fab, aria-label='View', color="primary", (click)='viewSchedule(element)')
+ i.fa.fa-eye
+ button.text-white(mat-mini-fab, aria-label='Remove', color='warn', (click)='deleteSchedule(element)')
+ i.fa.fa-remove
+
+ tr(mat-header-row, *matHeaderRowDef="displayedColumns")
+ tr(mat-row, *matRowDef="let row; columns: displayedColumns")
+
+ mat-paginator([length]="resultsLength", [pageSizeOptions]="[10, 25, 100]")
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/scheduling/scheduling.component.scss b/otf-frontend/client/src/app/layout/scheduling/scheduling.component.scss
new file mode 100644
index 0000000..b951c73
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/scheduling/scheduling.component.scss
@@ -0,0 +1,34 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.mbtn:focus {
+ outline: none;
+}
+.mat-warn {
+ background-color: red;
+ color:red;
+}
+.bg-accent{
+ background-color: brown
+}
+.mat-mini-fab{
+ width: 30px !important;
+ height: 30px !important;
+ line-height: 10px !important;
+}
+
+
+tr:nth-child(even){background-color: #f2f2f2;}
diff --git a/otf-frontend/client/src/app/layout/scheduling/scheduling.component.spec.ts b/otf-frontend/client/src/app/layout/scheduling/scheduling.component.spec.ts
new file mode 100644
index 0000000..26ecee1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/scheduling/scheduling.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { SchedulingComponent } from './scheduling.component';
+
+describe('SchedulingComponent', () => {
+ let component: SchedulingComponent;
+ let fixture: ComponentFixture<SchedulingComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ SchedulingComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SchedulingComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/scheduling/scheduling.component.ts b/otf-frontend/client/src/app/layout/scheduling/scheduling.component.ts
new file mode 100644
index 0000000..16e9d6f
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/scheduling/scheduling.component.ts
@@ -0,0 +1,154 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, ViewContainerRef, ViewChild } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { routerLeftTransition } from '../../router.animations';
+import { ListService } from '../../shared/services/list.service';
+import { Router } from '@angular/router';
+import { MatDialog, MatTableDataSource, MatPaginator, MatSnackBar } from '@angular/material';
+import { ScheduleTestModalComponent } from '../../shared/modules/schedule-test-modal/schedule-test-modal.component';
+import { SchedulingService } from '../../shared/services/scheduling.service';
+import { TestInstanceService } from '../../shared/services/test-instance.service';
+import { AlertModalComponent } from '../../shared/modules/alert-modal/alert-modal.component';
+import { ViewScheduleModalComponent } from '../../shared/modules/view-schedule-modal/view-schedule-modal.component';
+import { AlertSnackbarComponent } from '../../shared/modules/alert-snackbar/alert-snackbar.component';
+
+@Component({
+ selector: 'app-scheduling',
+ templateUrl: './scheduling.component.pug',
+ styleUrls: ['./scheduling.component.scss'],
+ animations: [routerLeftTransition()]
+})
+
+export class SchedulingComponent implements OnInit {
+
+ constructor(private http: HttpClient,
+ private router: Router,
+ private viewRef: ViewContainerRef,
+ private list: ListService,
+ private schedulingService: SchedulingService,
+ private testInstanceService: TestInstanceService,
+ public dialog: MatDialog,
+ private snack: MatSnackBar
+ ) { }
+
+ public search;
+ public data;
+ public dataSource;
+ public displayedColumns: string[] = ['name', 'description', 'testDefinition', 'options'];
+ public resultsLength;
+ public instances;
+ public temp;
+ public count;
+
+ @ViewChild(MatPaginator) paginator: MatPaginator;
+
+ ngOnInit() {
+ this.search = {};
+ this.search._id = "";
+ this.search.testInstanceName = "";
+ this.instances = [];
+ this.list.createList('schedules');
+ this.temp = {};
+ this.count = 0;
+
+ this.schedulingService.find({$limit: -1, 'data.testSchedule._testInstanceStartDate': { $ne: ['now'] }}).subscribe((list) => {
+
+ for(var i = 0; i < Object.keys(list).length; i++){
+ list[i].nextRunAt = this.convertDate(list[i].nextRunAt);
+ list[i].lastRunAt = this.convertDate(list[i].lastRunAt);
+ }
+ this.list.changeMessage('schedules', list);
+ })
+
+
+ this.dataSource = new MatTableDataSource();
+ this.dataSource.paginator = this.paginator;
+
+ this.list.listMap['schedules'].currentList.subscribe((list) =>{
+ if(list){
+ this.dataSource.data = list;
+ this.resultsLength = list.length;
+
+
+ }
+ });
+ }
+
+ convertDate(str){
+ if(!str){
+ return 'none'
+ }
+ str = str.split('-')
+ let dayAndTime = str[2];
+ let day = dayAndTime.substring(0, dayAndTime.indexOf('T'));
+ let time = dayAndTime.substring(dayAndTime.indexOf('T')+1, dayAndTime.length-5);
+ return str[1] + '/' + day + '/' + str[0] + ' at ' + time + ' UTC';
+ }
+
+ viewSchedule(sched){
+ this.dialog.open(ViewScheduleModalComponent, {
+ width: '450px',
+ data: sched
+ });
+
+ }
+
+ deleteSchedule(sched){
+ const dialogRef = this.dialog.open(AlertModalComponent, {
+ width : '450px',
+ data: {
+ type: 'confirmation',
+ message: 'Are you sure you want to delete you schedule? This action cannot be undone.'
+ }
+ });
+ dialogRef.afterClosed().subscribe(result => {
+ if(result){
+ this.schedulingService.delete(sched._id).subscribe((result) => {
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message:'Test Instance Saved'
+ }
+ });
+ this.list.removeElement('sched', '_id', sched._id + '');
+ this.list.listMap['sched'].currentList.subscribe(x => {
+ this.dataSource = x;
+ });
+
+ })
+ }
+ })
+
+ }
+
+ createSchedule(){
+ const dialogRef = this.dialog.open(ScheduleTestModalComponent, {
+ width: '90%'
+ });
+
+ dialogRef.afterClosed().subscribe(result => {
+ /*if(result != ''){
+ this.test_instance_selected = result;
+ this.strategy_selected = true;
+ }else{
+ this.strategy_selected = false;
+ }*/
+ });
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/scheduling/scheduling.module.spec.ts b/otf-frontend/client/src/app/layout/scheduling/scheduling.module.spec.ts
new file mode 100644
index 0000000..b75cb0e
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/scheduling/scheduling.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { SchedulingModule } from './scheduling.module';
+
+describe('SchedulingModule', () => {
+ let schedulingModule: SchedulingModule;
+
+ beforeEach(() => {
+ schedulingModule = new SchedulingModule();
+ });
+
+ it('should create an instance', () => {
+ expect(schedulingModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/scheduling/scheduling.module.ts b/otf-frontend/client/src/app/layout/scheduling/scheduling.module.ts
new file mode 100644
index 0000000..00f7e12
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/scheduling/scheduling.module.ts
@@ -0,0 +1,52 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { SchedulingRoutingModule } from './scheduling-routing.module'
+import { SchedulingComponent } from './scheduling.component';
+import { PageHeaderModule } from '../../shared/modules';
+import { MatButtonModule, MatIconModule, MatDatepickerModule, MatCheckboxModule, MatTableModule, MatFormFieldModule, MatInputModule, MatPaginatorModule, MatSnackBarModule} from '@angular/material';
+import { FilterPipeModule } from 'ngx-filter-pipe';
+import { ScheduleTestModalModule } from '../../shared/modules/schedule-test-modal/schedule-test-modal.module';
+import { AlertModalModule } from '../../shared/modules/alert-modal/alert-modal.module';
+import { ViewScheduleModalModule } from '../../shared/modules/view-schedule-modal/view-schedule-modal.module';
+
+
+@NgModule({
+ imports: [
+ CommonModule,
+ SchedulingRoutingModule,
+ ViewScheduleModalModule,
+ AlertModalModule,
+ MatTableModule,
+ MatFormFieldModule,
+ MatInputModule,
+ MatPaginatorModule,
+ FilterPipeModule,
+ MatButtonModule,
+ MatCheckboxModule,
+ MatDatepickerModule,
+ MatFormFieldModule,
+ MatIconModule,
+ PageHeaderModule,
+ MatSnackBarModule,
+ ScheduleTestModalModule
+ ],
+ declarations: [SchedulingComponent]
+})
+export class SchedulingModule {
+}
diff --git a/otf-frontend/client/src/app/layout/settings/settings-routing.module.ts b/otf-frontend/client/src/app/layout/settings/settings-routing.module.ts
new file mode 100644
index 0000000..190e894
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/settings/settings-routing.module.ts
@@ -0,0 +1,32 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { SettingsComponent } from './settings.component';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: SettingsComponent
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class SettingsRoutingModule { }
diff --git a/otf-frontend/client/src/app/layout/settings/settings.component.pug b/otf-frontend/client/src/app/layout/settings/settings.component.pug
new file mode 100644
index 0000000..2cd086b
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/settings/settings.component.pug
@@ -0,0 +1,42 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div([@routerTransition])
+ h2 Settings
+ hr
+
+h4(style="padding-top:1em;") Default Group Configuration
+.row
+ .col-sm-5
+ label Enable default group setting?
+.row
+ .col-sm-5
+ mat-radio-group
+ mat-radio-button(value='enable', style="padding-right:5em;", [checked]="defaultGroupEnabled", (click)="enableDefaultGroup()") Enable
+ mat-radio-button(value='disable', [checked]="!defaultGroupEnabled", (click)="disableDefaultGroup()") Disable
+.row
+ .col-sm-5
+ mat-form-field
+ mat-label(style="color:black") {{ defaultGroup?.groupName }}
+ mat-select([disabled]='!defaultGroupEnabled')
+ mat-option(*ngFor="let group of eligibleGroups", (click)='changDefaultGroup(group)') {{group?.groupName}}
+.row
+ .col-sm-5
+ // button for submitting the information in the form
+ button(mat-raised-button='', color='primary', class='pull-right', (click)='update()') Save
+
+hr
+
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/settings/settings.component.scss b/otf-frontend/client/src/app/layout/settings/settings.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/settings/settings.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/layout/settings/settings.component.spec.ts b/otf-frontend/client/src/app/layout/settings/settings.component.spec.ts
new file mode 100644
index 0000000..a86c4e4
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/settings/settings.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { SettingsComponent } from './settings.component';
+
+describe('SettingsComponent', () => {
+ let component: SettingsComponent;
+ let fixture: ComponentFixture<SettingsComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ SettingsComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SettingsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/settings/settings.component.ts b/otf-frontend/client/src/app/layout/settings/settings.component.ts
new file mode 100644
index 0000000..16312b7
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/settings/settings.component.ts
@@ -0,0 +1,103 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit } from '@angular/core';
+import { CookieService } from 'ngx-cookie-service';
+import { UserService } from 'app/shared/services/user.service';
+import { GroupService } from 'app/shared/services/group.service';
+import { routerTransition } from 'app/router.animations';
+import { AlertSnackbarComponent } from 'app/shared/modules/alert-snackbar/alert-snackbar.component';
+import { Group } from 'app/shared/models/group.model';
+import { MatSnackBar } from '@angular/material';
+
+@Component({
+ selector: 'app-settings',
+ templateUrl: './settings.component.pug',
+ styleUrls: ['./settings.component.scss'],
+ animations: [routerTransition()]
+})
+
+export class SettingsComponent implements OnInit {
+ defaultGroupEnabled = false;
+ private defaultGroup;
+ private eligibleGroups;
+ private currentUser;
+ private defaultGroupId;
+
+ constructor(private cookie: CookieService,
+ private user: UserService,
+ private _group: GroupService,
+ private snack: MatSnackBar
+ ) { }
+
+ ngOnInit() {
+
+ this.currentUser = JSON.parse(this.cookie.get('currentUser'));
+
+ this._group.find({ $limit: -1 }).subscribe((result) => {
+ if (result)
+ this.eligibleGroups = result;
+ });
+
+ this.user.get(this.currentUser._id).subscribe((result) => {
+ if (result)
+ this.defaultGroupId = result['defaultGroup'];
+ this.defaultGroupEnabled = result['defaultGroupEnabled'];
+
+ this._group.get(this.defaultGroupId).subscribe((result) => {
+ this.defaultGroup = result;
+ });
+ });
+ }
+
+ changDefaultGroup(group: Group) {
+ this.defaultGroup = group;
+ }
+
+ enableDefaultGroup() {
+ this.defaultGroupEnabled = true;
+ }
+
+ disableDefaultGroup() {
+ this.defaultGroupEnabled = false;
+
+ }
+
+ update() {
+
+ this.currentUser.defaultGroupEnabled = this.defaultGroupEnabled;
+ this.currentUser.defaultGroup = this.defaultGroup;
+ this.cookie.set('currentUser', JSON.stringify(this.currentUser));
+
+
+
+ let userPatch = {
+ _id: this.currentUser._id,
+ defaultGroup: this.defaultGroup._id,
+ defaultGroupEnabled: this.defaultGroupEnabled
+ };
+
+ this.user.patch(userPatch).subscribe((res) => {
+ let snackMessage = 'Successfully Updated Settings';
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: snackMessage
+ }
+ })
+ })
+ }
+}
diff --git a/otf-frontend/client/src/app/layout/settings/settings.module.spec.ts b/otf-frontend/client/src/app/layout/settings/settings.module.spec.ts
new file mode 100644
index 0000000..0d694f4
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/settings/settings.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { SettingsModule } from './settings.module';
+
+describe('SettingsModule', () => {
+ let settingsModule: SettingsModule;
+
+ beforeEach(() => {
+ settingsModule = new SettingsModule();
+ });
+
+ it('should create an instance', () => {
+ expect(settingsModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/settings/settings.module.ts b/otf-frontend/client/src/app/layout/settings/settings.module.ts
new file mode 100644
index 0000000..605aac4
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/settings/settings.module.ts
@@ -0,0 +1,48 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { MatSelectModule } from '@angular/material/select';
+import { MatFormFieldModule } from '@angular/material/form-field';
+import { FormsModule, ReactiveFormsModule} from '@angular/forms';
+import { MatCheckboxModule, MatBadgeModule, MatButtonModule, MatCardModule, MatIconModule, MatInputModule, MatRadioModule, MatSnackBarModule} from '@angular/material';
+
+import { SettingsRoutingModule } from './settings-routing.module';
+import { SettingsComponent } from './settings.component';
+import { AlertSnackbarModule } from 'app/shared/modules/alert-snackbar/alert-snackbar.module';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ SettingsRoutingModule,
+ MatSelectModule,
+ MatButtonModule,
+ FormsModule,
+ ReactiveFormsModule,
+ MatBadgeModule,
+ MatCardModule,
+ MatIconModule,
+ MatInputModule,
+ MatFormFieldModule,
+ MatRadioModule,
+ MatSnackBarModule,
+ AlertSnackbarModule,
+ MatCheckboxModule
+ ],
+ declarations: [SettingsComponent]
+})
+export class SettingsModule { }
diff --git a/otf-frontend/client/src/app/layout/test-definition-expanded-details/test-definition-expanded-details.component.pug b/otf-frontend/client/src/app/layout/test-definition-expanded-details/test-definition-expanded-details.component.pug
new file mode 100644
index 0000000..6b0cc0c
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-definition-expanded-details/test-definition-expanded-details.component.pug
@@ -0,0 +1,63 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+.row.mt-2
+ .col-sm-4(*ngIf="data")
+ h3 {{ data.testName }}
+ p {{ data.testDescription }}
+ p.text-muted Updated At {{ data.updatedAt }}
+ p.text-muted Created At {{ data.createdAt }}
+ .col-sm-8
+ mat-card.mb-4
+ div(mat-card-image, style="padding: 5% 2px; margin:0px; width:100%; position: relative; cursor: pointer", #canvas, (click)="enlargeBpmn()", [attr.id]="'canvas' + testDefinitionId")
+ button(mat-icon-button, color="primary", style="position: absolute; top: 0px; right: 0px; z-index: 100")
+ mat-icon zoom_in
+
+.row(*ngIf="testInstanceList")
+ .col-12
+ table.mat-elevation-z4(mat-table, [dataSource]="testInstanceList", style="width: 100%")
+
+ ng-container(matColumnDef="name")
+ th(mat-header-cell, *matHeaderCellDef) Instances
+ td(mat-cell, *matCellDef="let element")
+ a([routerLink]="['/test-instances', {filter: element._id}]") {{ element.testInstanceName}}
+
+ ng-container(matColumnDef="{{status}}", *ngFor="let status of statusList")
+ th(mat-header-cell, *matHeaderCellDef) # {{status.toLowerCase()}}
+ td(mat-cell, *matCellDef="let element")
+ .dropdown(ngbDropdown, placement="top-right", *ngIf="element[status]")
+ a(ngbDropdownToggle) {{ element[status]}}
+ .dropdown-menu(ngbDropdownMenu, style="max-height: 200px; overflow-y: scroll")
+ div(*ngFor="let execution of testExecutionList | filterBy: {testResult: status}")
+ a.dropdown-item([routerLink]="['/control-panel']", [queryParams]="{id: execution._id}", *ngIf="execution.historicTestInstance._id == element._id" )
+ i.fa.fa-fw.fa-bar-chart(style="color: orange")
+ span.pl-1 {{execution.startTime}}
+
+ ng-container(matColumnDef="options", stickyEnd)
+ th.optionsColumn(mat-header-cell, *matHeaderCellDef)
+ td.optionsColumn(mat-cell, *matCellDef="let element")
+ .dropdown.options(ngbDropdown, placement="left", style="margin-right: -20px")
+ button(mat-icon-button, ngbDropdownToggle)
+ mat-icon more_vert
+ .dropdown-menu(ngbDropdownMenu)
+ a.dropdown-item((click)='executeTestInstance(element)')
+ i.fa.fa-fw.fa-refresh(style="color: green")
+ span.pl-1 Execute
+
+ tr(mat-header-row, *matHeaderRowDef="displayedColumns")
+ tr(mat-row, *matRowDef="let row; columns: displayedColumns")
+
+ mat-paginator([pageSizeOptions]="[5, 10]")
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/test-definition-expanded-details/test-definition-expanded-details.component.scss b/otf-frontend/client/src/app/layout/test-definition-expanded-details/test-definition-expanded-details.component.scss
new file mode 100644
index 0000000..3210c46
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-definition-expanded-details/test-definition-expanded-details.component.scss
@@ -0,0 +1,27 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+mat-paginator {
+ background-color: transparent;
+}
+
+.options .dropdown-toggle::after {
+ display:none;
+}
+
+.optionsColumn {
+ text-align: right;
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/test-definition-expanded-details/test-definition-expanded-details.component.spec.ts b/otf-frontend/client/src/app/layout/test-definition-expanded-details/test-definition-expanded-details.component.spec.ts
new file mode 100644
index 0000000..eb5296c
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-definition-expanded-details/test-definition-expanded-details.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TestDefinitionExpandedDetailsComponent } from './test-definition-expanded-details.component';
+
+describe('TestDefinitionExpandedDetailsComponent', () => {
+ let component: TestDefinitionExpandedDetailsComponent;
+ let fixture: ComponentFixture<TestDefinitionExpandedDetailsComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TestDefinitionExpandedDetailsComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TestDefinitionExpandedDetailsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/test-definition-expanded-details/test-definition-expanded-details.component.ts b/otf-frontend/client/src/app/layout/test-definition-expanded-details/test-definition-expanded-details.component.ts
new file mode 100644
index 0000000..4e2891d
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-definition-expanded-details/test-definition-expanded-details.component.ts
@@ -0,0 +1,216 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Input, ViewChild, HostListener, AfterContentInit, AfterViewInit, ElementRef, OnDestroy } from '@angular/core';
+import { TestDefinitionService } from 'app/shared/services/test-definition.service';
+import { TestInstanceService } from 'app/shared/services/test-instance.service';
+import { MatTableDataSource, MatPaginator, MatDialog, MatSnackBar } from '@angular/material';
+import Modeler from 'bpmn-js';
+import { timeInterval } from 'rxjs/operators';
+import { Observable } from 'rxjs';
+import { TestExecutionService } from 'app/shared/services/test-execution.service';
+import { AlertModalComponent } from 'app/shared/modules/alert-modal/alert-modal.component';
+import { AlertSnackbarComponent } from 'app/shared/modules/alert-snackbar/alert-snackbar.component';
+import { SchedulingService } from 'app/shared/services/scheduling.service';
+import { FileTransferService } from 'app/shared/services/file-transfer.service';
+import { Buffer } from 'buffer';
+import { ViewWorkflowModalComponent } from 'app/shared/modules/view-workflow-modal/view-workflow-modal.component';
+import { ExecuteService } from 'app/shared/services/execute.service';
+import { BpmnFactoryService } from 'app/shared/factories/bpmn-factory.service';
+
+@Component({
+ selector: 'app-test-definition-expanded-details',
+ templateUrl: './test-definition-expanded-details.component.pug',
+ styleUrls: ['./test-definition-expanded-details.component.scss']
+})
+export class TestDefinitionExpandedDetailsComponent implements OnInit, OnDestroy {
+
+ @Input() public testDefinitionId;
+
+ @Input() public events: Observable<void>;
+
+ @ViewChild(MatPaginator) instancePaginator: MatPaginator;
+ @ViewChild('canvas') canvas: ElementRef;
+
+ public data = null;
+ public dataLength = 0;
+ public displayedColumns;
+ public foundStatuses = ['name'];
+ public statusList = ['COMPLETED', 'SUCCESS', 'UNKNOWN', 'FAILURE', 'STOPPED', 'UNAUTHORIZED', 'FAILED'];
+ public testInstanceList = null;
+ public testExecutionList = [];
+ public viewer;
+ public eventSub;
+ public bpmnXml;
+
+ constructor(
+ private bpmnFactory: BpmnFactoryService,
+ private fileTransfer: FileTransferService,
+ private dialog: MatDialog,
+ private testDefinition: TestDefinitionService,
+ private testInstance: TestInstanceService,
+ private testExecution: TestExecutionService,
+ private execute: ExecuteService,
+ private modal: MatDialog,
+ private snack: MatSnackBar
+ ) { }
+
+ async ngOnInit() {
+
+ await this.testDefinition.get(this.testDefinitionId).subscribe(
+ result => {
+ result['createdAt'] = new Date(result['createdAt']).toLocaleString();
+ result['updatedAt'] = new Date(result['updatedAt']).toLocaleString();
+ this.data = result;
+ if(this.data.bpmnInstances){
+ this.bpmnFactory.setup({
+ mode: 'viewer',
+ options: {
+ container: this.canvas.nativeElement
+ },
+ fileId: this.data.bpmnInstances[0].bpmnFileId
+ }).then(res => {
+ this.viewer = res;
+ });
+ // this.loadDiagram();
+ }
+ }
+ );
+
+ this.testInstanceList = new MatTableDataSource();
+ this.testInstance.find({
+ $limit: -1,
+ $sort: {
+ createdAt: -1
+ },
+ testDefinitionId: this.testDefinitionId
+ }).subscribe(
+ result => {
+ this.testInstanceList.data = result;
+ this.testInstanceList.paginator = this.instancePaginator;
+
+ this.testInstanceList.data.forEach(elem => {
+ this.setExecutions(elem._id);
+ });
+
+ this.displayedColumns = ['name', 'COMPLETED', 'SUCCESS', 'UNKNOWN', 'FAILURE', 'STOPPED', 'UNAUTHORIZED', 'FAILED', 'options'];
+
+ }
+ )
+
+ //If parent emeits, diagram will reload
+ if(this.events != undefined && this.events){
+ this.events.subscribe(() => {
+ setTimeout(() => {
+ this.loadDiagram();
+ }, 500)
+ });
+ }
+ }
+
+ enlargeBpmn(){
+ this.dialog.open(ViewWorkflowModalComponent, {
+ data: {
+ xml: this.viewer.getBpmnXml()
+ },
+ width: '100%',
+ height: '100%'
+ })
+ }
+
+ ngOnDestroy() {
+ delete this.events;
+ }
+
+ async setExecutions(instanceId) {
+ // ['$limit=-1', '$sort[startTime]=-1', 'testInstanceId=' + instanceId]
+ this.testExecution.find({
+ $limit: -1,
+ $sort: {
+ startTime: -1
+ },
+ 'historicTestInstance._id': instanceId
+ }).subscribe(
+ result => {
+ for(let i = 0; i < result['length']; i++){
+ result[i].startTime = new Date(result[i].startTime).toLocaleString();
+ this.testExecutionList.push(result[i]);
+ for(let j = 0; j < this.testInstanceList.data.length; j++){
+ if(this.testInstanceList.data[j]._id == instanceId){
+ if(!this.testInstanceList.data[j][result[i]['testResult']]){
+ this.testInstanceList.data[j][result[i]['testResult']] = 1;
+ }else{
+ this.testInstanceList.data[j][result[i]['testResult']] += 1;
+ }
+ }
+ }
+ }
+
+ //this.setDisplayColumns();
+ // for(let i = 0; i < result[i]; i++){
+ // this.testInstanceList[instanceId] = result;
+ // }
+
+ }
+ );
+ }
+
+ loadDiagram(){
+ if(this.viewer && this.data && this.data.bpmnInstances){
+ this.viewer.renderDiagram();
+ }
+ }
+
+ executeTestInstance(element){
+ (element);
+ if(element.testDefinitionId){
+ const executer = this.modal.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: 'confirmation',
+ message: 'Are you sure you want to run ' + element.testInstanceName + '?'
+ }
+ });
+
+ executer.afterClosed().subscribe(result => {
+ if(result){
+ this.execute.create({
+ _id : element._id,
+ async: true
+ }).subscribe((result) => {
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: 'Test Instance Executed'
+ }
+ });
+ },
+ (error) => {
+ this.modal.open(AlertModalComponent, {
+ width: '450px',
+ data: {
+ type: 'Alert',
+ message: 'Failed to execute Test Instance!\n' + JSON.stringify(error)
+ }
+ });
+ })
+ }
+ });
+ }
+
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog-routing.module.ts b/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog-routing.module.ts
new file mode 100644
index 0000000..b19d3f0
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog-routing.module.ts
@@ -0,0 +1,33 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+import {TestExecutionsCatalogComponent} from './test-executions-catalog.component';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: TestExecutionsCatalogComponent
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class TestExecutionsCatalogRoutingModule {
+}
diff --git a/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog.component.pug b/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog.component.pug
new file mode 100644
index 0000000..21663f3
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog.component.pug
@@ -0,0 +1,61 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div([@routerTransition])
+ app-page-header([heading]="'Test Executions'", [icon]="'fa-edit'")
+
+ .card-mb-12
+ .pull-left
+ mat-form-field
+ input(matInput, name="filter", (keyup)="applyFilter($event.target.value)", placeholder="Filter")
+ //.pull-right
+ button(mat-raised-button, color="primary", (click)="createTestInstance()") New
+
+ div(style="width: 100%", [hidden]="!loading")
+ mat-spinner(style="margin: auto", color="primary")
+
+ table.mat-elevation-z8(mat-table, [dataSource]="dataSource", style="width: 100%", [hidden]="loading")
+
+ ng-container(matColumnDef="testInstanceName")
+ th(mat-header-cell, *matHeaderCellDef) Test Instance
+ td(mat-cell, *matCellDef="let element") {{ (element.historicTestInstance) ? element.historicTestInstance.testInstanceName : 'Does Not Exist' }}
+
+ ng-container(matColumnDef="testInstanceDescription")
+ th(mat-header-cell, *matHeaderCellDef) Description
+ td(mat-cell, *matCellDef="let element") {{ (element.testInstanceId) ? element.testInstanceId.testInstanceDescription : ''}}
+
+ ng-container(matColumnDef="result")
+ th(mat-header-cell, *matHeaderCellDef) Result
+ td(mat-cell, *matCellDef="let element") {{ element.testResult}}
+
+ ng-container(matColumnDef="totalTime")
+ th(mat-header-cell, *matHeaderCellDef) Total Time
+ td(mat-cell, *matCellDef="let element") {{ element.totalTime + ' secs' }}
+
+ ng-container(matColumnDef="options")
+ th(mat-header-cell, *matHeaderCellDef) Options
+ td(mat-cell, *matCellDef="let element")
+ button.mr-3(mat-mini-fab, matTooltip="Execution Logs", color="primary", [routerLink]="['/control-panel']", [queryParams]="{id: element._id}")
+ i.fa.fa-bar-chart
+ button.text-white(mat-mini-fab, matTooltip="Delete", color='warn', (click)='deleteTestInstance(element)')
+ i.fa.fa-remove
+
+
+ tr(mat-header-row, *matHeaderRowDef="displayedColumns")
+ tr(mat-row, *matRowDef="let row; columns: displayedColumns")
+
+ mat-paginator([length]="resultsLength", [pageSizeOptions]="[10, 25, 100]", [hidden]="loading")
+
diff --git a/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog.component.scss b/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog.component.scss
new file mode 100644
index 0000000..56e842b
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog.component.scss
@@ -0,0 +1,21 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.mat-mini-fab{
+ width: 30px !important;
+ height: 30px !important;
+ line-height: 10px !important;
+}
diff --git a/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog.component.spec.ts b/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog.component.spec.ts
new file mode 100644
index 0000000..6382ba9
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TestExecutionsCatalogComponent } from './test-executions-catalog.component';
+
+describe('TestExecutionsCatalogComponent', () => {
+ let component: TestExecutionsCatalogComponent;
+ let fixture: ComponentFixture<TestExecutionsCatalogComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TestExecutionsCatalogComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TestExecutionsCatalogComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog.component.ts b/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog.component.ts
new file mode 100644
index 0000000..a054e59
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog.component.ts
@@ -0,0 +1,162 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, ViewChild, ViewContainerRef, OnDestroy } from '@angular/core';
+import { MatPaginator, MatDialog, MatTableDataSource, MatSnackBar } from '@angular/material';
+import { Router } from '@angular/router';
+import { ActivatedRoute } from '@angular/router';
+import { ListService } from 'app/shared/services/list.service';
+import { TestInstanceService } from 'app/shared/services/test-instance.service';
+import { AlertModalComponent } from 'app/shared/modules/alert-modal/alert-modal.component';
+import { TestExecutionService } from 'app/shared/services/test-execution.service';
+import { routerTransition } from 'app/router.animations';
+import { AlertSnackbarComponent } from 'app/shared/modules/alert-snackbar/alert-snackbar.component';
+import { TestDefinitionService } from 'app/shared/services/test-definition.service';
+import { GroupService } from 'app/shared/services/group.service';
+import { Subscription } from 'rxjs';
+
+@Component({
+ selector: 'app-test-executions-catalog',
+ templateUrl: './test-executions-catalog.component.pug',
+ styleUrls: ['./test-executions-catalog.component.scss'],
+ animations: [routerTransition()]
+})
+export class TestExecutionsCatalogComponent implements OnInit, OnDestroy {
+
+ private toDestroy: Array<Subscription> = [];
+ public dataSource;
+ public displayedColumns: string[] = ['testInstanceName', 'testInstanceDescription', 'result', 'totalTime', 'options'];
+ public resultsLength;
+ public loading = false;
+
+ @ViewChild(MatPaginator) paginator: MatPaginator;
+
+ constructor(
+ private list: ListService,
+ private testExecution: TestExecutionService,
+ private modal: MatDialog,
+ private route: ActivatedRoute,
+ private _groups: GroupService,
+ private snack: MatSnackBar
+ ) {
+ }
+
+ ngOnInit() {
+ this.setComponentData(this._groups.getGroup());
+ this.toDestroy.push(this._groups.groupChange().subscribe(group => {
+ this.setComponentData(group);
+ }));
+ }
+
+ ngOnDestroy() {
+ this.toDestroy.forEach(e => e.unsubscribe());
+ }
+
+ setComponentData(group) {
+ if (!group) {
+ return;
+ }
+ this.loading = true;
+
+ this.dataSource = new MatTableDataSource();
+ this.dataSource.paginator = this.paginator;
+
+ //RG: Hard limit returns object, -1 returns array
+ const params = { $limit: 50, groupId: group._id, $populate: ['testInstanceId'], $sort: { startTime: -1 } }//['$limit=-1', '$populate[]=testInstanceId', '$sort[startTime]=-1'];
+ if (this.route.snapshot.params['filter']) {
+ params['testResult'] = this.route.snapshot.params['filter'].toUpperCase();
+ }
+ this.testExecution.find(params).subscribe((response) => {
+
+ let list = response;
+ //RG: check if hard limit if so it will be object w/ prop data
+ if(!Array.isArray(response) && response.hasOwnProperty('data')){
+ list = response['data'];
+ }
+ for (let i = 0; i < list['length']; i++) {
+ const tsDate = new Date(list[i]['startTime']);
+ const teDate = new Date(list[i]['endTime']);
+ list[i]['totalTime'] = (teDate.getTime() - tsDate.getTime()) / 1000;
+ }
+ this.dataSource.data = list;
+ this.resultsLength = this.dataSource.data.length;
+ this.loading = false;
+ });
+
+ }
+
+ applyFilter(filterValue: string) {
+ this.dataSource.filter = filterValue.trim().toLowerCase();
+ }
+
+ createTestInstance() {
+ // const create = this.modal.open(TestDefinition, {
+ // width: '450px',
+ // data: {
+ // goal: 'create'
+ // }
+ // });
+
+ // create.afterClosed().subscribe(result => {
+ // this.list.listMap['vth'].currentList.subscribe(x => {
+ // this.dataSource = x;
+ // });
+ // });
+ }
+
+
+ editTestInstance(th) {
+ // const edit = this.modal.open(TestHeadModalComponent, {
+ // width: '450px',
+ // data: {
+ // goal: 'edit',
+ // testHead: th
+ // }
+ // });
+
+ // edit.afterClosed().subscribe(result => {
+ // console.log(result);
+ // });
+ }
+
+ deleteTestInstance(te) {
+ const deleter = this.modal.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: 'confirmation',
+ message: 'Are you sure you want to delete ' + te.testExecutionName + ' ?'
+ }
+ });
+
+ deleter.afterClosed().subscribe(result => {
+ if (result) {
+ this.testExecution.delete(te._id).subscribe(response => {
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: 'Test Execution Deleted'
+ }
+ });
+ this.list.removeElement('te', '_id', te._id + '');
+ this.list.listMap['te'].currentList.subscribe(x => {
+ this.dataSource.data = x;
+ this.resultsLength = x.length;
+ });
+ });
+ }
+ });
+ }
+}
diff --git a/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog.module.spec.ts b/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog.module.spec.ts
new file mode 100644
index 0000000..e977dad
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {TestExecutionsCatalogModule} from './test-executions-catalog.module';
+
+describe('TestExecutionsCatalogModule', () => {
+ let testExecutionsCatalogModule: TestExecutionsCatalogModule;
+
+ beforeEach(() => {
+ testExecutionsCatalogModule = new TestExecutionsCatalogModule();
+ });
+
+ it('should create an instance', () => {
+ expect(testExecutionsCatalogModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog.module.ts b/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog.module.ts
new file mode 100644
index 0000000..cc2d6cd
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-executions-catalog/test-executions-catalog.module.ts
@@ -0,0 +1,61 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {NgModule} from '@angular/core';
+import {CommonModule} from '@angular/common';
+
+import {TestExecutionsCatalogRoutingModule} from './test-executions-catalog-routing.module';
+import {TestExecutionsCatalogComponent} from './test-executions-catalog.component';
+import {PageHeaderModule} from 'app/shared';
+import {FormsModule} from '@angular/forms';
+import {FilterPipeModule} from 'ngx-filter-pipe';
+import {
+ MatButtonModule,
+ MatFormFieldModule,
+ MatIconModule,
+ MatInputModule,
+ MatPaginatorModule,
+ MatTableModule,
+ MatTooltipModule,
+ MatSnackBarModule,
+ MatProgressSpinnerModule
+} from '@angular/material';
+import {TestHeadModalModule} from 'app/shared/modules/test-head-modal/test-head-modal.module';
+import {AlertModalModule} from 'app/shared/modules/alert-modal/alert-modal.module';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ TestExecutionsCatalogRoutingModule,
+ PageHeaderModule,
+ FormsModule,
+ FilterPipeModule,
+ MatButtonModule,
+ MatTableModule,
+ MatFormFieldModule,
+ MatInputModule,
+ MatPaginatorModule,
+ TestHeadModalModule,
+ AlertModalModule,
+ MatIconModule,
+ MatTooltipModule,
+ MatSnackBarModule,
+ MatProgressSpinnerModule
+ ],
+ declarations: [TestExecutionsCatalogComponent]
+})
+export class TestExecutionsCatalogModule {
+}
diff --git a/otf-frontend/client/src/app/layout/test-instance-expanded-details/test-instance-expanded-details.component.pug b/otf-frontend/client/src/app/layout/test-instance-expanded-details/test-instance-expanded-details.component.pug
new file mode 100644
index 0000000..c9c9575
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-instance-expanded-details/test-instance-expanded-details.component.pug
@@ -0,0 +1,28 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+.col-12(style="background-color: #f5f5f5; padding: 10px")
+ mat-spinner(*ngIf="isLoading", [diameter]="25", style="margin: auto")
+ div(*ngIf="executionList.length > 0")
+ .list-group(*ngFor="let execution of executionList")
+ a.list-group-item.list-group-item-action(style="", [routerLink]="['/control-panel']", [queryParams]="{id: execution._id}")
+ .pull-left
+ i.fa.fa-fw.fa-bar-chart(style="color: orange")
+ | {{execution.startTime}}
+ .pull-right
+ div([attr.class]="execution.testResult + '-dash'") {{execution.testResult}}
+ div(*ngIf="!isLoading && executionList.length == 0", style="text-align:center")
+ p There are no executions for this instance.
diff --git a/otf-frontend/client/src/app/layout/test-instance-expanded-details/test-instance-expanded-details.component.scss b/otf-frontend/client/src/app/layout/test-instance-expanded-details/test-instance-expanded-details.component.scss
new file mode 100644
index 0000000..17106e6
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-instance-expanded-details/test-instance-expanded-details.component.scss
@@ -0,0 +1,39 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.COMPLETED-dash {
+ color: #0d47a1;
+}
+
+.SUCCESS-dash {
+ color: #199700;
+}
+
+.FAILURE-dash {
+ color: #dd2c00;
+}
+
+.STOPPED-dash {
+ color: #ff9100;
+}
+
+.UNAUTHORIZED-dash {
+ color: #000000;
+}
+
+.UNKNOWN-dash {
+ color: grey;
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/test-instance-expanded-details/test-instance-expanded-details.component.spec.ts b/otf-frontend/client/src/app/layout/test-instance-expanded-details/test-instance-expanded-details.component.spec.ts
new file mode 100644
index 0000000..4828eed
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-instance-expanded-details/test-instance-expanded-details.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TestInstanceExpandedDetailsComponent } from './test-instance-expanded-details.component';
+
+describe('TestInstanceExpandedDetailsComponent', () => {
+ let component: TestInstanceExpandedDetailsComponent;
+ let fixture: ComponentFixture<TestInstanceExpandedDetailsComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TestInstanceExpandedDetailsComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TestInstanceExpandedDetailsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/test-instance-expanded-details/test-instance-expanded-details.component.ts b/otf-frontend/client/src/app/layout/test-instance-expanded-details/test-instance-expanded-details.component.ts
new file mode 100644
index 0000000..baf9c40
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-instance-expanded-details/test-instance-expanded-details.component.ts
@@ -0,0 +1,59 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Input } from '@angular/core';
+import { TestExecutionService } from 'app/shared/services/test-execution.service';
+
+@Component({
+ selector: 'app-test-instance-expanded-details',
+ templateUrl: './test-instance-expanded-details.component.pug',
+ styleUrls: ['./test-instance-expanded-details.component.scss']
+})
+export class TestInstanceExpandedDetailsComponent implements OnInit {
+
+ @Input() public testInstanceId;
+ public executionList:any = [];
+ public isLoading = true;
+
+ constructor(private testexecution: TestExecutionService) { }
+
+ ngOnInit() {
+ this.testexecution.find({
+ $limit: 100,
+ $sort: {
+ startTime: -1
+ },
+ $or: [
+ { "historicTestInstance._id": this.testInstanceId},
+ { testInstanceId: this.testInstanceId }
+ ],
+ $select: ['startTime', 'testResult']
+
+ }).subscribe(
+ result => {
+ for(let i = 0; i < result['data']['length']; i++){
+ result['data'][i]['startTime'] = new Date(result['data'][i]['startTime']).toLocaleString();
+ }
+ this.executionList = result['data'];
+ this.isLoading = false;
+ },
+ err => {
+ this.isLoading = false;
+ }
+ );
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog-routing.module.ts b/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog-routing.module.ts
new file mode 100644
index 0000000..69d5e33
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog-routing.module.ts
@@ -0,0 +1,30 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+import {TestInstancesCatalogComponent} from './test-instances-catalog.component';
+
+const routes: Routes = [{
+ path: '', component: TestInstancesCatalogComponent
+}];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class TestInstancesCatalogRoutingModule {
+}
diff --git a/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog.component.pug b/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog.component.pug
new file mode 100644
index 0000000..446c892
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog.component.pug
@@ -0,0 +1,72 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div([@routerTransition]).mb-3
+
+ .row
+ .col
+ app-page-header.pull-left([heading]="'Test Instances'", [icon]="'fa-edit'")
+ button.mr-2.pull-right(mat-raised-button, color="primary", (click)="createTestInstance()") New
+
+
+
+ .row
+ .col.mt-2
+ //- Delete
+ button.mr-2.pull-right(color="primary", matTooltip="Delete Test Instance", mat-icon-button, (click)="deleteMultipleTestInstance()", [disabled]="(!hasSelectedRows)")
+ mat-icon delete_forever
+ //- Clone
+ button.mr-2.pull-right(color="primary", matTooltip="Clone Test Instance", mat-icon-button, (click)="cloneTestInstance()", [disabled]="(!selectedSingleRow)")
+ mat-icon insert_drive_file
+ //- Edit
+ button.mr-2.pull-right(color="primary", matTooltip="Edit Test Instance", mat-icon-button, (click)="editTestInstance()", [disabled]="(!selectedSingleRow)")
+ mat-icon edit
+ //- Execute
+ button.mr-2.pull-right(color="primary", matTooltip="Execute Test Instance", mat-icon-button, (click)="executeMultipleTestInstance()", *ngIf="(selectedUnlockedRows)")
+ mat-icon play_circle_outline
+ //- Schedule
+ button.mr-2.pull-right(color="primary", matTooltip="Schedule Test Instance", mat-icon-button, (click)="schedule()", *ngIf="(selectedUnlockedRows && selectedSingleRow)")
+ mat-icon date_range
+
+
+ .row
+ .col-md
+ ag-grid-angular.ag-theme-material(
+ style="width:100%; height: 600px",
+ [rowData]="rowData",
+ [columnDefs]="columnDefs",
+ rowSelection="multiple",
+ [rowMultiSelectWithClick]="true",
+ (rowSelected)="onRowSelected($event)",
+ (gridReady)="onGridReady($event)",
+ [singleClickEdit]="true",
+ [gridOptions]="gridOptions",
+ (rowDataChanged)="selectActiveInstance($event)"
+ )
+
+ .col-md-3(*ngIf="selectedSingleRow")
+ h1 Executions
+ div(*ngFor = "let ti of rowData")
+ app-test-instance-expanded-details(*ngIf="ti._id == selectedRows[0]._id", [testInstanceId]="selectedRows[0]._id")
+
+
+
+
+
+
+
+
+
diff --git a/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog.component.scss b/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog.component.scss
new file mode 100644
index 0000000..110ce5b
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog.component.scss
@@ -0,0 +1,53 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.mat-mini-fab{
+ width: 30px !important;
+ height: 30px !important;
+ line-height: 10px !important;
+}
+.dropdown-menu{
+ z-index: 10;
+}
+.dropdown-toggle::after {
+ display:none;
+}
+
+tr.example-detail-row {
+ height: 0;
+ }
+
+ tr.example-element-row:not(.example-expanded-row):hover {
+ background: #f5f5f5;
+ cursor: pointer;
+ }
+
+ tr.example-element-row:not(.example-expanded-row):active {
+ background: #efefef;
+ cursor: pointer;
+ }
+
+ .example-element-row td {
+ border-bottom-width: 0;
+ }
+
+ table {
+ width: 100%;
+ }
+
+ .options {
+ flex: 0 0 10px !important;
+ }
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog.component.spec.ts b/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog.component.spec.ts
new file mode 100644
index 0000000..11ccb4e
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog.component.spec.ts
@@ -0,0 +1,46 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {async, ComponentFixture, TestBed} from '@angular/core/testing';
+
+import {TestInstancesCatalogComponent} from './test-instances-catalog.component';
+
+describe('TestInstancesCatalogComponent', () => {
+ let component: TestInstancesCatalogComponent;
+ let fixture: ComponentFixture<TestInstancesCatalogComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [TestInstancesCatalogComponent]
+ }).compileComponents()
+ .then((arg) => {
+ // handle
+ })
+ .catch((err) => {
+ // handle error
+ });
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TestInstancesCatalogComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog.component.ts b/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog.component.ts
new file mode 100644
index 0000000..cb5a6e5
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog.component.ts
@@ -0,0 +1,436 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, ViewChild, ViewContainerRef, AfterViewInit, OnDestroy, ViewChildren, ElementRef, QueryList } from '@angular/core';
+import { MatDialog, MatPaginator, MatSnackBar, MatTableDataSource, MatListItem } from '@angular/material';
+import { ActivatedRoute, Router } from '@angular/router';
+import { ListService } from '../../shared/services/list.service';
+import { AlertModalComponent } from '../../shared/modules/alert-modal/alert-modal.component';
+import { TestInstanceService } from '../../shared/services/test-instance.service';
+import { routerTransition } from 'app/router.animations';
+import { SchedulingService } from '../../shared/services/scheduling.service';
+import { TestInstanceModalComponent } from '../../shared/modules/test-instance-modal/test-instance-modal.component';
+import { AlertSnackbarComponent } from '../../shared/modules/alert-snackbar/alert-snackbar.component';
+import { ScheduleTestModalComponent } from '../../shared/modules/schedule-test-modal/schedule-test-modal.component';
+import { animate, state, style, transition, trigger } from '@angular/animations';
+import { TestDefinitionService } from '../../shared/services/test-definition.service';
+import { Observable, Subscription } from 'rxjs';
+import { ExecuteService } from 'app/shared/services/execute.service';
+import { GroupService } from 'app/shared/services/group.service';
+import { GridOptions } from "ag-grid-community";
+
+
+@Component({
+ selector: 'app-test-instances-catalog',
+ templateUrl: './test-instances-catalog.component.pug',
+ styleUrls: ['./test-instances-catalog.component.scss'],
+ animations: [routerTransition(),
+ trigger('detailExpand', [
+ state('collapsed', style({ height: '0px', minHeight: '0', display: 'none' })),
+ state('expanded', style({ height: '*' })),
+ transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
+ ])
+ ]
+})
+export class TestInstancesCatalogComponent implements OnInit, AfterViewInit, OnDestroy {
+
+
+ public resultsLength;
+ public loading = false;
+
+
+ public columnDefs = [
+ {headerName: '', field: 'disabled', cellRenderer: this.disabledIndicator, width: 100, hide: false, checkboxSelection:true, headerCheckboxSelection: true, headerCheckboxSelectionFilteredOnly: true},
+ {headerName: 'Name', field: 'testInstanceName', sortable: true, filter: true, resizable: true, width: 300},
+ {headerName: 'Description', field: 'testInstanceDescription', sortable: true, filter: true, resizable: true, width: 100},
+ {headerName: 'Id', field: '_id', sortable: true, filter: true, resizable: true, width: 200, editable: true},
+ {headerName: 'Test Definition', field: 'testDefinitionId.testName', sortable: true, filter: true, resizable: true}
+
+ ];
+
+ public selectedRows;
+ public hasSelectedRows;
+ public selectedSingleRow;
+ private gridApi;
+ private gridColumnApi;
+ public selectedUnlockedRows;
+ public rowData;
+
+ public gridOptions: GridOptions;
+
+
+ public params;
+
+ private subscriptions: Subscription[] = [];
+
+ @ViewChild(MatPaginator) paginator: MatPaginator;
+
+ constructor(
+
+ private router: Router,
+ private viewRef: ViewContainerRef,
+ private testInstance: TestInstanceService,
+ private modal: MatDialog,
+ private schedulingService: SchedulingService,
+ private snack: MatSnackBar,
+ private route: ActivatedRoute,
+ private testDefinitionService: TestDefinitionService,
+ private _execute: ExecuteService,
+ private _groups: GroupService
+ ) { }
+
+ ngOnInit() {
+
+ this.setComponentData(this._groups.getGroup());
+
+ this.subscriptions.push(this._groups.groupChange().subscribe(group => {
+ this.setComponentData(group);
+
+ }));
+
+ // this.subscriptions.push(this._groups.groupChange().subscribe( group => {
+ // if(!group["_id"]){
+ // this.setComponentData(this._groups.getGroup());
+ // }
+ // this.setComponentData(group);
+ // }));
+
+
+ this.route.queryParams.subscribe( params => {
+
+ this.params = params;
+
+
+ });
+
+
+ }
+
+ setComponentData(group) {
+
+ if(!group){
+ return;
+ }
+ this.loading = true;
+ let params = {
+ groupId: group['_id'],
+ $limit: -1,
+ $populate: ['testDefinitionId'],
+ $sort: {
+ createdAt: -1
+ },
+ $select: ['testInstanceName', 'testInstanceDescription', 'testDefinitionId.testName', 'disabled']
+ }
+
+ if (this.route.snapshot.params['filter']) {
+ params['_id'] = this.route.snapshot.params['filter'];
+ }
+
+ this.testInstance.find(params).subscribe((list) => {
+ this.resultsLength = list['length'];
+ this.loading = false;
+ this.rowData = list;
+ },
+ err => {
+ console.log(err);
+ });
+
+ }
+
+ ngAfterViewInit() {
+
+ }
+
+ ngOnDestroy() {
+ this.subscriptions.forEach(e => e.unsubscribe());
+ }
+
+
+ schedule() {
+ this.selectedRows = this.gridApi.getSelectedRows().map(({_id, testInstanceName, testDefinitionId}) => ({_id, testInstanceName, testDefinitionId}));
+ console.log("The new element is: "+JSON.stringify(this.selectedRows[0]._id));
+
+ console.log("Here is the selected Row: "+JSON.stringify(this.gridApi.getSelectedRows()[0]));
+ const dialogRef = this.modal.open(ScheduleTestModalComponent, {
+ width: '90%',
+ data: {
+ id: this.selectedRows[0]._id
+ }
+ });
+
+ dialogRef.afterClosed().subscribe(result => {
+ /*if(result != ''){
+ this.test_instance_selected = result;
+ this.strategy_selected = true;
+ }else{
+ this.strategy_selected = false;
+ }*/
+ });
+ }
+
+ executeMultipleTestInstance(){
+ for(let i = 0; i < this.gridApi.getSelectedNodes().length; i++){
+ this.executeTestInstance(i);
+ }
+ }
+
+ executeTestInstance(ti) {
+
+ this.selectedRows = this.gridApi.getSelectedRows().map(({_id, testInstanceName, testDefinitionId}) => ({_id, testInstanceName, testDefinitionId}));
+
+
+ if (this.selectedRows[ti].testDefinitionId) {
+ const executer = this.modal.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: 'confirmation',
+ message: 'Are you sure you want to run ' + this.selectedRows[ti].testInstanceName + '?'
+ }
+ });
+
+ executer.afterClosed().subscribe(result => {
+ if (result) {
+ this._execute.create({
+ _id: this.selectedRows[ti]._id,
+ async: true
+ }).subscribe((result) => {
+ console.log(result);
+ if (result) {
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: 'Test Instance Executed'
+ }
+ });
+ }
+ },
+ (error) => {
+ console.log(error);
+ this.modal.open(AlertModalComponent, {
+ width: '450px',
+ data: {
+ type: 'Alert',
+ message: 'Failed to execute Test Instance!\n' + JSON.stringify(error)
+ }
+ });
+ })
+ }
+ });
+ }
+
+ }
+
+ createTestInstance() {
+ const create = this.modal.open(TestInstanceModalComponent, {
+ width: '90%',
+ data: null,
+ disableClose: true
+ });
+
+ create.afterClosed().subscribe(result => {
+ this.ngOnInit();
+ });
+ }
+
+
+ editTestInstance() {
+ this.selectedRows = this.gridApi.getSelectedRows().map(({_id, testInstanceName}) => ({_id, testInstanceName}));
+
+ const edit = this.modal.open(TestInstanceModalComponent, {
+ data: {
+ ti: this.selectedRows[0]._id,
+ isEdit: true
+ },
+ width: '90%',
+ disableClose: true
+ });
+
+ edit.afterClosed().subscribe(result => {
+
+ });
+ }
+
+ cloneTestInstance() {
+ this.selectedRows = this.gridApi.getSelectedRows().map(({_id, testInstanceName}) => ({_id, testInstanceName}));
+ this.testInstance.get(this.selectedRows[0]._id).subscribe(
+ result => {
+ var temp = Object.assign({}, result);
+ delete result['_id'];
+ delete result['createdAt'];
+ delete result['updatedAt'];
+ if (this.selectedRows[0].testInstanceName) {
+ result['testInstanceName'] = this.selectedRows[0].testInstanceName + '_Clone';
+ } else {
+ result['testInstanceName'] = result['testInstanceName'] + '_Clone';
+ }
+ this.testInstance.create(result).subscribe(
+ resp => {
+ //this.editTestInstance(resp);
+ this.editTestInstance();
+ },
+ err => {
+ if (err) {
+
+ result['_id'] = temp['_id'];
+
+ //this.cloneTestInstance(result);
+ }
+ }
+ );
+ }
+ )
+ }
+
+ deleteMultipleTestInstance(){
+ for(let i = 0; i < this.gridApi.getSelectedNodes().length; i++){
+ this.deleteTestInstance(i);
+ }
+ }
+
+ deleteTestInstance(ti) {
+ this.selectedRows = this.gridApi.getSelectedRows().map(({_id, testInstanceName}) => ({_id, testInstanceName}));
+
+
+ const deleter = this.modal.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: 'confirmation',
+ message: 'Are you sure you want to delete ' + this.selectedRows[ti].testInstanceName + ' ? Executions of this instance will no longer display everything.'
+ }
+ });
+
+ deleter.afterClosed().subscribe(result => {
+ if (result) {
+ this.testInstance.delete(this.selectedRows[ti]._id).subscribe(response => {
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: 'Test Instance Deleted'
+ }
+ });
+
+ });
+ this.setComponentData(this._groups.getGroup());
+ }
+ });
+
+ }
+
+
+ disabledIndicator(params){
+ if (params.value){
+ return `<mat-icon class="mat-icon mat-icon-no-color" role="img" >
+ locked</mat-icon>`;
+ }
+
+
+ }
+
+ setParams(element) {
+
+ if (JSON.stringify(element) == JSON.stringify({testInstanceId: this.params.testInstanceId})){
+ element = {};
+ }
+
+
+ this.router.navigate([], {
+ //queryParams: {testInstanceId: element.testInstanceId, page: this.paginator.pageIndex, instancePerPage: this.paginator.pageSize }
+ queryParams: {testInstanceId: element._id}
+ })
+
+ }
+
+ onGridReady(params){
+ this.gridApi = params.api;
+ console.log(params.columnApi.autoSizeColumns)
+ this.gridColumnApi = params.columnApi;
+
+ //auto size the column widths
+ this.gridColumnApi.autoSizeColumns(['name']);
+
+ }
+
+ selectActiveInstance($event){
+ if(this.params.testInstanceId)
+ {
+ this.gridApi.forEachNode( (node, index) => {
+
+ if(node.data._id ==this.params.testInstanceId)
+ {
+ // Pre selects the row that was last selected when on the page
+ node.setSelected(true, true);
+ //Vertically scrolls to that row so it is visible
+ this.gridApi.ensureIndexVisible(index, "middle");
+
+ }
+
+ });
+ }
+
+ }
+
+
+ onRowSelected(event){
+
+ this.selectedRows = this.gridApi.getSelectedRows().map(({ _id, disabled, testInstanceName }) => ({ _id, disabled, testInstanceName}));
+
+
+
+ if(event.api.getSelectedNodes().length > 0){
+ this.hasSelectedRows = true;
+
+ //Checks for all Unlocked rows
+ for (let i = 0; i < event.api.getSelectedNodes().length; i++ )
+ {
+ if(!this.selectedRows[i].disabled)
+ {
+ this.selectedUnlockedRows = true;
+ }
+ else{
+ this.selectedUnlockedRows = false;
+ break;
+ }
+ }
+ }
+ else{
+ this.hasSelectedRows = false;
+ this.selectedUnlockedRows = false;
+
+ this.setParams({_id: null});
+ }
+
+
+ //One Row was selected
+ if((event.api.getSelectedNodes().length == 1)){
+ this.selectedSingleRow = true;
+
+ this.setParams({_id: this.selectedRows[0]._id});
+
+ }else{
+ this.selectedSingleRow = false;
+ this.setParams({_id: null});
+ }
+
+ }
+
+
+
+
+
+
+
+
+}
diff --git a/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog.module.spec.ts b/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog.module.spec.ts
new file mode 100644
index 0000000..5823da5
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {TestInstancesCatalogModule} from './test-instances-catalog.module';
+
+describe('TestInstancesCatalogModule', () => {
+ let testInstancesCatalogModule: TestInstancesCatalogModule;
+
+ beforeEach(() => {
+ testInstancesCatalogModule = new TestInstancesCatalogModule();
+ });
+
+ it('should create an instance', () => {
+ expect(testInstancesCatalogModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog.module.ts b/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog.module.ts
new file mode 100644
index 0000000..6d85016
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/test-instances-catalog/test-instances-catalog.module.ts
@@ -0,0 +1,65 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {NgModule} from '@angular/core';
+import {CommonModule} from '@angular/common';
+import {TestInstancesCatalogRoutingModule} from './test-instances-catalog-routing.module';
+import {TestInstancesCatalogComponent} from './test-instances-catalog.component';
+import {AlertModalModule} from '../../shared/modules/alert-modal/alert-modal.module';
+import {PageHeaderModule} from '../../shared';
+import {FormsModule} from '@angular/forms';
+import {FilterPipeModule} from 'ngx-filter-pipe';
+import {MatButtonModule, MatFormFieldModule, MatInputModule, MatPaginatorModule, MatTableModule, MatSnackBarModule, MatTooltipModule, MatIconModule} from '@angular/material';
+import {TestHeadModalModule} from '../../shared/modules/test-head-modal/test-head-modal.module';
+import { AlertSnackbarModule } from 'app/shared/modules/alert-snackbar/alert-snackbar.module';
+import {TestInstanceModalModule} from '../../shared/modules/test-instance-modal/test-instance-modal.module';
+import { ScheduleTestModalModule } from '../../shared/modules/schedule-test-modal/schedule-test-modal.module';
+import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
+import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
+import { TestInstanceExpandedDetailsComponent } from 'app/layout/test-instance-expanded-details/test-instance-expanded-details.component';
+import { AgGridModule } from 'ag-grid-angular';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ TestInstancesCatalogRoutingModule,
+ PageHeaderModule,
+ ScheduleTestModalModule,
+ FormsModule,
+ FilterPipeModule,
+ MatButtonModule,
+ MatTableModule,
+ MatFormFieldModule,
+ MatInputModule,
+ MatPaginatorModule,
+ TestHeadModalModule,
+ MatSnackBarModule,
+ AlertModalModule,
+ MatSnackBarModule,
+ AlertSnackbarModule,
+ TestInstanceModalModule,
+ MatTooltipModule,
+ MatIconModule,
+ NgbModule,
+ MatProgressSpinnerModule,
+ AgGridModule.withComponents([])
+ ],
+ declarations: [TestInstancesCatalogComponent,
+ TestInstanceExpandedDetailsComponent],
+ entryComponents: [TestInstanceExpandedDetailsComponent]
+})
+export class TestInstancesCatalogModule {
+}
diff --git a/otf-frontend/client/src/app/layout/tests/test-definition-details/test-definition-details.component.pug b/otf-frontend/client/src/app/layout/tests/test-definition-details/test-definition-details.component.pug
new file mode 100644
index 0000000..87d49a5
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/tests/test-definition-details/test-definition-details.component.pug
@@ -0,0 +1,64 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+mat-card.mb-3
+ mat-card-header
+ mat-card-title
+ h4(*ngIf="testDefinition?.testName") {{ testDefinition.testName }}
+ mat-card-subtitle(style="margin-bottom: 0px")
+ div(*ngIf="testDefinition?.testDescription") {{testDefinition.testDescription }}
+ mat-card-content
+ .row(*ngIf="testDefinition")
+ .col-sm
+ mat-form-field(*ngIf="testDefinition?.processDefinitionKey")
+ input(matInput, placeholder="Process Definition Key", type="text", [value]="testDefinition.processDefinitionKey", disabled, name="defKey")
+ .col-sm
+ mat-form-field(*ngIf="testDefinition?.disabled != undefined")
+ input(matInput, placeholder="Is Disabled", type="text", [value]="testDefinition.disabled", disabled, name="disabled")
+ .col-sm
+ mat-form-field(*ngIf="testDefinition")
+ input(matInput, placeholder="Number Of Versions", type="text", [value]="numOfVersions", disabled, name="numOfVersions")
+ .col-sm
+ mat-form-field(*ngIf="testDefinition?.groupId")
+ input(matInput, placeholder="Group Id", type="text", [value]="testDefinition.groupId", disabled, name="group")
+ //- .col-sm
+ //- mat-form-field(style="width:50px",*ngIf="testDefinition?.isPublic")
+ //- input(matInput, placeholder="Is Public", type="text", [value]="testDefinition.isPublic", disabled, name="public")
+
+div(style="position: relative")
+ .row
+ .col-12
+ .pull-left
+ mat-form-field(style="width:110px")
+ input(matInput, [matDatepicker]="fromPicker", placeholder="From Date", [(ngModel)]="stats.filters.startDate")
+ mat-datepicker-toggle(matSuffix, [for]="fromPicker")
+ mat-datepicker(#fromPicker)
+ mat-form-field.ml-2(style="width:110px")
+ input(matInput, [matDatepicker]="toPicker", placeholder="To Date", [(ngModel)]="stats.filters.endDate")
+ mat-datepicker-toggle(matSuffix, [for]="toPicker")
+ mat-datepicker(#toPicker)
+ button.ml-2(mat-icon-button, (click)="getData()")
+ mat-icon arrow_forward
+
+ .pull-right
+ mat-form-field
+ input(matInput, [ngModel]="stats.executionList?.length", placeholder="Total Executions", disabled)
+
+ .row
+ .col-12
+ mat-card
+ mat-card-content
+ app-line-chart(height="201px")
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/tests/test-definition-details/test-definition-details.component.scss b/otf-frontend/client/src/app/layout/tests/test-definition-details/test-definition-details.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/tests/test-definition-details/test-definition-details.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/layout/tests/test-definition-details/test-definition-details.component.spec.ts b/otf-frontend/client/src/app/layout/tests/test-definition-details/test-definition-details.component.spec.ts
new file mode 100644
index 0000000..24aaec8
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/tests/test-definition-details/test-definition-details.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TestDefinitionDetailsComponent } from './test-definition-details.component';
+
+describe('TestDefinitionDetailsComponent', () => {
+ let component: TestDefinitionDetailsComponent;
+ let fixture: ComponentFixture<TestDefinitionDetailsComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TestDefinitionDetailsComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TestDefinitionDetailsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/tests/test-definition-details/test-definition-details.component.ts b/otf-frontend/client/src/app/layout/tests/test-definition-details/test-definition-details.component.ts
new file mode 100644
index 0000000..660fa62
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/tests/test-definition-details/test-definition-details.component.ts
@@ -0,0 +1,107 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, OnDestroy } from '@angular/core';
+import { ActivatedRoute } from '@angular/router';
+import { Subscription } from 'rxjs';
+import { TestDefinitionService } from 'app/shared/services/test-definition.service';
+import { TestDefinition } from 'app/shared/models/test-definition.model';
+import { StatsService } from 'app/layout/components/stats/stats.service';
+
+@Component({
+ selector: 'app-test-definition-details',
+ templateUrl: './test-definition-details.component.pug',
+ styleUrls: ['./test-definition-details.component.scss']
+})
+export class TestDefinitionDetailsComponent implements OnInit, OnDestroy {
+
+ private toDestroy: Array<Subscription> = [];
+
+ public testDefinition: TestDefinition;
+
+ constructor(
+ private route: ActivatedRoute,
+ private _testDefinition: TestDefinitionService,
+ public stats: StatsService
+ ) { }
+
+ ngOnInit() {
+ this.toDestroy.push(this.route.params.subscribe(params => {
+
+ if(params.id){
+ this._testDefinition.get(params.id).subscribe(
+ res => {
+
+ this.testDefinition = res as TestDefinition;
+ },
+ err => {
+
+ })
+
+ this.getData(params.id);
+ }
+ }));
+ }
+
+ get numOfVersions(){
+ if(this.testDefinition['bpmnInstances']){
+ return this.testDefinition['bpmnInstances'].length;
+ }
+ return 0;
+ }
+
+ ngOnDestroy() {
+ this.toDestroy.forEach(elem => elem.unsubscribe());
+ }
+
+ getData(testDefinitionId?){
+ if(!testDefinitionId){
+ testDefinitionId = this.testDefinition._id
+ }
+
+ if(!testDefinitionId){
+ return;
+ }
+
+ this.stats.getDefaultData(1, {
+ 'historicTestDefinition._id': testDefinitionId,
+ $select: [
+ 'startTime',
+ 'endTime',
+ "historicTestDefinition._id",
+ "historicTestDefinition.testName",
+ "historicTestInstance._id",
+ "historicTestInstance.testInstanceName",
+ "testHeadResults.startTime",
+ "testHeadResults.endTime",
+ "testHeadResults.testHeadName",
+ "testHeadResults.testHeadId",
+ "testHeadResults.testHeadGroupId",
+ "testHeadResults.statusCode",
+ 'testResult'
+ ],
+ $limit: -1,
+ $sort: {
+ startTime: 1
+ },
+ startTime: {
+ $gte: this.stats.filters.startDate,
+ $lte: this.stats.filters.endDate
+ }
+ });
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/tests/tests-routing.module.ts b/otf-frontend/client/src/app/layout/tests/tests-routing.module.ts
new file mode 100644
index 0000000..e434133
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/tests/tests-routing.module.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { TestsComponent } from './tests.component';
+import { TestDefinitionDetailsComponent } from './test-definition-details/test-definition-details.component';
+
+const routes: Routes = [
+ { path:'', component: TestsComponent },
+ { path:':id', component: TestDefinitionDetailsComponent}
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class TestsRoutingModule { }
diff --git a/otf-frontend/client/src/app/layout/tests/tests.component.pug b/otf-frontend/client/src/app/layout/tests/tests.component.pug
new file mode 100644
index 0000000..a8fc774
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/tests/tests.component.pug
@@ -0,0 +1,180 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div([@routerTransition])
+
+ .row
+ .col
+ .pull-left
+ app-page-header([heading]="'Test Definitions'", [icon]="'fa-edit'")
+ .pull-right
+ button(mat-raised-button, color="primary", (click)="create()") New
+ //-.card-mb-12
+ .pull-left
+ mat-form-field
+ input(matInput, name="filter", (keyup)="applyFilter($event.target.value)", placeholder="Filter")
+ .pull-right
+ button(mat-raised-button, color="primary", (click)="create()") New
+
+ div(style="width: 100%", [hidden]="!loading")
+ mat-spinner(style="margin: auto", color="primary")
+ //-
+ table.mat-elevation-z8(mat-table, *ngIf="dataSource && dataSource.data && dataSource.data.length > 0", [dataSource]="dataSource", style="width: 100%", [hidden]="loading")
+
+ ng-container(matColumnDef="lock")
+ th(mat-header-cell, *matHeaderCellDef)
+ td(mat-cell, *matCellDef="let element", (click)="expand(element)")
+ div.mr-4
+ i.fa.fa-lock(*ngIf="element.disabled")
+
+ ng-container(matColumnDef="name")
+ th(mat-header-cell, *matHeaderCellDef) Name
+ td(mat-cell, *matCellDef="let element", (dblclick)="navToDefinition(element._id)") {{ element.testName }}
+
+ ng-container(matColumnDef="description")
+ th(mat-header-cell, *matHeaderCellDef) Description
+ td(mat-cell, *matCellDef="let element", (dblclick)="navToDefinition(element._id)") {{ element.testDescription }}
+
+ ng-container(matColumnDef="id")
+ th(mat-header-cell, *matHeaderCellDef) Id
+ td(mat-cell, *matCellDef="let element", (dblclick)="navToDefinition(element._id)") {{ element._id }}
+
+ ng-container(matColumnDef="processDefinitionKey")
+ th(mat-header-cell, *matHeaderCellDef) Process Definition Key
+ td(mat-cell, *matCellDef="let element", (dblclick)="navToDefinition(element._id)") {{ element.processDefinitionKey }}
+
+ ng-container(matColumnDef="options")
+ th(mat-header-cell, *matHeaderCellDef) Options
+ td(mat-cell, *matCellDef="let element")
+ .dropdown(ngbDropdown, placement="bottom-right")
+ button(mat-mini-fab, color="primary", ngbDropdownToggle)
+ i.fa.fa-caret-down
+ //mat-icon more_vert
+ .dropdown-menu(ngbDropdownMenu)
+ a.dropdown-item(*ngIf="isDeployed(element) && !element.disabled", (click)='createInstance(element)')
+ i.fa.fa-fw.fa-plus(style="color: #005000")
+ span.pl-1 Create Instance
+ //- a.dropdown-item((click)='view(element)')
+ //- i.fa.fa-fw.fa-eye(style="color: #ff9100")
+ //- span.pl-1 View
+ a.dropdown-item(*ngIf="element.disabled", (click)='unlock(element)')
+ i.fa.fa-fw.far.fa-unlock(style="color: black")
+ span.pl-1 Unlock
+ a.dropdown-item(*ngIf="!element.disabled", (click)='lock(element)')
+ i.fa.fa-fw.far.fa-lock(style="color: black")
+ span.pl-1 Lock
+ a.dropdown-item(*ngIf="favorites.indexOf(element._id) < 0", (click)='favorite(element)')
+ i.fa.fa-fw.far.fa-star(style="color: yellow")
+ span.pl-1 Favorite
+ a.dropdown-item(*ngIf="favorites.indexOf(element._id) >= 0", (click)='unfavorite(element)')
+ i.fa.fa-fw.fas.fa-star(style="color: yellow")
+ span.pl-1 Unfavorite
+ a.dropdown-item((click)='edit(element)')
+ i.fa.fa-fw.fa-pencil(style="color: #0d47a1")
+ span.pl-1 Edit
+ a.dropdown-item([routerLink]="['/modeler']", [queryParams]="{testDefinitionId: element._id}")
+ i.fa.fa-fw.bpmn-icon-bpmn-io(style="color: green")
+ span.pl-1 Modeler
+ a.dropdown-item((click)='delete(element)')
+ i.fa.fa-fw.fa-remove(style="color: #dd2c00")
+ span.pl-1 Delete
+ //- button.mr-3(mat-mini-fab, matTooltip="View Workflow", color="accent", (click)='view(element)')
+ //- i.fa.fa-eye
+ //- button.mr-3(mat-mini-fab, matTooltip="Edit", color="primary", (click)='edit(element)')
+ //- i.fa.fa-pencil
+ //- button.text-white(mat-mini-fab, matTooltip="Delete", color='warn', (click)='delete(element)')
+ //- i.fa.fa-remove
+
+ tr(mat-header-row, *matHeaderRowDef="displayedColumns")
+ tr(mat-row, *matRowDef="let row; columns: displayedColumns")
+
+ //-mat-paginator([length]="resultsLength", [pageSizeOptions]="[10, 25, 100]", [hidden]="loading")
+
+
+
+ .row.mt-2
+ .col
+
+ //- Create
+ button.mr-2.pull-right(color="primary", matTooltip="Create Test Instance", mat-icon-button, (click)="createInstance()", [disabled] = "((!selectedSingleRow) || (selectedLockedRows))")
+ mat-icon add
+ //- Lock
+ button.mr-4.pull-right(color="primary", matTooltip="Lock Test Definition", mat-icon-button, (click)="lockMultiple()", [disabled]="(!hasSelectedRows)", [hidden]="(!selectedUnlockedRows)")
+ mat-icon lock
+ //- Unlock
+ button.mr-2.pull-right(color="primary", matTooltip="Unlock Test Definition", mat-icon-button, (click)="unlockMultiple()", [disabled]="", [hidden] = "((!selectedLockedRows) || (!selectedRows))")
+ mat-icon lock_open
+
+ //- Edit
+ button.mr-2.pull-right(color="primary", matTooltip="Edit Test Definition", mat-icon-button, (click)="edit()", [disabled]="(!selectedSingleRow)")
+ mat-icon edit
+ //- Delete
+ button.mr-2.pull-right(color="primary", matTooltip="Delete Test Definition", mat-icon-button, (click)="deleteMultiple()", [disabled]="!hasSelectedRows")
+ mat-icon delete_forever
+ //- Modeler
+ button.mr-2.pull-right(mat-raised-button, color="primary", (click)="testDefinitionModeler()", [disabled]="(!selectedSingleRow)") Modeler
+
+ //-div(style="width: 100%", [hidden]="!loading") **Took this out because it would load quicker
+ mat-spinner(style="margin: auto", color="primary")
+
+ //- div(style="width: 100%;height: 40px;")
+
+ .row
+ .col
+ ag-grid-angular.ag-theme-material(
+ style="width:100%; height: 600px",
+ [rowData]="rowData",
+ [columnDefs]="columns",
+ rowSelection="multiple",
+ [rowMultiSelectWithClick]="true",
+ (rowSelected)="onRowSelected($event)",
+ (gridReady)="onGridReady($event)",
+ [enableCellChangeFlash]="true",
+ (cellDoubleClicked)="navToDefinition($event)",
+ [singleClickEdit]="true"
+ )
+
+
+
+
+ //.card-body
+ .row
+ div.col-6
+ input.form-control.bg-light.mb-1([(ngModel)]="search.test_head_id", type="text", placeholder="Search...")
+ div.col-6
+ button.bg-primary.mbtn.pull-right.text-white.mb-1(mat-raised-button, (click)='createTestHead()') Create VTH
+ table.table.table-striped([mfData]='data', #mf='mfDataTable', [mfRowsOnPage]='5')
+ thead
+ tr
+ th(style='width: 20%')
+ mfDefaultSorter(by='name') Name
+ th(style='width: 50%')
+ mfDefaultSorter(by='creator') Creator
+ th(style='width: 10%')
+ mfDefaultSorter(by='date') Date
+ th(style='width: 20%') Options
+ tbody
+ tr
+ td Ping Test Head
+ td Tiffany, Patrick
+ td 7/21/18
+ td
+ button.bg-primary.mbtn.text-white.mr-1(mat-mini-fab, aria-label='View', (click)='viewTestHead(null)')
+ i.fa.fa-eye
+ button.bg-primary.mbtn.text-white.mr-1(mat-mini-fab, aria-label='Edit', (click)='editTestHead()')
+ i.fa.fa-pencil
+ button.mbtn.text-white(mat-mini-fab, aria-label='Remove', color='warn', (click)='deleteTestHead()')
+ i.fa.fa-remove
diff --git a/otf-frontend/client/src/app/layout/tests/tests.component.scss b/otf-frontend/client/src/app/layout/tests/tests.component.scss
new file mode 100644
index 0000000..fa45135
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/tests/tests.component.scss
@@ -0,0 +1,34 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.mbtn:focus {
+ outline: none;
+}
+.mat-warn {
+ background-color: red;
+ color:red;
+}
+.bg-accent{
+ background-color: brown
+}
+.mat-mini-fab{
+ width: 30px !important;
+ height: 30px !important;
+ line-height: 10px !important;
+}
+.dropdown-toggle::after {
+ display:none;
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/tests/tests.component.spec.ts b/otf-frontend/client/src/app/layout/tests/tests.component.spec.ts
new file mode 100644
index 0000000..9ca1b08
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/tests/tests.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TestsComponent } from './tests.component';
+
+describe('TestsComponent', () => {
+ let component: TestsComponent;
+ let fixture: ComponentFixture<TestsComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TestsComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TestsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/tests/tests.component.ts b/otf-frontend/client/src/app/layout/tests/tests.component.ts
new file mode 100644
index 0000000..6b0019e
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/tests/tests.component.ts
@@ -0,0 +1,535 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, ViewContainerRef, ViewChild, AfterContentInit, OnDestroy } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { routerTransition } from '../../router.animations';
+import { ListService } from '../../shared/services/list.service';
+import { Router } from '@angular/router';
+import { TestDefinitionService } from '../../shared/services/test-definition.service';
+import { TestInstanceService } from '../../shared/services/test-instance.service';
+import { MatTableDataSource } from '@angular/material/table';
+import { MatPaginator, MatDialog, MatSnackBar } from '@angular/material';
+import { AlertModalComponent } from '../../shared/modules/alert-modal/alert-modal.component';
+import { CreateTestComponent } from '../onboarding/create-test/create-test.component';
+import { TestDefinitionModalComponent } from 'app/shared/modules/test-definition-modal/test-definition-modal.component';
+import { ViewWorkflowModalComponent } from 'app/shared/modules/view-workflow-modal/view-workflow-modal.component';
+import { AlertSnackbarComponent } from 'app/shared/modules/alert-snackbar/alert-snackbar.component';
+import { TestInstanceModalComponent } from '../../shared/modules/test-instance-modal/test-instance-modal.component';
+import { UserService } from 'app/shared/services/user.service';
+import { CookieService } from "ngx-cookie-service";
+import { GroupService } from 'app/shared/services/group.service';
+import { appInitializerFactory } from '@angular/platform-browser/src/browser/server-transition';
+import { element } from '@angular/core/src/render3/instructions';
+import { GridOptionsWrapper, RowNode, initialiseAgGridWithAngular1 } from 'ag-grid-community';
+import { every } from 'rxjs/operators';
+import { Subscription } from 'rxjs';
+
+@Component({
+ selector: 'app-tests',
+ templateUrl: './tests.component.pug',
+ styleUrls: ['./tests.component.scss'],
+ animations: [routerTransition()]
+})
+export class TestsComponent implements OnInit, OnDestroy {
+
+ private toDestroy: Array<Subscription> = [];
+
+ public dataSource;
+ public displayedColumns: string[] = ['lock', 'name', 'description', 'id', 'processDefinitionKey', 'options'];
+ public resultsLength;
+ public loading = false;
+
+
+ public columns = [
+
+ {headerName: 'Name', field: 'testName', sortable: true, filter: true, resizable: true, checkboxSelection:true, headerCheckboxSelection: true, headerCheckboxSelectionFilteredOnly: true, width: 300},
+ {headerName: 'Description', field: 'testDescription', sortable: true, filter: true, resizable: true},
+ {headerName: 'Id', field: '_id', sortable: true, filter: true, resizable: true, editable: true},
+ {headerName: 'Process Definition key', field: 'processDefinitionKey', sortable: true, filter: true, resizable: true},
+ {headerName: '', field: 'disabled', cellRenderer: this.disabledIndicator, hide: false, width: 80}
+
+ ];
+ public rowData;
+
+ /*
+ public rowData = [
+ { _id: '5cfe7e5d6f4e5d0040a3b235', testDescription: 'For testing', testName: "testflow", processDefinitionKey: "demo"},
+ { make: 'Ford', model: 'Mondeo', price: 32000 },
+ { make: 'Porsche', model: 'Boxter', price: 72000 }
+]; */
+
+ public hasSelectedRows = false;
+ public selectedSingleRow = false;
+ public selectedUnlockedRows = true;
+ public selectedLockedRows = false;
+
+ private gridApi;
+ private gridColumnApi;
+ private selectedRows = {};
+
+ @ViewChild(MatPaginator) paginator: MatPaginator;
+
+ constructor(private http: HttpClient,
+ private router: Router,
+ private viewRef: ViewContainerRef,
+ private testDefinition: TestDefinitionService,
+ private modal: MatDialog,
+ private snack: MatSnackBar,
+ private user: UserService,
+ private testInstanceService: TestInstanceService,
+ private cookie: CookieService,
+ private _groups: GroupService
+ ) { }
+
+ ngOnInit() {
+
+ this.setComponentData(this._groups.getGroup());
+ this.toDestroy.push(this._groups.groupChange().subscribe(group => {
+ this.setComponentData(group);
+ }));
+
+
+ }
+
+ ngOnDestroy() {
+ this.toDestroy.forEach(elem => elem.unsubscribe());
+ }
+
+ setComponentData(group) {
+
+ if(!group){
+ return;
+ }
+
+ this.loading = true;
+
+ this.dataSource = new MatTableDataSource();
+ this.dataSource.paginator = this.paginator;
+
+
+
+ this.testDefinition.find({
+ $limit: -1,
+ groupId: group['_id'],
+ $sort: {
+ createdAt: -1
+ },
+ $select: ['testName', 'testDescription', 'processDefinitionKey', 'bpmnInstances.isDeployed', 'disabled', 'groupId']
+ }).subscribe((list) => {
+ this.dataSource.data = list;
+ this.resultsLength = this.dataSource.data.length;
+ this.loading = false;
+ // Getting row data filled with list
+ this.rowData = list;
+
+
+
+ //console.log("This is the rowdata: "+ JSON.stringify(this.rowData[1]))
+ //this.rowData = [].concat.apply([], list);
+ })
+
+
+ }
+
+ applyFilter(filterValue: string) {
+ this.dataSource.filter = filterValue.trim().toLowerCase();
+ }
+//createInstance(element)
+ createInstance() {
+
+
+ this.selectedRows = this.gridApi.getSelectedRows().map(({ _id, testName }) => ({_id, testName}));
+
+ const create = this.modal.open(TestInstanceModalComponent, {
+ width: '90%',
+ data: {
+ td: this.selectedRows[0]._id//element._id
+ },
+ disableClose: true
+ });
+ }
+
+ create() {
+ let create = this.modal.open(TestDefinitionModalComponent, {
+ disableClose: true
+ });
+
+ create.afterClosed().subscribe(res => {
+ this.ngOnInit();
+ })
+ }
+
+
+ // view(td){
+ // this.modal.open(ViewWorkflowModalComponent, {
+ // width: '90%',
+ // height: '70%',
+ // maxWidth: '100%',
+ // data: {
+ // id: td._id
+ // }
+ // });
+ // }
+
+
+
+
+
+ deleteMultiple(){
+ for(let i = 0; i < this.gridApi.getSelectedNodes().length; i++){
+ this.delete(i);
+ }
+ }
+
+ delete(td) {
+
+ this.selectedRows = this.gridApi.getSelectedRows().map(({_id, testName }) => ({_id, testName}));
+ const deleter = this.modal.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: 'confirmation',
+ message: 'Are you sure you want to delete ' + this.selectedRows[td].testName + '? Any test instances or executions using this test definition will no longer work.'
+ }
+ });
+
+ deleter.afterClosed().subscribe(result => {
+ if (result) {
+ this.testDefinition.delete(this.selectedRows[td]._id).subscribe(response => {
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: 'Test definition was deleted'
+ }
+ })
+ //this.ngOnInit();
+ this.setComponentData(this._groups.getGroup());
+ });
+ }
+ });
+ }
+
+ edit() {
+ this.selectedRows = this.gridApi.getSelectedRows().map(({_id }) => ({_id}));
+ var editor = this.modal.open(TestDefinitionModalComponent, {
+ disableClose: true,
+ data: {
+ testDefinitionId: this.selectedRows[0]._id
+ }
+ });
+ }
+
+ lockMultiple(){
+
+ for(let i = 0; i < this.gridApi.getSelectedNodes().length; i++){
+ this.lock(i);
+ }
+
+ }
+
+
+ lock(td) {
+ this.selectedRows = this.gridApi.getSelectedRows().map(({_id, testName, groupId, }) => ({_id, testName, groupId}));
+
+ let user = JSON.parse(this.cookie.get('currentUser'));
+ let isAdmin = false;
+ for (let i = 0; i < user.groups.length; i++) {
+ if (this.selectedRows[td].groupId === user.groups[i].groupId) {
+ if (user.groups[i].permissions.includes("admin")) {
+ isAdmin = true;
+ }
+ }
+ }
+ user = '';
+ if (!isAdmin) {
+ this.modal.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: 'alert',
+ message: 'You do not have the correct permissions to lock/unlock test definitions.'
+ }
+ })
+ return;
+ }
+ this.modal.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: 'confirmation',
+ message: 'Are you sure you want to lock ' + this.selectedRows[td].testName + '? All test instances using this test definition will be locked and no more instances can be created until unlocked.'
+ }
+ }).afterClosed().subscribe((result) => {
+ if (result) {
+ let testDef = {
+ '_id': this.selectedRows[td]._id,
+ 'disabled': true
+ }
+ this.testDefinition.patch(testDef).subscribe((res) => {
+ this.selectedRows[td].disabled = true;
+ this.testInstanceService.find({ $limit: -1, testDefinitionId: this.selectedRows[td]._id }).subscribe((result) => {
+
+
+
+ if (result['length']) {
+ for (let i = 0; i < result['length']; i++) {
+ let ti = {
+ '_id': null,
+ 'disabled': true
+ }
+ ti._id = result[i]._id;
+ ti.disabled = true;
+ let temp = ti;
+
+ this.testInstanceService.patch(ti).subscribe((results) => {
+
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: 'Test Instance ' + results['testInstanceName'] + ' was locked'
+ }
+ })
+ });
+ }
+ } else {
+ let ti = {
+ '_id': null,
+ 'disabled': true
+ }
+ ti._id = result['_id'];
+ this.testInstanceService.patch(ti).subscribe((results) => {
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: 'Test Instance ' + results['testInstanceName'] + ' was locked'
+ }
+ })
+ });;
+ }
+ });
+ this.setComponentData(this._groups.getGroup());
+ }, (error) => {
+ this.modal.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: "alert",
+ message: 'Test Definition could not be locked.'
+ }
+ })
+ });
+
+ }
+ })
+ }
+
+
+ updateData(){
+
+ this.setComponentData(this._groups.getGroup());
+ }
+
+ unlockMultiple() {
+ for(let i = 0; i < this.gridApi.getSelectedNodes().length; i++){
+ this.unlock(i);
+ }
+ }
+//unlock multiple and loop through single unlock
+ unlock(td) {
+ this.selectedRows = this.gridApi.getSelectedRows().map(({_id, testName, groupId, }) => ({_id, testName, groupId}));
+ let user = JSON.parse(this.cookie.get('currentUser'));
+ let isAdmin = false;
+ for (let i = 0; i < user.groups.length; i++) {
+ if (this.selectedRows[td].groupId === user.groups[i].groupId) {
+ if (user.groups[i].permissions.includes("admin")) {
+ isAdmin = true;
+ }
+ }
+ }
+ user = '';
+ if (!isAdmin) {
+ this.modal.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: 'alert',
+ message: 'You do not have the correct permissions to lock/unlock test definitions.'
+ }
+ })
+ return;
+ }
+
+ this.modal.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: 'confirmation',
+ message: 'Are you sure you want to unlock ' + td.testName + '? All test instances using this test definition will be unlocked as well.'
+ }
+ }).afterClosed().subscribe((result) => {
+ if (result) {
+ let testDef = {
+ '_id': this.selectedRows[td]._id,
+ 'disabled': false
+ }
+ this.testDefinition.patch(testDef).subscribe((res) => {
+ this.selectedRows[td].disabled = false;
+ this.testInstanceService.find({ $limit: -1, testDefinitionId: this.selectedRows[td]._id }).subscribe((result) => {
+
+ // console.log(result);
+ if (result['length']) {
+ for (let i = 0; i < result['length']; i++) {
+ let ti = {
+ '_id': null,
+ 'disabled': false
+ }
+ ti._id = result[i]._id;
+ ti.disabled = false;
+ this.testInstanceService.patch(ti).subscribe((results) => {
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: 'Test Instance ' + results['testInstanceName'] + ' was unlocked'
+ }
+ })
+ });
+ }
+ } else {
+ let ti = {
+ '_id': null,
+ 'disabled': false
+ }
+ ti._id = result['_id'];
+
+ this.testInstanceService.patch(ti).subscribe((results) => {
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: 'Test Instance ' + results['testInstanceName'] + ' was unlocked'
+ }
+ })
+ });;
+ }
+ });
+ this.setComponentData(this._groups.getGroup());
+ }, (error) => {
+ this.modal.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: "alert",
+ message: 'Test Definition could not be locked.'
+ }
+ })
+ });
+
+ }
+ })
+ }
+
+
+ isDeployed(element) {
+ let deployed = false;
+ if (element.bpmnInstances) {
+ element.bpmnInstances.forEach(elem => {
+ if (elem.isDeployed) {
+ deployed = true;
+ }
+ });
+ }
+ return deployed;
+ }
+
+
+
+ onRowSelected(event){
+
+ this.selectedRows = this.gridApi.getSelectedRows().map(({ _id, disabled }) => ({ _id, disabled}));
+
+ if(event.api.getSelectedNodes().length > 0){
+ this.hasSelectedRows = true;
+
+ //Checks for all Unlocked rows
+ for (let i = 0; i < event.api.getSelectedNodes().length; i++ )
+ {
+
+ if(!this.selectedRows[i].disabled)
+ {
+ this.selectedUnlockedRows = true;
+ }
+ else{
+ this.selectedUnlockedRows = false;
+ break;
+ }
+ }
+
+ //Checks for all Locked rows
+ for (let i = 0; i < event.api.getSelectedNodes().length; i++ )
+ {
+
+ if(this.selectedRows[i].disabled)
+ {
+ this.selectedLockedRows = true;
+ }
+ else{
+ this.selectedLockedRows = false;
+ break;
+ }
+ }
+
+
+
+
+
+ }
+ else{
+ this.hasSelectedRows = false;
+ this.selectedLockedRows = false;
+ this.selectedUnlockedRows = true;
+
+ }
+ //One Row was selected
+ if((event.api.getSelectedNodes().length == 1)){
+ this.selectedSingleRow = true;
+
+ }else{
+ this.selectedSingleRow = false;
+ }
+
+ }
+
+ onGridReady(params){
+ this.gridApi = params.api;
+
+ this.gridColumnApi = params.columnApi;
+
+ //auto size the column widths
+ this.gridColumnApi.autoSizeColumns(['name']);
+ }
+
+ disabledIndicator(params){
+ if (params.value){
+ return `<mat-icon class="mat-icon mat-icon-no-color" role="img" >
+ locked</mat-icon>`;
+ }
+ }
+
+
+
+
+ navToDefinition(event){
+ this.router.navigate(['/test-definitions', event.data._id]);
+ }
+
+ testDefinitionModeler(){
+ this.router.navigate(['/modeler'], {queryParams: {testDefinitionId: this.selectedRows[0]._id}});
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/tests/tests.module.spec.ts b/otf-frontend/client/src/app/layout/tests/tests.module.spec.ts
new file mode 100644
index 0000000..baebc53
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/tests/tests.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestsModule } from './tests.module';
+
+describe('TestsModule', () => {
+ let testsModule: TestsModule;
+
+ beforeEach(() => {
+ testsModule = new TestsModule();
+ });
+
+ it('should create an instance', () => {
+ expect(testsModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/tests/tests.module.ts b/otf-frontend/client/src/app/layout/tests/tests.module.ts
new file mode 100644
index 0000000..b1f5aa4
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/tests/tests.module.ts
@@ -0,0 +1,83 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {NgModule} from '@angular/core';
+import {CommonModule} from '@angular/common';
+import {TestsRoutingModule} from './tests-routing.module';
+import {TestsComponent} from './tests.component';
+import {
+ MAT_DIALOG_DATA,
+ MatButtonModule,
+ MatFormFieldModule,
+ MatInputModule,
+ MatPaginatorModule,
+ MatSnackBarModule,
+ MatTableModule,
+ MatTooltipModule,
+ MatProgressSpinnerModule,
+ MatIconModule,
+ MatDatepickerModule
+} from '@angular/material';
+import {PageHeaderModule} from '../../shared';
+import {FilterPipeModule} from 'ngx-filter-pipe';
+import {FormsModule} from '@angular/forms';
+import {TestHeadModalModule} from '../../shared/modules/test-head-modal/test-head-modal.module';
+import {AlertModalModule} from '../../shared/modules/alert-modal/alert-modal.module';
+import {TestDefinitionModalModule} from 'app/shared/modules/test-definition-modal/test-definition-modal.module';
+import {CreateTestModule} from '../onboarding/create-test/create-test.module';
+import {ViewWorkflowModalModule} from 'app/shared/modules/view-workflow-modal/view-workflow-modal.module';
+import { CreateTestInstanceFormModule } from '../../shared/modules/create-test-instance-form/create-test-instance-form.module';
+import { TestInstanceModalModule } from '../../shared/modules/test-instance-modal/test-instance-modal.module';
+import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
+import { AgGridModule } from 'ag-grid-angular';
+import { TestDefinitionDetailsComponent } from './test-definition-details/test-definition-details.component';
+import {MatCardModule} from '@angular/material/card';
+import { DashboardModule } from '../dashboard/dashboard.module';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ TestsRoutingModule,
+ PageHeaderModule,
+ FormsModule,
+ FilterPipeModule,
+ MatButtonModule,
+ MatTableModule,
+ MatFormFieldModule,
+ MatInputModule,
+ MatPaginatorModule,
+ TestHeadModalModule,
+ TestInstanceModalModule,
+ AlertModalModule,
+ TestDefinitionModalModule,
+ CreateTestModule,
+ TestDefinitionModalModule,
+ MatTooltipModule,
+ ViewWorkflowModalModule,
+ MatSnackBarModule,
+ MatProgressSpinnerModule,
+ NgbModule,
+ AgGridModule.withComponents([]),
+ MatIconModule,
+ MatCardModule,
+ DashboardModule,
+ MatDatepickerModule
+ ],
+ declarations: [TestsComponent, TestDefinitionDetailsComponent],
+ providers: [{provide: MAT_DIALOG_DATA, useValue: {}}]
+})
+export class TestsModule {
+}
diff --git a/otf-frontend/client/src/app/layout/user-management/user-management-routing.module.ts b/otf-frontend/client/src/app/layout/user-management/user-management-routing.module.ts
new file mode 100644
index 0000000..64eaf38
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/user-management/user-management-routing.module.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { UserManagementComponent } from './user-management.component';
+
+
+const routes: Routes = [{
+ path:'', component: UserManagementComponent}];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class UserManagementRoutingModule { }
diff --git a/otf-frontend/client/src/app/layout/user-management/user-management.component.pug b/otf-frontend/client/src/app/layout/user-management/user-management.component.pug
new file mode 100644
index 0000000..5e75101
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/user-management/user-management.component.pug
@@ -0,0 +1,86 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div([@routerTransition])
+ app-page-header([heading]="'User Management'", [icon]="'fa-edit'")
+
+ .card-mb-12
+ .pull-left
+ mat-form-field
+ input(matInput, name="filter", value="{{filterString}}", (keyup)="applyFilter($event.target.value)", placeholder="Filter")
+
+ div(style="width: 100%", [hidden]="!loading")
+ mat-spinner(style="margin: auto", color="primary")
+
+ table.mat-elevation-z8(mat-table, *ngIf="dataSource.data && dataSource.data.length > 0", [dataSource]="dataSource", style="width: 100%", [hidden]="loading")
+
+ ng-container(matColumnDef="lastName")
+ th(mat-header-cell, *matHeaderCellDef) lastName
+ td(mat-cell, *matCellDef="let element") {{ element.lastName }}
+
+ ng-container(matColumnDef="firstName")
+ th(mat-header-cell, *matHeaderCellDef) First Name
+ td(mat-cell, *matCellDef="let element") {{ element.firstName }}
+
+ ng-container(matColumnDef="email")
+ th(mat-header-cell, *matHeaderCellDef) Email
+ td(mat-cell, *matCellDef="let element") {{ element.email}}
+
+ ng-container(matColumnDef="addGroups")
+ th(mat-header-cell, *matHeaderCellDef) Add to Group
+ td(mat-cell, *matCellDef="let element")
+ .dropdown(ngbDropdown, autoClose="outside", (openChange)="dropdownChange()", placement="left-top")
+ button(mat-mini-fab, color="primary", ngbDropdownToggle, (click)="null")
+ i.fa.fa-caret-down
+ .dropdown-menu(ngbDropdownMenu)
+ h4.mb-2.ml-1(style="font-weight: bold;") Change Groups
+ input.ml-1(matInput, type='search', placeholder='Search...', color='blue', [(ngModel)]='search.groupName')
+ div(style="max-height: 300px; overflow-y: scroll")
+ .px-4.py-3
+ .mr-2.ml-2(*ngFor="let group of groups | filterBy:search")
+ mat-checkbox((change)="addRemoveGroupList(element, group._id, $event)", [(ngModel)]="element[group._id]") {{group.groupName}}
+ div(style="text-align: center")
+ button.primary.mr-1(mat-raised-button, [disabled]= "!element.groupsToAddRemove || element.groupsToAddRemove.length <= 0", aria-label='Edit', color="primary", (click)='addGroups(element)') Add
+ button(mat-raised-button, [disabled]= "!element.groupsToAddRemove || element.groupsToAddRemove.length <= 0", color="warn", (click)='removeGroups(element)') Remove
+
+ //- a.dropdown-item(*ngFor="let group of groups", (click)='addGroupsList(element, group._id)')
+ //- span.pl-1 {{group.groupName}}
+ //- i.fa.fa-check(*ngIf='element.groupsToAdd !== undefined && element.groupsToAdd.includes(group._id)')
+
+
+
+ //- mat-select.mr-1((selectionChange)="onChange(element)", style="width: 30%; background: #80808066",[(ngModel)]="element['groupToAddRemove']")
+ //- mat-option(*ngFor="let group of groups", value="{{group._id}}") {{ group.groupName }}
+ //- button.mr-1(mat-mini-fab, aria-label='Edit', color="primary", (click)='addGroup(element)')
+ //- i.fa.fa-plus
+ //- button.text-white(mat-mini-fab, aria-label='Remove', color='warn', (click)='removeGroup(element)')
+ //- i.fa.fa-remove
+
+ ng-container(matColumnDef="isVerified")
+ th(mat-header-cell, *matHeaderCellDef) Verified
+ td(mat-cell, *matCellDef="let element") {{element.isVerified ? "Yes" : "No"}}
+
+ ng-container(matColumnDef="enabled")
+ th(mat-header-cell, *matHeaderCellDef) Enabled
+ td(mat-cell, *matCellDef="let element")
+ mat-slide-toggle([(ngModel)]="element.enabled", "color"="primary", (input)="enableUser($event, element)")
+ //mat-slide-toggle([checked]="element.enabled? true : false", "color"="primary", (input)="enableUser($event, element)")
+
+ tr(mat-header-row, *matHeaderRowDef="displayedColumns")
+ tr(mat-row, *matRowDef="let row; columns: displayedColumns")
+
+ mat-paginator([length]="resultsLength", [pageSizeOptions]="[10, 25, 100]", [hidden]="loading")
+
diff --git a/otf-frontend/client/src/app/layout/user-management/user-management.component.scss b/otf-frontend/client/src/app/layout/user-management/user-management.component.scss
new file mode 100644
index 0000000..e177191
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/user-management/user-management.component.scss
@@ -0,0 +1,25 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.mat-mini-fab{
+ width: 30px !important;
+ height: 30px !important;
+ line-height: 10px !important;
+}
+
+.dropdown-toggle::after {
+ display:none;
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/user-management/user-management.component.spec.ts b/otf-frontend/client/src/app/layout/user-management/user-management.component.spec.ts
new file mode 100644
index 0000000..8dea47b
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/user-management/user-management.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { UserManagementComponent } from './user-management.component';
+
+describe('UserManagementComponent', () => {
+ let component: UserManagementComponent;
+ let fixture: ComponentFixture<UserManagementComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ UserManagementComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(UserManagementComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/user-management/user-management.component.ts b/otf-frontend/client/src/app/layout/user-management/user-management.component.ts
new file mode 100644
index 0000000..4ce454f
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/user-management/user-management.component.ts
@@ -0,0 +1,347 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {Component, OnInit, ViewContainerRef, ViewChild} from '@angular/core';
+import {ActivatedRoute, Router} from '@angular/router';
+import { MatPaginator, MatDialog, MatSnackBar } from '@angular/material';
+import { MatTableDataSource } from '@angular/material/table';
+import {HttpClient} from "@angular/common/http";
+import {UserService} from "../../shared/services/user.service";
+import { routerTransition } from '../../router.animations';
+import { ListService } from '../../shared/services/list.service';
+import { AlertSnackbarComponent } from 'app/shared/modules/alert-snackbar/alert-snackbar.component';
+import { GroupService } from 'app/shared/services/group.service';
+import { AlertModalComponent } from 'app/shared/modules/alert-modal/alert-modal.component';
+import * as organizeGroups from '../../../../../server/src/feathers/hooks/permissions/get-permissions';
+import { CookieService } from 'ngx-cookie-service';
+
+@Component({
+ selector: 'app-user-management',
+ templateUrl: './user-management.component.pug',
+ styleUrls: ['./user-management.component.scss'],
+ animations: [routerTransition()]
+
+})
+export class UserManagementComponent implements OnInit {
+
+ public dataSource;
+ public displayedColumns: string[] = ['lastName', 'firstName', 'email', 'addGroups', 'isVerified', 'enabled'];
+ public resultsLength;
+ public loading = false;
+ public filterString = "";
+ public groups;
+ public search;
+ public currentUser;
+
+ @ViewChild(MatPaginator) paginator: MatPaginator;
+
+
+ constructor(private http: HttpClient,
+ private router: Router,
+ private viewRef: ViewContainerRef,
+ private list: ListService,
+ private modal: MatDialog,
+ private snack: MatSnackBar,
+ private user: UserService,
+ private route: ActivatedRoute,
+ private groupService: GroupService,
+ private cookie: CookieService
+ ) { }
+
+ ngOnInit() {
+ this.loading = true;
+ this.groups = [];
+ this.search = {};
+ this.search.groupName = '';
+ this.currentUser = JSON.parse(this.cookie.get('currentUser'));
+ this.groupService.find({$limit: -1}).subscribe((result) => {
+ if(result){
+ this.groups = organizeGroups(this.currentUser, result);
+
+ }
+ })
+ this.route.queryParamMap.subscribe(queryParams => {
+ this.filterString = queryParams.get("filter");
+ if(!this.filterString){
+ this.filterString = "";
+ }
+ });
+ this.list.createList('td');
+ //["$limit=-1", "$sort[createdAt]=-1", "$select[]=lastName", "$select[]=firstName", "$select[]=email", "$select[]=isVerified", "$select[]=enabled"]
+ this.user.find({
+ $limit: -1,
+ $sort: {
+ createdAt: -1,
+ },
+ $select: ['lastName', 'firstName', 'email', 'isVerified', 'enabled', 'groups']
+ }).subscribe((list) => {
+ this.list.changeMessage('td', list);
+ this.loading = false;
+
+ });
+
+ this.dataSource = new MatTableDataSource();
+ this.dataSource.paginator = this.paginator;
+
+ this.list.listMap['td'].currentList.subscribe((list) =>{
+ if(list){
+ this.dataSource.data = list;
+ this.resultsLength = this.dataSource.data.length;
+ this.applyFilter(this.filterString)
+ }
+ });
+
+ }
+
+ applyFilter(filterValue: string) {
+ this.dataSource.filter = filterValue.trim().toLowerCase();
+ }
+
+ applyGroupFilter(filterValue: string){
+ this.groups.filter = filterValue.trim().toLowerCase();
+ }
+
+ dropdownChange(){
+ this.search.groupName = '';
+ for(let i in this.groups){
+ this.groups[i].selected = false;
+ }
+
+ }
+
+
+ addRemoveGroupList(element, groupId, event){
+ if(event.checked){
+ if (element.groupsToAddRemove){
+ element.groupsToAddRemove.push(groupId);
+ }else{
+ element.groupsToAddRemove = [];
+ element.groupsToAddRemove.push(groupId);
+ }
+ }else{
+ if(element.groupsToAddRemove){
+ let temp = element.groupsToAddRemove.indexOf(groupId)
+ if(temp >= 0)
+ element.groupsToAddRemove.splice(temp, 1);
+ }
+ }
+
+ }
+
+ removeGroups(user){
+ this.modal.open(AlertModalComponent, {
+ width: "250px",
+ data: {
+ type: "confirmation",
+ message: "Are you sure you want to remove " + user.firstName + " " + user.lastName + " from groups?"
+ }
+ }).afterClosed().subscribe((results) => {
+ if(results === undefined){
+ return;
+ }
+ if(results){
+ for(let i in user.groupsToAddRemove){
+ user[user.groupsToAddRemove[i]] = false;
+ let index = this.groups.findIndex(function(group){ return group._id == user.groupsToAddRemove[i]; })
+ if(index >= 0 && this.groups[index].members){
+ let memberIndex = this.groups[index].members.findIndex(function(member){return member.userId.toString() == user._id.toString()})
+ if(memberIndex >= 0){
+ this.groups[index].members.splice(memberIndex, 1);
+ let groupPatch = {
+ _id : this.groups[index]._id,
+ members: this.groups[index].members
+ }
+ this.groupService.patch(groupPatch).subscribe((res) => {
+ let snackMessage = 'Success. ' + user.firstName + ' ' + user.lastName + ' removed from group!';
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: snackMessage
+ }
+ });
+ });
+ }
+ }
+
+ }
+ }else{
+ return;
+ }
+ // let userPatch = {
+ // _id : user._id,
+ // groups: user.groups
+ // };
+
+ // this.user.patch(userPatch).subscribe((res) => {
+ // let snackMessage = 'Success. ' + user.firstName + ' ' + user.lastName + ' removed from group!';
+ // this.snack.openFromComponent(AlertSnackbarComponent, {
+ // duration: 1500,
+ // data: {
+ // message: snackMessage
+ // }
+ // })
+ // });
+ user.groupsToAddRemove = [];
+
+ });
+ }
+ //add "Change Groups" header to management dropdown\
+ addGroups(user){
+ this.modal.open(AlertModalComponent, {
+ width: "250px",
+ data: {
+ type: "userAdmin",
+ message: "Would you like to add as group user or group admin?"
+ }
+ }).afterClosed().subscribe((results) => {
+ if(results === undefined){
+ return;
+ }
+ if(results){
+ for(let i in user.groupsToAddRemove){
+ user[user.groupsToAddRemove[i]] = false;
+ let groupPatch = {
+ _id : user.groupsToAddRemove[i],
+ $push: { members: { userId : user._id, roles: ["admin"]}}
+ }
+
+
+ let index = this.groups.findIndex(function(group){ return group._id == user.groupsToAddRemove[i]; })
+ if(index >= 0 && this.groups[index].members){
+ let memberIndex = this.groups[index].members.findIndex(function(member){return member.userId.toString() == user._id.toString()});
+
+ if(memberIndex >= 0 && !this.groups[index].members[memberIndex]["roles"].includes("admin")){
+ groupPatch = this.groups[index];
+ groupPatch["members"][memberIndex].roles.push("admin");
+ }else if (memberIndex < 0) {
+ groupPatch = {
+ _id : user.groupsToAddRemove[i],
+ $push: { members: { userId : user._id, roles: ["admin"]}}
+ }
+ }else{
+ let snackMessage = 'Success. ' + user.firstName + ' ' + user.lastName + ' already group admin!';
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: snackMessage
+ }
+ });
+ continue;
+ }
+ }
+ this.groupService.patch(groupPatch).subscribe((res) => {
+ let snackMessage = 'Success. ' + user.firstName + ' ' + user.lastName + ' added to group!';
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: snackMessage
+ }
+ });
+ });
+
+ }
+ }else{
+ for(let i in user.groupsToAddRemove){
+ user[user.groupsToAddRemove[i]] = false;
+ let groupPatch = {
+ _id : user.groupsToAddRemove[i],
+ $push: { members: { userId : user._id, roles: [""]}}
+ }
+
+
+ let index = this.groups.findIndex(function(group){ return group._id == user.groupsToAddRemove[i]; })
+ if(index >= 0 && this.groups[index].members){
+ let memberIndex = this.groups[index].members.findIndex(function(member){return member.userId == user.groupsToAddRemove[i]})
+ if(memberIndex >= 0 ){
+ if( this.groups[index].members[memberIndex].roles.includes("admin")){
+ groupPatch = this.groups[index];
+ let adminIndex = groupPatch["members"][memberIndex].roles.findIndex(function(perm){return perm.toLowerCase() == "admin";});
+ groupPatch["members"][memberIndex].roles.splice(adminIndex, 1);
+ }else{
+ return;
+ }
+ }else if (memberIndex < 0) {
+ groupPatch = {
+ _id : user.groupsToAddRemove[i],
+ $push: { members: { userId : user._id, roles: [""]}}
+ }
+ }
+ }
+ this.groupService.patch(groupPatch).subscribe((res) => {
+ let snackMessage = 'Success. ' + user.firstName + ' ' + user.lastName + ' added to group!';
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: snackMessage
+ }
+ });
+ });
+ }
+ }
+ // let userPatch = {
+ // _id : user._id,
+ // groups: user.groups
+ // };
+
+ // this.user.patch(userPatch).subscribe((res) => {
+ // let snackMessage = 'Success. ' + user.firstName + ' ' + user.lastName + ' added to group!';
+ // this.snack.openFromComponent(AlertSnackbarComponent, {
+ // duration: 1500,
+ // data: {
+ // message: snackMessage
+ // }
+ // })
+ // });
+ user.groupsToAddRemove = [];
+
+ });
+
+
+ }
+
+ enableUser(event, element){
+ console.log(element)
+ let oldVal = element.enabled;
+ if(event.target.checked === element.enabled){
+ //console.log("same");
+ return
+ }
+ this.user.enableUser(element._id, event.target.checked).subscribe(
+ (result) => {
+ element.enabled = result['enabled'];
+ let snackMessage = 'Success. Set enabled to : ' + result['enabled'];
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: snackMessage
+ }
+ })
+
+ },
+ (error) => {
+ element.enabled = oldVal;
+ let snackMessage = 'Could not set enabled to : ' + !oldVal;
+ this.snack.open(snackMessage, "Error", { duration: 1500 })
+
+
+ }
+
+ )
+
+
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/user-management/user-management.module.spec.ts b/otf-frontend/client/src/app/layout/user-management/user-management.module.spec.ts
new file mode 100644
index 0000000..529ddc8
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/user-management/user-management.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { UserManagementModule } from './user-management.module';
+
+describe('UserManagementModule', () => {
+ let userManagementModule: UserManagementModule;
+
+ beforeEach(() => {
+ userManagementModule = new UserManagementModule();
+ });
+
+ it('should create an instance', () => {
+ expect(userManagementModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/user-management/user-management.module.ts b/otf-frontend/client/src/app/layout/user-management/user-management.module.ts
new file mode 100644
index 0000000..01a84b6
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/user-management/user-management.module.ts
@@ -0,0 +1,71 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {NgModule} from '@angular/core';
+import {CommonModule} from '@angular/common';
+import {UserManagementRoutingModule} from './user-management-routing.module';
+import {UserManagementComponent} from './user-management.component';
+import {
+ MAT_DIALOG_DATA,
+ MatButtonModule,
+ MatFormFieldModule,
+ MatInputModule,
+ MatPaginatorModule,
+ MatSnackBarModule,
+ MatSelectModule,
+ MatTableModule,
+ MatTooltipModule,
+ MatProgressSpinnerModule,
+ MatSlideToggleModule,
+ MatOptionModule,
+ MatCheckboxModule,
+ MatIconModule
+} from '@angular/material';
+import {PageHeaderModule} from '../../shared';
+import {FilterPipeModule} from 'ngx-filter-pipe';
+import {FormsModule} from '@angular/forms';
+import {AlertModalModule} from '../../shared/modules/alert-modal/alert-modal.module';
+import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
+import {AlertSnackbarModule} from "../../shared/modules/alert-snackbar/alert-snackbar.module";
+
+@NgModule({
+ imports: [
+ CommonModule,
+ PageHeaderModule,
+ FormsModule,
+ FilterPipeModule,
+ MatButtonModule,
+ MatCheckboxModule,
+ MatTableModule,
+ MatFormFieldModule,
+ MatInputModule,
+ MatIconModule,
+ MatSlideToggleModule,
+ MatPaginatorModule,
+ AlertModalModule,
+ MatTooltipModule,
+ MatSnackBarModule,
+ MatSelectModule,
+ MatOptionModule,
+ MatProgressSpinnerModule,
+ NgbModule,
+ AlertSnackbarModule,
+ UserManagementRoutingModule
+ ],
+ declarations: [UserManagementComponent],
+ providers: [{provide: MAT_DIALOG_DATA, useValue: {}}]
+})
+export class UserManagementModule { }
diff --git a/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/charts/test-head-executions-line-chart/test-head-executions-line-chart.component.pug b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/charts/test-head-executions-line-chart/test-head-executions-line-chart.component.pug
new file mode 100644
index 0000000..cd6f182
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/charts/test-head-executions-line-chart/test-head-executions-line-chart.component.pug
@@ -0,0 +1,17 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div(#linechartdiv, [style.height]="height")
diff --git a/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/charts/test-head-executions-line-chart/test-head-executions-line-chart.component.scss b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/charts/test-head-executions-line-chart/test-head-executions-line-chart.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/charts/test-head-executions-line-chart/test-head-executions-line-chart.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/charts/test-head-executions-line-chart/test-head-executions-line-chart.component.spec.ts b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/charts/test-head-executions-line-chart/test-head-executions-line-chart.component.spec.ts
new file mode 100644
index 0000000..af1de53
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/charts/test-head-executions-line-chart/test-head-executions-line-chart.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TestHeadExecutionsLineChartComponent } from './test-head-executions-line-chart.component';
+
+describe('TestHeadExecutionsLineChartComponent', () => {
+ let component: TestHeadExecutionsLineChartComponent;
+ let fixture: ComponentFixture<TestHeadExecutionsLineChartComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TestHeadExecutionsLineChartComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TestHeadExecutionsLineChartComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/charts/test-head-executions-line-chart/test-head-executions-line-chart.component.ts b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/charts/test-head-executions-line-chart/test-head-executions-line-chart.component.ts
new file mode 100644
index 0000000..2d4abf6
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/charts/test-head-executions-line-chart/test-head-executions-line-chart.component.ts
@@ -0,0 +1,190 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, ViewChild, ElementRef, Input, Output, EventEmitter } from '@angular/core';
+import { Subscription } from 'rxjs';
+import { StatsService } from 'app/layout/components/stats/stats.service';
+import * as moment from 'moment';
+import * as am4core from "@amcharts/amcharts4/core";
+import * as am4charts from "@amcharts/amcharts4/charts";
+
+@Component({
+ selector: 'app-test-head-executions-line-chart',
+ templateUrl: './test-head-executions-line-chart.component.pug',
+ styleUrls: ['./test-head-executions-line-chart.component.scss']
+})
+export class TestHeadExecutionsLineChartComponent implements OnInit {
+
+ private toDestroy: Array<Subscription> = [];
+
+ @ViewChild('linechartdiv') LineChartDiv: ElementRef;
+ @Input() height: string;
+ @Input() testHeadId;
+ @Output() total: EventEmitter<any> = new EventEmitter();
+
+ //public testDefinitionName = "Hello";
+ private chart: am4charts.XYChart;
+ private loadingIndicator;
+
+ constructor(private stats: StatsService) {
+ }
+
+ ngOnInit() {
+
+
+ this.renderChart();
+
+ this.toDestroy.push(this.stats.onTDExecutionChangeStarted().subscribe(res => {
+ this.showLoadingIndicator();
+ }));
+
+ this.toDestroy.push(this.stats.onDefaultDataCallStarted().subscribe(res => {
+ this.showLoadingIndicator();
+ }));
+
+ this.toDestroy.push(this.stats.onDefaultDataCallFinished().subscribe(res => {
+ this.setChartData();
+ }));
+
+ this.toDestroy.push(this.stats.onTDExecutionChangeFinished().subscribe(res => {
+ this.setChartData();
+ }));
+
+ }
+
+ ngOnDestroy(){
+ //destory chart
+ this.chart.dispose();
+ }
+
+ //Sets count to 0 for any dates that dont have data
+ setupPoints(rawData) {
+ let formattedData = [];
+ let dayRange = moment(this.stats.filters.endDate).add(1, 'days').diff(moment(this.stats.filters.startDate), 'days');
+
+ for(let i = 0; i < dayRange; i++){
+ //find date in raw data
+ let d = rawData.find(e => moment(e.date).isSame(moment(this.stats.filters.startDate).add(i, 'days'), 'day'));
+ let count = 0;
+ if(d){
+ count = d.count;
+ }
+ formattedData.push({
+ date: moment(this.stats.filters.startDate).startOf('day').add(i, 'days').toDate(),
+ count: count
+ })
+ }
+
+ return formattedData;
+ }
+
+ showLoadingIndicator() {
+
+ //this.height = "380px";
+ if(!this.loadingIndicator){
+ this.loadingIndicator = this.chart.tooltipContainer.createChild(am4core.Container);
+ this.loadingIndicator.background.fill = am4core.color("#fff");
+ this.loadingIndicator.background.fillOpacity = 0.8;
+ this.loadingIndicator.width = am4core.percent(100);
+ this.loadingIndicator.height = am4core.percent(100);
+
+ let indicatorLabel = this.loadingIndicator.createChild(am4core.Label);
+ indicatorLabel.text = "Loading..";
+ indicatorLabel.align = "center";
+ indicatorLabel.valign = "middle";
+ indicatorLabel.fontSize = 18;
+ indicatorLabel.fontWeight = "bold";
+ indicatorLabel.dy = 50;
+
+ let loadingImage = this.loadingIndicator.createChild(am4core.Image);
+ //loadingImage.href = "https://img.devrant.com/devrant/rant/r_647810_4FeCH.gif";
+ loadingImage.href = "/assets/images/equalizer.gif";
+ //loadingImage.dataSource = "/loading-pies.svg"
+ loadingImage.align = "center";
+ loadingImage.valign = "middle";
+ loadingImage.horizontalCenter = "middle";
+ loadingImage.verticalCenter = "middle";
+ loadingImage.scale = 3.0;
+ }else{
+ this.loadingIndicator.show();
+ }
+ }
+
+ hideLoadingIndicator() {
+ this.loadingIndicator.hide();
+ }
+
+ setChartData() {
+ let data = [];
+ let total = 0;
+ this.stats.executionList.forEach(e => {
+ if (e.testHeadResults && e.testHeadResults.length > 0) {
+
+ e.testHeadResults.forEach((result, index) => {
+
+ if(result.testHeadId == this.testHeadId){
+ total++;
+ let dataIndex = data.findIndex(d => moment(d.date).isSame(result.startTime, 'day'));
+
+ if (dataIndex == -1) {
+ data.push({ date: moment(result.startTime).toDate(), count: 1 });
+ }else{
+ data[dataIndex].count++;
+ }
+
+ }
+
+ })
+ }
+ })
+
+ this.chart.data = this.setupPoints(data);
+ this.total.emit(total);
+ this.hideLoadingIndicator();
+ }
+
+ renderChart() {
+
+ if(this.chart){
+ this.chart.dispose();
+ }
+ this.chart = am4core.create(this.LineChartDiv.nativeElement, am4charts.XYChart);
+ this.chart.preloader.disabled = true;
+ this.showLoadingIndicator();
+
+ let dateAxis = this.chart.xAxes.push(new am4charts.DateAxis());
+ dateAxis.fontSize = "10px";
+
+ let valueAxis = this.chart.yAxes.push(new am4charts.ValueAxis());
+ valueAxis.title.text = "Executions";
+ valueAxis.title.fontSize = "10px";
+
+ let series = this.chart.series.push(new am4charts.LineSeries());
+ series.dataFields.dateX = "date";
+ series.dataFields.valueY = "count";
+ series.strokeWidth = 3;
+
+ series.fillOpacity = .5;
+ // series.tensionX = 0.8;
+ series.sequencedInterpolation = false;
+ series.tooltipText = "{valueY.value}";
+
+ this.chart.cursor = new am4charts.XYCursor();
+
+ this.chart.responsive.enabled = true;
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/virtual-test-head-details.component.pug b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/virtual-test-head-details.component.pug
new file mode 100644
index 0000000..fce6e86
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/virtual-test-head-details.component.pug
@@ -0,0 +1,98 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+mat-card.mb-3
+ mat-card-header
+ mat-card-title
+ h4(*ngIf="testHead?.testHeadName") {{ testHead.testHeadName }}
+ mat-card-subtitle(style="margin-bottom: 0px")
+ div(*ngIf="testHead?.testHeadDescription") {{testHead.testHeadDescription }}
+ mat-card-content
+ .row(*ngIf="testHead")
+ .col-sm
+ mat-form-field(*ngIf="testHead?.hostname")
+ input(matInput, placeholder="Host Name", type="text", [value]="testHead.hostname", disabled, name="host")
+ .col-sm
+ mat-form-field(style="width:50px", *ngIf="testHead?.port")
+ input(matInput, placeholder="Port", type="text", [value]="testHead.port", disabled, name="port")
+ .col-sm
+ mat-form-field(*ngIf="testHead?.resourcePath")
+ input(matInput, placeholder="Resource Path", type="text", [value]="testHead.resourcePath", disabled, name="path")
+ .col-sm
+ mat-form-field(*ngIf="testHead?.groupId")
+ input(matInput, placeholder="Group", type="text", [value]="testHead.groupId", disabled, name="group")
+ .col-sm
+ mat-form-field(style="width:50px",*ngIf="testHead?.isPublic != undefined")
+ input(matInput, placeholder="Is Public", type="text", [value]="testHead.isPublic", disabled, name="public")
+
+div(style="position: relative")
+ .row
+ .col-12
+ .pull-left
+ mat-form-field(style="width:110px")
+ input(matInput, [matDatepicker]="fromPicker", placeholder="From Date", [(ngModel)]="stats.filters.startDate")
+ mat-datepicker-toggle(matSuffix, [for]="fromPicker")
+ mat-datepicker(#fromPicker)
+ mat-form-field.ml-2(style="width:110px")
+ input(matInput, [matDatepicker]="toPicker", placeholder="To Date", [(ngModel)]="stats.filters.endDate")
+ mat-datepicker-toggle(matSuffix, [for]="toPicker")
+ mat-datepicker(#toPicker)
+ button.ml-2(mat-icon-button, (click)="getData()")
+ mat-icon arrow_forward
+
+ .pull-right
+ mat-form-field
+ input(matInput, [ngModel]="totalExecutions", placeholder="Total Executions", disabled)
+
+ .row
+ .col-12
+ mat-card
+ mat-card-content
+ app-test-head-executions-line-chart(*ngIf="testHead", height="201px", [testHeadId]="testHead._id", (total)="setTotalExecutions($event)")
+
+//- .row.mt-2
+//- .col-lg-5
+//- mat-card
+//- mat-card-header
+//- mat-card-title
+//- h5 Test Results
+//- mat-card-content
+//- app-pie-chart(height="230px")
+
+//- .col-lg-7
+//- mat-card
+//- mat-card-header
+//- mat-card-title
+//- h5 Test Definition Usage
+//- mat-card-content
+//- app-test-definition-executions-bar-chart(height="230px")
+//- .row.mt-2
+
+//- .col-lg-8
+//- mat-card
+//- mat-card-header
+//- mat-card-title
+//- h5 Virtual Test Head Executions
+//- mat-card-content
+//- app-test-head-executions-line-chart(height="230px")
+
+//- .col-lg-4
+//- mat-card
+//- mat-card-header
+//- mat-card-title
+//- h5 Virtual Test Head Usage
+//- mat-card-content
+//- app-test-head-execution-bar-chart(height="230px")
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/virtual-test-head-details.component.scss b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/virtual-test-head-details.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/virtual-test-head-details.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/virtual-test-head-details.component.spec.ts b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/virtual-test-head-details.component.spec.ts
new file mode 100644
index 0000000..30b35bf
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/virtual-test-head-details.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { VirtualTestHeadDetailsComponent } from './virtual-test-head-details.component';
+
+describe('VirtualTestHeadDetailsComponent', () => {
+ let component: VirtualTestHeadDetailsComponent;
+ let fixture: ComponentFixture<VirtualTestHeadDetailsComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ VirtualTestHeadDetailsComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(VirtualTestHeadDetailsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/virtual-test-head-details.component.ts b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/virtual-test-head-details.component.ts
new file mode 100644
index 0000000..4c1fe5c
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-head-details/virtual-test-head-details.component.ts
@@ -0,0 +1,104 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit } from '@angular/core';
+import {ActivatedRoute} from "@angular/router";
+import {TestHead} from "app/shared/models/test-head.model";
+import {TestHeadService} from "app/shared/services/test-head.service";
+import { Subscription } from 'rxjs';
+import { StatsService } from 'app/layout/components/stats/stats.service';
+
+
+@Component({
+ selector: 'app-virtual-test-head-details',
+ templateUrl: './virtual-test-head-details.component.pug',
+ styleUrls: ['./virtual-test-head-details.component.scss']
+})
+export class VirtualTestHeadDetailsComponent implements OnInit {
+
+ private toDestroy : Array<Subscription> = [];
+ testHead : TestHead;
+ public totalExecutions;
+ constructor(
+ private route: ActivatedRoute,
+ private testHeadService : TestHeadService,
+ public stats: StatsService
+ ) { }
+
+ ngOnInit() {
+ this.toDestroy.push(this.route.params.subscribe(param => {
+ if(param.id){
+ this.toDestroy.push(this.testHeadService.get(param.id).subscribe(res => {
+ this.testHead = res as TestHead;
+
+ }, err=>{
+ console.log(err);
+ }));
+
+ this.getData(param.id);
+ }
+ }));
+
+ }
+
+ ngOnDestroy(){
+ this.toDestroy.forEach(e => {
+ e.unsubscribe()
+ });
+ }
+
+ getData(testHeadId?){
+ if(!testHeadId){
+ testHeadId = this.testHead._id
+ }
+
+ if(!testHeadId){
+ return;
+ }
+
+ this.stats.getDefaultData(1, {
+ 'testHeadResults.testHeadId': testHeadId,
+ $select: [
+ 'startTime',
+ 'endTime',
+ "historicTestDefinition._id",
+ "historicTestDefinition.testName",
+ "historicTestInstance._id",
+ "historicTestInstance.testInstanceName",
+ "testHeadResults.startTime",
+ "testHeadResults.endTime",
+ "testHeadResults.testHeadName",
+ "testHeadResults.testHeadId",
+ "testHeadResults.testHeadGroupId",
+ "testHeadResults.statusCode",
+ 'testResult'
+ ],
+ $limit: -1,
+ $sort: {
+ startTime: 1
+ },
+ startTime: {
+ $gte: this.stats.filters.startDate,
+ $lte: this.stats.filters.endDate
+ }
+ });
+ }
+
+
+ setTotalExecutions(event){
+ this.totalExecutions = event;
+ }
+}
diff --git a/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads-routing.module.ts b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads-routing.module.ts
new file mode 100644
index 0000000..3ca6d4f
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads-routing.module.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { VirtualTestHeadsComponent } from './virtual-test-heads.component';
+import { VirtualTestHeadDetailsComponent } from './virtual-test-head-details/virtual-test-head-details.component';
+
+const routes: Routes = [
+ { path:'', component: VirtualTestHeadsComponent },
+ { path:':id', component: VirtualTestHeadDetailsComponent}
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class VirtualTestHeadsRoutingModule { }
diff --git a/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads.component.pug b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads.component.pug
new file mode 100644
index 0000000..2c46590
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads.component.pug
@@ -0,0 +1,80 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div([@routerTransition])
+ app-page-header([heading]="'Virtual Test Heads'", [icon]="'fa-edit'")
+
+ .card-mb-12
+ .pull-left
+ mat-form-field
+ input(matInput, name="filter", (keyup)="applyFilter($event.target.value)", placeholder="Filter")
+ .pull-right
+ button(mat-raised-button, color="primary", (click)="createTestHead()") New
+
+ div(style="width: 100%", [hidden]="!loading")
+ mat-spinner(style="margin: auto", color="primary")
+
+ table.mat-elevation-z8(mat-table, [dataSource]="dataSource", style="width: 100%", [hidden]="loading")
+
+ ng-container(matColumnDef="name")
+ th(mat-header-cell, *matHeaderCellDef) Name
+ td(mat-cell, *matCellDef="let element", [routerLink]="['/test-heads', element._id]") {{ element.testHeadName}}
+
+ ng-container(matColumnDef="description")
+ th(mat-header-cell, *matHeaderCellDef) Description
+ td(mat-cell, *matCellDef="let element", [routerLink]="['/test-heads', element._id]") {{ element.testHeadDescription}}
+
+ ng-container(matColumnDef="options")
+ th(mat-header-cell, *matHeaderCellDef) Options
+ td(mat-cell, *matCellDef="let element")
+ button.mr-3(mat-mini-fab, aria-label='Edit', color="primary", (click)='editTestHead(element)')
+ i.fa.fa-pencil
+ button.text-white(mat-mini-fab, aria-label='Remove', color='warn', (click)='deleteTestHead(element)')
+ i.fa.fa-remove
+
+ tr(mat-header-row, *matHeaderRowDef="displayedColumns")
+ tr(mat-row, *matRowDef="let row; columns: displayedColumns")
+
+ mat-paginator([length]="resultsLength", [pageSizeOptions]="[10, 25, 100]", [hidden]="loading")
+
+ //.card-body
+ .row
+ div.col-6
+ input.form-control.bg-light.mb-1([(ngModel)]="search.test_head_id", type="text", placeholder="Search...")
+ div.col-6
+ button.bg-primary.mbtn.pull-right.text-white.mb-1(mat-raised-button, (click)='createTestHead()') Create VTH
+ table.table.table-striped([mfData]='data', #mf='mfDataTable', [mfRowsOnPage]='5')
+ thead
+ tr
+ th(style='width: 20%')
+ mfDefaultSorter(by='name') Name
+ th(style='width: 50%')
+ mfDefaultSorter(by='creator') Creator
+ th(style='width: 10%')
+ mfDefaultSorter(by='date') Date
+ th(style='width: 20%') Options
+ tbody
+ tr
+ td Ping Test Head
+ td Tiffany, Patrick
+ td 7/21/18
+ td
+ button.bg-primary.mbtn.text-white.mr-1(mat-mini-fab, aria-label='View', (click)='viewTestHead(null)')
+ i.fa.fa-eye
+ button.bg-primary.mbtn.text-white.mr-1(mat-mini-fab, aria-label='Edit', (click)='editTestHead()')
+ i.fa.fa-pencil
+ button.mbtn.text-white(mat-mini-fab, aria-label='Remove', color='warn', (click)='deleteTestHead()')
+ i.fa.fa-remove
diff --git a/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads.component.scss b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads.component.scss
new file mode 100644
index 0000000..03c9b55
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads.component.scss
@@ -0,0 +1,39 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.mbtn:focus {
+ outline: none;
+}
+.mat-warn {
+ background-color: red;
+ color:red;
+}
+.bg-accent{
+ background-color: brown
+}
+.mat-mini-fab{
+ width: 30px !important;
+ height: 30px !important;
+ line-height: 10px !important;
+}
+
+tr:hover {background-color: #ddd;}
+
+.card-header{
+ font-size: large;
+ font-family: "Arial Black", Gadget, sans-serif;
+}
+
diff --git a/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads.component.spec.ts b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads.component.spec.ts
new file mode 100644
index 0000000..5b6b605
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { VirtualTestHeadsComponent } from './virtual-test-heads.component';
+
+describe('VirtualTestHeadsComponent', () => {
+ let component: VirtualTestHeadsComponent;
+ let fixture: ComponentFixture<VirtualTestHeadsComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ VirtualTestHeadsComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(VirtualTestHeadsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads.component.ts b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads.component.ts
new file mode 100644
index 0000000..0853862
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads.component.ts
@@ -0,0 +1,145 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Output, Input, ViewChild, ChangeDetectorRef, OnDestroy } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { AppGlobals } from '../../app.global';
+import { routerTransition } from '../../router.animations';
+import { ListService } from '../../shared/services/list.service';
+import { Router } from '@angular/router';
+import { MatTableDataSource, MatPaginator, MatSort, MatDialog, MatSnackBar } from '@angular/material';
+import { TestHeadService } from '../../shared/services/test-head.service';
+import { TestHeadModalComponent } from '../../shared/modules/test-head-modal/test-head-modal.component';
+import { AlertModalComponent } from '../../shared/modules/alert-modal/alert-modal.component';
+import { AlertSnackbarComponent } from 'app/shared/modules/alert-snackbar/alert-snackbar.component';
+import { GroupService } from 'app/shared/services/group.service';
+import { Subscription } from 'rxjs';
+
+@Component({
+ selector: 'app-virtual-test-heads',
+ templateUrl: './virtual-test-heads.component.pug',
+ providers: [AppGlobals],
+ styleUrls: ['./virtual-test-heads.component.scss'],
+ animations: [routerTransition()]
+})
+export class VirtualTestHeadsComponent implements OnInit, OnDestroy {
+
+ private toDestroy: Array<Subscription> = [];
+ public dataSource;
+ public displayedColumns: string[] = ['name', 'description', 'options'];
+ public resultsLength;
+ public loading = false;
+
+ @ViewChild(MatPaginator) paginator: MatPaginator;
+
+ constructor(private testHead: TestHeadService,
+ private router: Router,
+ private modal: MatDialog,
+ private snack: MatSnackBar,
+ private _groups: GroupService) { }
+
+ applyFilter(filterValue: string) {
+ this.dataSource.filter = filterValue.trim().toLowerCase();
+ }
+
+
+ ngOnInit() {
+ this.setComponentData(this._groups.getGroup());
+ this.toDestroy.push(this._groups.groupChange().subscribe(group => {
+ this.setComponentData(group);
+ }));
+ }
+
+ ngOnDestroy(){
+ this.toDestroy.forEach(e => e.unsubscribe());
+ }
+
+ setComponentData(group) {
+ if(group){
+
+ this.dataSource = new MatTableDataSource();
+ this.dataSource.paginator = this.paginator;
+
+ this.testHead.find({ $limit: -1, groupId: group['_id'], $sort: { createdAt: -1 } }).subscribe((list) => {
+ this.dataSource.data = list;
+ this.resultsLength = this.dataSource.data.length;
+ this.loading = false;
+ })
+ }
+ }
+
+ createTestHead() {
+ const create = this.modal.open(TestHeadModalComponent, {
+ width: '90%',
+ data: {
+ goal: 'create'
+ }
+ })
+
+ create.afterClosed().subscribe(result => {
+ this.ngOnInit();
+ // this.list.listMap['vth'].currentList.subscribe(x => {
+ // this.dataSource.data = x;
+ // this.resultsLength = this.dataSource.data.length;
+ // });
+ });
+ }
+
+
+ editTestHead(th) {
+ const edit = this.modal.open(TestHeadModalComponent, {
+ width: '90%',
+ data: {
+ goal: 'edit',
+ testHead: th
+ }
+ });
+
+ edit.afterClosed().subscribe(result => {
+ this.ngOnInit();
+ });
+ }
+
+ deleteTestHead(th) {
+ const deleter = this.modal.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: 'confirmation',
+ message: 'Are you sure you want to delete ' + th.testHeadName + '? There may be test definitions using this test head.'
+ }
+ });
+
+ deleter.afterClosed().subscribe(result => {
+ if (result) {
+ this.testHead.delete(th._id).subscribe(response => {
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: 'Test Head Deleted'
+ }
+ });
+
+ this.ngOnInit();
+ });
+ }
+ });
+ }
+
+ navToTestHead(id){
+ this.router.navigate(['/test-heads', id]);
+ }
+
+}
diff --git a/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads.module.spec.ts b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads.module.spec.ts
new file mode 100644
index 0000000..1eeb733
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { VirtualTestHeadsModule } from './virtual-test-heads.module';
+
+describe('VirtualTestHeadsModule', () => {
+ let virtualTestHeadsModule: VirtualTestHeadsModule;
+
+ beforeEach(() => {
+ virtualTestHeadsModule = new VirtualTestHeadsModule();
+ });
+
+ it('should create an instance', () => {
+ expect(virtualTestHeadsModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads.module.ts b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads.module.ts
new file mode 100644
index 0000000..a394353
--- /dev/null
+++ b/otf-frontend/client/src/app/layout/virtual-test-heads/virtual-test-heads.module.ts
@@ -0,0 +1,78 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {NgModule} from '@angular/core';
+import {CommonModule} from '@angular/common';
+
+import {VirtualTestHeadsRoutingModule} from './virtual-test-heads-routing.module';
+import {VirtualTestHeadsComponent} from './virtual-test-heads.component';
+import {PageHeaderModule} from '../../shared';
+import {FilterPipeModule} from 'ngx-filter-pipe';
+import {FormsModule} from '@angular/forms';
+import {
+ MAT_DIALOG_DATA,
+ MatButtonModule,
+ MatFormFieldModule,
+ MatInputModule,
+ MatPaginatorModule,
+ MatSnackBarModule,
+ MatProgressSpinnerModule,
+ MatDatepickerModule,
+ MatIconModule,
+ MatNativeDateModule
+} from '@angular/material';
+import {CreateTestHeadFormModule} from '../../shared/modules/create-test-head-form/create-test-head-form.module';
+import {MatTableModule} from '@angular/material/table';
+import {TestHeadModalModule} from '../../shared/modules/test-head-modal/test-head-modal.module';
+import {AlertModalModule} from '../../shared/modules/alert-modal/alert-modal.module';
+import {AlertSnackbarModule} from 'app/shared/modules/alert-snackbar/alert-snackbar.module';
+import { VirtualTestHeadDetailsComponent } from './virtual-test-head-details/virtual-test-head-details.component';
+import {MatDividerModule} from '@angular/material/divider';
+import {MatCardModule} from '@angular/material/card';
+import { LineChartComponent } from '../components/stats/line-chart/line-chart.component';
+import { DashboardModule } from '../dashboard/dashboard.module';
+import { TestHeadExecutionsLineChartComponent } from './virtual-test-head-details/charts/test-head-executions-line-chart/test-head-executions-line-chart.component';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ VirtualTestHeadsRoutingModule,
+ PageHeaderModule,
+ FormsModule,
+ FilterPipeModule,
+ CreateTestHeadFormModule,
+ MatButtonModule,
+ MatTableModule,
+ MatFormFieldModule,
+ MatInputModule,
+ MatPaginatorModule,
+ TestHeadModalModule,
+ AlertModalModule,
+ MatSnackBarModule,
+ AlertSnackbarModule,
+ MatProgressSpinnerModule,
+ MatDividerModule,
+ MatCardModule,
+ MatDatepickerModule,
+ MatNativeDateModule,
+ MatIconModule
+ ],
+ declarations: [VirtualTestHeadsComponent, VirtualTestHeadDetailsComponent, TestHeadExecutionsLineChartComponent],
+ entryComponents: [],
+ providers: [{provide: MAT_DIALOG_DATA, useValue: {}}, MatDatepickerModule]
+})
+export class VirtualTestHeadsModule {
+}
diff --git a/otf-frontend/client/src/app/login/login-routing.module.ts b/otf-frontend/client/src/app/login/login-routing.module.ts
new file mode 100644
index 0000000..04ea965
--- /dev/null
+++ b/otf-frontend/client/src/app/login/login-routing.module.ts
@@ -0,0 +1,32 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { LoginComponent } from './login.component';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: LoginComponent
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class LoginRoutingModule {}
diff --git a/otf-frontend/client/src/app/login/login.component.html b/otf-frontend/client/src/app/login/login.component.html
new file mode 100644
index 0000000..7bb3328
--- /dev/null
+++ b/otf-frontend/client/src/app/login/login.component.html
@@ -0,0 +1,46 @@
+<!-- Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+#############################################################################-->
+
+
+<div class="login-page" [@routerTransition]>
+ <div class="row justify-content-md-center">
+ <div class="col-md-4">
+ <img src="assets/images/NetworkLogo.jpg" width="200px" class="user-avatar" />
+ <h1>Open Test Framework</h1>
+ <form #login="ngForm" (ngSubmit)="onLoggedin()" role="form">
+ <div class="form-content">
+ <div class="form-group">
+ <input type="text" [(ngModel)]="User.email" [ngModelOptions]="{standalone: true}" class="form-control input-underline input-lg" id="email" #email="ngModel" placeholder="Email">
+ </div>
+
+
+ <div class="form-group">
+ <input type="password" [(ngModel)]="User.password" [ngModelOptions]="{standalone: true}" class="form-control input-underline input-lg" id="password" placeholder="Password">
+
+ </div>
+ <div *ngIf="loginFailed && (email.dirty || email.touched)"
+ class="alert-danger">
+ <div>
+ Username/Password is incorrect.
+ </div>
+ </div>
+ </div>
+ <button class="btn rounded-btn" type="submit" id="login"> Log in </button>
+
+ <a class="btn rounded-btn" [routerLink]="['/signup']">Register</a>
+ </form>
+ </div>
+ </div>
+</div>
diff --git a/otf-frontend/client/src/app/login/login.component.scss b/otf-frontend/client/src/app/login/login.component.scss
new file mode 100644
index 0000000..215e85f
--- /dev/null
+++ b/otf-frontend/client/src/app/login/login.component.scss
@@ -0,0 +1,112 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+$topnav-background-color: #222;
+:host {
+ display: block;
+}
+.login-page {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ overflow: auto;
+ background: $topnav-background-color;
+ text-align: center;
+ color: #fff;
+ padding: 3em;
+ .col-lg-4 {
+ padding: 0;
+ }
+ .input-lg {
+ height: 46px;
+ padding: 10px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+ border-radius: 0;
+ }
+ .input-underline {
+ background: 0 0;
+ border: none;
+ box-shadow: none;
+ border-bottom: 2px solid rgba(255, 255, 255, 0.5);
+ color: #fff;
+ border-radius: 0;
+ }
+ .input-underline:focus {
+ border-bottom: 2px solid #fff;
+ box-shadow: none;
+ }
+ .rounded-btn {
+ -webkit-border-radius: 50px;
+ border-radius: 50px;
+ color: rgba(255, 255, 255, 0.8);
+ background: $topnav-background-color;
+ border: 2px solid rgba(255, 255, 255, 0.8);
+ font-size: 18px;
+ line-height: 40px;
+ padding: 0 25px;
+ }
+ .rounded-btn:hover,
+ .rounded-btn:focus,
+ .rounded-btn:active,
+ .rounded-btn:visited {
+ color: rgba(255, 255, 255, 1);
+ border: 2px solid rgba(255, 255, 255, 1);
+ outline: none;
+ }
+
+ h1 {
+ font-weight: 300;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ font-size: 36px;
+ small {
+ color: rgba(255, 255, 255, 0.7);
+ }
+ }
+
+ .form-group {
+ padding: 8px 0;
+ input::-webkit-input-placeholder {
+ color: rgba(255, 255, 255, 0.6) !important;
+ }
+
+ input:-moz-placeholder {
+ /* Firefox 18- */
+ color: rgba(255, 255, 255, 0.6) !important;
+ }
+
+ input::-moz-placeholder {
+ /* Firefox 19+ */
+ color: rgba(255, 255, 255, 0.6) !important;
+ }
+
+ input:-ms-input-placeholder {
+ color: rgba(255, 255, 255, 0.6) !important;
+ }
+ }
+ .form-content {
+ padding: 30px 0;
+ }
+ .user-avatar {
+ -webkit-border-radius: 50%;
+ border-radius: 50%;
+ border: 2px solid #fff;
+ }
+
+}
diff --git a/otf-frontend/client/src/app/login/login.component.spec.ts b/otf-frontend/client/src/app/login/login.component.spec.ts
new file mode 100644
index 0000000..2eb7b85
--- /dev/null
+++ b/otf-frontend/client/src/app/login/login.component.spec.ts
@@ -0,0 +1,48 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing'
+import { RouterTestingModule } from '@angular/router/testing'
+import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
+
+import { LoginComponent } from './login.component'
+import { LoginModule } from './login.module'
+
+describe('LoginComponent', () => {
+ let component: LoginComponent;
+ let fixture: ComponentFixture<LoginComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ imports: [
+ LoginModule,
+ RouterTestingModule,
+ BrowserAnimationsModule,
+ ],
+ })
+ .compileComponents()
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(LoginComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges()
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy()
+ })
+});
diff --git a/otf-frontend/client/src/app/login/login.component.ts b/otf-frontend/client/src/app/login/login.component.ts
new file mode 100644
index 0000000..3a17aad
--- /dev/null
+++ b/otf-frontend/client/src/app/login/login.component.ts
@@ -0,0 +1,102 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit } from '@angular/core';
+import { Router, ActivatedRoute } from '@angular/router';
+import { routerTransition } from '../router.animations';
+import { HttpClient } from '@angular/common/http';
+import { AppGlobals } from '../app.global';
+import { UserService } from '../shared/services/user.service';
+import { CookieService } from 'ngx-cookie-service';
+import { AuthService } from 'app/shared/services/auth.service';
+import { AlertModalComponent } from '../shared/modules/alert-modal/alert-modal.component';
+import { MatDialog } from '@angular/material';
+
+
+
+@Component({
+ selector: 'app-login',
+ templateUrl: './login.component.html',
+ providers: [],
+ styleUrls: ['./login.component.scss'],
+ animations: [routerTransition()]
+})
+export class LoginComponent implements OnInit {
+ public User;
+ public authResult;
+ public returnUrl;
+ public loginFailed = false;
+
+ constructor(public router: Router,
+ private route: ActivatedRoute,
+ private http: HttpClient,
+ private _global: AppGlobals,
+ private cookie: CookieService,
+ private dialog: MatDialog,
+ private auth: AuthService
+ ) {}
+
+ ngOnInit() {
+ this.User={};
+ this.User.email = "";
+ this.User.password = "";
+ this.authResult={};
+
+ this.auth.logout();
+
+ this.returnUrl = this.route.snapshot.queryParams['returnUrl'] || '/';
+ }
+
+ onLoggedin() {
+ //alert("User email: " + this.User.email + " User password: " + this.User.password);
+ this.auth.login(this.User) //need to use /authorization
+ .subscribe(
+ (authResult) => {
+ if(this.cookie.check('access_token')){
+ this.router.navigate([this.returnUrl]);
+ }else {
+ if (authResult['user'] && !authResult['user']['enabled']) {
+ this.dialog.open(AlertModalComponent, {
+ width: '450px',
+ data: {
+ type: 'ok',
+ message: "Your account is not yet enabled. Please wait for approval."
+ }
+ });
+ }
+ else {
+ this.dialog.open(AlertModalComponent, {
+ width: '450px',
+ data: {
+ type: 'alert',
+ message: "Something went wrong... Please Refresh and try again."
+ }
+ });
+ }
+ }
+ },
+ (error) => {
+ this.loginFailed = true;
+ this.dialog.open(AlertModalComponent, {
+ width: '450px',
+ data: {
+ type: 'alert',
+ message: error + " Please try again"
+ }
+ });
+ });
+ }
+}
diff --git a/otf-frontend/client/src/app/login/login.module.spec.ts b/otf-frontend/client/src/app/login/login.module.spec.ts
new file mode 100644
index 0000000..c4b2ce2
--- /dev/null
+++ b/otf-frontend/client/src/app/login/login.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { LoginModule } from './login.module';
+
+describe('LoginModule', () => {
+ let loginModule: LoginModule;
+
+ beforeEach(() => {
+ loginModule = new LoginModule();
+ });
+
+ it('should create an instance', () => {
+ expect(loginModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/login/login.module.ts b/otf-frontend/client/src/app/login/login.module.ts
new file mode 100644
index 0000000..5b72f0c
--- /dev/null
+++ b/otf-frontend/client/src/app/login/login.module.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+import { LoginRoutingModule } from './login-routing.module';
+import { LoginComponent } from './login.component';
+import { AlertModalModule } from '../shared/modules/alert-modal/alert-modal.module';
+import { MatDialogModule } from '@angular/material';
+
+@NgModule({
+ imports: [CommonModule, LoginRoutingModule, FormsModule, AlertModalModule, MatDialogModule],
+ declarations: [LoginComponent]
+})
+export class LoginModule {}
diff --git a/otf-frontend/client/src/app/not-found/not-found-routing.module.ts b/otf-frontend/client/src/app/not-found/not-found-routing.module.ts
new file mode 100644
index 0000000..f7efefd
--- /dev/null
+++ b/otf-frontend/client/src/app/not-found/not-found-routing.module.ts
@@ -0,0 +1,32 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { NotFoundComponent } from './not-found.component';
+
+const routes: Routes = [
+ {
+ path: '', component: NotFoundComponent
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class NotFoundRoutingModule {
+}
diff --git a/otf-frontend/client/src/app/not-found/not-found.component.html b/otf-frontend/client/src/app/not-found/not-found.component.html
new file mode 100644
index 0000000..6a98bbd
--- /dev/null
+++ b/otf-frontend/client/src/app/not-found/not-found.component.html
@@ -0,0 +1,35 @@
+<!-- Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+#############################################################################-->
+
+
+<link href='https://fonts.googleapis.com/css?family=Anton|Passion+One|PT+Sans+Caption' rel='stylesheet' type='text/css'>
+<body>
+
+ <!-- Error Page -->
+ <div class="error">
+ <div class="container-floud">
+ <div class="col-xs-12 ground-color text-center">
+ <div class="container-error-404">
+ <div class="clip"><div class="shadow"><span class="digit thirdDigit"></span></div></div>
+ <div class="clip"><div class="shadow"><span class="digit secondDigit"></span></div></div>
+ <div class="clip"><div class="shadow"><span class="digit firstDigit"></span></div></div>
+ <div class="msg">OH!<span class="triangle"></span></div>
+ </div>
+ <h2 class="h1">Sorry! Page not found</h2>
+ </div>
+ </div>
+ </div>
+ <!-- Error Page -->
+</body>
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/not-found/not-found.component.pug b/otf-frontend/client/src/app/not-found/not-found.component.pug
new file mode 100644
index 0000000..1c72049
--- /dev/null
+++ b/otf-frontend/client/src/app/not-found/not-found.component.pug
@@ -0,0 +1,20 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+.col-md-12.text-center
+ img(src="assets/images/404image.png", width="400px")
+ h2 Page Not Found
+ p The page you were trying to access could not be found!
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/not-found/not-found.component.scss b/otf-frontend/client/src/app/not-found/not-found.component.scss
new file mode 100644
index 0000000..26188f7
--- /dev/null
+++ b/otf-frontend/client/src/app/not-found/not-found.component.scss
@@ -0,0 +1,241 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+*
+{
+ font-family: 'PT Sans Caption', sans-serif, 'arial', 'Times New Roman';
+}
+/* Error Page */
+ .error .clip .shadow
+ {
+ height: 180px; /*Contrall*/
+ }
+ .error .clip:nth-of-type(2) .shadow
+ {
+ width: 130px; /*Contrall play with javascript*/
+ }
+ .error .clip:nth-of-type(1) .shadow, .error .clip:nth-of-type(3) .shadow
+ {
+ width: 250px; /*Contrall*/
+ }
+ .error .digit
+ {
+ width: 150px; /*Contrall*/
+ height: 150px; /*Contrall*/
+ line-height: 150px; /*Contrall*/
+ font-size: 120px;
+ font-weight: bold;
+ }
+ .error h2 /*Contrall*/
+ {
+ font-size: 32px;
+ }
+ .error .msg /*Contrall*/
+ {
+ top: -190px;
+ left: 30%;
+ width: 80px;
+ height: 80px;
+ line-height: 80px;
+ font-size: 32px;
+ }
+ .error span.triangle /*Contrall*/
+ {
+ top: 70%;
+ right: 0%;
+ border-left: 20px solid #535353;
+ border-top: 15px solid transparent;
+ border-bottom: 15px solid transparent;
+ }
+
+
+ .error .container-error-404
+ {
+ margin-top: 10%;
+ position: relative;
+ height: 250px;
+ padding-top: 40px;
+ }
+ .error .container-error-404 .clip
+ {
+ display: inline-block;
+ transform: skew(-45deg);
+ }
+ .error .clip .shadow
+ {
+
+ overflow: hidden;
+ }
+ .error .clip:nth-of-type(2) .shadow
+ {
+ overflow: hidden;
+ position: relative;
+ box-shadow: inset 20px 0px 20px -15px rgba(150, 150, 150,0.8), 20px 0px 20px -15px rgba(150, 150, 150,0.8);
+ }
+
+ .error .clip:nth-of-type(3) .shadow:after, .error .clip:nth-of-type(1) .shadow:after
+ {
+ content: "";
+ position: absolute;
+ right: -8px;
+ bottom: 0px;
+ z-index: 9999;
+ height: 100%;
+ width: 10px;
+ background: linear-gradient(90deg, transparent, rgba(173,173,173, 0.8), transparent);
+ border-radius: 50%;
+ }
+ .error .clip:nth-of-type(3) .shadow:after
+ {
+ left: -8px;
+ }
+ .error .digit
+ {
+ position: relative;
+ top: 8%;
+ color: white;
+ background: #07B3F9;
+ border-radius: 50%;
+ display: inline-block;
+ transform: skew(45deg);
+ }
+ .error .clip:nth-of-type(2) .digit
+ {
+ left: -10%;
+ }
+ .error .clip:nth-of-type(1) .digit
+ {
+ right: -20%;
+ }.error .clip:nth-of-type(3) .digit
+ {
+ left: -20%;
+ }
+ .error h2
+ {
+ color: #A2A2A2;
+ font-weight: bold;
+ padding-bottom: 20px;
+ }
+ .error .msg
+ {
+ position: relative;
+ z-index: 9999;
+ display: block;
+ background: #535353;
+ color: #A2A2A2;
+ border-radius: 50%;
+ font-style: italic;
+ }
+ .error .triangle
+ {
+ position: absolute;
+ z-index: 999;
+ transform: rotate(45deg);
+ content: "";
+ width: 0;
+ height: 0;
+ }
+
+/* Error Page */
+@media(max-width: 767px)
+{
+ /* Error Page */
+ .error .clip .shadow
+ {
+ height: 100px; /*Contrall*/
+ }
+ .error .clip:nth-of-type(2) .shadow
+ {
+ width: 80px; /*Contrall play with javascript*/
+ }
+ .error .clip:nth-of-type(1) .shadow, .error .clip:nth-of-type(3) .shadow
+ {
+ width: 100px; /*Contrall*/
+ }
+ .error .digit
+ {
+ width: 80px; /*Contrall*/
+ height: 80px; /*Contrall*/
+ line-height: 80px; /*Contrall*/
+ font-size: 52px;
+ }
+ .error h2 /*Contrall*/
+ {
+ font-size: 24px;
+ }
+ .error .msg /*Contrall*/
+ {
+ top: -110px;
+ left: 15%;
+ width: 40px;
+ height: 40px;
+ line-height: 40px;
+ font-size: 18px;
+ }
+ .error span.triangle /*Contrall*/
+ {
+ top: 70%;
+ right: -3%;
+ border-left: 10px solid #535353;
+ border-top: 8px solid transparent;
+ border-bottom: 8px solid transparent;
+ }
+.error .container-error-404
+ {
+ height: 150px;
+ }
+ /* Error Page */
+}
+
+/*--------------------------------------------Framework --------------------------------*/
+
+.overlay { position: relative; z-index: 20; } /*done*/
+ .ground-color { background: white; } /*done*/
+ .item-bg-color { background: #EAEAEA } /*done*/
+
+ /* Padding Section*/
+ .padding-top { padding-top: 10px; } /*done*/
+ .padding-bottom { padding-bottom: 10px; } /*done*/
+ .padding-vertical { padding-top: 10px; padding-bottom: 10px; }
+ .padding-horizontal { padding-left: 10px; padding-right: 10px; }
+ .padding-all { padding: 10px; } /*done*/
+
+ .no-padding-left { padding-left: 0px; } /*done*/
+ .no-padding-right { padding-right: 0px; } /*done*/
+ .no-vertical-padding { padding-top: 0px; padding-bottom: 0px; }
+ .no-horizontal-padding { padding-left: 0px; padding-right: 0px; }
+ .no-padding { padding: 0px; } /*done*/
+ /* Padding Section*/
+
+ /* Margin section */
+ .margin-top { margin-top: 10px; } /*done*/
+ .margin-bottom { margin-bottom: 10px; } /*done*/
+ .margin-right { margin-right: 10px; } /*done*/
+ .margin-left { margin-left: 10px; } /*done*/
+ .margin-horizontal { margin-left: 10px; margin-right: 10px; } /*done*/
+ .margin-vertical { margin-top: 10px; margin-bottom: 10px; } /*done*/
+ .margin-all { margin: 10px; } /*done*/
+ .no-margin { margin: 0px; } /*done*/
+
+ .no-vertical-margin { margin-top: 0px; margin-bottom: 0px; }
+ .no-horizontal-margin { margin-left: 0px; margin-right: 0px; }
+
+ .inside-col-shrink { margin: 0px 20px; } /*done - For the inside sections that has also Title section*/
+ /* Margin section */
+
+ hr
+ { margin: 0px; padding: 0px; border-top: 1px dashed #999; }
+/*--------------------------------------------FrameWork------------------------*/
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/not-found/not-found.component.spec.ts b/otf-frontend/client/src/app/not-found/not-found.component.spec.ts
new file mode 100644
index 0000000..ba9de87
--- /dev/null
+++ b/otf-frontend/client/src/app/not-found/not-found.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { NotFoundComponent } from './not-found.component';
+
+describe('NotFoundComponent', () => {
+ let component: NotFoundComponent;
+ let fixture: ComponentFixture<NotFoundComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ NotFoundComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(NotFoundComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/not-found/not-found.component.ts b/otf-frontend/client/src/app/not-found/not-found.component.ts
new file mode 100644
index 0000000..1aa6b9e
--- /dev/null
+++ b/otf-frontend/client/src/app/not-found/not-found.component.ts
@@ -0,0 +1,69 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
+import * as $ from 'jquery';
+
+@Component({
+ selector: 'app-not-found',
+ templateUrl: './not-found.component.html',
+ styleUrls: ['./not-found.component.scss']
+})
+export class NotFoundComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ var loop1, loop2, loop3, time = 30, i = 0, number, selector3 = $('.thirdDigit'), selector2 = $('.secondDigit'),
+ selector1 = $('.firstDigit');
+ loop3 = setInterval(() => {
+ "use strict";
+ if (i > 40) {
+ clearInterval(loop3);
+ selector3.text(4);
+ } else {
+ selector3.text(this.randomNum());
+ i++;
+ }
+ }, time);
+ loop2 = setInterval(() => {
+ "use strict";
+ if (i > 80) {
+ clearInterval(loop2);
+ selector2.text(0);
+ } else {
+ selector2.text(this.randomNum());
+ i++;
+ }
+ }, time);
+ loop1 = setInterval( () => {
+ "use strict";
+ if (i > 100) {
+ clearInterval(loop1);
+ selector1.text(4);
+ } else {
+ selector1.text(this.randomNum());
+ i++;
+ }
+ }, time);
+ }
+
+ randomNum() {
+ "use strict";
+ return Math.floor(Math.random() * 9) + 1;
+ }
+
+}
diff --git a/otf-frontend/client/src/app/not-found/not-found.module.spec.ts b/otf-frontend/client/src/app/not-found/not-found.module.spec.ts
new file mode 100644
index 0000000..a24eea2
--- /dev/null
+++ b/otf-frontend/client/src/app/not-found/not-found.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NotFoundModule } from './not-found.module';
+
+describe('NotFoundModule', () => {
+ let notFoundModule: NotFoundModule;
+
+ beforeEach(() => {
+ notFoundModule = new NotFoundModule();
+ });
+
+ it('should create an instance', () => {
+ expect(notFoundModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/not-found/not-found.module.ts b/otf-frontend/client/src/app/not-found/not-found.module.ts
new file mode 100644
index 0000000..2bcb72f
--- /dev/null
+++ b/otf-frontend/client/src/app/not-found/not-found.module.ts
@@ -0,0 +1,30 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+import { NotFoundRoutingModule } from './not-found-routing.module';
+import { NotFoundComponent } from './not-found.component';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ NotFoundRoutingModule
+ ],
+ declarations: [NotFoundComponent]
+})
+export class NotFoundModule { }
diff --git a/otf-frontend/client/src/app/router.animations.ts b/otf-frontend/client/src/app/router.animations.ts
new file mode 100644
index 0000000..30cf59f
--- /dev/null
+++ b/otf-frontend/client/src/app/router.animations.ts
@@ -0,0 +1,178 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { animate, group, query, state, style, transition, trigger } from '@angular/animations';
+
+export function routerTransition() {
+ return slideToTop();
+}
+
+export function routerLeftTransition() {
+ return slideToLeft();
+}
+
+export function slideToRight() {
+ return trigger('routerTransition', [
+ state('void', style({})),
+ state('*', style({})),
+ transition(':enter', [
+ style({ transform: 'translateX(-100%)' }),
+ animate('0.5s ease-in-out', style({ transform: 'translateX(0%)' }))
+ ]),
+ transition(':leave', [
+ style({ transform: 'translateX(0%)' }),
+ animate('0.5s ease-in-out', style({ transform: 'translateX(100%)' }))
+ ])
+ ]);
+}
+
+export function slideToLeft() {
+ return trigger('routerTransition', [
+ state('void', style({})),
+ state('*', style({})),
+ transition(':enter', [
+ style({ transform: 'translateX(100%)' }),
+ animate('0.5s ease-in-out', style({ transform: 'translateX(0%)' }))
+ ]),
+ transition(':leave', [
+ style({ transform: 'translateX(0%)' }),
+ animate('0.5s ease-in-out', style({ transform: 'translateX(-100%)' }))
+ ])
+ ]);
+}
+
+export function slideToBottom() {
+ return trigger('routerTransition', [
+ state('void', style({})),
+ state('*', style({})),
+ transition(':enter', [
+ style({ transform: 'translateY(-100%)' }),
+ animate('0.5s ease-in-out', style({ transform: 'translateY(0%)' }))
+ ]),
+ transition(':leave', [
+ style({ transform: 'translateY(0%)' }),
+ animate('0.5s ease-in-out', style({ transform: 'translateY(100%)' }))
+ ])
+ ]);
+}
+
+export function slideToTop() {
+ return trigger('routerTransition', [
+ state('void', style({})),
+ state('*', style({})),
+ transition(':enter', [
+ style({ transform: 'translateY(100%)' }),
+ animate('0.5s ease-in-out', style({ transform: 'translateY(0%)' }))
+ ]),
+ transition(':leave', [
+ style({ transform: 'translateY(0%)' }),
+ animate('0.5s ease-in-out', style({ transform: 'translateY(-100%)' }))
+ ])
+ ]);
+}
+
+
+export function routerTransitionCustom() {
+ alert("");
+ return trigger('routerAnimation', [
+ state('void', style({})),
+ state('*', style({})),
+ // LEFT TO RIGHT AKA RESET
+ transition('* => 0', [
+ // Initial state of new route
+ query(':enter',
+ style({
+ position: 'fixed',
+ width: '100%',
+ transform: 'translateX(-100%)'
+ }), { optional: true }),
+ // move page off screen right on leave
+ query(':leave',
+ animate('500ms ease',
+ style({
+ position: 'fixed',
+ width: '100%',
+ transform: 'translateX(100%)',
+ })
+ ), { optional: true }),
+ // move page in screen from left to right
+ query(':enter',
+ animate('500ms ease',
+ style({
+ opacity: 1,
+ transform: 'translateX(0%)'
+ })
+ ), { optional: true }),
+ ]),
+ // LEFT TO RIGHT AKA PREVIOUS
+ transition('* => 1', [
+ // Initial state of new route
+ query(':enter',
+ style({
+ position: 'fixed',
+ width: '100%',
+ transform: 'translateX(-100%)'
+ }), { optional: true }),
+ // move page off screen right on leave
+ query(':leave',
+ animate('500ms ease',
+ style({
+ position: 'fixed',
+ width: '100%',
+ transform: 'translateX(100%)',
+ })
+ ), { optional: true }),
+ // move page in screen from left to right
+ query(':enter',
+ animate('500ms ease',
+ style({
+ opacity: 1,
+ transform: 'translateX(0%)'
+ })
+ ), { optional: true }),
+ ]),
+ // RIGHT TO LEFT AKA NEXT
+ transition('* => 2', [
+ // Initial state of new route
+ query(':enter',
+ style({
+ position: 'fixed',
+ width: '100%',
+ transform: 'translateX(100%)'
+ }), { optional: true }),
+ // move page off screen right on leave
+ query(':leave',
+ animate('500ms ease',
+ style({
+ position: 'fixed',
+ width: '100%',
+ transform: 'translateX(-100%)',
+ })
+ ), { optional: true }),
+ // move page in screen from left to right
+ query(':enter',
+ animate('500ms ease',
+ style({
+ opacity: 1,
+ transform: 'translateX(0%)'
+ })
+ ), { optional: true }),
+ ])
+
+ ]);
+
+}
+
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/server-error/server-error-routing.module.ts b/otf-frontend/client/src/app/server-error/server-error-routing.module.ts
new file mode 100644
index 0000000..90615dc
--- /dev/null
+++ b/otf-frontend/client/src/app/server-error/server-error-routing.module.ts
@@ -0,0 +1,32 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { ServerErrorComponent } from './server-error.component';
+
+const routes: Routes = [
+ {
+ path: '', component: ServerErrorComponent
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class ServerErrorRoutingModule {
+}
diff --git a/otf-frontend/client/src/app/server-error/server-error.component.html b/otf-frontend/client/src/app/server-error/server-error.component.html
new file mode 100644
index 0000000..40b6cc4
--- /dev/null
+++ b/otf-frontend/client/src/app/server-error/server-error.component.html
@@ -0,0 +1,19 @@
+<!-- Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+#############################################################################-->
+
+
+<p>
+ server-error works!
+</p>
diff --git a/otf-frontend/client/src/app/server-error/server-error.component.scss b/otf-frontend/client/src/app/server-error/server-error.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/server-error/server-error.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/server-error/server-error.component.spec.ts b/otf-frontend/client/src/app/server-error/server-error.component.spec.ts
new file mode 100644
index 0000000..a0a97b8
--- /dev/null
+++ b/otf-frontend/client/src/app/server-error/server-error.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ServerErrorComponent } from './server-error.component';
+
+describe('ServerErrorComponent', () => {
+ let component: ServerErrorComponent;
+ let fixture: ComponentFixture<ServerErrorComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ServerErrorComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ServerErrorComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/server-error/server-error.component.ts b/otf-frontend/client/src/app/server-error/server-error.component.ts
new file mode 100644
index 0000000..31b4fb6
--- /dev/null
+++ b/otf-frontend/client/src/app/server-error/server-error.component.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-server-error',
+ templateUrl: './server-error.component.html',
+ styleUrls: ['./server-error.component.scss']
+})
+export class ServerErrorComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+}
diff --git a/otf-frontend/client/src/app/server-error/server-error.module.spec.ts b/otf-frontend/client/src/app/server-error/server-error.module.spec.ts
new file mode 100644
index 0000000..c5decc5
--- /dev/null
+++ b/otf-frontend/client/src/app/server-error/server-error.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { ServerErrorModule } from './server-error.module';
+
+describe('ServerErrorModule', () => {
+ let serverErrorModule: ServerErrorModule;
+
+ beforeEach(() => {
+ serverErrorModule = new ServerErrorModule();
+ });
+
+ it('should create an instance', () => {
+ expect(serverErrorModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/server-error/server-error.module.ts b/otf-frontend/client/src/app/server-error/server-error.module.ts
new file mode 100644
index 0000000..835a80b
--- /dev/null
+++ b/otf-frontend/client/src/app/server-error/server-error.module.ts
@@ -0,0 +1,30 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+import { ServerErrorRoutingModule } from './server-error-routing.module';
+import { ServerErrorComponent } from './server-error.component';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ ServerErrorRoutingModule
+ ],
+ declarations: [ServerErrorComponent]
+})
+export class ServerErrorModule { }
diff --git a/otf-frontend/client/src/app/shared/components/menu-item/menu-item.component.pug b/otf-frontend/client/src/app/shared/components/menu-item/menu-item.component.pug
new file mode 100644
index 0000000..548ac7c
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/components/menu-item/menu-item.component.pug
@@ -0,0 +1,29 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+mat-menu(#childMenu='matMenu', [overlapTrigger]='false')
+ span(*ngFor='let child of items')
+ // Handle branch node menu items
+ span(*ngIf='child.children && child.children.length > 0')
+ button(mat-menu-item='', color='primary', (click)="sendSelected(child)", [matMenuTriggerFor]='menu.childMenu')
+ mat-icon(*ngIf="child.iconName") {{child.iconName}}
+ span {{child.displayName}}
+ app-menu-item(#menu='', [items]='child.children', (dataEvent)="receiveSelected($event)")
+ // Handle leaf node menu items
+ span(*ngIf='!child.children || child.children.length === 0')
+ button(mat-menu-item='', (click)="sendSelected(child)")
+ mat-icon(*ngIf="child.iconName") {{child.iconName}}
+ span {{child.displayName}}
diff --git a/otf-frontend/client/src/app/shared/components/menu-item/menu-item.component.scss b/otf-frontend/client/src/app/shared/components/menu-item/menu-item.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/components/menu-item/menu-item.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/shared/components/menu-item/menu-item.component.spec.ts b/otf-frontend/client/src/app/shared/components/menu-item/menu-item.component.spec.ts
new file mode 100644
index 0000000..73b7e97
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/components/menu-item/menu-item.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { MenuItemComponent } from './menu-item.component';
+
+describe('MenuItemComponent', () => {
+ let component: MenuItemComponent;
+ let fixture: ComponentFixture<MenuItemComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ MenuItemComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(MenuItemComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/components/menu-item/menu-item.component.ts b/otf-frontend/client/src/app/shared/components/menu-item/menu-item.component.ts
new file mode 100644
index 0000000..426ca43
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/components/menu-item/menu-item.component.ts
@@ -0,0 +1,54 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Input, ViewChild, Output, EventEmitter } from '@angular/core';
+import { Router } from '@angular/router';
+
+export interface NavItem {
+ displayName: string;
+ disabled?: boolean;
+ iconName?: string;
+ route?: string;
+ click?: any;
+ children?: NavItem[];
+}
+
+@Component({
+ selector: 'app-menu-item',
+ templateUrl: './menu-item.component.pug',
+ styleUrls: ['./menu-item.component.scss']
+})
+
+export class MenuItemComponent implements OnInit {
+
+ @Input() items: NavItem[];
+ @ViewChild('childMenu') public childMenu;
+ @Output() dataEvent = new EventEmitter<any>();
+
+ constructor(public router: Router) { }
+
+ ngOnInit() {
+ }
+
+ receiveSelected($event){
+ this.sendSelected($event);
+ }
+
+ sendSelected(data){
+ this.dataEvent.emit(data)
+ }
+
+}
diff --git a/otf-frontend/client/src/app/shared/factories/bpmn-factory.service.spec.ts b/otf-frontend/client/src/app/shared/factories/bpmn-factory.service.spec.ts
new file mode 100644
index 0000000..1068c95
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/factories/bpmn-factory.service.spec.ts
@@ -0,0 +1,28 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestBed } from '@angular/core/testing';
+
+import { BpmnFactoryService } from './bpmn-factory.service';
+
+describe('BpmnFactoryService', () => {
+ beforeEach(() => TestBed.configureTestingModule({}));
+
+ it('should be created', () => {
+ const service: BpmnFactoryService = TestBed.get(BpmnFactoryService);
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/factories/bpmn-factory.service.ts b/otf-frontend/client/src/app/shared/factories/bpmn-factory.service.ts
new file mode 100644
index 0000000..1a92854
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/factories/bpmn-factory.service.ts
@@ -0,0 +1,132 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from '@angular/core';
+import { FileTransferService } from '../services/file-transfer.service';
+import { TestDefinitionService } from '../services/test-definition.service';
+import { Observable } from 'rxjs';
+import { Buffer } from 'buffer';
+import { BpmnOptions, Bpmn } from '../models/bpmn.model';
+
+interface BpmnFactoryOptions extends BpmnOptions {
+ fileId?: String,
+ testDefinitionId?: String,
+ version?: String,
+ xml?: String
+}
+
+@Injectable({
+ providedIn: 'root'
+})
+export class BpmnFactoryService {
+
+ constructor(
+ private filesTransfer: FileTransferService,
+ private testDefinition: TestDefinitionService
+ ) { }
+
+ public async setup(options: BpmnFactoryOptions): Promise<any> {
+ return new Promise(async (resolve, reject) => {
+ //check for required options
+ if (!options.mode) {
+ console.error('Bpmn options require: mode');
+ reject('Bpmn options require: mode')
+ }
+
+ let xml = await this.getXml(options);
+
+ let instance = new Bpmn(xml, {
+ mode: options.mode,
+ options: options.options
+ })
+
+ resolve(instance);
+ });
+
+ }
+
+ public async getXml(options): Promise<any> {
+ return new Promise(async (resolve, reject) => {
+ let xml;
+
+ //handle the way to retrieve bpmn xml
+ if (options.xml) {
+ xml = options.xml
+ } else if (options.fileId) {
+ xml = await this.loadFile(options.fileId);
+ } else if (options.testDefinitionId && options.version) {
+ let fileId = await this.getFileId(options.testDefinitionId, options.version);
+ xml = await this.loadFile(fileId);
+ } else if (options.testDefinitionId) {
+ let fileId = await this.getFileId(options.testDefinitionId);
+ xml = await this.loadFile(fileId);
+ } else {
+ console.warn('Either xml, fileId, testDefinitionId and version, or testDefinitionId is required to render the bpmn');
+ }
+
+ resolve(xml);
+
+ });
+
+ }
+
+ private getFileId(id, version?): Observable<Object> {
+ return new Observable(observer => {
+ this.testDefinition.get(id).subscribe(
+ data => {
+ if (data['bpmnInstances']) {
+ if (version) {
+ let index;
+ for (let i = 0; i < data['bpmnInstances'].length; i++) {
+ if (version == data['bpmnInstances'][i].version) {
+ index = i;
+ break;
+ }
+ }
+ if (index) {
+ observer.next(data['bpmnInstances'][index].bpmnFileId);
+ } else {
+ observer.error('No bpmn file');
+ }
+
+ } else {
+ if (data['bpmnInstances'][data['bpmnInstances'].length - 1].bpmnFileId) {
+ observer.next(data['bpmnInstances'][data['bpmnInstances'].length - 1].bpmnFileId);
+ } else {
+ observer.error('No bpmn file');
+ }
+ }
+ } else {
+ observer.error('No bpmn instances');
+ }
+ },
+ err => {
+ observer.error('No test definition found');
+ }
+ )
+ })
+ }
+
+ public loadFile(bpmnFileId) {
+ return new Promise((resolve, reject) => {
+ this.filesTransfer.get(bpmnFileId).subscribe(content => {
+ resolve(new Buffer(content as Buffer).toString());
+ }, err => {
+ reject(err);
+ });
+ });
+ }
+}
diff --git a/otf-frontend/client/src/app/shared/guard/admin.guard.spec.ts b/otf-frontend/client/src/app/shared/guard/admin.guard.spec.ts
new file mode 100644
index 0000000..ec3d6ba
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/guard/admin.guard.spec.ts
@@ -0,0 +1,33 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestBed, async, inject } from '@angular/core/testing';
+import { RouterTestingModule } from '@angular/router/testing';
+
+import { AdminGuard } from './admin.guard';
+
+describe('AdminGuard', () => {
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ imports: [ RouterTestingModule ],
+ providers: [AdminGuard]
+ });
+ });
+
+ it('should ...', inject([AdminGuard], (guard: AdminGuard) => {
+ expect(guard).toBeTruthy();
+ }));
+});
diff --git a/otf-frontend/client/src/app/shared/guard/admin.guard.ts b/otf-frontend/client/src/app/shared/guard/admin.guard.ts
new file mode 100644
index 0000000..12e2cc9
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/guard/admin.guard.ts
@@ -0,0 +1,48 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from '@angular/core';
+import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
+import { HttpClient, HttpHandler, HttpHeaders } from '@angular/common/http';
+import { AppGlobals } from 'app/app.global';
+import { UserService } from '../services/user.service';
+import { CookieService } from 'ngx-cookie-service';
+
+@Injectable()
+export class AdminGuard implements CanActivate {
+
+ constructor(private router: Router, private http: HttpClient, private cookie: CookieService) { }
+
+ async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
+
+ if (this.cookie.get('access_token') && this.cookie.get('currentUser')) {
+ let currentUser = JSON.parse(this.cookie.get('currentUser'));
+ if(currentUser['permissions'].indexOf('admin') >= 0){
+ return true;
+ }
+ else{
+ this.router.navigate(['/dashboard'], { queryParams: { returnUrl: state.url }});
+ return false;
+ }
+ }
+ // not logged in so redirect to login page with the return url
+ this.router.navigate(['/dashboard'], { queryParams: { returnUrl: state.url }});
+ return false;
+
+
+
+ }
+}
diff --git a/otf-frontend/client/src/app/shared/guard/auth.guard.spec.ts b/otf-frontend/client/src/app/shared/guard/auth.guard.spec.ts
new file mode 100644
index 0000000..a13902d
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/guard/auth.guard.spec.ts
@@ -0,0 +1,33 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestBed, async, inject } from '@angular/core/testing';
+import { RouterTestingModule } from '@angular/router/testing';
+
+import { AuthGuard } from './auth.guard';
+
+describe('AuthGuard', () => {
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ imports: [ RouterTestingModule ],
+ providers: [AuthGuard]
+ });
+ });
+
+ it('should ...', inject([AuthGuard], (guard: AuthGuard) => {
+ expect(guard).toBeTruthy();
+ }));
+});
diff --git a/otf-frontend/client/src/app/shared/guard/auth.guard.ts b/otf-frontend/client/src/app/shared/guard/auth.guard.ts
new file mode 100644
index 0000000..621bb0e
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/guard/auth.guard.ts
@@ -0,0 +1,38 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from '@angular/core';
+import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
+import { HttpClient, HttpHandler, HttpHeaders } from '@angular/common/http';
+import { AppGlobals } from 'app/app.global';
+import { UserService } from '../services/user.service';
+import { CookieService } from 'ngx-cookie-service';
+
+@Injectable()
+export class AuthGuard implements CanActivate {
+
+ constructor(private router: Router, private http: HttpClient, private cookie: CookieService) { }
+
+ async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
+ if (this.cookie.check('access_token') && window.localStorage.getItem('access_token')) {
+ return true;
+ }
+
+ // not logged in so redirect to login page with the return url
+ this.router.navigate(['/login'], { queryParams: { returnUrl: state.url }});
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/guard/index.ts b/otf-frontend/client/src/app/shared/guard/index.ts
new file mode 100644
index 0000000..30a32cf
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/guard/index.ts
@@ -0,0 +1,18 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+export * from './auth.guard';
+export * from './admin.guard';
diff --git a/otf-frontend/client/src/app/shared/index.ts b/otf-frontend/client/src/app/shared/index.ts
new file mode 100644
index 0000000..edc253b
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/index.ts
@@ -0,0 +1,19 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+export * from './modules';
+export * from './pipes/shared-pipes.module';
+export * from './guard';
diff --git a/otf-frontend/client/src/app/shared/models/base-model.model.ts b/otf-frontend/client/src/app/shared/models/base-model.model.ts
new file mode 100644
index 0000000..a89a591
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/models/base-model.model.ts
@@ -0,0 +1,23 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+export interface BaseModel {
+ _id: String;
+ createdAt: String;
+ createdBy: String;
+ updatedAt: String;
+ updatedBy: String;
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/models/bpmn.model.ts b/otf-frontend/client/src/app/shared/models/bpmn.model.ts
new file mode 100644
index 0000000..ab274f8
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/models/bpmn.model.ts
@@ -0,0 +1,159 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import Modeler from 'bpmn-js/lib/Modeler';
+import Viewer from 'bpmn-js/lib/NavigatedViewer';
+import { FileTransferService } from 'app/shared/services/file-transfer.service';
+import { Observable } from 'rxjs';
+import { TestDefinitionService } from 'app/shared/services/test-definition.service';
+
+import { saveAs } from 'file-saver';
+//import { parseString } from 'xml2js';
+import { HostListener } from '@angular/core';
+
+export interface BpmnOptions {
+ mode: 'viewer' | 'modeler',
+ options: {
+ container: any
+ }
+}
+
+export class Bpmn {
+
+ protected model: any;
+ protected bpmnXml: String;
+ private options: BpmnOptions;
+
+ constructor(bpmnXml: String, options: BpmnOptions) {
+ //check for required options
+ if (!options.mode) {
+ console.error('Bpmn options require: mode');
+ }
+
+ this.bpmnXml = bpmnXml;
+ this.options = options;
+
+ //setup model
+ this.setModel();
+
+ //render diagram
+ this.renderDiagram();
+ }
+
+ // Getters
+
+ public getModel() {
+ return this.model;
+ }
+
+ public async getBpmnXml() {
+ return new Promise((resolve, reject) => {
+ this.model.saveXML({ format: true }, function (err, xml) {
+ if(err){
+ reject(err);
+ }
+ resolve(xml);
+ })
+ });
+ }
+
+ // Setters
+
+ private setModel(options?) {
+
+ if (this.model) {
+ return -1;
+ }
+
+ let op = this.options.options;
+
+ if (options) {
+ op = options;
+ }
+
+ if (!op) {
+ console.error('Options for the viewer/modeler must be provided');
+ return -1;
+ }
+
+ //handle the mode (viewer or modeler)
+ switch (this.options.mode.toLowerCase()) {
+ case 'viewer':
+ this.model = new Viewer(op);
+ break;
+
+ case 'modeler':
+ this.model = new Modeler(op);
+ break;
+
+ default:
+ console.error('Mode must either be "viewer" or "modeler"');
+ return;
+ }
+
+ }
+
+ public async setBpmnXml(xml) {
+ this.bpmnXml = xml;
+ await this.renderDiagram();
+ }
+
+ // Methods
+
+ public async renderDiagram() {
+ return new Promise((resolve, reject) => {
+ if (this.bpmnXml) {
+ this.model.importXML(this.bpmnXml, (err) => {
+ if (!err) {
+ this.model.get('canvas').zoom('fit-viewport');
+ resolve(true)
+ } else {
+ console.error(err);
+ resolve(false);
+ }
+ });
+ }
+ })
+ }
+
+ public resize() {
+ this.model.get('canvas').zoom('fit-viewport');
+ }
+
+ public download(saveName?) {
+
+ this.model.saveXML({ format: true }, function (err, xml) {
+ if (!saveName) {
+ let parser = new DOMParser();
+ let xmlDoc = parser.parseFromString(xml.toString(), "text/xml");
+
+ let id = xmlDoc.getElementsByTagName("bpmn:process")[0].attributes.getNamedItem("id").value;
+
+ if (id) {
+ saveName = id;
+ } else {
+ saveName = 'workflow';
+ }
+ }
+
+ saveName += ".bpmn";
+
+ let blob = new Blob([xml], { type: "application/xml" });
+ saveAs(blob, saveName);
+ })
+ }
+
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/models/group.model.ts b/otf-frontend/client/src/app/shared/models/group.model.ts
new file mode 100644
index 0000000..86538fa
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/models/group.model.ts
@@ -0,0 +1,51 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { BaseModel } from "./base-model.model";
+
+export interface Group extends BaseModel{
+
+ groupName: String;
+ groupDescription: String;
+ parentGroupId: String;
+ ownerId: String;
+ mechanizedIds: Array<String>;
+
+}
+
+
+export class Groups implements Group {
+ groupName: String;
+ groupDescription: String;
+ parentGroupId: String;
+ ownerId: String;
+ mechanizedIds: String[];
+ _id: String;
+ createdAt: String;
+ createdBy: String;
+ updatedAt: String;
+ updatedBy: String;
+
+ static get modelName(){
+ return 'groups';
+ }
+
+ constructor(group){
+ this._id = group._id;
+ this.groupName = group.groupName;
+ this.parentGroupId = group.parentGroupId;
+ }
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/models/test-definition.model.ts b/otf-frontend/client/src/app/shared/models/test-definition.model.ts
new file mode 100644
index 0000000..c996761
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/models/test-definition.model.ts
@@ -0,0 +1,60 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { BaseModel } from "./base-model.model";
+
+export interface TestDefinition extends BaseModel {
+
+ testName: String;
+ testDescription: String;
+ processDefinitionKey: String;
+ groupId: String;
+
+ bpmnInstances: Array<BpmnInstance>;
+
+ disabled: Boolean;
+
+}
+
+export interface BpmnInstance {
+ processDefinitionId: String;
+ deploymentId: String;
+ version: String;
+ bpmnFileId: String;
+ resourceFileId: String;
+ isDeployed: Boolean;
+
+ testHeads: Array<TestHeadRef>;
+ pflos: Array<Pflow>;
+
+ testDataTemplate: Object;
+
+ updatedBy: String;
+ createdBy: String;
+ createdAt: String;
+ updatedAt: String;
+}
+
+export interface TestHeadRef {
+ testHeadId: String;
+ bpmnVthTaskId: String;
+ label: String;
+}
+
+export interface Pflow {
+ bpmnPflowTaskId: String;
+ label: String;
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/models/test-execution.model.ts b/otf-frontend/client/src/app/shared/models/test-execution.model.ts
new file mode 100644
index 0000000..9f410b5
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/models/test-execution.model.ts
@@ -0,0 +1,39 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestDefinition } from "./test-definition.model";
+import { TestInstance } from "./test-instance.model";
+
+export interface TestExecution {
+
+ _id: String;
+ processInstanceId: String;
+ businessKey: String;
+ testResult: String;
+ testDetails: Object;
+ startTime: Date;
+ endTime: Date;
+ async: Boolean;
+ asyncTopic: String;
+ groupId: String;
+ executorId: String;
+ testHeadResults: Array<Object>;
+ testInstanceResults: Array<Object>;
+ historicEmail: String;
+ historicTestInstance: TestInstance;
+ historicTestDefinition: TestDefinition;
+
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/models/test-head.model.ts b/otf-frontend/client/src/app/shared/models/test-head.model.ts
new file mode 100644
index 0000000..ef28772
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/models/test-head.model.ts
@@ -0,0 +1,34 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { BaseModel } from "./base-model.model";
+
+export interface TestHead extends BaseModel {
+
+ testHeadName: String;
+ testHeadDescription: String;
+ testHeadType: String;
+ vthInputTemplate: Object;
+ vendor: String;
+ port: String;
+ hostname: String;
+ resourcePath: String;
+ groupId: String;
+ authorizationType: String,
+ authorizationCredential: String,
+ authorizationEnabled: Boolean,
+
+}
diff --git a/otf-frontend/client/src/app/shared/models/test-instance.model.ts b/otf-frontend/client/src/app/shared/models/test-instance.model.ts
new file mode 100644
index 0000000..9bac1c0
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/models/test-instance.model.ts
@@ -0,0 +1,36 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { BaseModel } from "./base-model.model";
+
+export interface TestInstance extends BaseModel {
+
+ testInstanceName: String;
+ testInstanceDescription: String;
+ testDefinitionId: String;
+ useLatestDefinition: Boolean;
+ processDefinitionId: String;
+ testData: Object;
+ internalTestData: Object;
+ simulationMode: Boolean;
+ simulationVthInput: Object;
+ vthInput: Object;
+ pfloInput: Object;
+ disabled: Boolean;
+ maxExecutionTimeInMillis: Number;
+ groupId: String;
+
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/models/user.model.ts b/otf-frontend/client/src/app/shared/models/user.model.ts
new file mode 100644
index 0000000..9e75b95
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/models/user.model.ts
@@ -0,0 +1,45 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { BaseModel } from "./base-model.model";
+
+export interface User extends BaseModel {
+
+ firstName: String;
+ lastName: String;
+ email: String;
+ permissions: Array<String>;
+ password: String;
+
+ groups: Array<GroupRef>;
+
+ favorites: Object;
+
+ enabled: Boolean;
+ isVerified: Boolean;
+ verifyToken: String;
+ verifyExpires: Date;
+ verifyChanges: Object;
+
+ resetToken: String;
+ resetExpires: DataCue;
+
+}
+
+interface GroupRef {
+ groupId: String;
+ permissions: Array<String>;
+}
diff --git a/otf-frontend/client/src/app/shared/modules/alert-modal/alert-modal.component.pug b/otf-frontend/client/src/app/shared/modules/alert-modal/alert-modal.component.pug
new file mode 100644
index 0000000..1db2cd3
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/alert-modal/alert-modal.component.pug
@@ -0,0 +1,83 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div(*ngIf = 'type == "warning"')
+ h2(mat-dialog-title)
+ i.fa.fa-warning
+ div Warning
+ mat-dialog-content
+ p(style="text-align: center") {{data.message}}
+ mat-dialog-actions
+ button(mat-raised-button, color="primary", aria-label='View', (click) = "okay()") OK
+
+div(*ngIf = 'type == "confirmation"')
+ h2(mat-dialog-title)
+ i.fa.fa-check
+ div Confirm
+ mat-dialog-content
+ p(style="text-align: center") {{data.message}}
+ mat-dialog-actions
+ button(mat-raised-button, color="primary", aria-label='Yes', (click) = "confirmed()") Yes
+ button(mat-raised-button, color="primary", aria-label='Cancel', (click) = "canceled()") Cancel
+
+div(*ngIf = 'type == "userAdmin"')
+ h2(mat-dialog-title)
+ i.fa.fa-question
+ div Choose
+ mat-dialog-content
+ p(style="text-align: center") {{data.message}}
+ mat-dialog-actions
+ button(mat-raised-button, color="primary", aria-label='Yes', (click) = "confirmed()") Admin
+ button(mat-raised-button, color="primary", aria-label='Cancel', (click) = "canceled()") User
+
+div(*ngIf = 'type == "alert"')
+ h2(mat-dialog-title)
+ i.fa.fa-times-circle-o
+ div Error
+ mat-dialog-content
+ p(style="text-align: center") {{data.message}}
+ mat-dialog-actions
+ button.bg-primary.mbtn.text-white.mr-1(mat-raised-button, aria-label='OK', (click) = "okay()") OK
+
+div(*ngIf = 'type == "ok"')
+ h2(mat-dialog-title)
+ i.fa.fa-check
+ div Alert
+ mat-dialog-content
+ p(*ngIf="html", [innerHtml]="html")
+ p(*ngIf="!html", style="text-align: center") {{data.message}}
+ mat-dialog-actions
+ button.bg-primary.mbtn.text-white.mr-1(mat-raised-button, aria-label='OK', (click) = "okay()") OK
+
+div(*ngIf = 'type == "info"')
+ h2(mat-dialog-title)
+ div Info
+ mat-dialog-content
+ p(*ngIf="html", [innerHtml]="html")
+ p(*ngIf="!html", style="text-align: center") {{data.message}}
+ mat-dialog-actions
+ button.bg-primary.mbtn.text-white.mr-1(mat-raised-button, aria-label='OK', (click) = "okay()") OK
+
+
+
+//<h1 mat-dialog-title>Add file</h1>
+ <mat-dialog-content>
+ Content goes here
+ </mat-dialog-content>
+ <mat-dialog-actions>
+ <button mat-button>Add</button>
+ <button mat-button>Cancel</button>
+ </mat-dialog-actions>
diff --git a/otf-frontend/client/src/app/shared/modules/alert-modal/alert-modal.component.scss b/otf-frontend/client/src/app/shared/modules/alert-modal/alert-modal.component.scss
new file mode 100644
index 0000000..608c6cc
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/alert-modal/alert-modal.component.scss
@@ -0,0 +1,38 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.fa-warning{
+ color: #FFCC00;
+}
+.fa-times-circle-o{
+ color: red;
+}
+
+.fa-check {
+ color: green;
+}
+
+mat-dialog-actions .mat-raised-button {
+ margin: auto;
+}
+
+.mat-dialog-title {
+ text-align: center;
+}
+
+i {
+ font-size: 30px;
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/modules/alert-modal/alert-modal.component.spec.ts b/otf-frontend/client/src/app/shared/modules/alert-modal/alert-modal.component.spec.ts
new file mode 100644
index 0000000..01ad3d6
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/alert-modal/alert-modal.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { AlertModalComponent } from './alert-modal.component';
+
+describe('AlertModalComponent', () => {
+ let component: AlertModalComponent;
+ let fixture: ComponentFixture<AlertModalComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ AlertModalComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(AlertModalComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/alert-modal/alert-modal.component.ts b/otf-frontend/client/src/app/shared/modules/alert-modal/alert-modal.component.ts
new file mode 100644
index 0000000..6904ebf
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/alert-modal/alert-modal.component.ts
@@ -0,0 +1,67 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import {Component, Inject, OnInit} from '@angular/core';
+import {MAT_DIALOG_DATA, MatDialogRef,} from '@angular/material';
+
+@Component({
+ selector: 'app-alert-modal',
+ templateUrl: './alert-modal.component.pug',
+ styleUrls: ['./alert-modal.component.scss']
+})
+export class AlertModalComponent implements OnInit {
+ public data;
+ public type;
+ public html;
+
+ constructor(
+ public dialogRef: MatDialogRef<AlertModalComponent>,
+ @Inject(MAT_DIALOG_DATA) public input_data
+ ) {
+ this.data = this.input_data;
+ if (this.data.type.match(new RegExp('^warning$', 'i'))) {
+ this.type = 'warning';
+ } else if (this.data.type.match(new RegExp('^confirmation$', 'i'))) {
+ this.type = 'confirmation';
+ } else if (this.data.type.match(new RegExp('^alert$', 'i'))) {
+ this.type = 'alert';
+ } else if (this.data.type.match(new RegExp('^ok$', 'i'))) {
+ this.type = 'ok';
+ } else if (this.data.type.match(new RegExp('^userAdmin$', 'i'))) {
+ this.type = 'userAdmin';
+ } else {
+ this.type = 'info';
+ }
+ }
+
+ ngOnInit() {
+ if(this.data.html){
+ this.html = this.data.html;
+ }
+ }
+
+ okay() {
+ this.dialogRef.close();
+ }
+
+ confirmed() {
+ this.dialogRef.close(true);
+ }
+
+ canceled() {
+ this.dialogRef.close(false);
+ }
+}
diff --git a/otf-frontend/client/src/app/shared/modules/alert-modal/alert-modal.module.spec.ts b/otf-frontend/client/src/app/shared/modules/alert-modal/alert-modal.module.spec.ts
new file mode 100644
index 0000000..bfe72d1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/alert-modal/alert-modal.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { AlertModalModule } from './alert-modal.module';
+
+describe('AlertModalModule', () => {
+ let alertModalModule: AlertModalModule;
+
+ beforeEach(() => {
+ alertModalModule = new AlertModalModule();
+ });
+
+ it('should create an instance', () => {
+ expect(alertModalModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/alert-modal/alert-modal.module.ts b/otf-frontend/client/src/app/shared/modules/alert-modal/alert-modal.module.ts
new file mode 100644
index 0000000..3fb4e6b
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/alert-modal/alert-modal.module.ts
@@ -0,0 +1,36 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { AlertModalComponent } from './alert-modal.component';
+import { MatDialogModule, MatButtonModule} from '@angular/material';
+import { FilterPipeModule } from 'ngx-filter-pipe';
+import { FormsModule } from '@angular/forms';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ MatButtonModule,
+ MatDialogModule,
+ FilterPipeModule,
+ FormsModule
+ ],
+ declarations: [AlertModalComponent],
+ exports: [ AlertModalComponent],
+ entryComponents: [AlertModalComponent]
+})
+export class AlertModalModule { }
diff --git a/otf-frontend/client/src/app/shared/modules/alert-snackbar/alert-snackbar.component.pug b/otf-frontend/client/src/app/shared/modules/alert-snackbar/alert-snackbar.component.pug
new file mode 100644
index 0000000..ea28f8f
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/alert-snackbar/alert-snackbar.component.pug
@@ -0,0 +1,19 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+.pull-left
+ mat-icon(style="color: green") check
+.pull-right {{ data.message }}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/modules/alert-snackbar/alert-snackbar.component.scss b/otf-frontend/client/src/app/shared/modules/alert-snackbar/alert-snackbar.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/alert-snackbar/alert-snackbar.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/shared/modules/alert-snackbar/alert-snackbar.component.spec.ts b/otf-frontend/client/src/app/shared/modules/alert-snackbar/alert-snackbar.component.spec.ts
new file mode 100644
index 0000000..c17a50e
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/alert-snackbar/alert-snackbar.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { AlertSnackbarComponent } from './alert-snackbar.component';
+
+describe('AlertSnackbarComponent', () => {
+ let component: AlertSnackbarComponent;
+ let fixture: ComponentFixture<AlertSnackbarComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ AlertSnackbarComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(AlertSnackbarComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/alert-snackbar/alert-snackbar.component.ts b/otf-frontend/client/src/app/shared/modules/alert-snackbar/alert-snackbar.component.ts
new file mode 100644
index 0000000..dd0c1d0
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/alert-snackbar/alert-snackbar.component.ts
@@ -0,0 +1,36 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Inject } from '@angular/core';
+import { MAT_SNACK_BAR_DATA, } from '@angular/material';
+
+@Component({
+ selector: 'app-alert-snackbar',
+ templateUrl: './alert-snackbar.component.pug',
+ styleUrls: ['./alert-snackbar.component.scss']
+})
+export class AlertSnackbarComponent implements OnInit {
+
+ public data;
+
+ constructor(@Inject(MAT_SNACK_BAR_DATA) public input_data) {
+ this.data = input_data;
+ }
+
+ ngOnInit() {
+ }
+
+}
diff --git a/otf-frontend/client/src/app/shared/modules/alert-snackbar/alert-snackbar.module.spec.ts b/otf-frontend/client/src/app/shared/modules/alert-snackbar/alert-snackbar.module.spec.ts
new file mode 100644
index 0000000..d7eb3bc
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/alert-snackbar/alert-snackbar.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { AlertSnackbarModule } from './alert-snackbar.module';
+
+describe('AlertSnackbarModule', () => {
+ let alertSnackbarModule: AlertSnackbarModule;
+
+ beforeEach(() => {
+ alertSnackbarModule = new AlertSnackbarModule();
+ });
+
+ it('should create an instance', () => {
+ expect(alertSnackbarModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/alert-snackbar/alert-snackbar.module.ts b/otf-frontend/client/src/app/shared/modules/alert-snackbar/alert-snackbar.module.ts
new file mode 100644
index 0000000..5910877
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/alert-snackbar/alert-snackbar.module.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { AlertSnackbarComponent } from './alert-snackbar.component';
+import { MatSnackBarModule, MatIconModule} from '@angular/material';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ MatSnackBarModule,
+ MatIconModule
+ ],
+ declarations: [AlertSnackbarComponent],
+ entryComponents: [AlertSnackbarComponent]
+})
+export class AlertSnackbarModule { }
diff --git a/otf-frontend/client/src/app/shared/modules/create-group-modal/create-group-modal.component.pug b/otf-frontend/client/src/app/shared/modules/create-group-modal/create-group-modal.component.pug
new file mode 100644
index 0000000..82c37a4
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-group-modal/create-group-modal.component.pug
@@ -0,0 +1,37 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div([@routerTransition])
+ app-page-header([heading]="'Create Group'")
+ form.ml-2(style="width:100%")
+ .row
+ .col-md-6
+ .row
+ mat-form-field.mr-2
+ mat-select([(value)]="newGroup.parentGroupId", placeholder="Parent Group", required)
+ mat-option(value="None") None
+ mat-option(*ngFor="let group of groups", [value]="group._id") {{group.groupName}}
+
+ .row
+ mat-form-field.mr-2(required)
+ input(matInput, placeholder="New Group Name", [(ngModel)]="newGroup.groupName", name="Group Name", required)
+
+ .col-md-6
+ mat-form-field.mr-2
+ textarea(matInput, cdkTextareaAutosize, placeholder="Description", #autosize="cdkTextareaAutosize", cdkAutosizeMinRows="2", cdkAutosizeMaxRows="5", name="description", [(ngModel)]="newGroup.groupDescription")
+
+ button.pull-left(mat-raised-button, color="primary", (click)="createGroup()") Create
+ button.pull-right(mat-raised-button, color="warn", (click)="close()") Cancel
diff --git a/otf-frontend/client/src/app/shared/modules/create-group-modal/create-group-modal.component.scss b/otf-frontend/client/src/app/shared/modules/create-group-modal/create-group-modal.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-group-modal/create-group-modal.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/shared/modules/create-group-modal/create-group-modal.component.spec.ts b/otf-frontend/client/src/app/shared/modules/create-group-modal/create-group-modal.component.spec.ts
new file mode 100644
index 0000000..f6b0153
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-group-modal/create-group-modal.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { CreateGroupModalComponent } from './create-group-modal.component';
+
+describe('CreateGroupModalComponent', () => {
+ let component: CreateGroupModalComponent;
+ let fixture: ComponentFixture<CreateGroupModalComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ CreateGroupModalComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(CreateGroupModalComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/create-group-modal/create-group-modal.component.ts b/otf-frontend/client/src/app/shared/modules/create-group-modal/create-group-modal.component.ts
new file mode 100644
index 0000000..2d0befc
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-group-modal/create-group-modal.component.ts
@@ -0,0 +1,131 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Inject } from '@angular/core';
+import { MatDialogRef, MAT_DIALOG_DATA, MatSnackBar, MatDialog } from '@angular/material';
+import { GroupService } from 'app/shared/services/group.service';
+import { CookieService } from 'ngx-cookie-service';
+import { UserService } from 'app/shared/services/user.service';
+import { AlertSnackbarComponent } from '../alert-snackbar/alert-snackbar.component';
+import { AlertModalComponent } from 'app/shared/modules/alert-modal/alert-modal.component';
+
+
+@Component({
+ selector: 'app-create-group-modal',
+ templateUrl: './create-group-modal.component.pug',
+ styleUrls: ['./create-group-modal.component.scss']
+})
+export class CreateGroupModalComponent implements OnInit {
+
+ constructor(public dialogRef: MatDialogRef<CreateGroupModalComponent>, @Inject(MAT_DIALOG_DATA) public input_data, private userService: UserService, private groupService: GroupService, private cookieService: CookieService, private snack: MatSnackBar, private modal: MatDialog) { }
+
+ public groups;
+ public newGroup;
+ public user;
+
+ ngOnInit() {
+ this.newGroup = {};
+ this.user = {};
+ this.groups = [];
+ this.newGroup.groupName = '';
+ this.newGroup.parentGroupId = null;
+ this.user._id = this.userService.getId();
+ this.newGroup.ownerId = this.user["_id"];
+ //filter list of groups by the Admin permssion from the user
+ //Also add group onto active dropdown list when this dialog is closed
+ this.groupService.find({
+ $limit: -1
+
+ }).subscribe((list) => {
+ //console.log(list);
+ for(let i in list){
+ //console.log(this.user._id + " " + list[i]);
+ if(this.checkIsAdmin(list[i], this.user._id)){
+ this.groups.push(list[i]);
+ }
+ }
+
+ });
+
+ }
+
+ checkIsAdmin(group, userId){
+ if(group.members){
+ let memberIndex = group.members.findIndex(function(member){return member.userId.toString() == userId.toString()});
+ if(memberIndex >= 0){
+ if(group.members[memberIndex].roles.includes("admin")){
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ close(){
+
+ this.dialogRef.close(null);
+ }
+
+ createGroup(){
+
+ //console.log(this.newGroup);
+ if(this.newGroup.parentGroupId == "None"){
+ this.newGroup.parentGroupId = null;
+ }
+
+ this.newGroup.roles = [{
+ roleName: "admin",
+ permissions: ["management", "write", "delete", "read", "execute"]
+ },
+ {
+ roleName: "user",
+ permissions: ["read"]
+ },
+ {
+ roleName: "developer",
+ permissions: ["write", "delete", "read", "execute"]
+ }];
+ this.newGroup.members = [{
+ userId: this.user._id,
+ roles: ["admin"]
+ }];
+ this.groupService.create(this.newGroup).subscribe(res => {
+
+ let snackMessage = 'The group ' + this.newGroup.groupName + " has been created!";
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: snackMessage
+ }
+ });
+ if(res){
+ this.dialogRef.close(res)
+ }else{
+ this.close();
+ }
+ }, (error) => {
+ this.modal.open(AlertModalComponent, {
+ width: "250px",
+ data: {
+ type: "alert",
+ message: error
+ }
+ });
+ });
+
+ }
+
+}
diff --git a/otf-frontend/client/src/app/shared/modules/create-group-modal/create-group-modal.module.spec.ts b/otf-frontend/client/src/app/shared/modules/create-group-modal/create-group-modal.module.spec.ts
new file mode 100644
index 0000000..91ecd63
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-group-modal/create-group-modal.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { CreateGroupModalModule } from './create-group-modal.module';
+
+describe('CreateGroupModalModule', () => {
+ let createGroupModalModule: CreateGroupModalModule;
+
+ beforeEach(() => {
+ createGroupModalModule = new CreateGroupModalModule();
+ });
+
+ it('should create an instance', () => {
+ expect(createGroupModalModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/create-group-modal/create-group-modal.module.ts b/otf-frontend/client/src/app/shared/modules/create-group-modal/create-group-modal.module.ts
new file mode 100644
index 0000000..42bc6e6
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-group-modal/create-group-modal.module.ts
@@ -0,0 +1,43 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { CreateGroupModalComponent } from './create-group-modal.component';
+import { FormsModule } from '@angular/forms';
+import { MatButtonModule, MatInputModule, MatSelectModule, MatOptionModule, MatSnackBarModule, MatIconModule, MatDialogModule } from '@angular/material';
+import { AlertSnackbarModule } from '../alert-snackbar/alert-snackbar.module';
+import { PageHeaderModule } from '..';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ MatButtonModule,
+ MatInputModule,
+ MatSelectModule,
+ MatOptionModule,
+ MatSnackBarModule,
+ PageHeaderModule,
+ AlertSnackbarModule,
+ MatIconModule,
+ MatDialogModule
+ ],
+ declarations: [CreateGroupModalComponent],
+ exports: [ CreateGroupModalComponent],
+ entryComponents: [ CreateGroupModalComponent ]
+})
+export class CreateGroupModalModule { }
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-form/create-test-form.component.pug b/otf-frontend/client/src/app/shared/modules/create-test-form/create-test-form.component.pug
new file mode 100644
index 0000000..dbafe0e
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-form/create-test-form.component.pug
@@ -0,0 +1,167 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+form(#testDefinitionForm="ngForm")
+ .row.mb-3
+ .col-sm-6(style="justify-content: flex-end;flex-direction: column;display: flex")
+
+ //- Diagram
+ .row(style="height: 100%")
+ //- placeholder
+ .col-12(*ngIf="!ptd.currentInstance.bpmnXml", style="text-align:center; opacity: .4")
+ i.fa.fa-5x.fa-object-group
+ //- diagram
+ .col-12(#canvas, [hidden]="!ptd.currentInstance.bpmnXml", style="position: relative; cursor: pointer", (click)="enlargeBpmn()")
+ button(mat-icon-button, color="primary", style="position: absolute; top: 0px; right: 0px; z-index: 100")
+ mat-icon zoom_in
+
+
+ //- Upload and version
+ .row
+ .col-sm-6(style="text-align:center")
+ input(id="file", #file, type="file", name="file", ng2FileSelect, [uploader]="bpmnUploader", style="display:none", [hidden]="!ptd.currentInstance.isDeployed", (change)="validateFile()", required)
+
+ //- when creating new
+ button(mat-raised-button, color="accent", *ngIf="!ptd.currentInstance.isDeployed && !ptd.currentInstance.bpmnXml && isNew", [hidden]="isUploading", (click)="isClicked = true", onclick="file.click();")
+ | Upload Workflow
+ button(mat-raised-button, color="primary", *ngIf="!ptd.currentInstance.isDeployed && ptd.currentInstance.bpmnXml", [hidden]="isUploading", onclick="file.click();")
+ | Change Workflow
+
+ //- when editing
+ //- button(mat-raised-button, color="primary", *ngIf="!isNew && ptd.currentInstance.isDeployed", [hidden]="isUploading", (click)="newVersion(this.ptd.processDefinitionKey)", onclick="file.click();")
+ //- | New Version
+ h4(*ngIf="ptd.currentInstance.isDeployed") Deployed
+
+ mat-spinner(style="margin:auto", [diameter]="30", [hidden]="!isUploading")
+
+ .col-sm-6
+ mat-form-field(*ngIf="ptd.processDefinitionKey != null")
+ input(matInput, placeholder="Process Definition Key", name="processDefinitionKey", maxlength="22", [disabled]="hasBeenSaved", (keyup)="checkProcessDefinitionKey()", [(ngModel)]="ptd.processDefinitionKey", required)
+ mat-spinner(matSuffix, *ngIf="pStatus == 'loading'", [diameter]="19")
+ mat-icon(matSuffix, *ngIf="pStatus == 'unique'", style="color: green") check
+ mat-icon(matSuffix, *ngIf="pStatus == 'notUnique'", style="color: red") error_outline
+
+ .col-sm-6
+ mat-form-field(style="width:100%")
+ input(matInput, type="text", placeholder="Name", name="name", [disabled]="(existingTd && !hasBeenSaved) || !ptd.currentInstance.bpmnXml", [(ngModel)]="ptd.testName", required)
+ mat-error Required
+ mat-form-field(style="width:100%")
+ input(matInput, type="text", placeholder="Description", name="description", [disabled]="(existingTd && !hasBeenSaved) || !ptd.currentInstance.bpmnXml", [(ngModel)]="ptd.testDescription", required)
+ mat-error Required
+ //- mat-form-field(style="width:100%")
+ //- mat-select((selectionChange)="markAsDirty()", name="ns", [disabled]="(existingTd && !hasBeenSaved) || !ptd.currentInstance.bpmnXml", placeholder="Group", [(value)]="ptd.groupId", required)
+ //- mat-option(*ngFor="let group of groups", value="{{group._id}}") {{ group.groupName }}
+ //- mat-error Required
+ mat-form-field(style="width:100%")
+ input(matInput, type="text", *ngIf="!hasBeenSaved", placeholder="Version", name="version", [(ngModel)]="ptd.currentInstance.version", (keyup)="checkVersionUnique()", required)
+ mat-select((selectionChange)="switchVersion(ptd.currentVersionName)", placeholder="Version", name="selectedVersion", *ngIf="hasBeenSaved", [(value)]="ptd.currentVersionName", required)
+ mat-option(*ngFor="let instance of ptd.bpmnInstances.slice().reverse()", value="{{instance.version}}") {{ instance.version }}
+ mat-error Required
+ button(mat-button, matSuffix, color="primary", *ngIf="hasBeenSaved", (click)="newVersion(this.ptd.processDefinitionKey)", onclick="file.click();") New
+
+ button(mat-button, (click)="viewer.download()", color="primary")
+ mat-icon cloud_download
+ span.ml-2 Download
+
+
+ .row
+ .col-12(*ngIf="ptd.currentInstance")
+ mat-accordion
+ mat-expansion-panel([expanded]="ptd.currentInstance.dataTestHeads.length > 0")
+ mat-expansion-panel-header
+ mat-panel-title Test Heads
+ mat-panel-description(*ngIf="ptd.currentInstance.dataTestHeads") {{ ptd.currentInstance.dataTestHeads.length > 0? ptd.currentInstance.dataTestHeads.length : '' }}
+ .ps(style="position: relative; max-height: 105px", [perfectScrollbar])
+ div(style="white-space: nowrap")
+ .mr-4.text-center(*ngFor=("let task of ptd.currentInstance.dataTestHeads; index as i; trackBy: trackByFn"), style="display:inline-block")
+ .text-muted {{task.bpmnVthTaskId}}
+ button(color="accent", mat-fab, (click)="selectTestHead(i)")
+ i.fa.fw.fa-gears.fa-2x(style="color:white")
+ p.text-muted {{ (task.testHead && task.testHead.testHeadName) ? task.testHead.testHeadName : '' }}
+ mat-expansion-panel([expanded]="true")
+ mat-expansion-panel-header
+ mat-panel-title Resources
+ mat-panel-description A single .zip file with scripts
+ input(type="file", #scripts, id="scripts", name="scripts", hidden, (change)="markAsDirty()", ng2FileSelect, [uploader]="uploader", accept="application/zip")
+ .row(*ngIf="ptd.currentInstance.resourceFileId")
+ .col-12
+ mat-list
+ mat-list-item
+ mat-icon(mat-list-icon) insert_drive_file
+ h4(mat-line) {{ptd.currentInstance.resourceFileName }}
+ .row(*ngIf="!ptd.currentInstance.isDeployed")
+ .col-md-3
+ //- .mb-2 TESTING GIT TRACKING
+ //- | Multiple Files
+ //- mat-slide-toggle(color="primary", name="isZip", [(ngModel)]="isZip", (change)="uploader.clearQueue()")
+ //- | .zip
+ //- div
+ //- input(*ngIf="!isZip", type="file", name="scripts", ng2FileSelect, [uploader]="uploader", multiple)
+
+ button(mat-raised-button, *ngIf="isZip && !ptd.currentInstance.resourceFileId", onclick="scripts.click()", color="primary") Choose File
+ button(mat-raised-button, *ngIf="isZip && ptd.currentInstance.resourceFileId", onclick="scripts.click()", color="primary") Replace File
+ .col-md-8.ml-2
+ div(*ngIf="uploader.queue.length > 0")
+ label File:
+ ul.list-group(style="position:relative")
+ li.list-group-item(*ngFor="let item of uploader.queue")
+ | {{ item?.file?.name }}
+ div.upload-progress([ngStyle]="{'width': item.progress + '%'}")
+ //- button.pull-right(mat-button, (click)="upload()") Upload All
+ label(*ngIf="ptd.currentInstance.resourceFileId && uploader.queue.length > 0 && !saved") This will replace the previous resouce file
+ button.pull-right(mat-button, color="primary", (click)="clearQueue()") Remove All
+ .row(*ngIf="ptd.currentInstance.isDeployed")
+ .col-12(*ngIf="!ptd.currentInstance.resourceFileId")
+ | No resources were deployed with this version
+
+
+ .col-12(*ngIf="ptd.currentInstance.testDataTemplate != {}")
+ h5.text-muted.mt-4 testInputTemplate.yaml
+ div(style="border: 1px solid lightgrey; font-size: 16px !important")
+ codemirror([config]="codeConfig", [(ngModel)]='ptd.currentInstance.testDataTemplate', name="testConfig")
+
+ .row(style="height:30px")
+ .row.form-buttons
+ .col-12.mt-3
+ .pull-left
+ .mr-3(mat-button, *ngIf="hasBeenSaved && saved && !testDefinitionForm.dirty") saved
+ mat-icon(style="color:green") check
+ .pull-right
+ //save
+ button.mr-3(mat-raised-button, *ngIf="!hasBeenSaved && !inProgress", color="primary", [disabled]="!testDefinitionForm.form.valid || !ptd.currentInstance.bpmnXml || !successUpload || pStatus == 'notUnique'", (click)="save()") Save
+
+ //update
+ button.mr-3(mat-raised-button, *ngIf="hasBeenSaved && !inProgress", color="primary", [disabled]="!testDefinitionForm.form.valid || !ptd.currentInstance.bpmnXml || !testDefinitionForm.dirty || !successUpload", (click)="update()") Update
+
+ //save and deploy
+ button.mr-3(mat-raised-button, color="accent", [disabled]="!testDefinitionForm.form.valid || !ptd.currentInstance.bpmnXml || !successUpload || pStatus == 'notUnique'", *ngIf="!ptd.currentInstance.isDeployed && !hasBeenSaved && !saved && !inProgress", (click)="saveDeploy()") Save & Deploy
+
+ //update and deploy
+ button.mr-3(mat-raised-button, color="accent", [disabled]="!testDefinitionForm.form.valid || !ptd.currentInstance.bpmnXml || !successUpload", *ngIf="!ptd.currentInstance.isDeployed && hasBeenSaved && testDefinitionForm.dirty && !inProgress", (click)="updateDeploy()") Update & Deploy
+
+ //deploy
+ button.mr-3(mat-raised-button, color="accent", [disabled]="!testDefinitionForm.form.valid || !ptd.currentInstance.bpmnXml || !successUpload", *ngIf="!ptd.currentInstance.isDeployed && hasBeenSaved && testDefinitionForm.pristine && !inProgress", (click)="deploy()") Deploy
+
+ //delete
+ button.mr-3(mat-raised-button, color="warn", *ngIf="hasBeenSaved && !inProgress", (click)="deleteVersion()") Delete Version
+
+ //- button((click)="print()") print
+
+ //In Progress
+ button.mr-3(mat-raised-button, *ngIf="inProgress", color="primary", disabled)
+ mat-spinner([diameter]="19", style="display:inline")
+ div.ml-4(style="display:inline") In Progress
+
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-form/create-test-form.component.scss b/otf-frontend/client/src/app/shared/modules/create-test-form/create-test-form.component.scss
new file mode 100644
index 0000000..124106c
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-form/create-test-form.component.scss
@@ -0,0 +1,50 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.slider {
+ overflow-y: hidden;
+ max-height: 500px; /* approximate max height */
+
+ transition-property: all;
+ transition-duration: .5s;
+ transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
+}
+
+.fa-spinner{
+ color: green;
+}
+
+.tsd {
+ width:100%;
+ height:100%;
+ background: orange
+}
+
+.centered {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ -webkit-transform: translate(-50%, -50%);
+ transform: translate(-50%, -50%);
+}
+
+.no-margin-tlb {
+ margin: -16px -16px -16px -16px;
+}
+
+.mbtn:focus {
+ outline: none;
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-form/create-test-form.component.spec.ts b/otf-frontend/client/src/app/shared/modules/create-test-form/create-test-form.component.spec.ts
new file mode 100644
index 0000000..595b3d1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-form/create-test-form.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { CreateTestFormComponent } from './create-test-form.component';
+
+describe('CreateTestFormComponent', () => {
+ let component: CreateTestFormComponent;
+ let fixture: ComponentFixture<CreateTestFormComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ CreateTestFormComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(CreateTestFormComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-form/create-test-form.component.ts b/otf-frontend/client/src/app/shared/modules/create-test-form/create-test-form.component.ts
new file mode 100644
index 0000000..f88523d
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-form/create-test-form.component.ts
@@ -0,0 +1,823 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, EventEmitter, Input, OnInit, Output, ViewChild, ElementRef, OnDestroy } from '@angular/core';
+import { MatDialog, MatSnackBar } from '@angular/material';
+import { SelectTestHeadModalComponent } from '../select-test-head-modal/select-test-head-modal.component';
+import { GroupService } from '../../services/group.service';
+import { TestDefinitionService } from '../../services/test-definition.service';
+import { AlertModalComponent } from '../alert-modal/alert-modal.component';
+import { Alert } from 'selenium-webdriver';
+import { ListService } from '../../services/list.service';
+import { AlertSnackbarComponent } from '../alert-snackbar/alert-snackbar.component';
+import { TestHeadService } from 'app/shared/services/test-head.service';
+import { FileUploader, FileItem, ParsedResponseHeaders } from 'ng2-file-upload';
+import { AppGlobals } from 'app/app.global';
+import { HttpHeaders } from '@angular/common/http';
+import { CookieService } from 'ngx-cookie-service';
+import { stringify } from '@angular/core/src/render3/util';
+import Modeler from 'bpmn-js';
+import { FileService } from 'app/shared/services/file.service';
+import { FileTransferService } from 'app/shared/services/file-transfer.service';
+import { TestDefinition } from './test-definition.class';
+import { connectableObservableDescriptor } from 'rxjs/internal/observable/ConnectableObservable';
+import { Buffer } from 'buffer';
+import { ViewWorkflowModalComponent } from '../view-workflow-modal/view-workflow-modal.component';
+import { BpmnFactoryService } from 'app/shared/factories/bpmn-factory.service';
+import { Bpmn } from 'app/shared/models/bpmn.model';
+
+
+@Component({
+ selector: 'app-create-test-form',
+ templateUrl: './create-test-form.component.pug',
+ styleUrls: ['./create-test-form.component.scss']
+})
+export class CreateTestFormComponent implements OnInit, OnDestroy {
+
+
+ public codeConfig = {
+ mode: 'yaml',
+ theme: 'eclipse',
+ lineNumbers: true
+ };
+
+ public trackByFn;
+
+ public selectedTestHead;
+ public groups;
+ public isUploading;
+ public successUpload = false;
+ public processDefinitionKey = false;
+ public validateResponse;
+ public pStatus;
+ public file: File;
+ public hasBeenSaved = false;
+ public saved = false;
+ public isClicked;
+ public isZip = true;
+ public viewer: Bpmn;
+ public scriptFiles = [];
+ public existingTd;
+
+ @ViewChild('testDefinitionForm') form: any;
+ @ViewChild('canvas') canvas;
+ @ViewChild('scripts') scripts: ElementRef;
+ @ViewChild('file') bpmnFileInput: ElementRef;
+
+ @Input() public listKey;
+
+ @Input() public formData;
+
+ @Output() public childEvent = new EventEmitter();
+
+ public uploader: FileUploader;
+ public bpmnUploader: FileUploader;
+
+ public inProgress = false;
+
+ // New variables
+ public ptd: TestDefinition;
+ public isNew = true;
+
+ constructor(
+ public dialog: MatDialog,
+ private list: ListService,
+ private testHead: TestHeadService,
+ private group: GroupService,
+ private testDefinition: TestDefinitionService,
+ private snack: MatSnackBar,
+ private cookie: CookieService,
+ private fileTransfer: FileTransferService,
+ private fileService: FileService,
+ private bpmnFactory: BpmnFactoryService
+ ) { }
+
+ print(){
+ console.log(this.ptd);
+ }
+
+ async ngOnInit() {
+ //this.setNew();
+
+ this.viewer = await this.bpmnFactory.setup({
+ mode: 'viewer',
+ options: {
+ container: this.canvas.nativeElement
+ }
+ })
+
+ this.ptd = new TestDefinition();
+ this.ptd.reset();
+ this.ptd.switchVersion();
+
+ let uploadOptions = {
+ url: AppGlobals.baseAPIUrl + 'file-transfer',
+ authTokenHeader: 'Authorization',
+ authToken: 'Bearer ' + JSON.parse(this.cookie.get('access_token'))
+ };
+
+ //File Uploaders
+ this.uploader = new FileUploader(uploadOptions);
+ this.bpmnUploader = new FileUploader(uploadOptions);
+
+ if (this.formData && this.formData !== 'new') {
+ this.hasBeenSaved = true;
+ this.successUpload = true;
+ this.isNew = false;
+ this.setTestDefinition();
+ }
+
+ this.group.find({$limit: -1}).subscribe((x) => {
+ this.groups = x;
+ });
+
+ }
+
+ ngOnDestroy(){
+
+ }
+
+ waitSave(){
+ return new Promise((resolve, reject) => {
+ console.log('waitsave')
+ //upload bpmn file
+ this.saveBpmnFile().then(bpmnFile => {
+ console.log(bpmnFile)
+ console.log('pass save bpmnfile')
+ this.checkTestDataTemplate();
+
+ let data = this.gatherTestDefinition(bpmnFile);
+ console.log(data)
+ //If this is not a new version
+ if(!this.existingTd){
+ delete data._id;
+
+ this.create(data).then(
+ result => {
+ resolve(result);
+ this.setTestDefinition(result);
+ this.showHasBeenSaved();
+ }
+ ).catch(err => {
+ reject(err);
+ this.showHasNotBeenSaved();
+ });
+ }else{
+ //create version by updating definition
+ this.saveVersion(data).then(
+ result => {
+ resolve(result);
+ this.setTestDefinition(result);
+ this.showHasBeenSaved();
+ }
+ ).catch(err => {
+ reject(err);
+ this.showHasNotBeenSaved();
+ });
+ }
+ });
+ })
+ }
+
+ // Saves Test Definition - Triggered by "Save" button
+ save() {
+ //set in progress
+ this.inProgress = true;
+ return this.waitSave();
+
+ }
+
+ // Updates Test Definition - Triggered by "Update" button
+ update() {
+ this.inProgress = true;
+ return this.saveBpmnFile().then(bpmnFile => {
+ this.checkTestDataTemplate();
+
+ var data = this.gatherTestDefinition(bpmnFile);
+
+ return this.testDefinition.patch(data)
+ .subscribe(
+ result => {
+ this.uploadResources(result).then(
+ res => {
+ this.setTestDefinition(res);
+ this.showHasBeenUpdated();
+ }
+ );
+ return result;
+ },
+ error => {
+ this.showHasNotBeenUpdated(error);
+ }
+ );
+ });
+ }
+
+ deleteVersion(){
+ let deleteDialog = this.dialog.open(AlertModalComponent, {
+ width: '250px',
+ data: { type: 'confirmation', message: 'Are you sure you want to delete version ' + this.ptd.currentVersionName }
+ });
+
+ deleteDialog.afterClosed().subscribe(
+ result => {
+ if(result){
+ this.inProgress = true;
+ if(this.ptd.bpmnInstances.length == 1){
+ this.testDefinition.delete(this.ptd._id).subscribe(
+ result => {
+ this.childEvent.emit();
+ }
+ )
+ }else{
+ this.ptd.removeBpmnInstance(this.ptd.currentVersionName);
+ this.update().then(
+ res => {
+ this.inProgress = false;
+ }
+ );
+ }
+ }
+ }
+ )
+ }
+
+ // Deploys Test Definition version - Triggerd by "Deploy" button
+ deploy(versionName?) {
+ this.inProgress = true;
+ //console.log(this.ptd)
+ this.testDefinition.deploy(this.ptd, versionName)
+ .subscribe(result => {
+
+ this.handleResponse(result);
+ this.inProgress = false;
+ if (result['statusCode'] == 200) {
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: 'Test Definition Deployed!'
+ }
+ });
+ this.ptd.currentInstance.isDeployed = true;
+ } else {
+ this.dialog.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: 'Alert',
+ message: JSON.stringify(result)
+ }
+ });
+ }
+ },
+ err => {
+ this.inProgress = false;
+ }
+
+ );
+ }
+
+ create(data){
+ return new Promise((resolve, reject) => {
+ this.testDefinition.create(data)
+ .subscribe(
+ result => {
+ this.uploadResources(result).then(
+ res => {
+ resolve(res);
+ }
+ );
+ },
+ error => {
+ this.dialog.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: 'Alert',
+ message: JSON.stringify(error)
+ }
+ });
+ reject(error);
+ }
+ );
+ });
+ }
+
+ newVersion(processDefinitionKey){
+ this.hasBeenSaved = false;
+ this.isNew = true;
+ this.ptd.reset();
+ this.ptd.switchVersion();
+ this.ptd.setProcessDefinitionKey(processDefinitionKey);
+ }
+
+ checkProcessDefinitionKey() {
+ this.pStatus = 'loading';
+ this.testDefinition.check(this.ptd.getProcessDefinitionKey()).subscribe(result => {
+ console.log(result);
+ if (result['statusCode'] == 200) {
+ this.pStatus = 'unique';
+ } else {
+ this.pStatus = 'notUnique';
+ }
+
+ this.ptd.bpmnInstances = this.ptd.bpmnInstances.filter((e, i) => {
+ return i == 0;
+ })
+
+ // this.ptd.bpmnInstances.forEach((elem, val) => {
+ // if(val > 0){
+ // this.ptd.bpmnInstances.splice(val, 1);
+ // }
+ // })
+
+ //New Code
+ if(result['body'] && result['body'][0]){
+ //when changing bpmn dont
+ //if(this.ptd.currentInstance.isDeployed){
+ let res = result['body'][0];
+ this.existingTd = true;
+ this.ptd.setId(res._id);
+ this.ptd.setName(res.testName);
+ this.ptd.setDescription(res.testDescription);
+ this.ptd.setGroupId(res.groupId);
+ this.ptd.setVersion(res.bpmnInstances.length + 1);
+ //this.ptd.bpmnInstances = [];
+
+ for(let i = 0; i < res.bpmnInstances.length; i++){
+ this.ptd.addBpmnInstance(res.bpmnInstances[i]);
+ }
+
+
+ //this.ptd.addBpmnInstance (res.bpmnInstances);
+ //}
+ }else{
+ this.existingTd = false;
+ this.ptd.setId(null);
+ this.ptd.setName('');
+ this.ptd.setDescription('');
+ this.ptd.setGroupId('');
+ this.ptd.setVersion(1);
+ }
+
+ if(!this.ptd.currentInstance.version){
+ this.ptd.setNewVersion();
+ }
+
+ });
+ }
+
+ validateFile() {
+
+ this.isUploading = true
+ this.fetchFileContents(val => {
+ //
+ this.ptd.currentInstance.bpmnXml = val;
+ if (!this.ptd.currentInstance.bpmnXml) {
+ this.isUploading = false;
+ this.dialog.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: 'Alert',
+ message: 'File was not selected. Please try again.'
+ }
+ });
+ return null;
+ }
+
+ this.testDefinition.validate(this.ptd.getAll())
+ .subscribe(
+ result => {
+ this.handleResponse(result);
+ //
+ this.isUploading = false;
+ this.ptd.currentInstance.bpmnHasChanged = true;
+ this.loadDiagram();
+ },
+ err => {
+ this.dialog.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: 'Alert',
+ message: 'Something went wrong. Please try again'
+ }
+ });
+ this.isUploading = false;
+ }
+ );
+ });
+
+
+ }
+
+ showHasNotBeenSaved(){
+ this.dialog.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: 'Alert',
+ message: 'There was a problem with saving the test definition.'
+ }
+ });
+ this.inProgress = false;
+ }
+
+ showHasBeenSaved(){
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: 'Test Definition Saved!'
+ }
+ });
+ //this.switchVersion();
+ this.ptd.switchVersion();
+ this.hasBeenSaved = true;
+ this.saved = true;
+ this.form.form.markAsPristine();
+ this.inProgress = false;
+ }
+
+ showHasBeenUpdated(){
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: 'Test Definition Updated!'
+ }
+ });
+ //this.switchVersion();
+ this.ptd.switchVersion(this.ptd.currentInstance.version);
+ this.saved = true;
+ this.form.form.markAsPristine();
+ this.ptd.currentInstance.bpmnHasChanged = false;
+ this.inProgress = false;
+ }
+
+ showHasNotBeenUpdated(error = null){
+ this.dialog.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: 'Alert',
+ message: JSON.stringify(error)
+ }
+ });
+ this.inProgress = false;
+ }
+
+ setTestDefinition(data = null){
+ //new
+ if(data){
+
+ this.ptd.setAll(data);
+ }else{
+ this.ptd.setAll(JSON.parse(JSON.stringify(this.formData)));
+ }
+
+ this.switchVersion();
+
+ //console.log(this.ptd);
+
+ }
+
+ clearQueue(){
+ this.uploader.clearQueue();
+ if(this.scripts){
+ this.scripts.nativeElement.value = null;
+ }
+ }
+
+ switchVersion(versionName = null){
+ this.ptd.switchVersion(versionName);
+ this.checkTestDataTemplate();
+
+ this.clearQueue();
+ this.bpmnFileInput.nativeElement.value = null;
+
+ //Get bpmn file contents
+ this.fileTransfer.get(this.ptd.currentInstance.bpmnFileId).subscribe(
+ result => {
+ result = new Buffer(result as Buffer);
+ this.ptd.currentInstance.bpmnXml = result.toString();
+ this.loadDiagram();
+ }
+ );
+
+ //get info on resource file
+ if(this.ptd.currentInstance.resourceFileId){
+ this.fileService.get(this.ptd.currentInstance.resourceFileId).subscribe(
+ result => {
+ this.ptd.currentInstance.resourceFileName = result['filename'];
+ }
+ )
+ }
+
+ if(this.ptd.currentInstance.testHeads){
+ this.ptd.currentInstance.dataTestHeads = [];
+ this.ptd.currentInstance.testHeads.forEach((elem, val) => {
+ //Find test head info
+ const e = elem;
+ this.testHead.get(e.testHeadId).subscribe(
+ result => {
+ this.ptd.currentInstance.dataTestHeads.push({
+ testHeadId: e.testHeadId,
+ bpmnVthTaskId: e.bpmnVthTaskId,
+ testHead: JSON.parse(JSON.stringify(result))
+ });
+ },
+ err => {
+ this.ptd.currentInstance.dataTestHeads.push({
+ testHeadId: e.testHeadId,
+ bpmnVthTaskId: e.bpmnVthTaskId,
+ testHead: { _id: e.testHeadId, testHeadName: 'No Access' }
+ });
+ }
+ );
+ });
+ }
+ }
+
+ gatherTestDefinition(bpmnFile = null) {
+
+ if(bpmnFile){
+ this.ptd.currentInstance.bpmnFileId = bpmnFile._id;
+ }
+
+ this.ptd.currentInstance.testHeads = [];
+ this.ptd.currentInstance.dataTestHeads.forEach((elem, val) => {
+ this.ptd.currentInstance.testHeads.push({
+ testHeadId: elem.testHead._id,
+ bpmnVthTaskId: elem.bpmnVthTaskId
+ });
+ });
+
+ return this.ptd.getAll();
+
+ }
+
+ saveDeploy() {
+ let version = JSON.parse(JSON.stringify(this.ptd.currentInstance.version));
+ console.log(version)
+ this.save().then(x => {
+ this.deploy(version);
+ });
+ }
+
+ updateDeploy() {
+ let version = JSON.parse(JSON.stringify(this.ptd.currentInstance.version));
+ this.update().then(x => {
+ this.deploy(version);
+ });
+ }S
+
+ handleResponse(result) {
+ this.successUpload = true;
+ this.processDefinitionKey = false;
+ //this.validateResponse = result;
+ if (result['body']['errors']) {
+
+
+ if (result['body']['errors']['processDefinitionKey']) {
+ this.openProcessDefinitionKeyModal();
+ this.pStatus = 'notUnique';
+ this.ptd.setProcessDefinitionKey(result['body'].errors.processDefinitionKey.key)
+ //this.td.processDefinitionKey = result['body']['errors']['processDefinitionKey']['key'];
+ this.processDefinitionKey = true;
+ }
+ if (result['body']['errors']['notFound']) {
+ this.dialog.open(AlertModalComponent, {
+ width: '250px',
+ data: { type: 'alert', message: result['body']['errors']['notFound']['error'] }
+ });
+ this.successUpload = false;
+ }
+ if (result['body']['errors']['startEvent']) {
+ this.dialog.open(AlertModalComponent, {
+ width: '250px',
+ data: { type: 'alert', message: result['body']['errors']['startEvent']['error'] }
+ });
+ this.successUpload = false;
+ }
+ if (result['body']['errors']['required']) {
+ this.dialog.open(AlertModalComponent, {
+ width: '250px',
+ data: { type: 'alert', message: result['body']['errors']['required']['error'] }
+ });
+ this.successUpload = false;
+ }
+ if (result['body']['errors']['permissions']) {
+ let mess = '';
+ result['body']['errors']['permissions'].forEach(elem => {
+ mess += elem.error + '\n';
+ })
+ this.dialog.open(AlertModalComponent, {
+ width: '250px',
+ data: { type: 'alert', message: mess }
+ });
+ this.successUpload = false;
+ }
+
+ }else{
+ this.markAsDirty();
+ }
+ // Update list of test heads
+ if (result['body']['bpmnVthTaskIds']) {
+ this.ptd.currentInstance.dataTestHeads = result['body'].bpmnVthTaskIds;
+ this.ptd.currentInstance.testHeads = [];
+ //this.definitionInstance.testHeads = result['body']['bpmnVthTaskIds'];
+ }
+
+ //Update plfos list
+ if(result['body']['bpmnPfloTaskIds']){
+ this.ptd.currentInstance.pflos = result['body'].bpmnPfloTaskIds;
+ }
+
+ if (result['body']['processDefinitionKey']) {
+ this.ptd.setProcessDefinitionKey(result['body'].processDefinitionKey);
+ //this.td.processDefinitionKey = result['body']['processDefinitionKey'];
+ this.checkProcessDefinitionKey()
+ }
+ }
+
+ markAsDirty() {
+ this.form.control.markAsDirty();
+ }
+
+ //returns promise for file object
+ saveBpmnFile() {
+ return new Promise((resolve, reject) => {
+
+ //check for bpmnXml
+ if (!this.ptd.currentInstance.bpmnXml) {
+ this.dialog.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: 'Alert',
+ message: 'No File found. Please select a file to upload'
+ }
+ });
+ reject();
+ }
+
+ if(this.ptd.currentInstance.bpmnHasChanged){
+ // Upload
+ console.log('validate save call')
+ this.testDefinition.validateSave(this.ptd).subscribe(
+ result => {
+ resolve(JSON.parse(result.toString())[0]);
+ }
+ );
+ }else{
+ //bpmn has not changed, so did not save it.
+ resolve(null);
+ }
+ });
+ }
+
+ saveVersion(data){
+ return new Promise((resolve, reject) => {
+
+ let newBpmnInsance = JSON.parse(JSON.stringify(data.bpmnInstances[0]));
+ delete data.bpmnInstances;
+ data['$push'] = {
+ bpmnInstances: newBpmnInsance
+ }
+
+ console.log(data)
+
+ this.testDefinition.patch(data).subscribe(
+ result => {
+ this.uploadResources(result).then(
+ res => {
+ resolve(res);
+ }
+ )
+ },
+ err => {
+ reject(err);
+ }
+ )
+ });
+ }
+
+ uploadResources(td){
+ return new Promise((resolve, reject) => {
+ if(this.uploader.queue.length > 0){
+ //console.log('has file');
+ this.uploader.uploadAll();
+ this.uploader.onCompleteItem = (item: FileItem, response: string, status: Number, headers: ParsedResponseHeaders) => {
+ this.scriptFiles.push(JSON.parse(response)[0]);
+ //console.log('in file')
+ }
+ this.uploader.onCompleteAll = () => {
+ //console.log('complete')
+ let scriptFilesId = [];
+ for (let i = 0; i < this.scriptFiles.length; i++) {
+ scriptFilesId.push(this.scriptFiles[i]['_id']);
+ }
+ td['bpmnInstances'][this.ptd.currentVersion]['resourceFileId'] = scriptFilesId[0];
+ //console.log(td);
+ this.testDefinition.patch(td).subscribe(
+ res => {
+ //console.log(res);
+ resolve(res);
+ },
+ err => {
+ reject(err);
+ }
+ );
+ }
+ }else{
+ resolve(td);
+ }
+ });
+ }
+
+ checkTestDataTemplate() {
+ if (this.ptd.currentInstance.testDataTemplate == null || this.ptd.currentInstance.testDataTemplate == '') {
+ delete this.ptd.currentInstance.testDataTemplate;
+ }
+ // if (this.definitionInstance.testDataTemplate == null || this.definitionInstance.testDataTemplate == '') {
+ // delete this.definitionInstance.testDataTemplate;
+ // }
+ }
+
+ async loadDiagram() {
+ if (this.ptd.currentInstance.bpmnXml) {
+ //render xml and display
+ this.viewer.setBpmnXml(this.ptd.currentInstance.bpmnXml);
+ // if (!this.viewer) {
+ // this.viewer = new Modeler({
+ // container: this.canvas.nativeElement
+ // });
+ // }
+
+ // this.viewer.importXML(this.ptd.currentInstance.bpmnXml, (err) => {
+ // if (!err) {
+ // this.viewer.get('canvas').zoom('fit-viewport');
+ // } else {
+ // //
+ // }
+ // });
+
+ }
+ }
+
+ enlargeBpmn(){
+ this.dialog.open(ViewWorkflowModalComponent, {
+ data: {
+ xml: this.ptd.currentInstance.bpmnXml
+ },
+ width: '100%',
+ height: '100%'
+ })
+ }
+
+ fetchFileContents(callback) {
+ var val = "x";
+ var fileToLoad = (document.getElementById('file'))['files'][0];
+ var fileReader = new FileReader();
+ if (!fileToLoad) {
+ return null;
+ }
+ fileReader.onload = function (event) {
+ //
+ val = event.target['result'] as string;
+
+ //
+ callback(val);
+ }
+ fileReader.readAsText(fileToLoad);
+ }
+
+ openProcessDefinitionKeyModal() {
+ const dialogRef = this.dialog.open(AlertModalComponent, {
+ width: '250px',
+ data: { type: 'warning', message: 'You cannot use this process definition key. Please change it.' }
+ });
+ }
+
+ checkVersionUnique(){
+ let exists = false;
+ this.ptd.bpmnInstances.forEach(elem => {
+ if(elem != this.ptd.currentInstance && elem.version == this.ptd.currentInstance.version){
+ exists = true;
+ }
+ });
+
+ if(exists){
+ this.form.controls['version'].setErrors({error: 'Version Already Exists'});
+ }else{
+ this.form.controls['version'].setErrors(null);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-form/create-test-form.module.spec.ts b/otf-frontend/client/src/app/shared/modules/create-test-form/create-test-form.module.spec.ts
new file mode 100644
index 0000000..595b3d1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-form/create-test-form.module.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { CreateTestFormComponent } from './create-test-form.component';
+
+describe('CreateTestFormComponent', () => {
+ let component: CreateTestFormComponent;
+ let fixture: ComponentFixture<CreateTestFormComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ CreateTestFormComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(CreateTestFormComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-form/create-test-form.module.ts b/otf-frontend/client/src/app/shared/modules/create-test-form/create-test-form.module.ts
new file mode 100644
index 0000000..7466c81
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-form/create-test-form.module.ts
@@ -0,0 +1,77 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { CreateTestFormComponent } from './create-test-form.component';
+import { FormsModule, ReactiveFormsModule } from '@angular/forms';
+import { MatButtonModule, MatIconModule, MatTooltipModule, MatInputModule, MatBadgeModule, MatOptionModule, MatSelectModule,
+ MatSnackBarModule,
+ MatSlideToggleModule,
+ MatListModule} from '@angular/material';
+import { MatProgressButtonsModule} from 'mat-progress-buttons';
+import { PageHeaderModule } from '../page-header/page-header.module';
+import { PerfectScrollbarModule, PERFECT_SCROLLBAR_CONFIG, PerfectScrollbarConfigInterface } from 'ngx-perfect-scrollbar';
+import { FilterPipeModule } from 'ngx-filter-pipe';
+import { SelectStrategyModalModule } from '../select-strategy-modal/select-strategy-modal.module';
+import { SelectTestHeadModalModule } from '../select-test-head-modal/select-test-head-modal.module';
+import { CodemirrorModule } from 'ng2-codemirror';
+import { MatExpansionModule} from '@angular/material/expansion';
+import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
+import { AlertModalModule } from '../alert-modal/alert-modal.module';
+import { AlertSnackbarModule } from '../alert-snackbar/alert-snackbar.module';
+import { FileUploadModule } from 'ng2-file-upload';
+import { Bpmn } from 'app/shared/models/bpmn.model';
+
+const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
+ suppressScrollY: true
+};
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FilterPipeModule,
+ FormsModule,
+ ReactiveFormsModule,
+ PageHeaderModule,
+ PerfectScrollbarModule,
+ MatButtonModule,
+ SelectTestHeadModalModule,
+ SelectStrategyModalModule,
+ MatIconModule,
+ CodemirrorModule,
+ MatTooltipModule,
+ MatInputModule,
+ MatExpansionModule,
+ MatProgressSpinnerModule,
+ MatBadgeModule,
+ AlertModalModule,
+ MatSelectModule,
+ MatOptionModule,
+ AlertSnackbarModule,
+ MatSnackBarModule,
+ FileUploadModule,
+ MatSlideToggleModule,
+ MatProgressButtonsModule,
+ MatListModule
+ ],
+ declarations: [CreateTestFormComponent],
+ exports: [CreateTestFormComponent],
+ providers: [
+ { provide: PERFECT_SCROLLBAR_CONFIG, useValue: DEFAULT_PERFECT_SCROLLBAR_CONFIG }
+ ]
+})
+export class CreateTestFormModule { }
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-form/definition-instance.class.ts b/otf-frontend/client/src/app/shared/modules/create-test-form/definition-instance.class.ts
new file mode 100644
index 0000000..d73e48a
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-form/definition-instance.class.ts
@@ -0,0 +1,60 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+export class DefinitionInstance {
+
+ public bpmnFileId: String;
+ public bpmnXml: any;
+ public resourceFileId: String;
+ public resourceFileName: String;
+ public isDeployed: Boolean;
+ public testHeads: TestHead[];
+ public dataTestHeads: DataTestHead[];
+ public testDataTemplate: String;
+ public testDataTemplateJSON: any;
+ public version: String;
+ public bpmnHasChanged: Boolean;
+ public pflos: Pflo[];
+
+ constructor(){
+ this.testDataTemplate = '';
+ this.version = '';
+ this.testHeads = [];
+ this.dataTestHeads = [];
+ this.pflos = [];
+ this.isDeployed = false;
+ this.bpmnFileId = null;
+ this.resourceFileName = null;
+ this.bpmnXml = null;
+ this.resourceFileId = null;
+ this.bpmnHasChanged = false;
+ }
+
+}
+
+interface TestHead {
+ bpmnVthTaskId: String;
+ testHeadId: String;
+}
+
+interface DataTestHead extends TestHead {
+ testHead: any;
+}
+
+interface Pflo {
+ bpmnPfloTaskId: String;
+ label: String;
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-form/test-definition.class.ts b/otf-frontend/client/src/app/shared/modules/create-test-form/test-definition.class.ts
new file mode 100644
index 0000000..0303d13
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-form/test-definition.class.ts
@@ -0,0 +1,222 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { DefinitionInstance } from "./definition-instance.class";
+import { element } from "@angular/core/src/render3/instructions";
+
+export class TestDefinition {
+
+ public _id: String;
+ public testName: String;
+ public testDescription: String;
+ public groupId: String;
+ public processDefinitionKey: String;
+
+ public bpmnInstances: DefinitionInstance[];
+
+ public currentVersion; // int Array index of the bpmnInstances
+ public currentVersionName;
+ public currentInstance: DefinitionInstance;
+
+ constructor(testDefinition: TestDefinition = null){
+ if(testDefinition){
+ this.setAll(testDefinition);
+ }
+ }
+
+
+ reset(){
+ this._id = '';
+ this.testName = '';
+ this.testDescription = '';
+ this.groupId = '';
+ this.processDefinitionKey = '';
+ this.bpmnInstances = [
+ this.newInstance() as DefinitionInstance
+ ];
+ this.currentInstance = this.bpmnInstances[0];
+ this.currentVersion = 0;
+ }
+
+ getAll(){
+ return {
+ _id: this._id,
+ testName: this.testName,
+ testDescription: this.testDescription,
+ processDefinitionKey: this.processDefinitionKey,
+ bpmnInstances: this.bpmnInstances,
+ currentVersion: this.currentVersion
+ };
+ }
+
+ switchVersion(version: String = null){
+
+ if(version){
+ //find the version
+ this.bpmnInstances.forEach((elem, val) => {
+ if(elem['version'] == version){
+ this.currentVersion = val;
+ this.currentInstance = this.bpmnInstances[val];
+ this.currentVersionName = this.currentInstance.version;
+ }
+ });
+ }else{
+ //get latest version
+ this.currentVersion = this.bpmnInstances.length - 1;
+ this.currentInstance = this.bpmnInstances[this.currentVersion];
+ this.currentVersionName = this.currentInstance.version;
+ }
+ }
+
+ getVersionKey(){
+ return this.currentVersion;
+ }
+
+ //Setter Methods
+
+ setAll(td){
+ this._id = td._id;
+ this.testName = td.testName;
+ this.testDescription = td.testDescription;
+ this.groupId = td.groupId;
+ this.processDefinitionKey = td.processDefinitionKey;
+ this.setBpmnInstances(td.bpmnInstances);
+
+ this.bpmnInstances.forEach((elem, val) => {
+ if(!elem.dataTestHeads)
+ this.bpmnInstances[val].dataTestHeads = [];
+ })
+ }
+
+ setId(id: String){
+ this._id = id;
+ }
+
+ setName(testName: String){
+ this.testName = testName;
+ }
+
+ setDescription(testDescription: String){
+ this.testDescription = testDescription;
+ }
+
+ setGroupId(groupId: String){
+ this.groupId = groupId;
+ }
+
+ setProcessDefinitionKey(processDefinitionKey: String){
+ this.processDefinitionKey = processDefinitionKey;
+ }
+
+ setBpmnInstances(instances: DefinitionInstance[] = []){
+ // this.bpmnInstances = [];
+ // for(let i = instances.length - 1; i >= 0; i--){
+ // this.bpmnInstances.push(instances[i]);
+ // }
+ this.bpmnInstances = instances;
+ }
+
+ setNewVersion(newVersion: number = null){
+ if(newVersion == null){
+ newVersion = this.bpmnInstances.length;
+ }
+ if(this.setVersion(newVersion) == -1){
+ this.setNewVersion(++newVersion);
+ }
+ return newVersion;
+ }
+
+ setVersion(version){
+
+ this.bpmnInstances.forEach((elem, val) => {
+
+
+ if(elem.version == version && this.currentVersion != val ){
+ return -1;
+ }
+ });
+ this.currentInstance.version = version;
+ return version;
+ }
+
+ addBpmnInstance(instance = null){
+
+ if(!instance){
+ instance = this.newInstance();
+ }
+ let alreadyIn = false;
+ this.bpmnInstances.forEach((elem, val) => {
+ if(elem.version == instance.version && val != 0){
+ alreadyIn = true;
+ }
+ });
+ if(!alreadyIn){
+ this.bpmnInstances.push(instance);
+ this.setNewVersion()
+ }
+
+ }
+
+ removeBpmnInstance(version){
+ this.bpmnInstances.forEach((elem, val) =>{
+ if(elem['version'] == version){
+ this.bpmnInstances.splice(val, 1);
+ }
+ });
+ }
+
+ //Getter Methods
+
+ getId(){
+ return this._id;
+ }
+
+ getName(){
+ return this.testName;
+ }
+
+ getDescription(){
+ return this.testDescription;
+ }
+
+ getGroupId(){
+ return this.groupId;
+ }
+
+ getProcessDefinitionKey(){
+ return this.processDefinitionKey;
+ }
+
+ getBpmnInstances(version: String = null){
+ if(!version)
+ return this.bpmnInstances;
+
+ this.bpmnInstances.forEach((elem, val) => {
+ if(elem['version'] == version){
+ return elem;
+ }
+ });
+ }
+
+ newInstance() {
+ return new DefinitionInstance();
+ }
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-head-form/create-test-head-form.component.pug b/otf-frontend/client/src/app/shared/modules/create-test-head-form/create-test-head-form.component.pug
new file mode 100644
index 0000000..8807f2d
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-head-form/create-test-head-form.component.pug
@@ -0,0 +1,78 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+form(#testHeadForm="ngForm", style="width:100%")
+ .row
+ .col-sm-6
+ mat-form-field(*ngIf="vth._id")
+ input(matInput, type="text", name="_id", placeholder="Test Head ID", [ngModel]='vth._id', disabled)
+
+ mat-form-field
+ input(matInput, type="text", name="test_head_name", placeholder="Name", [(ngModel)]="vth.testHeadName", required)
+
+ mat-form-field
+ input(matInput, type="text", name="test_head_hostname", placeholder="Hostname", [(ngModel)]="vth.hostname")
+
+ mat-form-field
+ input(matInput, type="text", name="test_head_urlPath", placeholder="Resource Path", [(ngModel)]="vth.resourcePath")
+
+ .col-sm-6
+ mat-form-field
+ input(matInput, name="description", placeholder="Description", [(ngModel)]="vth.testHeadDescription", required)
+
+ mat-form-field
+ input(matInput, type="text", name="test_head_port", placeholder="Port", [(ngModel)]="vth.port")
+
+ .row
+ .col-sm-4
+ mat-checkbox(name="test_head_authorization_enabled", (change)="markAsDirty()", [(ngModel)]="vth.authorizationEnabled") Authorization
+
+ .col-sm-3
+ mat-form-field
+ input(matInput, type="text", name="test_head_authorization_type", placeholder="Type (ex: ApiKey)", [(ngModel)]="vth.authorizationType")
+
+ .col-sm-5
+ mat-form-field
+ input(matInput, type="text", autocomplete="off", name="test_head_authorization_credential", placeholder="Password", [(ngModel)]="vth.authorizationCredential")
+
+
+
+ //- mat-form-field
+ //- mat-select((selectionChange)="markAsDirty()", name="ns", placeholder="User Group", [(value)]="vth.groupId", required)
+ //- mat-option(*ngFor="let group of groups", value="{{group._id}}") {{ group.groupName }}
+
+ .col-12
+ h5.text-muted vthInputTemplate.yaml
+ input( type="file", id="file", (change)="saveFileContents()")
+ div(style="border: 1px solid lightgrey; font-size: 16px !important")
+ codemirror([config]="codeConfig", [(ngModel)]='vth.vthInputTemplate', name="vthInputTemplate")
+
+ //- .row.mt-3
+ //- .col
+ //- h5.text-muted vthOutputTemplate.yaml
+ //- div(style="border: 1px solid lightgrey; font-size: 16px !important")
+ //- codemirror([config]="codeConfig", [(ngModel)]='vth.vthOutputTemplate', name="vthOutputTemplate")
+
+
+ .row(style="height:30px")
+ .row.form-buttons
+ .col-12
+ .pull-left
+ .mr-3(mat-button, *ngIf="testHeadForm.form.valid && !testHeadForm.form.dirty && options.goal == 'edit'") saved
+ mat-icon(style="color:green") check
+ .pull-right
+ button.mr-3(mat-raised-button, color="primary", (click)='create()', *ngIf="options.goal == 'create'", [disabled]="!testHeadForm.form.valid") Create
+ button.mr-3(mat-raised-button, color="accent", (click)='update()', *ngIf="options.goal == 'edit'", [disabled]="!testHeadForm.form.valid || !testHeadForm.form.dirty") Update
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-head-form/create-test-head-form.component.scss b/otf-frontend/client/src/app/shared/modules/create-test-head-form/create-test-head-form.component.scss
new file mode 100644
index 0000000..8d6ae72
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-head-form/create-test-head-form.component.scss
@@ -0,0 +1,35 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+// .ng-valid[required], .ng-valid.required {
+// border-left: 3px solid #42A948; /* green */
+// }
+
+// .ng-invalid:not(form) {
+// border-left: 3px solid #a94442; /* red */
+// }
+
+// .ng-dirty:not(form) {
+// border-left: 3px solid #045C87; /* blue */
+// }
+
+mat-form-field {
+ width: 100%;
+}
+
+.CodeMirror-scroll {
+ height: 200px
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-head-form/create-test-head-form.component.spec.ts b/otf-frontend/client/src/app/shared/modules/create-test-head-form/create-test-head-form.component.spec.ts
new file mode 100644
index 0000000..efb2b4a
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-head-form/create-test-head-form.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { CreateTestHeadFormComponent } from './create-test-head-form.component';
+
+describe('CreateTestHeadFormComponent', () => {
+ let component: CreateTestHeadFormComponent;
+ let fixture: ComponentFixture<CreateTestHeadFormComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ CreateTestHeadFormComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(CreateTestHeadFormComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-head-form/create-test-head-form.component.ts b/otf-frontend/client/src/app/shared/modules/create-test-head-form/create-test-head-form.component.ts
new file mode 100644
index 0000000..4e0f459
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-head-form/create-test-head-form.component.ts
@@ -0,0 +1,170 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { ListService } from '../../services/list.service';
+import { TestHeadService } from '../../services/test-head.service';
+import { GroupService } from '../../services/group.service';
+import 'codemirror/mode/yaml/yaml.js';
+import { MatSnackBar, MatDialog, MatDialogRef } from '@angular/material';
+import { AlertSnackbarComponent } from '../alert-snackbar/alert-snackbar.component';
+import { AlertModalComponent } from '../alert-modal/alert-modal.component';
+
+
+@Component({
+ selector: 'app-create-test-head-form',
+ templateUrl: './create-test-head-form.component.pug',
+ styleUrls: ['./create-test-head-form.component.scss']
+})
+export class CreateTestHeadFormComponent implements OnInit {
+ yaml;
+
+ private hasPrevCredential;
+
+ public codeConfig = {
+ mode: "yaml",
+ theme: "eclipse",
+ lineNumbers: true
+ };
+
+ @Input() public formData;
+ @Input() public options;
+
+ @Output() public childEvent = new EventEmitter();
+
+ //Virtual Test Head Type Options
+ types = [
+ 'Proxy',
+ 'Regular',
+ 'Script',
+ 'Adapter'
+ ]
+
+ //Implementation Language Options
+ langs = [
+ 'Java',
+ 'Python',
+ 'JavaScript/NodeJS'
+ ]
+
+ public vth;
+ public groups;
+
+ @ViewChild('testHeadForm') form: any;
+
+ constructor(public dialogRef: MatDialogRef<CreateTestHeadFormComponent>, private http: HttpClient, private list: ListService, private dialog: MatDialog, private snack: MatSnackBar, private testHead: TestHeadService, private group: GroupService) { }
+
+ ngOnInit() {
+ this.setNew();
+ if(this.formData){
+ this.vth = Object.assign({}, this.formData);
+ if(!this.vth.authorizationCredential){
+ this.vth.authorizationCredential = "";
+ this.hasPrevCredential = false;
+ }
+ else{
+ this.hasPrevCredential = true
+ }
+ }
+ }
+
+ markAsDirty(){
+ this.form.control.markAsDirty();
+ }
+
+ create(){
+
+ this.testHead.create(this.vth)
+ .subscribe((vth) => {
+ //this.list.addElement('vth', vth);
+ this.clear(this.form);
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message:'Test Head Created'
+ }
+ });
+ this.dialogRef.close();
+ //this.dialog.closeAll();
+ }, err => {
+ this.dialog.open(AlertModalComponent, {
+ data: {
+ type: 'alert',
+ message: JSON.stringify(err)
+ },
+ width: '450px'
+ })
+ });
+
+ }
+ //grab file
+ saveFileContents(){
+ this.getFileContents(val => {
+ this.vth.vthInputTemplate = val;
+ });
+ }
+
+ getFileContents(callback) {
+ var val = "x";
+ var fileToLoad = (document.getElementById('file'))['files'][0];
+ var fileReader = new FileReader();
+ if (!fileToLoad) {
+ return null;
+ }
+ fileReader.onload = function (event) {
+ //
+ val = event.target['result'];
+
+ //
+ callback(val);
+ }
+ fileReader.readAsText(fileToLoad);
+ }
+
+ update(){
+ if(!this.hasPrevCredential && this.vth.authorizationCredential == ""){
+ delete this.vth.authorizationCredential;
+ }
+ this.testHead.patch(this.vth)
+ .subscribe((vth) => {
+ // this.list.updateElement('vth', '_id', vth['_id'], vth);
+ this.childEvent.emit();
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message:'Test Head Updated'
+ }
+ });
+ this.dialogRef.close();
+ });
+ }
+
+ clear(form){
+ this.setNew();
+ if(form){
+ form.reset();
+ }
+ this.childEvent.emit();
+ }
+
+ setNew(){
+ this.vth = {};
+ this.vth.vthInputTemplate = '';
+
+ //this.vth.vthOutputTemplate = '';
+ }
+}
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-head-form/create-test-head-form.module.spec.ts b/otf-frontend/client/src/app/shared/modules/create-test-head-form/create-test-head-form.module.spec.ts
new file mode 100644
index 0000000..b039050
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-head-form/create-test-head-form.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { CreateTestHeadFormModule } from './create-test-head-form.module';
+
+describe('CreateTestHeadFormModule', () => {
+ let createTestHeadFormModule: CreateTestHeadFormModule;
+
+ beforeEach(() => {
+ createTestHeadFormModule = new CreateTestHeadFormModule();
+ });
+
+ it('should create an instance', () => {
+ expect(createTestHeadFormModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-head-form/create-test-head-form.module.ts b/otf-frontend/client/src/app/shared/modules/create-test-head-form/create-test-head-form.module.ts
new file mode 100644
index 0000000..14b83e1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-head-form/create-test-head-form.module.ts
@@ -0,0 +1,53 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { CreateTestHeadFormComponent } from './create-test-head-form.component';
+import { FormsModule } from '@angular/forms';
+import {
+ MatButtonModule,
+ MatInputModule,
+ MatSelectModule,
+ MatOptionModule,
+ MatSnackBarModule,
+ MatIconModule,
+ MatDialogModule,
+ MatSlideToggleModule, MatCheckboxModule
+} from '@angular/material';
+import { CodemirrorModule } from 'ng2-codemirror';
+import { AlertSnackbarModule } from '../alert-snackbar/alert-snackbar.module';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ CodemirrorModule,
+ FormsModule,
+ MatButtonModule,
+ MatInputModule,
+ MatSelectModule,
+ MatOptionModule,
+ MatSnackBarModule,
+ AlertSnackbarModule,
+ MatIconModule,
+ MatDialogModule,
+ MatSlideToggleModule,
+ MatCheckboxModule
+ ],
+ declarations: [CreateTestHeadFormComponent],
+ exports: [CreateTestHeadFormComponent ]
+})
+export class CreateTestHeadFormModule { }
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-instance-form/create-test-instance-form.component.pug b/otf-frontend/client/src/app/shared/modules/create-test-instance-form/create-test-instance-form.component.pug
new file mode 100644
index 0000000..8739065
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-instance-form/create-test-instance-form.component.pug
@@ -0,0 +1,139 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+.row(style="margin-left: 0px")
+ .col
+ button.mr-2.mt-2(mat-raised-button, color="primary", (click)="getDefinition()") Select Definition
+ label() Selected Test Defintion: {{ selectedDefinition.testName || "None Selected" }}
+ div.mt-4(*ngIf="selectedDefinition.testName")
+ .col-md-12.mb-4
+ .row
+ mat-form-field.mr-3
+ input(matInput, [(ngModel)]="testInstance.testInstanceName", placeholder="Instance Name", required)
+ mat-error Required
+ mat-form-field
+ input(matInput, [(ngModel)]="testInstance.testInstanceDescription", placeholder="Description")
+ .row
+ Label() Select BPMN Version
+ .row
+ .col-md-4
+ mat-select.mr-2([(value)]="selectedBpmn", [disabled]="testInstance.useLatestTestDefinition || editMode", (selectionChange)="changeBpmn()")
+ mat-option( *ngFor="let bpmn of selectedDefinition.bpmnInstances | filterNonDeployed: myFilter", [value]="bpmn") {{bpmn.version}}
+
+ .col-md-4
+ mat-slide-toggle(*ngIf='!editMode', [(ngModel)]="testInstance.useLatestTestDefinition", (change)="useLatest()") Use latest
+ mat-slide-toggle.ml-2(color="primary", [(ngModel)]="testInstance.simulationMode", (change)="simulationMode()") Simulation Mode
+
+ mat-accordion
+ mat-expansion-panel([expanded]="false")
+ mat-slide-toggle((change)="toggleYaml()", [checked]="displayYAML") Display Yaml Input
+ mat-expansion-panel-header Test Input
+ div(*ngIf='testInstance.testDataJSON || selectedBpmn.testDataTemplateJSON')
+ app-form-generator(*ngIf="!displayYAML", [JSONData] = 'testInstance.testDataJSON || selectedBpmn.testDataTemplateJSON', [taskId]= '', (childEvent)="saveTestDataOptions($event)" )
+ codemirror(*ngIf="displayYAML", [config]="codeConfig", [(ngModel)] = "testInstance['testData']")
+
+ //- If Not in simulation mode, display vth input fields
+ div(*ngIf="!testInstance.simulationMode")
+ mat-slide-toggle.mt-4.mb-2((change) = "testHeadYaml()") Display Yaml (All VTHs)
+ mat-accordion(*ngFor = 'let testHead of selectedBpmn.testHeads; let i = index')
+ mat-expansion-panel(*ngIf="editMode || (testHead.testHeadId.testHeadName && testHead.testHeadId.testHeadName.toLowerCase() != 'robot')",[expanded]='false')
+ mat-expansion-panel-header {{ testHead.testHeadId.testHeadName || testInstance.vthInput[testHead.bpmnVthTaskId + "testHeadName"] }} ({{testHead.bpmnVthTaskId}})
+ app-form-generator(*ngIf= "!testHeadYAML", [JSONData] = 'testInstance.vthInput[testHead.bpmnVthTaskId] || testHead["testHeadId"]["vthInputTemplateJSON"]', [taskId]="testHead.bpmnVthTaskId", (childEvent)="saveFormOptions($event)")
+
+ codemirror(*ngIf="testHeadYAML", [config]="codeConfig", [(ngModel)] = "testInstance['vthInputYaml'][testHead.bpmnVthTaskId]")
+
+ mat-expansion-panel(*ngIf="(testHead.testHeadId.testHeadName && testHead.testHeadId.testHeadName.toLowerCase() == 'robot')", [expanded]='false')
+ mat-expansion-panel-header {{ testHead.testHeadId.testHeadName || testInstance.vthInput[testHead.bpmnVthTaskId + "testHeadName"]}} ({{testHead.bpmnVthTaskId}}) Robot Files
+ mat-panel-title Resources
+ .row
+ .col-md-3
+ //- .mb-2 TESTING GIT TRACKING
+ //- | Multiple Files
+ //- mat-slide-toggle(color="primary", name="isZip", [(ngModel)]="isZip", (change)="uploader.clearQueue()")
+ //- | .zip
+ //- div
+ //- input(*ngIf="!isZip", type="file", name="scripts", ng2der")FileSelect, [uploader]="uploader", multiple)
+ input(*ngIf="isZip", type="file", name="scripts", ng2FileSelect, [uploader]="uploaders[testHead.bpmnVthTaskId]", accept="application/zip")
+ .col-md-8.ml-2
+ div(*ngIf="uploaders[testHead.bpmnVthTaskId].queue.length > 0")
+ label Files:
+ ul.list-group(style="position:relative")
+ li.list-group-item(*ngFor="let item of uploaders[testHead.bpmnVthTaskId].queue")
+ | {{ item?.file?.name }}
+ div.upload-progress([ngStyle]="{'width': item.progress + '%'}")
+ //button.pull-right(mat-button, (click)="upload()") Upload All
+ button.pull-right(mat-button, color="primary", (click)="uploaders[testHead.bpmnVthTaskId].clearQueue()") Remove All
+
+ //- If in simulation mode, show simulated outputs and delays
+ div.mt-4(*ngIf="testInstance.simulationMode && testInstance.simulationVthInput")
+ mat-accordion
+ mat-expansion-panel(*ngFor="let testHead of selectedBpmn.testHeads; let i = index")
+ mat-expansion-panel-header
+ span(style="color: #2196f3") Simulated
+ | {{ testHead.testHeadId.testHeadName || testInstance.vthInput[testHead.bpmnVthTaskId + "testHeadName"] }} ({{testHead.bpmnVthTaskId}})
+ codemirror([config]="codeJsonConfig", *ngIf="testInstance.simulationVthInput[testHead.bpmnVthTaskId]", [(ngModel)]="testInstance.simulationVthInput[testHead.bpmnVthTaskId]")
+ //- h5.text-muted testHeadData.yaml
+ //- div(style="border: 1px solid lightgrey")
+ //- codemirror([config]="codeConfig", value = "{{ testInstance['testData']}}", [(ngModel)]='testInstance["testData"]')
+ div.mt-4(*ngIf="checkPfloInputLength()")
+ h4 PFLO Inputs
+ mat-accordion
+ mat-expansion-panel(*ngFor="let pflo of selectedBpmn.pflos; let i = index" color="primary")
+ mat-expansion-panel-header {{testInstance.pfloInput[pflo.bpmnPfloTaskId + "pfloName"]}} ({{pflo.bpmnPfloTaskId}})
+ .row
+ .col-md-6()
+ h5 Stop on Failure
+ mat-form-field
+ mat-select(placeholder="Interrupt On Failure", [(value)]="testInstance.pfloInput[pflo.bpmnPfloTaskId]['interruptOnFailure']", required)
+ mat-option([value]="false") False
+ mat-option([value]="true") True
+ h5 Max Number of Failures
+ mat-form-field
+ input(matInput, type="number", [(ngModel)] = "testInstance.pfloInput[pflo.bpmnPfloTaskId]['maxFailures']")
+ .col-md-6
+ h5 Number of Threads
+ mat-form-field
+ input(matInput, type="number", [(ngModel)] = "testInstance.pfloInput[pflo.bpmnPfloTaskId]['threadPoolSize']")
+
+ .dropdown.mt-1(ngbDropdown, autoClose="outside", (openChange)="clearSelectedValues()", placement="left-top")
+ button(mat-raised-button, [disabled]="editMode", color="primary", ngbDropdownToggle, (click)="null") Add Instance
+ i.ml-1.fa.fa-caret-down
+ .dropdown-menu(ngbDropdownMenu)
+ h4.mb-2.ml-1(style="font-weight: bold;") Add Instances
+ input.ml-1(matInput, type='search', placeholder='Search...', color='blue', [(ngModel)]='search.testInstanceName')
+ div(style="max-height: 300px; overflow-y: scroll")
+ .px-4.py-3
+ .mr-2.ml-2(*ngFor="let instance of instances | filterBy:search")
+ mat-checkbox([(ngModel)]='instance.isSelected') {{instance.testInstanceName}}
+ div( style="text-align: center")
+ button.primary.mr-1(mat-raised-button, aria-label='Add', color="primary", (click)='addInstancesToPflo(pflo.bpmnPfloTaskId)') Add
+
+ h4.mt-2(*ngIf="testInstance.pfloInput[pflo.bpmnPfloTaskId].args.length && !editMode", style="width:100%") Workflows
+ mat-accordion
+ mat-expansion-panel(*ngFor="let workReq of testInstance.pfloInput[pflo.bpmnPfloTaskId].args; let i = index")
+ mat-expansion-panel-header(style="align-text:center") {{tiNameLookup[workReq.testInstanceId]}}
+ //button.primary.mr-1.ml-4(mat-mini-fab, aria-label='Remove', color="warn", (click)="deleteWorkReq(pflo.bpmnPfloTaskId, i)")
+ i.fa.fa-remove.ml-2((click)="deleteWorkReq(pflo.bpmnPfloTaskId, i)")
+ app-workflow-request([formData]='testInstance.pfloInput[pflo.bpmnPfloTaskId].args[i]', [taskId]="pflo.bpmnPfloTaskId", [index]="i", (childEvent)="saveWorkReqForm($event)")
+.row(style="height:40px")
+.row.form-buttons(*ngIf = "selectedDefinition.testName")
+ .col-12.mt-3
+ .pull-right
+ h5.mr-2(style="color: Red", *ngIf='executionFailed') Tests failed to execute!
+ button.mr-2(mat-raised-button, *ngIf='!editMode', color="primary", (click)="saveAll()") Save
+ button(mat-raised-button, *ngIf='!editMode', color="warn", (click)="saveAndExecute()") Save and Execute
+ button.mr-2(mat-raised-button, *ngIf='editMode', color="primary", (click)="updateInstance()") Update
+ button.mr-2(mat-raised-button, *ngIf='editMode', color="primary", (click)="cancel()") Cancel
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-instance-form/create-test-instance-form.component.scss b/otf-frontend/client/src/app/shared/modules/create-test-instance-form/create-test-instance-form.component.scss
new file mode 100644
index 0000000..d93cec9
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-instance-form/create-test-instance-form.component.scss
@@ -0,0 +1,19 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.dropdown-toggle::after {
+ display:none;
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-instance-form/create-test-instance-form.component.spec.ts b/otf-frontend/client/src/app/shared/modules/create-test-instance-form/create-test-instance-form.component.spec.ts
new file mode 100644
index 0000000..16c79dd
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-instance-form/create-test-instance-form.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { CreateTestInstanceFormComponent } from './create-test-instance-form.component';
+
+describe('CreateTestInstanceFormComponent', () => {
+ let component: CreateTestInstanceFormComponent;
+ let fixture: ComponentFixture<CreateTestInstanceFormComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ CreateTestInstanceFormComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(CreateTestInstanceFormComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-instance-form/create-test-instance-form.component.ts b/otf-frontend/client/src/app/shared/modules/create-test-instance-form/create-test-instance-form.component.ts
new file mode 100644
index 0000000..df703b4
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-instance-form/create-test-instance-form.component.ts
@@ -0,0 +1,788 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
+import 'codemirror/mode/yaml/yaml.js';
+import { TestInstanceService } from '../../services/test-instance.service';
+import { TestDefinitionService } from '../../services/test-definition.service';
+import { SchedulingService } from '../../services/scheduling.service';
+import { SelectStrategyModalComponent } from '../select-strategy-modal/select-strategy-modal.component';
+import { MatDialog, MatSnackBar } from '@angular/material';
+import { AlertModalComponent } from '../alert-modal/alert-modal.component';
+import { Router } from '@angular/router';
+import { AlertSnackbarComponent } from '../alert-snackbar/alert-snackbar.component';
+import { ListService } from 'app/shared/services/list.service';
+import { FileUploader, FileItem, ParsedResponseHeaders } from 'ng2-file-upload';
+import { HttpClient, HttpHeaders } from "@angular/common/http";
+import { AppGlobals } from "../../../app.global";
+import { CookieService } from "ngx-cookie-service";
+import * as YAML from '../../../../../../node_modules/yamljs/lib/Yaml';
+import 'codemirror/mode/javascript/javascript.js';
+import beautify from 'json-beautify';
+import { WorkflowRequest } from './instance.class';
+import { PfloInputClass } from './instance.class';
+import { GroupService } from 'app/shared/services/group.service';
+import { ExecuteService } from 'app/shared/services/execute.service';
+
+const URL = AppGlobals.baseAPIUrl + 'files';
+
+
+@Component({
+ selector: 'app-create-test-instance-form',
+ templateUrl: './create-test-instance-form.component.pug',
+ styleUrls: ['./create-test-instance-form.component.scss']
+})
+export class CreateTestInstanceFormComponent implements OnInit {
+ yaml;
+ //Variable sent between modules
+ @Input() public existingInstance: any;
+
+ @Output() public childEvent = new EventEmitter();
+ public dataTemplate: any;
+ public configTemplate: any;
+
+ public codeConfig = {
+ mode: "yaml",
+ theme: "eclipse",
+ lineNumbers: true
+ };
+
+ public codeJsonConfig = {
+ mode: "application/json",
+ theme: "eclipse",
+ lineNumbers: true
+ }
+
+ public testDefinition;
+ public testInstance;
+ public createResult;
+ public selectedDefinition;
+ public errorCount = 0;
+ public executionFailed = false;
+ public editMode = false;
+ public httpOptions;
+ public selectedBpmn;
+ public uploader: FileUploader;
+ public isZip = true;
+ public scriptFiles = [];
+ public uploaders = {};
+ public vthInput = {};
+ public pfloInput = {};
+ public argsToAdd = {};
+ public vthInputYaml = {};
+ public displayYAML = false;
+ public testHeadYAML = false;
+ public testHeadNames = {};
+ public tiNameLookup = {};
+ public instances;
+ public search;
+ public instanceAdded;
+
+
+ public uploadOptions = {
+ url: AppGlobals.baseAPIUrl + 'file-transfer',
+ authTokenHeader: 'Authorization',
+ authToken: 'Bearer ' + JSON.parse(this.cookie.get('access_token'))
+ };
+
+ // , private http: HttpClient, private Params: ParamsService, private cookie: CookieService
+ constructor(private router: Router, private list: ListService, private dialog: MatDialog, private execute: ExecuteService, private testInstanceService: TestInstanceService, private testDefinitionService: TestDefinitionService, private snack: MatSnackBar, private http: HttpClient, private cookie: CookieService, private groupService: GroupService) {
+ this.http = http;
+ this.cookie = cookie;
+ // this.httpOptions = {
+ // headers: new HttpHeaders({
+ // 'Content-Type': 'application/json',
+ // 'Authorization': 'Bearer ' + JSON.parse(this.cookie.get('access_token'))
+ // })
+ // };
+ }
+ // testingSelect(){
+ // console.log(this.selectedBpmn);
+ // }
+ myFilter(bpmn) {
+ return bpmn.isDeployed;
+ }
+ ngOnInit() {
+ this.search = {};
+ this.search.testInstanceName = '';
+ this.testInstance = {};
+ this.selectedDefinition = {};
+ this.selectedBpmn = {};
+ this.testInstance.useLatestTestDefinition = true;
+ this.testInstance.simulationVthInput = {};
+ let currentGroup;
+ //options required for the file uploader
+ currentGroup = this.groupService.getGroup();
+ this.groupService.groupChange().subscribe(group => {
+ currentGroup = group;
+ });
+
+ this.testInstanceService.find({
+ groupId: currentGroup['_id'],
+ $limit: -1,
+ $sort: {
+ createdAt: -1,
+ },
+ $select: ['testInstanceName']
+ }).subscribe((result) => {
+ this.instances = result;
+ for(let i = 0; i < this.instances.length; i++){
+ this.instances[i].isSelected = false;
+ }
+ })
+
+ //File Uploaders
+ //this.uploader = new FileUploader(uploadOptions);
+ //if the user is using this page for editing an existing instance
+ if (this.existingInstance) {
+ //console.log(this.existingInstance)
+ if (this.existingInstance.testInstance) {
+ this.testInstance = this.existingInstance.testInstance;
+ this.selectedDefinition = this.existingInstance.testInstance['testDefinitionId'];
+
+ this.convertSimulationVth('string');
+ console.log(this.testInstance);
+
+ //set the bpmn to the selected bpmn. Alert User if no bpmn versions are deployed
+ if (this.testInstance.useLatestTestDefinition) {
+ this.useLatest();
+ } else {
+ for (let i = 0; i < this.selectedDefinition.bpmnInstances.length; i++) {
+ if (this.selectedDefinition.bpmnInstances[i].processDefintionId === this.testInstance.processDefintionId) {
+ this.selectedBpmn = this.selectedDefinition.bpmnInstances[i];
+ break;
+ }
+ }
+ }
+
+ if (this.testInstance.testData === '') {
+ this.displayYAML = true;
+ }
+
+ if (!this.testInstance.simulationVthInput) {
+ this.testInstance.simulationVthInput = {};
+ }
+
+
+ //grab all robot test heads to assign uploaders to each and create the vthInput object
+ //for(let j = 0; j < this.selectedBpmn.testHeads.length; j++){
+
+
+ //}
+ //console.log(this.uploaders);
+ if (this.existingInstance.isEdit == true)
+ this.editMode = true;
+ }//if the user is creating a new instance from the test definition page
+ else if (this.existingInstance.testDefinition) {
+ this.selectedDefinition = this.existingInstance.testDefinition;
+ this.populateTIName();
+ //set the bpmn as the latest deployed version. Alert User if no bpmn versions are deployed
+ this.useLatest();
+ this.populateVthInput();
+ this.populatePfloInput();
+ //grab all robot test heads to assign uploaders to each and set the vthInput object
+ for (let j = 0; j < this.selectedBpmn.testHeads.length; j++) {
+
+ if (this.selectedBpmn.testHeads[j].testHeadId['testHeadName'].toLowerCase() === 'robot') {
+ this.uploaders[this.selectedBpmn.testHeads[j].bpmnVthTaskId] = new FileUploader(this.uploadOptions);
+ }
+ }
+
+ this.testInstance = {
+ "testInstanceDescription": "",
+ "testDefinitionId" : this.selectedDefinition["_id"],
+ "vthInput" : this.vthInput,
+ "pfloInput": this.pfloInput,
+ "vthInputYaml": this.vthInputYaml,
+ "testData": this.selectedBpmn.testDataTemplate,
+ "testDataJSON": this.selectedBpmn.testDataTemplateJSON,
+ "useLatestTestDefinition": true,
+ "internalTestData": {},
+ "simulationVthInput": {}
+ };
+
+ }
+ }
+
+ }
+
+ convertSimulationVth(convertTo) {
+ for (let key in this.testInstance.simulationVthInput) {
+ if (this.testInstance.simulationVthInput.hasOwnProperty(key)) {
+ if(convertTo == 'json')
+ this.testInstance.simulationVthInput[key] = JSON.parse(this.testInstance.simulationVthInput[key]);
+ else if (convertTo == 'string')
+ this.testInstance.simulationVthInput[key] = beautify(this.testInstance.simulationVthInput[key], null, 2, 10);
+ }
+ }
+
+ }
+
+
+
+ simulationMode() {
+ let def = {
+ delay: 0, response: {}
+ };
+ //console.log(this.selectedBpmn);
+ if (this.testInstance.simulationMode) {
+ this.selectedBpmn.testHeads.forEach(e => {
+ if(!this.testInstance.simulationVthInput){
+ this.testInstance.simulationVthInput = {}
+ }
+ if (!this.testInstance.simulationVthInput[e.bpmnVthTaskId]) {
+ this.testInstance.simulationVthInput[e.bpmnVthTaskId] = beautify(def, null, 2, 10);
+ }
+ })
+ }
+ }
+
+ populateTIName() {
+ let list;
+ this.testInstanceService.find({ $limit: -1, $select: ['testInstanceName'], testDefinitionId: this.selectedDefinition._id }).subscribe((res) => {
+ list = res;
+ //console.log(list);
+ let num = list.length;
+ if (num === 0) {
+ this.testInstance.testInstanceName = this.selectedDefinition.testName;
+ } else {
+ this.testInstance.testInstanceName = this.selectedDefinition.testName + num;
+ }
+ let isTaken = true;
+ let count = 0;
+ let alreadyExisted = false;
+ while (isTaken === true && count < 10000) {
+ for (let i = 0; i < list.length; i++) {
+ if (list[i]["testInstanceName"] === this.testInstance.testInstanceName) {
+ num++;
+ this.testInstance.testInstanceName = this.selectedDefinition.testName + num;
+ alreadyExisted = true;
+ break;
+ }
+ }
+ if (alreadyExisted) {
+ alreadyExisted = false;
+ } else {
+ isTaken = false;
+ }
+ count++;
+ }
+ });
+ }
+ //Section for implementing Paralell workflow data entry --------------------------------------------------------------------------------------
+ populatePfloInput(){
+ // this.pfloInput = {
+ // "task123": new PfloInputClass
+ // }
+ //this.selectedBpmn.pflos = [{"bpmnPfloTaskId" : "task123", "label": "TestPFLO"}]
+
+ if(this.testInstance.pfloInput){
+ return;
+ }
+
+ this.pfloInput = {};
+
+ if(this.selectedBpmn == {} || !this.selectedBpmn.pflos){
+
+ this.testInstance.pfloInput = this.pfloInput;
+ return;
+ }
+
+ for(let i = 0; i < this.selectedBpmn.pflos.length; i++){
+ if(this.selectedBpmn.pflos[i]['bpmnPfloTaskId'] != null){
+ this.pfloInput[this.selectedBpmn.pflos[i]['bpmnPfloTaskId']] = new PfloInputClass;
+
+ //this.pfloInput[this.selectedBpmn.pflos[i]['bpmnPfloTaskId'] + "pfloName"] = this.selectedBpmn.pflos[i]['label'];
+ }
+ }
+ this.testInstance.pfloInput = this.pfloInput;
+
+ }
+
+
+ addInstancesToPflo(taskId){
+ for(let i = 0; i < this.instances.length; i++){
+ if(this.instances[i].isSelected){
+ this.tiNameLookup[this.instances[i]._id] = this.instances[i].testInstanceName;
+ this.addPfloInput(taskId, this.instances[i]._id);
+ }
+
+ }
+ }
+
+ addPfloInput(taskId, instanceId){
+
+ this.testInstance.pfloInput[taskId].args.push(new WorkflowRequest(instanceId));
+
+ }
+
+ clearSelectedValues(){
+ this.search.testInstanceName = '';
+ for(let i = 0; i < this.instances.length; i++){
+ this.instances[i].isSelected = false;
+ }
+ }
+
+ saveTestDataOptions(event) {
+ this.testInstance.testData = event.object;
+ }
+
+ saveFormOptions(event) {
+ this.testInstance.vthInput[event.taskId] = event.object;
+ //console.log(this.testInstance);
+ }
+
+
+ checkPfloInputLength(){
+
+ if(this.testInstance.pfloInput != null){
+ let temp = Object.keys(this.testInstance.pfloInput);
+ if(temp.length)
+ return temp.length > 0;
+ else
+ return false;
+ }else{
+ return false;
+ }
+ }
+
+ deleteWorkReq(pfloId, index){
+ this.testInstance.pfloInput[pfloId].args.splice(index, 1);
+ //FORCE REFRESH all connected forms to update their index
+ }
+
+ saveWorkReqForm(event) {
+ this.testInstance.pfloInput[event.taskId].args[event.index] = event.object;
+ //console.log(this.testInstance);
+ }
+
+ convertTestLevelYaml() {
+ if (this.displayYAML) {
+ this.testInstance.testDataJSON = YAML.parse(this.testInstance.testData);
+ } else {
+ this.testInstance.testData = YAML.stringify(this.testInstance.testDataJSON);
+ }
+ }
+
+ convertVTHYaml() {
+ if (this.testHeadYAML) {
+ for (let key in this.testInstance.vthInputYaml) {
+ this.testInstance.vthInput[key] = YAML.parse(this.testInstance.vthInputYaml[key]);
+ }
+ } else {
+
+ for (let key in this.testInstance.vthInput) {
+ this.testInstance.vthInputYaml[key] = YAML.stringify(this.testInstance.vthInput[key]);
+ }
+ }
+ }
+ //End of Paralell workflow data entry section --------------------------------------------------------------------------------------
+
+ changeBpmn() {
+ //populate the vth inputs when bpmn changes
+ this.populateVthInput();
+ this.displayYAML = !this.displayYAML;
+ this.testInstance.testDataJSON = this.selectedBpmn.testDataTemplateJSON;
+ this.testInstance.testData = this.selectedBpmn.testDataTemplate;
+ this.convertTestLevelYaml();
+ setTimeout(() => {
+ this.displayYAML = !this.displayYAML;
+ }, 200);
+
+ }
+ //toggle Yaml for test level data
+ toggleYaml() {
+ this.convertTestLevelYaml();
+ this.displayYAML = !this.displayYAML;
+ }
+ //toggles Yaml for testHeads
+ testHeadYaml() {
+ this.convertVTHYaml();
+ this.testHeadYAML = !this.testHeadYAML;
+ }
+ //onChange method for the use latest TD toggle
+ useLatest() {
+ if (this.testInstance.useLatestTestDefinition) {
+ let temp;
+ let orderNum;
+ let processKey;
+ for (let i = 0; i < this.selectedDefinition.bpmnInstances.length; i++) {
+ if (temp) {
+ processKey = this.selectedDefinition.bpmnInstances[i].processDefinitionId
+ if(processKey){
+ orderNum = processKey.split(":");
+ orderNum = orderNum[1];
+ //console.log("bpmn check : " + orderNum + " bpmn current: " + temp.processDefinitionId.split(':')[1]);
+ if (this.selectedDefinition.bpmnInstances[i].isDeployed && parseInt(orderNum) > parseInt(temp.processDefinitionId.split(':')[1])) {
+ temp = this.selectedDefinition.bpmnInstances[i];
+ }
+ }
+ } else {
+ if (this.selectedDefinition.bpmnInstances[i].isDeployed) {
+ temp = this.selectedDefinition.bpmnInstances[i];
+ }
+ }
+
+ }
+ if (temp.isDeployed) {
+ this.selectedBpmn = temp;
+ } else {
+ this.dialog.open(AlertModalComponent, {
+ width: '450px',
+ data: {
+ type: 'alert',
+ message: 'Test Definition does not contain a deployed bpmn instance. Please return to the Test Definition page and deploy.'
+ }
+ });
+ this.testInstance.useLatestTestDefinition = false;
+ }
+ this.populateVthInput();
+ }
+ this.populatePfloInput();
+ }
+
+
+ //checks if the test instance has a required Name
+ allNamed() {
+ if (!this.testInstance.testInstanceName) {
+ return false;
+ }
+
+ return true;
+ }
+
+ //populate the vthInputYaml for newly created testInstances
+ populateVthInput() {
+ this.vthInputYaml = {};
+ this.vthInput = {};
+ for (let i = 0; i < this.selectedBpmn.testHeads.length; i++) {
+ this.vthInputYaml[this.selectedBpmn.testHeads[i].bpmnVthTaskId] = this.selectedBpmn.testHeads[i].testHeadId.vthInputTemplate;
+ this.vthInputYaml[this.selectedBpmn.testHeads[i].bpmnVthTaskId + "testHeadName"] = this.selectedBpmn.testHeads[i].testHeadId.testHeadName;
+ if (this.selectedBpmn.testHeads[i].testHeadId.vthInputTemplateJSON) {
+ this.vthInput[this.selectedBpmn.testHeads[i].bpmnVthTaskId] = this.selectedBpmn.testHeads[i].testHeadId.vthInputTemplateJSON;
+ this.vthInput[this.selectedBpmn.testHeads[i].bpmnVthTaskId + "testHeadName"] = this.selectedBpmn.testHeads[i].testHeadId.testHeadName;
+ }
+
+ }
+
+ }
+ //Used to grab all test definitions for the user to select.
+ getDefinition() {
+ const dialogRef = this.dialog.open(SelectStrategyModalComponent, {
+ width: '450px',
+ data: {}
+ });
+
+ dialogRef.afterClosed().subscribe(result => {
+ //If the user already had a selected definition and selected a new one, prompt the user to be sure of change
+ if (result != '' && this.selectedDefinition.testName) {
+ this.dialog.open(AlertModalComponent, {
+ width: '450px',
+ data: {
+ type: 'confirmation',
+ message: 'Changing the Test Definition will erase the Instance you are currently writing.'
+ }
+ }).afterClosed().subscribe(response => {
+ if (response) {
+ this.selectedDefinition = result;
+ this.populateTIName();
+ //set the bpmn as the latest deployed version. Alert User if no bpmn versions are deployed
+ this.useLatest();
+ this.populateVthInput();
+ this.populatePfloInput();
+ //grab all robot test heads to assign uploaders to each and initialize vthInput
+ for (let j = 0; j < this.selectedBpmn.testHeads.length; j++) {
+ if (this.selectedBpmn.testHeads[j].testHeadId['vthInputTemplateJSON']) {
+ this.vthInput[this.selectedBpmn.testHeads[j].bpmnVthTaskId] = this.selectedBpmn.testHeads[j].testHeadId['vthInputTemplateJSON'];
+ }
+
+ if (this.selectedBpmn.testHeads[j].testHeadId['testHeadName'].toLowerCase() === 'robot') {
+ this.uploaders[this.selectedBpmn.testHeads[j].bpmnVthTaskId] = new FileUploader(this.uploadOptions);
+ }
+ }
+
+ this.testInstance = {
+ "testInstanceDescription": "",
+ "groupId": this.selectedDefinition["groupId"],
+ "testDefinitionId": this.selectedDefinition["_id"],
+ "vthInput": this.vthInput,
+ "pfloInput": this.pfloInput,
+ "vthInputYaml": this.vthInputYaml,
+ "testData": this.selectedBpmn.testDataTemplate,
+ "testDataJSON": this.selectedBpmn.testDataTemplateJSON,
+ "useLatestTestDefinition": true,
+ "internalTestData": {},
+ "simulationVthInput": {}
+
+ };
+ }
+ });
+
+ //else they did not have a test definition currently selected
+ } else {
+ this.selectedDefinition = result;
+ this.populateTIName();
+ //set the bpmn as the latest deployed version. Alert User if no bpmn versions are deployed
+ this.useLatest();
+ this.populateVthInput();
+ this.populatePfloInput();
+ //grab all robot test heads to assign uploaders to each
+ for (let j = 0; j < this.selectedBpmn.testHeads.length; j++) {
+ if (this.selectedBpmn.testHeads[j].testHeadId['vthInputTemplateJSON']) {
+ this.vthInput[this.selectedBpmn.testHeads[j].bpmnVthTaskId] = this.selectedBpmn.testHeads[j].testHeadId['vthInputTemplateJSON'];
+ }
+ if (this.selectedBpmn.testHeads[j].testHeadId['testHeadName'].toLowerCase() === 'robot') {
+ this.uploaders[this.selectedBpmn.testHeads[j].bpmnVthTaskId] = new FileUploader(this.uploadOptions);
+ }
+ }
+
+
+
+ this.testInstance = {
+ "testInstanceDescription": "",
+ "groupId": this.selectedDefinition["groupId"],
+ "testDefinitionId": this.selectedDefinition["_id"],
+ "vthInput": this.vthInput,
+ "pfloInput": this.pfloInput,
+ "vthInputYaml": this.vthInputYaml,
+ "testData": this.selectedBpmn.testDataTemplate,
+ "testDataJSON": this.selectedBpmn.testDataTemplateJSON,
+ "useLatestTestDefinition": true,
+ "internalTestData": {},
+ "simulationVthInput": {}
+ };
+
+ }
+ });
+ }
+
+ //Saves the Test Instance Object to the database
+ saveAll() {
+ if (!this.allNamed()) {
+ this.dialog.open(AlertModalComponent, {
+ width: '450px',
+ data: {
+ type: 'alert',
+ message: 'The Instance is not named! Please ensure the Instance are named.'
+ }
+ }).afterClosed().subscribe((result) => {
+ return;
+ });
+ } else {
+
+ if (!this.testInstance.processDefinitionId) {
+ this.testInstance.processDefinitionId = this.selectedBpmn.processDefinitionId;
+ }
+ this.errorCount = 0;
+ if (!this.displayYAML) {
+ this.testInstance.testData = this.testInstance.testDataJSON;
+ }
+ if (this.testHeadYAML) {
+ this.testInstance.vthInput = this.testInstance.vthInputYaml;
+ }
+
+ this.convertSimulationVth('json');
+
+ this.testInstanceService.create(this.testInstance)
+ .subscribe(
+ (result) => {
+ if (Object.keys(this.uploaders).length > 0)
+ this.uploadFiles(result);
+
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: 'Test Instance Saved'
+ }
+ });
+ this.dialog.closeAll();
+ },
+ (error) => {
+ this.dialog.open(AlertModalComponent, {
+ width: '450px',
+ data: {
+ type: 'Alert',
+ message: error
+ }
+ });
+
+ });
+ }
+ }
+
+ updateInstance() {
+
+
+ if (!this.testInstance.processDefinitionId) {
+ this.testInstance.processDefinitionId = this.selectedBpmn.processDefinitionId;
+ }
+ this.errorCount = 0;
+ if (!this.displayYAML) {
+ this.testInstance.testData = this.testInstance.testDataJSON;
+ }
+ if (this.testHeadYAML) {
+ this.testInstance.vthInput = this.testInstance.vthInputYaml;
+ }
+
+ this.convertSimulationVth('json');
+
+ this.testInstanceService.update(this.testInstance)
+ .subscribe((result) => {
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: 'Test Instance Updated'
+ }
+ });
+ this.childEvent.emit();
+ });
+ }
+
+ cancel() {
+ this.childEvent.emit();
+ }
+ uploadFiles(result) {
+ for (let i = 0; i < this.selectedBpmn.testHeads.length; i++) {
+ if (!this.uploaders[this.selectedBpmn.testHeads[i].bpmnVthTaskId]) {
+ continue;
+ }
+ let key = this.selectedBpmn.testHeads[i].bpmnVthTaskId;
+ let uploader = this.uploaders[key];
+ if (uploader.queue.length > 0) {
+ uploader.uploadAll();
+ uploader.onCompleteItem = (item: FileItem, response: string, status: Number, headers: ParsedResponseHeaders) => {
+ this.scriptFiles.push(JSON.parse(response)[0]);
+ }
+ }
+ uploader.onCompleteAll = () => {
+
+ let scriptFilesId = [];
+ for (let i = 0; i < this.scriptFiles.length; i++) {
+ scriptFilesId.push(this.scriptFiles[i]['_id']);
+ }
+
+ for (let i = 0; i < this.selectedBpmn.testHeads.length; i++) {
+ if (this.selectedBpmn.testHeads[i].testHeadId['testHeadName'].toLowerCase() === 'robot') {
+ this.testInstance.internalTestData[this.selectedBpmn.testHeads[i].bpmnVthTaskId] =
+ {
+ "robotFileId": scriptFilesId[0]
+ };
+ }
+ }
+ let ti = {
+ '_id': result._id,
+ 'internalTestData': this.testInstance.internalTestData
+ }
+
+ this.testInstanceService.patch(ti).subscribe(
+ res => {
+ //console.log(res);
+ // resolve(res);
+ },
+ err => {
+ // console.log(err);
+ // reject(err);
+ }
+ );
+ }
+ }
+ }
+ //saves instance to the database and executes the test using the agenda scheduler
+ saveAndExecute() {
+ if (!this.allNamed()) {
+ this.dialog.open(AlertModalComponent, {
+ width: '450px',
+ data: {
+ type: 'alert',
+ message: 'One or more Instance is not named! Please ensure all Instances are named.'
+ }
+ }).afterClosed().subscribe((result) => {
+ return;
+ });
+ } else {
+
+ if (!this.testInstance.processDefinitionId) {
+ this.testInstance.processDefinitionId = this.selectedBpmn.processDefinitionId;
+ }
+ this.errorCount = 0;
+ if (!this.displayYAML) {
+ this.testInstance.testData = this.testInstance.testDataJSON;
+ }
+ if (this.testHeadYAML) {
+ this.testInstance.vthInput = this.testInstance.vthInputYaml;
+ }
+
+ this.convertSimulationVth('json')
+
+ this.testInstanceService.create(this.testInstance)
+ .subscribe(
+ (result) => {
+ this.executionFailed = false;
+ this.createResult = result;
+ if (Object.keys(this.uploaders).length > 0)
+ this.uploadFiles(result);
+
+
+ this.execute.create({
+ _id: this.createResult._id,
+ async: true
+ })
+ .subscribe(
+ (response) => {
+
+ this.childEvent.emit();
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: 'Test Instance Saved and Executed'
+ }
+ });
+ this.router.navigateByUrl('/dashboard');
+ },
+ (error) => {
+ this.executionFailed = true;
+ this.dialog.open(AlertModalComponent, {
+ width: '450px',
+ data: {
+ type: 'Alert',
+ message: "Execution error: " + error
+ }
+ });
+ });
+ },
+ (error) => {
+ this.dialog.open(AlertModalComponent, {
+ width: '450px',
+ data: {
+ type: 'Alert',
+ message: "Save Error: " + error
+ }
+ });
+ });
+ }
+ }
+
+ createNewInstance() {
+ this.testInstance = {
+ 'testInstanceName': '',
+ 'testInstanceDescription': '',
+ 'testDefinitionId': this.selectedDefinition._id,
+ 'testData': '',
+ 'simulationVthInput': {}
+
+ }
+ }
+}
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-instance-form/create-test-instance-form.module.spec.ts b/otf-frontend/client/src/app/shared/modules/create-test-instance-form/create-test-instance-form.module.spec.ts
new file mode 100644
index 0000000..875e328
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-instance-form/create-test-instance-form.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { CreateTestInstanceFormModule } from './create-test-instance-form.module';
+
+describe('CreateTestInstanceFormModule', () => {
+ let createTestInstanceFormModule: CreateTestInstanceFormModule;
+
+ beforeEach(() => {
+ createTestInstanceFormModule = new CreateTestInstanceFormModule();
+ });
+
+ it('should create an instance', () => {
+ expect(createTestInstanceFormModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-instance-form/create-test-instance-form.module.ts b/otf-frontend/client/src/app/shared/modules/create-test-instance-form/create-test-instance-form.module.ts
new file mode 100644
index 0000000..3daf9ad
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-instance-form/create-test-instance-form.module.ts
@@ -0,0 +1,70 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { CreateTestInstanceFormComponent } from './create-test-instance-form.component';
+import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
+import { FilterPipeModule } from 'ngx-filter-pipe';
+import { FormsModule } from '@angular/forms';
+import { MatButtonModule, MatDialogModule, MatCheckboxModule, MatRadioModule, MatInputModule, MatIconModule, MatExpansionModule, MatCardModule, MatOptionModule, MatSnackBarModule, MatProgressBar, MatSlideToggleModule, MatSelectModule } from '@angular/material';
+import { CodemirrorModule } from 'ng2-codemirror';
+import { SelectStrategyModalModule } from '../select-strategy-modal/select-strategy-modal.module';
+import { AlertModalModule } from '../alert-modal/alert-modal.module';
+import { AlertSnackbarModule } from '../alert-snackbar/alert-snackbar.module';
+import { FormGeneratorModule } from '../form-generator/form-generator.module';
+import { FileUploadModule } from 'ng2-file-upload';
+import { FilterNonDeployedPipe } from './filterNonDeployed.pipe';
+import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
+import { WorkflowRequestModule } from '../workflow-request/workflow-request.module';
+
+
+
+@NgModule({
+ imports: [
+ CommonModule,
+ AlertModalModule,
+ SelectStrategyModalModule,
+ PerfectScrollbarModule,
+ FilterPipeModule,
+ FormsModule,
+ MatButtonModule,
+ MatDialogModule,
+ MatCheckboxModule,
+ MatRadioModule,
+ MatInputModule,
+ MatSlideToggleModule,
+ MatSelectModule,
+ MatOptionModule,
+ MatIconModule,
+ MatExpansionModule,
+ MatCardModule,
+ MatSnackBarModule,
+ AlertSnackbarModule,
+ CodemirrorModule,
+ FormGeneratorModule,
+ FileUploadModule,
+ NgbModule,
+ WorkflowRequestModule
+
+
+ ],
+ declarations: [CreateTestInstanceFormComponent, FilterNonDeployedPipe],
+ exports: [CreateTestInstanceFormComponent]
+})
+export class CreateTestInstanceFormModule {
+
+ }
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-instance-form/filterNonDeployed.pipe.ts b/otf-frontend/client/src/app/shared/modules/create-test-instance-form/filterNonDeployed.pipe.ts
new file mode 100644
index 0000000..87a33c3
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-instance-form/filterNonDeployed.pipe.ts
@@ -0,0 +1,32 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Pipe, PipeTransform } from '@angular/core';
+
+@Pipe({
+ name: 'filterNonDeployed',
+ pure: false
+})
+export class FilterNonDeployedPipe implements PipeTransform {
+ transform(items: any[], callback: (item: any) => boolean): any {
+ if (!items || !callback) {
+ return items;
+ }
+ // filter items array, items which match and return true will be
+ // kept, false will be filtered out
+ return items.filter(item => callback(item) );
+ }
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/modules/create-test-instance-form/instance.class.ts b/otf-frontend/client/src/app/shared/modules/create-test-instance-form/instance.class.ts
new file mode 100644
index 0000000..13af570
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/create-test-instance-form/instance.class.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+export class TestInstance {
+
+}
+
+export class WorkflowRequest {
+ public async = false;
+ public asyncTopic = "";
+ public executorId = "";
+ public testInstanceId = "";
+ public pfloInput : null;
+ public testData : null;
+ public vthInput : null;
+ public maxExecutionTimeInMillis = 0;
+
+ constructor(instanceId){
+ this.testInstanceId = instanceId;
+ }
+}
+
+export class PfloInputClass {
+ public args = [];
+ public interruptOnFailure = false;
+ public maxFailures = 0;
+ public threadPoolSize = 2;
+}
diff --git a/otf-frontend/client/src/app/shared/modules/form-generator/form-generator.component.html b/otf-frontend/client/src/app/shared/modules/form-generator/form-generator.component.html
new file mode 100644
index 0000000..c8a4884
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/form-generator/form-generator.component.html
@@ -0,0 +1,23 @@
+<!-- Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+#############################################################################-->
+
+
+<form [formGroup]="form" style="text-align:center" #test >
+
+
+</form>
+<div class="col-md-12" >
+ <h5 [hidden]="!noData()">No Input Template provided.</h5>
+</div>
diff --git a/otf-frontend/client/src/app/shared/modules/form-generator/form-generator.component.scss b/otf-frontend/client/src/app/shared/modules/form-generator/form-generator.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/form-generator/form-generator.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/shared/modules/form-generator/form-generator.component.spec.ts b/otf-frontend/client/src/app/shared/modules/form-generator/form-generator.component.spec.ts
new file mode 100644
index 0000000..0ba7d15
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/form-generator/form-generator.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { FormGeneratorComponent } from './form-generator.component';
+
+describe('FormGeneratorComponent', () => {
+ let component: FormGeneratorComponent;
+ let fixture: ComponentFixture<FormGeneratorComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ FormGeneratorComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(FormGeneratorComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/form-generator/form-generator.component.ts b/otf-frontend/client/src/app/shared/modules/form-generator/form-generator.component.ts
new file mode 100644
index 0000000..6f205db
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/form-generator/form-generator.component.ts
@@ -0,0 +1,381 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Input, Output, EventEmitter, ViewChild, NgModuleRef, Injector, Compiler, NgModule, ViewContainerRef } from '@angular/core';
+import { FormGroup, FormControl, ReactiveFormsModule } from '@angular/forms';
+import { MatSnackBar } from '@angular/material';
+import { AlertSnackbarComponent } from '../alert-snackbar/alert-snackbar.component';
+
+
+@Component({
+ selector: 'app-form-generator',
+ templateUrl: './form-generator.component.html',
+ styleUrls: ['./form-generator.component.scss']
+})
+export class FormGeneratorComponent implements OnInit {
+
+ public test = {
+ text1: "Hello please enter text1",
+ text2: "Hello please enter text2",
+ one: {
+ text1: "lol"
+ },
+ siteSpecific: {
+ port: "1234",
+ host: "google.com"
+ },
+ list: ["Enter", "some", "values"],
+ list2: [{"test": "hello"}, {"test2": "hello2"}]
+ }
+ public isSaved = false;
+ public arrayCheck;
+ @Input() public JSONData : any;
+ @Input() public taskId: any;
+ @ViewChild('test', { read: ViewContainerRef }) public containerDiv;
+ @Output() public childEvent = new EventEmitter();
+
+ form = new FormGroup({
+ });
+
+ //public textAreaTemplate = "<textarea [(value)]='";
+ /*
+ constructor(private _compiler: Compiler,
+ private _injector: Injector,
+ private _m: NgModuleRef<any>) {
+}
+
+ngAfterViewInit() {
+ const template = '<span>generated on the fly: {{name}}</span>';
+
+ const tmpCmp = Component({template: template})(class {
+ });
+ const tmpModule = NgModule({declarations: [tmpCmp]})(class {
+ });
+
+ this._compiler.compileModuleAndAllComponentsAsync(tmpModule)
+ .then((factories) => {
+ const f = factories.componentFactories[0];
+ const cmpRef = this.vc.createComponent(f);
+ cmpRef.instance.name = 'dynamic';
+ })
+}
+ */
+
+ //public containerDiv;// = document.getElementById(tas);
+ constructor(private compiler: Compiler,
+ private injector: Injector,
+ private snack: MatSnackBar,
+ private m: NgModuleRef<any>) { }
+ public testing = "hello";
+ //public textAreaTemplate = '';
+ ngOnInit() {
+
+ //this.JSONData = this.test;
+ if(this.JSONData){
+ this.arrayCheck = JSON.parse(JSON.stringify(this.JSONData));
+ let arr = [];
+ this.populatePage(arr, 1);
+ this.onFormChange();
+ }
+ }
+
+ onFormChange(){
+
+ this.form.valueChanges.subscribe(val => {
+ this.copyValues([]);
+
+ let event = {
+ object: this.JSONData,
+ taskId: this.taskId
+ };
+ this.childEvent.emit(event);
+ });
+ }
+ //checks if data was supplied to form
+ noData(){
+
+ if(Object.keys(this.form.controls).length == 0){
+ return true;
+ }else{
+ return false;
+ }
+ }
+
+ copyValues(keyArr){
+ // console.log("Fixed");
+ let data = this.JSONData;
+ let tempArrCheck = this.arrayCheck;
+ let keyPath = "";
+ for(let k in keyArr){
+ tempArrCheck = tempArrCheck[keyArr[k]];
+ data = data[keyArr[k]];
+ keyPath += keyArr[k];
+ }
+
+ for(let key in data){
+ if(this.form.get(keyPath + key)){
+ if(tempArrCheck[key] === "_ConvertThisArray_"){
+ let temp = this.form.get(keyPath + key).value;
+ data[key] = temp.split(',');
+ }else{
+ data[key] = this.form.get(keyPath + key).value;
+ }
+ }else{
+ keyArr.push(key);
+ this.copyValues(keyArr);
+ keyArr.splice(keyArr.length - 1);
+ }
+ }
+ // Object.keys(this.form.controls).forEach(key => {
+ // data[key] = this.form.get(key).value;
+ // });
+
+ }
+
+ populatePage(keyArr, level){//vthinput and testInput
+ let data = this.JSONData;
+ //used to detect and convert arrays after input is entered
+ let tempArrCheck = this.arrayCheck;
+ let keyPath = "";
+ for(let k in keyArr){
+ tempArrCheck = tempArrCheck[keyArr[k]];
+ data = data[keyArr[k]];
+ keyPath += keyArr[k];
+ }
+ //console.log(data);
+
+ for( let key in data){
+ let indent = 'ml-' + level;
+
+ if((typeof data[key] === "object" && !data[key].length) || (typeof data[key] === "object" && data[key].length &&
+ typeof data[key][0] === "object")){
+
+ let str = '';
+ if(level >= 4){
+ str = 'h5';
+ //indent = 'ml-5';
+ }else if(level === 3){
+ str = 'h4';
+ //indent = 'ml-4';
+ }else if (level === 2){
+ str = 'h3';
+ //indent = 'ml-3';
+ }else{
+ str = 'h2'
+ //indent = 'ml-2';
+ }
+ if(data.constructor === Array){
+
+ keyArr.push(key);
+ this.populatePage(keyArr, level);
+ keyArr.splice(keyArr.length - 1);
+ continue;
+ }
+ const textHeaderTemplate = '<' + str + ' class="'+ indent +'" style="font-weight:bold">' + key.trim() + '</'+ str + '>';
+ const tmpCmp = Component({template: textHeaderTemplate})(class {
+ });
+ const tmpModule = NgModule({imports:[ReactiveFormsModule] ,declarations: [tmpCmp]})(class {
+ });
+
+ this.compiler.compileModuleAndAllComponentsAsync(tmpModule)
+ .then((factories) => {
+ const f = factories.componentFactories[0];
+ const cmpRef = this.containerDiv.createComponent(f);
+ })
+
+ keyArr.push(key);
+ level ++;
+ this.populatePage(keyArr, level);
+ level = level -1;
+ keyArr.splice(keyArr.length - 1);
+ }
+ else if(typeof data[key] === "string"){
+ // this.containerDiv.
+
+ this.form.addControl(keyPath + key.trim(), new FormControl(data[key]));
+
+ if(level > 1){
+
+ const textInputTemplate = '<div class=" mb-1 '+ indent + '" [formGroup]="form"> <label class="mr-2">' + key.trim() + '</label><input formControlName="' + keyPath + key.trim() + '"> </div>';
+ const tmpCmp = Component({template: textInputTemplate})(class {
+ });
+ const tmpModule = NgModule({imports:[ReactiveFormsModule], declarations: [tmpCmp]})(class {
+ });
+
+ //this.containerDiv.element.nativeElement.appendChild(document.createElement("label")).innerHTML = key.trim();
+
+ this.compiler.compileModuleAndAllComponentsAsync(tmpModule)
+ .then((factories) => {
+ const f = factories.componentFactories[0];
+ const cmpRef = this.containerDiv.createComponent(f);
+ cmpRef.instance.form = this.form;
+ })
+ }
+ else{
+ const textInputTemplate = '<div class=" mb-1 '+ indent + '" [formGroup]="form"> <h5 style="font-weight:bold" class="mr-2">' + key.trim() + '</h5><input formControlName="' + keyPath + key.trim() + '"> </div>';
+ const tmpCmp = Component({template: textInputTemplate})(class {
+ });
+ const tmpModule = NgModule({imports:[ReactiveFormsModule], declarations: [tmpCmp]})(class {
+ });
+
+ //this.containerDiv.element.nativeElement.appendChild(document.createElement("label")).innerHTML = key.trim();
+
+ this.compiler.compileModuleAndAllComponentsAsync(tmpModule)
+ .then((factories) => {
+ const f = factories.componentFactories[0];
+ const cmpRef = this.containerDiv.createComponent(f);
+ cmpRef.instance.form = this.form;
+ })
+ }
+
+
+ }
+ else if(typeof data[key] === "object" && data[key].length){
+
+ //this.containerDiv.element.nativeElement.appendChild(document.createElement("label")).innerHTML = key.trim();
+ let temp = "";
+ for(let i = 0; i < data[key].length; i++){
+ if(i != data[key].length - 1)
+ temp += data[key][i] + ",";
+ else
+ temp += data[key][i] + "";
+ }
+ //this.containerDiv.element.nativeElement.appendChild(document.createElement("textarea")).innerHTML = temp.trim();
+ this.form.addControl(keyPath + key.trim(), new FormControl(temp));
+
+ tempArrCheck[key] = "_ConvertThisArray_";
+
+ if(level > 1){
+
+ const textAreaTemplate = '<div class= " mb-1 '+ indent + '" [formGroup]="form"> <label class="mr-2">' + key.trim() + '</label><textarea rows="' + data[key].length + '" formControlName="' + keyPath + key.trim() + '"> </textarea></div>';// + path + "'> "+ data[key] + "</textarea>"
+ const tmpCmp = Component({template: textAreaTemplate})(class {
+ });
+ const tmpModule = NgModule({imports:[ReactiveFormsModule], declarations: [tmpCmp]})(class {
+ });
+
+ //this.containerDiv.element.nativeElement.appendChild(document.createElement("label")).innerHTML = key.trim();
+
+ this.compiler.compileModuleAndAllComponentsAsync(tmpModule)
+ .then((factories) => {
+ const f = factories.componentFactories[0];
+ const cmpRef = this.containerDiv.createComponent(f);
+ cmpRef.instance.form = this.form;
+ })
+ }
+ else{
+ const textAreaTemplate = '<div class= " mb-1 '+ indent + '" [formGroup]="form"> <h5 style="font-weight:bold" class="mr-2">' + key.trim() + '</h5><textarea rows="' + data[key].length + '" formControlName="' + keyPath + key.trim() + '"> </textarea></div>';// + path + "'> "+ data[key] + "</textarea>"
+ const tmpCmp = Component({template: textAreaTemplate})(class {
+ });
+ const tmpModule = NgModule({imports:[ReactiveFormsModule], declarations: [tmpCmp]})(class {
+ });
+
+ //this.containerDiv.element.nativeElement.appendChild(document.createElement("label")).innerHTML = key.trim();
+
+ this.compiler.compileModuleAndAllComponentsAsync(tmpModule)
+ .then((factories) => {
+ const f = factories.componentFactories[0];
+ const cmpRef = this.containerDiv.createComponent(f);
+ cmpRef.instance.form = this.form;
+ })
+ }
+ // const textAreaTemplate = '<div class= "mb-2" [formGroup]="form"> <label class="mr-2">' + key.trim() + '</label><textarea rows="' + data[key].length + '" formControlName="' + keyPath + key.trim() + '"> </textarea></div>';// + path + "'> "+ data[key] + "</textarea>"
+ // const tmpCmp = Component({template: textAreaTemplate})(class {
+ // });
+ // const tmpModule = NgModule({imports:[ReactiveFormsModule] ,declarations: [tmpCmp]})(class {
+ // });
+
+ // //this.containerDiv.element.nativeElement.appendChild(document.createElement("label")).innerHTML = key.trim();
+
+ // this.compiler.compileModuleAndAllComponentsAsync(tmpModule)
+ // .then((factories) => {
+ // const f = factories.componentFactories[0];
+ // const cmpRef = this.containerDiv.createComponent(f);
+ // cmpRef.instance.form = this.form;
+ // })
+
+ }
+ else if(typeof data[key] === 'boolean'){
+ let str = '';
+ let str2 = 'h5';
+ let bold = ' style="font-weight:bold"'
+ if(level > 1){
+ str2 = 'label';
+ bold = '';
+ }
+ if(data[key]){
+ str = '<option [ngValue]="true">true</option><option [ngValue]="false">false</option>';
+ }else{
+ str = '<option [ngValue]="false">false</option><option [ngValue]="true">true</option>';
+ }
+ this.form.addControl(keyPath + key.trim(), new FormControl(data[key]));
+ const textAreaTemplate = '<div class= " mb-1 '+ indent + '" [formGroup]="form"> <' + str2 + bold + ' class="mr-2">' + key.trim() + '</' + str2 + '><select formControlName="' + keyPath + key.trim() + '">' + str + ' </select></div>';// + path + "'> "+ data[key] + "</textarea>"
+ const tmpCmp = Component({template: textAreaTemplate})(class {
+ });
+ const tmpModule = NgModule({imports:[ReactiveFormsModule], declarations: [tmpCmp]})(class {
+ });
+
+ //this.containerDiv.element.nativeElement.appendChild(document.createElement("label")).innerHTML = key.trim();
+
+ this.compiler.compileModuleAndAllComponentsAsync(tmpModule)
+ .then((factories) => {
+ const f = factories.componentFactories[0];
+ const cmpRef = this.containerDiv.createComponent(f);
+ cmpRef.instance.form = this.form;
+ })
+ }
+ else if(typeof data[key] === typeof 23){
+ let str = 'h5';
+ let bold = ' style="font-weight:bold"';
+ if(level > 1){
+ str = 'label';
+ bold = '';
+ }
+ this.form.addControl(keyPath + key.trim(), new FormControl(data[key]));
+ const textInputTemplate = '<div class=" mb-1 '+ indent + '" [formGroup]="form"> <' + str + bold + ' class="mr-2">' + key.trim() + '</' + str + '><input type="number" formControlName="' + keyPath + key.trim() + '"> </div>';
+ const tmpCmp = Component({template: textInputTemplate})(class {
+ });
+ const tmpModule = NgModule({imports:[ReactiveFormsModule], declarations: [tmpCmp]})(class {
+ });
+
+ //this.containerDiv.element.nativeElement.appendChild(document.createElement("label")).innerHTML = key.trim();
+
+ this.compiler.compileModuleAndAllComponentsAsync(tmpModule)
+ .then((factories) => {
+ const f = factories.componentFactories[0];
+ const cmpRef = this.containerDiv.createComponent(f);
+ cmpRef.instance.form = this.form;
+ })
+ }
+ else{
+ const textAreaTemplate = ' <h5 style="font-weight:bold" class="mr-2 '+ indent + '">' + key.trim() + ': Type Not Supported</h5>';// + path + "'> "+ data[key] + "</textarea>"
+ const tmpCmp = Component({template: textAreaTemplate})(class {
+ });
+ const tmpModule = NgModule({imports:[ReactiveFormsModule], declarations: [tmpCmp]})(class {
+ });
+
+ //this.containerDiv.element.nativeElement.appendChild(document.createElement("label")).innerHTML = key.trim();
+
+ this.compiler.compileModuleAndAllComponentsAsync(tmpModule)
+ .then((factories) => {
+ const f = factories.componentFactories[0];
+ const cmpRef = this.containerDiv.createComponent(f);
+ cmpRef.instance.form = this.form;
+ })
+ }
+
+ }
+ }
+}
diff --git a/otf-frontend/client/src/app/shared/modules/form-generator/form-generator.module.spec.ts b/otf-frontend/client/src/app/shared/modules/form-generator/form-generator.module.spec.ts
new file mode 100644
index 0000000..4fe9215
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/form-generator/form-generator.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { FormGeneratorModule } from './form-generator.module';
+
+describe('FormGeneratorModule', () => {
+ let formGeneratorModule: FormGeneratorModule;
+
+ beforeEach(() => {
+ formGeneratorModule = new FormGeneratorModule();
+ });
+
+ it('should create an instance', () => {
+ expect(formGeneratorModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/form-generator/form-generator.module.ts b/otf-frontend/client/src/app/shared/modules/form-generator/form-generator.module.ts
new file mode 100644
index 0000000..6d418cd
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/form-generator/form-generator.module.ts
@@ -0,0 +1,37 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormGeneratorComponent } from './form-generator.component';
+import { MatButtonModule, MatSnackBarModule } from '@angular/material';
+import { TextAreaComponent } from './text-area/text-area.component';
+import { FormsModule, ReactiveFormsModule } from '@angular/forms';
+import { AlertSnackbarModule } from '../alert-snackbar/alert-snackbar.module';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ MatButtonModule,
+ FormsModule,
+ ReactiveFormsModule,
+ MatSnackBarModule,
+ AlertSnackbarModule
+ ],
+ declarations: [ FormGeneratorComponent, TextAreaComponent ],
+ exports: [ FormGeneratorComponent ]
+})
+export class FormGeneratorModule { }
diff --git a/otf-frontend/client/src/app/shared/modules/form-generator/text-area/text-area.component.html b/otf-frontend/client/src/app/shared/modules/form-generator/text-area/text-area.component.html
new file mode 100644
index 0000000..5c3c3aa
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/form-generator/text-area/text-area.component.html
@@ -0,0 +1,17 @@
+<!-- Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+#############################################################################-->
+
+
+<textarea [(value)]="textValue"></textarea>
diff --git a/otf-frontend/client/src/app/shared/modules/form-generator/text-area/text-area.component.scss b/otf-frontend/client/src/app/shared/modules/form-generator/text-area/text-area.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/form-generator/text-area/text-area.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/shared/modules/form-generator/text-area/text-area.component.spec.ts b/otf-frontend/client/src/app/shared/modules/form-generator/text-area/text-area.component.spec.ts
new file mode 100644
index 0000000..3684549
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/form-generator/text-area/text-area.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TextAreaComponent } from './text-area.component';
+
+describe('TextAreaComponent', () => {
+ let component: TextAreaComponent;
+ let fixture: ComponentFixture<TextAreaComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TextAreaComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TextAreaComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/form-generator/text-area/text-area.component.ts b/otf-frontend/client/src/app/shared/modules/form-generator/text-area/text-area.component.ts
new file mode 100644
index 0000000..d144d17
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/form-generator/text-area/text-area.component.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-text-area',
+ templateUrl: './text-area.component.html',
+ styleUrls: ['./text-area.component.scss']
+})
+export class TextAreaComponent implements OnInit {
+ public textValue = "hello";
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+}
diff --git a/otf-frontend/client/src/app/shared/modules/index.ts b/otf-frontend/client/src/app/shared/modules/index.ts
new file mode 100644
index 0000000..97d2c90
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/index.ts
@@ -0,0 +1,18 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+export * from './page-header/page-header.module';
+// export * from './stat/stat.module';
diff --git a/otf-frontend/client/src/app/shared/modules/onboard-mechid/onboard-mechid.component.pug b/otf-frontend/client/src/app/shared/modules/onboard-mechid/onboard-mechid.component.pug
new file mode 100644
index 0000000..9fb2178
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/onboard-mechid/onboard-mechid.component.pug
@@ -0,0 +1,18 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+p onboard-mechid works!
+
diff --git a/otf-frontend/client/src/app/shared/modules/onboard-mechid/onboard-mechid.component.scss b/otf-frontend/client/src/app/shared/modules/onboard-mechid/onboard-mechid.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/onboard-mechid/onboard-mechid.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/shared/modules/onboard-mechid/onboard-mechid.component.spec.ts b/otf-frontend/client/src/app/shared/modules/onboard-mechid/onboard-mechid.component.spec.ts
new file mode 100644
index 0000000..5c404d8
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/onboard-mechid/onboard-mechid.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { OnboardMechidComponent } from './onboard-mechid.component';
+
+describe('OnboardMechidComponent', () => {
+ let component: OnboardMechidComponent;
+ let fixture: ComponentFixture<OnboardMechidComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ OnboardMechidComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(OnboardMechidComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/onboard-mechid/onboard-mechid.component.ts b/otf-frontend/client/src/app/shared/modules/onboard-mechid/onboard-mechid.component.ts
new file mode 100644
index 0000000..1f61f0a
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/onboard-mechid/onboard-mechid.component.ts
@@ -0,0 +1,42 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Inject } from '@angular/core';
+import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
+
+@Component({
+ selector: 'app-onboard-mechid',
+ templateUrl: './onboard-mechid.component.pug',
+ styleUrls: ['./onboard-mechid.component.scss']
+})
+export class OnboardMechidComponent implements OnInit {
+
+ constructor(
+ public dialogRef: MatDialogRef<OnboardMechidComponent>,
+ @Inject(MAT_DIALOG_DATA) public input_data
+ ) {
+
+ }
+
+ ngOnInit() {
+ }
+
+ onboardMechid(){
+ //call rohans api endpoint
+ //save mechId as a user
+ }
+
+}
diff --git a/otf-frontend/client/src/app/shared/modules/onboard-mechid/onboard-mechid.module.spec.ts b/otf-frontend/client/src/app/shared/modules/onboard-mechid/onboard-mechid.module.spec.ts
new file mode 100644
index 0000000..32d6392
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/onboard-mechid/onboard-mechid.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { OnboardMechidModule } from './onboard-mechid.module';
+
+describe('OnboardMechidModule', () => {
+ let onboardMechidModule: OnboardMechidModule;
+
+ beforeEach(() => {
+ onboardMechidModule = new OnboardMechidModule();
+ });
+
+ it('should create an instance', () => {
+ expect(onboardMechidModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/onboard-mechid/onboard-mechid.module.ts b/otf-frontend/client/src/app/shared/modules/onboard-mechid/onboard-mechid.module.ts
new file mode 100644
index 0000000..1a44865
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/onboard-mechid/onboard-mechid.module.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { OnboardMechidComponent } from './onboard-mechid.component';
+
+@NgModule({
+ imports: [
+ CommonModule
+ ],
+ declarations: [OnboardMechidComponent],
+ exports: [OnboardMechidComponent],
+ entryComponents: [OnboardMechidComponent]
+})
+export class OnboardMechidModule { }
diff --git a/otf-frontend/client/src/app/shared/modules/page-header/page-header.component.html b/otf-frontend/client/src/app/shared/modules/page-header/page-header.component.html
new file mode 100644
index 0000000..baa008a
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/page-header/page-header.component.html
@@ -0,0 +1,31 @@
+<!-- Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+#############################################################################-->
+
+
+<div class="row">
+ <div class="col-xl-12">
+ <h2 class="page-header">
+ {{heading}}
+ </h2>
+ <!-- Breadcumbs
+ <ol class="breadcrumb">
+ <li class="breadcrumb-item">
+ <i class="fa fa-dashboard"></i> <a href="Javascript:void(0)" [routerLink]="['/dashboard']">Dashboard</a>
+ </li>
+ <li class="breadcrumb-item active"><i class="fa {{icon}}"></i> {{heading}}</li>
+ </ol>
+ -->
+ </div>
+</div>
diff --git a/otf-frontend/client/src/app/shared/modules/page-header/page-header.component.scss b/otf-frontend/client/src/app/shared/modules/page-header/page-header.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/page-header/page-header.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/shared/modules/page-header/page-header.component.spec.ts b/otf-frontend/client/src/app/shared/modules/page-header/page-header.component.spec.ts
new file mode 100644
index 0000000..d713226
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/page-header/page-header.component.spec.ts
@@ -0,0 +1,43 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing'
+import { RouterTestingModule } from '@angular/router/testing'
+
+import { PageHeaderComponent } from './page-header.component'
+import { PageHeaderModule } from './page-header.module'
+
+describe('PageHeaderComponent', () => {
+ let component: PageHeaderComponent
+ let fixture: ComponentFixture<PageHeaderComponent>
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ imports: [PageHeaderModule, RouterTestingModule],
+ })
+ .compileComponents()
+ }))
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(PageHeaderComponent)
+ component = fixture.componentInstance
+ fixture.detectChanges()
+ })
+
+ it('should create', () => {
+ expect(component).toBeTruthy()
+ })
+})
diff --git a/otf-frontend/client/src/app/shared/modules/page-header/page-header.component.ts b/otf-frontend/client/src/app/shared/modules/page-header/page-header.component.ts
new file mode 100644
index 0000000..5c4b5bf
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/page-header/page-header.component.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Input } from '@angular/core';
+import { RouterModule } from '@angular/router';
+
+@Component({
+ selector: 'app-page-header',
+ templateUrl: './page-header.component.html',
+ styleUrls: ['./page-header.component.scss']
+})
+export class PageHeaderComponent implements OnInit {
+ @Input() heading: string;
+ @Input() icon: string;
+ constructor() {}
+
+ ngOnInit() {}
+}
diff --git a/otf-frontend/client/src/app/shared/modules/page-header/page-header.module.spec.ts b/otf-frontend/client/src/app/shared/modules/page-header/page-header.module.spec.ts
new file mode 100644
index 0000000..c76516b
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/page-header/page-header.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { PageHeaderModule } from './page-header.module';
+
+describe('PageHeaderModule', () => {
+ let pageHeaderModule: PageHeaderModule;
+
+ beforeEach(() => {
+ pageHeaderModule = new PageHeaderModule();
+ });
+
+ it('should create an instance', () => {
+ expect(pageHeaderModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/page-header/page-header.module.ts b/otf-frontend/client/src/app/shared/modules/page-header/page-header.module.ts
new file mode 100644
index 0000000..e0d2d7b
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/page-header/page-header.module.ts
@@ -0,0 +1,28 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { RouterModule } from '@angular/router';
+
+import { PageHeaderComponent } from './page-header.component';
+
+@NgModule({
+ imports: [CommonModule, RouterModule],
+ declarations: [PageHeaderComponent],
+ exports: [PageHeaderComponent]
+})
+export class PageHeaderModule {}
diff --git a/otf-frontend/client/src/app/shared/modules/schedule-test-modal/schedule-test-modal.component.pug b/otf-frontend/client/src/app/shared/modules/schedule-test-modal/schedule-test-modal.component.pug
new file mode 100644
index 0000000..72b7884
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/schedule-test-modal/schedule-test-modal.component.pug
@@ -0,0 +1,72 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+h2.mb-1(mat-dialog-title) Schedule {{selectedTestInstance ? selectedTestInstance.testInstanceName : ''}}
+
+mat-dialog-content(*ngIf="selectedTestInstance")
+ .row
+ .col-sm-6
+ h5 Create Schedule
+ .row
+ .col-sm-6
+ mat-form-field
+ input(matInput, [matDatepicker]="schedulePicker", [(ngModel)]='startDate', placeholder="Select Start Date", required)
+ mat-datepicker-toggle(matSuffix, [for]="schedulePicker")
+ mat-datepicker(#schedulePicker)
+ .col-sm-6
+ mat-form-field
+ input(matInput, [(ngModel)]="timeToRun", [ngxTimepicker]="picker", placeholder="Select Time", required)
+ ngx-material-timepicker(#picker)
+
+ .row.mb-2
+ .col-12
+ mat-slide-toggle(color="primary", [(ngModel)]="frequency") Add Frequency
+
+ .row(*ngIf="frequency").mb-2
+ .col-sm-12
+ mat-form-field.mr-2
+ input(matInput, type="number", [(ngModel)]='numUnit', placeholder='Execution Interval', required)
+ mat-form-field
+ mat-select(placeholder='Time Unit', [(ngModel)]='timeUnit', required)
+ mat-option([value]=60) min(s)
+ mat-option([value]=3600) hour(s)
+ mat-option([value]=86400) day(s)
+ .col-sm-6
+ mat-form-field
+ input(matInput, [matDatepicker]="schedulePicker2", [(ngModel)]='endDate', placeholder="Select a End Date (Optional)")
+ mat-datepicker-toggle(matSuffix, [for]="schedulePicker2")
+ mat-datepicker(#schedulePicker2)
+
+ .row
+ .col-12
+ button(mat-raised-button, color="primary", (click)='createSchedule()') Create Schedule
+
+ .col-sm-6
+ h5 Scheduled Runs
+ .row(*ngIf="scheduledJobs")
+ .col-12
+ .group-list
+ .group-list-item(*ngFor="let job of scheduledJobs")
+ a((click)="deleteJob(job)")
+ i.fa.fa-times
+ | {{ job.data.testSchedule._testInstanceStartDate }} {{job.data.testSchedule._testInstanceEndDate ? 'to ' + job.data.testSchedule._testInstanceEndDate : '' }} {{ job.data.testSchedule._testInstanceExecFreqInSeconds ? 'every ' + job.data.testSchedule._testInstanceExecFreqInSeconds + ' sec' : '' }}
+ .group-list-item(*ngIf="!loadingJobs && scheduledJobs.length == 0", style="text-align:center") Nothing is scheduled
+ .group-list-item(*ngIf="loadingJobs")
+ mat-spinner(style="margin:auto")
+mat-dialog-actions.pull-right
+ button.pull-right(mat-button, mat-dialog-close) Close
+ // The mat-dialog-close directive optionally accepts a value as a result for the dialog.
+
diff --git a/otf-frontend/client/src/app/shared/modules/schedule-test-modal/schedule-test-modal.component.scss b/otf-frontend/client/src/app/shared/modules/schedule-test-modal/schedule-test-modal.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/schedule-test-modal/schedule-test-modal.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/shared/modules/schedule-test-modal/schedule-test-modal.component.spec.ts b/otf-frontend/client/src/app/shared/modules/schedule-test-modal/schedule-test-modal.component.spec.ts
new file mode 100644
index 0000000..68e0f26
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/schedule-test-modal/schedule-test-modal.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ScheduleTestModalComponent } from './schedule-test-modal.component';
+
+describe('ScheduleTestModalComponent', () => {
+ let component: ScheduleTestModalComponent;
+ let fixture: ComponentFixture<ScheduleTestModalComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ScheduleTestModalComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ScheduleTestModalComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/schedule-test-modal/schedule-test-modal.component.ts b/otf-frontend/client/src/app/shared/modules/schedule-test-modal/schedule-test-modal.component.ts
new file mode 100644
index 0000000..e87e6dd
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/schedule-test-modal/schedule-test-modal.component.ts
@@ -0,0 +1,190 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, Inject, OnInit } from '@angular/core';
+import { MatDialog, MatDialogRef, MAT_DIALOG_DATA, MatSnackBar } from '@angular/material';
+import { TestInstanceService } from '../../services/test-instance.service';
+import { SchedulingService } from '../../services/scheduling.service';
+import { AlertSnackbarComponent } from '../alert-snackbar/alert-snackbar.component';
+import { AlertModalComponent } from '../alert-modal/alert-modal.component';
+
+
+@Component({
+ selector: 'app-schedule-test-modal',
+ templateUrl: './schedule-test-modal.component.pug',
+ styleUrls: ['./schedule-test-modal.component.scss']
+})
+export class ScheduleTestModalComponent implements OnInit {
+
+ public data;
+ public test_instances;
+ public selectedTestInstance;
+ public schedule;
+ public search;
+ public timeUnit;
+ public timeToRun;
+ public numUnit;
+ public startDate;
+ public endDate;
+ public frequency = false;
+ public isSelected = false;
+ public scheduledJobs;
+ public loadingJobs;
+
+ constructor(
+ private schedulingService: SchedulingService,
+ private testInstanceService: TestInstanceService,
+ public dialogRef: MatDialogRef<ScheduleTestModalComponent>,
+ private snack: MatSnackBar,
+ private dialog: MatDialog,
+ @Inject(MAT_DIALOG_DATA) public input_data
+ ) {
+
+ }
+
+ onNoClick(): void {
+ this.dialogRef.close();
+ }
+
+ ngOnInit() {
+ this.timeUnit = 60;
+ this.numUnit = 0;
+ this.search = {};
+ this.selectedTestInstance = {};
+ this.startDate = null;
+ this.timeToRun = null;
+ this.endDate = null;
+ //this.search.testInstanceName = "";
+ //this.test_instances = [];
+ this.schedule = {};
+ this.schedule.testInstanceExecFreqInSeconds = '';
+ this.scheduledJobs = [];
+ this.loadingJobs = true;
+
+ //console.log(this.test_instances);
+ this.testInstanceService.get(this.input_data.id).subscribe(
+ result => {
+ this.selectedTestInstance = result;
+ }
+ );
+
+ this.schedulingService.find({$limit: -1, testInstanceId: this.input_data.id}).subscribe(
+ result => {
+ for (let i = 0; i < result['length']; i++) {
+ result[i].data.testSchedule._testInstanceStartDate = new Date(result[i].data.testSchedule._testInstanceStartDate).toLocaleString();
+ if (result[i].data.testSchedule._testInstanceEndDate) {
+ result[i].data.testSchedule._testInstanceEndDate = new Date(result[i].data.testSchedule._testInstanceEndDate).toLocaleString();
+ }
+ this.scheduledJobs.push(result[i]);
+
+ }
+ this.loadingJobs = false;
+ }
+ );
+ }
+
+ convertDate(date, time = ''): Date {
+ let nDate = new Date(date + '');
+ return new Date(nDate.getMonth() + 1 + '/' + nDate.getDate() + '/' + nDate.getFullYear() + ' ' + time);
+ }
+
+ createSchedule() {
+ this.convertDate(this.startDate, this.timeToRun);
+
+ if (!this.selectedTestInstance || !this.startDate || !this.timeToRun) {
+ this.dialog.open(AlertModalComponent, {
+ width: '450px',
+ data: {
+ type: 'Alert',
+ message: 'Select start date/time before you create schedule!'
+ }
+ });
+ return;
+ }
+ if (this.frequency) {
+ this.schedule = {
+ testInstanceId: this.selectedTestInstance._id,
+ testInstanceStartDate: this.convertDate(this.startDate, this.timeToRun).toISOString(),
+ testInstanceExecFreqInSeconds: this.numUnit * this.timeUnit,
+ async: false,
+ asyncTopic: ''
+ };
+
+
+ if(this.endDate){
+ this.schedule.testInstanceEndDate = this.convertDate(this.endDate).toISOString();
+ }
+ } else {
+ this.schedule = {
+ testInstanceId: this.selectedTestInstance._id,
+ testInstanceStartDate: this.convertDate(this.startDate, this.timeToRun).toISOString(),
+ async: false,
+ asyncTopic: ''
+ };
+ //console.log(this.schedule);
+
+ }
+
+ this.schedulingService.create(this.schedule).subscribe((result) => {
+ this.snack.openFromComponent(AlertSnackbarComponent, {
+ duration: 1500,
+ data: {
+ message: 'Schedule Created!'
+ }
+ });
+ this.ngOnInit();
+ }, err => {
+ this.dialog.open(AlertModalComponent, {
+ data: {
+ type: "alert",
+ message: err.message
+ }
+ })
+ })
+ // console.log(this.schedule);
+ }
+
+ deleteJob(job) {
+ var deleteJob = this.dialog.open(AlertModalComponent, {
+ width: '250px',
+ data: {
+ type: 'confirmation',
+ message: 'Are you sure you want to delete this schedule?'
+ }
+ });
+
+ deleteJob.afterClosed().subscribe(
+ result => {
+ if (result) {
+ this.schedulingService.delete(job._id).subscribe(
+ result => {
+ this.ngOnInit();
+ }
+ );
+ }
+ }
+ );
+ }
+ // this.testInstanceId = testInstanceId;
+ // this.testInstanceStartDate = testInstanceStartDate;
+ // this.testInstanceExecFreqInSeconds = testInstanceExecFreqInSeconds;
+ // this.testInstanceEndDate = testInstanceEndDate;
+ // this.async = async;
+ // this.asyncTopic = asyncTopic;
+ // this.executorId = executorId;
+
+
+}
diff --git a/otf-frontend/client/src/app/shared/modules/schedule-test-modal/schedule-test-modal.module.spec.ts b/otf-frontend/client/src/app/shared/modules/schedule-test-modal/schedule-test-modal.module.spec.ts
new file mode 100644
index 0000000..7ce918e
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/schedule-test-modal/schedule-test-modal.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { ScheduleTestModalModule } from './schedule-test-modal.module';
+
+describe('ScheduleTestModalModule', () => {
+ let scheduleTestModalModule: ScheduleTestModalModule;
+
+ beforeEach(() => {
+ scheduleTestModalModule = new ScheduleTestModalModule();
+ });
+
+ it('should create an instance', () => {
+ expect(scheduleTestModalModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/schedule-test-modal/schedule-test-modal.module.ts b/otf-frontend/client/src/app/shared/modules/schedule-test-modal/schedule-test-modal.module.ts
new file mode 100644
index 0000000..ed9a26d
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/schedule-test-modal/schedule-test-modal.module.ts
@@ -0,0 +1,55 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+//needed imports for Material Dialogue
+import { MatDialogModule, MatRadioModule, MatIconModule, MatFormFieldModule, MatInputModule, MatButtonModule, MatDatepickerModule, MatNativeDateModule, MatCheckboxModule, MatSelectModule, MatSnackBarModule, MatSlideToggleModule, MatProgressSpinnerModule} from '@angular/material';
+import { FilterPipeModule } from 'ngx-filter-pipe';
+import { FormsModule } from '@angular/forms';
+import { ScheduleTestModalComponent } from './schedule-test-modal.component';
+import { AlertSnackbarModule } from '../alert-snackbar/alert-snackbar.module';
+import { AlertModalModule } from '../alert-modal/alert-modal.module';
+import {NgxMaterialTimepickerModule} from 'ngx-material-timepicker';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ FilterPipeModule,
+ MatButtonModule,
+ MatInputModule,
+ MatRadioModule,
+ MatDialogModule,
+ MatDatepickerModule,
+ MatSnackBarModule,
+ AlertSnackbarModule,
+ AlertModalModule,
+ MatSnackBarModule,
+ MatSelectModule,
+ MatNativeDateModule,
+ MatCheckboxModule,
+ MatIconModule,
+ NgxMaterialTimepickerModule.forRoot(),
+ MatFormFieldModule,
+ MatSlideToggleModule,
+ MatProgressSpinnerModule
+ ],
+ declarations: [ScheduleTestModalComponent ],
+ exports: [ScheduleTestModalComponent],
+ entryComponents: [ScheduleTestModalComponent]
+})
+export class ScheduleTestModalModule { }
diff --git a/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.component.pug b/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.component.pug
new file mode 100644
index 0000000..9785f93
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.component.pug
@@ -0,0 +1,35 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+h2.mb-1(mat-dialog-title) Select Test Definition
+//input.bg-light.form-control(mat-dialog-title, type="text", placeholder="Search...", [(ngModel)]="search.testName")
+mat-form-field(style="width:100%")
+ input(matInput, type='search', placeholder='Search...', color='blue', [(ngModel)]='search.testName')
+ button(mat-button, *ngIf='search.testName', matSuffix, mat-icon-button, aria-label='Clear', (click)="search.testName=''")
+ mat-icon close
+h5([hidden]='test_definitions.length != 0') No Test Definitions found.
+mat-dialog-content
+ .list-group
+ mat-radio-group([(ngModel)]="input_data.testDefinition")
+ .list-group-item(*ngFor="let testDefinition of test_definitions | filterBy:search")
+ mat-radio-button([value]="testDefinition")
+ .ml-2
+ h5 {{ testDefinition.testName }}
+ p.mb-0 {{ testDefinition.testDescription}}
+mat-dialog-actions
+ button(mat-button, mat-dialog-close) Cancel
+ // The mat-dialog-close directive optionally accepts a value as a result for the dialog.
+ button.bg-primary.text-white(mat-button, [mat-dialog-close]='input_data.testDefinition') Select
diff --git a/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.component.scss b/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.component.spec.ts b/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.component.spec.ts
new file mode 100644
index 0000000..b318dad
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { SelectStrategyModalComponent } from './select-strategy-modal.component';
+
+describe('SelectStrategyModalComponent', () => {
+ let component: SelectStrategyModalComponent;
+ let fixture: ComponentFixture<SelectStrategyModalComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ SelectStrategyModalComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SelectStrategyModalComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.component.ts b/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.component.ts
new file mode 100644
index 0000000..371c8ae
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.component.ts
@@ -0,0 +1,65 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, Inject, OnInit } from '@angular/core';
+import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material';
+import { TestDefinitionService } from '../../services/test-definition.service';
+import { GroupService } from 'app/shared/services/group.service';
+
+@Component({
+ selector: 'app-select-strategy-modal',
+ templateUrl: './select-strategy-modal.component.pug',
+ styleUrls: ['./select-strategy-modal.component.scss']
+})
+export class SelectStrategyModalComponent implements OnInit {
+
+ public data;
+ public test_definitions;
+ public search;
+
+ constructor(
+ public dialogRef: MatDialogRef<SelectStrategyModalComponent>,
+ private testDefinitionService: TestDefinitionService,
+ private _groups: GroupService,
+ @Inject(MAT_DIALOG_DATA) public input_data
+ ) {
+ this.data = {};
+ }
+
+ onNoClick(): void {
+ this.dialogRef.close();
+ }
+
+ ngOnInit() {
+ this.test_definitions = [];
+ let groupId = this._groups.getGroup()['_id'];
+
+ this.testDefinitionService.find({$limit: -1, groupId: groupId, disabled: { $ne: true }, 'bpmnInstances.isDeployed': true, $populate: ['bpmnInstances.testHeads.testHeadId'] })
+ .subscribe(
+ (result) => {
+ this.test_definitions = result;
+ },
+ (error) => {
+ console.log(error);
+ });
+
+
+ this.search = {};
+ this.search.testName = "";
+ this.input_data.testDefinition = {};
+ }
+
+}
diff --git a/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.module.spec.ts b/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.module.spec.ts
new file mode 100644
index 0000000..edebb83
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { SelectStrategyModalModule } from './select-strategy-modal.module';
+
+describe('SelectStrategyModalModule', () => {
+ let selectStrategyModalModule: SelectStrategyModalModule;
+
+ beforeEach(() => {
+ selectStrategyModalModule = new SelectStrategyModalModule();
+ });
+
+ it('should create an instance', () => {
+ expect(selectStrategyModalModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.module.ts b/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.module.ts
new file mode 100644
index 0000000..fca9f67
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.module.ts
@@ -0,0 +1,40 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { SelectStrategyModalComponent } from './select-strategy-modal.component';
+import { MatDialogModule, MatRadioModule, MatIconModule, MatFormFieldModule, MatInputModule, MatButtonModule } from '@angular/material';
+import { FilterPipeModule } from 'ngx-filter-pipe';
+import { FormsModule } from '@angular/forms';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ FilterPipeModule,
+ MatButtonModule,
+ MatInputModule,
+ MatRadioModule,
+ MatDialogModule,
+ MatIconModule,
+ MatFormFieldModule
+ ],
+ declarations: [SelectStrategyModalComponent],
+ exports: [SelectStrategyModalComponent],
+ entryComponents: [SelectStrategyModalComponent]
+})
+export class SelectStrategyModalModule { }
diff --git a/otf-frontend/client/src/app/shared/modules/select-test-head-modal/select-test-head-modal.component.pug b/otf-frontend/client/src/app/shared/modules/select-test-head-modal/select-test-head-modal.component.pug
new file mode 100644
index 0000000..da2d0c0
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/select-test-head-modal/select-test-head-modal.component.pug
@@ -0,0 +1,30 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+h2(mat-dialog-title) Select Test Head
+input.bg-light.form-control(mat-dialog-title, type="text", placeholder="Search...", [(ngModel)]="search.testHeadName")
+mat-dialog-content
+ .list-group
+ mat-radio-group([(ngModel)]="input_data.testHead")
+ .list-group-item(*ngFor="let testHead of test_heads | filterBy:search")
+ mat-radio-button([value]="testHead")
+ .ml-2
+ h5 {{ testHead.testHeadName }}
+ p.mb-0 {{ testHead.testHeadDescription }}
+mat-dialog-actions
+ button(mat-button, mat-dialog-close) Cancel
+ // The mat-dialog-close directive optionally accepts a value as a result for the dialog.
+ button.bg-primary.text-white(mat-button, [mat-dialog-close]='input_data.testHead') Select
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/modules/select-test-head-modal/select-test-head-modal.component.scss b/otf-frontend/client/src/app/shared/modules/select-test-head-modal/select-test-head-modal.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/select-test-head-modal/select-test-head-modal.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/shared/modules/select-test-head-modal/select-test-head-modal.component.spec.ts b/otf-frontend/client/src/app/shared/modules/select-test-head-modal/select-test-head-modal.component.spec.ts
new file mode 100644
index 0000000..b15d850
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/select-test-head-modal/select-test-head-modal.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { SelectTestHeadModalComponent } from './select-test-head-modal.component';
+
+describe('SelectTestHeadModalComponent', () => {
+ let component: SelectTestHeadModalComponent;
+ let fixture: ComponentFixture<SelectTestHeadModalComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ SelectTestHeadModalComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SelectTestHeadModalComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/select-test-head-modal/select-test-head-modal.component.ts b/otf-frontend/client/src/app/shared/modules/select-test-head-modal/select-test-head-modal.component.ts
new file mode 100644
index 0000000..9c81b59
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/select-test-head-modal/select-test-head-modal.component.ts
@@ -0,0 +1,53 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Inject } from '@angular/core';
+import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
+import { TestHeadService } from '../../services/test-head.service';
+
+@Component({
+ selector: 'app-select-test-head-modal',
+ templateUrl: './select-test-head-modal.component.pug',
+ styleUrls: ['./select-test-head-modal.component.scss']
+})
+export class SelectTestHeadModalComponent implements OnInit {
+
+ public data = {test_heads: []};
+ public test_heads;
+ public search;
+ public selected;
+
+ constructor(public dialogRef: MatDialogRef<SelectTestHeadModalComponent>,
+ private testHeadService: TestHeadService,
+ @Inject(MAT_DIALOG_DATA) public input_data
+ ) { }
+
+ ngOnInit() {
+ this.search = {};
+ this.input_data.testHead = {};
+ this.test_heads = [{}];
+ this.testHeadService.find({$limit: -1})
+ .subscribe(
+ (result) => {
+ this.test_heads = result;
+ },
+ (error) => {
+ alert(error.error.message);
+ });
+ //console.log(this.test_heads)
+ }
+
+}
diff --git a/otf-frontend/client/src/app/shared/modules/select-test-head-modal/select-test-head-modal.module.spec.ts b/otf-frontend/client/src/app/shared/modules/select-test-head-modal/select-test-head-modal.module.spec.ts
new file mode 100644
index 0000000..ed2b5df
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/select-test-head-modal/select-test-head-modal.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { SelectTestHeadModalModule } from './select-test-head-modal.module';
+
+describe('SelectTestHeadModalModule', () => {
+ let selectTestHeadModalModule: SelectTestHeadModalModule;
+
+ beforeEach(() => {
+ selectTestHeadModalModule = new SelectTestHeadModalModule();
+ });
+
+ it('should create an instance', () => {
+ expect(selectTestHeadModalModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/select-test-head-modal/select-test-head-modal.module.ts b/otf-frontend/client/src/app/shared/modules/select-test-head-modal/select-test-head-modal.module.ts
new file mode 100644
index 0000000..7a11ef6
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/select-test-head-modal/select-test-head-modal.module.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { SelectTestHeadModalComponent } from './select-test-head-modal.component';
+import { MAT_DIALOG_DEFAULT_OPTIONS, MatRadioModule, MatDialogModule, MatInputModule, MatButtonModule, MatFormFieldModule, MatIconModule } from '@angular/material';
+import { FormsModule } from '@angular/forms';
+import { FilterPipeModule } from 'ngx-filter-pipe';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ FilterPipeModule,
+ MatButtonModule,
+ MatInputModule,
+ MatRadioModule,
+ MatDialogModule,
+ MatIconModule,
+ MatFormFieldModule
+ ],
+ declarations: [SelectTestHeadModalComponent],
+ exports: [SelectTestHeadModalComponent],
+ providers: [{provide: MAT_DIALOG_DEFAULT_OPTIONS, useValue: {hasBackdrop: true}}],
+ entryComponents: [SelectTestHeadModalComponent]
+})
+export class SelectTestHeadModalModule { }
diff --git a/otf-frontend/client/src/app/shared/modules/stat/stat.component.html b/otf-frontend/client/src/app/shared/modules/stat/stat.component.html
new file mode 100644
index 0000000..02cd2ba
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/stat/stat.component.html
@@ -0,0 +1,35 @@
+<!-- Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+#############################################################################-->
+
+
+<div class="card text-white bg-{{bgClass}}">
+ <div class="card-header">
+ <div class="row">
+ <div class="col col-xs-3">
+ <i class="fa {{icon}} fa-5x"></i>
+ </div>
+ <div class="col col-xs-9 text-right">
+ <div class="d-block huge">{{count}}</div>
+ <div class="d-block">{{label}}</div>
+ </div>
+ </div>
+ </div>
+ <div class="card-footer">
+ <span class="float-left">View Details {{data}}</span>
+ <a href="javascript:void(0)" class="float-right card-inverse">
+ <span ><i class="fa fa-arrow-circle-right"></i></span>
+ </a>
+ </div>
+</div>
diff --git a/otf-frontend/client/src/app/shared/modules/stat/stat.component.scss b/otf-frontend/client/src/app/shared/modules/stat/stat.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/stat/stat.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/shared/modules/stat/stat.component.spec.ts b/otf-frontend/client/src/app/shared/modules/stat/stat.component.spec.ts
new file mode 100644
index 0000000..903c861
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/stat/stat.component.spec.ts
@@ -0,0 +1,42 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { StatComponent } from './stat.component';
+
+describe('StatComponent', () => {
+ let component: StatComponent;
+ let fixture: ComponentFixture<StatComponent>;
+
+ beforeEach(
+ async(() => {
+ TestBed.configureTestingModule({
+ declarations: [StatComponent]
+ }).compileComponents();
+ })
+ );
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(StatComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/stat/stat.component.ts b/otf-frontend/client/src/app/shared/modules/stat/stat.component.ts
new file mode 100644
index 0000000..d5ff3e4
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/stat/stat.component.ts
@@ -0,0 +1,35 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
+
+@Component({
+ selector: 'app-stat',
+ templateUrl: './stat.component.html',
+ styleUrls: ['./stat.component.scss']
+})
+export class StatComponent implements OnInit {
+ @Input() bgClass: string;
+ @Input() icon: string;
+ @Input() count: number;
+ @Input() label: string;
+ @Input() data: number;
+ @Output() event: EventEmitter<any> = new EventEmitter();
+
+ constructor() {}
+
+ ngOnInit() {}
+}
diff --git a/otf-frontend/client/src/app/shared/modules/stat/stat.module.spec.ts b/otf-frontend/client/src/app/shared/modules/stat/stat.module.spec.ts
new file mode 100644
index 0000000..b089e89
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/stat/stat.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { StatModule } from './stat.module';
+
+describe('StatModule', () => {
+ let statModule: StatModule;
+
+ beforeEach(() => {
+ statModule = new StatModule();
+ });
+
+ it('should create an instance', () => {
+ expect(statModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/stat/stat.module.ts b/otf-frontend/client/src/app/shared/modules/stat/stat.module.ts
new file mode 100644
index 0000000..211413a
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/stat/stat.module.ts
@@ -0,0 +1,26 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { StatComponent } from './stat.component';
+
+@NgModule({
+ imports: [CommonModule],
+ declarations: [StatComponent],
+ exports: [StatComponent]
+})
+export class StatModule {}
diff --git a/otf-frontend/client/src/app/shared/modules/test-definition-modal/test-definition-modal.component.pug b/otf-frontend/client/src/app/shared/modules/test-definition-modal/test-definition-modal.component.pug
new file mode 100644
index 0000000..5edf087
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/test-definition-modal/test-definition-modal.component.pug
@@ -0,0 +1,25 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div(style="position:relative")
+ .row()
+ .col-12
+ h2.pull-left(mat-dialog-title) Test Definition
+ button.pull-right(mat-icon-button, (click)="close()")
+ mat-icon close
+ .row
+ mat-dialog-content
+ app-create-test-form(*ngIf="formData", [formData]="formData", (childEvent)="close($event)")
diff --git a/otf-frontend/client/src/app/shared/modules/test-definition-modal/test-definition-modal.component.scss b/otf-frontend/client/src/app/shared/modules/test-definition-modal/test-definition-modal.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/test-definition-modal/test-definition-modal.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/shared/modules/test-definition-modal/test-definition-modal.component.spec.ts b/otf-frontend/client/src/app/shared/modules/test-definition-modal/test-definition-modal.component.spec.ts
new file mode 100644
index 0000000..d932d95
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/test-definition-modal/test-definition-modal.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TestDefinitionModalComponent } from './test-definition-modal.component';
+
+describe('TestDefinitionModalComponent', () => {
+ let component: TestDefinitionModalComponent;
+ let fixture: ComponentFixture<TestDefinitionModalComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TestDefinitionModalComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TestDefinitionModalComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/test-definition-modal/test-definition-modal.component.ts b/otf-frontend/client/src/app/shared/modules/test-definition-modal/test-definition-modal.component.ts
new file mode 100644
index 0000000..3e681ed
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/test-definition-modal/test-definition-modal.component.ts
@@ -0,0 +1,53 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Inject, Output, Input } from '@angular/core';
+import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
+import { AppGlobals } from 'app/app.global';
+import { HttpClient } from '@angular/common/http';
+import { TestDefinitionService } from 'app/shared/services/test-definition.service';
+
+@Component({
+ selector: 'app-test-definition-modal',
+ templateUrl: './test-definition-modal.component.pug',
+ styleUrls: ['./test-definition-modal.component.scss']
+})
+export class TestDefinitionModalComponent implements OnInit {
+
+ @Output() formData;
+
+ @Input() childEvent;
+
+ constructor(
+ public dialogRef: MatDialogRef<TestDefinitionModalComponent>,
+ private http: HttpClient,
+ private testDefinition: TestDefinitionService,
+ @Inject(MAT_DIALOG_DATA) public input_data) { }
+
+ ngOnInit() {
+ if (this.input_data.testDefinitionId) {
+ this.testDefinition.get(this.input_data.testDefinitionId).subscribe(result => {
+ this.formData = result;
+ });
+ } else {
+ this.formData = 'new';
+ }
+ }
+
+ close() {
+ this.dialogRef.close();
+ }
+}
diff --git a/otf-frontend/client/src/app/shared/modules/test-definition-modal/test-definition-modal.module.spec.ts b/otf-frontend/client/src/app/shared/modules/test-definition-modal/test-definition-modal.module.spec.ts
new file mode 100644
index 0000000..245e8dc
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/test-definition-modal/test-definition-modal.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestDefinitionModalModule } from './test-definition-modal.module';
+
+describe('TestDefinitionModalModule', () => {
+ let testDefinitionModalModule: TestDefinitionModalModule;
+
+ beforeEach(() => {
+ testDefinitionModalModule = new TestDefinitionModalModule();
+ });
+
+ it('should create an instance', () => {
+ expect(testDefinitionModalModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/test-definition-modal/test-definition-modal.module.ts b/otf-frontend/client/src/app/shared/modules/test-definition-modal/test-definition-modal.module.ts
new file mode 100644
index 0000000..d136b4b
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/test-definition-modal/test-definition-modal.module.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { TestDefinitionModalComponent } from './test-definition-modal.component';
+import { FilterPipeModule } from 'ngx-filter-pipe';
+import { MatButtonModule, MatInputModule, MatRadioModule, MatDialogModule, MatIconModule, MatFormFieldModule, MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material';
+import { CreateTestFormModule } from '../create-test-form/create-test-form.module';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FilterPipeModule,
+ MatButtonModule,
+ MatInputModule,
+ MatRadioModule,
+ MatDialogModule,
+ MatIconModule,
+ MatFormFieldModule,
+ CreateTestFormModule
+ ],
+ declarations: [TestDefinitionModalComponent],
+ exports: [TestDefinitionModalComponent],
+ entryComponents: [TestDefinitionModalComponent],
+ providers: [{provide: MAT_DIALOG_DEFAULT_OPTIONS, useValue: {hasBackdrop: true}}]
+})
+export class TestDefinitionModalModule { }
diff --git a/otf-frontend/client/src/app/shared/modules/test-head-modal/test-head-modal.component.pug b/otf-frontend/client/src/app/shared/modules/test-head-modal/test-head-modal.component.pug
new file mode 100644
index 0000000..13423ed
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/test-head-modal/test-head-modal.component.pug
@@ -0,0 +1,25 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div(style="position:relative")
+ .row()
+ .col-12
+ h2.pull-left(mat-dialog-title) Test Head
+ button.pull-right(mat-icon-button, (click)="close()")
+ mat-icon close
+ .row
+ mat-dialog-content(style="width: 100%")
+ app-create-test-head-form(*ngIf="formData", [options]="formOptions", [formData]="formData", (childEvent)="close($event)")
diff --git a/otf-frontend/client/src/app/shared/modules/test-head-modal/test-head-modal.component.scss b/otf-frontend/client/src/app/shared/modules/test-head-modal/test-head-modal.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/test-head-modal/test-head-modal.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/shared/modules/test-head-modal/test-head-modal.component.spec.ts b/otf-frontend/client/src/app/shared/modules/test-head-modal/test-head-modal.component.spec.ts
new file mode 100644
index 0000000..c4523c5
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/test-head-modal/test-head-modal.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TestHeadModalComponent } from './test-head-modal.component';
+
+describe('TestHeadModalComponent', () => {
+ let component: TestHeadModalComponent;
+ let fixture: ComponentFixture<TestHeadModalComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TestHeadModalComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TestHeadModalComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/test-head-modal/test-head-modal.component.ts b/otf-frontend/client/src/app/shared/modules/test-head-modal/test-head-modal.component.ts
new file mode 100644
index 0000000..eed1766
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/test-head-modal/test-head-modal.component.ts
@@ -0,0 +1,53 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Inject, Output, Input } from '@angular/core';
+import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
+import { AppGlobals } from '../../../app.global';
+import { HttpClient } from '@angular/common/http';
+
+@Component({
+ selector: 'app-test-head-modal',
+ templateUrl: './test-head-modal.component.pug',
+ styleUrls: ['./test-head-modal.component.scss']
+})
+export class TestHeadModalComponent implements OnInit {
+
+ public formOptions;
+
+ public formData;
+
+ @Input() childEvent;
+
+ constructor(public dialogRef: MatDialogRef<TestHeadModalComponent>, private http: HttpClient,
+ @Inject(MAT_DIALOG_DATA) public input_data
+ ) { }
+
+ ngOnInit() {
+ this.formOptions = {
+ goal: this.input_data.goal
+ };
+ if(this.input_data.testHead)
+ this.formData = this.input_data.testHead;
+ else
+ this.formData = {};
+ }
+
+ close(){
+ this.dialogRef.close();
+ }
+
+}
diff --git a/otf-frontend/client/src/app/shared/modules/test-head-modal/test-head-modal.module.spec.ts b/otf-frontend/client/src/app/shared/modules/test-head-modal/test-head-modal.module.spec.ts
new file mode 100644
index 0000000..fd16ca5
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/test-head-modal/test-head-modal.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestHeadModalModule } from './test-head-modal.module';
+
+describe('TestHeadModalModule', () => {
+ let testHeadModalModule: TestHeadModalModule;
+
+ beforeEach(() => {
+ testHeadModalModule = new TestHeadModalModule();
+ });
+
+ it('should create an instance', () => {
+ expect(testHeadModalModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/test-head-modal/test-head-modal.module.ts b/otf-frontend/client/src/app/shared/modules/test-head-modal/test-head-modal.module.ts
new file mode 100644
index 0000000..66a214a
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/test-head-modal/test-head-modal.module.ts
@@ -0,0 +1,43 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { TestHeadModalComponent } from './test-head-modal.component';
+import { FormsModule } from '@angular/forms';
+import { FilterPipeModule } from 'ngx-filter-pipe';
+import { MatButtonModule, MatInputModule, MatRadioModule, MatDialogModule, MatFormFieldModule, MatIconModule, MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material';
+import { CreateTestHeadFormModule } from '../create-test-head-form/create-test-head-form.module';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ FilterPipeModule,
+ MatButtonModule,
+ MatInputModule,
+ MatRadioModule,
+ MatDialogModule,
+ MatIconModule,
+ MatFormFieldModule,
+ CreateTestHeadFormModule
+ ],
+ declarations: [TestHeadModalComponent],
+ exports: [TestHeadModalComponent],
+ entryComponents: [TestHeadModalComponent],
+ providers: [{provide: MAT_DIALOG_DEFAULT_OPTIONS, useValue: {hasBackdrop: true}}]
+})
+export class TestHeadModalModule { }
diff --git a/otf-frontend/client/src/app/shared/modules/test-instance-modal/test-instance-modal.component.pug b/otf-frontend/client/src/app/shared/modules/test-instance-modal/test-instance-modal.component.pug
new file mode 100644
index 0000000..7cc39e0
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/test-instance-modal/test-instance-modal.component.pug
@@ -0,0 +1,25 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+div(style="position:relative")
+ .row()
+ .col-12
+ h2.pull-left(mat-dialog-title) Test Instance
+ button.pull-right(mat-icon-button, (click)="close()")
+ mat-icon close
+ .row
+ mat-dialog-content(style="width:100%")
+ app-create-test-instance-form(*ngIf='!findInstance', [existingInstance] = 'editInstance', (childEvent)="close($event)")
diff --git a/otf-frontend/client/src/app/shared/modules/test-instance-modal/test-instance-modal.component.scss b/otf-frontend/client/src/app/shared/modules/test-instance-modal/test-instance-modal.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/test-instance-modal/test-instance-modal.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/shared/modules/test-instance-modal/test-instance-modal.component.spec.ts b/otf-frontend/client/src/app/shared/modules/test-instance-modal/test-instance-modal.component.spec.ts
new file mode 100644
index 0000000..703bfcb
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/test-instance-modal/test-instance-modal.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TestInstanceModalComponent } from './test-instance-modal.component';
+
+describe('TestInstanceModalComponent', () => {
+ let component: TestInstanceModalComponent;
+ let fixture: ComponentFixture<TestInstanceModalComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TestInstanceModalComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TestInstanceModalComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/test-instance-modal/test-instance-modal.component.ts b/otf-frontend/client/src/app/shared/modules/test-instance-modal/test-instance-modal.component.ts
new file mode 100644
index 0000000..9fb4f43
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/test-instance-modal/test-instance-modal.component.ts
@@ -0,0 +1,80 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Inject, Output, Input } from '@angular/core';
+import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
+import { AppGlobals } from 'app/app.global';
+import { HttpClient } from '@angular/common/http';
+import { TestInstanceService } from '../../services/test-instance.service';
+import { TestDefinitionService } from '../../services/test-definition.service';
+
+@Component({
+ selector: 'app-test-instance-modal',
+ templateUrl: './test-instance-modal.component.pug',
+ styleUrls: ['./test-instance-modal.component.scss']
+})
+export class TestInstanceModalComponent implements OnInit {
+
+ @Output() editInstance;
+ public findInstance = true;
+ @Input() childEvent;
+
+
+ constructor(
+ public dialogRef: MatDialogRef<TestInstanceModalComponent>,
+ private http: HttpClient,
+ private testDefintionService: TestDefinitionService,
+ private testInstanceService: TestInstanceService,
+ @Inject(MAT_DIALOG_DATA) public inputInstanceId) { }
+
+ ngOnInit() {
+ if(!this.inputInstanceId){
+ this.findInstance = false;
+ }
+ //if the user is creating an Instance from a test definition page. Pull all data and populate testHeads
+ else if(this.inputInstanceId["td"]){
+ this.testDefintionService.get(this.inputInstanceId.td,{$populate: ['bpmnInstances.testHeads.testHeadId']}).subscribe((result) => {
+ this.editInstance = {
+
+ testDefinition: result,
+ isEdit: false
+ };
+
+ this.findInstance = false;
+ });
+
+ }
+ else if (this.inputInstanceId["ti"]) {
+ this.testInstanceService.get(this.inputInstanceId.ti, {$populate: ['testDefinitionId']}).subscribe((result) => {
+
+ this.editInstance = {};
+ this.editInstance.testInstance = result;
+ if(this.inputInstanceId.isEdit){
+ this.editInstance.isEdit = true;
+ }else{
+ this.editInstance.isEdit = false;
+ }
+ this.findInstance = false;
+ });
+ }else{
+ this.findInstance = false
+ }
+ }
+
+ close() {
+ this.dialogRef.close();
+ }
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/modules/test-instance-modal/test-instance-modal.module.spec.ts b/otf-frontend/client/src/app/shared/modules/test-instance-modal/test-instance-modal.module.spec.ts
new file mode 100644
index 0000000..8ca1097
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/test-instance-modal/test-instance-modal.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestInstanceModalModule } from './test-instance-modal.module';
+
+describe('TestInstanceModalModule', () => {
+ let testInstanceModalModule: TestInstanceModalModule;
+
+ beforeEach(() => {
+ testInstanceModalModule = new TestInstanceModalModule();
+ });
+
+ it('should create an instance', () => {
+ expect(testInstanceModalModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/test-instance-modal/test-instance-modal.module.ts b/otf-frontend/client/src/app/shared/modules/test-instance-modal/test-instance-modal.module.ts
new file mode 100644
index 0000000..96be1e9
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/test-instance-modal/test-instance-modal.module.ts
@@ -0,0 +1,42 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { MatInputModule, MatDialogModule, MatFormFieldModule, MatIconModule, MatButtonModule } from '@angular/material';
+import { CreateTestInstanceFormModule } from '../create-test-instance-form/create-test-instance-form.module';
+import { FormsModule } from '@angular/forms';
+import { FilterPipeModule } from 'ngx-filter-pipe';
+import { TestInstanceModalComponent } from './test-instance-modal.component';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ FilterPipeModule,
+ MatInputModule,
+ MatDialogModule,
+ MatFormFieldModule,
+ MatButtonModule,
+ MatIconModule,
+ CreateTestInstanceFormModule
+
+ ],
+ declarations: [TestInstanceModalComponent],
+ exports: [TestInstanceModalComponent],
+ entryComponents: [TestInstanceModalComponent]
+})
+export class TestInstanceModalModule { }
diff --git a/otf-frontend/client/src/app/shared/modules/user-select/user-select.component.pug b/otf-frontend/client/src/app/shared/modules/user-select/user-select.component.pug
new file mode 100644
index 0000000..401d807
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/user-select/user-select.component.pug
@@ -0,0 +1,44 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+h2.mb-1(mat-dialog-title) Search Users By Email
+//input.bg-light.form-control(mat-dialog-title, type="text", placeholder="Search...", [(ngModel)]="search.testName")
+mat-form-field(style="width:100%")
+ input(matInput, type='search', placeholder='Search email...', color='blue', [(ngModel)]='search.email')
+ button(mat-button, *ngIf='search.email', matSuffix, mat-icon-button, aria-label='Clear', (click)="search.email=''")
+ mat-icon close
+
+mat-dialog-content
+ .row
+ .col-md-8
+ .list-group
+ .px-4.py-3
+ .mr-1.ml-1(*ngFor="let user of users | filterBy:search")
+ mat-checkbox(*ngIf="search.email.length > 0", [(ngModel)]="user.isSelected", (change)="selectUser(user)")
+ .ml-1
+ h5 {{ user.firstName }} {{user.lastName}}
+ p.mb-0 {{ user.email }}
+ .col-md-4
+ h4(*ngIf="selectedUsers.length > 0") Selected Users
+ .list-group
+ .mr-1.ml-1(*ngFor="let user of selectedUsers")
+ mat-checkbox([(ngModel)] = "user.isSelected", (change)="unselectUser(user)")
+ .ml-1
+ h5 {{ user.firstName }} {{user.lastName}}
+ p.mb-0 {{ user.email }}
+mat-dialog-actions
+ button.bg-primary.text-white(mat-button, (click)="addUsers()") Add To Group
+
diff --git a/otf-frontend/client/src/app/shared/modules/user-select/user-select.component.scss b/otf-frontend/client/src/app/shared/modules/user-select/user-select.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/user-select/user-select.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/shared/modules/user-select/user-select.component.spec.ts b/otf-frontend/client/src/app/shared/modules/user-select/user-select.component.spec.ts
new file mode 100644
index 0000000..1a42102
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/user-select/user-select.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { UserSelectComponent } from './user-select.component';
+
+describe('UserSelectComponent', () => {
+ let component: UserSelectComponent;
+ let fixture: ComponentFixture<UserSelectComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ UserSelectComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(UserSelectComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/user-select/user-select.component.ts b/otf-frontend/client/src/app/shared/modules/user-select/user-select.component.ts
new file mode 100644
index 0000000..5cbfa0b
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/user-select/user-select.component.ts
@@ -0,0 +1,117 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Inject } from '@angular/core';
+import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
+import { UserService } from 'app/shared/services/user.service';
+import { GroupService } from 'app/shared/services/group.service';
+
+@Component({
+ selector: 'app-user-select',
+ templateUrl: './user-select.component.pug',
+ styleUrls: ['./user-select.component.scss']
+})
+export class UserSelectComponent implements OnInit {
+
+
+ public data;
+ public users;
+ public group;
+ public search;
+ public selectedUsers;
+
+ constructor(
+ public dialogRef: MatDialogRef<UserSelectComponent>,
+ private userService: UserService,
+ private groupService: GroupService,
+ @Inject(MAT_DIALOG_DATA) public input_data
+ ) {
+ this.data = {};
+ }
+
+ onNoClick(): void {
+ this.dialogRef.close();
+ }
+
+ selectUser(user){
+ //this.unselectUser();
+ if(user.isSelected){
+ this.selectedUsers.push(user);
+ }else{
+ //user.isSelected = false;
+ this.unselectUser(user);
+ }
+
+
+ }
+
+ unselectUser(user){
+ // this.selectedUsers = this.selectedUsers.filter(user => user.isSelected);
+ this.selectedUsers.splice(this.selectedUsers.findIndex(function(userN){ return userN._id.toString() === user._id.toString(); }), 1);
+
+ }
+
+ addUsers(){
+ let usersToAdd = this.selectedUsers;
+
+ //filters users that are already in the group to avoid duplicates
+ if(this.group.members){
+ usersToAdd = this.selectedUsers.filter(user =>
+ this.group.members.filter(member => member.userId.toString() == user._id.toString()).length <= 0
+ );
+ }
+
+ //populates the users roles and userId field
+ for(let i = 0; i < usersToAdd.length; i++){
+ usersToAdd[i] = {
+ userId : usersToAdd[i]._id,
+ roles : ["user"]
+ }
+ }
+ //sets up patch object
+
+ let groupPatch = {
+ _id : this.input_data.groupId,
+ $push : { members: { $each : usersToAdd } }
+
+ }
+ this.groupService.patch(groupPatch).subscribe((results) => {
+ this.dialogRef.close(usersToAdd);
+ });
+
+ }
+
+ ngOnInit() {
+ this.users = [];
+ this.selectedUsers = [];
+ this.userService.find({$limit: -1, $select: ['firstName', 'lastName', 'email']})
+ .subscribe(
+ (result) => {
+ this.users = result;
+ },
+ (error) => {
+ console.log(error);
+ });
+ this.groupService.get(this.input_data.groupId).subscribe((res) => {
+ this.group = res;
+ })
+
+ this.search = {};
+ this.search.email = "";
+ this.input_data.testDefinition = {};
+ }
+
+}
diff --git a/otf-frontend/client/src/app/shared/modules/user-select/user-select.module.spec.ts b/otf-frontend/client/src/app/shared/modules/user-select/user-select.module.spec.ts
new file mode 100644
index 0000000..dc33dc2
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/user-select/user-select.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { UserSelectModule } from './user-select.module';
+
+describe('UserSelectModule', () => {
+ let userSelectModule: UserSelectModule;
+
+ beforeEach(() => {
+ userSelectModule = new UserSelectModule();
+ });
+
+ it('should create an instance', () => {
+ expect(userSelectModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/user-select/user-select.module.ts b/otf-frontend/client/src/app/shared/modules/user-select/user-select.module.ts
new file mode 100644
index 0000000..8793aed
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/user-select/user-select.module.ts
@@ -0,0 +1,40 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { UserSelectComponent } from './user-select.component';
+import { FormsModule } from '@angular/forms';
+import { FilterPipeModule } from 'ngx-filter-pipe';
+import { MatButtonModule, MatInputModule, MatDialogModule, MatIconModule, MatFormFieldModule, MatCheckboxModule } from '@angular/material';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ FilterPipeModule,
+ MatButtonModule,
+ MatInputModule,
+ MatDialogModule,
+ MatIconModule,
+ MatFormFieldModule,
+ MatCheckboxModule
+ ],
+ declarations: [UserSelectComponent],
+ exports: [UserSelectComponent],
+ entryComponents: [UserSelectComponent]
+})
+export class UserSelectModule { }
diff --git a/otf-frontend/client/src/app/shared/modules/view-schedule-modal/view-schedule-modal.component.pug b/otf-frontend/client/src/app/shared/modules/view-schedule-modal/view-schedule-modal.component.pug
new file mode 100644
index 0000000..10da824
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/view-schedule-modal/view-schedule-modal.component.pug
@@ -0,0 +1,32 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+.row
+ .col-md-6
+ h5 Scheduled Instance
+ Label {{schedule.testInstanceName}}
+ h5 Schedule Start Date
+ Label {{ schedule.data.testSchedule._testInstanceStartDate }}
+ h5 Schedule End Date
+ Label {{schedule.data.testSchedule._testInstanceEndDate}}
+ .col-md-6
+ h5 Next Run On
+ Label {{ schedule.nextRunAt }}
+ h5 Last Run On
+ Label {{schedule.lastRunAt}}
+ h5 Run Every
+ Label {{schedule.repeatInterval}}
+ button.bg-primary.text-white(mat-button, mat-dialog-close) Close
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/modules/view-schedule-modal/view-schedule-modal.component.scss b/otf-frontend/client/src/app/shared/modules/view-schedule-modal/view-schedule-modal.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/view-schedule-modal/view-schedule-modal.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/shared/modules/view-schedule-modal/view-schedule-modal.component.spec.ts b/otf-frontend/client/src/app/shared/modules/view-schedule-modal/view-schedule-modal.component.spec.ts
new file mode 100644
index 0000000..0e95912
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/view-schedule-modal/view-schedule-modal.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ViewScheduleModalComponent } from './view-schedule-modal.component';
+
+describe('ViewScheduleModalComponent', () => {
+ let component: ViewScheduleModalComponent;
+ let fixture: ComponentFixture<ViewScheduleModalComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ViewScheduleModalComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ViewScheduleModalComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/view-schedule-modal/view-schedule-modal.component.ts b/otf-frontend/client/src/app/shared/modules/view-schedule-modal/view-schedule-modal.component.ts
new file mode 100644
index 0000000..c047c92
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/view-schedule-modal/view-schedule-modal.component.ts
@@ -0,0 +1,45 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Inject } from '@angular/core';
+import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material';
+
+@Component({
+ selector: 'app-view-schedule-modal',
+ templateUrl: './view-schedule-modal.component.pug',
+ styleUrls: ['./view-schedule-modal.component.scss']
+})
+export class ViewScheduleModalComponent implements OnInit {
+
+ public data;
+
+ constructor(
+ private dialogRef: MatDialogRef<ViewScheduleModalComponent>,
+ private dialog: MatDialog,
+ @Inject(MAT_DIALOG_DATA) public schedule: any
+ ) {
+ }
+
+ onNoClick(): void {
+ this.dialogRef.close();
+ }
+
+ ngOnInit() {
+ if(!this.schedule.data.testSchedule._testInstanceEndDate){
+ this.schedule.data.testSchedule._testInstanceEndDate = 'none';
+ }
+ }
+}
diff --git a/otf-frontend/client/src/app/shared/modules/view-schedule-modal/view-schedule-modal.module.spec.ts b/otf-frontend/client/src/app/shared/modules/view-schedule-modal/view-schedule-modal.module.spec.ts
new file mode 100644
index 0000000..cd52d9d
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/view-schedule-modal/view-schedule-modal.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { ViewScheduleModalModule } from './view-schedule-modal.module';
+
+describe('ViewScheduleModalModule', () => {
+ let viewScheduleModalModule: ViewScheduleModalModule;
+
+ beforeEach(() => {
+ viewScheduleModalModule = new ViewScheduleModalModule();
+ });
+
+ it('should create an instance', () => {
+ expect(viewScheduleModalModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/view-schedule-modal/view-schedule-modal.module.ts b/otf-frontend/client/src/app/shared/modules/view-schedule-modal/view-schedule-modal.module.ts
new file mode 100644
index 0000000..dbb706e
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/view-schedule-modal/view-schedule-modal.module.ts
@@ -0,0 +1,32 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { MatDialogModule, MatButtonModule } from '@angular/material';
+import { ViewScheduleModalComponent } from './view-schedule-modal.component';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ MatDialogModule,
+ MatButtonModule
+ ],
+ declarations: [ViewScheduleModalComponent],
+ exports: [ViewScheduleModalComponent],
+ entryComponents: [ViewScheduleModalComponent]
+})
+export class ViewScheduleModalModule { }
diff --git a/otf-frontend/client/src/app/shared/modules/view-workflow-modal/view-workflow-modal.component.pug b/otf-frontend/client/src/app/shared/modules/view-workflow-modal/view-workflow-modal.component.pug
new file mode 100644
index 0000000..7c33d5e
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/view-workflow-modal/view-workflow-modal.component.pug
@@ -0,0 +1,23 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+h2.mat-dialog-title
+ span(*ngIf="td") {{ td.testName }}
+ | Workflow
+mat-dialog-content
+ #canvas(style="width: 100%; height: 100%")
+mat-dialog-actions.pull-right
+ button(mat-raised-button, mat-dialog-close, color="primary") Close
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/modules/view-workflow-modal/view-workflow-modal.component.scss b/otf-frontend/client/src/app/shared/modules/view-workflow-modal/view-workflow-modal.component.scss
new file mode 100644
index 0000000..90560e3
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/view-workflow-modal/view-workflow-modal.component.scss
@@ -0,0 +1,20 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+mat-dialog-content {
+ max-height: none;
+ height: calc(100% - 90px);
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/modules/view-workflow-modal/view-workflow-modal.component.spec.ts b/otf-frontend/client/src/app/shared/modules/view-workflow-modal/view-workflow-modal.component.spec.ts
new file mode 100644
index 0000000..e11459c
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/view-workflow-modal/view-workflow-modal.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ViewWorkflowModalComponent } from './view-workflow-modal.component';
+
+describe('ViewWorkflowModalComponent', () => {
+ let component: ViewWorkflowModalComponent;
+ let fixture: ComponentFixture<ViewWorkflowModalComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ViewWorkflowModalComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ViewWorkflowModalComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/view-workflow-modal/view-workflow-modal.component.ts b/otf-frontend/client/src/app/shared/modules/view-workflow-modal/view-workflow-modal.component.ts
new file mode 100644
index 0000000..7cef8dc
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/view-workflow-modal/view-workflow-modal.component.ts
@@ -0,0 +1,53 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, Inject, HostListener } from '@angular/core';
+import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
+import { TestHeadModalComponent } from '../test-head-modal/test-head-modal.component';
+import { BpmnFactoryService } from 'app/shared/factories/bpmn-factory.service';
+
+
+@Component({
+ selector: 'app-view-workflow-modal',
+ templateUrl: './view-workflow-modal.component.pug',
+ styleUrls: ['./view-workflow-modal.component.scss']
+})
+export class ViewWorkflowModalComponent implements OnInit {
+
+ public viewer;
+
+ constructor(
+ public dialogRef: MatDialogRef<TestHeadModalComponent>,
+ private bpmnFactory: BpmnFactoryService,
+ @Inject(MAT_DIALOG_DATA) public input_data
+ ) { }
+
+ async ngOnInit() {
+
+ this.viewer = await this.bpmnFactory.setup({
+ mode: 'viewer',
+ options: {
+ container: '#canvas'
+ },
+ xml: this.input_data.xml,
+ fileId: this.input_data.fileId,
+ testDefinitionId: this.input_data.testDefinitionId,
+ version: this.input_data.version
+ });
+
+ }
+
+}
diff --git a/otf-frontend/client/src/app/shared/modules/view-workflow-modal/view-workflow-modal.module.spec.ts b/otf-frontend/client/src/app/shared/modules/view-workflow-modal/view-workflow-modal.module.spec.ts
new file mode 100644
index 0000000..a1da0a8
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/view-workflow-modal/view-workflow-modal.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { ViewWorkflowModalModule } from './view-workflow-modal.module';
+
+describe('ViewWorkflowModalModule', () => {
+ let viewWorkflowModalModule: ViewWorkflowModalModule;
+
+ beforeEach(() => {
+ viewWorkflowModalModule = new ViewWorkflowModalModule();
+ });
+
+ it('should create an instance', () => {
+ expect(viewWorkflowModalModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/view-workflow-modal/view-workflow-modal.module.ts b/otf-frontend/client/src/app/shared/modules/view-workflow-modal/view-workflow-modal.module.ts
new file mode 100644
index 0000000..5538574
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/view-workflow-modal/view-workflow-modal.module.ts
@@ -0,0 +1,33 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { ViewWorkflowModalComponent } from './view-workflow-modal.component';
+import { MAT_DIALOG_DEFAULT_OPTIONS, MatDialogModule, MatButtonModule } from '@angular/material';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ MatDialogModule,
+ MatButtonModule
+ ],
+ declarations: [ViewWorkflowModalComponent],
+ exports: [ViewWorkflowModalComponent],
+ entryComponents: [ViewWorkflowModalComponent],
+ providers: [{provide: MAT_DIALOG_DEFAULT_OPTIONS, useValue: {hasBackdrop: true}}]
+})
+export class ViewWorkflowModalModule { }
diff --git a/otf-frontend/client/src/app/shared/modules/workflow-request/workflow-request.component.pug b/otf-frontend/client/src/app/shared/modules/workflow-request/workflow-request.component.pug
new file mode 100644
index 0000000..052fbfb
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/workflow-request/workflow-request.component.pug
@@ -0,0 +1,36 @@
+//- Copyright (c) 2019 AT&T Intellectual Property. #
+//- #
+//- Licensed under the Apache License, Version 2.0 (the "License"); #
+//- you may not use this file except in compliance with the License. #
+//- You may obtain a copy of the License at #
+//- #
+//- http://www.apache.org/licenses/LICENSE-2.0 #
+//- #
+//- Unless required by applicable law or agreed to in writing, software #
+//- distributed under the License is distributed on an "AS IS" BASIS, #
+//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+//- See the License for the specific language governing permissions and #
+//- limitations under the License. #
+//- #############################################################################
+
+
+form(style="width:100%")
+ .row
+ .col-sm-6
+ .row
+ mat-form-field.mr-2
+ mat-select((selectionChange)="onFormChange()", name="ns", placeholder="Async", [(value)]="workReq.async", required)
+ mat-option([value]="false") False
+ mat-option([value]="true") True
+ .row
+ mat-form-field.mr-2(*ngIf="workReq")
+ input(matInput, (onChange)="onFormChange()", type="text", name="asyncTopic", placeholder="Async Topic", [(ngModel)]="workReq.asyncTopic")
+
+ .col-sm-6
+ .row
+ mat-form-field.mr-2
+ input(matInput, (onChange)="onFormChange()", type="text", name="testInstanceId", placeholder="Test Instance Id", [(ngModel)]="workReq.testInstanceId", required)
+ .row
+ mat-form-field
+ input(matInput, (onChange)="onFormChange()", type="number", name="timeoutTime", placeholder="Timeout Time in Millis", [(ngModel)]="workReq.maxExecutionTimeInMillis", required)
+
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/modules/workflow-request/workflow-request.component.scss b/otf-frontend/client/src/app/shared/modules/workflow-request/workflow-request.component.scss
new file mode 100644
index 0000000..1571dc1
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/workflow-request/workflow-request.component.scss
@@ -0,0 +1,16 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
diff --git a/otf-frontend/client/src/app/shared/modules/workflow-request/workflow-request.component.spec.ts b/otf-frontend/client/src/app/shared/modules/workflow-request/workflow-request.component.spec.ts
new file mode 100644
index 0000000..d789ffb
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/workflow-request/workflow-request.component.spec.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { WorkflowRequestComponent } from './workflow-request.component';
+
+describe('WorkflowRequestComponent', () => {
+ let component: WorkflowRequestComponent;
+ let fixture: ComponentFixture<WorkflowRequestComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ WorkflowRequestComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(WorkflowRequestComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/workflow-request/workflow-request.component.ts b/otf-frontend/client/src/app/shared/modules/workflow-request/workflow-request.component.ts
new file mode 100644
index 0000000..35f5042
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/workflow-request/workflow-request.component.ts
@@ -0,0 +1,48 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit, EventEmitter, Input, Output } from '@angular/core';
+import { FormGroup } from '@angular/forms';
+
+@Component({
+ selector: 'app-workflow-request',
+ templateUrl: './workflow-request.component.pug',
+ styleUrls: ['./workflow-request.component.scss']
+})
+
+export class WorkflowRequestComponent implements OnInit {
+ @Input() public formData;
+ @Input() public taskId;
+ @Input() public index;
+
+ @Output() public childEvent = new EventEmitter();
+
+ public workReq;
+ constructor() { }
+
+ ngOnInit() {
+ this.workReq = this.formData;
+ }
+
+ onFormChange(){
+ let event = {
+ object: this.workReq,
+ taskId: this.taskId,
+ index: this.index
+ };
+ this.childEvent.emit(event);
+ }
+}
diff --git a/otf-frontend/client/src/app/shared/modules/workflow-request/workflow-request.module.spec.ts b/otf-frontend/client/src/app/shared/modules/workflow-request/workflow-request.module.spec.ts
new file mode 100644
index 0000000..e6d1f84
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/workflow-request/workflow-request.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { WorkflowRequestModule } from './workflow-request.module';
+
+describe('WorkflowRequestModule', () => {
+ let workflowRequestModule: WorkflowRequestModule;
+
+ beforeEach(() => {
+ workflowRequestModule = new WorkflowRequestModule();
+ });
+
+ it('should create an instance', () => {
+ expect(workflowRequestModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/modules/workflow-request/workflow-request.module.ts b/otf-frontend/client/src/app/shared/modules/workflow-request/workflow-request.module.ts
new file mode 100644
index 0000000..ca959d9
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/modules/workflow-request/workflow-request.module.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { WorkflowRequestComponent } from './workflow-request.component';
+import { FormsModule, ReactiveFormsModule } from '@angular/forms';
+import { MatButtonModule, MatInputModule, MatSelectModule, MatOptionModule, MatSnackBarModule, MatIconModule, MatDialogModule } from '@angular/material';
+import { AlertSnackbarModule } from '../alert-snackbar/alert-snackbar.module';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ MatButtonModule,
+ MatInputModule,
+ MatSelectModule,
+ MatOptionModule,
+ MatSnackBarModule,
+ AlertSnackbarModule,
+ MatIconModule,
+ ReactiveFormsModule,
+ MatDialogModule
+ ],
+ declarations: [WorkflowRequestComponent],
+ exports: [WorkflowRequestComponent]
+})
+export class WorkflowRequestModule { }
diff --git a/otf-frontend/client/src/app/shared/pipes/shared-pipes.module.ts b/otf-frontend/client/src/app/shared/pipes/shared-pipes.module.ts
new file mode 100644
index 0000000..c582d92
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/pipes/shared-pipes.module.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+@NgModule({
+ imports: [
+ CommonModule
+ ],
+ declarations: [
+
+ ],
+ exports: [
+
+ ]
+})
+export class SharedPipesModule { }
diff --git a/otf-frontend/client/src/app/shared/services/account.service.spec.ts b/otf-frontend/client/src/app/shared/services/account.service.spec.ts
new file mode 100644
index 0000000..2485439
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/account.service.spec.ts
@@ -0,0 +1,28 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestBed } from '@angular/core/testing';
+
+import { AccountService } from './account.service';
+
+describe('AccountService', () => {
+ beforeEach(() => TestBed.configureTestingModule({}));
+
+ it('should be created', () => {
+ const service: AccountService = TestBed.get(AccountService);
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/services/account.service.ts b/otf-frontend/client/src/app/shared/services/account.service.ts
new file mode 100644
index 0000000..cbbb1d3
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/account.service.ts
@@ -0,0 +1,47 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from '@angular/core';
+import { CookieService } from 'ngx-cookie-service';
+import { HttpClient, HttpHeaders } from '@angular/common/http';
+import { Observable } from 'rxjs';
+import { AppGlobals } from '../../app.global';
+import { map } from 'rxjs/operators';
+
+const httpOptions = {
+ headers: new HttpHeaders({ 'Content-Type': 'application/json' })
+};
+
+@Injectable({
+ providedIn: 'root'
+})
+export class AccountService {
+
+ constructor(private cookie: CookieService, private http: HttpClient) { }
+
+
+ verify(token): Observable<Object>{
+ let body = {
+ action: 'verifySignupLong',
+ value: token
+ };
+
+ return this.http.post(AppGlobals.baseAPIUrl + 'authManagement', body, httpOptions)
+
+ }
+
+
+}
diff --git a/otf-frontend/client/src/app/shared/services/auth.service.spec.ts b/otf-frontend/client/src/app/shared/services/auth.service.spec.ts
new file mode 100644
index 0000000..91de3d6
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/auth.service.spec.ts
@@ -0,0 +1,28 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestBed } from '@angular/core/testing';
+
+import { AuthService } from './auth.service';
+
+describe('AuthService', () => {
+ beforeEach(() => TestBed.configureTestingModule({}));
+
+ it('should be created', () => {
+ const service: AuthService = TestBed.get(AuthService);
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/services/auth.service.ts b/otf-frontend/client/src/app/shared/services/auth.service.ts
new file mode 100644
index 0000000..7b5fe3f
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/auth.service.ts
@@ -0,0 +1,85 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from '@angular/core';
+import { CookieService } from 'ngx-cookie-service';
+import { HttpClient, HttpHeaders } from '@angular/common/http';
+import { Observable } from 'rxjs';
+import { AppGlobals } from '../../app.global';
+import { map } from 'rxjs/operators';
+import { FeathersService } from './feathers.service';
+
+const httpOptions = {
+ headers: new HttpHeaders({ 'Content-Type': 'application/json' })
+};
+
+@Injectable({
+ providedIn: 'root'
+})
+export class AuthService {
+
+ constructor(private cookie: CookieService, private http: HttpClient, private feathers: FeathersService) { }
+
+ //logs user into the app and store the auth token in cookie
+ login(userLogin): Observable<Object> {
+ let body = userLogin;
+ body.strategy = "local";
+ return new Observable(observer => {
+ this.feathers.authenticate(body)
+ .subscribe(res => {
+ this.storeUser(res);
+ observer.next(res);
+ },
+ err => {
+ observer.error(err);
+ });
+ });
+ // return this.http.post(AppGlobals.baseAPIUrl + 'authentication', body, httpOptions)
+ // .pipe(map(authResult => {
+ // if (authResult && authResult['accessToken']) {
+ // this.storeUser(authResult);
+ // }
+ // return authResult;
+ // }));
+ }
+
+ register(user): Observable<Object> {
+ return this.http.post(AppGlobals.baseAPIUrl + 'users', user, httpOptions);
+ }
+
+ //logs user out of app
+ logout() {
+ this.feathers.logout();
+ window.localStorage.clear();
+ this.cookie.delete('access_token');
+ this.cookie.delete('currentUser');
+ }
+
+ //store a user
+ storeUser(user) {
+
+ if (user.accessToken) {
+ window.localStorage.setItem('access_token', user['accessToken'])
+ window.localStorage.setItem('user_rules', JSON.stringify(user['user']['rules']));
+
+ //The rules are too large to store as a cookie
+ delete user['user']['rules'];
+
+ this.cookie.set('access_token', JSON.stringify(user['accessToken']));
+ this.cookie.set('currentUser', JSON.stringify(user['user']));
+ }
+ }
+}
diff --git a/otf-frontend/client/src/app/shared/services/execute.service.ts b/otf-frontend/client/src/app/shared/services/execute.service.ts
new file mode 100644
index 0000000..66887b4
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/execute.service.ts
@@ -0,0 +1,38 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from "@angular/core";
+import { ModelService } from "./model.service";
+import { HttpClient } from "@angular/common/http";
+import { ParamsService } from "./params.service";
+import { CookieService } from "ngx-cookie-service";
+import { FeathersService } from "./feathers.service";
+import { Observable } from "rxjs";
+
+@Injectable({
+ providedIn: 'root'
+})
+
+export class ExecuteService extends ModelService {
+ constructor(http: HttpClient, Params: ParamsService, cookie: CookieService, feathers: FeathersService) {
+ super('execute', http, Params, cookie, feathers);
+ }
+
+ create(data, params?): Observable<Object> {
+ data.asyncTopic = "";
+ return super.create(data, params);
+ }
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/services/feathers.service.ts b/otf-frontend/client/src/app/shared/services/feathers.service.ts
new file mode 100644
index 0000000..e5ba3eb
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/feathers.service.ts
@@ -0,0 +1,88 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+
+import { Injectable, OnInit } from '@angular/core';
+
+import * as feathers from '@feathersjs/client';
+import * as io from 'socket.io-client';
+import * as socketio from '@feathersjs/socketio-client';
+import * as authentication from '@feathersjs/authentication-client';
+import { Observable, from, interval } from 'rxjs';
+import { now } from 'moment';
+import { AppGlobals } from 'app/app.global';
+import { CookieService } from 'ngx-cookie-service';
+import { Router } from '@angular/router';
+
+
+@Injectable({
+ providedIn: 'root'
+})
+export class FeathersService {
+ // There are no proper typings available for feathers, due to its plugin-heavy nature
+ private _feathers: any;
+ public _socket: any;
+ public auth: Observable<Object>;
+
+ constructor(private route: Router) {
+ this._socket = io('/',{
+ transports: ['websocket']
+ }); // init socket.io
+ this._socket.on('connect_error', function(data){
+ route.navigateByUrl('/login');
+ });
+ this._feathers = feathers(); // init Feathers // add hooks plugin
+ this._feathers.configure(socketio(this._socket, {
+ timeout: 100000000
+ })); // add socket.io plugin
+ this._feathers.configure(authentication({
+ storage: window.localStorage,
+ storageKey: 'access_token'
+ }));
+
+ //set observiable for services to check before calling the service
+ this.auth = from(this._feathers.authenticate());
+
+ }
+
+ // expose services
+ public service(name: string) {
+ return this._feathers.service(name);
+ }
+
+ public socket(){
+ return this._socket;
+ }
+
+ // expose authentication
+ public authenticate(credentials?): Observable<Object> {
+ return new Observable(observer => {
+ this.auth = from(this._feathers.authenticate(credentials).then(res => {
+ observer.next(res);
+ }, err => {
+ observer.error(err);
+ this.route.navigate(['/login'])
+ }));
+ });
+
+ }
+
+ // expose logout
+ public logout() {
+ return this._feathers.logout();
+ }
+}
+
diff --git a/otf-frontend/client/src/app/shared/services/feedback.service.spec.ts b/otf-frontend/client/src/app/shared/services/feedback.service.spec.ts
new file mode 100644
index 0000000..7aa654b
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/feedback.service.spec.ts
@@ -0,0 +1,28 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestBed } from '@angular/core/testing';
+
+import { FeedbackService } from './feedback.service';
+
+describe('FeedbackService', () => {
+ beforeEach(() => TestBed.configureTestingModule({}));
+
+ it('should be created', () => {
+ const service: FeedbackService = TestBed.get(FeedbackService);
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/services/feedback.service.ts b/otf-frontend/client/src/app/shared/services/feedback.service.ts
new file mode 100644
index 0000000..a42c2f9
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/feedback.service.ts
@@ -0,0 +1,42 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from '@angular/core';
+import {HttpClient} from "@angular/common/http";
+import {CookieService} from "ngx-cookie-service";
+import { Observable } from 'rxjs';
+import { ParamsService } from './params.service';
+import { ModelService } from './model.service';
+import { FeathersService } from './feathers.service';
+
+
+@Injectable({
+ providedIn: 'root'
+})
+export class FeedbackService extends ModelService {
+
+ constructor(http: HttpClient, Params: ParamsService, cookie: CookieService, feathers: FeathersService){
+ super('feedback', http, Params, cookie, feathers);
+ }
+
+ sendFeedback(msg): Observable<Object>{
+ let body = {
+ data: msg,
+ };
+
+ return this.create(body);
+ }
+}
diff --git a/otf-frontend/client/src/app/shared/services/file-transfer.service.spec.ts b/otf-frontend/client/src/app/shared/services/file-transfer.service.spec.ts
new file mode 100644
index 0000000..322ba32
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/file-transfer.service.spec.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestBed, inject } from '@angular/core/testing';
+
+import { FileTransferService } from './file-transfer.service';
+
+describe('FileTransferService', () => {
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ providers: [FileTransferService]
+ });
+ });
+
+ it('should be created', inject([FileTransferService], (service: FileTransferService) => {
+ expect(service).toBeTruthy();
+ }));
+});
diff --git a/otf-frontend/client/src/app/shared/services/file-transfer.service.ts b/otf-frontend/client/src/app/shared/services/file-transfer.service.ts
new file mode 100644
index 0000000..e607895
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/file-transfer.service.ts
@@ -0,0 +1,34 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { ParamsService } from './params.service';
+import { ModelService } from './model.service';
+import { CookieService } from 'ngx-cookie-service';
+import { FeathersService } from './feathers.service';
+
+
+@Injectable({
+ providedIn: 'root'
+})
+export class FileTransferService extends ModelService {
+
+ constructor(http: HttpClient, Params: ParamsService, cookie: CookieService, feathers: FeathersService){
+ super('file-transfer', http, Params, cookie, feathers);
+ }
+
+}
diff --git a/otf-frontend/client/src/app/shared/services/file.service.spec.ts b/otf-frontend/client/src/app/shared/services/file.service.spec.ts
new file mode 100644
index 0000000..3ff1861
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/file.service.spec.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestBed, inject } from '@angular/core/testing';
+
+import { FileService } from './file.service';
+
+describe('FileService', () => {
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ providers: [FileService]
+ });
+ });
+
+ it('should be created', inject([FileService], (service: FileService) => {
+ expect(service).toBeTruthy();
+ }));
+});
diff --git a/otf-frontend/client/src/app/shared/services/file.service.ts b/otf-frontend/client/src/app/shared/services/file.service.ts
new file mode 100644
index 0000000..a46c89d
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/file.service.ts
@@ -0,0 +1,34 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { ParamsService } from './params.service';
+import { ModelService } from './model.service';
+import { CookieService } from 'ngx-cookie-service';
+import { FeathersService } from './feathers.service';
+
+
+@Injectable({
+ providedIn: 'root'
+})
+export class FileService extends ModelService {
+
+ constructor(http: HttpClient, Params: ParamsService, cookie: CookieService, feathers: FeathersService){
+ super('files', http, Params, cookie, feathers);
+ }
+
+}
diff --git a/otf-frontend/client/src/app/shared/services/group.service.spec.ts b/otf-frontend/client/src/app/shared/services/group.service.spec.ts
new file mode 100644
index 0000000..022d977
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/group.service.spec.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestBed, inject } from '@angular/core/testing';
+
+import { GroupService } from './group.service';
+
+describe('GroupService', () => {
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ providers: [GroupService]
+ });
+ });
+
+ it('should be created', inject([GroupService], (service: GroupService) => {
+ expect(service).toBeTruthy();
+ }));
+});
diff --git a/otf-frontend/client/src/app/shared/services/group.service.ts b/otf-frontend/client/src/app/shared/services/group.service.ts
new file mode 100644
index 0000000..477ae92
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/group.service.ts
@@ -0,0 +1,145 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { ParamsService } from './params.service';
+import { ModelService } from './model.service';
+import { CookieService } from 'ngx-cookie-service';
+import { FeathersService } from './feathers.service';
+import { Observable, Subject } from 'rxjs';
+import * as organizeGroups from '../../../../../server/src/feathers/hooks/permissions/get-permissions';
+import { UserService } from './user.service';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class GroupService extends ModelService {
+
+ protected groupList;
+ protected selectedGroup;
+
+ protected groupListChange: Subject<Array<any>> = new Subject<Array<any>>();
+ protected selectedGroupChange: Subject<Object> = new Subject<Object>();
+
+ constructor(http: HttpClient, Params: ParamsService, cookie: CookieService, feathers: FeathersService, private _users: UserService) {
+ super('groups', http, Params, cookie, feathers);
+ this.setUp();
+ }
+ //new edit:
+ public currentUser;
+
+ setUp() {
+ let currentId = window.localStorage.getItem('currentGroupId');
+
+ this.currentUser = JSON.parse(this.cookie.get('currentUser'));
+
+ this.find({ $limit: -1, lookup: 'both' }).subscribe(res => {
+ this.setGroupList(res);
+
+ if (currentId) {
+ this.setGroup(this.groupList.filter(elem => elem._id == currentId)[0]);
+ } else if (this.currentUser.defaultGroup) {
+ this.setGroup(this.groupList.filter(elem => elem._id == this.currentUser.defaultGroup)[0]);
+ }else {
+ //set to first group
+ }
+ },
+ err => {
+ console.log(err);
+ })
+ }
+
+
+
+ getGroup() {
+ return this.selectedGroup;
+ }
+
+ getGroupList() {
+ return this.groupList;
+ }
+
+ setGroup(group: any) {
+ this.selectedGroup = group;
+ window.localStorage.setItem('currentGroupId', group._id);
+ this.selectedGroupChange.next(this.selectedGroup);
+ if (!this.currentUser.defaultGroupEnabled) {
+ let userPatch = {
+ _id: this.currentUser._id,
+ defaultGroup: group._id,
+ defaultGroupEnabled: false
+ };
+
+ this._users.patch(userPatch).subscribe((res) => {
+
+ });
+ }
+ }
+
+ organizeGroups(groups){
+ return organizeGroups(this.currentUser, groups);
+ }
+
+ setGroupList(groups) {
+ this.groupList = organizeGroups(this.currentUser, groups);
+ this.groupListChange.next(this.groupList);
+ }
+
+ listChange(): Subject<Array<any>> {
+ return this.groupListChange;
+ }
+
+ groupChange(): Subject<Object> {
+ return this.selectedGroupChange;
+ }
+
+ format(arr: Array<any>) {
+
+ //puts all groups in a single level array
+ // arr = organizeGroups(this.currentUser, arr);
+
+ var tree = [],
+ mappedArr = {},
+ arrElem,
+ mappedElem;
+
+ // First map the nodes of the array to an object -> create a hash table.
+ for (var i = 0, len = arr.length; i < len; i++) {
+ arrElem = arr[i];
+ mappedArr[arrElem._id] = arrElem;
+ mappedArr[arrElem._id]['children'] = [];
+ }
+
+
+ for (var _id in mappedArr) {
+ if (mappedArr.hasOwnProperty(_id)) {
+ mappedElem = mappedArr[_id];
+ // If the element is not at the root level, add it to its parent array of children.
+ if (mappedElem.parentGroupId) {
+ mappedArr[mappedElem['parentGroupId']]['children'].push(mappedElem);
+ }
+ // If the element is at the root level, add it to first level elements array.
+ else {
+ tree.push(mappedElem);
+ }
+ }
+ }
+ return tree;
+ }
+
+
+}
diff --git a/otf-frontend/client/src/app/shared/services/health.service.spec.ts b/otf-frontend/client/src/app/shared/services/health.service.spec.ts
new file mode 100644
index 0000000..21a0b30
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/health.service.spec.ts
@@ -0,0 +1,28 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestBed } from '@angular/core/testing';
+
+import { HealthService } from './health.service';
+
+describe('HealthService', () => {
+ beforeEach(() => TestBed.configureTestingModule({}));
+
+ it('should be created', () => {
+ const service: HealthService = TestBed.get(HealthService);
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/services/health.service.ts b/otf-frontend/client/src/app/shared/services/health.service.ts
new file mode 100644
index 0000000..3ad80e3
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/health.service.ts
@@ -0,0 +1,37 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from '@angular/core';
+import { ModelService } from './model.service';
+import { HttpClient } from '@angular/common/http';
+import { ParamsService } from './params.service';
+import { CookieService } from 'ngx-cookie-service';
+import { FeathersService } from './feathers.service';
+import { Observable } from 'rxjs';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class HealthService extends ModelService {
+
+ constructor(http: HttpClient, Params: ParamsService, cookie: CookieService, feathers: FeathersService){
+ super('health', http, Params, cookie, feathers);
+ }
+
+ get(id, params?): Observable<any>{
+ return super.call('get', {data: id, params: params}, '/otf/api/health/v1');
+ }
+}
diff --git a/otf-frontend/client/src/app/shared/services/json2html.service.ts b/otf-frontend/client/src/app/shared/services/json2html.service.ts
new file mode 100644
index 0000000..2943c05
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/json2html.service.ts
@@ -0,0 +1,60 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from "@angular/core";
+import { toInteger } from "@ng-bootstrap/ng-bootstrap/util/util";
+
+@Injectable({
+ providedIn: 'root'
+})
+
+export class ToHtml {
+ constructor() {}
+
+ convert(json:any = [{name: 'Adam', age: 23}, {name: 'Raj', age: 22}, {name: 'Justin', age: 5}], tabs = 0){
+ var html = '';
+ var tabHtml = '';
+ if(typeof json === 'string'){
+ json = JSON.parse(json);
+ }
+ for(let i = 0; i < tabs; i++){
+ tabHtml += ' ';
+ }
+ for(let key in json){
+ if(json.hasOwnProperty(key)){
+ if(typeof json[key] === "object"){
+ html += tabHtml + '<b><u>' + key + ':</u></b><br/>';
+ if(json.constructor === Array && toInteger(key) > 0){
+ tabs--;
+ }
+ html += this.convert(json[key], ++tabs);
+ }else{
+ html += tabHtml + '<b><u>' + key + ':</u></b>' + '<br/>';
+ if(typeof json[key] === 'string'){
+ json[key] = json[key].replace(/\\n/g, '<br/>' + tabHtml);
+ }
+ html += tabHtml + json[key] + '<br/>';
+ html += '<br/>';
+ }
+ }
+ }
+ return html;
+ }
+
+ convertString(str){
+ return str.replace(/\\n/g, '<br/>');
+ }
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/services/list.service.spec.ts b/otf-frontend/client/src/app/shared/services/list.service.spec.ts
new file mode 100644
index 0000000..07c5331
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/list.service.spec.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestBed, inject } from '@angular/core/testing';
+
+import { ListService } from './list.service';
+
+describe('TestHeadListService', () => {
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ providers: [ListService]
+ });
+ });
+
+ it('should be created', inject([ListService], (service: ListService) => {
+ expect(service).toBeTruthy();
+ }));
+});
diff --git a/otf-frontend/client/src/app/shared/services/list.service.ts b/otf-frontend/client/src/app/shared/services/list.service.ts
new file mode 100644
index 0000000..aced885
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/list.service.ts
@@ -0,0 +1,77 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable, OnInit } from '@angular/core';
+import { BehaviorSubject } from 'rxjs';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class ListService {
+
+ listMap: {[uniqueKey: string]: {listSource: any, currentList: any} } = {};
+ // private listSource = new BehaviorSubject(null);
+ // currentList = this.listSource.asObservable();
+
+ constructor() { }
+
+ createList(key){
+ this.listMap[key] = {
+ listSource: new BehaviorSubject(null),
+ currentList: null
+ }
+ this.listMap[key].currentList = this.listMap[key].listSource.asObservable();
+ this.listMap[key].listSource.next([]);
+ }
+
+ changeMessage(key, message: any) {
+ if(!this.listMap[key])
+ this.createList(key);
+
+ this.listMap[key].listSource.next(message)
+ }
+
+ addElement(key, obj: any){
+ this.listMap[key].currentList.subscribe(function(value){
+ //console.log(value);
+ value.push(obj);
+ });
+ }
+
+ removeElement(key, object_field_name, id: any){
+ let val = 0;
+ this.listMap[key].currentList.subscribe(function(value){
+ value.forEach(function(elem, val) {
+ if(elem[object_field_name] == id){
+ value.splice(val, 1);
+ }
+ });
+ });
+
+ }
+
+ updateElement(key, object_field_name, id: any, new_object){
+ let val = 0;
+ this.listMap[key].currentList.subscribe(function(value){
+ value.forEach(function(elem, val) {
+ if(elem[object_field_name] == id){
+ value[val] = new_object;
+ }
+ })
+ });
+ }
+
+}
diff --git a/otf-frontend/client/src/app/shared/services/model.service.ts b/otf-frontend/client/src/app/shared/services/model.service.ts
new file mode 100644
index 0000000..745e109
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/model.service.ts
@@ -0,0 +1,211 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { HttpClient, HttpHeaders } from "@angular/common/http";
+import { AppGlobals } from "../../app.global";
+import { ParamsService } from "./params.service";
+import { Observable, observable, from } from "rxjs";
+import { CookieService } from "ngx-cookie-service";
+import { FeathersService } from "./feathers.service";
+import { Injectable } from "@angular/core";
+
+Injectable({
+ providedIn: 'root'
+})
+export class ModelService {
+
+ protected path;
+ protected http: HttpClient;
+ protected Params: ParamsService;
+ protected cookie: CookieService;
+ protected feathers: FeathersService;
+ private authenticated: Boolean = false;
+
+ constructor(endpoint: String, http: HttpClient, Params: ParamsService, cookie: CookieService, feathers: FeathersService) {
+ this.http = http;
+ this.Params = Params;
+ this.path = AppGlobals.baseAPIUrl + endpoint;
+ this.cookie = cookie;
+ this.feathers = feathers;
+ }
+
+ checkAuth(): Observable<Object>{
+ return this.feathers.auth;
+ }
+
+ call(method, data?, path?){
+ if(!path){
+ path = this.path;
+ }
+ return new Observable(observer => {
+ var init = null;
+ if(data.params && data.params.events){
+ delete data.params.events;
+ this.feathers.service(path)
+ .on('created', data => {
+ if(init){
+ if(init.data){
+ (init.data as Array<Object>).unshift(data);
+ observer.next(init);
+ }else{
+ (init as Array<Object>).unshift(data);
+ observer.next(init);
+ }
+ }
+ })
+ .on('removed', data => {
+ if(init){
+ if(init.data){
+ init.data = (init.data as Array<Object>).filter(item => item['_id'] != data._id);
+ observer.next(init);
+ }else{
+ init = (init as Array<Object>).filter(item => item['_id'] != data._id);
+ observer.next(init);
+ }
+ }
+ })
+ .on('updated', data => {
+ if(init){
+ if(init.data){
+ (init.data as Array<Object>).forEach((elem, val) => {
+ if(elem['_id'] == data._id){
+ (init.data as Array<Object>).splice(val, 1, data);
+ return;
+ }
+ })
+ observer.next(init);
+ }else{
+ (init as Array<Object>).forEach((elem, val) => {
+ if(elem['_id'] == data._id){
+ (init as Array<Object>).splice(val, 1, data);
+ return;
+ }
+ })
+ observer.next(init);
+ }
+ }
+ });
+
+ }
+ this.checkAuth().subscribe(res => {
+ if(data.data){
+
+ //UPDATE & PATCH
+ if(method == 'update' || method == 'patch'){
+ let id = data.data._id;
+ delete data.data._id;
+ this.feathers.service(path)[method](id, data.data, {query: data.params}).then(result =>{
+ if(!init){
+ init = result;
+ }
+ observer.next(result)
+ }).catch(err => {
+ observer.error(err)}
+ );
+ }else{
+ this.feathers.service(path)[method](data.data, {query: data.params}).then(result =>{
+ if(!init){
+ init = result;
+ }
+ observer.next(result)
+ }).catch(err => {
+ observer.error(err)
+ });
+ }
+ }else{
+ this.feathers.service(path)[method]({query: data.params}).then(result =>{
+ if(!init){
+ init = result;
+ }
+ observer.next(result)
+ }).catch(err => observer.error(err));
+ }
+
+ }, err => {
+
+ this.feathers.authenticate().subscribe(res => {
+ observer.next(this.call(method, data, path));
+ })
+ });
+ })
+ }
+
+ on(event){
+ return new Observable(observer => {
+ this.feathers.service(this.path).on(event, (data) => {
+ observer.next(data);
+ });
+ })
+ }
+
+ // sfind(params = []): Observable<Object> {
+ // return this.http.get(this.path + this.Params.toString(params), this.getHttpOptions());
+ // }
+
+ find(params?): Observable<Object> {
+
+ return this.call('find', {params: params})
+ }
+
+ // sget(id, params = []): Observable<Object> {
+ // return from(this.http.get(this.path + '/' + id + this.Params.toString(params), this.getHttpOptions()));
+ // }
+
+ get(id, params?): Observable<Object> {
+ return this.call('get', {data: id, params: params})
+ }
+
+ // create(data, params = []): Observable<Object> {
+ // return this.http.post(this.path + this.Params.toString(params), data, this.getHttpOptions());
+ // }
+
+ create(data, params?): Observable<Object> {
+ return this.call('create', {data: data, params: params})
+ }
+
+ // update(data, params = []): Observable<Object> {
+ // return this.http.put(this.path + '/' + data._id + this.Params.toString(params), data, this.getHttpOptions());
+ // }
+
+ update(data, params?): Observable<Object> {
+ return this.call('update', {data: data, params: params})
+ }
+
+ // patch(data, params = []): Observable<Object> {
+ // return this.http.patch(this.path + '/' + data._id + this.Params.toString(params), data, this.getHttpOptions());
+ // }
+
+ patch(data, params?): Observable<Object> {
+ return this.call('patch', {data: data, params: params})
+ }
+
+ // delete(id, params = []): Observable<Object> {
+ // return this.http.delete(this.path + '/' + id + this.Params.toString(params), this.getHttpOptions());
+ // }
+
+ delete(id, params?): Observable<Object> {
+ return this.call('remove', {data: id, params: params})
+ }
+
+ protected getHttpOptions() {
+ return {
+ headers: new HttpHeaders({
+ 'Authorization': 'Bearer ' + JSON.parse(this.cookie.get('access_token'))
+ })
+ };
+ }
+
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/services/params.service.ts b/otf-frontend/client/src/app/shared/services/params.service.ts
new file mode 100644
index 0000000..cbff2dd
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/params.service.ts
@@ -0,0 +1,32 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from "@angular/core";
+
+
+@Injectable({
+ providedIn: 'root'
+})
+export class ParamsService {
+
+ toString(params = []) {
+ var string = "?";
+ params.forEach(elem => {
+ string += elem + '&&';
+ });
+ return string;
+ }
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/services/scheduling.service.spec.ts b/otf-frontend/client/src/app/shared/services/scheduling.service.spec.ts
new file mode 100644
index 0000000..4c0f573
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/scheduling.service.spec.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestBed, inject } from '@angular/core/testing';
+
+import { SchedulingService } from './scheduling.service';
+
+describe('SchedulingService', () => {
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ providers: [SchedulingService]
+ });
+ });
+
+ it('should be created', inject([SchedulingService], (service: SchedulingService) => {
+ expect(service).toBeTruthy();
+ }));
+});
diff --git a/otf-frontend/client/src/app/shared/services/scheduling.service.ts b/otf-frontend/client/src/app/shared/services/scheduling.service.ts
new file mode 100644
index 0000000..b492ea6
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/scheduling.service.ts
@@ -0,0 +1,58 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { HttpClient, HttpHeaders } from "@angular/common/http";
+import { AppGlobals } from "../../app.global";
+import { ParamsService } from "./params.service";
+import { Observable } from "rxjs";
+import { Injectable } from "@angular/core";
+import { ModelService } from './model.service';
+import { CookieService } from "ngx-cookie-service";
+import { TestInstanceService } from "./test-instance.service";
+import { MatDialog } from "@angular/material";
+import { TestDefinitionService } from "./test-definition.service";
+import { ExecuteService } from "./execute.service";
+import { FeathersService } from "./feathers.service";
+
+@Injectable({
+ providedIn: 'root'
+})
+
+export class SchedulingService extends ModelService {
+
+ constructor(http: HttpClient, Params: ParamsService, cookie: CookieService, feathers: FeathersService, private td: TestDefinitionService, private instance: TestInstanceService, private execute: ExecuteService, private dialog: MatDialog) {
+ super('jobs', http, Params, cookie, feathers);
+ }
+
+ // create(data, params?): Observable<Object> {
+ // return new Observable((observer) => {
+ // this.instance.get(data.testInstanceId, { $select: ['testData'] }).subscribe(result => {
+ // if(result){
+ // super.create(data).subscribe(
+ // res => {
+ // observer.next(res);
+ // },
+ // err => {
+ // observer.error(err);
+ // }
+ // )
+ // }
+ // });
+ // });
+ // }
+
+
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/services/test-definition.service.spec.ts b/otf-frontend/client/src/app/shared/services/test-definition.service.spec.ts
new file mode 100644
index 0000000..ef6f5e7
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/test-definition.service.spec.ts
@@ -0,0 +1,28 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestBed } from '@angular/core/testing';
+
+import { TestDefinitionService } from './test-definition.service';
+
+describe('TestDefinitionService', () => {
+ beforeEach(() => TestBed.configureTestingModule({}));
+
+ it('should be created', () => {
+ const service: TestDefinitionService = TestBed.get(TestDefinitionService);
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/shared/services/test-definition.service.ts b/otf-frontend/client/src/app/shared/services/test-definition.service.ts
new file mode 100644
index 0000000..100696d
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/test-definition.service.ts
@@ -0,0 +1,89 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { AppGlobals } from '../../app.global';
+import { Observable } from 'rxjs';
+import { ParamsService } from './params.service';
+import { CookieService } from 'ngx-cookie-service';
+import { ModelService } from './model.service';
+import { FeathersService } from './feathers.service';
+import { GroupService } from './group.service';
+
+
+
+@Injectable({
+ providedIn: 'root'
+})
+
+export class TestDefinitionService extends ModelService {
+
+ constructor(http: HttpClient, Params: ParamsService, cookie: CookieService, feathers: FeathersService, private _groups: GroupService) {
+ super('test-definitions', http, Params, cookie, feathers);
+ this.deployAll();
+ }
+
+ create(data, params?): Observable<Object>{
+ this.setGroup(data);
+ return super.create(data, params);
+ }
+
+ validate(testDefinition): Observable<Object> {
+ return this.call('create', {data: { testDefinition: testDefinition } }, AppGlobals.baseAPIUrl + 'bpmn-validate')
+ //return this.http.post(AppGlobals.baseAPIUrl + 'bpmn-validate', {testDefinition: testDefinition}, this.getHttpOptions());
+ }
+
+ validateSave(testDefinition): Observable<Object> {
+ return this.call('update', { data: {_id: null, testDefinition: testDefinition } }, AppGlobals.baseAPIUrl + 'bpmn-validate')
+ //return this.http.put(AppGlobals.baseAPIUrl + 'bpmn-validate', {testDefinition: testDefinition}, this.getHttpOptions());
+ }
+
+ check(processDefinitionKey): Observable<Object>{
+ return this.call('get', {data: processDefinitionKey} , AppGlobals.baseAPIUrl + 'bpmn-validate')
+ //return this.http.get(AppGlobals.baseAPIUrl + 'bpmn-validate/' + processDefinitionKey, this.getHttpOptions());
+ }
+
+ deploy(testDefinition, versionName?): Observable<Object> {
+ let data = {testDefinition: testDefinition};
+
+ if(versionName != null && versionName != undefined){
+ data['version'] = versionName;
+ }
+ return this.call('create', {data: data }, AppGlobals.baseAPIUrl + 'bpmn-upload')
+ //return this.http.post(AppGlobals.baseAPIUrl + 'bpmn-upload', {testDefinition: testDefinition}, this.getHttpOptions());
+ }
+
+ deployAll(){
+ // this.find({$limit: -1}).subscribe(definitions => {
+ // //definitions = definitions['data'];
+ // (definitions as Array<Object>).forEach((elem, val) => {
+ // elem['bpmnInstances'].forEach((e , v) => {
+ // let el = e;
+ // this.deploy(elem, el.version).subscribe(res => {
+ // console.log(res);
+ // });
+ // })
+ // })
+ // })
+ }
+
+ private setGroup(data){
+ if(!data['groupId']){
+ data['groupId'] = this._groups.getGroup()['_id'];
+ }
+ }
+}
diff --git a/otf-frontend/client/src/app/shared/services/test-execution.service.spec.ts b/otf-frontend/client/src/app/shared/services/test-execution.service.spec.ts
new file mode 100644
index 0000000..5b55bfd
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/test-execution.service.spec.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestBed, inject } from '@angular/core/testing';
+
+import { TestExecutionService } from './test-execution.service';
+
+describe('TestExecutionService', () => {
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ providers: [TestExecutionService]
+ });
+ });
+
+ it('should be created', inject([TestExecutionService], (service: TestExecutionService) => {
+ expect(service).toBeTruthy();
+ }));
+});
diff --git a/otf-frontend/client/src/app/shared/services/test-execution.service.ts b/otf-frontend/client/src/app/shared/services/test-execution.service.ts
new file mode 100644
index 0000000..9187c9d
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/test-execution.service.ts
@@ -0,0 +1,38 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { AppGlobals } from '../../app.global';
+import { ParamsService } from './params.service';
+import { ModelService } from './model.service';
+import { CookieService } from 'ngx-cookie-service';
+import { FeathersService } from './feathers.service';
+
+@Injectable({
+providedIn: 'root'
+})
+export class TestExecutionService extends ModelService {
+
+ constructor(http: HttpClient, Params: ParamsService, cookie: CookieService, feathers: FeathersService) {
+ super('test-executions', http, Params, cookie, feathers);
+ }
+
+ status(id, params?){
+ return this.call('get', {data: id, params: params}, AppGlobals.baseAPIUrl + 'test-execution-status')
+ //return this.http.get(AppGlobals.baseAPIUrl + 'test-execution-status/' + id + this.Params.toString(params), this.getHttpOptions());
+ }
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/shared/services/test-head.service.spec.ts b/otf-frontend/client/src/app/shared/services/test-head.service.spec.ts
new file mode 100644
index 0000000..6ed1666
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/test-head.service.spec.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestBed, inject } from '@angular/core/testing';
+
+import { TestHeadService } from './test-head.service';
+
+describe('TestHeadService', () => {
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ providers: [TestHeadService]
+ });
+ });
+
+ it('should be created', inject([TestHeadService], (service: TestHeadService) => {
+ expect(service).toBeTruthy();
+ }));
+});
diff --git a/otf-frontend/client/src/app/shared/services/test-head.service.ts b/otf-frontend/client/src/app/shared/services/test-head.service.ts
new file mode 100644
index 0000000..ad07560
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/test-head.service.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { ParamsService } from './params.service';
+import { ModelService } from './model.service';
+import { CookieService } from 'ngx-cookie-service';
+import { FeathersService } from './feathers.service';
+import { Observable } from 'rxjs';
+import { GroupService } from './group.service';
+
+
+@Injectable({
+ providedIn: 'root'
+})
+export class TestHeadService extends ModelService {
+
+ constructor(http: HttpClient, Params: ParamsService, cookie: CookieService, feathers: FeathersService, private _groups: GroupService){
+ super('test-heads', http, Params, cookie, feathers);
+ }
+
+ create(data, params?): Observable<Object> {
+ data['groupId'] = this._groups.getGroup()['_id'];
+ return super.create(data, params);
+ }
+
+}
diff --git a/otf-frontend/client/src/app/shared/services/test-instance.service.spec.ts b/otf-frontend/client/src/app/shared/services/test-instance.service.spec.ts
new file mode 100644
index 0000000..c1319cc
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/test-instance.service.spec.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestBed, inject } from '@angular/core/testing';
+
+import { TestInstanceService } from './test-instance.service';
+
+describe('TestInstanceService', () => {
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ providers: [TestInstanceService]
+ });
+ });
+
+ it('should be created', inject([TestInstanceService], (service: TestInstanceService) => {
+ expect(service).toBeTruthy();
+ }));
+});
diff --git a/otf-frontend/client/src/app/shared/services/test-instance.service.ts b/otf-frontend/client/src/app/shared/services/test-instance.service.ts
new file mode 100644
index 0000000..02b82ba
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/test-instance.service.ts
@@ -0,0 +1,41 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { ParamsService } from './params.service';
+import { ModelService } from './model.service';
+import { CookieService } from 'ngx-cookie-service';
+import { FeathersService } from './feathers.service';
+import { Observable } from 'rxjs';
+import { GroupService } from './group.service';
+
+@Injectable({
+providedIn: 'root'
+})
+export class TestInstanceService extends ModelService {
+
+ constructor(http: HttpClient, Params: ParamsService, cookie: CookieService, feathers: FeathersService, private _groups: GroupService){
+ super('test-instances', http, Params, cookie, feathers);
+ }
+
+ create(data, params?):Observable<Object>{
+ data['groupId'] = this._groups.getGroup()['_id'];
+ return super.create(data, params);
+ }
+}
+
+
diff --git a/otf-frontend/client/src/app/shared/services/user.service.spec.ts b/otf-frontend/client/src/app/shared/services/user.service.spec.ts
new file mode 100644
index 0000000..a7662e7
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/user.service.spec.ts
@@ -0,0 +1,31 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { TestBed, inject } from '@angular/core/testing';
+
+import { UserService } from './user.service';
+
+describe('UserService', () => {
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ providers: [UserService]
+ });
+ });
+
+ it('should be created', inject([UserService], (service: UserService) => {
+ expect(service).toBeTruthy();
+ }));
+});
diff --git a/otf-frontend/client/src/app/shared/services/user.service.ts b/otf-frontend/client/src/app/shared/services/user.service.ts
new file mode 100644
index 0000000..0209ab5
--- /dev/null
+++ b/otf-frontend/client/src/app/shared/services/user.service.ts
@@ -0,0 +1,75 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { map } from 'rxjs/operators';
+import { ModelService } from './model.service';
+import { ParamsService } from './params.service';
+import { CookieService } from 'ngx-cookie-service';
+import { FeathersService } from './feathers.service';
+import { Ability } from '@casl/ability';
+
+
+@Injectable({
+ providedIn: 'root'
+})
+export class UserService extends ModelService {
+
+ public ability: Ability;
+
+ constructor(http: HttpClient, Params: ParamsService, cookie: CookieService, private c: CookieService, feathers: FeathersService){
+ super('users', http, Params, cookie, feathers);
+ this.ability = new Ability(JSON.parse(localStorage.getItem('user_rules')));
+ }
+
+ getId(){
+ return JSON.parse(this.cookie.get('currentUser'))._id;
+ }
+
+ // addFavorite(ref: string, id: string){
+ // return this.get(this.getId()).pipe(map(
+ // result => {
+ // if(!result['favorites']){
+ // result['favorites'] = {};
+ // }
+ // if(!result['favorites'][ref]){
+ // result['favorites'][ref] = [];
+ // }
+ // result['favorites'][ref].push(id);
+ // result['favorites'][ref] = Array.from(new Set(result['favorites'][ref]));
+ // this.patch(result).subscribe();
+ // }
+ // ));
+ // }
+
+ // removeFavorite(ref: string, id: string){
+ // return this.get(this.getId()).pipe(map(
+ // result => {
+ // result['favorites'][ref].splice( result['favorites'][ref].indexOf(id), 1 );
+ // this.patch(result).subscribe();
+ // }
+ // ));
+ // }
+
+ enableUser(id: string, enabled: boolean){
+ return this.patch({
+ "_id" : id,
+ "enabled": enabled
+ })
+
+ }
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/app/signup/signup-routing.module.ts b/otf-frontend/client/src/app/signup/signup-routing.module.ts
new file mode 100644
index 0000000..50882e0
--- /dev/null
+++ b/otf-frontend/client/src/app/signup/signup-routing.module.ts
@@ -0,0 +1,32 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { SignupComponent } from './signup.component';
+
+const routes: Routes = [
+ {
+ path: '', component: SignupComponent
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class SignupRoutingModule {
+}
diff --git a/otf-frontend/client/src/app/signup/signup.component.html b/otf-frontend/client/src/app/signup/signup.component.html
new file mode 100644
index 0000000..a21c72e
--- /dev/null
+++ b/otf-frontend/client/src/app/signup/signup.component.html
@@ -0,0 +1,68 @@
+<!-- Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+#############################################################################-->
+
+
+<div class="login-page" [@routerTransition]>
+ <div class="row justify-content-md-center">
+ <div class="col-md-4">
+ <img class="user-avatar" src="assets/images/NetworkLogo.jpg" width="150px" />
+ <h1>Open Test Framework</h1>
+ <form role="form">
+ <div class="form-content">
+ <div class="row justify-content-md-center">
+ <div class="col-md-6">
+ <div class="form-group">
+ <input type="text" required [(ngModel)]="user.firstName" name="firstName" class="form-control input-underline input-lg" id="" placeholder="First Name">
+ </div>
+
+ <div class="form-group">
+ <input type="text" required [(ngModel)]="user.lastName" name="lastName" class="form-control input-underline input-lg" id="" placeholder="Last Name">
+ </div>
+
+ <div class="form-group">
+ <input type="email" required [(ngModel)]="user.email" name="email" class="form-control input-underline input-lg" id="" #email="ngModel" placeholder="Email">
+ </div>
+ <div *ngIf="email.invalid && (email.dirty || email.touched)"
+ class="alert-danger">
+ <div *ngIf="email.errors.required">
+ Email is required.
+ </div>
+ </div>
+ </div>
+ <div class="col-md-6">
+
+ <div class="form-group">
+ <input type="password" required minlength="8" [(ngModel)]="user.password" name="password" class="form-control input-underline input-lg" id="password1" #password="ngModel" placeholder="Password">
+ </div>
+ <div *ngIf="password.invalid && (password.dirty || password.touched)"
+ class="alert-danger">
+ <div *ngIf="password.errors.required">
+ Password is required.
+ </div>
+ <div *ngIf="password.errors.minlength">
+ Password must be at least 8 characters long.
+ </div>
+ </div>
+ <div class="form-group">
+ <input type="password" required [(ngModel)]="passwordConfirm" name="passwordConfirm" class="form-control input-underline input-lg" id="password2" placeholder="Repeat Password">
+ </div>
+ </div>
+ </div>
+ </div>
+ <a class="btn rounded-btn" (click)='register()'> Register </a>
+ </form>
+ </div>
+ </div>
+</div>
diff --git a/otf-frontend/client/src/app/signup/signup.component.scss b/otf-frontend/client/src/app/signup/signup.component.scss
new file mode 100644
index 0000000..faabd34
--- /dev/null
+++ b/otf-frontend/client/src/app/signup/signup.component.scss
@@ -0,0 +1,18 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+// shared css for the login and signup page
+@import "../login/login.component.scss";
diff --git a/otf-frontend/client/src/app/signup/signup.component.spec.ts b/otf-frontend/client/src/app/signup/signup.component.spec.ts
new file mode 100644
index 0000000..e64435d
--- /dev/null
+++ b/otf-frontend/client/src/app/signup/signup.component.spec.ts
@@ -0,0 +1,48 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { async, ComponentFixture, TestBed } from '@angular/core/testing'
+import { RouterTestingModule } from '@angular/router/testing'
+import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
+
+import { SignupComponent } from './signup.component'
+import { SignupModule } from './signup.module'
+
+describe('SignupComponent', () => {
+ let component: SignupComponent
+ let fixture: ComponentFixture<SignupComponent>
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ imports: [
+ SignupModule,
+ RouterTestingModule,
+ BrowserAnimationsModule,
+ ],
+ })
+ .compileComponents()
+ }))
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SignupComponent)
+ component = fixture.componentInstance
+ fixture.detectChanges()
+ })
+
+ it('should create', () => {
+ expect(component).toBeTruthy()
+ })
+})
diff --git a/otf-frontend/client/src/app/signup/signup.component.ts b/otf-frontend/client/src/app/signup/signup.component.ts
new file mode 100644
index 0000000..85893e9
--- /dev/null
+++ b/otf-frontend/client/src/app/signup/signup.component.ts
@@ -0,0 +1,102 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { Component, OnInit } from '@angular/core';
+import { routerTransition } from '../router.animations';
+import { HttpClient } from '@angular/common/http';
+import { AppGlobals } from '../app.global';
+import { UserService } from '../shared/services/user.service';
+import { Router } from '@angular/router';
+import { User } from '../shared/models/user.model';
+import { MatDialog } from '@angular/material';
+import { AlertModalComponent } from '../shared/modules/alert-modal/alert-modal.component';
+import { AuthService } from '../shared/services/auth.service';
+
+
+@Component({
+ selector: 'app-signup',
+ templateUrl: './signup.component.html',
+ styleUrls: ['./signup.component.scss'],
+ animations: [routerTransition()]
+})
+export class SignupComponent implements OnInit {
+ public user = {
+ password: null,
+ firstName: null,
+ lastName: null,
+ email: null
+ };
+ public passwordConfirm;
+
+ constructor(public router: Router,
+ private auth: AuthService,
+ public dialog: MatDialog
+ ) {
+
+ }
+
+ ngOnInit() {
+
+ }
+
+ register(){
+ // let body = {
+ // firstName: this.user.firstName,
+ // lastName: this.user.lastName,
+ // email: this.user.email,
+ // password: this.user.password
+ // };
+
+ if(this.user.password != this.passwordConfirm){
+ const dialogRef = this.dialog.open(AlertModalComponent, {
+ data:{
+ type: "Alert",
+ message: "Passwords must match!"
+ }
+
+ });
+
+ return;
+ }
+
+ this.auth.register(this.user)
+ .subscribe(
+ (res) => {
+ const r = this.dialog.open(AlertModalComponent, {
+ data: {
+ type: "Alert",
+ message: "Check your email to verify your account."
+ }
+ });
+
+ r.afterClosed().subscribe(res => {
+ this.router.navigateByUrl('/login');
+ })
+
+ },
+ (err) => {
+ this.dialog.open(AlertModalComponent, {
+ data:{
+ type: "Alert",
+ message: err
+ }
+ });
+ }
+ );
+
+
+ }
+}
diff --git a/otf-frontend/client/src/app/signup/signup.module.spec.ts b/otf-frontend/client/src/app/signup/signup.module.spec.ts
new file mode 100644
index 0000000..9b532fd
--- /dev/null
+++ b/otf-frontend/client/src/app/signup/signup.module.spec.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { SignupModule } from './signup.module';
+
+describe('SignupModule', () => {
+ let signupModule: SignupModule;
+
+ beforeEach(() => {
+ signupModule = new SignupModule();
+ });
+
+ it('should create an instance', () => {
+ expect(signupModule).toBeTruthy();
+ });
+});
diff --git a/otf-frontend/client/src/app/signup/signup.module.ts b/otf-frontend/client/src/app/signup/signup.module.ts
new file mode 100644
index 0000000..a9d2ffa
--- /dev/null
+++ b/otf-frontend/client/src/app/signup/signup.module.ts
@@ -0,0 +1,40 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+import { SignupRoutingModule } from './signup-routing.module';
+import { SignupComponent } from './signup.component';
+import { HttpClientModule } from '@angular/common/http';
+import { AppGlobals } from '../app.global';
+import { MatDialogModule, MatButtonModule } from '@angular/material';
+import { AlertModalModule } from '../shared/modules/alert-modal/alert-modal.module';
+
+
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ MatDialogModule,
+ MatButtonModule,
+ SignupRoutingModule,
+ AlertModalModule
+ ],
+ declarations: [SignupComponent]
+})
+export class SignupModule { }
diff --git a/otf-frontend/client/src/assets/fakedata.json b/otf-frontend/client/src/assets/fakedata.json
new file mode 100644
index 0000000..80494b9
--- /dev/null
+++ b/otf-frontend/client/src/assets/fakedata.json
@@ -0,0 +1,115 @@
+{
+ "test_heads": [
+ {
+ "test_head_id": 1,
+ "test_head_name": "test1",
+ "description": "Ping Test 1"
+ },
+ {
+ "test_head_id": 2,
+ "test_head_name": "test2",
+ "description": "Ping Test 2"
+ },
+ {
+ "test_head_id": 3,
+ "test_head_name": "test3",
+ "description": "Ping Test 3"
+ },
+ {
+ "test_head_id": 4,
+ "test_head_name": "test4",
+ "description": "Ping Test 4"
+ },
+ {
+ "test_head_id": 5,
+ "test_head_name": "test5",
+ "description": "Ping Test 5"
+ }
+ ],
+ "test_strategies": [
+ {
+ "test_strategy_id": 1,
+ "test_strategy_name": "strategy1",
+ "description": "Recursive Test 1",
+ "vth_nodes": [
+ "node1",
+ "node2"
+ ]
+ },
+ {
+ "test_strategy_id": 2,
+ "test_strategy_name": "strategy2",
+ "description": "Recursive Test 2",
+ "vth_nodes": [
+ "node1"
+ ]
+ },
+ {
+ "test_strategy_id": 3,
+ "test_strategy_name": "strategy3",
+ "description": "Recursive Test 3",
+ "vth_nodes": [
+ "node1",
+ "node2",
+ "node3",
+ "node4"
+ ]
+ }
+ ],
+ "tests": [
+ {
+ "test_id": 1,
+ "test_name": "Test 1",
+ "creator": 1,
+ "vts": 3,
+ "vth_list": {
+ "node1": 1,
+ "node2": 2,
+ "node3": 3,
+ "node4": 5
+ },
+ "vts_list": [
+
+ ]
+ },
+ {
+ "test_id": 2,
+ "test_name": "Test 2",
+ "creator": 2,
+ "vts": 2,
+ "vth_list": {
+ "node1": 3
+ },
+ "vts_list": [
+
+ ]
+ },
+ {
+ "test_id": 3,
+ "test_name": "Test 3",
+ "creator": 1,
+ "vts": 1,
+ "vth_list": {
+ "node1": 1,
+ "node2": 4
+ },
+ "vts_list": [
+
+ ]
+ }
+ ],
+ "users": [
+ {
+ "user_id": 1,
+ "firstName": "Adam",
+ "lastName": "Ordway",
+ "email": "agordway@gmail.com"
+ },
+ {
+ "user_id": 2,
+ "firstName": "Justin",
+ "lastName": "Meilinger",
+ "email": "mylinger@gmail.com"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/assets/i18n/de.json b/otf-frontend/client/src/assets/i18n/de.json
new file mode 100644
index 0000000..1936596
--- /dev/null
+++ b/otf-frontend/client/src/assets/i18n/de.json
@@ -0,0 +1,32 @@
+{
+ "Dashboard": "Dashboard",
+ "Charts": "Graphen",
+ "Tables": "Tabellen",
+ "Forms": "Formulare",
+ "Bootstrap Element": "Bootstrap Element",
+ "Bootstrap Grid": "Bootstrap Grid",
+ "Component": "Komponente",
+ "Menu": "Menü",
+ "Submenu": "Submenü",
+ "Blank Page": "Leere Seite",
+ "More Theme": "Mehr Themes",
+ "Download Now": "Jetzt runterladen",
+ "Language": "Sprache",
+ "English": "Englisch",
+ "French": "Französisch",
+ "Urdu": "Urdu",
+ "Spanish": "Spanisch",
+ "Italian": "Italienisch",
+ "Farsi": "Farsi",
+ "German": "Deutsch",
+ "Simplified Chinese": "Vereinfachtes Chinesisch",
+ "Search" : "Suchen",
+ "Settings" : "Einstellungen",
+ "Profile" : "Profil",
+ "Inbox" : "Posteingang",
+ "Log Out" : "Ausloggen",
+ "Pending Task" : "Ausstehende Aufgabe",
+ "In queue" : "In der Warteschlange",
+ "Mail" : "Post",
+ "View All" : "Alle Anzeigen"
+}
diff --git a/otf-frontend/client/src/assets/i18n/en.json b/otf-frontend/client/src/assets/i18n/en.json
new file mode 100644
index 0000000..2b3776f
--- /dev/null
+++ b/otf-frontend/client/src/assets/i18n/en.json
@@ -0,0 +1,32 @@
+{
+ "Dashboard": "Dashboard",
+ "Charts": "Charts",
+ "Tables": "Tables",
+ "Forms": "Forms",
+ "Bootstrap Element": "Bootstrap Element",
+ "Bootstrap Grid": "Bootstrap Grid",
+ "Component": "Component",
+ "Menu": "Menu",
+ "Submenu": "Submenu",
+ "Blank Page": "Blank Page",
+ "More Theme": "More Themes",
+ "Download Now": "Download Now",
+ "Language": "Language",
+ "English": "English",
+ "French": "French",
+ "Urdu": "Urdu",
+ "Spanish": "Spanish",
+ "Italian": "Italian",
+ "Farsi": "Farsi",
+ "German": "German",
+ "Simplified Chinese": "Simplified Chinese",
+ "Search" : "Search",
+ "Settings" : "Settings",
+ "Profile" : "Profile",
+ "Inbox" : "Inbox",
+ "Log Out" : "Log Out",
+ "Pending Task" : "Pending Task",
+ "In queue" : "In queue",
+ "Mail" : "Mail",
+ "View All" : "View All"
+}
diff --git a/otf-frontend/client/src/assets/i18n/es.json b/otf-frontend/client/src/assets/i18n/es.json
new file mode 100644
index 0000000..a225b5f
--- /dev/null
+++ b/otf-frontend/client/src/assets/i18n/es.json
@@ -0,0 +1,32 @@
+{
+ "Dashboard": "Principal",
+ "Charts": "Caracteres",
+ "Tables": "Tablas",
+ "Forms": "Formularios",
+ "Bootstrap Element": "Elementos Bootstrap",
+ "Bootstrap Grid": "Rejilla Bootstrap",
+ "Component": "Componentes",
+ "Menu": "Menú",
+ "Submenu": "Submenú",
+ "Blank Page": "Página en Blanco",
+ "More Theme": "Más temas",
+ "Download Now": "Descarga Ahora",
+ "Language": "Idioma",
+ "English": "Inglés",
+ "French": "Francés",
+ "Urdu": "Urdu",
+ "Spanish": "Español",
+ "Italian": "Italiano",
+ "Farsi": "Farsi",
+ "German": "Alemán",
+ "Simplified Chinese": "Chino simplificado",
+ "Search" : "Búsqueda",
+ "Settings" : "Ajustes",
+ "Profile" : "Profile",
+ "Inbox" : "Bandeja de entrada",
+ "Log Out" : "Cerrar Sesión",
+ "Pending Task" : "Tarea pendiente",
+ "In queue" : "En cola",
+ "Mail" : "Correo",
+ "View All" : "Ver todo"
+}
diff --git a/otf-frontend/client/src/assets/i18n/fa.json b/otf-frontend/client/src/assets/i18n/fa.json
new file mode 100644
index 0000000..508095a
--- /dev/null
+++ b/otf-frontend/client/src/assets/i18n/fa.json
@@ -0,0 +1,32 @@
+{
+ "Dashboard": "داشبورد",
+ "Charts": "چارت ها",
+ "Tables": "جداول",
+ "Forms": "فرم ها",
+ "Bootstrap Element": "عناصر بوتسترپ",
+ "Bootstrap Grid": "جداول بوتسترپ",
+ "Component": "کامپوننت",
+ "Menu": "منوها",
+ "Submenu": "زیر منوها",
+ "Blank Page": "صفحه خالی",
+ "More Theme": "تم های بیشتر",
+ "Download Now": "دانلود",
+ "Language": "زبان",
+ "English": "انگلیسی",
+ "French": "فرانسوی",
+ "Urdu": "اردو",
+ "Spanish": "اسپانیایی",
+ "Italian": "ایتالیایی",
+ "Farsi": "فارسی",
+ "German": "آلمانی",
+ "Simplified Chinese": "چینی ساده شده",
+ "Search" : "جستجو",
+ "Settings" : "تنظیمات",
+ "Profile" : "مشخصات",
+ "Inbox" : "صندوق ورودی",
+ "Log Out" : "خروج از سیستم",
+ "Pending Task" : "وظایف در انتظار",
+ "In queue" : "در صف",
+ "Mail" : "ایمیل",
+ "View All" : "نمایش همه"
+}
diff --git a/otf-frontend/client/src/assets/i18n/fr.json b/otf-frontend/client/src/assets/i18n/fr.json
new file mode 100644
index 0000000..7e27a4f
--- /dev/null
+++ b/otf-frontend/client/src/assets/i18n/fr.json
@@ -0,0 +1,32 @@
+{
+ "Dashboard": "Tableau de bord",
+ "Charts": "Hit-parade",
+ "Tables": "Tableaux",
+ "Forms": "Froms",
+ "Bootstrap Element": "Bootstrap Élément",
+ "Bootstrap Grid": "Bootstrap Grille",
+ "Component": "Composant",
+ "Menu": "Menu",
+ "Submenu": "Sous-menu",
+ "Blank Page": "Blanc Page",
+ "More Theme": "Plus Thèmes",
+ "Download Now": "Télécharger",
+ "Language": "Langue",
+ "English": "Anglais",
+ "French": "Français",
+ "Urdu": "Ourdou",
+ "Spanish": "Spanish",
+ "Italian": "Italien",
+ "Farsi": "Farsi",
+ "German": "Allemand",
+ "Simplified Chinese": "Chinois Simplifié",
+ "Search" : "Chercher",
+ "Settings" : "Paramètres",
+ "Profile" : "Profile",
+ "Inbox" : "Boîte de réception",
+ "Log Out" : "Connectez - Out",
+ "Pending Task" : "Tâche en attente",
+ "In queue" : "Dans la queue",
+ "Mail" : "Courrier",
+ "View All" : "Voir tout"
+}
diff --git a/otf-frontend/client/src/assets/i18n/it.json b/otf-frontend/client/src/assets/i18n/it.json
new file mode 100644
index 0000000..8ee3ae3
--- /dev/null
+++ b/otf-frontend/client/src/assets/i18n/it.json
@@ -0,0 +1,32 @@
+{
+ "Dashboard": "Principale",
+ "Charts": "Grafici",
+ "Tables": "Tabelle",
+ "Forms": "Formulari",
+ "Bootstrap Element": "Elementi Bootstrap",
+ "Bootstrap Grid": "Griglia Bootstrap",
+ "Component": "Componenti",
+ "Menu": "Menu",
+ "Submenu": "Submenu",
+ "Blank Page": "Pagina in Bianco",
+ "More Theme": "Altri temi",
+ "Download Now": "Scarica Adesso",
+ "Language": "Lingua",
+ "English": "Inglese",
+ "French": "Francese",
+ "Urdu": "Urdu",
+ "Spanish": "Spagnolo",
+ "Italian": "Italiano",
+ "Farsi": "Farsi",
+ "German": "Tedesco",
+ "Simplified Chinese": "Cinese semplificato",
+ "Search" : "Ricerca",
+ "Settings" : "Impostazioni",
+ "Profile" : "Profilo",
+ "Inbox" : "Posta in arrivo",
+ "Log Out" : "Uscire",
+ "Pending Task" : "Attività in sospeso",
+ "In queue" : "In coda",
+ "Mail" : "Posta",
+ "View All" : "Visualizza tutti"
+}
diff --git a/otf-frontend/client/src/assets/i18n/ur.json b/otf-frontend/client/src/assets/i18n/ur.json
new file mode 100644
index 0000000..0fd04f3
--- /dev/null
+++ b/otf-frontend/client/src/assets/i18n/ur.json
@@ -0,0 +1,32 @@
+{
+ "Dashboard": "داشبورد",
+ "Charts": "چارت ها",
+ "Tables": "جداول",
+ "Forms": "فرم ها",
+ "Bootstrap Element": "عنصر بوتسترپ",
+ "Bootstrap Grid": "جدول بوتسترپ",
+ "Component": "کامپوننت",
+ "Menu": "منو",
+ "Submenu": "زیر منو",
+ "Blank Page": "صفحه خالی",
+ "More Theme": "تم های بیشتر",
+ "Download Now": "دانلود",
+ "Language": "زبان",
+ "English": "انگریزی",
+ "French": "فرانسیسی",
+ "Urdu": "اردو",
+ "Spanish": "ہسپانوی",
+ "Italian": "اطالوی",
+ "Farsi": "فارسی",
+ "German": "جرمن",
+ "Simplified Chinese": "چینی چینی",
+ "Search" : "تلاش کریں",
+ "Settings" : "ترتیبات",
+ "Profile" : "پروفائل",
+ "Inbox" : "ان باکس",
+ "Log Out" : "لاگ آوٹ",
+ "Pending Task" : "زیر التواء ٹاسک",
+ "In queue" : "قطار میں",
+ "Mail" : "میل",
+ "View All" : "سب دیکھیں"
+}
diff --git a/otf-frontend/client/src/assets/i18n/zh-CHS.json b/otf-frontend/client/src/assets/i18n/zh-CHS.json
new file mode 100644
index 0000000..ae60c29
--- /dev/null
+++ b/otf-frontend/client/src/assets/i18n/zh-CHS.json
@@ -0,0 +1,32 @@
+{
+ "Dashboard": "仪表板",
+ "Charts": "图表",
+ "Tables": "表格",
+ "Forms": "表单",
+ "Bootstrap Element": "Bootstrap 元素",
+ "Bootstrap Grid": "Bootstrap 网格",
+ "Component": "组件",
+ "Menu": "菜单",
+ "Submenu": "子菜单",
+ "Blank Page": "空白页",
+ "More Theme": "更多主题",
+ "Download Now": "现在下载",
+ "Language": "语言",
+ "English": "英语",
+ "French": "法语",
+ "Urdu": "乌尔都语",
+ "Spanish": "西班牙语",
+ "Italian": "意大利语",
+ "Farsi": "波斯语",
+ "German": "德语",
+ "Simplified Chinese": "简体中文",
+ "Search" : "搜索",
+ "Settings" : "设置",
+ "Profile" : "个人配置",
+ "Inbox" : "收件箱",
+ "Log Out" : "退出",
+ "Pending Task" : "挂起任务",
+ "In queue" : "队列中",
+ "Mail" : "邮件",
+ "View All" : "查看所有"
+}
diff --git a/otf-frontend/client/src/assets/images/404image.png b/otf-frontend/client/src/assets/images/404image.png
new file mode 100644
index 0000000..5101cc1
--- /dev/null
+++ b/otf-frontend/client/src/assets/images/404image.png
Binary files differ
diff --git a/otf-frontend/client/src/assets/images/NetworkLogo.jpg b/otf-frontend/client/src/assets/images/NetworkLogo.jpg
new file mode 100644
index 0000000..3c071d3
--- /dev/null
+++ b/otf-frontend/client/src/assets/images/NetworkLogo.jpg
Binary files differ
diff --git a/otf-frontend/client/src/assets/images/OtfIcon.png b/otf-frontend/client/src/assets/images/OtfIcon.png
new file mode 100644
index 0000000..1e61906
--- /dev/null
+++ b/otf-frontend/client/src/assets/images/OtfIcon.png
Binary files differ
diff --git a/otf-frontend/client/src/assets/images/equalizer.gif b/otf-frontend/client/src/assets/images/equalizer.gif
new file mode 100644
index 0000000..22ccbe3
--- /dev/null
+++ b/otf-frontend/client/src/assets/images/equalizer.gif
Binary files differ
diff --git a/otf-frontend/client/src/assets/images/logo.png b/otf-frontend/client/src/assets/images/logo.png
new file mode 100644
index 0000000..a931536
--- /dev/null
+++ b/otf-frontend/client/src/assets/images/logo.png
Binary files differ
diff --git a/otf-frontend/client/src/assets/images/networkBackground.jpg b/otf-frontend/client/src/assets/images/networkBackground.jpg
new file mode 100644
index 0000000..5b1b943
--- /dev/null
+++ b/otf-frontend/client/src/assets/images/networkBackground.jpg
Binary files differ
diff --git a/otf-frontend/client/src/assets/images/networkBackground1.jpg b/otf-frontend/client/src/assets/images/networkBackground1.jpg
new file mode 100644
index 0000000..fc4d343
--- /dev/null
+++ b/otf-frontend/client/src/assets/images/networkBackground1.jpg
Binary files differ
diff --git a/otf-frontend/client/src/assets/images/slider1.jpg b/otf-frontend/client/src/assets/images/slider1.jpg
new file mode 100644
index 0000000..9859565
--- /dev/null
+++ b/otf-frontend/client/src/assets/images/slider1.jpg
Binary files differ
diff --git a/otf-frontend/client/src/assets/images/slider2.jpg b/otf-frontend/client/src/assets/images/slider2.jpg
new file mode 100644
index 0000000..794d791
--- /dev/null
+++ b/otf-frontend/client/src/assets/images/slider2.jpg
Binary files differ
diff --git a/otf-frontend/client/src/assets/workflows/blank.bpmn b/otf-frontend/client/src/assets/workflows/blank.bpmn
new file mode 100644
index 0000000..d310b7e
--- /dev/null
+++ b/otf-frontend/client/src/assets/workflows/blank.bpmn
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" id="Definitions_1n6f7f6" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.0.3">
+ <bpmn:process id="" isExecutable="true">
+ <bpmn:startEvent id="StartEvent_1" />
+ </bpmn:process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="">
+ <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
+ <dc:Bounds x="173" y="102" width="36" height="36" />
+ </bpmndi:BPMNShape>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/otf-frontend/client/src/environments/environment.prod.ts b/otf-frontend/client/src/environments/environment.prod.ts
new file mode 100644
index 0000000..fe1834b
--- /dev/null
+++ b/otf-frontend/client/src/environments/environment.prod.ts
@@ -0,0 +1,19 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+export const environment = {
+ production: true
+};
diff --git a/otf-frontend/client/src/environments/environment.ts b/otf-frontend/client/src/environments/environment.ts
new file mode 100644
index 0000000..98eb372
--- /dev/null
+++ b/otf-frontend/client/src/environments/environment.ts
@@ -0,0 +1,24 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+// The file contents for the current environment will overwrite these during build.
+// The build system defaults to the dev environment which uses `environment.ts`, but if you do
+// `ng build --env=prod` then `environment.prod.ts` will be used instead.
+// The list of which env maps to which file can be found in `.angular-cli.json`.
+
+export const environment = {
+ production: false
+};
diff --git a/otf-frontend/client/src/favicon.ico b/otf-frontend/client/src/favicon.ico
new file mode 100644
index 0000000..2cfcef1
--- /dev/null
+++ b/otf-frontend/client/src/favicon.ico
Binary files differ
diff --git a/otf-frontend/client/src/global-shims.ts b/otf-frontend/client/src/global-shims.ts
new file mode 100644
index 0000000..c6bec7f
--- /dev/null
+++ b/otf-frontend/client/src/global-shims.ts
@@ -0,0 +1,19 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+(window as any).global = window;
+
+export const NOOP = 0;
\ No newline at end of file
diff --git a/otf-frontend/client/src/index.html b/otf-frontend/client/src/index.html
new file mode 100644
index 0000000..f6daf32
--- /dev/null
+++ b/otf-frontend/client/src/index.html
@@ -0,0 +1,36 @@
+<!-- Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+#############################################################################-->
+
+
+<!doctype html>
+ <html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Open Test Framework</title>
+ <base href="/">
+
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel="icon" type="image/x-icon" href="favicon.ico">
+ </head>
+ <body>
+ <app-root>
+ <div class="spinner">
+ <div class="bounce1"></div>
+ <div class="bounce2"></div>
+ <div class="bounce3"></div>
+ </div>
+ </app-root>
+ </body>
+</html>
diff --git a/otf-frontend/client/src/main.ts b/otf-frontend/client/src/main.ts
new file mode 100644
index 0000000..fe30c76
--- /dev/null
+++ b/otf-frontend/client/src/main.ts
@@ -0,0 +1,29 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+import { enableProdMode } from '@angular/core';
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+
+import { AppModule } from './app/app.module';
+import { environment } from './environments/environment';
+
+if (environment.production) {
+ enableProdMode();
+}
+
+platformBrowserDynamic()
+ .bootstrapModule(AppModule)
+ .catch(err => console.log(err));
diff --git a/otf-frontend/client/src/polyfills.ts b/otf-frontend/client/src/polyfills.ts
new file mode 100644
index 0000000..404f96f
--- /dev/null
+++ b/otf-frontend/client/src/polyfills.ts
@@ -0,0 +1,85 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+/**
+ * This file includes polyfills needed by Angular and is loaded before the app.
+ * You can add your own extra polyfills to this file.
+ *
+ * This file is divided into 2 sections:
+ * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
+ * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
+ * file.
+ *
+ * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
+ * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
+ * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
+ *
+ * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
+ */
+
+/***************************************************************************************************
+ * BROWSER POLYFILLS
+ */
+
+/** IE9, IE10 and IE11 requires all of the following polyfills. **/
+import 'core-js/es6/symbol';
+import 'core-js/es6/object';
+import 'core-js/es6/function';
+import 'core-js/es6/parse-int';
+import 'core-js/es6/parse-float';
+import 'core-js/es6/number';
+import 'core-js/es6/math';
+import 'core-js/es6/string';
+import 'core-js/es6/date';
+import 'core-js/es6/array';
+import 'core-js/es6/regexp';
+import 'core-js/es6/map';
+import 'core-js/es6/weak-map';
+import 'core-js/es6/set';
+
+(window as any).global = window;
+
+/** IE10 and IE11 requires the following for NgClass support on SVG elements */
+//import 'classlist.js'; // Run `npm install --save classlist.js`.
+
+/** Evergreen browsers require these. **/
+import 'core-js/es6/reflect';
+import 'core-js/es7/reflect';
+
+/**
+ * Required to support Web Animations `@angular/platform-browser/animations`.
+ * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
+ **/
+//import 'web-animations-js'; // Run `npm install --save web-animations-js`.
+
+/***************************************************************************************************
+ * Zone JS is required by Angular itself.
+ */
+import 'zone.js/dist/zone'; // Included with Angular CLI.
+
+/***************************************************************************************************
+ * APPLICATION IMPORTS
+ */
+
+/**
+ * Date, currency, decimal and percent pipes.
+ * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
+ */
+// import 'intl'; // Run `npm install --save intl`.
+/**
+ * Need to import at least one locale-data with intl.
+ */
+// import 'intl/locale-data/jsonp/en';
diff --git a/otf-frontend/client/src/styles/_responsive.scss b/otf-frontend/client/src/styles/_responsive.scss
new file mode 100644
index 0000000..a5509a0
--- /dev/null
+++ b/otf-frontend/client/src/styles/_responsive.scss
@@ -0,0 +1,23 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+@media screen and (max-width: 992px) {
+ .push-right {
+ .sidebar {
+ left: 235px !important;
+ }
+ }
+}
diff --git a/otf-frontend/client/src/styles/_rtl.scss b/otf-frontend/client/src/styles/_rtl.scss
new file mode 100644
index 0000000..1249952
--- /dev/null
+++ b/otf-frontend/client/src/styles/_rtl.scss
@@ -0,0 +1,90 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.rtl {
+ .sidebar {
+ left: auto !important;
+ right: 0 !important;
+ > ul.list-group {
+ padding: 0;
+ }
+ }
+ .main-container {
+ margin-left: 0 !important;
+ margin-right: 235px;
+ }
+ /*rtl dropdown items correction*/
+ .dropdown-menu {
+ text-align: right;
+ }
+ * {
+ direction: rtl;
+ }
+ .navbar * {
+ direction: ltr;
+ }
+
+ .sidebar * {
+ direction: ltr;
+ }
+
+ .navbar .dropdown-menu {
+ text-align: left;
+ }
+
+ .breadcrumb {
+ direction: ltr;
+ justify-content: flex-end;
+
+ * {
+ direction: ltr;
+ }
+ }
+
+ .datepicker-input {
+ direction: ltr;
+ .dropdown-menu {
+ direction: ltr;
+
+ * {
+ direction: ltr;
+ }
+ }
+ }
+
+ .input-group {
+ direction: ltr;
+ }
+}
+@media screen and (max-width: 992px) {
+ .rtl {
+ .navbar-brand {
+ direction: ltr;
+ }
+ .sidebar {
+ right: -235px !important;
+ }
+ .main-container {
+ margin-right: 0;
+ }
+ &.push-right {
+ .sidebar {
+ left: auto !important;
+ right: 0 !important;
+ }
+ }
+ }
+}
diff --git a/otf-frontend/client/src/styles/_spinner.scss b/otf-frontend/client/src/styles/_spinner.scss
new file mode 100644
index 0000000..8d24c4d
--- /dev/null
+++ b/otf-frontend/client/src/styles/_spinner.scss
@@ -0,0 +1,60 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.spinner {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ -ms-transform: translate(-50%,-50%); /* IE 9 */
+ -webkit-transform: translate(-50%,-50%); /* Safari */
+ transform: translate(-50%,-50%); /* Standard syntax */
+ width: 70px;
+ height: 70px;
+ > div {
+ width: 18px;
+ height: 18px;
+ background-color: #333;
+
+ border-radius: 100%;
+ display: inline-block;
+ -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
+ animation: sk-bouncedelay 1.4s infinite ease-in-out both;
+ }
+ .bounce1 {
+ -webkit-animation-delay: -0.32s;
+ animation-delay: -0.32s;
+ }
+
+ .bounce2 {
+ -webkit-animation-delay: -0.16s;
+ animation-delay: -0.16s;
+ }
+}
+
+@-webkit-keyframes sk-bouncedelay {
+ 0%, 80%, 100% { -webkit-transform: scale(0) }
+ 40% { -webkit-transform: scale(1.0) }
+}
+
+@keyframes sk-bouncedelay {
+ 0%, 80%, 100% {
+ -webkit-transform: scale(0);
+ transform: scale(0);
+ } 40% {
+ -webkit-transform: scale(1.0);
+ transform: scale(1.0);
+ }
+}
diff --git a/otf-frontend/client/src/styles/_utils.scss b/otf-frontend/client/src/styles/_utils.scss
new file mode 100644
index 0000000..61014d6
--- /dev/null
+++ b/otf-frontend/client/src/styles/_utils.scss
@@ -0,0 +1,19 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+.fs-12 {
+ font-size: 12px;
+}
diff --git a/otf-frontend/client/src/styles/app.scss b/otf-frontend/client/src/styles/app.scss
new file mode 100644
index 0000000..3e6516b
--- /dev/null
+++ b/otf-frontend/client/src/styles/app.scss
@@ -0,0 +1,187 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+/* You can add global styles to this file, and also import other style files */
+$zindex-dropdown: 900 !default;
+$zindex-sticky: 920 !default;
+$zindex-fixed: 950 !default;
+$font-size-base: .8rem !default;
+@import "../../../node_modules/bootstrap/scss/bootstrap";
+@import "spinner";
+@import "utils";
+@import "rtl";
+@import "responsive";
+
+.list-group-item {
+ padding: .5rem 1rem;
+}
+
+@media print {
+ .breadcrumb {
+ display: none !important;
+ }
+}
+
+@import '~@angular/material/theming';
+// Plus imports for other components in your app.
+
+// Include the common styles for Angular Material. We include this here so that you only
+// have to load a single css file for Angular Material in your app.
+// Be sure that you only ever include this mixin once!
+@include mat-core();
+
+// Define the palettes for your theme using the Material Design palettes available in palette.scss
+// (imported above). For each palette, you can optionally specify a default, lighter, and darker
+// hue. Available color palettes: https://material.io/design/color/
+$candy-app-primary: mat-palette($mat-blue, 900);
+
+$candy-app-accent: mat-palette($mat-orange, A400);
+
+// The warn palette is optional (defaults to red).
+$candy-app-warn: mat-palette($mat-deep-orange, A700);
+
+// Create the theme object (a Sass map containing all of the palettes).
+$candy-app-theme: mat-light-theme($candy-app-primary, $candy-app-accent, $candy-app-warn);
+
+// Include theme styles for core and each component used in your app.
+// Alternatively, you can import and @include the theme mixins for each component
+// that you are using.
+@include angular-material-theme($candy-app-theme);
+
+@import "../../../node_modules/perfect-scrollbar/css/perfect-scrollbar.css";
+//@import '~@angular/material/prebuilt-themes/deeppurple-amber.css';
+@import url('https://fonts.googleapis.com/icon?family=Material+Icons');
+@import "../../../node_modules/codemirror/lib/codemirror.css";
+@import "../../../node_modules/codemirror/theme/eclipse.css";
+
+@import 'ag-grid-community/dist/styles/ag-grid.css';
+@import 'ag-grid-community/dist/styles/ag-theme-material.css';
+
+@font-face {
+ font-family: 'Material Icons';
+ font-style: normal;
+ font-weight: 400;
+ src: local('Material Icons'),
+ local('MaterialIcons-Regular'),
+ url(https://fonts.gstatic.com/s/materialicons/v21/2fcrYFNaTjcS6g4U3t-Y5UEw0lE80llgEseQY3FEmqw.woff2) format('woff2');
+ }
+
+mat-icon{
+ font-family: 'Material Icons' !important
+}
+
+.embedded {
+ box-shadow: inset 0px 11px 8px -10px #CCC, inset 0px -11px 8px -10px #CCC
+}
+
+.mat-mini-fab .mat-button-wrapper>*{
+ vertical-align: 6px !important;
+}
+
+button:focus{
+ outline: none;
+}
+
+mat-card {
+ padding: 0px !important;
+}
+
+mat-card-header {
+ padding: 15px !important;
+ padding-top: 10px !important;
+ padding-bottom: 10px !important;
+}
+
+.mat-card-header-text {
+ width: 100% !important;
+}
+
+mat-card-title {
+ margin: 0px !important;
+ padding: 0px !important;
+}
+
+mat-card-title button {
+ padding: 3px 8px !important;
+ line-height: 5px !important;
+}
+
+mat-card-title button mat-icon {
+ font-size: 22px !important;
+}
+
+mat-card-content {
+ padding: 24px !important;
+ padding-top: 10px !important;
+}
+
+.highlight-task-running:not(.djs-connection) .djs-visual > :nth-child(1) {
+ fill: rgb(186, 186, 255) !important; /* color elements as green */
+ opacity: .7;
+}
+
+.highlight-task-completed:not(.djs-connection) .djs-visual > :nth-child(1) {
+ fill: rgb(92, 223, 92) !important; /* color elements as green */
+}
+
+.highlight-task-failed:not(.djs-connection) .djs-visual > :nth-child(1) {
+ fill: rgb(255, 83, 83) !important; /* color elements as green */
+}
+
+.dropdown-item {
+ cursor: pointer;
+}
+
+tr:nth-child(even){background-color: #f9f9f9;}
+
+html {
+ height: 100%
+}
+
+body {
+ height: calc(100% - 56px);
+}
+
+.main-container {
+ height: 100%;
+ overflow: scroll !important;
+}
+
+.form-buttons {
+ position:absolute;
+ bottom:0;
+ right:0;
+ z-index:1000;
+ margin-bottom:-18px
+}
+
+.upload-progress {
+ position: absolute;
+ background-color: green;
+ height: 100%;
+ opacity: .5;
+ top: 0;
+ left: 0;
+}
+app-form-generator textarea,
+app-form-generator input {
+ width: 100%;
+}
+
+.loader-modal-container .mat-dialog-container{
+ border-radius: 100px;
+ opacity: 0.1;
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/test.ts b/otf-frontend/client/src/test.ts
new file mode 100644
index 0000000..34bfd28
--- /dev/null
+++ b/otf-frontend/client/src/test.ts
@@ -0,0 +1,48 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+// This file is required by karma.conf.js and loads recursively all the .spec and framework files
+
+import 'zone.js/dist/long-stack-trace-zone';
+import 'zone.js/dist/proxy.js';
+import 'zone.js/dist/sync-test';
+import 'zone.js/dist/jasmine-patch';
+import 'zone.js/dist/async-test';
+import 'zone.js/dist/fake-async-test';
+import { getTestBed } from '@angular/core/testing';
+import {
+ BrowserDynamicTestingModule,
+ platformBrowserDynamicTesting
+} from '@angular/platform-browser-dynamic/testing';
+
+// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
+declare const __karma__: any;
+declare const require: any;
+
+// Prevent Karma from running prematurely.
+__karma__.loaded = function () {};
+
+// First, initialize the Angular testing environment.
+getTestBed().initTestEnvironment(
+ BrowserDynamicTestingModule,
+ platformBrowserDynamicTesting()
+);
+// Then we find all the tests.
+const context = require.context('./', true, /\.spec\.ts$/);
+// And load the modules.
+context.keys().map(context);
+// Finally, start Karma to run the tests.
+__karma__.start();
diff --git a/otf-frontend/client/src/tsconfig.app.json b/otf-frontend/client/src/tsconfig.app.json
new file mode 100644
index 0000000..bdd3b1c
--- /dev/null
+++ b/otf-frontend/client/src/tsconfig.app.json
@@ -0,0 +1,20 @@
+{
+ "extends": "../config/tsconfig.json",
+ "compilerOptions": {
+ "outDir": "../out-tsc/app",
+ "baseUrl": "./",
+ "module": "es2015",
+ "types": [],
+ "paths": {
+ "fs": [
+ "./global-shims"
+ ]
+ },
+ "experimentalDecorators": true,
+ "allowJs": true
+ },
+ "exclude": [
+ "test.ts",
+ "**/*.spec.ts"
+ ]
+}
\ No newline at end of file
diff --git a/otf-frontend/client/src/tsconfig.json b/otf-frontend/client/src/tsconfig.json
new file mode 100644
index 0000000..e023398
--- /dev/null
+++ b/otf-frontend/client/src/tsconfig.json
@@ -0,0 +1,21 @@
+{
+ "extends": "../config/tsconfig.json",
+ "compilerOptions": {
+ "outDir": "../out-tsc/app",
+ "baseUrl": "./",
+ "module": "es2015",
+ "types": [],
+ "paths": {
+ "fs": [
+ "./global-shims"
+ ]
+ },
+ "experimentalDecorators": true,
+ "allowJs": true
+ },
+ "exclude": [
+ "test.ts",
+ "**/*.spec.ts"
+ ]
+ }
+
\ No newline at end of file
diff --git a/otf-frontend/client/src/tsconfig.spec.json b/otf-frontend/client/src/tsconfig.spec.json
new file mode 100644
index 0000000..2046c9e
--- /dev/null
+++ b/otf-frontend/client/src/tsconfig.spec.json
@@ -0,0 +1,21 @@
+{
+ "extends": "../config/tsconfig.json",
+ "compilerOptions": {
+ "outDir": "../out-tsc/spec",
+ "baseUrl": "./",
+ "module": "commonjs",
+ "target": "es5",
+ "types": [
+ "jasmine",
+ "node"
+ ]
+ },
+ "files": [
+ "test.ts",
+ "polyfills.ts"
+ ],
+ "include": [
+ "**/*.spec.ts",
+ "**/*.d.ts"
+ ]
+}
diff --git a/otf-frontend/client/src/typings.d.ts b/otf-frontend/client/src/typings.d.ts
new file mode 100644
index 0000000..b179036
--- /dev/null
+++ b/otf-frontend/client/src/typings.d.ts
@@ -0,0 +1,28 @@
+/* Copyright (c) 2019 AT&T Intellectual Property. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+##############################################################################*/
+
+
+/* SystemJS module definition */
+declare var module: NodeModule;
+interface NodeModule {
+ id: string;
+}
+
+declare var fs: any;
+
+declare module "*.json" {
+ const value: any;
+ export default value;
+}
\ No newline at end of file