From e3b0bf19152cbf0aec9d14e2fa2cee82a0ce5f2a Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 25 Sep 2020 15:03:54 +0100 Subject: [PATCH] Fix url encoding issue for modal widgets widgetId Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/@types/global.d.ts | 2 ++ src/components/views/dialogs/ModalWidgetDialog.tsx | 5 +++-- src/stores/ModalWidgetStore.ts | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index e1111a8a94..75ac1ea31e 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -30,6 +30,7 @@ import {Notifier} from "../Notifier"; import type {Renderer} from "react-dom"; import RightPanelStore from "../stores/RightPanelStore"; import WidgetStore from "../stores/WidgetStore"; +import {ModalWidgetStore} from "../stores/ModalWidgetStore"; declare global { interface Window { @@ -53,6 +54,7 @@ declare global { mxNotifier: typeof Notifier; mxRightPanelStore: RightPanelStore; mxWidgetStore: WidgetStore; + mxModalWidgetStore: ModalWidgetStore; } interface Document { diff --git a/src/components/views/dialogs/ModalWidgetDialog.tsx b/src/components/views/dialogs/ModalWidgetDialog.tsx index d2599d6f90..f17b1ec27a 100644 --- a/src/components/views/dialogs/ModalWidgetDialog.tsx +++ b/src/components/views/dialogs/ModalWidgetDialog.tsx @@ -83,8 +83,9 @@ export default class ModalWidgetDialog extends React.PureComponent { this.openSourceWidgetId = sourceWidgetId; this.modalInstance = Modal.createTrackedDialog('Modal Widget', '', ModalWidgetDialog, { widgetDefinition: {...requestData}, - sourceWidgetId: sourceWidgetId, + sourceWidgetId, onFinished: (success: boolean, data?: any) => { if (!success) { this.closeModalWidget(sourceWidgetId, { @@ -84,3 +84,5 @@ export class ModalWidgetStore extends AsyncStoreWithClient { } }; } + +window.mxModalWidgetStore = ModalWidgetStore.instance;