diff options
author | k.kedron <k.kedron@partner.samsung.com> | 2019-07-26 10:56:11 +0200 |
---|---|---|
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2019-08-13 14:09:38 +0000 |
commit | 0f0f94fa45483b6fbbab61535297289d2e752e71 (patch) | |
tree | cd55019083e492720ebe01805727a2c5cd25f64d | |
parent | 9362739916b3dac1aba957317866b67a35757443 (diff) |
Small tslint fixes in the general, home and store component.
Issue-ID: SDC-2312
Signed-off-by: Krystian Kedron <k.kedron@partner.samsung.com>
Change-Id: I69bdc0a3b2fa6f5a425447e5012b4d2442805379
-rw-r--r-- | public/package.json | 7 | ||||
-rw-r--r-- | public/src/app/general/general.component.ts | 10 | ||||
-rw-r--r-- | public/src/app/home/home.component.ts | 17 | ||||
-rw-r--r-- | public/src/app/store/store.ts | 14 |
4 files changed, 23 insertions, 25 deletions
diff --git a/public/package.json b/public/package.json index 9ab6240..b5b0e19 100644 --- a/public/package.json +++ b/public/package.json @@ -16,14 +16,15 @@ "war-remote": "mvn clean install", "storybook": "start-storybook -p 9001 -c .storybook", "build-storybook": "build-storybook", - "format": - "prettier --write \"src/{app,environments,assets}/**/*{.ts,.js,.json,.css,.scss}\"", + "format": "prettier --write \"src/{app,environments,assets}/**/*{.ts,.js,.json,.css,.scss}\"", "format:fix": "pretty-quick --staged", "precommit": "pretty-quick --staged" }, "jest": { "preset": "jest-preset-angular", - "roots": ["<rootDir>/src"], + "roots": [ + "<rootDir>/src" + ], "setupTestFrameworkScriptFile": "<rootDir>/src/setupJest.ts", "globals": { "ts-jest": { diff --git a/public/src/app/general/general.component.ts b/public/src/app/general/general.component.ts index 094949a..d1f03d3 100644 --- a/public/src/app/general/general.component.ts +++ b/public/src/app/general/general.component.ts @@ -49,10 +49,10 @@ export class GeneralComponent implements OnInit { vfniList = []; templates = []; serviceUUID: string; - vfcmts = new Array(); - versions = new Array(); - result = new Array(); - flowTypes = new Array(); + vfcmts = []; + versions = []; + result = []; + flowTypes = []; selectedVfcmt; selectedVersion = null; importCompleted = false; @@ -105,7 +105,7 @@ export class GeneralComponent implements OnInit { } versionChange(version) { const versionIndex = findIndex(propEq('version', version))(this.versions); - this.isLatestVersion = versionIndex === 0 ? true : false; + this.isLatestVersion = versionIndex === 0; const selectedVfcmtByVersion = find( propEq('version', version), this.result[this.selectedVfcmt] diff --git a/public/src/app/home/home.component.ts b/public/src/app/home/home.component.ts index 3b863b0..7052710 100644 --- a/public/src/app/home/home.component.ts +++ b/public/src/app/home/home.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectorRef, Component, ViewEncapsulation } from '@angular/core'; +import { Component, ViewEncapsulation } from '@angular/core'; import { MatDialog } from '@angular/material'; import { ActivatedRoute, Router } from '@angular/router'; import { ToastrService } from 'ngx-toastr'; @@ -8,7 +8,7 @@ import { ConfirmPopupComponent } from '../rule-engine/confirm-popup/confirm-popu // import { PluginPubSub } from '../sdc/plugin-pubsub'; import { PluginPubSub } from 'sdc-pubsub'; import { Store } from '../store/store'; -import { NgxDatatableModule } from '@swimlane/ngx-datatable'; +// import { NgxDatatableModule } from '@swimlane/ngx-datatable'; import { environment } from '../../environments/environment'; import { RuleEngineApiService } from '../rule-engine/api/rule-engine-api.service'; @@ -37,8 +37,7 @@ export class HomeComponent { private _ruleApi: RuleEngineApiService, private dialog: MatDialog, public store: Store, - private toastr: ToastrService, - private changeDetectorRef: ChangeDetectorRef + private toastr: ToastrService ) { this.store.loader = true; this.store.viewOnly = false; @@ -49,7 +48,7 @@ export class HomeComponent { console.log('params: %o', params); this.store.sdcParmas = params; - console.log('init comunication with sdc'); + console.log('init communication with sdc'); const eventsToWaitFor = [ 'WINDOW_OUT', 'VERSION_CHANGE', @@ -89,9 +88,7 @@ export class HomeComponent { } }); - this.linkToMain = `/main/${params.contextType}/${params.uuid}/${ - params.version - }/`; + this.linkToMain = `/main/${params.contextType}/${params.uuid}/${params.version}/`; this.loadingIndicator = true; this._restApi.getMonitoringComponents(params).subscribe( @@ -200,7 +197,7 @@ export class HomeComponent { submittedUuid ) .subscribe( - response => { + () => { this.itemDeletedRemoveAndNotify(item.uuid, this.deleteRow); this.store.loader = false; }, @@ -226,7 +223,7 @@ export class HomeComponent { item.vfiName ) .subscribe( - response => { + () => { this.itemDeletedRemoveAndNotify(item.uuid, this.deleteRow); this.store.loader = false; }, diff --git a/public/src/app/store/store.ts b/public/src/app/store/store.ts index a994e94..ec2c9dc 100644 --- a/public/src/app/store/store.ts +++ b/public/src/app/store/store.ts @@ -11,7 +11,7 @@ export class Store { @observable mcUuid; @observable mcName; @observable submittedMcUuid; - @observable monitoringComponents = new Array(); + @observable monitoringComponents = []; @observable cdump; @observable tabsProperties; @observable tabIndex = 0; @@ -34,8 +34,8 @@ export class Store { // rule-engine @observable tabParmasForRule; - @observable ruleList = new Array(); - @observable groupList = new Array(); + @observable ruleList = []; + @observable groupList = []; @observable ruleListExistParams; @observable ruleEditorInitializedState; @observable isLeftVisible; @@ -65,11 +65,11 @@ export class Store { .filter(item => item.groupId === rule.groupId) .map(item2 => { if (item2.list === undefined) { - item2.list = new Array(); + item2.list = []; } const ruleItemIndex = findIndex( item2.list, - ruleFromList => ruleFromList.uid === rule.uid + (ruleFromList: any) => ruleFromList.uid === rule.uid ); if (ruleItemIndex > -1) { item2.list[ruleItemIndex] = rule; @@ -111,8 +111,8 @@ export class Store { @action resetRuleList() { - this.ruleList = new Array(); - this.groupList = new Array(); + this.ruleList = []; + this.groupList = []; } @action |