From 4efc7318ba3e67c764c104a8756f6c17ca2ebddc Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 19 Jan 2020 18:54:24 +0100 Subject: [PATCH] improve todos to issues --- UI/Component/Form.js | 6 +++--- UI/Component/Table.js | 49 ++++++++++++++++++++++++++++++------------- Utils/UiUtils.js | 1 - 3 files changed, 38 insertions(+), 18 deletions(-) diff --git a/UI/Component/Form.js b/UI/Component/Form.js index aa5ea3c..1f34dbe 100644 --- a/UI/Component/Form.js +++ b/UI/Component/Form.js @@ -1084,10 +1084,10 @@ export class Form * * @todo Orange-Management/jsOMS#85 * Invalid backend/api responses (!201) should undo/stop UI changes + * + * @todo Orange-Management/jsOMS#87 + * On edit highlight the data which is changed */ - - // todo: on save button click insert data into hidden row and show hidden row again, delete form row - // todo: consider to highlight column during edit }); }; diff --git a/UI/Component/Table.js b/UI/Component/Table.js index 27e50ac..f34f1c5 100644 --- a/UI/Component/Table.js +++ b/UI/Component/Table.js @@ -105,13 +105,28 @@ export class Table this.tables[id] = new TableView(id); this.unbind(id); - this.bindExport(this.tables[id]); - // todo: sorting: increasing / decreasing only if icons are available - // todo: filtering: equals (alphanumeric), greater, greater equals, lesser, lesser equals, contains, doesn't contain, excel like selection of elements. Amount of filtering options unlimited. - // cell value should be data-value="" and cell name should be data-name="" and cell content should be data-content="". - // if no value is defined than data-value = cell content. if no name is defined then data-name = cell content. if no content is defined then data-content = cell content. + /** + * @todo Orange-Management/jsOMS#89 + * Implement local and remote filtering + * Options: + * * alphanumeric + * * greater + * * greater equals + * * lesser + * * lesser equals + * * contains + * * doesnt contain + * * in between + * * regex + * * pre-defined values + * The cell values should be defined in data-value and the name should be data-name and the content should be data-content. + * Note content and value can be different. + * * If no value is defined then the cell content is the value. + * * If no name is defined the cell content is the name. + * * If no content is defined the cell content is the name. + */ const sorting = this.tables[id].getSorting(); let length = sorting.length; @@ -152,9 +167,13 @@ export class Table button.addEventListener('click', function (event) { console.log(exports.serialize()); - // todo: either create download in javascript from this data or make round trip to server who then sends the data - // - think about allowing different export formats (json, csv, excel) - // - maybe this should never be done from the ui, maybe a endpoint uri should be specified which then calls the api get function for this data + /** + * @todo Orange-Management/jsOMS#90 + * mplement export + * Either create download in javascript from this data or make round trip to server who then sends the data. + * The export should be possible (if available) in json, csv, excel, word, pdf, ... + * If no endpoint is specified or reachable the client side should create a json or csv export. + */ }); }; @@ -187,7 +206,7 @@ export class Table rows[rowId - 1].parentNode.insertBefore(rows[rowId], rows[rowId - 1]); } - // todo: submit new order to remote + // continue implementation }); }; @@ -292,7 +311,6 @@ export class Table // todo: set existing filtering option in ui here - // todo: do this as injection into a form instead? -this would require cleanup for the events every time output.firstElementChild.querySelectorAll('button[type="submit"], input[type="submit"]')[0].addEventListener('click', function (event) { jsOMS.preventAll(event); @@ -311,8 +329,13 @@ export class Table document.getElementById('table-filter').getAttribute('data-ui-column') ].setAttribute('data-filter', JSON.stringify(filter)); - // todo: if not empty highlight filter button for user indication that filter is active - // todo: filter locally and if src is available to remote filter maybe just create an apply function which calls the different functions? + /** + * @todo Orange-Management/jsOMS#88 + * If a filter is active it should be highlighted/marked in the table + * + * @todo Orange-Management/jsOMS#89 + * Filter locally and if a data-src is defined a remote filtering endpoint should be used. + */ document.getElementById('table-filter').parentNode.removeChild(document.getElementById('table-filter')); @@ -320,8 +343,6 @@ export class Table Table.getRemoteData(table); return; } - - // todo: implement local filtering if no data-src available }); output.firstElementChild.querySelectorAll('button[type="reset"], input[type="reset"]')[0].addEventListener('click', function (event) { diff --git a/Utils/UiUtils.js b/Utils/UiUtils.js index fe76d37..61ab486 100644 --- a/Utils/UiUtils.js +++ b/Utils/UiUtils.js @@ -155,7 +155,6 @@ */ jsOMS.ready = function (func) { - // todo: IE problems? + Maybe interactive + loaded can cause problems since elements might not be loaded yet?!!?!!?! if (document.readyState === 'complete' || document.readyState === 'loaded' || document.readyState === 'interactive'