From 3fa3e14bb6f5dd4e86a2414bf0b7102e36dcc1e9 Mon Sep 17 00:00:00 2001 From: AllForNothing Date: Mon, 7 Sep 2020 10:17:59 +0800 Subject: [PATCH] Fix UI issues found on testing day Signed-off-by: AllForNothing --- .../app/config/auth/config-auth.component.ts | 2 +- .../create-project.component.html | 2 +- .../list-project/list-project.component.ts | 33 +++++++++++------ .../project-config.component.html | 2 +- .../project-config.component.ts | 5 ++- .../artifact/artifact-summary.component.html | 2 +- .../artifact/artifact-summary.component.ts | 4 ++ .../artifact-tag/artifact-tag.component.html | 2 +- .../artifact-tag/artifact-tag.component.ts | 3 +- .../repository-gridview.component.ts | 37 ++++++++++++------- .../tag-retention.component.html | 2 +- src/portal/src/global.scss | 2 +- src/portal/src/i18n/lang/en-us-lang.json | 4 +- src/portal/src/i18n/lang/es-es-lang.json | 4 +- src/portal/src/i18n/lang/fr-fr-lang.json | 4 +- src/portal/src/i18n/lang/pt-br-lang.json | 4 +- src/portal/src/i18n/lang/tr-tr-lang.json | 4 +- src/portal/src/i18n/lang/zh-cn-lang.json | 4 +- src/portal/src/i18n/lang/zh-tw-lang.json | 4 +- .../gc/gc-history/gc-history.component.html | 2 +- .../gc/gc-history/gc-history.component.ts | 4 +- .../project-policy-config.component.html | 8 ++-- .../project-policy-config.component.ts | 1 + 23 files changed, 91 insertions(+), 48 deletions(-) diff --git a/src/portal/src/app/config/auth/config-auth.component.ts b/src/portal/src/app/config/auth/config-auth.component.ts index 6086bb5dd..ac0d59a33 100644 --- a/src/portal/src/app/config/auth/config-auth.component.ts +++ b/src/portal/src/app/config/auth/config-auth.component.ts @@ -265,7 +265,7 @@ export class ConfigurationAuthComponent implements OnChanges, OnInit { } changeAutoOnBoard() { if (!this.currentConfig.oidc_auto_onboard.value) { - this.currentConfig.oidc_user_claim.value = null; + this.currentConfig.oidc_user_claim.value = ""; } } } diff --git a/src/portal/src/app/project/create-project/create-project.component.html b/src/portal/src/app/project/create-project/create-project.component.html index 53df52143..120fa6570 100644 --- a/src/portal/src/app/project/create-project/create-project.component.html +++ b/src/portal/src/app/project/create-project/create-project.component.html @@ -91,7 +91,7 @@
- +
diff --git a/src/portal/src/app/project/list-project/list-project.component.ts b/src/portal/src/app/project/list-project/list-project.component.ts index a3c630981..b70b70749 100644 --- a/src/portal/src/app/project/list-project/list-project.component.ts +++ b/src/portal/src/app/project/list-project/list-project.component.ts @@ -11,7 +11,7 @@ // 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 { Subscription, forkJoin } from "rxjs"; +import {Subscription, forkJoin, of} from "rxjs"; import { Component, Output, @@ -35,6 +35,7 @@ import { calculatePage, CustomComparator, doFiltering, doSorting } from "../../. import { OperationService } from "../../../lib/components/operation/operation.service"; import { operateChanges, OperateInfo, OperationState } from "../../../lib/components/operation/operate"; import { errorHandler } from "../../../lib/utils/shared/shared.utils"; +import {HttpErrorResponse} from "@angular/common/http"; @Component({ selector: "list-project", @@ -204,10 +205,22 @@ export class ListProjectComponent implements OnDestroy { projects.forEach(data => { observableLists.push(this.delOperate(data)); }); - forkJoin(...observableLists).subscribe(item => { - this.translate.get("BATCH.DELETED_SUCCESS").subscribe(res => { - this.msgHandler.showSuccess(res); - }); + forkJoin(...observableLists).subscribe(resArr => { + let error; + if (resArr && resArr.length) { + resArr.forEach(item => { + if (item instanceof HttpErrorResponse) { + error = errorHandler(item); + } + }); + } + if (error) { + this.msgHandler.handleError(error); + } else { + this.translate.get("BATCH.DELETED_SUCCESS").subscribe(res => { + this.msgHandler.showSuccess(res); + }); + } let st: State = this.getStateAfterDeletion(); this.selectedRow = []; if (!st) { @@ -216,8 +229,6 @@ export class ListProjectComponent implements OnDestroy { this.clrLoad(st); this.statisticHandler.refresh(); } - }, error => { - this.msgHandler.handleError(error); }); } } @@ -237,10 +248,10 @@ export class ListProjectComponent implements OnDestroy { }), catchError( error => { const message = errorHandler(error); - this.translateService.get(message).subscribe(res => - operateChanges(operMessage, OperationState.failure, res) - ); - return observableThrowError(error); + this.translateService.get(message).subscribe(res => { + operateChanges(operMessage, OperationState.failure, res); + }); + return of(error); })); } diff --git a/src/portal/src/app/project/project-config/project-config.component.html b/src/portal/src/app/project/project-config/project-config.component.html index bbfbc4254..0cc83a5b8 100644 --- a/src/portal/src/app/project/project-config/project-config.component.html +++ b/src/portal/src/app/project/project-config/project-config.component.html @@ -1,5 +1,5 @@
- +
\ No newline at end of file diff --git a/src/portal/src/app/project/project-config/project-config.component.ts b/src/portal/src/app/project/project-config/project-config.component.ts index 5499aaf40..36ffdf4eb 100644 --- a/src/portal/src/app/project/project-config/project-config.component.ts +++ b/src/portal/src/app/project/project-config/project-config.component.ts @@ -28,7 +28,7 @@ export class ProjectConfigComponent implements OnInit { projectName: string; currentUser: SessionUser; hasSignedIn: boolean; - + isProxyCacheProject: boolean = false; constructor( private route: ActivatedRoute, private router: Router, @@ -42,6 +42,9 @@ export class ProjectConfigComponent implements OnInit { if (resolverData) { let pro: Project = resolverData['projectResolver']; this.projectName = pro.name; + if (pro.registry_id) { + this.isProxyCacheProject = true; + } } } } 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 b2b106c3d..41d69dc4f 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 @@ -26,7 +26,7 @@
- diff --git a/src/portal/src/app/project/repository/artifact/artifact-summary.component.ts b/src/portal/src/app/project/repository/artifact/artifact-summary.component.ts index 5d1a75bf3..6213272aa 100644 --- a/src/portal/src/app/project/repository/artifact/artifact-summary.component.ts +++ b/src/portal/src/app/project/repository/artifact/artifact-summary.component.ts @@ -30,6 +30,7 @@ export class ArtifactSummaryComponent implements OnInit { @Output() backEvt: EventEmitter = new EventEmitter(); projectName: string; + isProxyCacheProject: boolean = false; loading: boolean = false; constructor( @@ -80,6 +81,9 @@ export class ArtifactSummaryComponent implements OnInit { if (resolverData) { const pro: Project = (resolverData['artifactResolver'][1]); this.projectName = pro.name; + if (pro.registry_id) { + this.isProxyCacheProject = true; + } this.artifact = (resolverData['artifactResolver'][0]); this.getIconFromBackEnd(); } diff --git a/src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.html b/src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.html index 5375051a2..5f153f719 100644 --- a/src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.html +++ b/src/portal/src/app/project/repository/artifact/artifact-tag/artifact-tag.component.html @@ -2,7 +2,7 @@ -