@igea/oac_frontend 1.0.56 → 1.0.58

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.56",
3
+ "version": "1.0.58",
4
4
  "description": "Frontend service for the OAC project",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -100,7 +100,9 @@
100
100
  "confirm": "Confirm",
101
101
  "download": "Download",
102
102
  "select_instance": "Select an instance",
103
- "generated_output": "Generated output"
103
+ "generated_output": "Generated output",
104
+ "valid": "Valid",
105
+ "not_valid": "Not valid"
104
106
  }
105
107
  },
106
108
  "search": {
@@ -103,7 +103,9 @@
103
103
  "confirm": "Conferma",
104
104
  "download": "Scarica",
105
105
  "select_instance": "Seleziona un'istanza",
106
- "generated_output": "Output generato"
106
+ "generated_output": "Output generato",
107
+ "valid": "Valido",
108
+ "not_valid": "Non valido"
107
109
  }
108
110
  },
109
111
  "search": {
@@ -8,6 +8,12 @@ const templateIRIToExcludeFromSearch = [
8
8
  templateIRIOfIndagine
9
9
  ];
10
10
 
11
+ const sequenceValues = ["$UUID$",
12
+ "$SEQ1$", "$SEQ2$", "$SEQ3$",
13
+ "$SEQ4$", "$SEQ5$", "$SEQ6$",
14
+ "$SEQ7$", "$SEQ8$", "$SEQ9$"
15
+ ];
16
+
11
17
  document.addEventListener('DOMContentLoaded', () => {
12
18
  const el = document.getElementById(appId);
13
19
 
@@ -120,11 +126,12 @@ document.addEventListener('DOMContentLoaded', () => {
120
126
  searchByPrefix(){
121
127
  if(this.search.end) return;
122
128
  var _this = this;
123
- var request = axios.post("/backend/fuseki/search/by-prefix", {
129
+ var data = {
124
130
  limit: this.search.limit,
125
131
  offset: this.search.offset,
126
132
  prefix: this.search.prefix
127
- });
133
+ }
134
+ var request = axios.post("/backend/fuseki/search/by-prefix", data);
128
135
  request.then(response => {
129
136
  var data = response.data;
130
137
  if(data.success){
@@ -160,20 +167,17 @@ document.addEventListener('DOMContentLoaded', () => {
160
167
  const shadow = form.shadowRoot;
161
168
  if (!shadow) return false;
162
169
 
163
- // Trova la label "ID"
164
- const labels = Array.from(shadow.querySelectorAll("label"))
165
- .filter(l => l.textContent.trim() === "ID");
170
+ const rokitInputList = Array.from(shadow.querySelectorAll("rokit-input"))
171
+ .filter(l => sequenceValues.some(v =>
172
+ (l.placeholder || '').toLowerCase().includes(v.toLowerCase())
173
+ ));
174
+
175
+ if (rokitInputList.length == 0) return false;
176
+ for(var i=0; i<rokitInputList.length; i++){
177
+ const rokitInput = rokitInputList[i];
178
+ const container = rokitInput.closest(".property-instance");
179
+ const label = container.querySelector("label");
166
180
 
167
- if (labels.length == 0) return false;
168
- for(var i=0; i<labels.length; i++){
169
- const label = labels[i];
170
- if (!label) continue;
171
- // Container della property
172
- const container = label.closest(".property-instance");
173
- if (!container) return false;
174
-
175
- // Disabilita rokit-input
176
- const rokitInput = container.querySelector("rokit-input");
177
181
  if (rokitInput) {
178
182
  var isIndagineIdField = templateIRIOfIndagine === rokitInput.placeholder;
179
183
  if(rokitInput.value == ""){
@@ -185,7 +189,8 @@ document.addEventListener('DOMContentLoaded', () => {
185
189
  rokitInput.style.pointerEvents = "none";
186
190
 
187
191
  var escludeSearchButton = templateIRIToExcludeFromSearch.includes(rokitInput.placeholder);
188
-
192
+
193
+ //escludeSearchButton = false;
189
194
  if(_this.enabled && !escludeSearchButton){
190
195
  // Aggiungo bottone IMG per la ricerca
191
196
  let next = label.nextElementSibling;
@@ -200,8 +205,12 @@ document.addEventListener('DOMContentLoaded', () => {
200
205
  img.style.cursor = "pointer";
201
206
  img.classList.add(imgClass);
202
207
  img.onclick = function(){
203
- var prefix = rokitInput.placeholder.replace("$uuid$", "").replace("$UUID$", "");
204
- //prefix = "http://diagnostica/vocabularies/quesito-diagnostico/";
208
+ var prefix = rokitInput.placeholder;
209
+ sequenceValues.forEach(seqVal => {
210
+ var searchStr = seqVal;
211
+ var searchStrUpp = seqVal.toUpperCase();
212
+ prefix = prefix.replace(searchStr, "").replace(searchStrUpp, "");
213
+ });
205
214
  _this.searchByPrefixStart(rokitInput, prefix);
206
215
  }
207
216
  // inserisco subito dopo la label
@@ -95,7 +95,7 @@
95
95
  {% if user.role != 3 %}
96
96
  <!-- Buttons -->
97
97
  <div class="col-12 text-center mt-4">
98
- <button v-if="validForm" @click="save()" type="submit" class="btn btn-primary me-2">{{ t('investigation.new.submit') }}</button>
98
+
99
99
  <button style="margin-left:30px;" title="{{ t('investigation.new.download') }}"
100
100
  @click="download('xml')" type="button" class="btn btn-secondary">
101
101
  <span>RDF/XML</span><i class="fa-solid fa-file-arrow-down"></i>
@@ -105,12 +105,14 @@
105
105
  <span>TURTLE</span><i class="fa-solid fa-file-arrow-down"></i>
106
106
  </button>
107
107
 
108
+ <!--
108
109
  <button style="margin-left:30px;" title="{{ t('investigation.new.validate') }}"
109
110
  @click="validate()" type="button" class="btn btn-warning">
110
111
  <i class="fa-solid fa-certificate"></i>
111
112
  </button>
113
+ -->
112
114
 
113
- <button style="margin-left:30px;" title="{{ t('investigation.new.confirm') }}"
115
+ <button v-if="validForm" style="margin-left:30px;" title="{{ t('investigation.new.confirm') }}"
114
116
  @click="save()" type="button" class="btn btn-primary">
115
117
  <i class="fa-solid fa-save"></i>
116
118
  </button>
@@ -119,13 +121,16 @@
119
121
  @click="reset()" type="button" class="btn btn-info">
120
122
  <i class="fa-solid fa-broom"></i>
121
123
  </button>
124
+
122
125
  </div>
123
126
  {% if user.role in [0, 1] %}
124
127
  <fieldset id="shacl-output" style="margin-top:10px;
125
128
  border: solid 1px gray;
126
129
  border-radius: 10px;
127
130
  padding: 10px;">
128
- <legend>{{ t('investigation.new.generated_output') }}: [{@ validForm @}]</legend>
131
+ <legend>{{ t('investigation.new.generated_output') }}:
132
+ [{@ validForm ? '{{ t('investigation.new.valid') }}': '{{ t('investigation.new.not_valid') }}' @}]
133
+ </legend>
129
134
  <pre :style="outputStyle">{@ serializedForm @}</pre>
130
135
  </fieldset>
131
136
  {% endif %}
@@ -34,8 +34,9 @@
34
34
  <!-- The sparnatural web component with config attributes. -->
35
35
  <!-- See http://docs.sparnatural.eu/Javascript-integration.html#html-attributes-reference -->
36
36
  <spar-natural
37
- src="/backend/ontology/schema/ttl"
38
- endpoint="https://dbpedia.org/sparql"
37
+ src="/backend/ontology/schema/ttl2"
38
+ endpoint="/backend/fuseki/endpoint/sparql"
39
+ endpoint_="https://dbpedia.org/sparql"
39
40
  lang="en"
40
41
  defaultLang="en"
41
42
  distinct="true"