Skip to content
Snippets Groups Projects
Commit 32edcf23 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

Merge branch 'dev' into f-quotes-googly-search

parents 0c07155d 732d4b0d
Branches
Tags
2 merge requests!84Release 0.9,!80F quotes googly search
Pipeline #29423 failed
...@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
down or arrow up. down or arrow up.
* [#182](https://gitlab.com/caosdb/caosdb-webui/-/issues/182) - Quotes breake * [#182](https://gitlab.com/caosdb/caosdb-webui/-/issues/182) - Quotes breake
"googly" search "googly" search
* Hidden boolean select in edit mode.
### Security ### Security
......
...@@ -986,30 +986,33 @@ var edit_mode = new function () { ...@@ -986,30 +986,33 @@ var edit_mode = new function () {
result = "<input type='number' step='any' value='" + property.value + "'></input>"; result = "<input type='number' step='any' value='" + property.value + "'></input>";
} else if (property.datatype == "INTEGER") { } else if (property.datatype == "INTEGER") {
result = "<input type='number' value='" + property.value + "'></input>"; result = "<input type='number' value='" + property.value + "'></input>";
} else if (property.datatype == "BOOLEAN") { } else if (property.datatype == "BOOLEAN" || property.datatype == "FILE" || property.reference) {
result = $(`<select class="selectpicker form-control caosdb-list-${property.datatype}"><option value=""></option><option>FALSE</option><option>TRUE</option></select>`); result = $('<div/>');
if(property.value) { var css = {
result.val(property.value); "min-height": "38px",
} "width": "80%",
} else if (property.reference || property.datatype == "FILE") { "display": "inline-block",
result = $('<div/>'); };
var css = { result.css(css);
"min-height": "38px",
"width": "80%",
"display": "inline-block",
};
result.css(css);
result.append(`<select style="display: none"><option selected>${property.value}</option></select>`);
result.append(createWaitingNotification(property.value));
const select = $('<select data-container="body" data-virtual-scroll="100" data-window-padding="15" data-live-search="true" class="selectpicker form-control caosdb-list-' + property.datatype + '" data-resolved="false"><option value=""></option></select>');
options.then((_options) => {
edit_mode.fill_reference_drop_down(select[0], _options, property.value);
result.empty();
result.append(select);
edit_mode._init_select(select);
});
if (property.datatype == "BOOLEAN") {
const select = $(`<select data-container="body" class="selectpicker form-control caosdb-list-${property.datatype}"><option value=""></option><option>FALSE</option><option>TRUE</option></select>`);
if (property.value) {
select.val(property.value);
}
result.append(select);
} else { // references and files
result.append(`<select style="display: none"><option selected>${property.value}</option></select>`);
result.append(createWaitingNotification(property.value));
const select = $('<select data-container="body" data-virtual-scroll="100" data-window-padding="15" data-live-search="true" class="selectpicker form-control caosdb-list-' + property.datatype + '" data-resolved="false"><option value=""></option></select>');
options.then((_options) => {
edit_mode.fill_reference_drop_down(select[0], _options, property.value);
result.empty();
result.append(select);
edit_mode._init_select(select);
});
}
} else { } else {
throw ("Unsupported data type: `" + property.datatype + "`. Please issue a feature request."); throw ("Unsupported data type: `" + property.datatype + "`. Please issue a feature request.");
} }
...@@ -2094,4 +2097,4 @@ var edit_mode = new function () { ...@@ -2094,4 +2097,4 @@ var edit_mode = new function () {
*/ */
$(document).ready(function () { $(document).ready(function () {
edit_mode.init(); edit_mode.init();
}); });
\ No newline at end of file
...@@ -821,7 +821,7 @@ QUnit.test("_toggle_list_property", async function (assert) { ...@@ -821,7 +821,7 @@ QUnit.test("_toggle_list_property", async function (assert) {
var val = $(single_input).val(); var val = $(single_input).val();
if (dt == "DATETIME") { if (dt == "DATETIME") {
val = $(single_input).find("[type='date']").val() + "T" + $(single_input).find("[type='time']").val(); val = $(single_input).find("[type='date']").val() + "T" + $(single_input).find("[type='time']").val();
} else if (["Person", "FILE", "REFERENCE"].indexOf(dt) > -1) { } else if (["BOOLEAN", "Person", "FILE", "REFERENCE"].indexOf(dt) > -1) {
val = $(single_input).find("select").val(); val = $(single_input).find("select").val();
} }
assert.equal(val, data[`LIST<${dt}>`], `single ${dt} input has correct value`); assert.equal(val, data[`LIST<${dt}>`], `single ${dt} input has correct value`);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment