@gisce/react-ooui 1.1.17 → 1.1.18-rc.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/react-ooui",
3
- "version": "1.1.17",
3
+ "version": "1.1.18-rc.0",
4
4
  "files": [
5
5
  "dist",
6
6
  "src",
@@ -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) {
@@ -84,4 +84,5 @@ export default {
84
84
  openAttachmentLink: "Obrir enllaç de l'adjunt",
85
85
  uninformed: "Sense informar",
86
86
  totalRegisters: "Registres totals:",
87
+ savedRegisters: "Registre guardat correctament",
87
88
  };
@@ -81,4 +81,5 @@ export default {
81
81
  openAttachmentLink: "Open attachment link",
82
82
  uninformed: "Uninformed",
83
83
  totalRegisters: "Total registers:",
84
+ savedRegisters: "Record successfully saved",
84
85
  };
@@ -85,4 +85,5 @@ export default {
85
85
  openAttachmentLink: "Abrir enlace del adjunto",
86
86
  uninformed: "Sin informar",
87
87
  totalRegisters: "Registros totales:",
88
+ savedRegisters: "Registro guardado correctamente",
88
89
  };