Skip to content

Commit

Permalink
Merge pull request #27 from AskiaADX/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
prabathgamage authored Nov 28, 2019
2 parents 0609aa5 + 1c77990 commit dd290f1
Show file tree
Hide file tree
Showing 5 changed files with 397 additions and 837 deletions.
18 changes: 9 additions & 9 deletions app/modules/adxutil/app/configurator/ADXConfigurator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1723,14 +1723,14 @@ ADXProperties.prototype.get = function get() {
const itemCategory = {
id : category.get("id") || "",
name : category.get("name") || "",
condition: category.get("condition") || "",
// condition: category.get("condition") || "",
properties : []
};

const conditionEl = category.find("condition");
if (conditionEl) {
itemCategory.condition = conditionEl.text;
}
// const conditionEl = category.find("condition");
// if (conditionEl) {
// itemCategory.condition = conditionEl.text;
// }

category.iter('property', (property) => {
const itemProperty = {};
Expand Down Expand Up @@ -1938,7 +1938,7 @@ ADXProperties.prototype.set = function set(data) {

itemCategory.set("id", category.id || "");
itemCategory.set("name", category.name || "");
itemCategory.set("condition", category.condition || "");
// itemCategory.set("condition", category.condition || "");

if (category.properties && Array.isArray(category.properties)) {
category.properties.forEach((property) => {
Expand Down Expand Up @@ -2005,9 +2005,9 @@ ADXProperties.prototype.toXml = function toXml() {
data.categories.forEach((category) => {
xml.push(' <category id="' + (category.id || "") + '" name="' + (category.name || "") + '">');

if (category.condition) {
xml.push(' <condition><![CDATA[' + category.condition + ']]></condition>');
}
// if (category.condition) {
// xml.push(' <condition><![CDATA[' + category.condition + ']]></condition>');
// }

if (Array.isArray(category.properties)) {
category.properties.forEach((property) => {
Expand Down
16 changes: 8 additions & 8 deletions app/viewers/projectSettings/projectSettings.properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ innerFormEl.querySelector('#property_name').addEventListener('change', encodeEve
// Use falsy to validate if the comparison make sense
// for example oriCat.condition could not exist
// if curCat.condition == '' then it's equal
if (oriCat.condition || curCat.condition) {
if (curCat.condition !== oriCat.condition) {
return true;
}
}
// if (oriCat.condition || curCat.condition) {
// if (curCat.condition !== oriCat.condition) {
// return true;
// }
// }

for (let j = 0, k = curCat.properties.length; j < k; j += 1) {
curProp = curCat.properties[j];
Expand Down Expand Up @@ -203,7 +203,7 @@ innerFormEl.querySelector('#property_name').addEventListener('change', encodeEve
currentSelectedCatIndex = index;
document.getElementById('category_id').value = category.id;
document.getElementById('category_name').value = category.name || '';
document.getElementById('category_condition').value = category.condition || '';
// document.getElementById('category_condition').value = category.condition || '';

loadProperties();
muteChange = false;
Expand All @@ -224,7 +224,7 @@ innerFormEl.querySelector('#property_name').addEventListener('change', encodeEve

category.id = document.getElementById('category_id').value;
category.name = document.getElementById('category_name').value;
category.condition = document.getElementById('category_condition').value;
// category.condition = document.getElementById('category_condition').value;

categoriesListEl.options[currentSelectedCatIndex].setAttribute('value', category.id);
categoriesListEl.options[currentSelectedCatIndex].innerText = category.name;
Expand Down Expand Up @@ -703,7 +703,7 @@ innerFormEl.querySelector('#property_name').addEventListener('change', encodeEve
}
document.getElementById('category_id').value = '';
document.getElementById('category_name').value = '';
document.getElementById('category_condition').value = '';
// document.getElementById('category_condition').value = '';
loadCategory();
muteChange = false;

Expand Down
4 changes: 2 additions & 2 deletions app/viewers/projectSettings/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ <h3>Controls</h3>
<label for="category_name">Name:</label>
<textarea id="category_name" name="category[name]"></textarea>
</p>
<p>
<!-- <p>
<label for="category_condition">Condition:</label>
<textarea id="category_condition" name="category[condition]"></textarea>
</p>
</p> -->
</fieldset>
<fieldset id="category_properties">
<legend>Properties</legend>
Expand Down
Loading

0 comments on commit dd290f1

Please sign in to comment.