diff --git a/src/portal/src/app/app.component.ts b/src/portal/src/app/app.component.ts index ec6c61f52..a8dba24ae 100644 --- a/src/portal/src/app/app.component.ts +++ b/src/portal/src/app/app.component.ts @@ -20,7 +20,7 @@ import { CookieService } from 'ngx-cookie'; import { SessionService } from './shared/session.service'; import { AppConfigService } from './services/app-config.service'; import { ThemeService } from './services/theme.service'; -import { themeArray, ThemeInterface } from './services/theme'; +import { THEME_ARRAY, ThemeInterface } from './services/theme'; import { clone } from '../lib/utils/utils'; const HAS_STYLE_MODE: string = 'styleModeLocal'; @@ -30,7 +30,7 @@ const HAS_STYLE_MODE: string = 'styleModeLocal'; templateUrl: 'app.component.html' }) export class AppComponent { - themeArray: ThemeInterface[] = clone(themeArray); + themeArray: ThemeInterface[] = clone(THEME_ARRAY); styleMode: string = this.themeArray[0].showStyle; constructor( diff --git a/src/portal/src/app/base/harbor-shell/harbor-shell.component.html b/src/portal/src/app/base/harbor-shell/harbor-shell.component.html index 33b77e6a6..5301e8477 100644 --- a/src/portal/src/app/base/harbor-shell/harbor-shell.component.html +++ b/src/portal/src/app/base/harbor-shell/harbor-shell.component.html @@ -81,7 +81,17 @@ diff --git a/src/portal/src/app/base/navigator/navigator.component.scss b/src/portal/src/app/base/navigator/navigator.component.scss index 6af4a8ada..9bf6677c5 100644 --- a/src/portal/src/app/base/navigator/navigator.component.scss +++ b/src/portal/src/app/base/navigator/navigator.component.scss @@ -68,27 +68,3 @@ .dropdown-lang { padding-right: 1.3rem; } -.header { - .header-actions { - .theme-select { - width: 5.4rem; - display: flex; - align-items: center; - justify-content: flex-start; - height: 100%; - font-size: 14px; - letter-spacing: 1px; - cursor: pointer; - &:hover { - opacity: 1; - } - clr-icon { - position: static; - transform: none; - margin-right: .2rem; - min-width: 20px; - } - } - } -} - diff --git a/src/portal/src/app/base/navigator/navigator.component.ts b/src/portal/src/app/base/navigator/navigator.component.ts index 037c8f88f..ee993bb90 100644 --- a/src/portal/src/app/base/navigator/navigator.component.ts +++ b/src/portal/src/app/base/navigator/navigator.component.ts @@ -26,10 +26,7 @@ import { SearchTriggerService } from '../global-search/search-trigger.service'; import { MessageHandlerService } from '../../shared/message-handler/message-handler.service'; import { SkinableConfig } from "../../services/skinable-config.service"; import { CommonRoutes } from "../../../lib/entities/shared.const"; -import { ThemeInterface, themeArray } from '../../services/theme'; -import { clone } from '../../../lib/utils/utils'; -import { ThemeService } from '../../services/theme.service'; -const HAS_STYLE_MODE: string = 'styleModeLocal'; + @Component({ selector: 'navigator', @@ -46,9 +43,6 @@ export class NavigatorComponent implements OnInit { appTitle: string = 'APP_TITLE.HARBOR'; customStyle: { [key: string]: any }; customProjectName: { [key: string]: any }; - themeArray: ThemeInterface[] = clone(themeArray); - - styleMode = this.themeArray[0].showStyle; constructor( private session: SessionService, private router: Router, @@ -58,7 +52,6 @@ export class NavigatorComponent implements OnInit { private appConfigService: AppConfigService, private msgHandler: MessageHandlerService, private searchTrigger: SearchTriggerService, - public theme: ThemeService, private skinableConfig: SkinableConfig) { } @@ -86,8 +79,6 @@ export class NavigatorComponent implements OnInit { if (this.appConfigService.getConfig().read_only) { this.msgHandler.handleReadOnly(); } - // set local in app - this.styleMode = localStorage.getItem(HAS_STYLE_MODE); } public get isSessionValid(): boolean { @@ -196,10 +187,4 @@ export class NavigatorComponent implements OnInit { registryAction(): void { this.searchTrigger.closeSearch(true); } - - themeChanged(theme) { - this.styleMode = theme.mode; - this.theme.loadStyle(theme.toggleFileName); - localStorage.setItem(HAS_STYLE_MODE, this.styleMode); - } } diff --git a/src/portal/src/app/config/scanner/config-scanner.component.html b/src/portal/src/app/config/scanner/config-scanner.component.html index ff0097992..1148aa5cf 100644 --- a/src/portal/src/app/config/scanner/config-scanner.component.html +++ b/src/portal/src/app/config/scanner/config-scanner.component.html @@ -27,11 +27,11 @@ [disabled]="!(selectedRow && !selectedRow.is_default)"> - {{'SCANNER.ENABLE' | translate}} + {{'WEBHOOK.ENABLED_BUTTON' | translate}} - {{'SCANNER.DISABLE' | translate}} + {{'WEBHOOK.DISABLED_BUTTON' | translate}} - diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-additions.component.ts b/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-additions.component.ts index b73af3e2f..253c2f038 100644 --- a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-additions.component.ts +++ b/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-additions.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit, Input } from '@angular/core'; import { ADDITIONS } from "./models"; import { AdditionLinks } from "../../../../../../ng-swagger-gen/models/addition-links"; import { AdditionLink } from "../../../../../../ng-swagger-gen/models/addition-link"; +import { Artifact } from "../../../../../../ng-swagger-gen/models/artifact"; @Component({ selector: 'artifact-additions', @@ -9,6 +10,7 @@ import { AdditionLink } from "../../../../../../ng-swagger-gen/models/addition-l styleUrls: ['./artifact-additions.component.scss'] }) export class ArtifactAdditionsComponent implements OnInit { + @Input() artifact: Artifact; @Input() additionLinks: AdditionLinks; @Input() projectName: string; @Input() diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.html b/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.html index b0aec1130..eb4bde8ba 100644 --- a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.html +++ b/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.html @@ -15,7 +15,7 @@
- diff --git a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.ts b/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.ts index a4eeb16c1..db6c59580 100644 --- a/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.ts +++ b/src/portal/src/app/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.ts @@ -19,6 +19,7 @@ import { import { ChannelService } from "../../../../../../lib/services/channel.service"; import { ResultBarChartComponent } from "../../../vulnerability-scanning/result-bar-chart.component"; import { Subscription } from "rxjs"; +import { Artifact } from "../../../../../../../ng-swagger-gen/models/artifact"; @Component({ selector: 'hbr-artifact-vulnerabilities', @@ -36,6 +37,7 @@ export class ArtifactVulnerabilitiesComponent implements OnInit, OnDestroy { repoName: string; @Input() digest: string; + @Input() artifact: Artifact; scan_overview: any; scanner: ScannerVo; @@ -50,6 +52,7 @@ export class ArtifactVulnerabilitiesComponent implements OnInit, OnDestroy { @ViewChild(ResultBarChartComponent, {static: false}) resultBarChartComponent: ResultBarChartComponent; sub: Subscription; + hasViewInitWithDelay: boolean = false; constructor( private errorHandler: ErrorHandler, private additionsService: AdditionsService, @@ -74,6 +77,9 @@ export class ArtifactVulnerabilitiesComponent implements OnInit, OnDestroy { this.getVulnerabilities(); }); } + setTimeout(() => { + this.hasViewInitWithDelay = true; + }, 0); } ngOnDestroy() { if (this.sub) { @@ -81,7 +87,6 @@ export class ArtifactVulnerabilitiesComponent implements OnInit, OnDestroy { this.sub = null; } } - getVulnerabilities() { if (this.vulnerabilitiesLink && !this.vulnerabilitiesLink.absolute @@ -173,7 +178,13 @@ export class ArtifactVulnerabilitiesComponent implements OnInit, OnDestroy { this.onSendingScanCommand = e; } shouldShowBar(): boolean { - return this.resultBarChartComponent + return this.hasViewInitWithDelay && this.resultBarChartComponent && (this.resultBarChartComponent.queued || this.resultBarChartComponent.scanning || this.resultBarChartComponent.error); } + handleScanOverview(scanOverview: any): any { + if (scanOverview) { + return scanOverview[DEFAULT_SUPPORTED_MIME_TYPE]; + } + return null; + } } diff --git a/src/portal/src/app/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.ts b/src/portal/src/app/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.ts index b577d8c13..83683e3f4 100644 --- a/src/portal/src/app/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.ts +++ b/src/portal/src/app/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.ts @@ -37,7 +37,11 @@ export class ArtifactCommonPropertiesComponent implements OnInit, OnChanges { for (let name in this.commonProperties) { if (this.commonProperties.hasOwnProperty(name)) { if (typeof (this.commonProperties[name]) === 'object') { - this.commonProperties[name] = JSON.stringify(this.commonProperties[name]); + if (this.commonProperties[name] === null) { + this.commonProperties[name] = ''; + } else { + this.commonProperties[name] = JSON.stringify(this.commonProperties[name]); + } } if (name === Types.CREATED) { this.commonProperties[name] = new DatePipe(this.translate.currentLang) diff --git a/src/portal/src/app/project/repository/artifact/artifact-summary.component.html b/src/portal/src/app/project/repository/artifact/artifact-summary.component.html index 2fa57ccb2..1b1f7508f 100644 --- a/src/portal/src/app/project/repository/artifact/artifact-summary.component.html +++ b/src/portal/src/app/project/repository/artifact/artifact-summary.component.html @@ -27,7 +27,7 @@ -
+
+
+
+ {{vulnerabilitySummary?.severity | slice:0:1}} +
+
+
- {{'VULNERABILITY.OVERALL_SEVERITY' | translate }} {{'VULNERABILITY.SEVERITY.CRITICAL' | translate | titlecase }} - {{'VULNERABILITY.OVERALL_SEVERITY' | translate }} {{'VULNERABILITY.SEVERITY.HIGH' | translate | titlecase }} - {{'VULNERABILITY.OVERALL_SEVERITY' | translate }} {{'VULNERABILITY.SEVERITY.MEDIUM' | translate | titlecase}} - {{'VULNERABILITY.OVERALL_SEVERITY' | translate }} {{'VULNERABILITY.SEVERITY.LOW' | translate | titlecase }} - {{'VULNERABILITY.OVERALL_SEVERITY' | translate }} {{'VULNERABILITY.SEVERITY.UNKNOWN' | translate | titlecase }} - {{'VULNERABILITY.OVERALL_SEVERITY' | translate }} {{'VULNERABILITY.SEVERITY.NEGLIGIBLE' | translate | titlecase }} diff --git a/src/portal/src/app/project/repository/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.scss b/src/portal/src/app/project/repository/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.scss index 216a30a05..01e788853 100644 --- a/src/portal/src/app/project/repository/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.scss +++ b/src/portal/src/app/project/repository/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.scss @@ -291,4 +291,7 @@ hr { } .font-size-12 { font-size: 12px; +} +.margin-right-5 { + margin-right: 5px; } \ No newline at end of file diff --git a/src/portal/src/app/project/tag-feature-integration/immutable-tag/immutable-tag.component.html b/src/portal/src/app/project/tag-feature-integration/immutable-tag/immutable-tag.component.html index a31c492b3..3b62374cf 100644 --- a/src/portal/src/app/project/tag-feature-integration/immutable-tag/immutable-tag.component.html +++ b/src/portal/src/app/project/tag-feature-integration/immutable-tag/immutable-tag.component.html @@ -52,9 +52,6 @@
-
- {{'IMMUTABLE_TAG.ADD_RULE_HELP_1' | translate}} -
diff --git a/src/portal/src/app/project/tag-feature-integration/tag-retention/tag-retention.component.html b/src/portal/src/app/project/tag-feature-integration/tag-retention/tag-retention.component.html index c8042151f..62ca13138 100644 --- a/src/portal/src/app/project/tag-feature-integration/tag-retention/tag-retention.component.html +++ b/src/portal/src/app/project/tag-feature-integration/tag-retention/tag-retention.component.html @@ -63,9 +63,6 @@
-
- {{'TAG_RETENTION.ADD_RULE_HELP_1' | translate}} -
diff --git a/src/portal/src/app/project/webhook/webhook.component.html b/src/portal/src/app/project/webhook/webhook.component.html index 2c610b7d9..8ce0c51ae 100644 --- a/src/portal/src/app/project/webhook/webhook.component.html +++ b/src/portal/src/app/project/webhook/webhook.component.html @@ -17,11 +17,11 @@ - {{'WEBHOOK.ENABLE' | translate}} + {{'WEBHOOK.ENABLED_BUTTON' | translate}} - {{'WEBHOOK.DISABLE' | translate}} + {{'WEBHOOK.DISABLED_BUTTON' | translate}} diff --git a/src/portal/src/app/project/webhook/webhook.component.scss b/src/portal/src/app/project/webhook/webhook.component.scss index 290c4cb84..2b397edad 100644 --- a/src/portal/src/app/project/webhook/webhook.component.scss +++ b/src/portal/src/app/project/webhook/webhook.component.scss @@ -57,4 +57,7 @@ } .min-width-340 { min-width: 340px!important; +} +.margin-left-10 { + margin-left: 10px; } \ No newline at end of file diff --git a/src/portal/src/app/services/theme.ts b/src/portal/src/app/services/theme.ts index 00ccdd753..8fa426264 100644 --- a/src/portal/src/app/services/theme.ts +++ b/src/portal/src/app/services/theme.ts @@ -6,7 +6,7 @@ export interface ThemeInterface { toggleFileName: string; } -export const themeArray: ThemeInterface[] = [ +export const THEME_ARRAY: ThemeInterface[] = [ { showStyle: "DARK", mode: "LIGHT", diff --git a/src/portal/src/css/common.scss b/src/portal/src/css/common.scss index 04357fa67..75977cee4 100644 --- a/src/portal/src/css/common.scss +++ b/src/portal/src/css/common.scss @@ -185,3 +185,6 @@ hbr-tag { } +clr-header { + background-color: $header-color; +} \ No newline at end of file diff --git a/src/portal/src/css/dark-theme.scss b/src/portal/src/css/dark-theme.scss index 70e3aed74..d26d615a1 100644 --- a/src/portal/src/css/dark-theme.scss +++ b/src/portal/src/css/dark-theme.scss @@ -24,5 +24,6 @@ $color-ddd: #21333b; $color-f2: none; $color-657b83: none; $color-fdf6e3: none; +$header-color: hsl(198, 100%, 15%)!important; @import "./common.scss"; diff --git a/src/portal/src/css/light-theme.scss b/src/portal/src/css/light-theme.scss index 9d3a8c435..4c852a44b 100644 --- a/src/portal/src/css/light-theme.scss +++ b/src/portal/src/css/light-theme.scss @@ -26,5 +26,6 @@ $color-ddd: #ddd; $color-f2: #f2f2f2; $color-657b83: #657b83; $color-fdf6e3: #fdf6e3; +$header-color: rgb(0, 74, 112); @import "./common.scss"; diff --git a/src/portal/src/i18n/lang/en-us-lang.json b/src/portal/src/i18n/lang/en-us-lang.json index 312d60271..4a2954938 100644 --- a/src/portal/src/i18n/lang/en-us-lang.json +++ b/src/portal/src/i18n/lang/en-us-lang.json @@ -222,7 +222,7 @@ "NAME_IS_ILLEGAL": "Project name is invalid.", "UNKNOWN_ERROR": "An unknown error occurred while creating the project.", "ITEMS": "items", - "DELETION_TITLE": "Confirm removal of project members", + "DELETION_TITLE": "Confirm remove project", "DELETION_SUMMARY": "Do you want to delete project {{param}}?", "FILTER_PLACEHOLDER": "Filter Projects", "REPLICATION_RULE": "Replication Rule", @@ -468,7 +468,7 @@ "MONTH": "Month", "DAY_MONTH": "Day of month", "DAY_WEEK": "Day of week", - "CRON-TITLE": "Pattern description for cron '* * * * * *'", + "CRON_TITLE": "Pattern description for cron '* * * * * *'.The cron string is based on UTC time", "FIELD_NAME": "Field name", "MANDATORY": "Mandatory?", "ALLOWED_VALUES": "Allowed values", diff --git a/src/portal/src/i18n/lang/es-es-lang.json b/src/portal/src/i18n/lang/es-es-lang.json index 5436e9b8d..881363599 100644 --- a/src/portal/src/i18n/lang/es-es-lang.json +++ b/src/portal/src/i18n/lang/es-es-lang.json @@ -468,7 +468,7 @@ "MONTH": "Month", "DAY_MONTH": "Day of month", "DAY_WEEK": "Day of week", - "CRON-TITLE": "Pattern description for cron '* * * * * *'", + "CRON_TITLE": "Pattern description for cron '* * * * * *'.The cron string is based on UTC time", "FIELD_NAME": "Field name", "MANDATORY": "Mandatory?", "ALLOWED_VALUES": "Allowed values", diff --git a/src/portal/src/i18n/lang/fr-fr-lang.json b/src/portal/src/i18n/lang/fr-fr-lang.json index a7a6acad8..1bfd0d68b 100644 --- a/src/portal/src/i18n/lang/fr-fr-lang.json +++ b/src/portal/src/i18n/lang/fr-fr-lang.json @@ -460,7 +460,7 @@ "MONTH": "Month", "DAY_MONTH": "Day of month", "DAY_WEEK": "Day of week", - "CRON-TITLE": "Pattern description for cron '* * * * * *'", + "CRON_TITLE": "Pattern description for cron '* * * * * *'.The cron string is based on UTC time", "FIELD_NAME": "Field name", "MANDATORY": "Mandatory?", "ALLOWED_VALUES": "Allowed values", diff --git a/src/portal/src/i18n/lang/pt-br-lang.json b/src/portal/src/i18n/lang/pt-br-lang.json index 03fa5ab3c..37148dbe8 100644 --- a/src/portal/src/i18n/lang/pt-br-lang.json +++ b/src/portal/src/i18n/lang/pt-br-lang.json @@ -466,7 +466,7 @@ "MONTH": "Month", "DAY_MONTH": "Day of month", "DAY_WEEK": "Day of week", - "CRON-TITLE": "Pattern description for cron '* * * * * *'", + "CRON_TITLE": "Pattern description for cron '* * * * * *'.The cron string is based on UTC time", "FIELD_NAME": "Field name", "MANDATORY": "Mandatory?", "ALLOWED_VALUES": "Allowed values", diff --git a/src/portal/src/i18n/lang/tr-tr-lang.json b/src/portal/src/i18n/lang/tr-tr-lang.json index 63a76ae4d..304963f5b 100644 --- a/src/portal/src/i18n/lang/tr-tr-lang.json +++ b/src/portal/src/i18n/lang/tr-tr-lang.json @@ -468,7 +468,7 @@ "MONTH": "Ay", "DAY_MONTH": "Ayın günü", "DAY_WEEK": "Ayın haftası", - "CRON-TITLE": "Cron için kalıp açıklaması '* * * * * *'", + "CRON_TITLE": "Cron için kalıp açıklaması '* * * * * *'.The cron string is based on UTC time", "FIELD_NAME": "Alan adı", "MANDATORY": "Zorunlu?", "ALLOWED_VALUES": "İzin verilen değerler", diff --git a/src/portal/src/i18n/lang/zh-cn-lang.json b/src/portal/src/i18n/lang/zh-cn-lang.json index 0745efadd..739dd4a1d 100644 --- a/src/portal/src/i18n/lang/zh-cn-lang.json +++ b/src/portal/src/i18n/lang/zh-cn-lang.json @@ -467,7 +467,7 @@ "MONTH": "月", "DAY_MONTH": "一个月的一天", "DAY_WEEK": "一周的一天", - "CRON-TITLE": "cron格式描述 '* * * * * *'", + "CRON_TITLE": "cron格式描述 '* * * * * *'。cron 基于 UTC 时间", "FIELD_NAME": "字段名称", "MANDATORY": "是否强制?", "ALLOWED_VALUES": "允许的值", diff --git a/src/portal/src/lib/components/config/gc/gc.component.html b/src/portal/src/lib/components/config/gc/gc.component.html index 7aa4c76d7..13b62fac7 100644 --- a/src/portal/src/lib/components/config/gc/gc.component.html +++ b/src/portal/src/lib/components/config/gc/gc.component.html @@ -9,7 +9,7 @@
- diff --git a/src/portal/src/lib/components/cron-schedule/cron-schedule.component.scss b/src/portal/src/lib/components/cron-schedule/cron-schedule.component.scss index 9bf73e162..3cf4c61f5 100644 --- a/src/portal/src/lib/components/cron-schedule/cron-schedule.component.scss +++ b/src/portal/src/lib/components/cron-schedule/cron-schedule.component.scss @@ -23,7 +23,7 @@ .setting-wrapper { position: relative; .confirm-button { - margin: 20px 0 0; + margin: 11px 0 0; } *:not(:first-child) { diff --git a/src/portal/src/lib/components/cron-schedule/cron-tooltip/cron-tooltip.component.html b/src/portal/src/lib/components/cron-schedule/cron-tooltip/cron-tooltip.component.html index e9384aa47..262cb3978 100644 --- a/src/portal/src/lib/components/cron-schedule/cron-tooltip/cron-tooltip.component.html +++ b/src/portal/src/lib/components/cron-schedule/cron-tooltip/cron-tooltip.component.html @@ -1,7 +1,7 @@
- {{ 'REPLICATION.CRON-TITLE' | translate }} + {{ 'REPLICATION.CRON_TITLE' | translate }}