@igea/oac_frontend 1.0.86 → 1.0.87

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": "@igea/oac_frontend",
3
- "version": "1.0.86",
3
+ "version": "1.0.87",
4
4
  "description": "Frontend service for the OAC project",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -109,7 +109,9 @@
109
109
  "new_item": "New",
110
110
  "stop_edit": "Stop edit",
111
111
  "search": "Search",
112
- "edit_from_other_user": "Another user is editing this item"
112
+ "edit_from_other_user": "Another user is editing this item",
113
+ "save_ok": "Form saved successfully",
114
+ "save_err": "Error saving the form"
113
115
  },
114
116
  "search": {
115
117
  "fast": {
@@ -112,7 +112,10 @@
112
112
  "new_item": "Nuova",
113
113
  "stop_edit": "Fine modifica",
114
114
  "search": "Ricerca",
115
- "edit_from_other_user": "Un altro utente sta modificando questo elemento"
115
+ "edit_from_other_user": "Un altro utente sta modificando questo elemento",
116
+ "save_ok": "Scheda salvata correttamente",
117
+ "save_err": "Errore nel salvataggio della scheda"
118
+
116
119
  },
117
120
  "search": {
118
121
  "title" : "Ricerca",
@@ -19,7 +19,7 @@ const uploadValues = ["$UPLOAD$"];
19
19
 
20
20
  const CLIENT_UUID = crypto.randomUUID();
21
21
 
22
- const KEEP_LOCK_EVERY = 60*1000;
22
+ const KEEP_LOCK_EVERY = 45*1000;
23
23
 
24
24
  document.addEventListener('DOMContentLoaded', () => {
25
25
 
@@ -144,7 +144,10 @@ document.addEventListener('DOMContentLoaded', () => {
144
144
  lastUpdateTs: 0,
145
145
  lastSaveTs: 0,
146
146
  isNew: true,
147
- labels: {},
147
+ labels: {
148
+ save_ok: el.dataset.label_save_ok,
149
+ save_err: el.dataset.label_save_err
150
+ },
148
151
  search: {
149
152
  offset: 0,
150
153
  limit: 10,
@@ -668,14 +671,14 @@ document.addEventListener('DOMContentLoaded', () => {
668
671
  console.log(obj);
669
672
  if(!automatic){
670
673
  if(obj.success){
671
- alert("Saved: OK");
674
+ alert(_this.labels.save_ok);
672
675
  if(_this.isNew && obj.data){
673
676
  _this.form_id = obj.data;
674
677
  await fetch('/backend/ontology/form/lock/' + obj.data + "/" + CLIENT_UUID)
675
678
  _this.form_keep_lock_timer = setInterval(_this.keepLock.bind(_this), KEEP_LOCK_EVERY)
676
679
  }
677
680
  }else
678
- alert("Error: " + obj.message);
681
+ alert(_this.labels.save_err + ": " + obj.message);
679
682
  }
680
683
  _this.saving = false;
681
684
  }).catch(error => {
@@ -84,6 +84,8 @@
84
84
  data-cur_role="{{ user.role }}"
85
85
  data-uuid="{{ uuid }}"
86
86
  data-editing="{{ user.role != 3 }}"
87
+ data-label_save_ok="{{ t('investigation.save_ok') }}"
88
+ data-label_save_err="{{ t('investigation.save_err') }}"
87
89
  >
88
90
  <template v-if="isVisible">
89
91