Skip to content

Commit

Permalink
[#65] Add minimal UI support for global cell references for query/sta…
Browse files Browse the repository at this point in the history
…tus (use JSON still)
  • Loading branch information
AlexP-Elastic committed Sep 28, 2019
1 parent 528904b commit 5109e44
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 11 additions & 3 deletions src/frontend/view-models/sidebarAppGeneralEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var GeneralEditor = (function(){
<option value='none'>Disabled</option>
<option value='top'>Top</option>
<option value='bottom'>Bottom</option>
<option value='global'>Cell Reference (use Advanced)</option>
</select>
</div>
`
Expand Down Expand Up @@ -61,6 +62,7 @@ var GeneralEditor = (function(){
<option value='top'>Top</option>
<option value='bottom'>Bottom</option>
<option value='none'>Disabled</option>
<option value='global'>Cell Reference (use Advanced)</option>
</select>
<div class="checkbox">
<label><input type="checkbox" id="status_merge_${tableType}_${index}">Merge with query/pagination rows</label>
Expand Down Expand Up @@ -110,6 +112,8 @@ var GeneralEditor = (function(){
var querySource = Util.getJson(json, ["common", "query", "source"]) || "none"
if (querySource == "none") {
$(`#querybar_${tableType}_${index}`).val("none")
} else if (querySource == "global") {
$(`#querybar_${tableType}_${index}`).val("global")
} else {
var localQueryPos = Util.getJson(json, ["common", "query", "local", "position"]) || "none"
$(`#querybar_${tableType}_${index}`).val(localQueryPos)
Expand Down Expand Up @@ -162,9 +166,13 @@ var GeneralEditor = (function(){
var thisValue = this.value
Util.updateRawJsonNow(globalEditor, function(currJson) {
var query = Util.getOrPutJsonObj(currJson, [ "common", "query" ])
query.source = (thisValue == "none") ? "none" : "local" // (only supported option currently)
var localQuery = Util.getOrPutJsonObj(currJson, [ "common", "query", "local" ])
localQuery.position = thisValue
if (("none" == thisValue) || ("global" == thisValue)) {
query.source = thisValue
} else {
query.source = "local"
var localQuery = Util.getOrPutJsonObj(currJson, [ "common", "query", "local" ])
localQuery.position = thisValue
}
})
})
}
Expand Down
1 change: 0 additions & 1 deletion src/frontend/view-models/sidebarAppTableForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ var TableForm = (function() {
`
}//(endif standaloneEdit)

var panelHeader = ''
var panelHeader = ''
var panelInOrOut = standaloneEdit ? 'in' : 'out'
if (!standaloneEdit) {
Expand Down

0 comments on commit 5109e44

Please sign in to comment.