Skip to content

Commit

Permalink
some sparql editor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Forberg committed Feb 15, 2024
1 parent 1f53e80 commit e8cef0e
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 44 deletions.
31 changes: 31 additions & 0 deletions public/css/_sparql.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

.yasqe .yasqe_buttons {
right: 16px !important;
top: 16px !important;
}

.yasqe .yasqe_buttons .yasqe_share {
display: none;
}

.yasqe .yasqe_buttons .yasqe_queryButton {
margin-right: .2em;
margin-top: .2em;
}

.error-box {
background-color: #ffdbdb;
color:#f13232;
border: 1px solid #f13232;
padding: 1em;
white-space: pre-line;
display: grid;
}

.error-box h1 {
font-weight: 600;
padding: 0;
margin: 0;
margin-bottom: 1em;
font-size: 1em;
}
42 changes: 32 additions & 10 deletions public/css/website.css
Original file line number Diff line number Diff line change
Expand Up @@ -10619,7 +10619,7 @@ template {
}
.databus-navbar .databus-navbar-item.link {
cursor: pointer;
color: #d5d5d5;
color: #c4c4c4;
padding: 0em 0.75em;
}
.databus-navbar .databus-navbar-item.link:hover {
Expand Down Expand Up @@ -10885,6 +10885,37 @@ template {
background-size: 150px;
}

.yasqe .yasqe_buttons {
right: 16px !important;
top: 16px !important;
}

.yasqe .yasqe_buttons .yasqe_share {
display: none;
}

.yasqe .yasqe_buttons .yasqe_queryButton {
margin-right: 0.2em;
margin-top: 0.2em;
}

.error-box {
background-color: #ffdbdb;
color: #f13232;
border: 1px solid #f13232;
padding: 1em;
white-space: pre-line;
display: grid;
}

.error-box h1 {
font-weight: 600;
padding: 0;
margin: 0;
margin-bottom: 1em;
font-size: 1em;
}

* {
margin: 0px;
padding: 0px;
Expand Down Expand Up @@ -11119,15 +11150,6 @@ body.has-navbar-fixed-top {
fill: rgb(200, 200, 200);
}

.yasqe .yasqe_buttons .yasqe_share {
display: none;
}

.yasqe .yasqe_buttons .yasqe_queryButton {
margin-right: 0.2em;
margin-top: 0.2em;
}

.editable-collection-element {
margin: 0 !important;
}
Expand Down
9 changes: 1 addition & 8 deletions public/css/website.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
@import 'normalize';
@import 'nav';
@import 'frontpage';
@import 'sparql';

* {
margin: 0px;
Expand Down Expand Up @@ -273,14 +274,6 @@ body.has-navbar-fixed-top {
fill: rgba(200, 200, 200, 1);
}

.yasqe .yasqe_buttons .yasqe_share {
display: none;
}

.yasqe .yasqe_buttons .yasqe_queryButton {
margin-right: .2em;
margin-top: .2em;
}

.editable-collection-element {
margin: 0 !important;
Expand Down
2 changes: 1 addition & 1 deletion public/dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 15 additions & 7 deletions public/js/page-controller/sparql-editor-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,16 +255,24 @@ ORDER BY DESC (STR(?v)) LIMIT 1`

var queryPage = $scope.queryData.pages[$scope.queryData.activeTab];

var res = await $http.post(queryPage.endpoint, { query: queryPage.query });
try {

var res = await $http.post(queryPage.endpoint, { query: queryPage.query });

if ($scope.resultCache == null) {
$scope.resultCache = {};
}
if ($scope.resultCache == null) {
$scope.resultCache = {};
}

$scope.resultCache[queryPage.name] = res.data;
$scope.saveResultCache();
$scope.resultCache[queryPage.name] = res.data;
$scope.saveResultCache();

delete queryPage.err;
$scope.editor.result = res.data;
} catch(err) {
console.log(err);
queryPage.err = err;
}

$scope.editor.result = res.data;
$scope.$apply();
}

Expand Down
Loading

0 comments on commit e8cef0e

Please sign in to comment.