From 28b0a3388ee41e5b72c084ba77735430e538db1d Mon Sep 17 00:00:00 2001 From: Xiaoyang Liu Date: Thu, 7 Apr 2022 01:54:54 -0700 Subject: [PATCH 1/2] Remove generic types from 'ResourceBase' to fix failed test case Signed-off-by: Xiaoyang Liu --- src/app/frontend/common/services/resource/resource.ts | 4 ++-- src/app/frontend/common/services/resource/utility.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/frontend/common/services/resource/resource.ts b/src/app/frontend/common/services/resource/resource.ts index 6a448c37e7c2..f0e27e03dc7e 100644 --- a/src/app/frontend/common/services/resource/resource.ts +++ b/src/app/frontend/common/services/resource/resource.ts @@ -23,7 +23,7 @@ import {GlobalSettingsService} from '../global/globalsettings'; import {NamespaceService} from '../global/namespace'; @Injectable() -export class ResourceService extends ResourceBase { +export class ResourceService extends ResourceBase { /** * We need to provide HttpClient here since the base is not annotated with * @Injectable @@ -52,7 +52,7 @@ export class ResourceService extends ResourceBase { } @Injectable() -export class NamespacedResourceService extends ResourceBase { +export class NamespacedResourceService extends ResourceBase { constructor( readonly http: HttpClient, private readonly namespace_: NamespaceService, diff --git a/src/app/frontend/common/services/resource/utility.ts b/src/app/frontend/common/services/resource/utility.ts index 6855b9f16f12..b574700a6f29 100644 --- a/src/app/frontend/common/services/resource/utility.ts +++ b/src/app/frontend/common/services/resource/utility.ts @@ -20,7 +20,7 @@ import {ResourceBase} from '../../resources/resource'; import {NamespaceService} from '../global/namespace'; @Injectable() -export class UtilityService extends ResourceBase { +export class UtilityService extends ResourceBase { constructor(readonly http: HttpClient, private readonly namespace_: NamespaceService) { super(http); } From 0ddf6143476e375e6601c6c8ad49ccdd43d6b969 Mon Sep 17 00:00:00 2001 From: Xiaoyang Liu Date: Thu, 7 Apr 2022 01:55:35 -0700 Subject: [PATCH 2/2] Downgrade truncate-url to 1.0.0 to handle build error Signed-off-by: Xiaoyang Liu --- package-lock.json | 19 ++++++++----------- package.json | 2 +- .../common/components/chips/component.ts | 1 + 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index f43893b6da6b..94b46b37f5eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,7 @@ "sockjs-client": "1.6.0", "strip-ansi": "6.0.1", "systemjs": "6.12.1", - "truncate-url": "2.1.0", + "truncate-url": "1.0.0", "tslib": "2.3.1", "web-animations-js": "2.3.2", "xterm": "4.18.0", @@ -22025,14 +22025,11 @@ } }, "node_modules/truncate-url": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/truncate-url/-/truncate-url-2.1.0.tgz", - "integrity": "sha512-PACKaRVLSovjqI30LOIqEoSA/KD3wQuhCGe0rY2dcKqeteOeqlNJ8PHmeEqg5AsGSyVEOHjUSG1pVzzDHe9paA==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/truncate-url/-/truncate-url-1.0.0.tgz", + "integrity": "sha1-hiGabDV12bch04aRvwjISqWtqkI=", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=4" } }, "node_modules/ts-jest": { @@ -39972,9 +39969,9 @@ "dev": true }, "truncate-url": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/truncate-url/-/truncate-url-2.1.0.tgz", - "integrity": "sha512-PACKaRVLSovjqI30LOIqEoSA/KD3wQuhCGe0rY2dcKqeteOeqlNJ8PHmeEqg5AsGSyVEOHjUSG1pVzzDHe9paA==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/truncate-url/-/truncate-url-1.0.0.tgz", + "integrity": "sha1-hiGabDV12bch04aRvwjISqWtqkI=" }, "ts-jest": { "version": "27.1.4", diff --git a/package.json b/package.json index fccfc9d3dc20..c10e09e4764e 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "sockjs-client": "1.6.0", "strip-ansi": "6.0.1", "systemjs": "6.12.1", - "truncate-url": "2.1.0", + "truncate-url": "1.0.0", "tslib": "2.3.1", "web-animations-js": "2.3.2", "xterm": "4.18.0", diff --git a/src/app/frontend/common/components/chips/component.ts b/src/app/frontend/common/components/chips/component.ts index 6b504ff037a2..cdd7d7f336ee 100644 --- a/src/app/frontend/common/components/chips/component.ts +++ b/src/app/frontend/common/components/chips/component.ts @@ -23,6 +23,7 @@ import { } from '@angular/core'; import {MatDialog, MatDialogConfig} from '@angular/material/dialog'; import {StringMap} from '@api/root.shared'; +// @ts-ignore import truncateUrl from 'truncate-url'; import {GlobalSettingsService} from '../../services/global/globalsettings';