mgr/dashboard: update npm packages (#28343)

mgr/dashboard: update npm packages

Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
Reviewed-by: Laura Paduano <lpaduano@suse.com>
Reviewed-by: Ricardo Marques <rimarques@suse.com>
Reviewed-by: Volker Theile <vtheile@suse.com>
This commit is contained in:
Lenz Grimmer 2019-08-05 12:20:20 +02:00 committed by GitHub
commit 7a6f741cbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
62 changed files with 5202 additions and 5154 deletions

View File

@ -87,10 +87,10 @@ build_dashboard_frontend() {
TEMP_DIR=`mktemp -d`
$CURR_DIR/src/tools/setup-virtualenv.sh --python=$(_python_autoselect) $TEMP_DIR
$TEMP_DIR/bin/pip install nodeenv
$TEMP_DIR/bin/nodeenv -p --node=10.13.0
$TEMP_DIR/bin/nodeenv -p --node=10.16.0
cd src/pybind/mgr/dashboard/frontend
. $TEMP_DIR/bin/activate
timeout 1h npm ci
NG_CLI_ANALYTICS="false" timeout 1h npm ci
npm run build -- --prod --progress=false
deactivate
cd $CURR_DIR

View File

@ -32,7 +32,7 @@ if(WITH_SYSTEM_NPM)
set(mgr-dashboard-nodeenv-dir )
set(nodeenv "")
add_custom_target(mgr-dashboard-frontend-deps
DEPENDS frontend/node_modules
DEPENDS frontend/node_modules
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/pybind/mgr/dashboard/frontend
)
else()
@ -43,7 +43,7 @@ else()
OUTPUT "${mgr-dashboard-nodeenv-dir}/bin/npm"
COMMAND ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python=${MGR_PYTHON_EXECUTABLE} ${mgr-dashboard-nodeenv-dir}
COMMAND ${mgr-dashboard-nodeenv-dir}/bin/pip install nodeenv
COMMAND ${mgr-dashboard-nodeenv-dir}/bin/nodeenv -p --node=10.13.0
COMMAND ${mgr-dashboard-nodeenv-dir}/bin/nodeenv -p --node=10.16.0
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "dashboard nodeenv is being installed"
)

View File

@ -87,7 +87,8 @@
]
}
}
}
},
"cli": {}
},
"ceph-dashboard-e2e": {
"root": "",
@ -112,7 +113,8 @@
]
}
}
}
},
"cli": {}
}
},
"defaultProject": "ceph-dashboard",
@ -124,5 +126,6 @@
"@schematics/angular:directive": {
"prefix": "cd"
}
}
},
"cli": {}
}

View File

@ -0,0 +1,12 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# You can see what browsers were selected by your queries by running:
# npx browserslist
> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.

File diff suppressed because it is too large Load Diff

View File

@ -37,8 +37,7 @@
"node_modules/(?!@ngrx|ngx-bootstrap|@progress)"
],
"transform": {
"^.+\\.(ts|html)$": "<rootDir>/node_modules/jest-preset-angular/preprocessor.js",
"^.+\\.js$": "babel-jest"
"^.+\\.(ts|js|html)$": "ts-jest"
},
"setupFiles": [
"jest-canvas-mock"
@ -56,64 +55,62 @@
"testURL": "http://localhost/"
},
"dependencies": {
"@angular/animations": "7.2.6",
"@angular/common": "7.2.6",
"@angular/compiler": "7.2.6",
"@angular/core": "7.2.6",
"@angular/forms": "7.2.6",
"@angular/http": "7.2.6",
"@angular/platform-browser": "7.2.6",
"@angular/platform-browser-dynamic": "7.2.6",
"@angular/router": "7.2.6",
"@auth0/angular-jwt": "2.1.0",
"@angular/animations": "8.2.0",
"@angular/common": "8.2.0",
"@angular/compiler": "8.2.0",
"@angular/core": "8.2.0",
"@angular/forms": "8.2.0",
"@angular/platform-browser": "8.2.0",
"@angular/platform-browser-dynamic": "8.2.0",
"@angular/router": "8.2.0",
"@auth0/angular-jwt": "2.1.1",
"@ngx-translate/i18n-polyfill": "1.0.0",
"@swimlane/ngx-datatable": "14.0.0",
"@swimlane/ngx-datatable": "15.0.0",
"bootstrap": "4.3.1",
"chart.js": "2.7.3",
"core-js": "2.6.5",
"detect-browser": "4.1.0",
"fork-awesome": "1.1.6",
"lodash": "4.17.13",
"chart.js": "2.8.0",
"core-js": "3.1.4",
"detect-browser": "4.6.0",
"fork-awesome": "1.1.7",
"lodash": "4.17.15",
"moment": "2.24.0",
"ng-block-ui": "2.1.1",
"ng-block-ui": "2.1.7",
"ng-bootstrap-form-validation": "4.0.0",
"ng2-charts": "1.6.0",
"ng2-charts": "2.3.0",
"ng2-tree": "2.0.0-rc.11",
"ngx-bootstrap": "4.3.0",
"ngx-toastr": "10.0.2",
"rxjs": "6.4.0",
"rxjs-compat": "6.4.0",
"ngx-bootstrap": "5.1.0",
"ngx-toastr": "10.0.4",
"rxjs": "6.5.2",
"rxjs-compat": "6.5.2",
"tslib": "1.9.3",
"zone.js": "0.8.29"
"zone.js": "0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.13.9",
"@angular/cli": "7.3.3",
"@angular/compiler-cli": "7.2.6",
"@angular/language-service": "7.2.6",
"@compodoc/compodoc": "1.1.9",
"@types/jasmine": "3.3.9",
"@angular-devkit/build-angular": "0.802.0",
"@angular/cli": "8.2.0",
"@angular/compiler-cli": "8.2.0",
"@angular/language-service": "8.2.0",
"@compodoc/compodoc": "1.1.10",
"@types/jasmine": "3.3.16",
"@types/jasminewd2": "2.0.6",
"@types/jest": "24.0.9",
"@types/lodash": "4.14.121",
"@types/node": "11.9.5",
"babel-preset-env": "1.7.0",
"codelyzer": "4.5.0",
"@types/jest": "24.0.16",
"@types/lodash": "4.14.136",
"@types/node": "12.6.9",
"codelyzer": "5.1.0",
"html-linter": "1.1.1",
"htmlhint": "0.11.0",
"jasmine-core": "3.3.0",
"jasmine-core": "3.4.0",
"jasmine-spec-reporter": "4.2.1",
"jest": "24.8.0",
"jest-canvas-mock": "1.1.0",
"jest-preset-angular": "6.0.2",
"jest-canvas-mock": "2.1.0",
"jest-preset-angular": "7.1.1",
"jest-silent-reporter": "0.1.2",
"prettier": "1.16.4",
"pretty-quick": "1.11.0",
"prettier": "1.18.2",
"pretty-quick": "1.11.1",
"protractor": "5.4.2",
"protractor-screenshoter-plugin": "0.10.3",
"replace-in-file": "3.4.3",
"ts-node": "8.0.2",
"replace-in-file": "4.1.1",
"ts-node": "8.3.0",
"tslint": "5.18.0",
"typescript": "3.2.4"
"typescript": "3.5.3"
}
}

View File

@ -179,7 +179,7 @@ const routes: Routes = [
canActivate: [AuthGuardService],
canActivateChild: [AuthGuardService],
data: { breadcrumbs: 'Pools' },
loadChildren: './ceph/pool/pool.module#RoutedPoolModule'
loadChildren: () => import('./ceph/pool/pool.module').then((m) => m.RoutedPoolModule)
},
// Block
{
@ -187,7 +187,7 @@ const routes: Routes = [
canActivateChild: [AuthGuardService],
canActivate: [AuthGuardService],
data: { breadcrumbs: true, text: 'Block', path: null },
loadChildren: './ceph/block/block.module#RoutedBlockModule'
loadChildren: () => import('./ceph/block/block.module').then((m) => m.RoutedBlockModule)
},
// Filesystems
{
@ -209,7 +209,7 @@ const routes: Routes = [
text: 'Object Gateway',
path: null
},
loadChildren: './ceph/rgw/rgw.module#RoutedRgwModule'
loadChildren: () => import('./ceph/rgw/rgw.module').then((m) => m.RoutedRgwModule)
},
// User/Role Management
{
@ -217,7 +217,7 @@ const routes: Routes = [
canActivate: [AuthGuardService],
canActivateChild: [AuthGuardService],
data: { breadcrumbs: 'User management', path: null },
loadChildren: './core/auth/auth.module#RoutedAuthModule'
loadChildren: () => import('./core/auth/auth.module').then((m) => m.RoutedAuthModule)
},
// User Profile
{

View File

@ -21,11 +21,11 @@ export class IscsiTargetDetailsComponent implements OnChanges, OnInit {
@Input()
settings: any;
@ViewChild('highlightTpl')
@ViewChild('highlightTpl', { static: true })
highlightTpl: TemplateRef<any>;
private detailTable: TableComponent;
@ViewChild('detailTable')
@ViewChild('detailTable', { static: false })
set content(content: TableComponent) {
this.detailTable = content;
if (content) {

View File

@ -30,7 +30,7 @@ import { IscsiTargetDiscoveryModalComponent } from '../iscsi-target-discovery-mo
providers: [TaskListService]
})
export class IscsiTargetListComponent implements OnInit, OnDestroy {
@ViewChild(TableComponent)
@ViewChild(TableComponent, { static: false })
table: TableComponent;
available: boolean = undefined;

View File

@ -12,13 +12,13 @@ import { IscsiBackstorePipe } from '../../../shared/pipes/iscsi-backstore.pipe';
styleUrls: ['./iscsi.component.scss']
})
export class IscsiComponent implements OnInit {
@ViewChild('statusColorTpl')
@ViewChild('statusColorTpl', { static: true })
statusColorTpl: TemplateRef<any>;
@ViewChild('iscsiSparklineTpl')
@ViewChild('iscsiSparklineTpl', { static: true })
iscsiSparklineTpl: TemplateRef<any>;
@ViewChild('iscsiPerSecondTpl')
@ViewChild('iscsiPerSecondTpl', { static: true })
iscsiPerSecondTpl: TemplateRef<any>;
@ViewChild('iscsiRelativeDateTpl')
@ViewChild('iscsiRelativeDateTpl', { static: true })
iscsiRelativeDateTpl: TemplateRef<any>;
gateways = [];

View File

@ -12,7 +12,7 @@ import { CephShortVersionPipe } from '../../../../shared/pipes/ceph-short-versio
styleUrls: ['./daemon-list.component.scss']
})
export class DaemonListComponent implements OnInit, OnDestroy {
@ViewChild('healthTmpl')
@ViewChild('healthTmpl', { static: true })
healthTmpl: TemplateRef<any>;
subs: Subscription;

View File

@ -11,11 +11,11 @@ import { RbdMirroringService } from '../../../../shared/api/rbd-mirroring.servic
styleUrls: ['./image-list.component.scss']
})
export class ImageListComponent implements OnInit, OnDestroy {
@ViewChild('stateTmpl')
@ViewChild('stateTmpl', { static: true })
stateTmpl: TemplateRef<any>;
@ViewChild('syncTmpl')
@ViewChild('syncTmpl', { static: true })
syncTmpl: TemplateRef<any>;
@ViewChild('progressTmpl')
@ViewChild('progressTmpl', { static: true })
progressTmpl: TemplateRef<any>;
subs: Subscription;

View File

@ -22,7 +22,7 @@ import { PoolEditPeerModalComponent } from '../pool-edit-peer-modal/pool-edit-pe
styleUrls: ['./pool-list.component.scss']
})
export class PoolListComponent implements OnInit, OnDestroy {
@ViewChild('healthTmpl')
@ViewChild('healthTmpl', { static: true })
healthTmpl: TemplateRef<any>;
subs: Subscription;

View File

@ -21,11 +21,11 @@ export class RbdConfigurationListComponent implements OnInit, OnChanges {
@Input()
data: RbdConfigurationEntry[];
poolConfigurationColumns: CdTableColumn[];
@ViewChild('configurationSourceTpl')
@ViewChild('configurationSourceTpl', { static: true })
configurationSourceTpl: TemplateRef<any>;
@ViewChild('configurationValueTpl')
@ViewChild('configurationValueTpl', { static: true })
configurationValueTpl: TemplateRef<any>;
@ViewChild('poolConfTable')
@ViewChild('poolConfTable', { static: true })
poolConfTable: TableComponent;
readonly sourceField = RbdConfigurationSourceField;

View File

@ -14,7 +14,7 @@ export class RbdDetailsComponent implements OnChanges {
selectedItem: RbdFormModel;
@Input()
images: any;
@ViewChild('poolConfigurationSourceTpl')
@ViewChild('poolConfigurationSourceTpl', { static: true })
poolConfigurationSourceTpl: TemplateRef<any>;
constructor() {}

View File

@ -39,15 +39,15 @@ const BASE_URL = 'block/rbd';
]
})
export class RbdListComponent implements OnInit {
@ViewChild(TableComponent)
@ViewChild(TableComponent, { static: true })
table: TableComponent;
@ViewChild('usageTpl')
@ViewChild('usageTpl', { static: false })
usageTpl: TemplateRef<any>;
@ViewChild('parentTpl')
@ViewChild('parentTpl', { static: true })
parentTpl: TemplateRef<any>;
@ViewChild('nameTpl')
@ViewChild('nameTpl', { static: false })
nameTpl: TemplateRef<any>;
@ViewChild('flattenTpl')
@ViewChild('flattenTpl', { static: true })
flattenTpl: TemplateRef<any>;
permission: Permission;

View File

@ -40,11 +40,11 @@ export class RbdSnapshotListComponent implements OnInit, OnChanges {
poolName: string;
@Input()
rbdName: string;
@ViewChild('nameTpl')
@ViewChild('nameTpl', { static: false })
nameTpl: TemplateRef<any>;
@ViewChild('protectTpl')
@ViewChild('protectTpl', { static: true })
protectTpl: TemplateRef<any>;
@ViewChild('rollbackTpl')
@ViewChild('rollbackTpl', { static: true })
rollbackTpl: TemplateRef<any>;
permission: Permission;

View File

@ -32,11 +32,11 @@ import { RbdTrashRestoreModalComponent } from '../rbd-trash-restore-modal/rbd-tr
providers: [TaskListService]
})
export class RbdTrashListComponent implements OnInit {
@ViewChild(TableComponent)
@ViewChild(TableComponent, { static: true })
table: TableComponent;
@ViewChild('expiresTpl')
@ViewChild('expiresTpl', { static: true })
expiresTpl: TemplateRef<any>;
@ViewChild('deleteTpl')
@ViewChild('deleteTpl', { static: true })
deleteTpl: TemplateRef<any>;
icons = Icons;

View File

@ -1,4 +1,5 @@
<div class="chart-container">
<div class="chart-container"
*ngIf="chart?.datasets">
<canvas baseChart
#chartCanvas
[datasets]="chart?.datasets"

View File

@ -1,6 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ChartsModule } from 'ng2-charts/ng2-charts';
import { ChartsModule } from 'ng2-charts';
import { configureTestBed } from '../../../../testing/unit-test-helper';
import { CephfsChartComponent } from './cephfs-chart.component';

View File

@ -11,9 +11,9 @@ import { ChartTooltip } from '../../../shared/models/chart-tooltip';
styleUrls: ['./cephfs-chart.component.scss']
})
export class CephfsChartComponent implements OnChanges, OnInit {
@ViewChild('chartCanvas')
@ViewChild('chartCanvas', { static: true })
chartCanvas: ElementRef;
@ViewChild('chartTooltip')
@ViewChild('chartTooltip', { static: true })
chartTooltip: ElementRef;
@Input()

View File

@ -16,9 +16,9 @@ import { AuthStorageService } from '../../../shared/services/auth-storage.servic
styleUrls: ['./cephfs-detail.component.scss']
})
export class CephfsDetailComponent implements OnChanges, OnInit {
@ViewChild('poolUsageTpl')
@ViewChild('poolUsageTpl', { static: true })
poolUsageTpl: TemplateRef<any>;
@ViewChild('activityTmpl')
@ViewChild('activityTmpl', { static: true })
activityTmpl: TemplateRef<any>;
@Input()

View File

@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ChartsModule } from 'ng2-charts/ng2-charts';
import { ChartsModule } from 'ng2-charts';
import { ProgressbarModule } from 'ngx-bootstrap/progressbar';
import { TabsModule } from 'ngx-bootstrap/tabs';

View File

@ -78,9 +78,9 @@ export class ConfigurationComponent implements OnInit {
}
];
@ViewChild('confValTpl')
@ViewChild('confValTpl', { static: true })
public confValTpl: TemplateRef<any>;
@ViewChild('confFlagTpl')
@ViewChild('confFlagTpl', { static: false })
public confFlagTpl: TemplateRef<any>;
constructor(

View File

@ -23,7 +23,7 @@ export class HostsComponent implements OnInit {
cdParams = { fromLink: '/hosts' };
selection = new CdTableSelection();
@ViewChild('servicesTpl')
@ViewChild('servicesTpl', { static: true })
public servicesTpl: TemplateRef<any>;
constructor(

View File

@ -22,7 +22,7 @@ import { NotificationService } from '../../../../shared/services/notification.se
styleUrls: ['./mgr-module-list.component.scss']
})
export class MgrModuleListComponent {
@ViewChild(TableComponent)
@ViewChild(TableComponent, { static: true })
table: TableComponent;
@BlockUI()
blockUI: NgBlockUI;

View File

@ -29,19 +29,19 @@ import { OsdScrubModalComponent } from '../osd-scrub-modal/osd-scrub-modal.compo
styleUrls: ['./osd-list.component.scss']
})
export class OsdListComponent implements OnInit {
@ViewChild('statusColor')
@ViewChild('statusColor', { static: true })
statusColor: TemplateRef<any>;
@ViewChild('osdUsageTpl')
@ViewChild('osdUsageTpl', { static: true })
osdUsageTpl: TemplateRef<any>;
@ViewChild('markOsdConfirmationTpl')
@ViewChild('markOsdConfirmationTpl', { static: true })
markOsdConfirmationTpl: TemplateRef<any>;
@ViewChild('criticalConfirmationTpl')
@ViewChild('criticalConfirmationTpl', { static: true })
criticalConfirmationTpl: TemplateRef<any>;
@ViewChild(TableComponent)
@ViewChild(TableComponent, { static: true })
tableComponent: TableComponent;
@ViewChild('reweightBodyTpl')
@ViewChild('reweightBodyTpl', { static: false })
reweightBodyTpl: TemplateRef<any>;
@ViewChild('safeToDestroyBodyTpl')
@ViewChild('safeToDestroyBodyTpl', { static: false })
safeToDestroyBodyTpl: TemplateRef<any>;
permissions: Permissions;

View File

@ -24,11 +24,11 @@ export class OsdPgScrubModalComponent {
resource: string;
permissions: Permissions;
@ViewChild('basicOptionsValues')
@ViewChild('basicOptionsValues', { static: true })
basicOptionsValues: ConfigOptionComponent;
basicOptions: Array<string> = OsdPgScrubModalOptions.basicOptions;
@ViewChild('advancedOptionsValues')
@ViewChild('advancedOptionsValues', { static: false })
advancedOptionsValues: ConfigOptionComponent;
advancedOptions: Array<string> = OsdPgScrubModalOptions.advancedOptions;

View File

@ -20,7 +20,7 @@ const BASE_URL = 'silence'; // as only silence actions can be used
styleUrls: ['./alert-list.component.scss']
})
export class AlertListComponent implements OnInit {
@ViewChild('externalLinkTpl')
@ViewChild('externalLinkTpl', { static: true })
externalLinkTpl: TemplateRef<any>;
columns: CdTableColumn[];
tableActions: CdTableAction[];

View File

@ -23,9 +23,9 @@ import { HealthPieColor } from './health-pie-color.enum';
styleUrls: ['./health-pie.component.scss']
})
export class HealthPieComponent implements OnChanges, OnInit {
@ViewChild('chartCanvas')
@ViewChild('chartCanvas', { static: true })
chartCanvasRef: ElementRef;
@ViewChild('chartTooltip')
@ViewChild('chartTooltip', { static: true })
chartTooltipRef: ElementRef;
@Input()
@ -75,7 +75,7 @@ export class HealthPieComponent implements OnChanges, OnInit {
// An extension to Chart.js to enable rendering some
// text in the middle of a doughnut
Chart.pluginService.register({
beforeDraw: function(chart) {
beforeDraw: function(chart: any) {
if (!chart.options.center_text) {
return;
}

View File

@ -2,7 +2,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core';
import { I18n } from '@ngx-translate/i18n-polyfill';
import * as _ from 'lodash';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { HealthService } from '../../../shared/api/health.service';
import { Icons } from '../../../shared/enum/icons.enum';

View File

@ -64,10 +64,18 @@ describe('NfsFormComponent', () => {
httpTesting.expectOne('ui-api/nfs-ganesha/cephx/clients').flush(['admin', 'fs', 'rgw']);
httpTesting.expectOne('ui-api/nfs-ganesha/cephfs/filesystems').flush([{ id: 1, name: 'a' }]);
httpTesting.expectOne('api/rgw/user').flush(['test', 'dev']);
httpTesting.expectOne('api/rgw/user/dev').flush({ suspended: 0, user_id: 'dev', keys: ['a'] });
httpTesting
.expectOne('api/rgw/user/test')
.flush({ suspended: 1, user_id: 'test', keys: ['a'] });
const user_dev = {
suspended: 0,
user_id: 'dev',
keys: ['a']
};
httpTesting.expectOne('api/rgw/user/dev').flush(user_dev);
const user_test = {
suspended: 1,
user_id: 'test',
keys: ['a']
};
httpTesting.expectOne('api/rgw/user/test').flush(user_test);
httpTesting.verify();
});

View File

@ -28,7 +28,7 @@ import { NfsFormClientComponent } from '../nfs-form-client/nfs-form-client.compo
styleUrls: ['./nfs-form.component.scss']
})
export class NfsFormComponent implements OnInit {
@ViewChild('nfsClients')
@ViewChild('nfsClients', { static: true })
nfsClients: NfsFormClientComponent;
permission: Permission;

View File

@ -28,12 +28,12 @@ import { TaskWrapperService } from '../../../shared/services/task-wrapper.servic
providers: [TaskListService]
})
export class NfsListComponent implements OnInit, OnDestroy {
@ViewChild('nfsState')
@ViewChild('nfsState', { static: false })
nfsState: TemplateRef<any>;
@ViewChild('nfsFsal')
@ViewChild('nfsFsal', { static: true })
nfsFsal: TemplateRef<any>;
@ViewChild('table')
@ViewChild('table', { static: true })
table: TableComponent;
columns: CdTableColumn[];

View File

@ -18,7 +18,7 @@ export class TablePerformanceCounterComponent implements OnInit {
columns: Array<CdTableColumn> = [];
counters: Array<object> = [];
@ViewChild('valueTpl')
@ViewChild('valueTpl', { static: false })
public valueTpl: TemplateRef<any>;
/**

View File

@ -23,7 +23,7 @@ export class PoolDetailsComponent implements OnChanges {
permissions: Permissions;
@Input()
cacheTiers: any[];
@ViewChild(TabsetComponent)
@ViewChild(TabsetComponent, { static: false })
tabsetChild: TabsetComponent;
selectedPoolConfiguration: RbdConfigurationEntry[];

View File

@ -39,12 +39,12 @@ const BASE_URL = 'pool';
styleUrls: ['./pool-list.component.scss']
})
export class PoolListComponent implements OnInit {
@ViewChild(TableComponent)
@ViewChild(TableComponent, { static: true })
table: TableComponent;
@ViewChild('poolUsageTpl')
@ViewChild('poolUsageTpl', { static: true })
poolUsageTpl: TemplateRef<any>;
@ViewChild('poolConfigurationSourceTpl')
@ViewChild('poolConfigurationSourceTpl', { static: false })
poolConfigurationSourceTpl: TemplateRef<any>;
pools: Pool[] = [];

View File

@ -118,9 +118,9 @@ describe('RgwBucketFormComponent', () => {
expect(component.zonegroup).toBe(payload.zonegroup);
const placementTargets = [];
for (const placementTarget of payload['placement_targets']) {
placementTarget['description'] = `${placementTarget['name']} (pool: ${
placementTarget['data_pool']
})`;
placementTarget[
'description'
] = `${placementTarget['name']} (pool: ${placementTarget['data_pool']})`;
placementTargets.push(placementTarget);
}
expect(component.placementTargets).toEqual(placementTargets);

View File

@ -26,7 +26,7 @@ const BASE_URL = 'rgw/bucket';
providers: [{ provide: URLBuilderService, useValue: new URLBuilderService(BASE_URL) }]
})
export class RgwBucketListComponent {
@ViewChild(TableComponent)
@ViewChild(TableComponent, { static: true })
table: TableComponent;
permission: Permission;

View File

@ -19,9 +19,9 @@ import { RgwUserSwiftKeyModalComponent } from '../rgw-user-swift-key-modal/rgw-u
styleUrls: ['./rgw-user-details.component.scss']
})
export class RgwUserDetailsComponent implements OnChanges, OnInit {
@ViewChild('accessKeyTpl')
@ViewChild('accessKeyTpl', { static: false })
public accessKeyTpl: TemplateRef<any>;
@ViewChild('secretKeyTpl')
@ViewChild('secretKeyTpl', { static: false })
public secretKeyTpl: TemplateRef<any>;
@Input()

View File

@ -27,7 +27,7 @@ const BASE_URL = 'rgw/user';
providers: [{ provide: URLBuilderService, useValue: new URLBuilderService(BASE_URL) }]
})
export class RgwUserListComponent {
@ViewChild(TableComponent)
@ViewChild(TableComponent, { static: true })
table: TableComponent;
permission: Permission;

View File

@ -24,11 +24,11 @@ import { RoleFormModel } from './role-form.model';
styleUrls: ['./role-form.component.scss']
})
export class RoleFormComponent implements OnInit {
@ViewChild('headerPermissionCheckboxTpl')
@ViewChild('headerPermissionCheckboxTpl', { static: true })
headerPermissionCheckboxTpl: TemplateRef<any>;
@ViewChild('cellScopeCheckboxTpl')
@ViewChild('cellScopeCheckboxTpl', { static: true })
cellScopeCheckboxTpl: TemplateRef<any>;
@ViewChild('cellPermissionCheckboxTpl')
@ViewChild('cellPermissionCheckboxTpl', { static: true })
cellPermissionCheckboxTpl: TemplateRef<any>;
modalRef: BsModalRef;

View File

@ -27,7 +27,7 @@ import { UserFormModel } from './user-form.model';
styleUrls: ['./user-form.component.scss']
})
export class UserFormComponent implements OnInit {
@ViewChild('removeSelfUserReadUpdatePermissionTpl')
@ViewChild('removeSelfUserReadUpdatePermissionTpl', { static: true })
removeSelfUserReadUpdatePermissionTpl: TemplateRef<any>;
modalRef: BsModalRef;

View File

@ -27,9 +27,9 @@ const BASE_URL = 'user-management/users';
providers: [{ provide: URLBuilderService, useValue: new URLBuilderService(BASE_URL) }]
})
export class UserListComponent implements OnInit {
@ViewChild('userRolesTpl')
@ViewChild('userRolesTpl', { static: true })
userRolesTpl: TemplateRef<any>;
@ViewChild('userEnabledTpl')
@ViewChild('userEnabledTpl', { static: true })
userEnabledTpl: TemplateRef<any>;
permission: Permission;

View File

@ -14,7 +14,7 @@ import { AboutComponent } from '../about/about.component';
styleUrls: ['./dashboard-help.component.scss']
})
export class DashboardHelpComponent implements OnInit {
@ViewChild('docsForm')
@ViewChild('docsForm', { static: true })
docsFormElement;
docsUrl: string;
modalRef: BsModalRef;

View File

@ -3,7 +3,7 @@ import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation';
import { ChartsModule } from 'ng2-charts/ng2-charts';
import { ChartsModule } from 'ng2-charts';
import { AlertModule } from 'ngx-bootstrap/alert';
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
import { ModalModule } from 'ngx-bootstrap/modal';

View File

@ -34,9 +34,9 @@ export class MockModule {}
`
})
class MockComponent {
@ViewChild('ctrlDescription')
@ViewChild('ctrlDescription', { static: true })
ctrlDescription: TemplateRef<any>;
@ViewChild('modalDescription')
@ViewChild('modalDescription', { static: true })
modalDescription: TemplateRef<any>;
someData = [1, 2, 3, 4, 5];
finished: number[];

View File

@ -13,7 +13,7 @@ import { SubmitButtonComponent } from '../submit-button/submit-button.component'
styleUrls: ['./critical-confirmation-modal.component.scss']
})
export class CriticalConfirmationModalComponent implements OnInit {
@ViewChild(SubmitButtonComponent)
@ViewChild(SubmitButtonComponent, { static: true })
submitButton: SubmitButtonComponent;
bodyTemplate: TemplateRef<any>;
bodyContext: object;

View File

@ -21,7 +21,7 @@ describe('LanguageSelectorComponent', () => {
fixture = TestBed.createComponent(LanguageSelectorComponent);
component = fixture.componentInstance;
fixture.detectChanges();
spyOn(window.location, 'reload').and.callFake(() => component.ngOnInit());
spyOn(component, 'reloadWindow').and.callFake(() => component.ngOnInit());
});
it('should create', () => {

View File

@ -39,8 +39,16 @@ export class LanguageSelectorComponent implements OnInit {
}
}
changeLanguage(lang: string) {
LocaleHelper.setLocale(lang);
/**
* Jest is being more restricted regarding spying on the reload method.
* This will allow us to spyOn this method instead.
*/
reloadWindow() {
window.location.reload();
}
changeLanguage(lang: string) {
LocaleHelper.setLocale(lang);
this.reloadWindow();
}
}

View File

@ -30,7 +30,7 @@ export class SelectBadgesComponent {
@Output()
selection = new EventEmitter();
@ViewChild('cdSelect')
@ViewChild('cdSelect', { static: true })
cdSelect;
icons = Icons;

View File

@ -10,9 +10,9 @@ import { DimlessBinaryPipe } from '../../pipes/dimless-binary.pipe';
styleUrls: ['./sparkline.component.scss']
})
export class SparklineComponent implements OnInit, OnChanges {
@ViewChild('sparkCanvas')
@ViewChild('sparkCanvas', { static: true })
chartCanvasRef: ElementRef;
@ViewChild('sparkTooltip')
@ViewChild('sparkTooltip', { static: true })
chartTooltipRef: ElementRef;
@Input()

View File

@ -34,7 +34,7 @@ class Item {
styleUrls: ['./table-key-value.component.scss']
})
export class TableKeyValueComponent implements OnInit, OnChanges {
@ViewChild(TableComponent)
@ViewChild(TableComponent, { static: true })
table: TableComponent;
@Input()

View File

@ -37,21 +37,21 @@ import { CdUserConfig } from '../../models/cd-user-config';
changeDetection: ChangeDetectionStrategy.OnPush
})
export class TableComponent implements AfterContentChecked, OnInit, OnChanges, OnDestroy {
@ViewChild(DatatableComponent)
@ViewChild(DatatableComponent, { static: true })
table: DatatableComponent;
@ViewChild('tableCellBoldTpl')
@ViewChild('tableCellBoldTpl', { static: true })
tableCellBoldTpl: TemplateRef<any>;
@ViewChild('sparklineTpl')
@ViewChild('sparklineTpl', { static: true })
sparklineTpl: TemplateRef<any>;
@ViewChild('routerLinkTpl')
@ViewChild('routerLinkTpl', { static: true })
routerLinkTpl: TemplateRef<any>;
@ViewChild('checkIconTpl')
@ViewChild('checkIconTpl', { static: true })
checkIconTpl: TemplateRef<any>;
@ViewChild('perSecondTpl')
@ViewChild('perSecondTpl', { static: true })
perSecondTpl: TemplateRef<any>;
@ViewChild('executingTpl')
@ViewChild('executingTpl', { static: true })
executingTpl: TemplateRef<any>;
@ViewChild('classAddingTpl')
@ViewChild('classAddingTpl', { static: true })
classAddingTpl: TemplateRef<any>;
// This is the array with the items to be shown.

View File

@ -206,22 +206,18 @@ export class CdValidators {
) {
conditionalValidators = conditionalValidators.concat(permanentValidators);
formControl.setValidators(
(
control: AbstractControl
): {
[key: string]: any;
} => {
const value = condition.call(this);
if (value) {
return Validators.compose(conditionalValidators)(control);
}
if (permanentValidators.length > 0) {
return Validators.compose(permanentValidators)(control);
}
return null;
formControl.setValidators((control: AbstractControl): {
[key: string]: any;
} => {
const value = condition.call(this);
if (value) {
return Validators.compose(conditionalValidators)(control);
}
);
if (permanentValidators.length > 0) {
return Validators.compose(permanentValidators)(control);
}
return null;
});
watchControls.forEach((control: AbstractControl) => {
control.valueChanges.subscribe(() => {

View File

@ -69,8 +69,6 @@ export class PrometheusAlertFormatter {
}
private appendSourceLink(alert: PrometheusCustomAlert, message: string): string {
return `${message} <a href="${alert.url}" target="_blank"><i class="${
Icons.lineChart
}"></i></a>`;
return `${message} <a href="${alert.url}" target="_blank"><i class="${Icons.lineChart}"></i></a>`;
}
}

View File

@ -139,9 +139,7 @@ describe('TaskManagerMessageService', () => {
defaultMsg = `RBD '${metadata.pool_name}/${metadata.image_name}'`;
childMsg = `RBD '${metadata.child_pool_name}/${metadata.child_image_name}'`;
destinationMsg = `RBD '${metadata.dest_pool_name}/${metadata.dest_image_name}'`;
snapMsg = `RBD snapshot '${metadata.pool_name}/${metadata.image_name}@${
metadata.snapshot_name
}'`;
snapMsg = `RBD snapshot '${metadata.pool_name}/${metadata.image_name}@${metadata.snapshot_name}'`;
finishedTask.metadata = metadata;
});

View File

@ -11,30 +11,13 @@
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
*
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
* Learn more in https://angular.io/guide/browser-support
*/
/***************************************************************************************************
* BROWSER POLYFILLS
*/
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
import 'core-js/es6/array';
import 'core-js/es6/date';
import 'core-js/es6/function';
import 'core-js/es6/map';
import 'core-js/es6/math';
import 'core-js/es6/number';
import 'core-js/es6/object';
import 'core-js/es6/parse-float';
import 'core-js/es6/parse-int';
import 'core-js/es6/regexp';
import 'core-js/es6/set';
import 'core-js/es6/string';
import 'core-js/es6/symbol';
import 'core-js/es6/weak-map';
import 'core-js/es7/object';
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.

View File

@ -1,4 +1,3 @@
import 'jest-preset-angular';
import 'jest-zone-patch';
import './jestGlobalMocks';

View File

@ -3,7 +3,6 @@
"compilerOptions": {
"outDir": "../out-tsc/app",
"baseUrl": "./",
"module": "es2015",
"types": []
},
"exclude": [

View File

@ -1,14 +1,16 @@
{
"compileOnSave": false,
"compilerOptions": {
"downlevelIteration": true,
"importHelpers": true,
"module": "esnext",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"target": "es2015",
"typeRoots": ["node_modules/@types"],
"lib": ["es2017", "dom"],
"allowJs": true

View File

@ -71,20 +71,20 @@
],
"directive-selector": [true, "attribute", "cd", "camelCase"],
"component-selector": [true, "element", "cd", "kebab-case"],
"angular-whitespace": [true, "check-interpolation", "check-semicolon"],
"no-output-on-prefix": true,
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": true,
"no-attribute-parameter-decorator": true,
"no-inputs-metadata-property": true,
"no-outputs-metadata-property": true,
"no-host-metadata-property": true,
"no-attribute-decorator": true,
"no-input-rename": true,
"no-output-rename": true,
"use-life-cycle-interface": true,
"use-lifecycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true,
"no-forward-ref": true,
"no-output-named-after-standard-event": true,
"no-output-native": true,
"ordered-imports": true
}
},
"jsRules": { "no-empty": true }
}