Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#noissue] Add close-callback on error popup #9675

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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