Upgrade Clarity and Angular to latest stable version (#15887)

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
孙世军 2021-10-28 17:21:39 +08:00 committed by GitHub
parent 7b75a456d3
commit ec1c8c9cd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 12555 additions and 22520 deletions

126
src/portal/PACKAGE.md Normal file
View File

@ -0,0 +1,126 @@
```text
{
"name": "harbor",
"version": "2.5.0",
"description": "Harbor UI with Clarity",
"angular-cli": {},
"scripts": {
// triggered after running "npm install"
"postinstall": "node scripts/convert-yaml-to-json.js && ng-swagger-gen -i ng-swagger-gen/swagger.json -o ng-swagger-gen && node scripts/delete-swagger-json.js",
// For developing
"start": "node --max_old_space_size=2048 ./node_modules/@angular/cli/bin/ng serve --ssl true --host 0.0.0.0 --proxy-config proxy.config.json",
"start:prod": "node --max_old_space_size=2048 ./node_modules/@angular/cli/bin/ng serve --ssl true --host 0.0.0.0 --proxy-config proxy.config.json --configuration production",
// For code grammar checking
"lint": "tslint \"src/**/*.ts\"",
"lint_fix": "tslint --fix \"src/**/*.ts\"",
// For unit test
"test": "node --max_old_space_size=2048 ./node_modules/@angular/cli/bin/ng test --code-coverage",
"test:watch": "ng test --code-coverage --watch",
"test:debug": "ng test --code-coverage --source-map false",
"test:chrome": "ng test --code-coverage --browsers Chrome",
"test:headless": "ng test --watch=false --no-progress --code-coverage --browsers=ChromeNoSandboxHeadless",
"test:chrome-debug": "ng test --code-coverage --browsers Chrome --watch",
// E2e related. Currently not used
"pree2e": "webdriver-manager update",
"e2e": "protractor",
"build": "ng build --aot",
"release": "ng build --configuration production",
"build-mock-api-server": "tsc -p server",
// to run a mocked node express api server
"mock-api-server": "npm run build-mock-api-server && node server/dist/server/src/mock-api.js",
// Run this command before the production building. It will set the current timestamp to "buildTimestamp" property in "environment.prod.ts" file
// And "buildTimestamp" will be used as a query parameter to avoid browser cache after upgrading Harbor UI
"generate-build-timestamp": "node scripts/generate-build-timestamp.js"
},
"private": true,
"dependencies": {
// Angular framework. Required
"@angular/animations": "~12.2.11",
"@angular/common": "~12.2.11",
"@angular/compiler": "~12.2.11",
"@angular/core": "~12.2.11",
"@angular/forms": "~12.2.11",
"@angular/localize": "~12.2.11",
"@angular/platform-browser": "~12.2.11",
"@angular/platform-browser-dynamic": "~12.2.11",
"@angular/router": "~12.2.11",
"rxjs": "^6.6.7",
"tslib": "^2.2.0",
"zone.js": "~0.11.4",
// Clarity UI. Required
"@cds/core": "~5.5.8",
"@clr/angular": "~12.0.6",
"@clr/icons": "~12.0.6",
"@clr/ui": "~12.0.6",
// For Harbor i18n functionality. Required
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
// For cron string checking. Required
"cron-validator": "^1.2.1",
// Used by CopyInputComponent to copy pull command to clipboard. Required
"ngx-clipboard": "^12.3.1",
// For Harbor cookie service. Required
"ngx-cookie": "^5.0.2",
// To render markdown data. Required
"ngx-markdown": "~12.0.1",
// For swagger API center. Required
"swagger-ui": "^3.52.5",
"buffer": "^6.0.3",
// To convert yaml to json. Required
"js-yaml": "^4.1.0"
},
"devDependencies": {
// Angular framework. Required
"@angular-devkit/build-angular": "~12.2.11",
"@angular/cli": "~12.2.11",
"@angular/compiler-cli": "~12.2.11",
"@types/jasmine": "~3.10.1",
"@types/node": "^16.11.6",
"typescript": "~4.3.5",
// For unit test. Required
"jasmine-core": "^3.7.1",
"jasmine-spec-reporter": "~7.0.0",
"karma": "^6.3.3",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "^2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
// To run a local mocked API server. Required
"@types/express": "^4.17.12",
"express": "^4.17.1",
// To generate models and Angular services based on swagger.yaml. Required
"ng-swagger-gen": "^2.3.1",
// For e2e test. Required
"protractor": "^7.0.0",
// For code grammar checking. Optional
"eslint": "8.1.0",
// For code checking. Optional
"codelyzer": "^6.0.2",
}
}
```

View File

@ -45,8 +45,6 @@
}
],
"scripts": [
"node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js",
"node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js",
"node_modules/@clr/icons/clr-icons.min.js",
"node_modules/marked/lib/marked.js",
"node_modules/prismjs/prism.js",
@ -109,8 +107,6 @@
"polyfills": "src/polyfills.ts",
"karmaConfig": "karma.conf.js",
"scripts": [
"node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js",
"node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js",
"node_modules/@clr/icons/clr-icons.min.js"
],
"styles": [

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,12 @@
{
"name": "harbor",
"version": "2.4.0",
"version": "2.5.0",
"description": "Harbor UI with Clarity",
"angular-cli": {},
"scripts": {
"postinstall": "node scripts/convert-yaml-to-json.js && ng-swagger-gen -i ng-swagger-gen/swagger.json -o ng-swagger-gen && node scripts/delete-swagger-json.js",
"start": "node --max_old_space_size=2048 ./node_modules/@angular/cli/bin/ng serve --ssl true --host 0.0.0.0 --proxy-config proxy.config.json",
"start:prod": "node --max_old_space_size=2048 ./node_modules/@angular/cli/bin/ng serve --ssl true --host 0.0.0.0 --proxy-config proxy.config.json --configuration production",
"lint": "tslint \"src/**/*.ts\"",
"lint_fix": "tslint --fix \"src/**/*.ts\"",
"test": "node --max_old_space_size=2048 ./node_modules/@angular/cli/bin/ng test --code-coverage",
@ -24,78 +25,51 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^12.0.3",
"@angular/common": "^12.0.3",
"@angular/compiler": "^12.0.3",
"@angular/core": "^12.0.3",
"@angular/forms": "^12.0.3",
"@angular/localize": "^12.0.3",
"@angular/platform-browser": "^12.0.3",
"@angular/platform-browser-dynamic": "^12.0.3",
"@angular/router": "^12.0.3",
"@cds/core": "^5.3.0",
"@clr/angular": "^5.3.0",
"@clr/icons": "^5.3.0",
"@clr/ui": "^5.3.0",
"@fortawesome/fontawesome-free": "^5.15.3",
"@ng-bootstrap/ng-bootstrap": "~9.1.2",
"@angular/animations": "~12.2.11",
"@angular/common": "~12.2.11",
"@angular/compiler": "~12.2.11",
"@angular/core": "~12.2.11",
"@angular/forms": "~12.2.11",
"@angular/localize": "~12.2.11",
"@angular/platform-browser": "~12.2.11",
"@angular/platform-browser-dynamic": "~12.2.11",
"@angular/router": "~12.2.11",
"rxjs": "^6.6.7",
"tslib": "^2.2.0",
"zone.js": "~0.11.4",
"@cds/core": "~5.5.8",
"@clr/angular": "~12.0.6",
"@clr/icons": "~12.0.6",
"@clr/ui": "~12.0.6",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
"@types/jquery": "^2.0.56",
"@webcomponents/custom-elements": "^1.4.3",
"@webcomponents/webcomponentsjs": "^2.5.0",
"buffer": "^5.7.1",
"core-js": "^2.6.12",
"cron-validator": "^1.2.1",
"intl": "^1.2.5",
"mutationobserver-shim": "^0.3.7",
"ng-packagr": "^12.0.4",
"ngx-clipboard": "^12.3.1",
"ngx-cookie": "^1.0.0",
"ngx-cookie": "^5.0.2",
"ngx-markdown": "~12.0.1",
"popper.js": "^1.16.1",
"rxjs": "^6.6.7",
"stream": "^0.0.2",
"swagger-ui": "^3.50.0",
"ts-helpers": "^1.1.1",
"tslib": "^2.2.0",
"types": "^0.1.1",
"web-animations-js": "^2.3.2",
"zone.js": "~0.11.4"
"swagger-ui": "^3.52.5",
"buffer": "^6.0.3",
"js-yaml": "^4.1.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^12.0.3",
"@angular/cli": "^12.0.3",
"@angular/compiler-cli": "^12.0.3",
"@angular/language-service": "^12.0.3",
"@types/core-js": "^0.9.41",
"@angular-devkit/build-angular": "~12.2.11",
"@angular/cli": "~12.2.11",
"@angular/compiler-cli": "~12.2.11",
"@types/express": "^4.17.12",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "^2.0.9",
"@types/node": "^14.17.3",
"@types/jasmine": "~3.10.1",
"@types/node": "^16.11.6",
"codelyzer": "^6.0.2",
"enhanced-resolve": "^3.0.0",
"express": "^4.17.1",
"jasmine-core": "^3.7.1",
"jasmine-spec-reporter": "~5.0.0",
"js-yaml": "^3.14.1",
"jasmine-spec-reporter": "~7.0.0",
"karma": "^6.3.3",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "^2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"ng-swagger-gen": "^1.8.1",
"ng-swagger-gen": "^2.3.1",
"protractor": "^7.0.0",
"rollup": "^2.51.1",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-plugin-uglify": "^1.0.1",
"ts-node": "~5.0.1",
"tsickle": "~0.40.0",
"tslint": "~6.1.3",
"typescript": "~4.2.3",
"typings": "^2.1.1",
"uglify-js": "3.3.18",
"webdriver-manager": "10.2.5"
"eslint": "8.1.0",
"typescript": "~4.3.5"
}
}

View File

@ -15,7 +15,7 @@
.refresh-btn:hover {
color: #007CBB;
}
:host >>> .btn-group-overflow .dropdown-toggle {
:host::ng-deep .btn-group-overflow .dropdown-toggle {
line-height: 24px;
height: 24px;
}
@ -32,7 +32,7 @@ clr-datagrid {
}
}
:host >>> clr-checkbox.checkbox.datagrid-foot-select {
:host::ng-deep clr-checkbox.checkbox.datagrid-foot-select {
position: inherit;
}
.content-space {

View File

@ -1,15 +1,11 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { CUSTOM_ELEMENTS_SCHEMA, SecurityContext } from '@angular/core';
import { ClarityModule } from '@clr/angular';
import { FormsModule } from '@angular/forms';
import { MarkdownModule, MarkedOptions } from 'ngx-markdown';
import { BrowserModule } from '@angular/platform-browser';
import { ValuesComponent } from "./values.component";
import { AdditionsService } from "../additions.service";
import { of } from "rxjs";
import { AdditionLink } from "../../../../../../../../ng-swagger-gen/models/addition-link";
import { ErrorHandler } from "../../../../../../shared/units/error-handler";
import { SharedTestingModule } from "../../../../../../shared/shared.module";
describe('ValuesComponent', () => {
@ -33,19 +29,14 @@ describe('ValuesComponent', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
TranslateModule.forRoot(),
SharedTestingModule,
MarkdownModule.forRoot({ sanitize: SecurityContext.HTML }),
ClarityModule,
FormsModule,
BrowserModule
],
declarations: [ValuesComponent],
schemas: [
CUSTOM_ELEMENTS_SCHEMA
],
providers: [
TranslateService,
ErrorHandler,
{provide: AdditionsService, useValue: fakedAdditionsService},
{provide: MarkedOptions, useValue: {}},
]

View File

@ -35,7 +35,7 @@ export class ValuesComponent implements OnInit {
.subscribe(
res => {
try {
this.format(yaml.safeLoad(res));
this.format(yaml.load(res));
this.values = res;
} catch (e) {
this.errorHandler.error(e);

View File

@ -68,7 +68,7 @@
height: 0;
}
:host >>> .datagrid-placeholder {
:host::ng-deep .datagrid-placeholder {
display: none;
}
@ -84,7 +84,7 @@
margin-right: 6px;
}
:host >>> .datagrid clr-dg-column {
:host ::ng-deep .datagrid clr-dg-column {
min-width: 80px;
}
@ -150,15 +150,15 @@
margin: 6px 0;
}
:host >>> .signpost-content {
:host::ng-deep .signpost-content {
min-width: 4rem;
}
:host >>> .signpost-content-body {
:host::ng-deep .signpost-content-body {
padding: 0 0.4rem;
}
:host >>> .signpost-content-header {
:host::ng-deep .signpost-content-header {
display: none;
}

View File

@ -10,6 +10,6 @@
text-align: center;
align-items: center;
}
:host >>> .alert-icon-wrapper{
:host::ng-deep .alert-icon-wrapper{
display: inline;
}
}

View File

@ -15,7 +15,7 @@
.eventErrorInf {display:block; font-size: 12px;color:red;line-height: .6rem;}
.eventTarget{display: inline-flex; width: 160px; font-size: 12px; flex-shrink:1; overflow: hidden; text-overflow: ellipsis;white-space: nowrap;}
.eventTime{ float: right; font-size: 12px;}
:host >>> .nav{padding-left: 38px;}
:host::ng-deep .nav{padding-left: 38px;}
.operDiv {
position: fixed;

View File

@ -34,7 +34,7 @@
border: 0;
}
:host>>>.dropdown-menu {
:host::ng-deep.dropdown-menu {
min-width: 360px;
max-width: 720px;
}