diff --git a/src/ui_ng/lib/src/config/system/system-settings.component.html.ts b/src/ui_ng/lib/src/config/system/system-settings.component.html.ts index b5354e272..763c39ddb 100644 --- a/src/ui_ng/lib/src/config/system/system-settings.component.html.ts +++ b/src/ui_ng/lib/src/config/system/system-settings.component.html.ts @@ -27,6 +27,15 @@ export const SYSTEM_SETTINGS_HTML: string = ` {{'CONFIG.TOOLTIP.ROOT_CERT_DOWNLOAD' | translate}} +
+ + + + + {{'CONFIG.TOOLTIP.REPO_TOOLTIP' | translate}} + + +
`; \ No newline at end of file diff --git a/src/ui_ng/lib/src/config/system/system-settings.component.ts b/src/ui_ng/lib/src/config/system/system-settings.component.ts index bff602e21..e98be3e56 100644 --- a/src/ui_ng/lib/src/config/system/system-settings.component.ts +++ b/src/ui_ng/lib/src/config/system/system-settings.component.ts @@ -41,6 +41,10 @@ export class SystemSettingsComponent { return this.systemSettingsForm && this.systemSettingsForm.valid; } + setRepoReadOnlyValue($event: any) { + this.systemSettings.read_only.value = $event; + } + get canDownloadCert(): boolean { return this.hasAdminRole && this.hasCAFile; } diff --git a/src/ui_ng/lib/src/create-edit-rule/create-edit-rule.component.spec.ts b/src/ui_ng/lib/src/create-edit-rule/create-edit-rule.component.spec.ts index 06118b582..bef7c0e64 100644 --- a/src/ui_ng/lib/src/create-edit-rule/create-edit-rule.component.spec.ts +++ b/src/ui_ng/lib/src/create-edit-rule/create-edit-rule.component.spec.ts @@ -284,7 +284,7 @@ describe('CreateEditRuleComponent (inline template)', ()=>{ it('Should open creation modal and load endpoints', async(()=>{ fixture.detectChanges(); - comp.openModal(); + compCreate.openCreateEditRule(); fixture.whenStable().then(()=>{ fixture.detectChanges(); let de: DebugElement = fixture.debugElement.query(By.css('input')); @@ -299,7 +299,7 @@ describe('CreateEditRuleComponent (inline template)', ()=>{ it('Should open modal to edit replication rule', async(()=>{ fixture.detectChanges(); - comp.openEditRule(mockRule); + compCreate.openCreateEditRule(mockRule.id); fixture.whenStable().then(()=>{ fixture.detectChanges(); let de: DebugElement = fixture.debugElement.query(By.css('input')); diff --git a/src/ui_ng/lib/src/list-replication-rule/list-replication-rule.component.html.ts b/src/ui_ng/lib/src/list-replication-rule/list-replication-rule.component.html.ts index 12a86b71e..20ca5fded 100644 --- a/src/ui_ng/lib/src/list-replication-rule/list-replication-rule.component.html.ts +++ b/src/ui_ng/lib/src/list-replication-rule/list-replication-rule.component.html.ts @@ -1,7 +1,7 @@ export const LIST_REPLICATION_RULE_TEMPLATE: string = `
- + diff --git a/src/ui_ng/lib/src/log/recent-log.template.ts b/src/ui_ng/lib/src/log/recent-log.template.ts index e1f2aa7ed..2f50b3403 100644 --- a/src/ui_ng/lib/src/log/recent-log.template.ts +++ b/src/ui_ng/lib/src/log/recent-log.template.ts @@ -7,7 +7,7 @@ export const LOG_TEMPLATE: string = `

{{'SIDE_NAV.LOGS' | translate}}

-
+
@@ -84,4 +84,10 @@ export const LOG_STYLES: string = ` top: 8px; position: relative; } +.rightPos { + position: absolute; + z-index: 100; + right: 35px; + margin-top: 4px; +} `; \ No newline at end of file diff --git a/src/ui_ng/lib/src/replication/replication.component.html.ts b/src/ui_ng/lib/src/replication/replication.component.html.ts index 91af4e7aa..bd1deaa84 100644 --- a/src/ui_ng/lib/src/replication/replication.component.html.ts +++ b/src/ui_ng/lib/src/replication/replication.component.html.ts @@ -73,6 +73,6 @@ export const REPLICATION_TEMPLATE: string = `
- +
`; \ No newline at end of file diff --git a/src/ui_ng/lib/src/repository/repository.component.html.ts b/src/ui_ng/lib/src/repository/repository.component.html.ts index e22ad9ae0..375dd286c 100644 --- a/src/ui_ng/lib/src/repository/repository.component.html.ts +++ b/src/ui_ng/lib/src/repository/repository.component.html.ts @@ -5,7 +5,7 @@ export const REPOSITORY_TEMPLATE = `
-

{{repoName}}

+

{{repoName}}

diff --git a/src/ui_ng/lib/src/tag/tag-detail.component.css.ts b/src/ui_ng/lib/src/tag/tag-detail.component.css.ts index f17860614..97bf9f26f 100644 --- a/src/ui_ng/lib/src/tag/tag-detail.component.css.ts +++ b/src/ui_ng/lib/src/tag/tag-detail.component.css.ts @@ -10,10 +10,6 @@ export const TAG_DETAIL_STYLES: string = ` padding-right: 24px; } -.title-block { - display: inline-block; -} - .title-wrapper { padding-top: 12px; } @@ -52,6 +48,10 @@ export const TAG_DETAIL_STYLES: string = ` padding: 6px 6px 6px 12px; } +.title-block { + display: inline-block; +} + .vulnerability-block { margin-bottom: 12px; } diff --git a/src/ui_ng/lib/src/tag/tag-detail.component.html.ts b/src/ui_ng/lib/src/tag/tag-detail.component.html.ts index e8989d94a..cd198af2b 100644 --- a/src/ui_ng/lib/src/tag/tag-detail.component.html.ts +++ b/src/ui_ng/lib/src/tag/tag-detail.component.html.ts @@ -6,9 +6,7 @@ export const TAG_DETAIL_HTML: string = `
-
-

{{repositoryId}}:{{tagDetails.name}}

-
+

{{repositoryId}}:{{tagDetails.name}}

diff --git a/src/ui_ng/lib/src/tag/tag-detail.component.spec.ts b/src/ui_ng/lib/src/tag/tag-detail.component.spec.ts index 30e7b053f..c1bc6645b 100644 --- a/src/ui_ng/lib/src/tag/tag-detail.component.spec.ts +++ b/src/ui_ng/lib/src/tag/tag-detail.component.spec.ts @@ -128,7 +128,7 @@ describe('TagDetailComponent (inline template)', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let el: HTMLElement = fixture.nativeElement.querySelector('.tag-name'); + let el: HTMLElement = fixture.nativeElement.querySelector('.custom-h2'); expect(el).toBeTruthy(); expect(el.textContent.trim()).toEqual('mock_repo:nginx'); }); diff --git a/src/ui_ng/lib/src/tag/tag.component.html.ts b/src/ui_ng/lib/src/tag/tag.component.html.ts index 8c8c2ff20..964453550 100644 --- a/src/ui_ng/lib/src/tag/tag.component.html.ts +++ b/src/ui_ng/lib/src/tag/tag.component.html.ts @@ -26,10 +26,9 @@ export const TAG_TEMPLATE = `
{{'LABEL.NO_LABELS' | translate }}
-
@@ -52,10 +51,9 @@ export const TAG_TEMPLATE = `
{{'LABEL.NO_LABELS' | translate }}
-
diff --git a/src/ui_ng/lib/src/tag/tag.component.ts b/src/ui_ng/lib/src/tag/tag.component.ts index 05d3c2605..5426931ad 100644 --- a/src/ui_ng/lib/src/tag/tag.component.ts +++ b/src/ui_ng/lib/src/tag/tag.component.ts @@ -310,8 +310,17 @@ export class TagComponent implements OnInit, AfterViewInit { this.selectedChange(tag); } - selectLabel(labelInfo: {[key: string]: any | string[]}): void { + + stickLabel(labelInfo: {[key: string]: any | string[]}): void { if (labelInfo && !labelInfo.iconsShow) { + this.selectLabel(labelInfo); + } + if (labelInfo && labelInfo.iconsShow) { + this.unSelectLabel(labelInfo); + } + } + + selectLabel(labelInfo: {[key: string]: any | string[]}): void { let labelId = labelInfo.label.id; this.selectedRow = this.selectedTag; toPromise(this.tagService.addLabelToImages(this.repoName, this.selectedRow[0].name, labelId)).then(res => { @@ -319,11 +328,9 @@ export class TagComponent implements OnInit, AfterViewInit { }).catch(err => { this.errorHandler.error(err); }); - } } unSelectLabel(labelInfo: {[key: string]: any | string[]}): void { - if (labelInfo && labelInfo.iconsShow) { let labelId = labelInfo.label.id; this.selectedRow = this.selectedTag; toPromise(this.tagService.deleteLabelToImages(this.repoName, this.selectedRow[0].name, labelId)).then(res => { @@ -331,11 +338,19 @@ export class TagComponent implements OnInit, AfterViewInit { }).catch(err => { this.errorHandler.error(err); }); + } + + rightFilterLabel(labelInfo: {[key: string]: any | string[]}): void { + if (labelInfo) { + if (!labelInfo.iconsShow) { + this.filterLabel(labelInfo); + } else { + this.unFilterLabel(labelInfo); + } } } filterLabel(labelInfo: {[key: string]: any | string[]}): void { - if (labelInfo && labelInfo.iconsShow) { let labelName = labelInfo.label.name; this.imageFilterLabels.filter(data => { if (data.label.name !== labelName) { @@ -361,11 +376,9 @@ export class TagComponent implements OnInit, AfterViewInit { } this.clrLoad(st); - } } unFilterLabel(labelInfo: {[key: string]: any | string[]}): void { - if (labelInfo && !labelInfo.iconsShow) { this.filterOneLabel = this.initFilter; // reload datagu @@ -383,7 +396,6 @@ export class TagComponent implements OnInit, AfterViewInit { st.filters = []; } this.clrLoad(st); - } } handleInputFilter() { diff --git a/src/ui_ng/package.json b/src/ui_ng/package.json index a54b15ee0..291a2d3a0 100644 --- a/src/ui_ng/package.json +++ b/src/ui_ng/package.json @@ -27,11 +27,11 @@ "@ngx-translate/http-loader": "0.0.3", "@types/jquery": "^2.0.41", "@webcomponents/custom-elements": "^1.0.0", - "clarity-angular": "^0.10.27", - "clarity-icons": "^0.10.17", - "clarity-ui": "^0.10.27", + "clarity-angular": "0.10.24", + "clarity-icons": "0.10.24", + "clarity-ui": "0.10.24", "core-js": "^2.4.1", - "harbor-ui": "0.6.67", + "harbor-ui": "0.6.68", "intl": "^1.2.5", "mutationobserver-shim": "^0.3.2", "ngx-cookie": "^1.0.0", diff --git a/src/ui_ng/src/app/base/harbor-shell/harbor-shell.component.css b/src/ui_ng/src/app/base/harbor-shell/harbor-shell.component.css index dc8ffec7b..374014acf 100644 --- a/src/ui_ng/src/app/base/harbor-shell/harbor-shell.component.css +++ b/src/ui_ng/src/app/base/harbor-shell/harbor-shell.component.css @@ -16,7 +16,8 @@ } .content-area-override { - padding: 36px !important; + padding-left: 36px !important; + padding-bottom: 36px !important; padding-right: 21px !important; } diff --git a/src/ui_ng/src/app/config/config.component.css b/src/ui_ng/src/app/config/config.component.css index 485ffef8d..e2d5acab2 100644 --- a/src/ui_ng/src/app/config/config.component.css +++ b/src/ui_ng/src/app/config/config.component.css @@ -1,6 +1,3 @@ -.custom-h2 { - margin-top: 0px !important; -} .info-tips-icon { color: grey; diff --git a/src/ui_ng/src/app/config/config.component.html b/src/ui_ng/src/app/config/config.component.html index 5e37f2ffc..6f00dce28 100644 --- a/src/ui_ng/src/app/config/config.component.html +++ b/src/ui_ng/src/app/config/config.component.html @@ -18,9 +18,6 @@ -
@@ -37,9 +34,6 @@
-
- -
diff --git a/src/ui_ng/src/app/config/config.component.ts b/src/ui_ng/src/app/config/config.component.ts index 6c4091831..ef70f27fb 100644 --- a/src/ui_ng/src/app/config/config.component.ts +++ b/src/ui_ng/src/app/config/config.component.ts @@ -31,7 +31,6 @@ import { SystemSettingsComponent, VulnerabilityConfigComponent, } from 'harbor-ui'; -import {RepoReadOnlyComponent} from "./repo/repo-read-only.component"; const fakePass = 'aWpLOSYkIzJTTU4wMDkx'; const TabLinkContentMap = { @@ -41,7 +40,6 @@ const TabLinkContentMap = { 'config-system': 'system_settings', 'config-vulnerability': 'vulnerability', 'config-label': 'system_label', - 'config-repo': 'repoReadOnly' }; @Component({ @@ -62,7 +60,6 @@ export class ConfigurationComponent implements OnInit, OnDestroy { @ViewChild(VulnerabilityConfigComponent) vulnerabilityConfig: VulnerabilityConfigComponent; @ViewChild(ConfigurationEmailComponent) mailConfig: ConfigurationEmailComponent; @ViewChild(ConfigurationAuthComponent) authConfig: ConfigurationAuthComponent; - @ViewChild(RepoReadOnlyComponent) repoConfig: RepoReadOnlyComponent; constructor( private msgHandler: MessageHandlerService, @@ -128,9 +125,6 @@ export class ConfigurationComponent implements OnInit, OnDestroy { case 'config-vulnerability': properties = ['scan_all_policy']; break; - case 'config-repo': - properties = ['read_only']; - break; default: return null; } diff --git a/src/ui_ng/src/app/config/config.module.ts b/src/ui_ng/src/app/config/config.module.ts index 4c955bf40..693edd0a5 100644 --- a/src/ui_ng/src/app/config/config.module.ts +++ b/src/ui_ng/src/app/config/config.module.ts @@ -19,7 +19,6 @@ import { ConfigurationComponent } from './config.component'; import { ConfigurationService } from './config.service'; import { ConfigurationAuthComponent } from './auth/config-auth.component'; import { ConfigurationEmailComponent } from './email/config-email.component'; -import {RepoReadOnlyComponent} from "./repo/repo-read-only.component"; @NgModule({ imports: [ @@ -30,7 +29,6 @@ import {RepoReadOnlyComponent} from "./repo/repo-read-only.component"; ConfigurationComponent, ConfigurationAuthComponent, ConfigurationEmailComponent, - RepoReadOnlyComponent ], exports: [ConfigurationComponent], providers: [ConfigurationService] diff --git a/src/ui_ng/src/app/config/repo/repo-read-only.component.ts b/src/ui_ng/src/app/config/repo/repo-read-only.component.ts deleted file mode 100644 index e94aac632..000000000 --- a/src/ui_ng/src/app/config/repo/repo-read-only.component.ts +++ /dev/null @@ -1,25 +0,0 @@ - -import {Component, Input, ViewChild} from "@angular/core"; -import {Configuration} from "harbor-ui"; -import {NgForm} from "@angular/forms"; - -@Component({ - selector: 'repo-read-only', - templateUrl: 'repo-read-only.html', -}) -export class RepoReadOnlyComponent { - - @Input('repoConfig') currentConfig: Configuration = new Configuration(); - - @ViewChild('repoConfigFrom') repoForm: NgForm; - - constructor() { } - - disabled(prop: any) { - return !(prop && prop.editable); - } - - setInsecureReadOnlyValue($event: any) { - this.currentConfig.read_only.value = $event; - } -} \ No newline at end of file diff --git a/src/ui_ng/src/app/config/repo/repo-read-only.html b/src/ui_ng/src/app/config/repo/repo-read-only.html deleted file mode 100644 index 5a5c8d285..000000000 --- a/src/ui_ng/src/app/config/repo/repo-read-only.html +++ /dev/null @@ -1,13 +0,0 @@ -
-
-
- - - - - {{'CONFIG.REPO_TOOLTIP' | translate}} - - -
-
-
\ No newline at end of file diff --git a/src/ui_ng/src/app/project/member/member.component.html b/src/ui_ng/src/app/project/member/member.component.html index acf5b9a51..c2a2e9fa9 100644 --- a/src/ui_ng/src/app/project/member/member.component.html +++ b/src/ui_ng/src/app/project/member/member.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/src/ui_ng/src/app/project/project-detail/project-detail.component.html b/src/ui_ng/src/app/project/project-detail/project-detail.component.html index 05f465388..140d5aa61 100644 --- a/src/ui_ng/src/app/project/project-detail/project-detail.component.html +++ b/src/ui_ng/src/app/project/project-detail/project-detail.component.html @@ -1,7 +1,7 @@ < {{'PROJECT_DETAIL.PROJECTS' | translate}} < {{'SEARCH.BACK' | translate}} -

{{currentProject.name}} {{roleName | translate}}

+

{{currentProject.name}} {{roleName | translate}}