Fix always show loading indicator when call API failed;Z-Index issue in repository detail page when event popup widget open;Wrong robot token expiration in system settings when call API failed

Signed-off-by: Yogi_Wang <yawang@vmware.com>
This commit is contained in:
Yogi_Wang 2019-05-08 11:30:27 +08:00
parent b0e3b65ade
commit 97acf44fbc
6 changed files with 16 additions and 21 deletions

View File

@ -129,7 +129,7 @@ export class Configuration {
this.email_password = new StringValueItem("", true);
this.email_insecure = new BoolValueItem(false, true);
this.token_expiration = new NumberValueItem(30, true);
this.robot_token_duration = new NumberValueItem(30, true);
this.robot_token_duration = new NumberValueItem(30 * (60 * 24), true);
this.cfg_expiration = new NumberValueItem(30, true);
this.verify_remote_cert = new BoolValueItem(false, true);
this.scan_all_policy = new ComplexValueItem({

View File

@ -27,7 +27,7 @@ import { Endpoint } from "../service/interface";
import { EndpointService } from "../service/endpoint.service";
import { ErrorHandler } from "../error-handler/index";
import { map, catchError } from "rxjs/operators";
import { map, catchError, finalize } from "rxjs/operators";
import { ConfirmationMessage } from "../confirmation-dialog/confirmation-message";
import { ConfirmationAcknowledgement } from "../confirmation-dialog/confirmation-state-message";
import { ConfirmationDialogComponent } from "../confirmation-dialog/confirmation-dialog.component";
@ -115,14 +115,14 @@ export class EndpointComponent implements OnInit, OnDestroy {
retrieve(): void {
this.loading = true;
this.selectedRow = [];
this.endpointService.getEndpoints(this.targetName)
this.endpointService.getEndpoints(this.targetName).pipe(finalize(() => {
this.loading = false;
this.forceRefreshView(1000);
}))
.subscribe(targets => {
this.targets = targets || [];
this.loading = false;
this.forceRefreshView(1000);
}, error => {
this.errorHandler.error(error);
this.loading = false;
});
}

View File

@ -34,7 +34,7 @@ import { TranslateService } from "@ngx-translate/core";
import { ConfirmationDialogComponent } from "../confirmation-dialog/confirmation-dialog.component";
import { operateChanges, OperateInfo, OperationState } from "../operation/operate";
import { OperationService } from "../operation/operation.service";
import { map, catchError } from "rxjs/operators";
import { map, catchError, finalize } from "rxjs/operators";
import { errorHandler as errorHandFn } from "../shared/shared.utils";
import { Observable, throwError as observableThrowError, forkJoin } from "rxjs";
@Component({
@ -76,14 +76,14 @@ export class LabelComponent implements OnInit {
this.loading = true;
this.selectedRow = [];
this.targetName = "";
this.labelService.getLabels(scope, this.projectId, name)
this.labelService.getLabels(scope, this.projectId, name).pipe(finalize(() => {
this.loading = false;
this.forceRefreshView(2000);
}))
.subscribe(targets => {
this.targets = targets || [];
this.loading = false;
this.forceRefreshView(2000);
}, error => {
this.errorHandler.error(error);
this.loading = false;
});
}

View File

@ -51,7 +51,7 @@
.rightPos {
position: absolute;
z-index: 600;
z-index: 1;
right: 35px;
margin-top: 20px;
display: flex;
@ -108,10 +108,6 @@
top: 5px;
}
.datagrid-action-bar {
z-index: 10;
}
.trigger-item hbr-label-piece {
display: flex !important;
margin: 6px 0;

View File

@ -59,10 +59,10 @@ export class ProjectRoutingResolver implements Resolve<Project> {
this.router.navigate(['/harbor', 'projects']);
return null;
}
}, catchError (error => {
}), catchError (error => {
this.router.navigate(['/harbor', 'projects']);
return null;
})));
}));
}
}

View File

@ -291,18 +291,17 @@ export class UserComponent implements OnInit, OnDestroy {
}));
}
return this.userService.deleteUser(user.user_id).pipe(map(() => {
this.translate.get('BATCH.DELETED_SUCCESS').subscribe(res => {
operateChanges(operMessage, OperationState.success);
});
}, catchError(error => {
}), catchError(error => {
const message = errorHandFn(error);
this.translate.get(message).subscribe(res =>
operateChanges(operMessage, OperationState.failure, res)
);
return observableThrowError(message);
})));
}));
}
// Refresh the user list