@topconsultnpm/sdkui-react-beta 6.8.16 → 6.8.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ import { SDK_Globals, ObjectClasses, ResultTypes } from "@topconsultnpm/sdk-ts-b
4
4
  import DataGrid, { Column, GroupPanel, Grouping, HeaderFilter, LoadPanel, Pager, Paging, Scrolling, SearchPanel, Selection } from "devextreme-react/cjs/data-grid";
5
5
  import { PlatformObjectService } from "../../services/platform_services";
6
6
  import { FormModes } from "../../ts";
7
- import { Globalization, IconAdd, IconColumns, IconCopy, IconDelete, IconDuplicate, IconHide, IconMail, IconMenuVertical, IconOpenInNew, IconRefresh, IconShow, SDKUI_Globals, SDKUI_Localizator, calcSaveFormTitle, canNext, canPrev, getExceptionMessage, getNext, getPrev } from "../../helper";
7
+ import { Globalization, IconAdd, IconColumns, IconCopy, IconDelete, IconDuplicate, IconHide, IconMail, IconMenuVertical, IconOpenInNew, IconRefresh, IconShow, SDKUI_Globals, SDKUI_Localizator, calcSaveFormTitle, canNext, canPrev, dialogConfirmOperation, getExceptionMessage, getNext, getPrev } from "../../helper";
8
8
  import TMSpinner from "../base/TMSpinner";
9
9
  import { ButtonNames, TMExceptionBoxManager, TMMessageBoxManager } from "../base/TMPopUp";
10
10
  import TMLayoutContainer, { TMLayoutItem, TMSplitterLayout } from "../base/TMLayout";
@@ -110,15 +110,7 @@ const TMPage = ({ id, objClass = ObjectClasses.None, objType, listInsteadOfConte
110
110
  setShowWaitPanel(false);
111
111
  TMResultManager.show(result, operationTitle, "JobID", undefined);
112
112
  };
113
- TMMessageBoxManager.show({
114
- title: SDKUI_Localizator.Delete, message: msg, buttons: [ButtonNames.YES, ButtonNames.NO],
115
- onButtonClick: async (e) => {
116
- if (e !== ButtonNames.YES)
117
- return;
118
- await doOperationAsync();
119
- await loadDataAsync();
120
- }
121
- });
113
+ dialogConfirmOperation(operationTitle, msg, doOperationAsync);
122
114
  };
123
115
  const ToolbarPage = () => {
124
116
  let disabled = selectionListDisabled;
@@ -29,4 +29,5 @@ export declare function buildtype(module: moduleTypes): string;
29
29
  export declare function versionAndBuildtypeInfo(module: moduleTypes): string;
30
30
  export declare const svgToString: (icon: React.ReactElement) => string;
31
31
  export declare function sleep(ms: number): Promise<void>;
32
+ export declare const dialogConfirmOperation: (title: string, msg: string, operationAsync: () => Promise<void>) => void;
32
33
  export declare function getExceptionMessage(ex: any): string;
@@ -299,6 +299,18 @@ export const svgToString = (icon) => {
299
299
  export async function sleep(ms) {
300
300
  return new Promise((resolve) => setTimeout(resolve, ms));
301
301
  }
302
+ // #region Dialog
303
+ export const dialogConfirmOperation = (title, msg, operationAsync) => {
304
+ TMMessageBoxManager.show({
305
+ title: title, message: msg, buttons: [ButtonNames.YES, ButtonNames.NO],
306
+ onButtonClick: async (e) => {
307
+ if (e !== ButtonNames.YES)
308
+ return;
309
+ await operationAsync();
310
+ }
311
+ });
312
+ };
313
+ // #endregion
302
314
  // #region Exception
303
315
  export function getExceptionMessage(ex) {
304
316
  let msg = ex.isApiException ? ex.response.title : ex.message;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.8.16",
3
+ "version": "6.8.18",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",