diff --git a/.travis.yml b/.travis.yml index 9e9525c74..cdd210c46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -97,7 +97,7 @@ script: - docker-compose -f make/docker-compose.test.yml down - sudo rm -rf /data/config/* - ls /data/cert - - sudo make install GOBUILDIMAGE=golang:1.7.3 COMPILETAG=compile_golangimage CLARITYIMAGE=vmware/harbor-clarity-ui-builder:1.1.0 NOTARYFLAG=true + - sudo make install GOBUILDIMAGE=golang:1.7.3 COMPILETAG=compile_golangimage CLARITYIMAGE=vmware/harbor-clarity-ui-builder:1.1.1 NOTARYFLAG=true - docker ps - ./tests/notarytest.sh diff --git a/Makefile b/Makefile index 629158e7a..86a4a7beb 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ NEWCLARITYVERSION= #clarity parameters CLARITYIMAGE=vmware/harbor-clarity-ui-builder[:tag] -CLARITYSEEDPATH=/clarity-seed +CLARITYSEEDPATH=/harbor_ui CLARITYBUILDSCRIPT=/entrypoint.sh # docker parameters diff --git a/make/dev/nodeclarity/Dockerfile b/make/dev/nodeclarity/Dockerfile index 7a425d71a..dc6f3fb6d 100644 --- a/make/dev/nodeclarity/Dockerfile +++ b/make/dev/nodeclarity/Dockerfile @@ -1,20 +1,20 @@ FROM node:7.5.0 -RUN mkdir -p /clarity-seed +RUN mkdir -p /harbor_ui -COPY src/ui_ng/package.json /clarity-seed -COPY src/ui_ng/tslint.json /clarity-seed -COPY src/ui_ng/typings.json /clarity-seed -COPY src/ui_ng/yarn.lock /clarity-seed -COPY make/dev/nodeclarity/angular-cli.json /clarity-seed +COPY src/ui_ng/package.json /harbor_ui +COPY src/ui_ng/tslint.json /harbor_ui +COPY src/ui_ng/typings.json /harbor_ui +COPY src/ui_ng/yarn.lock /harbor_ui +COPY make/dev/nodeclarity/angular-cli.json /harbor_ui COPY make/dev/nodeclarity/entrypoint.sh / -COPY src/ui_ng/tsconfig-aot.json /clarity-seed -COPY src/ui_ng/rollup-config.js /clarity-seed +COPY src/ui_ng/tsconfig-aot.json /harbor_ui +COPY src/ui_ng/rollup-config.js /harbor_ui -WORKDIR /clarity-seed +WORKDIR /harbor_ui RUN npm __proxy__ install -g @angular/cli && \ npm __proxy__ install && \ chmod u+x /entrypoint.sh -VOLUME ["/clarity-seed", "/clarity-seed/dist"] +VOLUME ["/harbor_ui", "/harbor_ui/dist"] diff --git a/make/dev/nodeclarity/angular-cli.json b/make/dev/nodeclarity/angular-cli.json index bba385099..059a95272 100644 --- a/make/dev/nodeclarity/angular-cli.json +++ b/make/dev/nodeclarity/angular-cli.json @@ -1,7 +1,7 @@ { "project": { - "version": "1.0.0-beta.20-4", - "name": "clarity-seed" + "version": "1.1.0", + "name": "Harbor" }, "apps": [ { diff --git a/make/dev/nodeclarity/entrypoint.sh b/make/dev/nodeclarity/entrypoint.sh index 8e90cd0f5..5b2a23240 100644 --- a/make/dev/nodeclarity/entrypoint.sh +++ b/make/dev/nodeclarity/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -cd /clarity-seed +cd /harbor_ui rm -rf dist/* npm_proxy= diff --git a/src/ui_ng/src/app/log/audit-log.component.html b/src/ui_ng/src/app/log/audit-log.component.html index 39e2b726e..2d026c4d0 100644 --- a/src/ui_ng/src/app/log/audit-log.component.html +++ b/src/ui_ng/src/app/log/audit-log.component.html @@ -14,12 +14,28 @@
- - + + + +
diff --git a/src/ui_ng/src/app/log/audit-log.component.ts b/src/ui_ng/src/app/log/audit-log.component.ts index 7c4a24aff..6444b7a26 100644 --- a/src/ui_ng/src/app/log/audit-log.component.ts +++ b/src/ui_ng/src/app/log/audit-log.component.ts @@ -11,7 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { NgModel } from '@angular/forms'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { AuditLog } from './audit-log'; @@ -70,6 +71,17 @@ export class AuditLogComponent implements OnInit { totalRecordCount: number; totalPage: number; + @ViewChild('fromTime') fromTimeInput: NgModel; + @ViewChild('toTime') toTimeInput: NgModel; + + get fromTimeInvalid(): boolean { + return this.fromTimeInput.errors && this.fromTimeInput.errors.dateValidator && (this.fromTimeInput.dirty || this.fromTimeInput.touched) + } + + get toTimeInvalid(): boolean { + return this.toTimeInput.errors && this.toTimeInput.errors.dateValidator && (this.toTimeInput.dirty || this.toTimeInput.touched); + } + constructor(private route: ActivatedRoute, private router: Router, private auditLogService: AuditLogService, private messageHandlerService: MessageHandlerService) { //Get current user from registered resolver. this.route.data.subscribe(data=>this.currentUser = data['auditLogResolver']); @@ -79,6 +91,7 @@ export class AuditLogComponent implements OnInit { this.projectId = +this.route.snapshot.parent.params['id']; this.queryParam.project_id = this.projectId; this.queryParam.page_size = this.pageSize; + } retrieve(state?: State): void { @@ -105,15 +118,29 @@ export class AuditLogComponent implements OnInit { this.retrieve(); } - doSearchByTimeRange(strDate: string, target: string): void { - let oneDayOffset = 3600 * 24; - switch(target) { - case 'begin': + convertDate(strDate: string): string { + if(/^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d$/.test(strDate)) { + let parts = strDate.split(/[-\/]/); + strDate = parts[2] /*Year*/ + '-' +parts[1] /*Month*/ + '-' + parts[0] /*Date*/; + } + return strDate; + } + + doSearchByStartTime(strDate: string): void { + this.queryParam.begin_timestamp = 0; + if(this.fromTimeInput.valid && strDate){ + strDate = this.convertDate(strDate); this.queryParam.begin_timestamp = new Date(strDate).getTime() / 1000; - break; - case 'end': + } + this.retrieve(); + } + + doSearchByEndTime(strDate: string): void { + this.queryParam.end_timestamp = 0; + if(this.toTimeInput.valid && strDate) { + strDate = this.convertDate(strDate); + let oneDayOffset = 3600 * 24; this.queryParam.end_timestamp = new Date(strDate).getTime() / 1000 + oneDayOffset; - break; } this.retrieve(); } diff --git a/src/ui_ng/src/app/log/audit-log.ts b/src/ui_ng/src/app/log/audit-log.ts index 2a5cbfb3e..d90da1ad7 100644 --- a/src/ui_ng/src/app/log/audit-log.ts +++ b/src/ui_ng/src/app/log/audit-log.ts @@ -42,4 +42,6 @@ export class AuditLog { keywords: string; page: number; page_size: number; + fromTime: string; + toTime: string; } \ No newline at end of file diff --git a/src/ui_ng/src/app/log/log.module.ts b/src/ui_ng/src/app/log/log.module.ts index 533e20d7d..6200eb09f 100644 --- a/src/ui_ng/src/app/log/log.module.ts +++ b/src/ui_ng/src/app/log/log.module.ts @@ -21,7 +21,8 @@ import { RecentLogComponent } from './recent-log.component'; imports: [SharedModule], declarations: [ AuditLogComponent, - RecentLogComponent], + RecentLogComponent + ], providers: [AuditLogService], exports: [ AuditLogComponent, diff --git a/src/ui_ng/src/app/project/create-project/create-project.component.html b/src/ui_ng/src/app/project/create-project/create-project.component.html index 97f838bb2..5ccdd2b0d 100644 --- a/src/ui_ng/src/app/project/create-project/create-project.component.html +++ b/src/ui_ng/src/app/project/create-project/create-project.component.html @@ -4,10 +4,10 @@ diff --git a/src/ui_ng/src/app/project/create-project/create-project.css b/src/ui_ng/src/app/project/create-project/create-project.css index 526c33101..0bcac82e9 100644 --- a/src/ui_ng/src/app/project/create-project/create-project.css +++ b/src/ui_ng/src/app/project/create-project/create-project.css @@ -1,12 +1,3 @@ -.inline-help-public { - color: #CCCCCC; - font-size: 12px; - line-height: 1.5em; - letter-spacing: 0.01em; - margin-top: 0; - padding: 0 14px; -} - .form-group-label-override { font-size: 14px; font-weight: 400; diff --git a/src/ui_ng/src/app/project/list-project/list-project.component.html b/src/ui_ng/src/app/project/list-project/list-project.component.html index da18a7f7d..4529d2876 100644 --- a/src/ui_ng/src/app/project/list-project/list-project.component.html +++ b/src/ui_ng/src/app/project/list-project/list-project.component.html @@ -1,6 +1,6 @@ {{'PROJECT.NAME' | translate}} - {{'PROJECT.PUBLIC_OR_PRIVATE' | translate}} + {{'PROJECT.ACCESS_LEVEL' | translate}} {{'PROJECT.ROLE' | translate}} {{'PROJECT.REPO_COUNT'| translate}} {{'PROJECT.CREATION_TIME' | translate}} diff --git a/src/ui_ng/src/app/project/member/member.component.css b/src/ui_ng/src/app/project/member/member.component.css index c782e3827..ab3bc903f 100644 --- a/src/ui_ng/src/app/project/member/member.component.css +++ b/src/ui_ng/src/app/project/member/member.component.css @@ -5,8 +5,4 @@ .option-right { padding-right: 16px; margin-top: 18px; -} - -.datagrid-foot { - margin-bottom: 0.5px; } \ 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 78ba04ea8..7f36d7639 100644 --- a/src/ui_ng/src/app/project/member/member.component.html +++ b/src/ui_ng/src/app/project/member/member.component.html @@ -19,9 +19,9 @@ {{'MEMBER.ROLE' | translate}} - - - + + + {{m.username}} diff --git a/src/ui_ng/src/app/project/member/member.component.ts b/src/ui_ng/src/app/project/member/member.component.ts index a69ac692c..2521fe519 100644 --- a/src/ui_ng/src/app/project/member/member.component.ts +++ b/src/ui_ng/src/app/project/member/member.component.ts @@ -22,7 +22,7 @@ import { MemberService } from './member.service'; import { AddMemberComponent } from './add-member/add-member.component'; import { MessageHandlerService } from '../../shared/message-handler/message-handler.service'; -import { ConfirmationTargets, ConfirmationState } from '../../shared/shared.const'; +import { ConfirmationTargets, ConfirmationState, ConfirmationButtons } from '../../shared/shared.const'; import { ConfirmationDialogService } from '../../shared/confirmation-dialog/confirmation-dialog.service'; import { ConfirmationMessage } from '../../shared/confirmation-dialog/confirmation-message'; @@ -111,8 +111,8 @@ export class MemberComponent implements OnInit, OnDestroy { ngOnInit() { //Get projectId from route params snapshot. this.projectId = +this.route.snapshot.parent.params['id']; - this.currentUser = this.session.getCurrentUser(); //Get current user from registered resolver. + this.currentUser = this.session.getCurrentUser(); let resolverData = this.route.snapshot.parent.data; if(resolverData) { this.hasProjectAdminRole = (resolverData['projectResolver']).has_project_admin_role; @@ -149,7 +149,8 @@ export class MemberComponent implements OnInit, OnDestroy { 'MEMBER.DELETION_SUMMARY', m.username, m.user_id, - ConfirmationTargets.PROJECT_MEMBER + ConfirmationTargets.PROJECT_MEMBER, + ConfirmationButtons.DELETE_CANCEL ); this.deletionDialogService.openComfirmDialog(deletionMessage); } diff --git a/src/ui_ng/src/app/project/project-detail/project-detail.component.css b/src/ui_ng/src/app/project/project-detail/project-detail.component.css index 25f27c693..90f5add5f 100644 --- a/src/ui_ng/src/app/project/project-detail/project-detail.component.css +++ b/src/ui_ng/src/app/project/project-detail/project-detail.component.css @@ -7,6 +7,10 @@ background-color: #fafafa; } +.subnav .nav { + padding-left: 0; +} + .role-label { color: #CCCCCC; font-size: 14px; diff --git a/src/ui_ng/src/app/project/project.component.html b/src/ui_ng/src/app/project/project.component.html index e2b82e968..ddc4aed0c 100644 --- a/src/ui_ng/src/app/project/project.component.html +++ b/src/ui_ng/src/app/project/project.component.html @@ -13,7 +13,7 @@
- diff --git a/src/ui_ng/src/app/project/project.component.ts b/src/ui_ng/src/app/project/project.component.ts index 4c8489f41..fcb4b668d 100644 --- a/src/ui_ng/src/app/project/project.component.ts +++ b/src/ui_ng/src/app/project/project.component.ts @@ -29,7 +29,7 @@ import { Response } from '@angular/http'; import { ConfirmationDialogService } from '../shared/confirmation-dialog/confirmation-dialog.service'; import { ConfirmationMessage } from '../shared/confirmation-dialog/confirmation-message'; -import { ConfirmationTargets, ConfirmationState } from '../shared/shared.const'; +import { ConfirmationTargets, ConfirmationState, ConfirmationButtons } from '../shared/shared.const'; import { Subscription } from 'rxjs/Subscription'; @@ -178,7 +178,8 @@ export class ProjectComponent implements OnInit, OnDestroy { 'PROJECT.DELETION_SUMMARY', p.name, p.project_id, - ConfirmationTargets.PROJECT + ConfirmationTargets.PROJECT, + ConfirmationButtons.DELETE_CANCEL ); this.deletionDialogService.openComfirmDialog(deletionMessage); } diff --git a/src/ui_ng/src/app/replication/destination/destination.component.ts b/src/ui_ng/src/app/replication/destination/destination.component.ts index 384395041..37f049471 100644 --- a/src/ui_ng/src/app/replication/destination/destination.component.ts +++ b/src/ui_ng/src/app/replication/destination/destination.component.ts @@ -19,7 +19,7 @@ import { MessageHandlerService } from '../../shared/message-handler/message-hand import { ConfirmationDialogService } from '../../shared/confirmation-dialog/confirmation-dialog.service'; import { ConfirmationMessage } from '../../shared/confirmation-dialog/confirmation-message'; -import { ConfirmationTargets, ConfirmationState } from '../../shared/shared.const'; +import { ConfirmationTargets, ConfirmationState, ConfirmationButtons } from '../../shared/shared.const'; import { Subscription } from 'rxjs/Subscription'; @@ -149,7 +149,8 @@ export class DestinationComponent implements OnInit { 'REPLICATION.DELETION_SUMMARY_TARGET', target.name, target.id, - ConfirmationTargets.TARGET); + ConfirmationTargets.TARGET, + ConfirmationButtons.DELETE_CANCEL); this.deletionDialogService.openComfirmDialog(deletionMessage); } } diff --git a/src/ui_ng/src/app/replication/replication-management/replication-management.component.css b/src/ui_ng/src/app/replication/replication-management/replication-management.component.css index 0286e4e83..fd8cfb74e 100644 --- a/src/ui_ng/src/app/replication/replication-management/replication-management.component.css +++ b/src/ui_ng/src/app/replication/replication-management/replication-management.component.css @@ -5,4 +5,8 @@ .sub-nav-bg-color { background-color: #fafafa; +} + +.subnav .nav { + padding-left: 0; } \ No newline at end of file diff --git a/src/ui_ng/src/app/replication/replication.component.html b/src/ui_ng/src/app/replication/replication.component.html index ac6a8e8f8..2f28a0c00 100644 --- a/src/ui_ng/src/app/replication/replication.component.html +++ b/src/ui_ng/src/app/replication/replication.component.html @@ -1,58 +1,62 @@
-
-
-
- - -
-
- - - - - - - - -
-
+
+
+
+ + +
+
+
+ +
+ + + + +
+
- +
-
-
{{'REPLICATION.REPLICATION_JOBS' | translate}}
-
- - - - - -
+
+
{{'REPLICATION.REPLICATION_JOBS' | translate}}
+
+ + + + +
-
- - - - -
- - -
+
+
+
+
+
+ + + + +
+
- +
\ No newline at end of file diff --git a/src/ui_ng/src/app/replication/replication.component.ts b/src/ui_ng/src/app/replication/replication.component.ts index 1392332e7..9bbeffaa3 100644 --- a/src/ui_ng/src/app/replication/replication.component.ts +++ b/src/ui_ng/src/app/replication/replication.component.ts @@ -13,6 +13,7 @@ // limitations under the License. import { Component, OnInit, ViewChild } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { NgModel } from '@angular/forms'; import { CreateEditPolicyComponent } from '../shared/create-edit-policy/create-edit-policy.component'; @@ -20,6 +21,7 @@ import { MessageHandlerService } from '../shared/message-handler/message-handler import { ReplicationService } from './replication.service'; +import { SessionUser } from '../shared/session-user'; import { Policy } from './policy'; import { Job } from './job'; import { Target } from './target'; @@ -27,13 +29,13 @@ import { Target } from './target'; import { State } from 'clarity-angular'; const ruleStatus = [ - { 'key': '', 'description': 'REPLICATION.ALL_STATUS'}, + { 'key': 'all', 'description': 'REPLICATION.ALL_STATUS'}, { 'key': '1', 'description': 'REPLICATION.ENABLED'}, { 'key': '0', 'description': 'REPLICATION.DISABLED'} ]; const jobStatus = [ - { 'key': '', 'description': 'REPLICATION.ALL' }, + { 'key': 'all', 'description': 'REPLICATION.ALL' }, { 'key': 'pending', 'description': 'REPLICATION.PENDING' }, { 'key': 'running', 'description': 'REPLICATION.RUNNING' }, { 'key': 'error', 'description': 'REPLICATION.ERROR' }, @@ -51,7 +53,9 @@ class SearchOption { repoName: string = ''; status: string = ''; startTime: string = ''; + startTimestamp: string = ''; endTime: string = ''; + endTimestamp: string = ''; page: number = 1; pageSize: number = 5; } @@ -62,10 +66,10 @@ class SearchOption { styleUrls: ['./replication.component.css'] }) export class ReplicationComponent implements OnInit { - + projectId: number; - search: SearchOption; + search: SearchOption = new SearchOption(); ruleStatus = ruleStatus; currentRuleStatus: {key: string, description: string}; @@ -89,15 +93,25 @@ export class ReplicationComponent implements OnInit { @ViewChild(CreateEditPolicyComponent) createEditPolicyComponent: CreateEditPolicyComponent; + @ViewChild('fromTime') fromTimeInput: NgModel; + @ViewChild('toTime') toTimeInput: NgModel; + + get fromTimeInvalid(): boolean { + return this.fromTimeInput.errors && this.fromTimeInput.errors.dateValidator && (this.fromTimeInput.dirty || this.fromTimeInput.touched); + } + + get toTimeInvalid(): boolean { + return this.toTimeInput.errors && this.toTimeInput.errors.dateValidator && (this.toTimeInput.dirty || this.toTimeInput.touched); + } + constructor( private messageHandlerService: MessageHandlerService, private replicationService: ReplicationService, - private route: ActivatedRoute) { + private route: ActivatedRoute) { } ngOnInit(): void { this.projectId = +this.route.snapshot.parent.params['id']; - this.search = new SearchOption(); this.currentRuleStatus = this.ruleStatus[0]; this.currentJobStatus = this.jobStatus[0]; this.currentJobSearchOption = 0; @@ -148,7 +162,7 @@ export class ReplicationComponent implements OnInit { } this.replicationService .listJobs(this.search.policyId, this.search.status, this.search.repoName, - this.search.startTime, this.search.endTime, this.search.page, this.search.pageSize) + this.search.startTimestamp, this.search.endTimestamp, this.search.page, this.search.pageSize) .subscribe( response=>{ this.jobsTotalRecordCount = response.headers.get('x-total-count'); @@ -171,9 +185,9 @@ export class ReplicationComponent implements OnInit { if(policy) { this.search.policyId = policy.id; this.search.repoName = ''; - this.search.status = '' + this.search.status = ''; this.currentJobSearchOption = 0; - this.currentJobStatus = { 'key': '', 'description': 'REPLICATION.ALL'}; + this.currentJobStatus = { 'key': 'all', 'description': 'REPLICATION.ALL' }; this.fetchPolicyJobs(); } } @@ -183,19 +197,28 @@ export class ReplicationComponent implements OnInit { this.retrievePolicies(); } - doFilterPolicyStatus(status: string) { - this.currentRuleStatus = this.ruleStatus.find(r=>r.key === status); - if(status.trim() === '') { - this.changedPolicies = this.policies; - } else { - this.changedPolicies = this.policies.filter(policy=>policy.enabled === +this.currentRuleStatus.key); + doFilterPolicyStatus($event: any) { + if ($event && $event.target && $event.target["value"]) { + let status = $event.target["value"]; + this.currentRuleStatus = this.ruleStatus.find(r=>r.key === status); + if(this.currentRuleStatus.key === 'all') { + this.changedPolicies = this.policies; + } else { + this.changedPolicies = this.policies.filter(policy=>policy.enabled === +this.currentRuleStatus.key); + } } } - doFilterJobStatus(status: string) { - this.currentJobStatus = this.jobStatus.find(r=>r.key === status); - this.search.status = status; - this.doSearchJobs(this.search.repoName); + doFilterJobStatus($event: any) { + if ($event && $event.target && $event.target["value"]) { + let status = $event.target["value"]; + this.currentJobStatus = this.jobStatus.find(r=>r.key === status); + if(this.currentJobStatus.key === 'all') { + status = ''; + } + this.search.status = status; + this.doSearchJobs(this.search.repoName); + } } doSearchJobs(repoName: string) { @@ -222,20 +245,30 @@ export class ReplicationComponent implements OnInit { (option === 1) ? this.currentJobSearchOption = 0 : this.currentJobSearchOption = 1; } + convertDate(strDate: string): string { + if(/^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d$/.test(strDate)) { + let parts = strDate.split(/[-\/]/); + strDate = parts[2] /*Year*/ + '-' +parts[1] /*Month*/ + '-' + parts[0] /*Date*/; + } + return strDate; + } + doJobSearchByStartTime(strDate: string) { - if(!strDate || strDate.trim() === '') { - strDate = 0 + ''; - } - (strDate === '0') ? this.search.startTime = '' : this.search.startTime = (new Date(strDate).getTime() / 1000) + ''; + this.search.startTimestamp = ''; + if(this.fromTimeInput.valid && strDate) { + strDate = this.convertDate(strDate); + this.search.startTimestamp = new Date(strDate).getTime() / 1000 + ''; + } this.fetchPolicyJobs(); } doJobSearchByEndTime(strDate: string) { - if(!strDate || strDate.trim() === '') { - strDate = 0 + ''; + this.search.endTimestamp = ''; + if(this.toTimeInput.valid && strDate) { + strDate = this.convertDate(strDate); + let oneDayOffset = 3600 * 24; + this.search.endTimestamp = (new Date(strDate).getTime() / 1000 + oneDayOffset) + ''; } - let oneDayOffset = 3600 * 24; - (strDate === '0') ? this.search.endTime = '' : this.search.endTime = (new Date(strDate).getTime() / 1000 + oneDayOffset) + ''; this.fetchPolicyJobs(); } } \ No newline at end of file diff --git a/src/ui_ng/src/app/repository/repository.component.ts b/src/ui_ng/src/app/repository/repository.component.ts index a3f24565c..265cb2ae1 100644 --- a/src/ui_ng/src/app/repository/repository.component.ts +++ b/src/ui_ng/src/app/repository/repository.component.ts @@ -18,7 +18,7 @@ import { RepositoryService } from './repository.service'; import { Repository } from './repository'; import { MessageHandlerService } from '../shared/message-handler/message-handler.service'; -import { ConfirmationState, ConfirmationTargets } from '../shared/shared.const'; +import { ConfirmationState, ConfirmationTargets, ConfirmationButtons } from '../shared/shared.const'; import { ConfirmationDialogService } from '../shared/confirmation-dialog/confirmation-dialog.service'; @@ -115,7 +115,8 @@ export class RepositoryComponent implements OnInit { 'REPOSITORY.DELETION_SUMMARY_REPO', repoName, repoName, - ConfirmationTargets.REPOSITORY); + ConfirmationTargets.REPOSITORY, + ConfirmationButtons.DELETE_CANCEL); this.deletionDialogService.openComfirmDialog(message); } diff --git a/src/ui_ng/src/app/repository/tag-repository/tag-repository.component.ts b/src/ui_ng/src/app/repository/tag-repository/tag-repository.component.ts index 37f32ea5a..5c5db27df 100644 --- a/src/ui_ng/src/app/repository/tag-repository/tag-repository.component.ts +++ b/src/ui_ng/src/app/repository/tag-repository/tag-repository.component.ts @@ -16,7 +16,7 @@ import { ActivatedRoute } from '@angular/router'; import { RepositoryService } from '../repository.service'; import { MessageHandlerService } from '../../shared/message-handler/message-handler.service'; -import { ConfirmationTargets, ConfirmationState } from '../../shared/shared.const'; +import { ConfirmationTargets, ConfirmationState, ConfirmationButtons } from '../../shared/shared.const'; import { ConfirmationDialogService } from '../../shared/confirmation-dialog/confirmation-dialog.service'; import { ConfirmationMessage } from '../../shared/confirmation-dialog/confirmation-message'; @@ -155,25 +155,25 @@ export class TagRepositoryComponent implements OnInit, OnDestroy { deleteTag(tag: TagView) { if (tag) { - let titleKey: string, summaryKey: string, content: string, confirmOnly: boolean; + let titleKey: string, summaryKey: string, content: string, buttons: ConfirmationButtons; if (tag.signed) { titleKey = 'REPOSITORY.DELETION_TITLE_TAG_DENIED'; summaryKey = 'REPOSITORY.DELETION_SUMMARY_TAG_DENIED'; - confirmOnly = true; + buttons = ConfirmationButtons.CLOSE; content = 'notary -s https://' + this.registryUrl + ':4443 -d ~/.docker/trust remove -p ' + this.registryUrl + '/' + this.repoName + ' ' + tag.tag; } else { titleKey = 'REPOSITORY.DELETION_TITLE_TAG'; summaryKey = 'REPOSITORY.DELETION_SUMMARY_TAG'; + buttons = ConfirmationButtons.DELETE_CANCEL; content = tag.tag; - confirmOnly = false; } let message = new ConfirmationMessage( titleKey, summaryKey, content, tag, - ConfirmationTargets.TAG); - message.confirmOnly = confirmOnly; + ConfirmationTargets.TAG, + buttons); this.deletionDialogService.openComfirmDialog(message); } } diff --git a/src/ui_ng/src/app/shared/confirmation-dialog/confirmation-dialog.component.html b/src/ui_ng/src/app/shared/confirmation-dialog/confirmation-dialog.component.html index fe56db9b8..0154a11dd 100644 --- a/src/ui_ng/src/app/shared/confirmation-dialog/confirmation-dialog.component.html +++ b/src/ui_ng/src/app/shared/confirmation-dialog/confirmation-dialog.component.html @@ -6,8 +6,21 @@
{{dialogContent}}
-