Merge pull request #7716 from jwangyangls/fix_api_faild_always_show_loading

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;UI hangs at deleting when to delete OIDC user
This commit is contained in:
jwangyangls 2019-05-08 22:40:23 +08:00 committed by GitHub
commit 67c5542dd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 19 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

@ -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