Skip to content

Commit

Permalink
[#noissue] Add close-callback on error popup
Browse files Browse the repository at this point in the history
  • Loading branch information
binDongKim committed Feb 2, 2023
1 parent 07cc30a commit 15a11a4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ export class TransactionMetaDataService {
catchError((error: IServerError) => {
this.onError({
data: {title: 'Error', contents: error},
component: ServerErrorPopupContainerComponent
component: ServerErrorPopupContainerComponent,

});

return EMPTY;
Expand Down Expand Up @@ -110,6 +111,20 @@ export class TransactionMetaDataService {
this.onError({
data: {title: 'Notice', contents: this.retrieveErrorMessage, type: 'html'},
component: MessagePopupContainerComponent,
onCloseCallback: () => {
this.urlRouteManagerService.moveOnPage({
url: [
UrlPath.MAIN,
this.newUrlStateNotificationService.getPathValue(UrlPathId.APPLICATION).getUrlStr(),
this.newUrlStateNotificationService.getPathValue(UrlPathId.PERIOD).getValueWithTime(),
this.newUrlStateNotificationService.getPathValue(UrlPathId.END_TIME).getEndTime()
],
queryParams: {
[UrlQuery.DRAG_INFO]: null,
[UrlQuery.TRANSACTION_INFO]: null
}
});
}
});
} else {
this.http.post<{metadata: ITransactionMetaData[]}>(this.requestURLV1, this.makeV1RequestOptionsArgs(), {
Expand Down Expand Up @@ -251,24 +266,11 @@ export class TransactionMetaDataService {
}

// TODO: When v1 gets removed, no need to receive component parameter. Just use ServerError component.
private onError({data, component}: {data: any, component: any}): void {
private onError({data, component, onCloseCallback}: {data: any, component: any, onCloseCallback?: () => void}): void {
this.dynamicPopupService.openPopup({
data,
component,
onCloseCallback: () => {
this.urlRouteManagerService.moveOnPage({
url: [
UrlPath.MAIN,
this.newUrlStateNotificationService.getPathValue(UrlPathId.APPLICATION).getUrlStr(),
this.newUrlStateNotificationService.getPathValue(UrlPathId.PERIOD).getValueWithTime(),
this.newUrlStateNotificationService.getPathValue(UrlPathId.END_TIME).getEndTime()
],
queryParams: {
[UrlQuery.DRAG_INFO]: null,
[UrlQuery.TRANSACTION_INFO]: null
}
});
}
onCloseCallback
}, {
resolver: this.componentFactoryResolver,
injector: this.injector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export class TransactionTableGridContainerComponent implements OnInit, OnDestroy
filter((responseData: ITransactionMetaData[]) => {
if (responseData.length === 0) {
this.transactionDataForAgGrid = [];
this.cd.detectChanges();
return false;
} else {
return true;
Expand Down

0 comments on commit 15a11a4

Please sign in to comment.