Skip to content

Commit d1f9d85

Browse files
authored
Merge pull request #104 from pengz1/Update-framework-changes
Update framework changes
2 parents 2d07aeb + 19f40fb commit d1f9d85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+122
-219
lines changed

config/build-utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const helpers = require('./helpers');
55

66
const DEFAULT_METADATA = {
77
title: 'RackHD Web UI 2.0',
8-
baseUrl: '/',
8+
baseUrl: './',
99
isDevServer: helpers.isWebpackDevServer(),
1010
HMR: helpers.hasProcessFlag('hot'),
1111
AOT: process.env.BUILD_AOT || helpers.hasNpmFlag('aot'),

config/webpack.dev.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module.exports = function (options) {
4646
*
4747
* See: http://webpack.github.io/docs/configuration.html#output-path
4848
*/
49-
publicPath: './',
49+
// publicPath: './',
5050
path: helpers.root('dist'),
5151

5252
/**

config/webpack.prod.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ module.exports = function (env) {
7373
*
7474
* See: http://webpack.github.io/docs/configuration.html#output-path
7575
*/
76-
publicPath: './',
76+
// publicPath: './',
7777
path: helpers.root('dist'),
7878

7979
/**

src/app/app-routing.module.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import { ROUTES } from './app.routes';
1010
@NgModule({
1111
imports: [
1212
RouterModule.forRoot(ROUTES, {
13-
useHash: Boolean(history.pushState) === false,
13+
//If we don't want to use hash mode, we need to change RackHD
14+
useHash: Boolean(history.pushState) === true,
1415
preloadingStrategy: PreloadAllModules
1516
// enableTracing: true
1617
})

src/app/app.routes.ts

+5-14
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,19 @@ import { NoContentComponent } from './no-content/no-content.component';
88
* route after '' will be denied. Cause angular will regard all routes as '' children
99
*/
1010
export const ROUTES: Routes = [
11-
/**
12-
* @description Four first-level routings
13-
* @date 2018-02-07 18:52:36
14-
15-
*/
16-
{path: '', redirectTo: 'ui/managementCenter', pathMatch: 'full'},
11+
{path: '', redirectTo: '/managementCenter/nodes', pathMatch: 'full'},
1712
{
18-
path: 'ui/managementCenter',
13+
path: 'managementCenter',
1914
loadChildren: 'app/management-center/management-center.module#ManagementCenterModule',
2015
},
2116
{
22-
path: 'ui/operationsCenter',
23-
loadChildren: 'app/operations-center/operations-center.module#OperationsCenterModule',
17+
path: 'workflowCenter',
18+
loadChildren: 'app/workflow-center/workflow-center.module#WorkflowCenterModule',
2419
},
2520
{
26-
path: 'ui/solutionCenter',
21+
path: 'solutionCenter',
2722
loadChildren: 'app/solution-center/solution-center.module#SolutionCenterModule',
2823
},
29-
{
30-
path: 'ui/workflowEditor',
31-
loadChildren: 'app/workflow-editor/workflow-editor.module#WorkflowEditorModule',
32-
},
3324
// 404 page, page with ** can not be lazily loaded.
3425
{path: '**', component: NoContentComponent},
3526
];

src/app/header/header.component.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
</a>
77
</div>
88
<div class="header-nav">
9-
<a routerLink="/ui/managementCenter" routerLinkActive="active" class="nav-link"><span class="nav-text">Management Center</span></a>
10-
<a routerLink="/ui/operationsCenter" routerLinkActive="active" class=" nav-link"><span class="nav-text">Operations Center</span></a>
11-
<a routerLink="/ui/workflowEditor" routerLinkActive="active" class=" nav-link"><span class="nav-text">Workflow Editor</span></a>
12-
<a routerLink="/ui/solutionCenter" routerLinkActive="active" class="nav-link"><span class="nav-text">Solution Center</span></a>
9+
<a routerLink="managementCenter" routerLinkActive="active" class="nav-link"><span class="nav-text">Management Center</span></a>
10+
<a routerLink="workflowCenter" routerLinkActive="active" class=" nav-link"><span class="nav-text">Workflow Center</span></a>
11+
<a routerLink="solutionCenter" routerLinkActive="active" class="nav-link"><span class="nav-text">Solution Center</span></a>
1312
</div>
1413
<div class="header-actions">
1514
<div class="active nav-link nav-icon" (click)="openSetting=true" style="cursor:pointer" >

src/app/management-center/workflows/workflows.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export class WorkflowsComponent implements OnInit {
188188

189189
gotoCanvas(workflow){
190190
let graphName = workflow.injectableName;
191-
let url = "/operationsCenter/workflowViewer?graphName=" + graphName;
191+
let url = "/workflowCenter/workflowViewer?graphName=" + graphName;
192192
this.router.navigateByUrl(url);
193193
}
194194

src/app/operations-center/operations-center.component.spec.ts

-22
This file was deleted.

src/app/operations-center/operations-center.component.ts

-16
This file was deleted.

src/app/operations-center/active-workflow/active-workflow.component.ts renamed to src/app/workflow-center/active-workflow/active-workflow.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export class ActiveWorkflowComponent implements OnInit {
180180

181181
gotoCanvas(workflow){
182182
let graphId = workflow.instanceId;
183-
let url = "/operationsCenter/workflowViewer?graphId=" + graphId;
183+
let url = "/workflowCenter/workflowViewer?graphId=" + graphId;
184184
this.router.navigateByUrl(url);
185185
}
186186
}

src/app/operations-center/history-workflow/history-workflow.component.ts renamed to src/app/workflow-center/history-workflow/history-workflow.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export class HistoryWorkflowComponent implements OnInit {
223223

224224
gotoCanvas(workflow){
225225
let graphId = workflow.instanceId;
226-
let url = "/operationsCenter/workflowViewer?graphId=" + graphId;
226+
let url = "/workflowCenter/workflowViewer?graphId=" + graphId;
227227
this.router.navigateByUrl(url);
228228
}
229229

src/app/operations-center/run-workflow/run-workflow.component.ts renamed to src/app/workflow-center/run-workflow/run-workflow.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export class RunWorkflowComponent implements OnInit, AfterViewInit {
214214
goToViewer() {
215215
this.resetModalInfo();
216216
this.showModal = false;
217-
this.router.navigate(['operationsCenter/workflowViewer'], {
217+
this.router.navigate(['workflowCenter/workflowViewer'], {
218218
queryParams: {graphId: this.graphId}
219219
});
220220
}
@@ -228,7 +228,7 @@ export class RunWorkflowComponent implements OnInit, AfterViewInit {
228228
this.selectedGraph = null;
229229
this.graphStore = _.cloneDeep(this.allGraphs);
230230
this.updateEditor({});
231-
this.router.navigateByUrl('operationsCenter/runWorkflow');
231+
this.router.navigateByUrl('workflowCenter/runWorkflow');
232232
}
233233

234234
onFilterSelect(node){
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
11
import { NgModule } from '@angular/core';
22
import { RouterModule, Routes } from '@angular/router';
33

4-
import { OperationsCenterComponent } from './operations-center.component';
4+
import { WorkflowCenterComponent } from './workflow-center.component';
55
import { ActiveWorkflowComponent } from './active-workflow/active-workflow.component';
66
import { HistoryWorkflowComponent } from './history-workflow/history-workflow.component';
77
import { WorkflowViewerComponent } from './workflow-viewer/workflow-viewer.component';
88
import { RunWorkflowComponent } from './run-workflow/run-workflow.component';
9+
import { WorkflowEditorComponent } from './workflow-editor/workflow-editor.component';
910

10-
const OperationsCenterRoutes: Routes = [
11+
const WorkflowCenterRoutes: Routes = [
1112
{
1213
path: '',
13-
component: OperationsCenterComponent,
14+
component: WorkflowCenterComponent,
1415
children: [
1516
{path: '', redirectTo: 'activeWorkflow'},
1617
{path: 'activeWorkflow', component: ActiveWorkflowComponent},
1718
{path: 'historyWorkflow', component: HistoryWorkflowComponent},
1819
{path: 'workflowViewer', component: WorkflowViewerComponent},
1920
{path: 'runWorkflow', component: RunWorkflowComponent},
21+
{path: 'workflowEditor', component: WorkflowEditorComponent},
2022
]
2123
}
2224
];
2325

2426
@NgModule({
2527
imports: [
26-
RouterModule.forChild(OperationsCenterRoutes)
28+
RouterModule.forChild(WorkflowCenterRoutes)
2729
],
2830
exports: [
2931
RouterModule
3032
]
3133
})
32-
export class OperationsCenterRoutingModule {
34+
export class WorkflowCenterRoutingModule {
3335
}

src/app/operations-center/operations-center.component.html renamed to src/app/workflow-center/workflow-center.component.html

+9-4
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,19 @@
99
<clr-icon clrVerticalNavIcon shape="history"></clr-icon>
1010
History Workflow
1111
</a>
12-
<a clrVerticalNavLink routerLink="./workflowViewer" routerLinkActive="active">
13-
<clr-icon clrVerticalNavIcon shape="view-cards"></clr-icon>
14-
Workflow Viewer
15-
</a>
1612
<a clrVerticalNavLink routerLink="./runWorkflow" routerLinkActive="active">
1713
<clr-icon clrVerticalNavIcon shape="play"></clr-icon>
1814
Run Workflow
1915
</a>
16+
<a clrVerticalNavLink routerLink="./workflowEditor" routerLinkActive="active">
17+
<clr-icon clrVerticalNavIcon shape="note"></clr-icon>
18+
Workflow Editor
19+
</a>
20+
<a clrVerticalNavLink routerLink="./workflowViewer" routerLinkActive="active">
21+
<clr-icon clrVerticalNavIcon shape="view-cards"></clr-icon>
22+
Workflow Viewer
23+
</a>
24+
2025

2126
</clr-vertical-nav>
2227
<div class="content-area">
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { WorkflowCenterComponent } from './workflow-center.component';
4+
5+
describe('WorkflowCenterComponent', () => {
6+
let component: WorkflowCenterComponent;
7+
let fixture: ComponentFixture<WorkflowCenterComponent>;
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [ WorkflowCenterComponent ]
12+
})
13+
.compileComponents();
14+
}));
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(WorkflowCenterComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-workflow-center',
5+
templateUrl: './workflow-center.component.html',
6+
styleUrls: ['./workflow-center.component.scss']
7+
})
8+
export class WorkflowCenterComponent implements OnInit {
9+
constructor() {
10+
}
11+
12+
ngOnInit() {
13+
}
14+
15+
}

src/app/operations-center/operations-center.module.ts renamed to src/app/workflow-center/workflow-center.module.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { NgModule } from '@angular/core';
22
import { CommonModule } from '@angular/common';
33
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
44
import { ClarityModule } from '@clr/angular';
5+
import { NodeExtensionService } from '../canvas-graph/node-extension.service';
56

67
import { ManagementCenterServicesModule } from '../management-center/services/management-center-service.module';
78

@@ -10,31 +11,33 @@ import { HistoryWorkflowComponent } from './history-workflow/history-workflow.co
1011
import { WorkflowViewerComponent } from './workflow-viewer/workflow-viewer.component';
1112
import { RunWorkflowComponent } from './run-workflow/run-workflow.component';
1213

13-
import { OperationsCenterComponent } from './operations-center.component';
14-
import { OperationsCenterRoutingModule } from './operations-center-routing.module';
14+
import { WorkflowCenterComponent } from './workflow-center.component';
15+
import { WorkflowCenterRoutingModule } from './workflow-center-routing.module';
1516

1617
import { CanvasGraphModule } from 'app/canvas-graph/canvas-graph.module';
1718
import { InventoryModule } from 'app/inventory/inventory.module';
19+
import { WorkflowEditorComponent } from './workflow-editor/workflow-editor.component';
1820

1921
@NgModule({
2022
imports: [
2123
ClarityModule.forChild(),
2224
CommonModule,
2325
FormsModule,
2426
ReactiveFormsModule,
25-
OperationsCenterRoutingModule,
27+
WorkflowCenterRoutingModule,
2628
ManagementCenterServicesModule,
2729
CanvasGraphModule,
2830
InventoryModule,
2931
],
3032
declarations: [
31-
OperationsCenterComponent,
33+
WorkflowCenterComponent,
3234
ActiveWorkflowComponent,
3335
HistoryWorkflowComponent,
3436
WorkflowViewerComponent,
3537
RunWorkflowComponent,
38+
WorkflowEditorComponent,
3639
],
37-
providers: []
40+
providers: [NodeExtensionService ]
3841
})
3942

40-
export class OperationsCenterModule {}
43+
export class WorkflowCenterModule {}

src/app/workflow-editor/workflow-canvas/workflow-canvas.component.html renamed to src/app/workflow-center/workflow-editor/workflow-editor.component.html

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="app-workflow-canvas">
1+
<div class="workflow-editor">
22
<div class="workflow-json-operation clear">
33
<div class="workflow-editor">
44
<button class="btn btn-icon" (click)="saveConfirm()" title="Save">
@@ -21,8 +21,9 @@
2121
<clr-icon shape="arrow left"></clr-icon>
2222
</button>
2323
<div class="editor-dropdown">
24-
<dropdown-group [data]="workflowStore" [columns]="columns" [placeholders]="placeholders" [fields]="fields" needSearchIcon=true
25-
(selected)="onSelected($event)" (cleared)="onRefresh()">
24+
<dropdown-group [data]="workflowStore" [columns]="columns" [placeholders]="placeholders" [fields]="fields"
25+
needSearchIcon=true
26+
(selected)="onSelected($event)" (cleared)="onRefresh()">
2627
</dropdown-group>
2728
</div>
2829
</div>
@@ -68,4 +69,4 @@ <h3 class="modal-title">Error Match Task Lable Waiton</h3>
6869
<button type="button" class="btn btn-primary btn-danger" (click)="isWaitOnMismatch = false;">OK</button>
6970
</div>
7071
</clr-modal>
71-
</div>
72+
</div>

src/app/workflow-editor/workflow-canvas/workflow-canvas.component.scss renamed to src/app/workflow-center/workflow-editor/workflow-editor.component.scss

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
.app-workflow-canvas {
2-
margin: 15px;
1+
.workflow-editor {
32
.float-right {
43
float: right;
54
}
65
.workflow-json-operation {
76
padding-bottom: 45px;
87
display: inline-flex;
98
width: 100%;
9+
10+
p {
11+
float: right;
12+
}
13+
1014
.workflow-editor {
1115
flex: 3;
12-
p {
13-
float: right;
14-
}
1516
}
1617
.editor {
1718
margin-left: 15px;
@@ -20,10 +21,11 @@
2021
height: 100vh;
2122
border: none;
2223
#jsoneditor {
23-
height: 100vh !important;
24+
height: 100vh;
2425
}
2526
.filter-line {
2627
margin-left: 0px;
28+
display: -webkit-inline-box;
2729
.editor-dropdown {
2830
margin-top: 18px;
2931
width: 85%;
@@ -32,4 +34,3 @@
3234
}
3335
}
3436
}
35-

src/app/workflow-editor/workflow-editor.component.spec.ts renamed to src/app/workflow-center/workflow-editor/workflow-editor.component.spec.ts

-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ describe('WorkflowEditorComponent', () => {
1818
component = fixture.componentInstance;
1919
fixture.detectChanges();
2020
});
21-
2221
});

0 commit comments

Comments
 (0)