未验证 提交 3c953c73 编写于 作者: M Marcin Maciaszczyk 提交者: GitHub

Update dependencies (#5233)

* Update dependencies

* Format files

* Format files

* Format files

* Format files

* Format files
上级 91b06dc3
......@@ -6,5 +6,5 @@ end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
max_line_length = 100
max_line_length = 120
trim_trailing_whitespace = true
const gtsConfig = require('gts/.prettierrc.json')
const _ = require('lodash')
const modifiedConfig = _.merge(
{},
gtsConfig,
{
insertPragma: false,
printWidth: 120,
requirePragma: false,
semi: true,
tabWidth: 2,
trailingComma: 'all',
useTabs: false,
}
)
module.exports = modifiedConfig
# Configuration file for prettier.
# Read more at: https://prettier.io/docs/en/options.html
printWidth: 100
tabWidth: 2
useTabs: false
semi: true
singleQuote: true
trailingComma: 'all'
bracketSpacing: false
arrowParens: 'avoid'
requirePragma: false
insertPragma: false
......@@ -11,9 +11,8 @@ export class AbstractPage {
static getItem(id: string, contains?: string): Cypress.Chainable<any> {
if (contains) {
return cy.get(id).contains(contains);
} else {
return cy.get(id);
}
return cy.get(id);
}
//Click item by tag/#id/.class/tag.class/tag#id
......@@ -26,9 +25,7 @@ export class AbstractPage {
}
static clickSelectorItem(option: string) {
cy.get('mat-option')
.contains(option)
.click();
cy.get('mat-option').contains(option).click();
}
static assertUrlContains(url: string) {
......
此差异已折叠。
......@@ -102,14 +102,13 @@
"@angular/core": "9.1.9",
"@angular/flex-layout": "9.0.0-beta.31",
"@angular/forms": "9.1.9",
"@angular/http": "8.0.0-beta.10",
"@angular/localize": "9.1.9",
"@angular/material": "9.2.4",
"@angular/platform-browser": "9.1.9",
"@angular/platform-browser-dynamic": "9.1.9",
"@angular/router": "9.1.9",
"@swimlane/ngx-charts": "14.0.0",
"@types/c3": "0.7.1",
"@types/c3": "0.7.4",
"@types/d3": "5.7.2",
"@types/d3-scale": "2.2.0",
"@types/file-saver": "2.0.1",
......@@ -118,14 +117,14 @@
"angular-page-visibility": "9.0.0",
"ansi-to-html": "0.6.14",
"c3": "0.7.15",
"core-js": "3.6.4",
"core-js": "3.6.5",
"d3": "5.16.0",
"file-saver": "2.0.2",
"highlight.js": "10.0.3",
"js-yaml": "3.14.0",
"material-design-icons": "3.0.1",
"ng-in-viewport": "6.1.0",
"ngx-cookie-service": "2.4.0",
"ngx-cookie-service": "3.0.4",
"ngx-filter-pipe": "2.1.2",
"normalize.css": "8.0.1",
"roboto-fontface": "0.10.0",
......@@ -134,7 +133,7 @@
"sockjs-client": "1.4.0",
"systemjs": "6.3.2",
"truncate-url": "1.0.0",
"tslib": "1.13.0",
"tslib": "2.0.0",
"web-animations-js": "2.3.2",
"xterm": "4.6.0",
"xterm-addon-fit": "0.4.0",
......@@ -150,16 +149,18 @@
"@types/jasminewd2": "2.0.8",
"@types/js-yaml": "3.12.4",
"@types/lodash": "4.14.155",
"@types/node": "14.0.9",
"@types/node": "14.0.10",
"babel-cli": "6.26.0",
"babel-preset-env": "1.7.0",
"babel-register": "6.26.0",
"codelyzer": "5.2.2",
"concurrently": "5.2.0",
"cypress": "4.7.0",
"eslint": "7.1.0",
"eslint-plugin-rxjs": "0.0.2-beta.24",
"del": "5.1.0",
"git-describe": "4.0.4",
"gts": "1.1.2",
"gts": "2.0.2",
"gulp": "4.0.2",
"gulp-filter": "6.0.0",
"husky": "4.2.5",
......@@ -169,10 +170,10 @@
"karma": "5.0.9",
"karma-chrome-launcher": "3.1.0",
"karma-cli": "2.0.0",
"karma-coverage-istanbul-reporter": "3.0.2",
"karma-coverage-istanbul-reporter": "3.0.3",
"karma-firefox-launcher": "1.3.0",
"karma-jasmine": "3.3.1",
"karma-jasmine-html-reporter": "1.5.2",
"karma-jasmine-html-reporter": "1.5.4",
"license-check-and-add": "3.0.4",
"lint-staged": "10.2.9",
"lite-server": "2.5.4",
......@@ -186,7 +187,7 @@
"raw-loader": "4.0.1",
"run-node": "2.0.0",
"sass-lint": "1.13.1",
"sass-loader": "7.3.0",
"sass-loader": "8.0.2",
"scssfmt": "1.0.7",
"semver": "7.3.2",
"source-map-explorer": "2.4.2",
......@@ -202,5 +203,58 @@
"engines": {
"node": ">=10.13.0",
"npm": ">=6.0.0"
}
},
"eslintConfig": {
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2019,
"project": "./tsconfig.json",
"sourceType": "module"
},
"extends": "./node_modules/gts/",
"plugins": [
"rxjs"
],
"rules": {
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/no-explicit-any": "off",
"node/no-unpublished-import": "off",
"no-undef": "off",
"no-inner-declarations": "off",
"no-redeclare": "off",
"eol-last": "error",
"no-console": "off",
"no-prototype-builtins": "off",
"no-extra-boolean-cast": "error",
"no-else-return": "error",
"node/no-extraneous-require": "error",
"node/no-unpublished-require": "error",
"prefer-rest-params": "error",
"rxjs/no-ignored-observable": "error",
"rxjs/no-unbound-methods": "error",
"rxjs/no-unsafe-takeuntil": "error"
},
"overrides": [
{
"files": [
"src/**/*.spec.ts"
],
"env": {
"browser": true,
"jest": true
}
}
],
"ignorePatterns": [
"**/*.js"
]
},
"eslintIgnore": [
"node_modules/*",
"aio/*"
]
}
......@@ -63,10 +63,7 @@ export class ChromeComponent implements OnInit {
}
getSystemBannerClass(): string {
const severity =
this.systemBanner_ && this.systemBanner_.severity
? this.systemBanner_.severity.toLowerCase()
: '';
const severity = this.systemBanner_ && this.systemBanner_.severity ? this.systemBanner_.severity.toLowerCase() : '';
switch (severity) {
case 'warning':
return 'kd-bg-warning-light';
......@@ -93,11 +90,7 @@ export class ChromeComponent implements OnInit {
return;
}
this.document_.addEventListener(
'visibilitychange',
this.handleVisibilityChange_.bind(this),
false,
);
this.document_.addEventListener('visibilitychange', this.handleVisibilityChange_.bind(this), false);
}
private handleVisibilityChange_(): void {
......
......@@ -26,10 +26,7 @@ import {PluginsConfigService} from '../../common/services/global/plugin';
export class NavComponent implements OnInit {
@ViewChild(MatDrawer, {static: true}) private readonly nav_: MatDrawer;
constructor(
private readonly navService_: NavService,
private readonly pluginsConfigService_: PluginsConfigService,
) {}
constructor(private readonly navService_: NavService, private readonly pluginsConfigService_: PluginsConfigService) {}
ngOnInit(): void {
this.navService_.setNav(this.nav_);
......
......@@ -27,10 +27,7 @@ export class NotificationsComponent {
isOpen_ = false;
notifications: Notification[] = [];
constructor(
private readonly notifications_: NotificationsService,
private readonly element_: ElementRef,
) {}
constructor(private readonly notifications_: NotificationsService, private readonly element_: ElementRef) {}
@HostListener('document:click', ['$event'])
private onOutsideClick_(event: Event): void {
......
......@@ -36,13 +36,11 @@ const routes: Routes = [
},
{
path: 'clusterrole',
loadChildren: () =>
import('resource/cluster/clusterrole/module').then(m => m.ClusterRoleModule),
loadChildren: () => import('resource/cluster/clusterrole/module').then(m => m.ClusterRoleModule),
},
{
path: 'namespace',
loadChildren: () =>
import('resource/cluster/namespace/module').then(m => m.NamespaceModule),
loadChildren: () => import('resource/cluster/namespace/module').then(m => m.NamespaceModule),
},
{
path: 'node',
......@@ -50,13 +48,11 @@ const routes: Routes = [
},
{
path: 'persistentvolume',
loadChildren: () =>
import('resource/cluster/persistentvolume/module').then(m => m.PersistentVolumeModule),
loadChildren: () => import('resource/cluster/persistentvolume/module').then(m => m.PersistentVolumeModule),
},
{
path: 'storageclass',
loadChildren: () =>
import('resource/cluster/storageclass/module').then(m => m.StorageClassModule),
loadChildren: () => import('resource/cluster/storageclass/module').then(m => m.StorageClassModule),
},
// Overview
......@@ -76,13 +72,11 @@ const routes: Routes = [
},
{
path: 'daemonset',
loadChildren: () =>
import('resource/workloads/daemonset/module').then(m => m.DaemonSetModule),
loadChildren: () => import('resource/workloads/daemonset/module').then(m => m.DaemonSetModule),
},
{
path: 'deployment',
loadChildren: () =>
import('resource/workloads/deployment/module').then(m => m.DeploymentModule),
loadChildren: () => import('resource/workloads/deployment/module').then(m => m.DeploymentModule),
},
{
path: 'job',
......@@ -94,20 +88,16 @@ const routes: Routes = [
},
{
path: 'replicaset',
loadChildren: () =>
import('resource/workloads/replicaset/module').then(m => m.ReplicaSetModule),
loadChildren: () => import('resource/workloads/replicaset/module').then(m => m.ReplicaSetModule),
},
{
path: 'replicationcontroller',
loadChildren: () =>
import('resource/workloads/replicationcontroller/module').then(
m => m.ReplicationControllerModule,
),
import('resource/workloads/replicationcontroller/module').then(m => m.ReplicationControllerModule),
},
{
path: 'statefulset',
loadChildren: () =>
import('resource/workloads/statefulset/module').then(m => m.StatefulSetModule),
loadChildren: () => import('resource/workloads/statefulset/module').then(m => m.StatefulSetModule),
},
// Discovery and load balancing group
......@@ -140,9 +130,7 @@ const routes: Routes = [
{
path: 'persistentvolumeclaim',
loadChildren: () =>
import('resource/config/persistentvolumeclaim/module').then(
m => m.PersistentVolumeClaimModule,
),
import('resource/config/persistentvolumeclaim/module').then(m => m.PersistentVolumeClaimModule),
},
{
path: 'secret',
......
......@@ -38,9 +38,7 @@ export class UserPanelComponent implements OnInit {
}
isAuthSkipped(): boolean {
return (
this.loginStatus && !this.authService_.isLoginPageEnabled() && !this.loginStatus.headerPresent
);
return this.loginStatus && !this.authService_.isLoginPageEnabled() && !this.loginStatus.headerPresent;
}
isLoggedIn(): boolean {
......
......@@ -18,27 +18,18 @@ const DEFAULT_TRANSITION_TIME = '500ms ease-in-out';
export class Animations {
static easeOut = trigger('easeOut', [
transition(`${AUTO_STYLE} => void`, [
style({opacity: 1}),
animate(DEFAULT_TRANSITION_TIME, style({opacity: 0})),
]),
transition(`${AUTO_STYLE} => void`, [style({opacity: 1}), animate(DEFAULT_TRANSITION_TIME, style({opacity: 0}))]),
]);
static easeInOut = trigger('easeInOut', [
transition(`void => ${AUTO_STYLE}`, [
style({opacity: 0}),
animate(DEFAULT_TRANSITION_TIME, style({opacity: 1})),
]),
transition(`void => ${AUTO_STYLE}`, [style({opacity: 0}), animate(DEFAULT_TRANSITION_TIME, style({opacity: 1}))]),
transition(`${AUTO_STYLE} => void`, [animate(DEFAULT_TRANSITION_TIME, style({opacity: 0}))]),
]);
static expandInOut = trigger('expandInOut', [
state('true', style({height: '0', opacity: '0'})),
state('false', style({height: AUTO_STYLE, opacity: '1'})),
transition('false => true', [
style({overflow: 'hidden'}),
animate('500ms ease-in', style({height: '0'})),
]),
transition('false => true', [style({overflow: 'hidden'}), animate('500ms ease-in', style({height: '0'}))]),
transition('true => false', [
style({overflow: 'hidden', opacity: '1'}),
animate('500ms ease-out', style({height: AUTO_STYLE, display: AUTO_STYLE})),
......
......@@ -31,20 +31,11 @@ export class ActionbarDetailPinComponent {
if (this.isPinned()) {
this.pinner_.unpin(this.typeMeta.kind, this.objectMeta.name, this.objectMeta.namespace);
} else {
this.pinner_.pin(
this.typeMeta.kind,
this.objectMeta.name,
this.objectMeta.namespace,
this.displayName,
);
this.pinner_.pin(this.typeMeta.kind, this.objectMeta.name, this.objectMeta.namespace, this.displayName);
}
}
isPinned(): boolean {
return this.pinner_.isPinned(
this.typeMeta.kind,
this.objectMeta.name,
this.objectMeta.namespace,
);
return this.pinner_.isPinned(this.typeMeta.kind, this.objectMeta.name, this.objectMeta.namespace);
}
}
......@@ -32,17 +32,13 @@ export class DefaultActionbar implements OnInit, OnDestroy {
constructor(private readonly actionbar_: ActionbarService) {}
ngOnInit(): void {
this.actionbar_.onInit
.pipe(takeUntil(this._unsubscribe))
.subscribe((resourceMeta: ResourceMeta) => {
this.resourceMeta = resourceMeta;
this.isInitialized = true;
this.isVisible = true;
});
this.actionbar_.onInit.pipe(takeUntil(this._unsubscribe)).subscribe((resourceMeta: ResourceMeta) => {
this.resourceMeta = resourceMeta;
this.isInitialized = true;
this.isVisible = true;
});
this.actionbar_.onDetailsLeave
.pipe(takeUntil(this._unsubscribe))
.subscribe(() => (this.isVisible = false));
this.actionbar_.onDetailsLeave.pipe(takeUntil(this._unsubscribe)).subscribe(() => (this.isVisible = false));
}
ngOnDestroy(): void {
......
......@@ -31,17 +31,13 @@ export class LogsDefaultActionbar implements OnInit, OnDestroy {
constructor(private readonly actionbar_: ActionbarService) {}
ngOnInit(): void {
this.actionbar_.onInit
.pipe(takeUntil(this._unsubscribe))
.subscribe((resourceMeta: ResourceMeta) => {
this.resourceMeta = resourceMeta;
this.isInitialized = true;
this.isVisible = true;
});
this.actionbar_.onInit.pipe(takeUntil(this._unsubscribe)).subscribe((resourceMeta: ResourceMeta) => {
this.resourceMeta = resourceMeta;
this.isInitialized = true;
this.isVisible = true;
});
this.actionbar_.onDetailsLeave
.pipe(takeUntil(this._unsubscribe))
.subscribe(() => (this.isVisible = false));
this.actionbar_.onDetailsLeave.pipe(takeUntil(this._unsubscribe)).subscribe(() => (this.isVisible = false));
}
ngOnDestroy(): void {
......
......@@ -31,17 +31,13 @@ export class LogsExecDefaultActionbar implements OnInit, OnDestroy {
constructor(private readonly actionbar_: ActionbarService) {}
ngOnInit(): void {
this.actionbar_.onInit
.pipe(takeUntil(this._unsubscribe))
.subscribe((resourceMeta: ResourceMeta) => {
this.resourceMeta = resourceMeta;
this.isInitialized = true;
this.isVisible = true;
});
this.actionbar_.onInit.pipe(takeUntil(this._unsubscribe)).subscribe((resourceMeta: ResourceMeta) => {
this.resourceMeta = resourceMeta;
this.isInitialized = true;
this.isVisible = true;
});
this.actionbar_.onDetailsLeave
.pipe(takeUntil(this._unsubscribe))
.subscribe(() => (this.isVisible = false));
this.actionbar_.onDetailsLeave.pipe(takeUntil(this._unsubscribe)).subscribe(() => (this.isVisible = false));
}
ngOnDestroy(): void {
......
......@@ -32,17 +32,13 @@ export class LogsScaleDefaultActionbar implements OnInit, OnDestroy {
constructor(private readonly actionbar_: ActionbarService) {}
ngOnInit(): void {
this.actionbar_.onInit
.pipe(takeUntil(this._unsubscribe))
.subscribe((resourceMeta: ResourceMeta) => {
this.resourceMeta = resourceMeta;
this.isInitialized = true;
this.isVisible = true;
});
this.actionbar_.onInit.pipe(takeUntil(this._unsubscribe)).subscribe((resourceMeta: ResourceMeta) => {
this.resourceMeta = resourceMeta;
this.isInitialized = true;
this.isVisible = true;
});
this.actionbar_.onDetailsLeave
.pipe(takeUntil(this._unsubscribe))
.subscribe(() => (this.isVisible = false));
this.actionbar_.onDetailsLeave.pipe(takeUntil(this._unsubscribe)).subscribe(() => (this.isVisible = false));
}
ngOnDestroy(): void {
......
......@@ -32,17 +32,13 @@ export class PinDefaultActionbar implements OnInit, OnDestroy {
constructor(private readonly actionbar_: ActionbarService) {}
ngOnInit(): void {
this.actionbar_.onInit
.pipe(takeUntil(this._unsubscribe))
.subscribe((resourceMeta: ResourceMeta) => {
this.resourceMeta = resourceMeta;
this.isInitialized = true;
this.isVisible = true;
});
this.actionbar_.onInit.pipe(takeUntil(this._unsubscribe)).subscribe((resourceMeta: ResourceMeta) => {
this.resourceMeta = resourceMeta;
this.isInitialized = true;
this.isVisible = true;
});
this.actionbar_.onDetailsLeave
.pipe(takeUntil(this._unsubscribe))
.subscribe(() => (this.isVisible = false));
this.actionbar_.onDetailsLeave.pipe(takeUntil(this._unsubscribe)).subscribe(() => (this.isVisible = false));
}
ngOnDestroy(): void {
......
......@@ -32,17 +32,13 @@ export class ScaleDefaultActionbar implements OnInit, OnDestroy {
constructor(private readonly actionbar_: ActionbarService) {}
ngOnInit(): void {
this.actionbar_.onInit
.pipe(takeUntil(this._unsubscribe))
.subscribe((resourceMeta: ResourceMeta) => {
this.resourceMeta = resourceMeta;
this.isInitialized = true;
this.isVisible = true;
});
this.actionbar_.onDetailsLeave
.pipe(takeUntil(this._unsubscribe))
.subscribe(() => (this.isVisible = false));
this.actionbar_.onInit.pipe(takeUntil(this._unsubscribe)).subscribe((resourceMeta: ResourceMeta) => {
this.resourceMeta = resourceMeta;
this.isInitialized = true;
this.isVisible = true;
});
this.actionbar_.onDetailsLeave.pipe(takeUntil(this._unsubscribe)).subscribe(() => (this.isVisible = false));
}
ngOnDestroy(): void {
......
......@@ -31,17 +31,13 @@ export class TriggerDefaultActionbar implements OnInit, OnDestroy {
constructor(private readonly actionbar_: ActionbarService) {}
ngOnInit(): void {
this.actionbar_.onInit
.pipe(takeUntil(this._unsubscribe))
.subscribe((resourceMeta: ResourceMeta) => {
this.resourceMeta = resourceMeta;
this.isInitialized = true;
this.isVisible = true;
});
this.actionbar_.onInit.pipe(takeUntil(this._unsubscribe)).subscribe((resourceMeta: ResourceMeta) => {
this.resourceMeta = resourceMeta;
this.isInitialized = true;
this.isVisible = true;
});
this.actionbar_.onDetailsLeave
.pipe(takeUntil(this._unsubscribe))
.subscribe(() => (this.isVisible = false));
this.actionbar_.onDetailsLeave.pipe(takeUntil(this._unsubscribe)).subscribe(() => (this.isVisible = false));
}
ngOnDestroy(): void {
......
......@@ -76,12 +76,7 @@ export class BreadcrumbsComponent implements OnInit {
) {
if (currentRoute.routeConfig.data.parent === LOGS_PARENT_PLACEHOLDER) {
route = this._getLogsParent(currentRoute.snapshot.params);
urlArray = [
'',
urlArray[urlArray.length - 1],
urlArray[urlArray.length - 3],
urlArray[urlArray.length - 2],
];
urlArray = ['', urlArray[urlArray.length - 1], urlArray[urlArray.length - 3], urlArray[urlArray.length - 2]];
routeParamsCount = 0;
} else if (currentRoute.routeConfig.data.parent === EXEC_PARENT_PLACEHOLDER) {
route = POD_DETAIL_ROUTE;
......@@ -122,9 +117,8 @@ export class BreadcrumbsComponent implements OnInit {
return REPLICATIONCONTROLLER_DETAIL_ROUTE;
} else if (resourceType === 'replicaset') {
return REPLICASET_DETAIL_ROUTE;
} else {
return undefined;
}
return undefined;
}
private _getCurrentRoute(): ActivatedRoute {
......@@ -147,8 +141,7 @@ export class BreadcrumbsComponent implements OnInit {
return breadcrumb;
} else if (route && route.component) {
return route.component.name;
} else {
return 'Unknown';
}
return 'Unknown';
}
}
......@@ -49,13 +49,7 @@ describe('CardComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [CardComponent, TestComponent],
imports: [
MatIconModule,
MatCardModule,
MatDividerModule,
MatTooltipModule,
NoopAnimationsModule,
],
imports: [MatIconModule, MatCardModule, MatDividerModule, MatTooltipModule, NoopAnimationsModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}).compileComponents();
}));
......
......@@ -21,10 +21,7 @@ import {Chip} from '../component';
templateUrl: 'template.html',
})
export class ChipDialog {
constructor(
public dialogRef: MatDialogRef<ChipDialog>,
@Inject(MAT_DIALOG_DATA) public data: Chip,
) {}
constructor(public dialogRef: MatDialogRef<ChipDialog>, @Inject(MAT_DIALOG_DATA) public data: Chip) {}
onNoClick(): void {
this.dialogRef.close();
......
......@@ -18,7 +18,8 @@ import {StringMap} from '@api/backendapi';
import {ChipDialog} from './chipdialog/dialog';
const truncateUrl = require('truncate-url');
// @ts-ignore
import * as truncateUrl from 'truncate-url';
export interface Chip {
key: string;
......
......@@ -75,9 +75,7 @@ export class GraphComponent implements OnInit, OnChanges {
switch (this.graphType) {
case GraphType.Memory:
series = this.metric.dataPoints.map(point =>
FormattedValue.NewFormattedMemoryValue(point.y),
);
series = this.metric.dataPoints.map(point => FormattedValue.NewFormattedMemoryValue(point.y));
break;
case GraphType.CPU:
series = this.metric.dataPoints.map(point => FormattedValue.NewFormattedCoreValue(point.y));
......@@ -142,12 +140,7 @@ export class GraphComponent implements OnInit, OnChanges {
// Calculate the average usage based on minute intervals. If there are more data points within
// a single minute, they will be accumulated and an average will be taken.
private _average(
acc: DataPoint[],
point: DataPoint,
idx: number,
points: DataPoint[],
): DataPoint[] {
private _average(acc: DataPoint[], point: DataPoint, idx: number, points: DataPoint[]): DataPoint[] {
if (idx > 0) {
const currMinute = this._getMinute(point.x);
const lastMinute = this._getMinute(points[idx - 1].x);
......
......@@ -33,17 +33,11 @@ export class GraphCardComponent implements OnChanges {
}
private getSelectedMetrics(): Metric {
if (
!this.selectedMetricName ||
(this.metrics.length && this.metrics[0].dataPoints.length === 0)
) {
if (!this.selectedMetricName || (this.metrics.length && this.metrics[0].dataPoints.length === 0)) {
return null;
}
return (
this.metrics &&
this.metrics.filter(metric => metric.metricName === this.selectedMetricName)[0]
);
return this.metrics && this.metrics.filter(metric => metric.metricName === this.selectedMetricName)[0];
}
shouldShowGraph(): boolean {
......
......@@ -26,9 +26,6 @@ export class GraphMetricsComponent {
readonly GraphType: typeof GraphType = GraphType;
showGraphs(): boolean {
return (
this.metrics &&
this.metrics.every(metrics => metrics.dataPoints && metrics.dataPoints.length > 1)
);
return this.metrics && this.metrics.every(metrics => metrics.dataPoints && metrics.dataPoints.length > 1);
}
}
......@@ -32,14 +32,10 @@ export class HiddenPropertyComponent {
HiddenPropertyMode = HiddenPropertyMode;
toggleVisible(): void {
this.mode =
this.mode !== HiddenPropertyMode.Visible
? HiddenPropertyMode.Visible
: HiddenPropertyMode.Hidden;
this.mode = this.mode !== HiddenPropertyMode.Visible ? HiddenPropertyMode.Visible : HiddenPropertyMode.Hidden;
}
toggleEdit(): void {
this.mode =
this.mode !== HiddenPropertyMode.Edit ? HiddenPropertyMode.Edit : HiddenPropertyMode.Hidden;
this.mode = this.mode !== HiddenPropertyMode.Edit ? HiddenPropertyMode.Edit : HiddenPropertyMode.Hidden;
}
}
......@@ -69,12 +69,7 @@ export class MenuComponent implements ActionColumn {
}
getLogsHref(): string {
return this.kdState_.href(
'log',
this.objectMeta.name,
this.objectMeta.namespace,
this.typeMeta.kind,
);
return this.kdState_.href('log', this.objectMeta.name, this.objectMeta.namespace, this.typeMeta.kind);
}
isExecEnabled(): boolean {
......@@ -119,11 +114,7 @@ export class MenuComponent implements ActionColumn {
}
isPinned(): boolean {
return this.pinner_.isPinned(
this.typeMeta.kind,
this.objectMeta.name,
this.objectMeta.namespace,
);
return this.pinner_.isPinned(this.typeMeta.kind, this.objectMeta.name, this.objectMeta.namespace);
}
onEdit(): void {
......
......@@ -60,13 +60,7 @@ describe('ObjectMetaComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
ObjectMetaComponent,
TestComponent,
CardComponent,
PropertyComponent,
ChipsComponent,
],
declarations: [ObjectMetaComponent, TestComponent, CardComponent, PropertyComponent, ChipsComponent],
imports: [
MatIconModule,
MatCardModule,
......@@ -104,9 +98,7 @@ describe('ObjectMetaComponent', () => {
const card = fixture.debugElement.query(By.css('mat-card-title'));
expect(card).toBeTruthy();
const metaName = fixture.debugElement.query(
By.css('kd-property.object-meta-name div.kd-property-value'),
);
const metaName = fixture.debugElement.query(By.css('kd-property.object-meta-name div.kd-property-value'));
expect(metaName).toBeTruthy();
expect(metaName.nativeElement.textContent === miniName);
});
......
......@@ -40,11 +40,7 @@ export class CRDObjectListComponent extends ResourceListBase<CRDObjectList, CRDO
notifications: NotificationsService,
cdr: ChangeDetectorRef,
) {
super(
activatedRoute_.params.pipe(map(params => `customresourcedefinition/${params.crdName}`)),
notifications,
cdr,
);
super(activatedRoute_.params.pipe(map(params => `customresourcedefinition/${params.crdName}`)), notifications, cdr);
this.id = ListIdentifier.crdObject;
this.groupId = ListGroupIdentifier.none;
......@@ -52,10 +48,7 @@ export class CRDObjectListComponent extends ResourceListBase<CRDObjectList, CRDO
this.registerActionColumn<MenuComponent>('menu', MenuComponent);
this.activatedRoute_.params.pipe(takeUntil(this.unsubscribe_)).subscribe(params => {
this.endpoint = EndpointManager.resource(Resource.crd, true).child(
params.crdName,
Resource.crdObject,
);
this.endpoint = EndpointManager.resource(Resource.crd, true).child(params.crdName, Resource.crdObject);
});
}
......
......@@ -71,16 +71,7 @@ export class CronJobListComponent extends ResourceListWithStatuses<CronJobList,
}
getDisplayColumns(): string[] {
return [
'statusicon',
'name',
'labels',
'schedule',
'suspend',
'active',
'lastschedule',
'created',
];
return ['statusicon', 'name', 'labels', 'schedule', 'suspend', 'active', 'lastschedule', 'created'];
}
private shouldShowNamespaceColumn_(): boolean {
......
......@@ -13,13 +13,7 @@
// limitations under the License.
import {HttpParams} from '@angular/common/http';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ComponentFactoryResolver,
Input,
} from '@angular/core';
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ComponentFactoryResolver, Input} from '@angular/core';
import {DaemonSet, DaemonSetList, Event, Metric} from '@api/backendapi';
import {Observable} from 'rxjs/Observable';
......
......@@ -13,13 +13,7 @@
// limitations under the License.
import {HttpParams} from '@angular/common/http';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ComponentFactoryResolver,
Input,
} from '@angular/core';
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ComponentFactoryResolver, Input} from '@angular/core';
import {Deployment, DeploymentList, Event, Metric} from '@api/backendapi';
import {Observable} from 'rxjs/Observable';
import {ResourceListWithStatuses} from '../../../resources/list';
......
......@@ -29,8 +29,7 @@ const EVENT_TYPE_WARNING = 'Warning';
templateUrl: './template.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class EventListComponent extends ResourceListWithStatuses<EventList, Event>
implements OnInit {
export class EventListComponent extends ResourceListWithStatuses<EventList, Event> implements OnInit {
@Input() endpoint: string;
constructor(
......
......@@ -13,13 +13,7 @@
// limitations under the License.
import {HttpParams} from '@angular/common/http';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ComponentFactoryResolver,
Input,
} from '@angular/core';
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ComponentFactoryResolver, Input} from '@angular/core';
import {HorizontalPodAutoscaler, HorizontalPodAutoscalerList} from '@api/backendapi';
import {Observable} from 'rxjs/Observable';
import {ResourceListWithStatuses} from '../../../resources/list';
......@@ -41,9 +35,7 @@ export class HorizontalPodAutoscalerListComponent extends ResourceListWithStatus
@Input() endpoint = EndpointManager.resource(Resource.horizontalPodAutoscaler, true).list();
constructor(
private readonly horizontalpodautoscaler_: NamespacedResourceService<
HorizontalPodAutoscalerList
>,
private readonly horizontalpodautoscaler_: NamespacedResourceService<HorizontalPodAutoscalerList>,
notifications: NotificationsService,
resolver: ComponentFactoryResolver,
cdr: ChangeDetectorRef,
......
......@@ -13,13 +13,7 @@
// limitations under the License.
import {HttpParams} from '@angular/common/http';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ComponentFactoryResolver,
Input,
} from '@angular/core';
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ComponentFactoryResolver, Input} from '@angular/core';
import {Event, Job, JobList, Metric} from '@api/backendapi';
import {Observable} from 'rxjs/Observable';
......
......@@ -73,16 +73,6 @@ export class NodeListComponent extends ResourceListWithStatuses<NodeList, Node>
}
getDisplayColumns(): string[] {
return [
'statusicon',
'name',
'labels',
'ready',
'cpureq',
'cpulim',
'memreq',
'memlim',
'created',
];
return ['statusicon', 'name', 'labels', 'ready', 'cpureq', 'cpulim', 'memreq', 'memlim', 'created'];
}
}
......@@ -29,10 +29,7 @@ import {ListGroupIdentifier, ListIdentifier} from '../groupids';
templateUrl: './template.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class PersistentVolumeListComponent extends ResourceListWithStatuses<
PersistentVolumeList,
PersistentVolume
> {
export class PersistentVolumeListComponent extends ResourceListWithStatuses<PersistentVolumeList, PersistentVolume> {
@Input() endpoint = EndpointManager.resource(Resource.persistentVolume).list();
constructor(
......
......@@ -77,17 +77,7 @@ export class PersistentVolumeClaimListComponent extends ResourceListWithStatuses
}
getDisplayColumns(): string[] {
return [
'statusicon',
'name',
'labels',
'status',
'volume',
'capacity',
'accmodes',
'storagecl',
'created',
];
return ['statusicon', 'name', 'labels', 'status', 'volume', 'capacity', 'accmodes', 'storagecl', 'created'];
}
getVolumeHref(persistentVolumeName: string): string {
......
......@@ -13,13 +13,7 @@
// limitations under the License.
import {HttpParams} from '@angular/common/http';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ComponentFactoryResolver,
Input,
} from '@angular/core';
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ComponentFactoryResolver, Input} from '@angular/core';
import {Event, Metric, Pod, PodList} from '@api/backendapi';
import {Observable} from 'rxjs/Observable';
......
......@@ -13,13 +13,7 @@
// limitations under the License.
import {HttpParams} from '@angular/common/http';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ComponentFactoryResolver,
Input,
} from '@angular/core';
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ComponentFactoryResolver, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Event, Metric, ReplicaSet, ReplicaSetList} from '@api/backendapi';
import {Observable} from 'rxjs/Observable';
......
......@@ -13,13 +13,7 @@
// limitations under the License.
import {HttpParams} from '@angular/common/http';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ComponentFactoryResolver,
Input,
} from '@angular/core';
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ComponentFactoryResolver, Input} from '@angular/core';
import {Event, ReplicationController, ReplicationControllerList} from '@api/backendapi';
import {Observable} from 'rxjs/Observable';
......
......@@ -62,7 +62,7 @@ export class TextInputComponent implements OnInit, AfterViewInit, OnChanges {
tabSize: 2,
wrap: true,
fontSize: 14,
fontFamily: `'Roboto Mono Regular', monospace`,
fontFamily: "'Roboto Mono Regular', monospace",
};
constructor(private readonly themeService_: ThemeService) {}
......
......@@ -97,9 +97,7 @@ describe('WorkloadStatusComponent', () => {
it('shows component heading', () => {
testHostFixture.detectChanges();
const debugElement = testHostFixture.debugElement.query(
By.css('kd-card mat-card mat-card-title div'),
);
const debugElement = testHostFixture.debugElement.query(By.css('kd-card mat-card mat-card-title div'));
expect(debugElement).toBeTruthy();
const htmlElement = debugElement.nativeElement;
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册