diff options
Diffstat (limited to 'cds-ui/designer-client/src/app/modules')
29 files changed, 202 insertions, 170 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/blueprint.page.mock.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/blueprint.page.mock.ts index d69f2fa8a..1cd054d75 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/blueprint.page.mock.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/blueprint.page.mock.ts @@ -1,7 +1,7 @@ -import {BluePrintPage} from './model/BluePrint.model'; +import {BlueprintPage} from './model/Blueprint.model'; import {PackagesDashboardState} from './model/packages-dashboard.state'; -export function getBluePrintPageMock(): BluePrintPage { +export function getBlueprintPageMock(): BlueprintPage { return { content: [ { diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html index e4231f902..f33f66020 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html @@ -84,7 +84,7 @@ <ngx-ui-loader></ngx-ui-loader> <div class="container"> <div class="creat-action-container"> - <button class="action-button save" (click)="editBluePrint()" [disabled]="!isSaveEnabled"> + <button class="action-button save" (click)="editBlueprint()" [disabled]="!isSaveEnabled"> <i class="icon-save-sm" aria-hidden="true"></i> <span>Save</span> </button> @@ -704,7 +704,7 @@ </div> </div> </div> - <button type="button" class="btn btn-sm mb-2 btn-enrich" (click)="enrichBluePrint()"> + <button type="button" class="btn btn-sm mb-2 btn-enrich" (click)="enrichBlueprint()"> <!-- data-toggle="modal" data-target="#enrichModal"--> <i class="icon-enrich" aria-hidden="true"></i> Enrich @@ -810,7 +810,7 @@ <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> <button type="button" data-dismiss="modal" class="btn btn-primary btn-enrich" - (click)="enrichBluePrint()">Enrich + (click)="enrichBlueprint()">Enrich </button> </div> </div> diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts index 0d92aadfb..0625394f4 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts @@ -1,6 +1,6 @@ import { Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { BluePrintDetailModel } from '../model/BluePrint.detail.model'; +import { BlueprintDetailModel } from '../model/Blueprint.detail.model'; import { PackageCreationStore } from '../package-creation/package-creation.store'; import { FilesContent, FolderNodeElement } from '../package-creation/mapping-models/metadata/MetaDataTab.model'; import { MetadataTabComponent } from '../package-creation/metadata-tab/metadata-tab.component'; @@ -28,7 +28,7 @@ import { NgxUiLoaderService } from 'ngx-ui-loader'; styleUrls: ['./configuration-dashboard.component.css'], }) export class ConfigurationDashboardComponent extends ComponentCanDeactivate implements OnInit, OnDestroy { - viewedPackage: BluePrintDetailModel = new BluePrintDetailModel(); + viewedPackage: BlueprintDetailModel = new BlueprintDetailModel(); @ViewChild(MetadataTabComponent, { static: false }) metadataTabComponent: MetadataTabComponent; public customActionName = ''; @@ -129,7 +129,7 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl }); } - private downloadCBAPackage(bluePrintDetailModels: BluePrintDetailModel) { + private downloadCBAPackage(bluePrintDetailModels: BlueprintDetailModel) { this.configurationDashboardService.downloadResource( this.viewedPackage.artifactName + '/' + this.viewedPackage.artifactVersion).subscribe(response => { const blob = new Blob([response], { type: 'application/octet-stream' }); @@ -144,11 +144,11 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl }); } - editBluePrint() { + editBlueprint() { this.ngxService.start(); this.configurationDashboardService.deletePackage(this.packageId).subscribe(res => { this.formTreeData(); - this.saveBluePrintToDataBase(); + this.saveBlueprintToDataBase(); }); } @@ -167,7 +167,7 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl this.metadataTabComponent.saveMetaDataToStore(); } - saveBluePrintToDataBase() { + saveBlueprintToDataBase() { this.create(); this.zipFile.generateAsync({ type: 'blob' }) .then(blob => { @@ -253,7 +253,7 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl this.cbaPackage.templateTopology.content = this.vlbDefinition.topology_template.content; } - enrichBluePrint() { + enrichBlueprint() { this.ngxService.start(); this.packageCreationStore.addTopologyTemplate(this.cbaPackage.templateTopology); this.formTreeData(); diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.service.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.service.ts index c7f557121..a8dfeafbb 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.service.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.service.ts @@ -2,23 +2,23 @@ import { Injectable } from '@angular/core'; import { ApiService } from '../../../../common/core/services/api.typed.service'; import { BlueprintURLs } from '../../../../common/constants/app-constants'; import { Observable } from 'rxjs'; -import { BluePrintDetailModel } from '../model/BluePrint.detail.model'; +import { BlueprintDetailModel } from '../model/Blueprint.detail.model'; @Injectable({ providedIn: 'root' }) export class ConfigurationDashboardService { - constructor(private api: ApiService<BluePrintDetailModel>) { + constructor(private api: ApiService<BlueprintDetailModel>) { } - private getBluePrintModel(id: string): Observable<BluePrintDetailModel> { + private getBlueprintModel(id: string): Observable<BlueprintDetailModel> { return this.api.getOne(BlueprintURLs.getOneBlueprint + '/' + id); } getPagedPackages(id: string) { - return this.getBluePrintModel(id); + return this.getBlueprintModel(id); } public downloadResource(path: string) { diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.html index d1b5eca98..0c542e089 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.html @@ -90,13 +90,13 @@ <div class="dropdown-text">Save</div> <ul class="dropdown-content save-blueprint"> <li> - <a (click)="saveBluePrint()"><i class="icon-save-sm" aria-hidden="true"></i> Save</a> + <a (click)="saveBlueprint()"><i class="icon-save-sm" aria-hidden="true"></i> Save</a> </li> <!-- <li> - <a (click)="enrichBluePrint()"><i class="icon-enrich" aria-hidden="true"></i> Enrich</a> + <a (click)="enrichBlueprint()"><i class="icon-enrich" aria-hidden="true"></i> Enrich</a> </li> --> <li> - <a (click)="enrichBluePrint()"><i class="fa fa-play-circle" aria-hidden="true"></i> Enrich & Deploy</a> + <a (click)="enrichBlueprint()"><i class="fa fa-play-circle" aria-hidden="true"></i> Enrich & Deploy</a> </li> </ul> </div> @@ -340,7 +340,7 @@ </div> </div> </div> - <app-functions-attribute (saveEvent)="saveBluePrint()"></app-functions-attribute> + <app-functions-attribute (saveEvent)="saveBlueprint()"></app-functions-attribute> </div> </div> </div> diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts index 652d235a0..adcc08cb1 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts @@ -37,7 +37,7 @@ import { GraphGenerator } from './graph.generator.util'; import { FunctionsStore } from './functions.store'; import { Subject } from 'rxjs'; import { distinctUntilChanged, takeUntil } from 'rxjs/operators'; -import { BluePrintDetailModel } from '../model/BluePrint.detail.model'; +import { BlueprintDetailModel } from '../model/Blueprint.detail.model'; import { ActivatedRoute, Router } from '@angular/router'; import { DesignerService } from './designer.service'; import { FilesContent, FolderNodeElement } from '../package-creation/mapping-models/metadata/MetaDataTab.model'; @@ -66,7 +66,7 @@ export class DesignerComponent implements OnInit, OnDestroy { controllerSideBar: boolean; actionAttributesSideBar: boolean; functionAttributeSidebar: boolean; - viewedPackage: BluePrintDetailModel = new BluePrintDetailModel(); + viewedPackage: BlueprintDetailModel = new BlueprintDetailModel(); customActionName: string; showAction: boolean; cl = 'editBar'; @@ -125,7 +125,7 @@ export class DesignerComponent implements OnInit, OnDestroy { this.actionAttributesSideBar = !this.actionAttributesSideBar; } - publishBluePrint() { + publishBlueprint() { this.create(); this.zipFile.generateAsync({ type: 'blob' }) .then(blob => { @@ -138,7 +138,7 @@ export class DesignerComponent implements OnInit, OnDestroy { this.toastService.error(error.message, 'Package error'); console.log(error); }, () => { - // this.deployBluePrint = false; + // this.deployBlueprint = false; }); }); } @@ -456,7 +456,7 @@ export class DesignerComponent implements OnInit, OnDestroy { this.ngUnsubscribe.complete(); } - saveBluePrint() { + saveBlueprint() { this.ngxService.start(); FilesContent.clear(); let packageCreationModes: PackageCreationModes; @@ -468,11 +468,11 @@ export class DesignerComponent implements OnInit, OnDestroy { }); packageCreationModes.execute(this.cbaPackage, this.packageCreationUtils); this.filesData.push(this.folder.TREE_DATA); - this.saveBluePrintToDataBase(); + this.saveBlueprintToDataBase(); } - enrichBluePrint() { + enrichBlueprint() { this.ngxService.start(); console.log('start enrich ------------'); this.packageCreationStore.addTopologyTemplate(this.cbaPackage.templateTopology); @@ -529,7 +529,7 @@ export class DesignerComponent implements OnInit, OnDestroy { } - saveBluePrintToDataBase() { + saveBlueprintToDataBase() { this.create(); this.zipFile.generateAsync({ type: 'blob' }) .then(blob => { diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.service.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.service.ts index c0d79cae1..28ef7ee1e 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.service.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.service.ts @@ -26,7 +26,7 @@ import { Observable } from 'rxjs'; import { ApiService } from '../../../../common/core/services/api.typed.service'; import { ResourceDictionaryURLs, BlueprintURLs } from '../../../../common/constants/app-constants'; import { ModelType } from './model/ModelType.model'; -import { BluePrintDetailModel } from '../model/BluePrint.detail.model'; +import { BlueprintDetailModel } from '../model/Blueprint.detail.model'; @Injectable({ @@ -36,7 +36,7 @@ export class DesignerService { constructor( private api: ApiService<ModelType>, - private api2: ApiService<BluePrintDetailModel> + private api2: ApiService<BlueprintDetailModel> ) { } @@ -44,12 +44,12 @@ export class DesignerService { return this.api.get(ResourceDictionaryURLs.getResourceDictionary + '/' + modelDefinitionType); } - private getBluePrintModel(id: string): Observable<BluePrintDetailModel> { + private getBlueprintModel(id: string): Observable<BlueprintDetailModel> { return this.api2.getOne(BlueprintURLs.getOneBlueprint + '/' + id); } getPagedPackages(id: string) { - return this.getBluePrintModel(id); + return this.getBlueprintModel(id); } publishBlueprint(body: any | null, options?: any): Observable<any> { diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.component.ts index ae4d09d20..c48136eba 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.component.ts @@ -3,7 +3,7 @@ import { DesignerStore } from '../designer.store'; import { PackageCreationUtils } from '../../package-creation/package-creation.utils'; import { RouterLink, Router, ActivatedRoute } from '@angular/router'; import { Subject } from 'rxjs'; -import { BluePrintDetailModel } from '../../model/BluePrint.detail.model'; +import { BlueprintDetailModel } from '../../model/Blueprint.detail.model'; import { viewClassName } from '@angular/compiler'; import { SourceViewService } from './source-view.service'; @@ -19,7 +19,7 @@ export class DesignerSourceViewComponent implements OnInit, OnDestroy { lang = 'json'; controllerSideBar: boolean; ngUnsubscribe = new Subject(); - viewedPackage: BluePrintDetailModel = new BluePrintDetailModel(); + viewedPackage: BlueprintDetailModel = new BlueprintDetailModel(); public customActionName = ''; cl = 'editBar'; packageId: string; diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.service.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.service.ts index 758952221..4ffd8a18e 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.service.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/source-view/source-view.service.ts @@ -1,7 +1,7 @@ import {Injectable} from '@angular/core'; import {Observable} from 'rxjs'; import { ApiService } from 'src/app/common/core/services/api.typed.service'; -import { BluePrintDetailModel } from '../../model/BluePrint.detail.model'; +import { BlueprintDetailModel } from '../../model/Blueprint.detail.model'; import { ModelType } from '../model/ModelType.model'; import { ResourceDictionaryURLs, BlueprintURLs } from 'src/app/common/constants/app-constants'; @@ -12,15 +12,15 @@ import { ResourceDictionaryURLs, BlueprintURLs } from 'src/app/common/constants/ }) export class SourceViewService { - constructor(private api1: ApiService<BluePrintDetailModel>) { + constructor(private api1: ApiService<BlueprintDetailModel>) { } - private getBluePrintModel(id: string): Observable<BluePrintDetailModel> { + private getBlueprintModel(id: string): Observable<BlueprintDetailModel> { return this.api1.getOne(BlueprintURLs.getOneBlueprint + '/' + id); } getPagedPackages(id: string) { - return this.getBluePrintModel(id); + return this.getBlueprintModel(id); } } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/BluePrint.detail.model.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/Blueprint.detail.model.ts index ff01695ab..160285b83 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/BluePrint.detail.model.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/Blueprint.detail.model.ts @@ -20,9 +20,9 @@ limitations under the License. */ import {Page} from 'src/app/common/model/page'; -import {BlueprintModel} from './BluePrint.model'; +import {BlueprintModel} from './Blueprint.model'; -export class BluePrintDetailModel extends BlueprintModel { +export class BlueprintDetailModel extends BlueprintModel { blueprintModelContent: BlueprintModelContent; } @@ -36,7 +36,7 @@ export class BlueprintModelContent { } /* -export class BluePrintDetailModelContent { - bluePrintDetailsModels: BluePrintDetailModel[]; +export class BlueprintDetailModelContent { + bluePrintDetailsModels: BlueprintDetailModel[]; }*/ diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/BluePrint.model.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/Blueprint.model.ts index 712b53b9a..ecc0062d9 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/BluePrint.model.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/Blueprint.model.ts @@ -37,5 +37,5 @@ export class BlueprintModel { tags: string; } -export class BluePrintPage extends Page<BlueprintModel> { +export class BlueprintPage extends Page<BlueprintModel> { } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/package-dashboard.state.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/package-dashboard.state.ts index b010f7a69..b6cf7fbdb 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/package-dashboard.state.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/package-dashboard.state.ts @@ -20,11 +20,11 @@ limitations under the License. */ -import { BluePrintDetailModel } from './BluePrint.detail.model'; +import { BlueprintDetailModel } from './Blueprint.detail.model'; import { Mapping, Scripts, Template } from '../package-creation/mapping-models/CBAPacakge.model'; export class PackageDashboardState { - configuration: BluePrintDetailModel; + configuration: BlueprintDetailModel; public scripts: Scripts; public templates: Template; public mapping: Mapping; diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/packages-dashboard.state.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/packages-dashboard.state.ts index f4f56c591..f7c5bb786 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/packages-dashboard.state.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/model/packages-dashboard.state.ts @@ -19,12 +19,12 @@ limitations under the License. ============LICENSE_END============================================ */ -import {BluePrintPage} from './BluePrint.model'; +import {BlueprintPage} from './Blueprint.model'; export class PackagesDashboardState { - page: BluePrintPage; - filteredPackages: BluePrintPage; + page: BlueprintPage; + filteredPackages: BlueprintPage; command: string; currentPage = 0; totalPackages: number; diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/metadata-tab/metadata-tab.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/metadata-tab/metadata-tab.component.ts index a46d2a3ec..1784346c7 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/metadata-tab/metadata-tab.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/metadata-tab/metadata-tab.component.ts @@ -105,7 +105,7 @@ export class MetadataTabComponent implements OnInit { console.log('in validate'); console.log('in this.metaDataTab.name' + this.metaDataTab.name); if (this.metaDataTab.name && this.metaDataTab.version) { - this.packageCreationService.checkBluePrintNameAndVersion(this.metaDataTab.name, this.metaDataTab.version).then(element => { + this.packageCreationService.checkBlueprintNameAndVersion(this.metaDataTab.name, this.metaDataTab.version).then(element => { if (element) { this.errorMessage = 'Package name already exists with this version. Use different name or different version number.'; } else if (!this.metaDataTab.version.match(this.versionPattern)) { diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation-extraction.service.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation-extraction.service.ts index 585c16929..389e95712 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation-extraction.service.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation-extraction.service.ts @@ -7,7 +7,7 @@ import * as JSZip from 'jszip'; import {PackageCreationUtils} from './package-creation.utils'; import {MetadataTabComponent} from './metadata-tab/metadata-tab.component'; import {DesignerStore} from '../designer/designer.store'; -import {BluePrintDetailModel} from '../model/BluePrint.detail.model'; +import {BlueprintDetailModel} from '../model/Blueprint.detail.model'; @Injectable({ providedIn: 'root' @@ -140,7 +140,7 @@ export class PackageCreationExtractionService { this.packageCreationStore.changeMetaData(metaDataObject); } - public setMetaDataWithObject(metaDataObject: MetaDataTabModel, bluePrintDetailModel: BluePrintDetailModel) { + public setMetaDataWithObject(metaDataObject: MetaDataTabModel, bluePrintDetailModel: BlueprintDetailModel) { metaDataObject.description = bluePrintDetailModel.artifactDescription; this.packageCreationStore.changeMetaData(metaDataObject); diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.html index d188dbfa2..9398bb961 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.html @@ -78,13 +78,13 @@ </header> <div class="container-fluid body-container"> - <ngx-ui-loader></ngx-ui-loader> + <ngx-ui-loader></ngx-ui-loader> <div class="container"> <div class="creat-action-container"> - <!-- <a class="action-button save" [hidden]="!isSaveEnabled" (click)="saveBluePrint()"> + <!-- <a class="action-button save" [hidden]="!isSaveEnabled" (click)="saveBlueprint()"> <i class="icon-save-sm" aria-hidden="true"></i> <span>Save</span>--> - <button tourAnchor="packageSave" (click)="saveBluePrint()" [disabled]="!isSaveEnabled" + <button tourAnchor="packageSave" (click)="saveBlueprint()" [disabled]="!isSaveEnabled" class="action-button save" aria-hidden="true"><i class="icon-save-sm" aria-hidden="true"></i> <span>Save</span></button> </div> diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.ts index 1d2340534..dc2b4dc03 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.ts @@ -109,7 +109,7 @@ export class PackageCreationComponent extends ComponentCanDeactivate implements // this.tourService.goto(step); } - saveBluePrint() { + saveBlueprint() { this.ngxService.start(); console.log(this.cbaPackage); FilesContent.clear(); @@ -121,13 +121,13 @@ export class PackageCreationComponent extends ComponentCanDeactivate implements // this.cbaPackage.templateTopology.content = this.designerStore.state.sourceContent; packageCreationModes.execute(this.cbaPackage, this.packageCreationUtils); this.filesData.push(this.folder.TREE_DATA); - this.saveBluePrintToDataBase(); + this.saveBlueprintToDataBase(); } - saveBluePrintToDataBase() { + saveBlueprintToDataBase() { this.create(); this.zipFile.generateAsync({ type: 'blob' }) .then(blob => { diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.service.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.service.ts index 1e0e36a51..ee8644ee3 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.service.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.service.ts @@ -67,12 +67,12 @@ export class PackageCreationService { return this.api.post(BlueprintURLs.enrichandpublish, body, {responseType: 'text'}); } - private deployBluePrint(body: any | null, options?: any): Observable<any> { + private deployBlueprint(body: any | null, options?: any): Observable<any> { return this.api.post(BlueprintURLs.deploy, body, {responseType: 'text'}); } - async checkBluePrintNameAndVersion(name: string, version: string): Promise<boolean> { - return await this.packagesListService.checkBluePrintIfItExists(name, version) + async checkBlueprintNameAndVersion(name: string, version: string): Promise<boolean> { + return await this.packagesListService.checkBlueprintIfItExists(name, version) .then(bluePrintModelsResult => bluePrintModelsResult != null && bluePrintModelsResult.length > 0); } @@ -97,7 +97,7 @@ export class PackageCreationService { deploy(blob) { const formData = this.getFormData(blob); - return this.deployBluePrint(formData); + return this.deployBlueprint(formData); } private getFormData(blob) { @@ -114,7 +114,7 @@ export class PackageCreationService { return this.api.getCustomized(BlueprintURLs.download + id, {responseType: 'blob'}); } - public saveBluePrintToDataBase(): Observable<string> { + public saveBlueprintToDataBase(): Observable<string> { this.formTreeData(); this.create(); const subject = new Subject<any>(); diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-api.service.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-api.service.ts index 8275f8c6c..1fab559d4 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-api.service.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-api.service.ts @@ -23,7 +23,7 @@ import {Injectable} from '@angular/core'; import {Observable} from 'rxjs'; import {ApiService} from '../../../common/core/services/api.typed.service'; import {BlueprintURLs} from '../../../common/constants/app-constants'; -import {BlueprintModel, BluePrintPage} from './model/BluePrint.model'; +import {BlueprintModel, BlueprintPage} from './model/Blueprint.model'; @Injectable({ @@ -33,10 +33,10 @@ export class PackagesApiService { packages: BlueprintModel[] = []; private numberOfPackages: number; - constructor(private api: ApiService<BluePrintPage>) { + constructor(private api: ApiService<BlueprintPage>) { } - getPagedPackages(pageNumber: number, pageSize: number, sortBy: string): Observable<BluePrintPage[]> { + getPagedPackages(pageNumber: number, pageSize: number, sortBy: string): Observable<BlueprintPage[]> { const sortType = sortBy.includes('DATE') ? 'DESC' : 'ASC'; return this.api.get(BlueprintURLs.getPagedBlueprints, { offset: pageNumber, @@ -46,7 +46,7 @@ export class PackagesApiService { }); } - async checkBluePrintIfItExists(name: string, version: string): Promise<BluePrintPage[]> { + async checkBlueprintIfItExists(name: string, version: string): Promise<BlueprintPage[]> { return await this.api.get(BlueprintURLs.getBlueprintByName + '/' + name + '/version/' + version).toPromise(); } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/filter-by-tags/filter-by-tags.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/filter-by-tags/filter-by-tags.component.ts index 6f02bbab8..b32b2b1e8 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/filter-by-tags/filter-by-tags.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/filter-by-tags/filter-by-tags.component.ts @@ -21,7 +21,7 @@ limitations under the License. import {Component, ElementRef, OnInit, QueryList, ViewChildren} from '@angular/core'; import {PackagesStore} from '../../packages.store'; -import {BlueprintModel, BluePrintPage} from '../../model/BluePrint.model'; +import {BlueprintModel, BlueprintPage} from '../../model/Blueprint.model'; @Component({ selector: 'app-filter-by-tags', @@ -31,7 +31,7 @@ import {BlueprintModel, BluePrintPage} from '../../model/BluePrint.model'; export class TagsFilteringComponent implements OnInit { - page: BluePrintPage; + page: BlueprintPage; tags: string[] = []; viewedTags: string[] = []; searchTag = ''; diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.spec.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.spec.ts index 000f9eda1..6068697d4 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.spec.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.spec.ts @@ -2,7 +2,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { PackageListComponent } from './package-list.component'; import { PackagesStore } from '../../packages.store'; -import { getBluePrintPageMock } from '../../blueprint.page.mock'; +import { getBlueprintPageMock } from '../../blueprint.page.mock'; import { of } from 'rxjs'; import {PackagesDashboardState} from '../../model/packages-dashboard.state'; @@ -14,7 +14,7 @@ describe('PackageListComponent', () => { beforeEach(async(() => { const dashBoard = new PackagesDashboardState(); - dashBoard.page = getBluePrintPageMock(); + dashBoard.page = getBlueprintPageMock(); store = { state$: of(dashBoard) }; TestBed.configureTestingModule({ diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.ts index 2f151d1bf..c2b597c9e 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.ts @@ -1,5 +1,5 @@ import {Component, OnInit} from '@angular/core'; -import {BlueprintModel} from '../../model/BluePrint.model'; +import {BlueprintModel} from '../../model/Blueprint.model'; import {PackagesStore} from '../../packages.store'; import {Router} from '@angular/router'; import {ConfigurationDashboardService} from '../../configuration-dashboard/configuration-dashboard.service'; diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/packages-header/packages-header.component.spec.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/packages-header/packages-header.component.spec.ts index 39228af76..4b572e054 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/packages-header/packages-header.component.spec.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/packages-header/packages-header.component.spec.ts @@ -4,7 +4,7 @@ import {PackagesHeaderComponent} from './packages-header.component'; import {PackagesStore} from '../../packages.store'; import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing'; import {PackagesDashboardState} from '../../model/packages-dashboard.state'; -import {getBluePrintPageMock} from '../../blueprint.page.mock'; +import {getBlueprintPageMock} from '../../blueprint.page.mock'; import {of} from 'rxjs'; import {By} from '@angular/platform-browser'; diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages.store.spec.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages.store.spec.ts index 379aaddf2..e65f05944 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages.store.spec.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages.store.spec.ts @@ -3,14 +3,14 @@ import { PackagesStore } from './packages.store'; import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { PackagesApiService } from './packages-api.service'; import { of } from 'rxjs'; -import { BluePrintPage } from './model/BluePrint.model'; -import { getBluePrintPageMock } from './blueprint.page.mock'; +import { BlueprintPage } from './model/Blueprint.model'; +import { getBlueprintPageMock } from './blueprint.page.mock'; import { PackagesDashboardState } from './model/packages-dashboard.state'; describe('PackagesStore', () => { // store: PackagesStore; - const MOCK_BLUEPRINTS_PAGE: BluePrintPage = getBluePrintPageMock(); + const MOCK_BLUEPRINTS_PAGE: BlueprintPage = getBlueprintPageMock(); let httpMock: HttpTestingController; diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages.store.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages.store.ts index 1e52e31dd..02682aafb 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages.store.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages.store.ts @@ -20,7 +20,7 @@ limitations under the License. */ import {Injectable} from '@angular/core'; -import {BluePrintPage} from './model/BluePrint.model'; +import {BlueprintPage} from './model/Blueprint.model'; import {Store} from '../../../common/core/stores/Store'; import {PackagesApiService} from './packages-api.service'; import {PackagesDashboardState} from './model/packages-dashboard.state'; @@ -33,7 +33,7 @@ import {NgxUiLoaderService} from 'ngx-ui-loader'; export class PackagesStore extends Store<PackagesDashboardState> { // TDOD fixed for now as there is no requirement to change it from UI public pageSize = 15; - private bluePrintContent: BluePrintPage = new BluePrintPage(); + private bluePrintContent: BlueprintPage = new BlueprintPage(); constructor( private packagesServiceList: PackagesApiService, @@ -83,7 +83,7 @@ export class PackagesStore extends Store<PackagesDashboardState> { protected getPagedPackages(pageNumber: number, pageSize: number, sortBy: string = this.state.sortBy) { this.packagesServiceList.getPagedPackages(pageNumber, pageSize, sortBy) - .subscribe((pages: BluePrintPage[]) => { + .subscribe((pages: BlueprintPage[]) => { this.setState({ ...this.state, page: pages[0], @@ -105,7 +105,7 @@ export class PackagesStore extends Store<PackagesDashboardState> { private searchPagedPackages(keyWord: string, pageNumber: number, pageSize: number, sortBy: string = this.state.sortBy) { this.packagesServiceList.getPagedPackagesByKeyWord(keyWord, pageNumber, pageSize, sortBy) - .subscribe((pages: BluePrintPage[]) => { + .subscribe((pages: BlueprintPage[]) => { this.setState({ ...this.state, page: pages[0], @@ -129,7 +129,7 @@ export class PackagesStore extends Store<PackagesDashboardState> { private getPagedPackagesByTags(keyWord: string, currentPage1: number, pageSize: number, sortBy1: string, tagsSearchable: string[]) { this.getPagedPackagesByKeyWordFilteredByTags(tagsSearchable) - .subscribe((pages: BluePrintPage) => { + .subscribe((pages: BlueprintPage) => { this.setState({ ...this.state, page: this.state.page, diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.html index 943707e6e..b60bc328a 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.html @@ -21,7 +21,7 @@ <div class="single-line-model"> <label class="label-name">Name</label> <div class="label-input"> - <input type="input" [(ngModel)]="metaDataTab.name" placeholder="Topology name.vLB.CDS"> + <input type="input" [(ngModel)]="metaDataTab.name" placeholder="Dictionary Name"> </div> <!-- <div class="model-note-container error-message"> Package name already exists with this version. Please enter a different name or enter different version @@ -74,18 +74,17 @@ <input type="input" [(ngModel)]="metaDataTab.libraryInstance" placeholder="Library Instance"> </div> </div> --> - <!-- <div class="single-line-model"> - <label class="label-name">Derived From</label> + <div class="single-line-model"> + <label class="label-name">Updated By</label> <div class="label-input"> - <input type="input" [(ngModel)]="metaDataTab.derivedFrom" placeholder="Derived From"> + <input type="input" [(ngModel)]="metaDataTab['updated-by']" placeholder="Updated By"> </div> - </div> --> + </div> <div class="single-line-model"> <label class="label-name">Tags</label> <div class="label-input"> - <input type="input" (keyup.enter)="addTag($event)" - placeholder="Ex., vDNS-CDS"> + <input type="input" (keyup.enter)="addTag($event)" placeholder="Ex., vDNS-CDS"> </div> <div class="model-note-container tag-notes">Seprate tags with comma or space</div> diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/resource-dictionary-creation.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/resource-dictionary-creation.component.html index 26857e600..00d6e31d3 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/resource-dictionary-creation.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/resource-dictionary-creation.component.html @@ -115,7 +115,7 @@ autofocus #nameit (focusout)="saveDictionaryToStore()">METADATA</a> <a class="nav-item nav-link" id="nav-source-tab" data-toggle="tab" href="#nav-source" role="tab" aria-controls="nav-source" aria-selected="false">SOURCES</a> - <a class="nav-item nav-link edit-button" id="nav-editor-tab" data-toggle="tab" + <a class="nav-item nav-link edit-button" (click)="saveDictionaryToStore()" id="nav-editor-tab" data-toggle="tab" href="#nav-editor" role="tab" aria-controls="nav-editor" aria-selected="false">EDITOR MODE</a> </div> diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/sources-template/sources-template.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/sources-template/sources-template.component.html index 14a0b6668..3eddaa79a 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/sources-template/sources-template.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/sources-template/sources-template.component.html @@ -32,18 +32,20 @@ (change)="onChange(item, $event.target.checked)"> {{item.name}} --> <div class="custom-control custom-checkbox"> - <input type="checkbox" class="custom-control-input" id="customControlValidation1" required> - <label class="custom-control-label" for="customControlValidation1">{{item.name}}</label> + <input [disabled]="sourcesOptions.has(item.name)" [checked]="tempSources.has(item.name)" + (change)="setTempSources($event,item)" type="checkbox" class="custom-control-input" + id="input-{{item.name}}"> + <label class="custom-control-label" for="input-{{item.name}}">{{item.name}}</label> </div> </div> </div> </div> <div class="row sourceOptionActions"> - <div class="col"> + <div (click)="selectAll()" class="col"> <a>Select all</a> </div> <div class="col"> - <button class="btn">Add to list</button> + <button (click)="addSources()" class="btn">Add to list</button> </div> </div> </div> @@ -54,71 +56,30 @@ <h5>Sources List</h5> <div class="accordion sourceListItems" id="accordionExample"> - <div class="card"> + <div class="card" *ngFor="let item of sourcesOptions | keyvalue; let i=index"> <div class="card-header" id="headingOne"> <h2 class="mb-0"> - <button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseOne" - aria-expanded="true" aria-controls="collapseOne"> + <button class="btn btn-link" type="button" data-toggle="collapse" attr.data-target="#collapse-{{item.key}}" + aria-expanded="true" attr.aria-controls="collapse-{{item.key}}"> <div class="custom-control custom-checkbox"> - <input type="checkbox" class="custom-control-input" id="customControlValidation1" required> - <label class="custom-control-label" for="customControlValidation1"></label> + <input (change)="setToDeleteSources($event,item)" type="checkbox" class="custom-control-input" + id="current-{{item.key}}" required> + <label class="custom-control-label" for="current-{{item.key}}"></label> </div> - Collapsible Group Item #1 + {{item.key}} </button> </h2> </div> - <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordionExample"> - <div class="card-body"> - Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf - moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. - Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda - shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea - proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim - aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. - </div> - </div> - </div> - <div class="card"> - <div class="card-header" id="headingTwo"> - <h2 class="mb-0"> - <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseTwo" - aria-expanded="false" aria-controls="collapseTwo"> - Collapsible Group Item #2 - </button> - </h2> - </div> - <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionExample"> + <div id="collapse-{{item.key}}" class="collapse" aria-labelledby="headingOne" data-parent="#accordionExample"> <div class="card-body"> - Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf - moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. - Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda - shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea - proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim - aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. - </div> - </div> - </div> - <div class="card"> - <div class="card-header" id="headingThree"> - <h2 class="mb-0"> - <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseThree" - aria-expanded="false" aria-controls="collapseThree"> - Collapsible Group Item #3 - </button> - </h2> - </div> - <div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#accordionExample"> - <div class="card-body"> - Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf - moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. - Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda - shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea - proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim - aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. + <ace-editor [mode]="'json'" [autoUpdateContent]="true" [durationBeforeCallback]="1000" + [theme]="'tomorrow_night_bright'" #editor style="height:300px;"> + </ace-editor> </div> </div> </div> + </div> <!-- <div cdkDropList #doneList="cdkDropList" [cdkDropListData]="sourcesOptions" [cdkDropListConnectedTo]="[todoList]" @@ -141,7 +102,7 @@ </div> --> <div class="row deleteSource"> <div class="col"> - <a type="submit" class="">Delete Source</a> + <a type="button" (click)="deleteSource()" class="">Delete Source</a> </div> </div> </div> diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/sources-template/sources-template.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/sources-template/sources-template.component.ts index 1a950163e..25b81994a 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/sources-template/sources-template.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/sources-template/sources-template.component.ts @@ -34,16 +34,19 @@ export class SourcesTemplateComponent implements OnInit { lang = 'json'; sources = {}; option = []; - sourcesOptions = []; textValue: any; selectItem: boolean; - ddSource = []; + // ddSource = []; checked: boolean; searchText = ''; text = ''; selectedArray = []; metaDataTab: MetaData = new MetaData(); + tempSources = new Map(); + toDeleteSource = new Map<string, any>(); + sourcesOptions = new Map<string, any>(); + constructor( private sourcesStore: SourcesStore, private dictionaryCreationService: DictionaryCreationService, @@ -58,9 +61,9 @@ export class SourcesTemplateComponent implements OnInit { // console.log(sources); this.sources = sources[0]; // this.sources = { - // "input": "source-input", "rest": "source-rest", "default":"source-default", "capability": "source-capability", - // "sdnc": "source-rest", "vault-data": "source-rest", "processor-db": "source-db", "aai-data": "source-rest", - // "script": "source-capability" + // "input": "source-input", "rest": "source-rest", "default": "source-default", "capability": "source-capability", + // "sdnc": "source-rest", "vault-data": "source-rest", "processor-db": "source-db", "aai-data": "source-rest", + // "script": "source-capability" // }; for (const key in this.sources) { if (key) { @@ -95,9 +98,13 @@ export class SourcesTemplateComponent implements OnInit { } saveSorcesDataToStore() { - console.log(this.ddSource); + const ddSource = []; + for (const key of this.sourcesOptions.keys()) { + ddSource.push(this.sourcesOptions.get(key)); + } + console.log(ddSource); this.metaDataTab.sources = {}; - for (const obj of this.ddSource) { + for (const obj of ddSource) { this.metaDataTab.sources = { ...this.metaDataTab.sources, ...obj }; } // this.metaDataTab.sources = { ...this.ddSource } @@ -105,39 +112,104 @@ export class SourcesTemplateComponent implements OnInit { this.dictionaryCreationStore.changeMetaData(this.metaDataTab); } - drop(event: CdkDragDrop<string[]>) { - console.log('-------------'); - // console.log(event); + setTempSources(event, item) { + console.log(event.target.checked); + if (event.target.checked) { + this.tempSources.set(item.name, item); + } else { + this.tempSources.delete(item.name); + } + console.log(this.tempSources); + } - if (event.previousContainer === event.container) { - moveItemInArray(event.container.data, event.previousIndex, event.currentIndex); + selectAll() { + if (this.tempSources.size === 0) { + for (const option of this.option) { + if (!this.sourcesOptions.has(option.name)) { + this.tempSources.set(option.name, option); + } + } } else { - transferArrayItem(event.previousContainer.data, - event.container.data, - event.previousIndex, - event.currentIndex); + this.tempSources = new Map<string, any>(); } + } - console.log(this.sourcesOptions); - console.log(this.sources); + setToDeleteSources(event, item) { + console.log(event.target.checked); + if (event.target.checked) { + this.toDeleteSource.set(item.key, item); + } else { + this.toDeleteSource.delete(item.key); + } - this.ddSource = []; + } - const originalSources = this.sourcesOptions; - for (const key of originalSources) { + addSources() { + // this.tempSources + const originalSources = this.tempSources; + for (const key of originalSources.keys()) { /* tslint:disable:no-string-literal */ - this.ddSource.push({ - [key.name]: { - type: key.value, + this.sourcesOptions.set(key, { + [key]: { + type: originalSources.get(key).value, properties: {} } }); } + console.log(this.sourcesOptions); + this.tempSources.clear(); + this.saveSorcesDataToStore(); + } + + deleteSource() { + console.log(this.toDeleteSource); + for (const key of this.toDeleteSource.keys()) { + console.log(key); + this.sourcesOptions.delete(key); + } + this.toDeleteSource = new Map<string, any>(); this.saveSorcesDataToStore(); } + // drop(event: CdkDragDrop<string[]>) { + // console.log('-------------'); + // // console.log(event); + + // if (event.previousContainer === event.container) { + // moveItemInArray(event.container.data, event.previousIndex, event.currentIndex); + // } else { + // transferArrayItem(event.previousContainer.data, + // event.container.data, + // event.previousIndex, + // event.currentIndex); + // } + + // console.log(this.sourcesOptions); + // console.log(this.sources); + + // this.ddSource = []; + + // const originalSources = this.sourcesOptions; + // for (const key of originalSources) { + // /* tslint:disable:no-string-literal */ + // this.ddSource.push({ + // [key.name]: { + // type: key.value, + // properties: {} + // } + // }); + + // } + + // this.saveSorcesDataToStore(); + // } + + getMapKey(map) { + return Object.assign({}, map.keys()); + } + searchDictionary(event: any) { this.searchQuery = event.target.value; this.searchQuery = this.searchQuery.trim(); |