add todos from github

This commit is contained in:
Dennis Eichhorn 2019-12-31 19:56:09 +01:00
parent 4e2556de52
commit 0c226ca9df
10 changed files with 110 additions and 26 deletions

View File

@ -7,6 +7,23 @@ import { Logger } from '../Log/Logger.js';
* @license OMS License 1.0
* @version 1.0.0
* @since 1.0.0
*
* @todo Orange-Management/jsOMS#26
* Sync/Async events
* Events so fare can be created sync and async depending on the implementation.
* It would be better to make it sync/async depending on a option flag.
*
* @todo Orange-Management/jsOMS#35
* Template actions cannot be overwritten
* Templates by nature get added and removed from a page (often in order to reuse existing html to minimize the html load).
* The problem with templates is that they need to register in the ActionManager.js.
* A listener currently is only registered once per id.
* Since templates often keep the same id for some elements this results in a problem because the new template will not register a new listener.
* Possible solutions:
* 1. Force unique ids for templates during setup (pro: fast and easy initial solution, con: action event pollution not solved)
* 2. Whenever a dom element with action elements is removed, also unregister the listeners (pro: clean solution, con: difficult to implement)
* Solution 2 will be implemented.
* Maybe this can be performed in the dom removing action events or a dom listener would be required to listen for these dom elements.
*/
export class ActionManager
{

View File

@ -7,9 +7,6 @@ import { Request } from '../../Message/Request/Request.js';
* @license OMS License 1.0
* @version 1.0.0
* @since 1.0.0
*
* @todo: this class is probably the most stupid thing I've done in a long time. Seriously fix this!
* @todo: Passing self to every MEMBER function is just dumb.
*/
export class AdvancedInput
{
@ -35,10 +32,12 @@ export class AdvancedInput
const self = this;
this.inputField.addEventListener('focusout', function(e) {
// todo: this also means that clicking on any other part of the result list that it disappears befor
// the click is registered in the result list since focusout has highest priority (e.g. sort button in table).
// so far i don't know a way to check if *any* element in the result div is clicked, if I could check this
// first then I could simply say, don't make the result div inactive!
/**
* @todo Orange-Management/Modules#63
* If you click anything outside of the input element the dropdown list closes.
* This is also true if you click something inside of the dropdown list e.g. sort/filter etc.
* This might be fixable by changing the focus from the input element to the dropdown element and keep the dropdown element visible if it has focus.
*/
if (e.relatedTarget === null ||
e.relatedTarget.parentElement === null ||
e.relatedTarget.parentElement.parentElement === null ||
@ -70,9 +69,14 @@ export class AdvancedInput
this.dropdownElement.addEventListener('keydown', function(e) {
jsOMS.preventAll(e);
// todo: consider if it makes sense to have a none element always for phone users only to jump out?
// todo: if not remote then the suggestion dropdown should filter itself based on best match
/**
* @todo Orange-Management/jsOMS#61
* Jumping out of the dropdown list is a little bit annoying for handheld users.
* A solution could be to add a exit/none element which closes the dropdown when clicked.
*
* @todo Orange-Management/jsOMS#62
* If the data for the input element is only locally defined the filter or sort should be done by the best match.
*/
if (e.keyCode === 27 || e.keyCode === 46 || e.keyCode === 8) {
// handle esc, del to go back to input field
self.inputField.focus();

View File

@ -14,9 +14,6 @@ import { Request } from '../../Message/Request/Request.js';
* @license OMS License 1.0
* @version 1.0.0
* @since 1.0.0
*
* @todo: this class is probably the most stupid thing I've done in a long time. Seriously fix this!
* @todo: Passing self to every MEMBER function is just dumb.
*/
export class AdvancedSelect
{

View File

@ -15,6 +15,20 @@ import { FormView } from '../../Views/FormView.js';
* @license OMS License 1.0
* @version 1.0.0
* @since 1.0.0
*
* @tood Orange-Management/jsOMS#60
* On change listener
* Allow to add a on change listener in a form. This should result in automatic submits after changing a form.
* Consider the following cases to submit the form:
* * on Enter (all except textarea)
* * on Change (by using a timer)
* * on Leave (all elements)
* The listener should be defined in the form definition once and in js be applied to all form elements.
*
* @todo Orange-Management/Modules#177
* Hotkey for saving forms for creation/edit
* Instead of using the mouse to click save the user should be able to use a hotkey to save/create/update the current form.
* The hotkey on PC should be alt+enter or alt+shift+enter or alt+s
*/
export class Form
{
@ -996,7 +1010,6 @@ export class Form
break;
case 'textarea':
// textarea only has value data in it's content and nothing else!
// @todo: check other html tags as well or maybe just don't use the -text attribute and be fine?
break;
default:
src.value = value;

View File

@ -1,6 +1,7 @@
import { TableView } from '../../Views/TableView.js';
import { Request } from '../../Message/Request/Request.js';
import { ResponseType } from '../../Message/Response/ResponseType.js';
/**
* Table manager class.
*
@ -8,6 +9,24 @@ import { ResponseType } from '../../Message/Response/ResponseType.js';
* @license OMS License 1.0
* @version 1.0.0
* @since 1.0.0
*
* @todo Orange-Management/jsOMS#50
* Add basic table handling (no db and pagination)
*
* @todo Orange-Management/jsOMS#55
* Implement filtering and sorting based on backend
*
* @todo Orange-Management/jsOMS#57
* Advanced filtering
* The current filtering implementation is only column by column connected with &&.
* Consider to implement a much more advanced filtering where different combinations are possible such as || &&, different ordering with parenthesis etc.
* This can be extremely powerful but will be complex for standard users.
* This advanced filtering should probably be a little bit hidden?
*
* @todo Orange-Management/jsOMS#59
* Data download
* There is a small icon in the top right corner of tables which allows (not yet to be honest) to download the data in the table.
* Whether the backend should be queried for this or only the frontend data should be collected (current situation) should depend on if the table has an api endpoint defined.
*/
export class Table
{

View File

@ -105,7 +105,10 @@ export class ReadManager
};
};
// todo: remove once obsolete
/**
* @todo Orange-Management/jsOMS#66
* Remove the speech recognition wrapper once it is obsolete and supported by the major browsers.
*/
/** global: webkitSpeechRecognition */
/** global: SpeechRecognition */
var SpeechRecognition = typeof SpeechRecognition !== 'undefined' ? SpeechRecognition : typeof webkitSpeechRecognition !== 'undefined' ? webkitSpeechRecognition : null;

View File

@ -158,7 +158,10 @@ export class VoiceManager
};
};
// todo: remove once obsolete
/**
* @todo Orange-Management/jsOMS#66
* Remove the speech recognition wrapper once it is obsolete and supported by the major browsers.
*/
/** global: webkitSpeechRecognition */
/** global: SpeechRecognition */
var SpeechRecognition = typeof SpeechRecognition !== 'undefined' ? SpeechRecognition : typeof webkitSpeechRecognition !== 'undefined' ? webkitSpeechRecognition : null;

View File

@ -249,7 +249,9 @@
};
/**
* @todo: implement
* @todo Orange-Management/jsOMS#64
* Implement a function which returns the nearest dom element based on a selector.
* Nearest is defined as vertical and horizontal distance.
*/
jsOMS.nearest = function (e, selector)
{

View File

@ -11,6 +11,15 @@ import { Input } from '../UI/Component/Input.js';
* @license OMS License 1.0
* @version 1.0.0
* @since 1.0.0
*
* @tood Orange-Management/jsOMS#60
* On change listener
* Allow to add a on change listener in a form. This should result in automatic submits after changing a form.
* Consider the following cases to submit the form:
* * on Enter (all except textarea)
* * on Change (by using a timer)
* * on Leave (all elements)
* The listener should be defined in the form definition once and in js be applied to all form elements.
*/
export class FormView
{
@ -100,7 +109,7 @@ export class FormView
/**
* Get submit elements
*
* @return {Object}
* @return {NodeListOf<any>}
*
* @since 1.0.0
*/
@ -119,7 +128,7 @@ export class FormView
/**
* Get submit elements
*
* @return {Object}
* @return {NodeListOf<any>}
*
* @since 1.0.0
*/
@ -133,7 +142,7 @@ export class FormView
/**
* Get edit elements
*
* @return {Object}
* @return {NodeListOf<any>}
*
* @since 1.0.0
*/
@ -149,7 +158,7 @@ export class FormView
/**
* Get save elements
*
* @return {Object}
* @return {NodeListOf<any>}
*
* @since 1.0.0
*/
@ -165,7 +174,7 @@ export class FormView
/**
* Get save elements
*
* @return {Object}
* @return {NodeListOf<any>}
*
* @since 1.0.0
*/
@ -195,12 +204,13 @@ export class FormView
};
/**
* Get remove buttons
* Get add buttons
*
* The add button is different from the submit button since sometimes you want to show data to the user before you submit it.
*
* @return {NodeListOf<any>}
*
* @since 1.0.0
* @todo isn't this the same as submit in some cases? form below table?
*/
getAdd ()
{
@ -493,7 +503,6 @@ export class FormView
* @return {void}
*
* @since 1.0.0
* @todo: check bind functionality maybe remove!!!
*/
bind ()
{
@ -549,7 +558,6 @@ export class FormView
* @return {void}
*
* @since 1.0.0
* @todo: check unbind functionality maybe remove = everything!!!
*/
unbind ()
{

View File

@ -5,6 +5,24 @@
* @license OMS License 1.0
* @version 1.0.0
* @since 1.0.0
*
* @todo Orange-Management/jsOMS#50
* Add basic table handling (no db and pagination)
*
* @todo Orange-Management/jsOMS#55
* Implement filtering and sorting based on backend
*
* @todo Orange-Management/jsOMS#57
* Advanced filtering
* The current filtering implementation is only column by column connected with &&.
* Consider to implement a much more advanced filtering where different combinations are possible such as || &&, different ordering with parenthesis etc.
* This can be extremely powerful but will be complex for standard users.
* This advanced filtering should probably be a little bit hidden?
*
* @todo Orange-Management/jsOMS#59
* Data download
* There is a small icon in the top right corner of tables which allows (not yet to be honest) to download the data in the table.
* Whether the backend should be queried for this or only the frontend data should be collected (current situation) should depend on if the table has an api endpoint defined.
*/
export class TableView
{