From 3cda867a2c5e86c3ba7173b456a2db19daf49036 Mon Sep 17 00:00:00 2001 From: AhmedEldeeb50 Date: Tue, 23 Jun 2020 17:28:21 +0200 Subject: Fix "npm run build" errors Issue-ID: CCSDK-2474 Signed-off-by: AhmedEldeeb50 Change-Id: I1577ea0f576f4000c77f94d52d22d4c2212525b2 --- .../configuration-dashboard.component.html | 66 +++++----- .../configuration-dashboard.component.ts | 140 +++++++++++---------- .../packages/designer/designer.component.ts | 77 ++++++------ .../designer/source-view/source-view.component.ts | 17 +-- .../metadata-tab/metadata-tab.component.html | 2 +- .../metadata-tab/metadata-tab.component.ts | 4 +- .../package-creation/package-creation.component.ts | 55 ++++---- .../filter-by-tags/filter-by-tags.component.ts | 8 +- .../search-by-packages.component.ts | 6 +- .../dictionary-editor.component.ts | 3 +- .../dictionary-metadata.component.ts | 14 +-- .../resource-dictionary-creation.component.ts | 15 +-- .../sources-template/sources-template.component.ts | 46 +++---- .../filterby-tags/filterby-tags.component.ts | 128 +++++++++---------- .../search-dictionary.component.ts | 8 +- 15 files changed, 310 insertions(+), 279 deletions(-) (limited to 'cds-ui/designer-client/src/app') 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 bf6bf1251..18c9277eb 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 @@ -8,7 +8,7 @@
@@ -22,8 +22,8 @@
- - + + Save @@ -43,7 +43,7 @@ + (click)="downloadPackage(viewedPackage.artifactName,viewedPackage.artifactVersion)"> Download @@ -83,19 +83,19 @@
  • @@ -138,7 +138,8 @@
    -
    @@ -155,7 +156,8 @@
    -
    @@ -173,7 +175,8 @@
    -
    @@ -192,7 +195,8 @@
    @@ -392,7 +401,8 @@

    0 selected

    -
    @@ -661,17 +671,17 @@
    @@ -680,24 +690,24 @@
    +
    \ No newline at end of file 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 471b25383..0ff8d952f 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,20 +1,21 @@ -import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; -import {ActivatedRoute, Router} from '@angular/router'; -import {BluePrintDetailModel} from '../model/BluePrint.detail.model'; -import {PackageCreationStore} from '../package-creation/package-creation.store'; -import {FilesContent, FolderNodeElement, MetaDataTabModel} from '../package-creation/mapping-models/metadata/MetaDataTab.model'; -import {MetadataTabComponent} from '../package-creation/metadata-tab/metadata-tab.component'; +import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { BluePrintDetailModel } from '../model/BluePrint.detail.model'; +import { PackageCreationStore } from '../package-creation/package-creation.store'; +import { FilesContent, FolderNodeElement, MetaDataTabModel } from '../package-creation/mapping-models/metadata/MetaDataTab.model'; +import { MetadataTabComponent } from '../package-creation/metadata-tab/metadata-tab.component'; import * as JSZip from 'jszip'; -import {ConfigurationDashboardService} from './configuration-dashboard.service'; -import {VlbDefinition} from '../package-creation/mapping-models/definitions/VlbDefinition'; -import {DslDefinition} from '../package-creation/mapping-models/CBAPacakge.model'; -import {PackageCreationUtils} from '../package-creation/package-creation.utils'; -import {PackageCreationModes} from '../package-creation/creationModes/PackageCreationModes'; -import {PackageCreationBuilder} from '../package-creation/creationModes/PackageCreationBuilder'; -import {saveAs} from 'file-saver'; -import {DesignerStore} from '../designer/designer.store'; -import {DesignerService} from '../designer/designer.service'; -import {ToastrService} from 'ngx-toastr'; +import { ConfigurationDashboardService } from './configuration-dashboard.service'; +import { VlbDefinition } from '../package-creation/mapping-models/definitions/VlbDefinition'; +import { DslDefinition } from '../package-creation/mapping-models/CBAPacakge.model'; +import { PackageCreationUtils } from '../package-creation/package-creation.utils'; +import { PackageCreationModes } from '../package-creation/creationModes/PackageCreationModes'; +import { PackageCreationBuilder } from '../package-creation/creationModes/PackageCreationBuilder'; +import { saveAs } from 'file-saver'; +import { DesignerStore } from '../designer/designer.store'; +import { DesignerService } from '../designer/designer.service'; +import { ToastrService } from 'ngx-toastr'; +import { NgxFileDropEntry } from 'ngx-file-drop'; @Component({ selector: 'app-configuration-dashboard', @@ -23,28 +24,30 @@ import {ToastrService} from 'ngx-toastr'; }) export class ConfigurationDashboardComponent implements OnInit { viewedPackage: BluePrintDetailModel = new BluePrintDetailModel(); - @ViewChild(MetadataTabComponent, {static: false}) - private metadataTabComponent: MetadataTabComponent; + @ViewChild(MetadataTabComponent, { static: false }) + metadataTabComponent: MetadataTabComponent; public customActionName = ''; entryDefinitionKeys: string[] = ['template_tags', 'user-groups', 'author-email', 'template_version', 'template_name', 'template_author', 'template_description']; - @ViewChild('nameit', {static: true}) - private elementRef: ElementRef; - - private zipFile: JSZip = new JSZip(); - private filesData: any = []; - private folder: FolderNodeElement = new FolderNodeElement(); - - private currentBlob = new Blob(); - - constructor(private route: ActivatedRoute, private configurationDashboardService: ConfigurationDashboardService, - private packageCreationStore: PackageCreationStore, - private packageCreationUtils: PackageCreationUtils, - private router: Router, - private designerStore: DesignerStore, - private designerService: DesignerService, - private toastService: ToastrService + @ViewChild('nameit', { static: true }) + elementRef: ElementRef; + uploadedFiles = []; + zipFile: JSZip = new JSZip(); + filesData: any = []; + folder: FolderNodeElement = new FolderNodeElement(); + + currentBlob = new Blob(); + + constructor( + private route: ActivatedRoute, + private configurationDashboardService: ConfigurationDashboardService, + private packageCreationStore: PackageCreationStore, + private packageCreationUtils: PackageCreationUtils, + private router: Router, + private designerStore: DesignerStore, + private designerService: DesignerService, + private toastService: ToastrService ) { } @@ -65,39 +68,39 @@ export class ConfigurationDashboardComponent implements OnInit { private downloadCBAPackage(bluePrintDetailModels: BluePrintDetailModel) { this.configurationDashboardService.downloadResource( bluePrintDetailModels[0].artifactName + '/' + bluePrintDetailModels[0].artifactVersion).subscribe(response => { - const blob = new Blob([response], {type: 'application/octet-stream'}); - this.currentBlob = blob; - this.zipFile.loadAsync(blob).then((zip) => { - Object.keys(zip.files).forEach((filename) => { - zip.files[filename].async('string').then((fileData) => { - if (fileData) { - if (filename.includes('Scripts/')) { - this.setScripts(filename, fileData); - } else if (filename.includes('Templates/')) { - if (filename.includes('-mapping.')) { - this.setMapping(filename, fileData); - } else if (filename.includes('-template.')) { - this.setTemplates(filename, fileData); + const blob = new Blob([response], { type: 'application/octet-stream' }); + this.currentBlob = blob; + this.zipFile.loadAsync(blob).then((zip) => { + Object.keys(zip.files).forEach((filename) => { + zip.files[filename].async('string').then((fileData) => { + if (fileData) { + if (filename.includes('Scripts/')) { + this.setScripts(filename, fileData); + } else if (filename.includes('Templates/')) { + if (filename.includes('-mapping.')) { + this.setMapping(filename, fileData); + } else if (filename.includes('-template.')) { + this.setTemplates(filename, fileData); + } + + } else if (filename.includes('Definitions/')) { + this.setImports(filename, fileData, bluePrintDetailModels); + } else if (filename.includes('TOSCA-Metadata/')) { + const metaDataTabInfo: MetaDataTabModel = this.getMetaDataTabInfo(fileData); + this.setMetaData(metaDataTabInfo, bluePrintDetailModels[0]); } - - } else if (filename.includes('Definitions/')) { - this.setImports(filename, fileData, bluePrintDetailModels); - } else if (filename.includes('TOSCA-Metadata/')) { - const metaDataTabInfo: MetaDataTabModel = this.getMetaDataTabInfo(fileData); - this.setMetaData(metaDataTabInfo, bluePrintDetailModels[0]); } - } + }); }); }); }); - }); } - private setScripts(filename: string, fileData: any) { + setScripts(filename: string, fileData: any) { this.packageCreationStore.addScripts(filename, fileData); } - private setImports(filename: string, fileData: any, bluePrintDetailModels: BluePrintDetailModel) { + setImports(filename: string, fileData: any, bluePrintDetailModels: BluePrintDetailModel) { if (filename.includes(bluePrintDetailModels[0].artifactName)) { let definition = new VlbDefinition(); definition = fileData as VlbDefinition; @@ -121,11 +124,11 @@ export class ConfigurationDashboardComponent implements OnInit { } } - private setTemplates(filename: string, fileData: any) { + setTemplates(filename: string, fileData: any) { this.packageCreationStore.addTemplate(filename, fileData); } - private setMapping(fileName: string, fileData: string) { + setMapping(fileName: string, fileData: string) { this.packageCreationStore.addMapping(fileName, fileData); } @@ -143,7 +146,7 @@ export class ConfigurationDashboardComponent implements OnInit { }); } - private setMetaData(metaDataObject: MetaDataTabModel, bluePrintDetailModel: BluePrintDetailModel) { + setMetaData(metaDataObject: MetaDataTabModel, bluePrintDetailModel: BluePrintDetailModel) { metaDataObject.description = bluePrintDetailModel.artifactDescription; this.packageCreationStore.changeMetaData(metaDataObject); @@ -166,7 +169,7 @@ export class ConfigurationDashboardComponent implements OnInit { saveBluePrintToDataBase() { this.create(); - this.zipFile.generateAsync({type: 'blob'}) + this.zipFile.generateAsync({ type: 'blob' }) .then(blob => { this.packageCreationStore.saveBluePrint(blob).subscribe( bluePrintDetailModels => { @@ -198,7 +201,7 @@ export class ConfigurationDashboardComponent implements OnInit { downloadPackage(artifactName: string, artifactVersion: string) { this.configurationDashboardService.downloadResource(artifactName + '/' + artifactVersion).subscribe(response => { - const blob = new Blob([response], {type: 'application/octet-stream'}); + const blob = new Blob([response], { type: 'application/octet-stream' }); saveAs(blob, artifactName + '-' + artifactVersion + '-CBA.zip'); }); } @@ -221,6 +224,17 @@ export class ConfigurationDashboardComponent implements OnInit { goToDesignerMode(id) { // this.designerService.setActionName(this.customActionName); - this.router.navigate(['/packages/designer', id, {actionName: this.customActionName}]); + this.router.navigate(['/packages/designer', id, { actionName: this.customActionName }]); + } + + public dropped(files: NgxFileDropEntry[]) { + + } + public fileOver(event) { + console.log(event); + } + + public fileLeave(event) { + console.log(event); } } 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 e2a8d642b..9462caf68 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 @@ -49,8 +49,8 @@ import { isDefined } from '@angular/compiler/src/util'; }) export class DesignerComponent implements OnInit, OnDestroy { - private controllerSideBar: boolean; - private attributesSideBar: boolean; + controllerSideBar: boolean; + attributesSideBar: boolean; functionAttributeSidebar: boolean; viewedPackage: BluePrintDetailModel = new BluePrintDetailModel(); customActionName: string; @@ -62,31 +62,32 @@ export class DesignerComponent implements OnInit, OnDestroy { paletteGraph: joint.dia.Graph; palettePaper: joint.dia.Paper; - private ngUnsubscribe = new Subject(); - private opt = { tx: 100, ty: 100 }; - - constructor(private designerStore: DesignerStore, - private functionStore: FunctionsStore, - private graphUtil: GraphUtil, - private graphGenerator: GraphGenerator, - private route: ActivatedRoute, - private designerService: DesignerService) { + ngUnsubscribe = new Subject(); + opt = { tx: 100, ty: 100 }; + + constructor( + private designerStore: DesignerStore, + private functionStore: FunctionsStore, + private graphUtil: GraphUtil, + private graphGenerator: GraphGenerator, + private route: ActivatedRoute, + private designerService: DesignerService) { this.controllerSideBar = true; this.attributesSideBar = false; this.showAction = false; this.functionAttributeSidebar = false; } - private _toggleSidebar1() { + _toggleSidebar1() { this.controllerSideBar = !this.controllerSideBar; if (this.controllerSideBar === false) { this.cl = 'editBar2'; - } + } if (this.controllerSideBar === true) { - this.cl = 'editBar'; - } + this.cl = 'editBar'; + } } - private _toggleSidebar2() { + _toggleSidebar2() { this.attributesSideBar = !this.attributesSideBar; } // private _toggleSidebar3() { @@ -164,7 +165,7 @@ export class DesignerComponent implements OnInit, OnDestroy { * auto arrange elements in graph * https://resources.jointjs.com/docs/jointjs/v3.1/joint.html#layout.DirectedGraph */ - joint.layout.DirectedGraph.layout( this.boardGraph.getCells(), { + joint.layout.DirectedGraph.layout(this.boardGraph.getCells(), { dagre, graphlib, setLinkVertices: false, @@ -203,17 +204,17 @@ export class DesignerComponent implements OnInit, OnDestroy { console.log('initializeBoard...'); this.boardGraph = new joint.dia.Graph(); this.boardPaper = new joint.dia.Paper({ - el: $('#board-paper'), - model: this.boardGraph, - // height: 720, - // width: 1100, - gridSize: 10, - drawGrid: true, - // background: { - // color: 'rgba(0, 255, 0, 0.3)' - // }, - cellViewNamespace: joint.shapes - }); + el: $('#board-paper'), + model: this.boardGraph, + // height: 720, + // width: 1100, + gridSize: 10, + drawGrid: true, + // background: { + // color: 'rgba(0, 255, 0, 0.3)' + // }, + cellViewNamespace: joint.shapes + }); this.boardPaper.on('all', element => { // console.log(element); @@ -273,13 +274,13 @@ export class DesignerComponent implements OnInit, OnDestroy { $('body').append(`
    ` - ); + ); const flyGraph = new joint.dia.Graph(); const flyPaper = new joint.dia.Paper({ - el: $('#flyPaper'), - model: flyGraph, - interactive: true - }); + el: $('#flyPaper'), + model: flyGraph, + interactive: true + }); const flyShape = draggedCell.model.clone(); const pos = draggedCell.model.position(); const offset = { @@ -312,15 +313,15 @@ export class DesignerComponent implements OnInit, OnDestroy { // step name is CDS realted terminology, please refer to tosca types const stepName = functionType; const functionElementForBoard = this.graphUtil.dropFunctionOverActionWithPosition( - stepName, functionType, - mouseupX, mouseupY, - target, offset, - this.boardGraph); + stepName, functionType, + mouseupX, mouseupY, + target, offset, + this.boardGraph); const parentCell = this.graphUtil.getParent(functionElementForBoard, this.boardPaper); if (parentCell && - parentCell.model.attributes.type === ActionElementTypeName && + parentCell.model.attributes.type === ActionElementTypeName && this.graphUtil.canEmpedMoreChildern(parentCell.model, this.boardGraph)) { if (this.graphUtil.isEmptyParent(parentCell.model)) { 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 487c19ad1..033e80081 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 @@ -17,16 +17,17 @@ export class DesignerSourceViewComponent implements OnInit, OnDestroy { content = ''; lang = 'json'; - private controllerSideBar: boolean; - private ngUnsubscribe = new Subject(); + controllerSideBar: boolean; + ngUnsubscribe = new Subject(); viewedPackage: BluePrintDetailModel = new BluePrintDetailModel(); public customActionName = ''; - constructor(private store: DesignerStore, - private packageCreationUtils: PackageCreationUtils, - private router: Router, - private route: ActivatedRoute, - private sourceViewService: SourceViewService) { + constructor( + private store: DesignerStore, + private packageCreationUtils: PackageCreationUtils, + private router: Router, + private route: ActivatedRoute, + private sourceViewService: SourceViewService) { this.controllerSideBar = true; } @@ -50,7 +51,7 @@ export class DesignerSourceViewComponent implements OnInit, OnDestroy { // TODO validate json against scheme console.log('convertAndOpenInDesingerView ...', this.content); this.store.saveSourceContent(this.content); - this.router.navigate(['/packages/designer', id, {actionName: this.customActionName}]); + this.router.navigate(['/packages/designer', id, { actionName: this.customActionName }]); } ngOnDestroy() { diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/metadata-tab/metadata-tab.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/metadata-tab/metadata-tab.component.html index 28f8938a7..bf94ebdbb 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/metadata-tab/metadata-tab.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/metadata-tab/metadata-tab.component.html @@ -59,7 +59,7 @@
    -
    Use ENTER to add tag
    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 dd9f45bf4..c74a1e01e 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 @@ -20,8 +20,8 @@ export class MetadataTabComponent implements OnInit { /* {name: 'Scripting Mode', style: 'mode-icon icon-topologySource'}, {name: 'Generic Script Mode', style: 'mode-icon icon-topologySource'}];*/ modeType = this.modes[0].name; - private metaDataTab: MetaDataTabModel = new MetaDataTabModel(); - private errorMessage: string; + metaDataTab: MetaDataTabModel = new MetaDataTabModel(); + errorMessage: string; versionPattern = '^(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)$'; constructor( 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 57c849761..0c5885cef 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 @@ -19,18 +19,18 @@ limitations under the License. ============LICENSE_END============================================ */ -import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; -import {FilesContent, FolderNodeElement, MetaDataTabModel} from './mapping-models/metadata/MetaDataTab.model'; +import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; +import { FilesContent, FolderNodeElement, MetaDataTabModel } from './mapping-models/metadata/MetaDataTab.model'; import * as JSZip from 'jszip'; -import {PackageCreationStore} from './package-creation.store'; -import {Definition} from './mapping-models/CBAPacakge.model'; -import {PackageCreationModes} from './creationModes/PackageCreationModes'; -import {PackageCreationBuilder} from './creationModes/PackageCreationBuilder'; -import {PackageCreationUtils} from './package-creation.utils'; -import {MetadataTabComponent} from './metadata-tab/metadata-tab.component'; -import {Router} from '@angular/router'; -import {ToastrService} from 'ngx-toastr'; +import { PackageCreationStore } from './package-creation.store'; +import { Definition } from './mapping-models/CBAPacakge.model'; +import { PackageCreationModes } from './creationModes/PackageCreationModes'; +import { PackageCreationBuilder } from './creationModes/PackageCreationBuilder'; +import { PackageCreationUtils } from './package-creation.utils'; +import { MetadataTabComponent } from './metadata-tab/metadata-tab.component'; +import { Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; @Component({ @@ -43,27 +43,28 @@ export class PackageCreationComponent implements OnInit { // adding initial referencing to designer mode - constructor(private packageCreationStore: PackageCreationStore, - private packageCreationUtils: PackageCreationUtils, - private router: Router, - private toastService: ToastrService) { + constructor( + private packageCreationStore: PackageCreationStore, + private packageCreationUtils: PackageCreationUtils, + private router: Router, + private toastService: ToastrService) { } counter = 0; modes: object[] = [ - {name: 'Designer Mode', style: 'mode-icon icon-designer-mode'}, - {name: 'Scripting Mode', style: 'mode-icon icon-scripting-mode'}]; - private metaDataTab: MetaDataTabModel = new MetaDataTabModel(); - private folder: FolderNodeElement = new FolderNodeElement(); - private zipFile: JSZip = new JSZip(); - private filesData: any = []; - private definition: Definition = new Definition(); + { name: 'Designer Mode', style: 'mode-icon icon-designer-mode' }, + { name: 'Scripting Mode', style: 'mode-icon icon-scripting-mode' }]; + metaDataTab: MetaDataTabModel = new MetaDataTabModel(); + folder: FolderNodeElement = new FolderNodeElement(); + zipFile: JSZip = new JSZip(); + filesData: any = []; + definition: Definition = new Definition(); - @ViewChild(MetadataTabComponent, {static: false}) - private metadataTabComponent: MetadataTabComponent; + @ViewChild(MetadataTabComponent, { static: false }) + metadataTabComponent: MetadataTabComponent; - @ViewChild('nameit', {static: true}) - private elementRef: ElementRef; + @ViewChild('nameit', { static: true }) + elementRef: ElementRef; ngOnInit() { this.elementRef.nativeElement.focus(); @@ -89,7 +90,7 @@ export class PackageCreationComponent implements OnInit { saveBluePrintToDataBase() { this.create(); - this.zipFile.generateAsync({type: 'blob'}) + this.zipFile.generateAsync({ type: 'blob' }) .then(blob => { this.packageCreationStore.saveBluePrint(blob).subscribe( bluePrintDetailModels => { @@ -99,7 +100,7 @@ export class PackageCreationComponent implements OnInit { this.router.navigate(['/packages/package/' + id]); } }, error => { - // this.toastService.error('error happened when editing ' + error.message); + // this.toastService.error('error happened when editing ' + error.message); console.log('Error -' + error.message); }); }); 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 28be5f5c8..228b6d6ab 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 @@ -19,9 +19,9 @@ limitations under the License. ============LICENSE_END============================================ */ -import {Component, OnDestroy, OnInit} from '@angular/core'; -import {PackagesStore} from '../../packages.store'; -import {BlueprintModel, BluePrintPage} from '../../model/BluePrint.model'; +import { Component, OnDestroy, OnInit } from '@angular/core'; +import { PackagesStore } from '../../packages.store'; +import { BlueprintModel, BluePrintPage } from '../../model/BluePrint.model'; @Component({ selector: 'app-filter-by-tags', @@ -36,7 +36,7 @@ export class TagsFilteringComponent implements OnInit { viewedTags: string[] = []; searchTag = ''; viewedPackages: BlueprintModel[] = []; - private checkBoxTages = ''; + checkBoxTages = ''; currentPage = 0; constructor(private packagesStore: PackagesStore, diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/search-by-packages/search-by-packages.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/search-by-packages/search-by-packages.component.ts index 91304e5c2..dc1965fde 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/search-by-packages/search-by-packages.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/search-by-packages/search-by-packages.component.ts @@ -1,5 +1,5 @@ -import {Component, OnInit} from '@angular/core'; -import {PackagesStore} from '../../packages.store'; +import { Component, OnInit } from '@angular/core'; +import { PackagesStore } from '../../packages.store'; @Component({ selector: 'app-packages-search', @@ -8,7 +8,7 @@ import {PackagesStore} from '../../packages.store'; }) export class PackagesSearchComponent implements OnInit { - private searchQuery = ''; + searchQuery = ''; constructor(private packagesStore: PackagesStore) { } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-editor/dictionary-editor.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-editor/dictionary-editor.component.ts index 92b27c24c..157a5aa25 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-editor/dictionary-editor.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-editor/dictionary-editor.component.ts @@ -25,8 +25,9 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./dictionary-editor.component.css'] }) export class DictionaryEditorComponent implements OnInit { + text = ''; constructor() { - } + } ngOnInit() { } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.ts index d5c4a109b..aa975f87a 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.ts @@ -25,22 +25,22 @@ import { DictionaryCreationStore } from '../dictionary-creation.store'; import { MetaData } from '../../model/metaData.model'; @Component({ - selector: 'app-dictionary-metadata', - templateUrl: './dictionary-metadata.component.html', - styleUrls: ['./dictionary-metadata.component.css'] + selector: 'app-dictionary-metadata', + templateUrl: './dictionary-metadata.component.html', + styleUrls: ['./dictionary-metadata.component.css'] }) export class DictionaryMetadataComponent implements OnInit { - packageNameAndVersionEnables = true; + packageNameAndVersionEnables = true; counter = 0; tags = new Set(); - private metaDataTab: MetaData = new MetaData(); - private errorMessage: string; + metaDataTab: MetaData = new MetaData(); + errorMessage: string; constructor( private route: ActivatedRoute, private dictionaryCreationService: DictionaryCreationService, private dictionaryCreationStore: DictionaryCreationStore - ) {} + ) { } ngOnInit() { this.dictionaryCreationStore.state$.subscribe(element => { diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/resource-dictionary-creation.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/resource-dictionary-creation.component.ts index 1a3484bae..e32db8a37 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/resource-dictionary-creation.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/resource-dictionary-creation.component.ts @@ -36,20 +36,21 @@ export class ResourceDictionaryCreationComponent implements OnInit { } modes: object[] = [ - {name: 'Designer Mode', style: 'mode-icon icon-designer-mode'}, - {name: 'Scripting Mode', style: 'mode-icon icon-scripting-mode'} + { name: 'Designer Mode', style: 'mode-icon icon-designer-mode' }, + { name: 'Scripting Mode', style: 'mode-icon icon-scripting-mode' } ]; - private metaDataTab: DictionaryModel = new DictionaryModel(); - private definition: Definition = new Definition(); + metaDataTab: DictionaryModel = new DictionaryModel(); + definition: Definition = new Definition(); + createDate = ''; - @ViewChild(DictionaryMetadataComponent, {static: false}) + @ViewChild(DictionaryMetadataComponent, { static: false }) private metadataTabComponent: DictionaryMetadataComponent; - @ViewChild(SourcesTemplateComponent, {static: false}) + @ViewChild(SourcesTemplateComponent, { static: false }) private sourcesTemplateComponent: SourcesTemplateComponent; - @ViewChild('nameit', {static: true}) + @ViewChild('nameit', { static: true }) private elementRef: ElementRef; ngOnInit() { 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 4a4f215cd..1b70a17ef 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 @@ -17,7 +17,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ -import { Component, OnInit} from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop'; import { SourcesStore } from './sources.store'; @@ -36,13 +36,15 @@ export class SourcesTemplateComponent implements OnInit { selectItem: boolean; ddSource = []; checked: boolean; + searchText = ''; + text = ''; selectedArray = []; constructor(private sourcesStore: SourcesStore) { this.sourcesStore.state$.subscribe(sources => { this.sources = sources.sources; for (const key in this.sources) { if (key) { - const sourceObj = { name: key, value: JSON.stringify(this.sources[key] )}; + const sourceObj = { name: key, value: JSON.stringify(this.sources[key]) }; this.option.push(sourceObj); } } @@ -58,27 +60,27 @@ export class SourcesTemplateComponent implements OnInit { } drop(event: CdkDragDrop) { - this.ddSource = []; - 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); - } + this.ddSource = []; + 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); + } - for (const key2 in this.sources) { - if (key2) { - const originalSources = this.sourcesOptions; - for (const key of originalSources) { - if (key.name === key2) { - const obj = `{${key.name}: ${key.value}}`; - this.ddSource.push(obj); - } + for (const key2 in this.sources) { + if (key2) { + const originalSources = this.sourcesOptions; + for (const key of originalSources) { + if (key.name === key2) { + const obj = `{${key.name}: ${key.value}}`; + this.ddSource.push(obj); } } } + } } searchDictionary(event: any) { @@ -98,9 +100,9 @@ export class SourcesTemplateComponent implements OnInit { const editedData = JSON.parse(event); const originalSources = this.sources; for (const key in originalSources) { - if (key === item.name) { - this.sources[key] = editedData; - } + if (key === item.name) { + this.sources[key] = editedData; + } } this.option = []; this.sourcesStore.changeSources(this.sources); diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-dashboard/filterby-tags/filterby-tags.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-dashboard/filterby-tags/filterby-tags.component.ts index bdf6bd1ea..3ad1b34e0 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-dashboard/filterby-tags/filterby-tags.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-dashboard/filterby-tags/filterby-tags.component.ts @@ -23,78 +23,78 @@ import { DictionaryModel, DictionaryPage } from '../../model/dictionary.model'; import { DictionaryStore } from '../../dictionary.store'; @Component({ - selector: 'app-filterby-tags', - templateUrl: './filterby-tags.component.html', - styleUrls: ['./filterby-tags.component.css'] + selector: 'app-filterby-tags', + templateUrl: './filterby-tags.component.html', + styleUrls: ['./filterby-tags.component.css'] }) export class FilterbyTagsComponent implements OnInit { - page: DictionaryPage; - tags: string[] = []; - viewedTags: string[] = []; - searchTag = ''; - viewedDictionary: DictionaryModel[] = []; - private checkBoxTages = ''; - currentPage = 0; + page: DictionaryPage; + tags: string[] = []; + viewedTags: string[] = []; + searchTag = ''; + viewedDictionary: DictionaryModel[] = []; + checkBoxTages = ''; + currentPage = 0; - constructor(private dictionaryStore: DictionaryStore) { - this.dictionaryStore.state$.subscribe(state => { - console.log(state); - if (state.page) { - this.viewedDictionary = state.page.content; - this.tags = []; - if (state.currentPage !== this.currentPage) { - this.checkBoxTages = ''; - this.currentPage = state.currentPage; - } - this.viewedDictionary.forEach(element => { - element.tags.split(',').forEach(tag => { - this.tags.push(tag.trim()); - }); - this.tags.push('All'); - this.tags = this.tags.filter((value, index, self) => self.indexOf(value) === index); - this.assignTags(); - }); - } - }); - } + constructor(private dictionaryStore: DictionaryStore) { + this.dictionaryStore.state$.subscribe(state => { + console.log(state); + if (state.page) { + this.viewedDictionary = state.page.content; + this.tags = []; + if (state.currentPage !== this.currentPage) { + this.checkBoxTages = ''; + this.currentPage = state.currentPage; + } + this.viewedDictionary.forEach(element => { + element.tags.split(',').forEach(tag => { + this.tags.push(tag.trim()); + }); + this.tags.push('All'); + this.tags = this.tags.filter((value, index, self) => self.indexOf(value) === index); + this.assignTags(); + }); + } + }); + } - ngOnInit() { + ngOnInit() { - } + } - reloadChanges(event: any) { - this.searchTag = event.target.value; - this.filterItem(this.searchTag); - } + reloadChanges(event: any) { + this.searchTag = event.target.value; + this.filterItem(this.searchTag); + } - private assignTags() { - this.viewedTags = this.tags; - } + private assignTags() { + this.viewedTags = this.tags; + } - private filterItem(value) { - if (!value) { - this.assignTags(); - } - this.viewedTags = this.tags.filter( - item => item.toLowerCase().indexOf(value.toLowerCase()) > -1 - ); - } + private filterItem(value) { + if (!value) { + this.assignTags(); + } + this.viewedTags = this.tags.filter( + item => item.toLowerCase().indexOf(value.toLowerCase()) > -1 + ); + } - reloadDictionary(event: any) { - if (!event.target.checked) { - this.checkBoxTages = this.checkBoxTages.replace(event.target.id + ',', '') - .replace(event.target.id, ''); - } else { - this.checkBoxTages += event.target.id.trim() + ','; - } - const tagsSelected = this.checkBoxTages.split(',').filter(item => { - if (item) { - return true; - } - }).map((item) => { - return item.trim(); - }); - this.dictionaryStore.filterByTags(tagsSelected); - } + reloadDictionary(event: any) { + if (!event.target.checked) { + this.checkBoxTages = this.checkBoxTages.replace(event.target.id + ',', '') + .replace(event.target.id, ''); + } else { + this.checkBoxTages += event.target.id.trim() + ','; + } + const tagsSelected = this.checkBoxTages.split(',').filter(item => { + if (item) { + return true; + } + }).map((item) => { + return item.trim(); + }); + this.dictionaryStore.filterByTags(tagsSelected); + } } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-dashboard/search-dictionary/search-dictionary.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-dashboard/search-dictionary/search-dictionary.component.ts index 76e40cf7d..d1fb4fc85 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-dashboard/search-dictionary/search-dictionary.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-dashboard/search-dictionary/search-dictionary.component.ts @@ -27,16 +27,16 @@ import { DictionaryStore } from '../../dictionary.store'; styleUrls: ['./search-dictionary.component.css'] }) export class SearchDictionaryComponent implements OnInit { - private searchQuery = ''; + searchQuery = ''; constructor(private dictionaryStore: DictionaryStore) { } ngOnInit() { } searchDictionary(event: any) { - this.searchQuery = event.target.value; - this.searchQuery = this.searchQuery.trim(); - this.dictionaryStore.search(this.searchQuery); + this.searchQuery = event.target.value; + this.searchQuery = this.searchQuery.trim(); + this.dictionaryStore.search(this.searchQuery); } } -- cgit 1.2.3-korg