Skip to content

Commit 181b7f2

Browse files
authored
Merge pull request #3 from thecloudcircle/develop
Update Sparnatural to fix Sortable compatibility errors
2 parents 33a7077 + 35689a2 commit 181b7f2

File tree

6 files changed

+33
-11
lines changed

6 files changed

+33
-11
lines changed

dist/demo-styles.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/demo-styles.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sparnatural.js

+14-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sparnatural.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/sparnatural.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ const tippy = require('tippy.js').default;
3131

3232
require('tippy.js/dist/tippy.css');
3333

34+
const Sortable = require('sortablejs/modular/sortable.core.esm.js').Sortable;
35+
3436
JsonLdSpecificationProvider = require("./JsonLdSpecificationProvider.js").JsonLdSpecificationProvider;
3537
SpecificationProviderFactory = require("./SpecificationProviderFactory.js").SpecificationProviderFactory;
3638
RDFSpecificationProvider = require("./RDFSpecificationProvider.js").RDFSpecificationProvider ;
@@ -305,6 +307,8 @@ var Datasources = require("./SparnaturalConfigDatasources.js");
305307
// On Clear form new component is automaticaly added, json gets loaded
306308
clearForm(form) ;
307309

310+
form.sparnatural.variablesSelector.loadQuery() ;
311+
308312
// And now, submit form
309313
$(form.sparnatural).trigger('submit')
310314
form.preLoad = false ;
@@ -359,6 +363,13 @@ var Datasources = require("./SparnaturalConfigDatasources.js");
359363
var contexte = $('<div class="bg-wrapper"><ul class="componentsListe"></ul></div>');
360364
$(form.sparnatural).append(contexte) ;
361365

366+
form.queryOptions = {
367+
distinct : settings.addDistinct,
368+
displayVariableList: ['?this'],
369+
orderSort: null,
370+
defaultLang: settings.language
371+
}
372+
362373
initGeneralEvent(form) ;
363374

364375
// triggered when Sparnatural is submitted : generates output SPARQL query
@@ -381,7 +392,6 @@ var Datasources = require("./SparnaturalConfigDatasources.js");
381392
// prints the SPARQL generated from the writing of the JSON data structure
382393
console.log("*** New SPARQL from JSON data structure ***");
383394
var writer = new QuerySPARQLWriter(
384-
settings.addDistinct,
385395
settings.typePredicate,
386396
specProvider
387397
);

0 commit comments

Comments
 (0)