From 008518dc35ded3bb6dc3e6352472b5816271f583 Mon Sep 17 00:00:00 2001 From: Lvbo163 Date: Thu, 11 Jan 2018 10:22:16 +0800 Subject: adjust folder change fold menu to menus Issue-ID: SDC-900 Change-Id: Ifce180badf4f468a3291b118bfd4f631483541ec Signed-off-by: Lvbo163 --- .../microservice-detail.component.html | 49 ---------- .../microservice-detail.component.ts | 100 --------------------- .../microservice-list.component.css | 15 ---- .../microservice-list.component.html | 32 ------- .../microservice-list.component.ts | 81 ----------------- .../menu/microservice/microservice.component.html | 39 -------- .../menu/microservice/microservice.component.ts | 48 ---------- 7 files changed, 364 deletions(-) delete mode 100644 sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-detail/microservice-detail.component.html delete mode 100644 sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-detail/microservice-detail.component.ts delete mode 100644 sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-list/microservice-list.component.css delete mode 100644 sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-list/microservice-list.component.html delete mode 100644 sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-list/microservice-list.component.ts delete mode 100644 sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice.component.html delete mode 100644 sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice.component.ts (limited to 'sdc-workflow-designer-ui/src/app/components/menu/microservice') diff --git a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-detail/microservice-detail.component.html b/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-detail/microservice-detail.component.html deleted file mode 100644 index d13895dd..00000000 --- a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-detail/microservice-detail.component.html +++ /dev/null @@ -1,49 +0,0 @@ - -
- -
- -
-
-
- -
- -
-
-
- -
- - -
-
-
- -
- -
-
- -
-
- -
- -
- -
-
diff --git a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-detail/microservice-detail.component.ts b/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-detail/microservice-detail.component.ts deleted file mode 100644 index bffaef42..00000000 --- a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-detail/microservice-detail.component.ts +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and the Apache License 2.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ - -import { Component, Input, OnChanges, ViewChild } from '@angular/core'; -import { ModalDirective } from 'ngx-bootstrap/modal'; - -import { Microservice } from '../../../../model/workflow/microservice'; -import { WorkflowConfigService } from '../../../../services/workflow-config.service'; -import { Swagger } from "../../../../model/swagger"; -import { RestConfig } from '../../../../model/rest-config'; - -/** - * toolbar component contains some basic operations(save) and all of the supported workflow nodes. - * The supported nodes can be dragged to container component. which will add a new node to the workflow. - */ -@Component({ - selector: 'b4t-microservice-detail', - templateUrl: 'microservice-detail.component.html', -}) -export class MicroserviceDetailComponent implements OnChanges { - @Input() microservice: RestConfig; - - public detail: string; - public dynamic = false; - - constructor(private configService: WorkflowConfigService) { - } - - public ngOnChanges() { - if(this.microservice == null) { - this.microservice = new RestConfig('', '', null, ''); - } - this.checkDynamic(); - this.parseSwagger2String(); - } - - private checkDynamic() { - if(this.microservice.url) { - this.dynamic = true; - } else { - this.dynamic = false; - } - } - - private parseSwagger2String() { - if (this.microservice.swagger) { - this.detail = JSON.stringify(this.microservice.swagger); - } else { - this.detail = ''; - } - } - - public onDetailChanged(detail: string) { - try { - if(detail) { - const swagger = new Swagger(JSON.parse(detail)); - this.detail = detail; - console.log(swagger); - this.microservice.swagger = swagger; - } else { - this.detail = ''; - this.microservice.swagger = null; - } - } catch (e) { - // if detail is not a json object, then not change the swagger - } - } - - public toggleDynamic(dynamic: boolean) { - this.dynamic = dynamic; - this.onDetailChanged(null); - - if(!dynamic) { - this.microservice.url = null; - } - } - - private loadDynamicInfo() { - this.configService.loadDynamicInfo(this.microservice.url) - .subscribe(response => { - try { - - this.microservice.swagger = response; - this.parseSwagger2String(); - } catch (e) { - console.log('detail transfer error'); - console.error(e); - } - }); - } -} diff --git a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-list/microservice-list.component.css b/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-list/microservice-list.component.css deleted file mode 100644 index f403890e..00000000 --- a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-list/microservice-list.component.css +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and the Apache License 2.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ - - .swagger-list{ - overflow: auto; - } \ No newline at end of file diff --git a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-list/microservice-list.component.html b/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-list/microservice-list.component.html deleted file mode 100644 index ce4730f7..00000000 --- a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-list/microservice-list.component.html +++ /dev/null @@ -1,32 +0,0 @@ - -
-
-
- Config List - -
- -
    -
  • -
    {{microservice.name}}
    -
    - -
    -
  • -
-
-
- diff --git a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-list/microservice-list.component.ts b/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-list/microservice-list.component.ts deleted file mode 100644 index b44d423f..00000000 --- a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-list/microservice-list.component.ts +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and the Apache License 2.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ - -import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core'; -import { ModalDirective } from 'ngx-bootstrap/modal'; - -import { Microservice } from '../../../../model/workflow/microservice'; -import { RestConfig } from '../../../../model/rest-config'; - -/** - * toolbar component contains some basic operations(save) and all of the supported workflow nodes. - * The supported nodes can be dragged to container component. which will add a new node to the workflow. - */ -@Component({ - selector: 'b4t-microservice-list', - templateUrl: 'microservice-list.component.html', -}) -export class MicroserviceListComponent { - @Input() microservices: RestConfig[]; - @Output() microserviceSelected = new EventEmitter(); - - public onMicroserviceSelected(microservice: RestConfig) { - this.microserviceSelected.emit(microservice); - } - - public addMicroservice() { - const microservice = new RestConfig(this.getConfigId(), 'new microservice', '', null); - this.microservices.push(microservice); - - this.onMicroserviceSelected(microservice); - } - - public deleteMicroservice(index: number, microservice: Microservice) { - this.deleteMicroService(microservice.name, microservice.version); - - // set the next microservice selected - let selectedMicroservice; - if (this.microservices.length > 0) { - if (this.microservices[index]) { - selectedMicroservice = this.microservices[index]; - } else { - selectedMicroservice = this.microservices[index - 1]; - } - } - this.onMicroserviceSelected(selectedMicroservice); - } - - private deleteMicroService(name: string, version: string) { - const index = this.microservices.findIndex(service => (service.name === name && service.version === version)); - if(index !== -1) { - return this.microservices.splice(index, 1)[0]; - } - - return undefined; - } - - private getConfigId(): string { - const idSet = new Set(); - this.microservices.forEach(config => { - idSet.add(config.id); - }); - - for(let index = 0; index < idSet.size; index++) { - const id = `config${index}`; - if(!idSet.has(id)) { - return id; - } - } - - return `config0`; - } -} diff --git a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice.component.html b/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice.component.html deleted file mode 100644 index e8483c22..00000000 --- a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice.component.html +++ /dev/null @@ -1,39 +0,0 @@ - - diff --git a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice.component.ts b/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice.component.ts deleted file mode 100644 index eeedac47..00000000 --- a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice.component.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and the Apache License 2.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ - -import { AfterViewInit, Component, ViewChild } from '@angular/core'; -import { ModalDirective } from 'ngx-bootstrap/modal'; - -import { MicroserviceListComponent } from './microservice-list/microservice-list.component'; -import { Microservice } from "../../../model/workflow/microservice"; -import { WorkflowConfigService } from "../../../services/workflow-config.service"; -import { RestService } from '../../../services/rest.service'; -import { RestConfig } from '../../../model/rest-config'; - -/** - * microservice component - * open a model to set microservice info - */ -@Component({ - selector: 'b4t-microservice', - templateUrl: 'microservice.component.html', -}) -export class MicroserviceComponent { - @ViewChild('microserviceModal') public microserviceModal: ModalDirective; - - public microservices: RestConfig[]; - public currentMicroservice: Microservice; - - constructor(private restService: RestService) { - } - - public microserviceSelected(microservice: any) { - this.currentMicroservice = microservice; - } - - public show() { - this.microservices = this.restService.getRestConfigs(); - this.microserviceModal.show(); - } - -} -- cgit 1.2.3-korg