@gisce/react-ooui 1.1.5 → 1.1.6
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;
|
|
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;;AAybF,wBAAsC"}
|
package/package.json
CHANGED
package/src/views/ActionView.tsx
CHANGED
|
@@ -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";
|
|
@@ -211,18 +212,18 @@ function ActionView(props: Props, ref: any) {
|
|
|
211
212
|
break;
|
|
212
213
|
}
|
|
213
214
|
}
|
|
215
|
+
let currentViewToAssign = undefined;
|
|
214
216
|
|
|
215
217
|
if (!initialView && viewDataRetrieved.find((v) => v.type === "tree")) {
|
|
216
218
|
const treeView: TreeView = viewDataRetrieved.find(
|
|
217
219
|
(v) => v.type === "tree"
|
|
218
220
|
) as TreeView;
|
|
219
|
-
|
|
221
|
+
currentViewToAssign = treeView;
|
|
220
222
|
} else if (!initialView) {
|
|
221
223
|
const formView: TreeView = viewDataRetrieved.find(
|
|
222
224
|
(v) => v.type === "form"
|
|
223
225
|
) as TreeView;
|
|
224
|
-
|
|
225
|
-
setCurrentView(formView);
|
|
226
|
+
currentViewToAssign = formView;
|
|
226
227
|
} else {
|
|
227
228
|
const view = viewDataRetrieved.find((v) => {
|
|
228
229
|
if (!initialView.id) {
|
|
@@ -231,9 +232,16 @@ function ActionView(props: Props, ref: any) {
|
|
|
231
232
|
return v.type === initialView.type && v.view_id === initialView.id;
|
|
232
233
|
}
|
|
233
234
|
});
|
|
234
|
-
|
|
235
|
+
currentViewToAssign = view;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (!currentViewToAssign) {
|
|
239
|
+
showErrorDialog(
|
|
240
|
+
"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"
|
|
241
|
+
);
|
|
235
242
|
}
|
|
236
243
|
|
|
244
|
+
setCurrentView(currentViewToAssign);
|
|
237
245
|
setAvailableViews(viewDataRetrieved);
|
|
238
246
|
setIsLoading(false);
|
|
239
247
|
};
|