@gisce/react-ooui 1.1.18 → 1.1.19
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.
- package/dist/actionbar/FormActionBar.d.ts.map +1 -1
- package/dist/locales/ca_ES.d.ts +2 -0
- package/dist/locales/ca_ES.d.ts.map +1 -1
- package/dist/locales/en_US.d.ts +2 -0
- package/dist/locales/en_US.d.ts.map +1 -1
- package/dist/locales/es_ES.d.ts +2 -0
- package/dist/locales/es_ES.d.ts.map +1 -1
- package/dist/react-ooui.es.js +1942 -1933
- package/dist/react-ooui.es.js.map +1 -1
- package/dist/react-ooui.umd.js +13 -13
- package/dist/react-ooui.umd.js.map +1 -1
- package/dist/widgets/views/Form.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/actionbar/FormActionBar.tsx +11 -3
- package/src/locales/ca_ES.tsx +2 -0
- package/src/locales/en_US.tsx +2 -0
- package/src/locales/es_ES.tsx +2 -0
- package/src/widgets/views/Form.tsx +4 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["Form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["Form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAkCf,OAAO,EAAE,QAAQ,EAAgB,MAAM,SAAS,CAAC;AAiBjD,oBAAY,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC9B,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IACxE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACvC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB,CAAC;;AAo+BF,wBAAgC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { useContext } from "react";
|
|
2
|
-
import { Space, Spin } from "antd";
|
|
1
|
+
import React, { useContext, useEffect, useRef } from "react";
|
|
2
|
+
import { Space, Spin, message } from "antd";
|
|
3
3
|
import {
|
|
4
4
|
SaveOutlined,
|
|
5
5
|
RightOutlined,
|
|
@@ -63,7 +63,6 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
|
|
|
63
63
|
attachments,
|
|
64
64
|
formRef,
|
|
65
65
|
setFormHasChanges,
|
|
66
|
-
searchTreeRef,
|
|
67
66
|
previousView,
|
|
68
67
|
setPreviousView,
|
|
69
68
|
goToResourceId,
|
|
@@ -79,6 +78,15 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
|
|
|
79
78
|
TabManagerContext
|
|
80
79
|
) as TabManagerContextType;
|
|
81
80
|
const { openRelate, openDefaultActionForModel } = tabManagerContext || {};
|
|
81
|
+
const prevFormIsSavingRef = useRef<boolean>(false);
|
|
82
|
+
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
if (!formIsSaving && prevFormIsSavingRef.current) {
|
|
85
|
+
message.success(t("savedRegisters"));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
prevFormIsSavingRef.current = formIsSaving || false;
|
|
89
|
+
}, [formIsSaving]);
|
|
82
90
|
|
|
83
91
|
function tryRefresh(callback: any) {
|
|
84
92
|
if (formHasChanges) {
|
package/src/locales/ca_ES.tsx
CHANGED
package/src/locales/en_US.tsx
CHANGED
package/src/locales/es_ES.tsx
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
Row,
|
|
16
16
|
Alert,
|
|
17
17
|
Spin,
|
|
18
|
+
message,
|
|
18
19
|
} from "antd";
|
|
19
20
|
import Measure from "react-measure";
|
|
20
21
|
import { CheckOutlined, CloseOutlined } from "@ant-design/icons";
|
|
@@ -105,7 +106,7 @@ function Form(props: FormProps, ref: any) {
|
|
|
105
106
|
defaultValues,
|
|
106
107
|
forcedValues = {},
|
|
107
108
|
} = props;
|
|
108
|
-
const { lang } = useContext(LocaleContext) as LocaleContextType;
|
|
109
|
+
const { t, lang } = useContext(LocaleContext) as LocaleContextType;
|
|
109
110
|
|
|
110
111
|
const [isSubmitting, setIsSubmitting] = useState<boolean>(false);
|
|
111
112
|
const [error, setError] = useState<string>();
|
|
@@ -343,6 +344,7 @@ function Form(props: FormProps, ref: any) {
|
|
|
343
344
|
await antForm.validateFields();
|
|
344
345
|
return false;
|
|
345
346
|
} catch (verror) {
|
|
347
|
+
message.error(t("fillRequiredFields"));
|
|
346
348
|
return true;
|
|
347
349
|
}
|
|
348
350
|
}
|
|
@@ -641,6 +643,7 @@ function Form(props: FormProps, ref: any) {
|
|
|
641
643
|
setIsSubmitting(false);
|
|
642
644
|
setFormIsSaving?.(false);
|
|
643
645
|
onSubmitError?.(err);
|
|
646
|
+
message.error(t("errorWhileSavingForm"));
|
|
644
647
|
setError(err?.message ? err.message : err);
|
|
645
648
|
} finally {
|
|
646
649
|
formSubmitting.current = false;
|