registration fixes

This commit is contained in:
Dennis Eichhorn 2023-03-24 16:20:25 +01:00
parent 7f0a3dd971
commit c73e7a480e
67 changed files with 94 additions and 68 deletions

View File

@ -2,7 +2,7 @@
* Form manager class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Account.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
* Account Manager.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Account type.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Particle class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Particle class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Particle animation class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Asset manager.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -10,7 +10,7 @@ import { RequestType } from '../Message/Request/RequestType.js';
* Auth class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -9,7 +9,7 @@ import { AssetManager } from './Asset/AssetManager.js';
* referenced classes.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -5,7 +5,7 @@
* without redefining the same behaviour multiple times.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* LocalStorage class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@ import { Logger } from '../Log/Logger.js';
* Used for pooling requests.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Log Level enum.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@ import { SystemUtils } from '../System/SystemUtils.js';
* Logger class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Math formula evaluator
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -1,3 +1,4 @@
import { NotificationLevel } from '../NotificationLevel.js';
/**
* @typedef {import('../NotificationMessage.js').NotificationMessage} NotificationMessage
*/
@ -6,7 +7,7 @@
* App notification.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
* Browser notification.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Notification data enum.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@ import { NotificationType } from '../../Message/Notification/NotificationType
* Notification manager.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* App notification message.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Notification data enum.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -7,7 +7,7 @@ import { RequestType } from './RequestType.js';
* Request class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Http request method.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Request type enum.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -4,7 +4,7 @@
* Used for auto handling different responses.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -8,7 +8,7 @@
* Used for auto handling different responses.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Response type enum.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* DOM action type.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -10,7 +10,7 @@ import { NotificationType } from '../../Message/Notification/NotificationType
*/
export function notifyMessage (data)
{
const msg = new NotificationMessage(data.level, data.title, data.msg);
const msg = new NotificationMessage(data.level, data.title, data.msg);
msg.duration = 5000;
window.omsApp.notifyManager.send(

View File

@ -2,7 +2,7 @@
* Notification type.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Module factory.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -3,7 +3,7 @@ import { ModuleFactory } from './ModuleFactory.js';
* Module manager.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Request data enum.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Request data enum.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -5,7 +5,7 @@ import { OSType } from './OSType.js';
* System utils class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -4,7 +4,7 @@ import { Logger } from '../Log/Logger.js';
* Action manager class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*

View File

@ -8,7 +8,7 @@ import { Request } from '../../Message/Request/Request.js';
* Advanced input class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -11,7 +11,7 @@ import { Request } from '../../Message/Request/Request.js';
* Advanced input class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -14,7 +14,7 @@ import { UriFactory } from '../../Uri/UriFactory.js';
* Form manager class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/
@ -1001,6 +1001,8 @@ export class Form
const request = new Request();
const self = this;
const redirect = form.getFormElement().getAttribute('data-redirect');
request.setData(data);
request.setType(RequestType.FORM_DATA); // @todo: consider to allow different request type
request.setUri(action !== null ? action : form.getAction());
@ -1050,8 +1052,32 @@ export class Form
const response = new Response(o);
let successInject = null;
if ((successInject = form.getSuccess()) !== null) {
successInject(response);
} else if (redirect !== null) {
fetch(UriFactory.build(redirect))
.then((response) => response.text())
.then((html) => {
document.documentElement.innerHTML = html;
if (window.omsApp.state) {
window.omsApp.state.hasChanges = false;
}
history.pushState({}, null, UriFactory.build(redirect));
/* This is not working as it reloads the page ?!
document.open();
document.write(html);
document.close();
*/
// @todo: fix memory leak which most likely exists because of continous binding without removing binds
window.omsApp.reInit();
})
.catch((error) => {
console.warn(error);
});
} else if (typeof response.get('type') !== 'undefined') {
self.app.responseManager.run(response.get('type'), response.get(), null);
} else if (typeof o.status !== 'undefined' && o.status !== NotificationLevel.HIDDEN) {

View File

@ -7,7 +7,7 @@ import { ResponseType } from '../../Message/Response/ResponseType.js';
* Form manager class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -5,7 +5,7 @@ import { UriFactory } from '../../Uri/UriFactory.js';
* Tab manager class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@ import { ResponseType } from '../../Message/Response/ResponseType.js';
* Table manager class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*

View File

@ -2,7 +2,7 @@
* Drag and drop class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -9,7 +9,7 @@ import { NotificationType } from '../Message/Notification/NotificationType.js
* UI manager for handling basic ui elements.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/
@ -159,7 +159,6 @@ export class GeneralUI
window.omsApp.state.hasChanges = false;
}
this.parentNode.remove();
history.pushState({}, null, UriFactory.build(uri));
/* This is not working as it reloads the page ?!
document.open();

View File

@ -6,7 +6,7 @@ import { VoiceManager } from '../../../jsOMS/UI/Input/Voice/VoiceManager.js';
* UI manager class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Keyboard manager class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Click type.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Event type.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -4,7 +4,7 @@ import { EventType } from '../../../../jsOMS/UI/Input/Mouse/EventType.js';
* Mouse manager class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Touch manager class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Form manager class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -4,7 +4,7 @@ import { Logger } from '../../../Log/Logger.js';
* Voice manager class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* Manual order class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -7,7 +7,7 @@ import { GeneralUI } from './GeneralUI.js';
* Remote data class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -12,7 +12,7 @@ import { UIStateManager } from './UIStateManager.js';
* UI manager for handling basic ui elements.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -2,7 +2,7 @@
* UI state manager class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -4,7 +4,7 @@
* This class handles all unhandled exceptions depending on the configuration.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -4,7 +4,7 @@
* This class is for creating, modifying and analyzing http uris.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -5,7 +5,7 @@ import { FormView } from './../Views/FormView.js';
* Uri factory.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*

View File

@ -4,7 +4,7 @@
* This library provides useful functionalities for the DOM and other manipulations.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -4,7 +4,7 @@
* This library provides useful functionalities for the DOM and other manipulations.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -4,7 +4,7 @@
* This library provides useful functionalities for the DOM and other manipulations.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -4,7 +4,7 @@
* This library provides useful functionalities for the DOM and other manipulations.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -4,7 +4,7 @@
* This library provides useful functionalities for the DOM and other manipulations.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*/

View File

@ -8,7 +8,7 @@ import { Input } from '../UI/Component/Input.js';
* form elements such as canvas etc.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*

View File

@ -2,7 +2,7 @@
* Table view.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @since 1.0.0
*