mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-11 17:58:41 +00:00
fix billing process
This commit is contained in:
parent
bc95c66f57
commit
0dd94695b8
|
|
@ -34,7 +34,7 @@ export class Response
|
|||
*/
|
||||
get (id = null)
|
||||
{
|
||||
return id === null ? this.responses : this.responses[id];
|
||||
return id === null ? this.responses : (typeof this.responses[id] === 'undefined' ? null : this.responses[id]);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1076,7 +1076,7 @@ export class Form
|
|||
.catch((error) => {
|
||||
console.warn(error);
|
||||
});
|
||||
} else if (typeof response.get('type') !== 'undefined') {
|
||||
} else if (response.get('type') !== null) {
|
||||
self.app.responseManager.run(response.get('type'), response.get(), null);
|
||||
} else if (typeof o.status !== 'undefined' && o.status !== NotificationLevel.HIDDEN) {
|
||||
self.app.notifyManager.send(
|
||||
|
|
@ -1101,7 +1101,8 @@ export class Form
|
|||
const o = JSON.parse(xhr.response)[0];
|
||||
const response = new Response(o);
|
||||
|
||||
if (typeof response.get('type') !== 'undefined') {
|
||||
if (response.get('type') !== null) {
|
||||
console.log(response.get('type'));
|
||||
} else if (typeof o.status !== 'undefined' && o.status !== NotificationLevel.HIDDEN) {
|
||||
self.app.notifyManager.send(
|
||||
new NotificationMessage(o.status, o.title, o.message), NotificationType.APP_NOTIFICATION
|
||||
|
|
|
|||
|
|
@ -105,15 +105,21 @@ export class GeneralUI
|
|||
uri = uri === null ? this.getAttribute('href') : uri;
|
||||
|
||||
if (this.getAttribute('target') === '_blank'
|
||||
|| this.getAttribute(['data-target']) === '_blank'
|
||||
|| this.getAttribute('data-target') === '_blank'
|
||||
|| event.button === 1
|
||||
|| uri.startsWith('https://')
|
||||
) {
|
||||
window.open(UriFactory.build(uri), '_blank');
|
||||
} else if (this.getAttribute('data-redirect') !== null) {
|
||||
uri = window.omsApp.request.getRootPath() + uri;
|
||||
window.location.assign(uri);
|
||||
} else {
|
||||
// window.location = UriFactory.build(uri);
|
||||
// @todo : consider to implement the line above again. why was it removed?
|
||||
uri = window.omsApp.request.getRootPath() + uri;
|
||||
|
||||
fetch(UriFactory.build(uri))
|
||||
.then((response) => response.text())
|
||||
.then (response => response.text())
|
||||
.then((html) => {
|
||||
if (window.omsApp.state && window.omsApp.state.hasChanges) {
|
||||
const message = new NotificationMessage(
|
||||
|
|
@ -167,6 +173,9 @@ export class GeneralUI
|
|||
*/
|
||||
// @todo: fix memory leak which most likely exists because of continous binding without removing binds
|
||||
window.omsApp.reInit();
|
||||
|
||||
const event = new Event('DOMContentLoaded');
|
||||
window.dispatchEvent(event);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
|
|
|
|||
|
|
@ -215,6 +215,11 @@ export class HttpUri
|
|||
this.set(this.uri);
|
||||
};
|
||||
|
||||
getRootPath ()
|
||||
{
|
||||
return this.root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Uri base
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user