@gisce/react-ooui 1.1.5 → 1.1.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ActionView.d.ts","sourceRoot":"","sources":["ActionView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAIf,OAAO,EAIL,eAAe,EAGf,QAAQ,EACT,MAAM,eAAe,CAAC;AAiBvB,aAAK,KAAK,GAAG;IACX,MAAM,EAAE,GAAG,CAAC;IACZ,OAAO,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,WAAW,EAAE,eAAe,CAAC;IAC7B,iBAAiB,CAAC,EAAE,GAAG,CAAC;IACxB,gBAAgB,CAAC,EAAE,GAAG,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;;AAkbF,wBAAsC"}
1
+ {"version":3,"file":"ActionView.d.ts","sourceRoot":"","sources":["ActionView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAIf,OAAO,EAIL,eAAe,EAGf,QAAQ,EACT,MAAM,eAAe,CAAC;AAkBvB,aAAK,KAAK,GAAG;IACX,MAAM,EAAE,GAAG,CAAC;IACZ,OAAO,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,WAAW,EAAE,eAAe,CAAC;IAC7B,iBAAiB,CAAC,EAAE,GAAG,CAAC;IACxB,gBAAgB,CAAC,EAAE,GAAG,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;;AA4bF,wBAAsC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/react-ooui",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "files": [
5
5
  "dist",
6
6
  "src",
@@ -28,6 +28,7 @@ import {
28
28
  import { useHotkeys } from "react-hotkeys-hook";
29
29
  import { GoToResourceModal } from "@/ui/GoToResourceModal";
30
30
  import showInfo from "@/ui/InfoDialog";
31
+ import showErrorDialog from "@/ui/ActionErrorDialog";
31
32
  import { LocaleContext, LocaleContextType } from "@/context/LocaleContext";
32
33
  import { GraphActionView } from "@/views/actionViews/GraphActionView";
33
34
  import { FormActionView } from "./actionViews/FormActionView";
@@ -191,6 +192,7 @@ function ActionView(props: Props, ref: any) {
191
192
  case "form": {
192
193
  viewDataRetrieved.push({
193
194
  ...(viewInfo as FormView),
195
+ type: viewType,
194
196
  });
195
197
  break;
196
198
  }
@@ -198,12 +200,14 @@ function ActionView(props: Props, ref: any) {
198
200
  viewDataRetrieved.push({
199
201
  ...(viewInfo as TreeView),
200
202
  isExpandable: treeExpandable,
203
+ type: viewType,
201
204
  });
202
205
  break;
203
206
  }
204
207
  case "graph": {
205
208
  viewDataRetrieved.push({
206
209
  ...(viewInfo as GraphView),
210
+ type: viewType,
207
211
  });
208
212
  break;
209
213
  }
@@ -211,18 +215,18 @@ function ActionView(props: Props, ref: any) {
211
215
  break;
212
216
  }
213
217
  }
218
+ let currentViewToAssign = undefined;
214
219
 
215
220
  if (!initialView && viewDataRetrieved.find((v) => v.type === "tree")) {
216
221
  const treeView: TreeView = viewDataRetrieved.find(
217
222
  (v) => v.type === "tree"
218
223
  ) as TreeView;
219
- setCurrentView(treeView);
224
+ currentViewToAssign = treeView;
220
225
  } else if (!initialView) {
221
226
  const formView: TreeView = viewDataRetrieved.find(
222
227
  (v) => v.type === "form"
223
228
  ) as TreeView;
224
-
225
- setCurrentView(formView);
229
+ currentViewToAssign = formView;
226
230
  } else {
227
231
  const view = viewDataRetrieved.find((v) => {
228
232
  if (!initialView.id) {
@@ -231,9 +235,16 @@ function ActionView(props: Props, ref: any) {
231
235
  return v.type === initialView.type && v.view_id === initialView.id;
232
236
  }
233
237
  });
234
- setCurrentView(view);
238
+ currentViewToAssign = view;
239
+ }
240
+
241
+ if (!currentViewToAssign) {
242
+ showErrorDialog(
243
+ "Error determining the first view to show.\nPlease, make sure the view ids on the fields_view_get responses are the same as the ones defined in the action"
244
+ );
235
245
  }
236
246
 
247
+ setCurrentView(currentViewToAssign);
237
248
  setAvailableViews(viewDataRetrieved);
238
249
  setIsLoading(false);
239
250
  };