@igea/oac_frontend 1.0.74 → 1.0.76

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.74",
3
+ "version": "1.0.76",
4
4
  "description": "Frontend service for the OAC project",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -107,6 +107,7 @@
107
107
  "title": "Investigation",
108
108
  "edit_item": "Edit",
109
109
  "new_item": "New",
110
+ "stop_edit": "Stop edit",
110
111
  "search": "Search"
111
112
  },
112
113
  "search": {
@@ -110,6 +110,7 @@
110
110
  "title": "Indagine",
111
111
  "edit_item": "Modifica",
112
112
  "new_item": "Nuova",
113
+ "stop_edit": "Fine modifica",
113
114
  "search": "Ricerca"
114
115
  },
115
116
  "search": {
@@ -40,6 +40,10 @@ document.addEventListener('DOMContentLoaded', () => {
40
40
  @click="newInstance()" type="button" class="btn btn-success">
41
41
  <i class="fa-solid fa-plus"></i>
42
42
  </button>
43
+ <button v-if="inEdit" :title="labels.stop_edit"
44
+ @click="stopEdit()" type="button" class="btn btn-success">
45
+ <i class="fa-solid fa-circle-stop" style="color:red;"></i>
46
+ </button>
43
47
  </div>
44
48
  `,
45
49
  data() {
@@ -49,6 +53,7 @@ document.addEventListener('DOMContentLoaded', () => {
49
53
  labels:{
50
54
  edit: elSearch.dataset.label_edit,
51
55
  new: elSearch.dataset.label_new,
56
+ stop_edit: elSearch.dataset.label_stop_edit,
52
57
  search: elSearch.dataset.label_search + "...",
53
58
  }
54
59
  }
@@ -56,19 +61,28 @@ document.addEventListener('DOMContentLoaded', () => {
56
61
  methods: {
57
62
  handleAutocompleteSelect(value) {
58
63
  this.existingInstance = value;
64
+ this.inEdit = false;
59
65
  window.dispatchEvent(
60
66
  new CustomEvent('select-item', { detail: value.uuid })
61
67
  );
62
68
  },
63
69
  editInstance(){
70
+ this.inEdit = true;
64
71
  window.dispatchEvent(
65
72
  new CustomEvent('edit-item', { detail: this.existingInstance.uuid })
66
73
  );
67
74
  },
68
75
  newInstance(){
76
+ this.inEdit = true;
69
77
  window.dispatchEvent(
70
78
  new CustomEvent('new-item')
71
79
  );
80
+ },
81
+ stopEdit(){
82
+ this.inEdit = false;
83
+ window.dispatchEvent(
84
+ new CustomEvent('edit-stop')
85
+ );
72
86
  }
73
87
  }
74
88
  });
@@ -140,6 +154,13 @@ document.addEventListener('DOMContentLoaded', () => {
140
154
  _this.inEditing = true;
141
155
  _this.resetShaclForm(null, true);
142
156
  });
157
+ window.addEventListener('edit-stop', (event) => {
158
+ console.log('edit-stop...');
159
+ _this.enabled = false;
160
+ _this.isVisible = false;
161
+ _this.inEditing = false;
162
+ //_this.resetShaclForm(null, true);
163
+ });
143
164
  },
144
165
  computed:{
145
166
  outputStyle(){
@@ -210,7 +231,7 @@ document.addEventListener('DOMContentLoaded', () => {
210
231
  newForm.id = "shacl-form";
211
232
  newForm.dataset.collapse = "open";
212
233
  newForm.dataset.valuesNamespace = "indagine:";
213
- newForm.dataset.shapesUrl = "/backend/ontology/schema/ttl2";
234
+ newForm.dataset.shapesUrl = "/backend/ontology/schema/editing";
214
235
  newForm.dataset.generateNodeShapeReference = "";
215
236
 
216
237
  //newForm.dataset.editing = edit;
@@ -266,8 +287,13 @@ document.addEventListener('DOMContentLoaded', () => {
266
287
  clearInterval(intervalId);
267
288
  if(_this.inEditing)
268
289
  _this.inputIdentifizier();
290
+
291
+ _this.validForm = true;
292
+ _this.serializedForm = _this.form.serialize();
293
+
269
294
  if(!_this.enabled)
270
295
  _this.disableInteractions(_this.form);
296
+
271
297
  }
272
298
  }, 100);
273
299
  });
@@ -76,6 +76,7 @@
76
76
  data-label_edit="{{ t('investigation.edit_item') }}"
77
77
  data-label_new="{{ t('investigation.new_item') }}"
78
78
  data-label_search="{{ t('investigation.search') }}"
79
+ data-label_stop_edit="{{ t('investigation.stop_edit') }}"
79
80
  ></div>
80
81
 
81
82
  <div v-cloak id="investigation-app"
@@ -113,7 +114,7 @@
113
114
  style="margin-top:10px; border:dashed 2px gray; padding:10px; border-radius:5px;">
114
115
  <shacl-form id="shacl-form" data-collapse="open"
115
116
  data-values-namespace="indagine:"
116
- data-shapes-url="/backend/ontology/schema/ttl2"
117
+ data-shapes-url="/backend/ontology/schema/editing"
117
118
  data-generate-node-shape-reference=""
118
119
  ></shacl-form>
119
120
  </div>