* merge master - allow to upload twig invoice templates via UI
* support adding existing teams with same name
* permissions cannot be set right after role was created - fixes #3777
* allow to deactivate unique customer number validation - fixes #3762 
* invalid message when trying to edit locked or exported timesheets in calendar - fixes #3766
* updated icons and manifest - fixes #3761
This commit is contained in:
Kevin Papst
2023-01-21 14:49:55 +01:00
committed by GitHub
parent b62253e1f3
commit a230be77dd
79 changed files with 428 additions and 358 deletions

View File

@@ -71,7 +71,11 @@ export default class KimaiAjaxModalForm extends KimaiReducedClickHandler {
return Modal.getOrCreateInstance(this._getModalElement())
}
openUrlInModal(url)
/**
* @param {string} url
* @param {function(Response)} error the callback to execute if the fetch failed
*/
openUrlInModal(url, error)
{
const headers = new Headers();
headers.append('X-Requested-With', 'Kimai-Modal');
@@ -91,8 +95,12 @@ export default class KimaiAjaxModalForm extends KimaiReducedClickHandler {
this._openFormInModal(html);
});
})
.catch(() => {
window.location = url;
.catch((reason) => {
if (error === undefined || error === null) {
window.location = url;
} else {
error(reason);
}
});
}