Commit 02af886b authored by Richard Marston's avatar Richard Marston
Browse files

Show dropdown for true / false attributes

parent 99be4b86
Pipeline #194684 passed with stage
in 1 minute and 10 seconds
......@@ -248,9 +248,7 @@ const selectPrimitiveRenderFunction = function(primitive){
render = '"renderString"';
}
else if (primitive == "Boolean") {
// TODO: Implementation Required!
console.error("Boolean primitive renderer not implemented!")
render = '"renderString"';
render = '"renderBoolean"';
}
else if (primitive == "Date") {
console.error("Date primitive renderer not implemented!")
......
<span class="row-right wide-row floating-panel-value">
<select value="{{value}}" id="{{dropdownId}}" type="select" onchange="currentCimsvg().updateComponent('{{classType}}', '{{parentRdfid}}', '{{attribute}}', this.value)">
<option>Select</label>
{{#eq value "True"}}
<option selected="selected" value="True">True</label>
{{else}}
<option value="True">True</label>
{{/eq}}
{{#eq value "False"}}
<option selected="selected" value="False">False</label>
{{else}}
<option value="False">False</label>
{{/eq}}
</select>
<button class="hiddenbutton"> + </button>
<button class="hiddenbutton"> -> </button>
</span>
......@@ -139,8 +139,7 @@ class aggregateRenderer {
return templates.handlebars_cim_render_string(data)
}
static renderBoolean(data) {
// TODO: WRONG!
return templates.handlebars_cim_render_string(data)
return templates.handlebars_cim_render_boolean(data)
}
static renderInteger(data) {
// TODO: WRONG!
......@@ -216,13 +215,21 @@ const getAggregateComponentMenuCIM16 = function(details){
export default function(Handlebars) {
Handlebars.registerHelper('neq', function neq(v1, v2, options) {
Handlebars.registerHelper('neq', function (v1, v2, options) {
if(v1 !== v2) {
return options.fn(this);
}
return options.inverse(this);
});
Handlebars.registerHelper('eq', function (v1, v2, options) {
console.log("v1: ", v1, " v2: ", v2, " options: ", options);
if(v1 == v2) {
return options.fn(this);
}
return options.inverse(this);
});
Handlebars.registerHelper('createGridArea', function (column, row, height) {
let rowStart = (row + 1).toString();
let rowEnd = (row + 1 + height).toString();
......
......@@ -448,6 +448,7 @@ class cimsvg {
}
else {
console.error("Failed to parse cim version.");
return false;
}
this.entsoe = entsoe ? "_entsoe" : "";
return true;
......@@ -457,7 +458,6 @@ class cimsvg {
if (!this.getXmlDoc()) {
this.setXmlDoc(cimxml.getDOM("<rdf:RDF "+cimxml.xmlns()+"/>"));
}
let cimParse = cimxml.moreXmlData(fileContents, this.getXmlDoc());
if (cimParse) {
if (this.rdfFileCount === 1) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment