From 74169e302185af8bc3c5b424c22982c7563b9a4c Mon Sep 17 00:00:00 2001 From: pengpengshui Date: Mon, 17 Jul 2017 12:46:01 -0700 Subject: [PATCH 1/4] fix issue about nav replicationManagement lose highlight --- .../src/app/base/harbor-shell/harbor-shell.component.html | 2 +- src/ui_ng/src/app/harbor-routing.module.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ui_ng/src/app/base/harbor-shell/harbor-shell.component.html b/src/ui_ng/src/app/base/harbor-shell/harbor-shell.component.html index 74b36c447..efe767bf4 100644 --- a/src/ui_ng/src/app/base/harbor-shell/harbor-shell.component.html +++ b/src/ui_ng/src/app/base/harbor-shell/harbor-shell.component.html @@ -17,7 +17,7 @@ diff --git a/src/ui_ng/src/app/harbor-routing.module.ts b/src/ui_ng/src/app/harbor-routing.module.ts index 75fd020ab..750b2b6e2 100644 --- a/src/ui_ng/src/app/harbor-routing.module.ts +++ b/src/ui_ng/src/app/harbor-routing.module.ts @@ -90,6 +90,10 @@ const harborRoutes: Routes = [ { path: 'endpoints', component: DestinationPageComponent + }, + { + path: '**', + redirectTo: 'endpoints' } ] }, From fc857a892811761a854e1dcac66a2f9887a7aed1 Mon Sep 17 00:00:00 2001 From: pengpengshui Date: Mon, 17 Jul 2017 15:28:31 -0700 Subject: [PATCH 2/4] fix create-project modal submit button issue --- .../project/create-project/create-project.component.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ui_ng/src/app/project/create-project/create-project.component.ts b/src/ui_ng/src/app/project/create-project/create-project.component.ts index 26155780c..a9ed7dc84 100644 --- a/src/ui_ng/src/app/project/create-project/create-project.component.ts +++ b/src/ui_ng/src/app/project/create-project/create-project.component.ts @@ -54,7 +54,7 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr createProjectOpened: boolean; hasChanged: boolean; - btnIsOk:boolean=false; + isSubmitValid:boolean=false; staticBackdrop: boolean = true; closable: boolean = false; @@ -87,11 +87,11 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr if (this.isNameValid) { //Check exiting from backend this.checkOnGoing = true; + this.isSubmitValid=true; this.projectService .checkProjectExists(cont.value).toPromise() .then(() => { //Project existing - this.btnIsOk=true; this.isNameValid = false; this.nameTooltipText = 'PROJECT.NAME_ALREADY_EXISTS'; this.checkOnGoing = false; @@ -111,7 +111,7 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr } onSubmit() { - this.btnIsOk=false; + this.isSubmitValid=false; this.projectService .createProject(this.project.name, this.project.public ? 1 : 0) .subscribe( @@ -187,7 +187,7 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr public get isValid(): boolean { return this.currentForm && this.currentForm.valid && - this.btnIsOk&& + this.isSubmitValid&& this.isNameValid && !this.checkOnGoing; } @@ -198,6 +198,7 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr if (cont) { this.proNameChecker.next(cont.value); } + } } From 26154aae559bba4d97d9357057dff28ad7d8b85a Mon Sep 17 00:00:00 2001 From: pengpengshui Date: Mon, 17 Jul 2017 17:07:46 -0700 Subject: [PATCH 3/4] change the code style of the issue create-project modal submit button --- .../create-project/create-project.component.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ui_ng/src/app/project/create-project/create-project.component.ts b/src/ui_ng/src/app/project/create-project/create-project.component.ts index a9ed7dc84..2de6ba855 100644 --- a/src/ui_ng/src/app/project/create-project/create-project.component.ts +++ b/src/ui_ng/src/app/project/create-project/create-project.component.ts @@ -54,7 +54,7 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr createProjectOpened: boolean; hasChanged: boolean; - isSubmitValid:boolean=false; + isSubmitOnGoing:boolean=false; staticBackdrop: boolean = true; closable: boolean = false; @@ -87,17 +87,18 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr if (this.isNameValid) { //Check exiting from backend this.checkOnGoing = true; - this.isSubmitValid=true; this.projectService .checkProjectExists(cont.value).toPromise() .then(() => { //Project existing this.isNameValid = false; + this.isSubmitOnGoing=false; this.nameTooltipText = 'PROJECT.NAME_ALREADY_EXISTS'; this.checkOnGoing = false; }) .catch(error => { this.checkOnGoing = false; + this.isSubmitOnGoing=true; }); } else { this.nameTooltipText = 'PROJECT.NAME_TOOLTIP'; @@ -111,7 +112,10 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr } onSubmit() { - this.isSubmitValid=false; + if (this.isSubmitOnGoing){ + return ; + } + this.isSubmitOnGoing=false; this.projectService .createProject(this.project.name, this.project.public ? 1 : 0) .subscribe( @@ -187,7 +191,7 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr public get isValid(): boolean { return this.currentForm && this.currentForm.valid && - this.isSubmitValid&& + this.isSubmitOnGoing&& this.isNameValid && !this.checkOnGoing; } From 47e24609b659cc7a67be6ca7f32b856e083089ce Mon Sep 17 00:00:00 2001 From: pengpengshui Date: Mon, 17 Jul 2017 17:35:10 -0700 Subject: [PATCH 4/4] change the code style of the issue create-project modal submit button --- .../create-project/create-project.component.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ui_ng/src/app/project/create-project/create-project.component.ts b/src/ui_ng/src/app/project/create-project/create-project.component.ts index 2de6ba855..1a332bd81 100644 --- a/src/ui_ng/src/app/project/create-project/create-project.component.ts +++ b/src/ui_ng/src/app/project/create-project/create-project.component.ts @@ -86,19 +86,16 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr this.isNameValid = cont.valid; if (this.isNameValid) { //Check exiting from backend - this.checkOnGoing = true; this.projectService .checkProjectExists(cont.value).toPromise() .then(() => { //Project existing this.isNameValid = false; - this.isSubmitOnGoing=false; this.nameTooltipText = 'PROJECT.NAME_ALREADY_EXISTS'; this.checkOnGoing = false; }) .catch(error => { this.checkOnGoing = false; - this.isSubmitOnGoing=true; }); } else { this.nameTooltipText = 'PROJECT.NAME_TOOLTIP'; @@ -115,16 +112,21 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr if (this.isSubmitOnGoing){ return ; } - this.isSubmitOnGoing=false; + + this.isSubmitOnGoing=true; this.projectService .createProject(this.project.name, this.project.public ? 1 : 0) .subscribe( status => { + this.isSubmitOnGoing=false; + this.create.emit(true); this.messageHandlerService.showSuccess('PROJECT.CREATED_SUCCESS'); this.createProjectOpened = false; }, error => { + this.isSubmitOnGoing=false; + let errorMessage: string; if (error instanceof Response) { switch (error.status) { @@ -191,7 +193,7 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr public get isValid(): boolean { return this.currentForm && this.currentForm.valid && - this.isSubmitOnGoing&& + !this.isSubmitOnGoing&& this.isNameValid && !this.checkOnGoing; }