goby-database 2.2.26 → 2.2.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -836,9 +836,12 @@ export default class Project {
|
|
|
836
836
|
else if (pagination.property_range == 'slim') {
|
|
837
837
|
return label_prop_ids.includes(prop.id);
|
|
838
838
|
}
|
|
839
|
-
else {
|
|
839
|
+
else if (pagination.property_range.length > 0) {
|
|
840
840
|
return pagination.property_range.includes(prop.id);
|
|
841
841
|
}
|
|
842
|
+
else {
|
|
843
|
+
return true;
|
|
844
|
+
}
|
|
842
845
|
});
|
|
843
846
|
const relation_properties = retrieved_properties.filter(a => a.type == 'relation');
|
|
844
847
|
const data_properties = retrieved_properties.filter(a => a.type == 'data');
|
|
@@ -892,8 +895,8 @@ export default class Project {
|
|
|
892
895
|
}
|
|
893
896
|
}
|
|
894
897
|
let orderby = `ORDER BY ${class_string}.system_order`;
|
|
895
|
-
const data_prop_sql_string = data_properties.map((p) => `[user_${p.name}]`).join(',');
|
|
896
|
-
const table_selection = pagination.property_range == 'all' ? `[class_${class_name}].*` : `system_id,system_order
|
|
898
|
+
const data_prop_sql_string = data_properties.length > 0 ? ', ' + data_properties.map((p) => `[user_${p.name}]`).join(',') : '';
|
|
899
|
+
const table_selection = pagination.property_range == 'all' ? `[class_${class_name}].*` : `system_id,system_order${data_prop_sql_string}`;
|
|
897
900
|
let filter_by_items = '';
|
|
898
901
|
if (pagination.item_range && pagination.item_range !== 'all') {
|
|
899
902
|
filter_by_items = `WHERE system_id in (${pagination.item_range.join(',')})`;
|
|
@@ -907,6 +910,7 @@ export default class Project {
|
|
|
907
910
|
${cte_joins.join(' ')}
|
|
908
911
|
${filter_by_items}
|
|
909
912
|
${orderby}`;
|
|
913
|
+
console.log('query', query);
|
|
910
914
|
// possibly elaborate this any type a little more in the future, e.g. a CellValue or SQLCellValue type that expects some wildcards
|
|
911
915
|
let items = this.db.prepare(query).all();
|
|
912
916
|
let stringified_properties = class_data.properties.filter(a => a.type == 'relation' || can_have_multiple_values(a.max_values));
|