added drag and drop for new records via calendar (#1962)

This commit is contained in:
Kevin Papst
2020-09-17 01:13:48 +02:00
committed by GitHub
parent 14b3de4300
commit 9ef32e75c5
82 changed files with 2808 additions and 385 deletions

View File

@@ -18,6 +18,10 @@ export default class KimaiAlert extends KimaiPlugin {
return 'alert';
}
/**
* @param {string} title
* @param {string|array} message
*/
error(title, message) {
const translation = this.getContainer().getTranslation();
if (translation.has(title)) {
@@ -26,11 +30,20 @@ export default class KimaiAlert extends KimaiPlugin {
if (translation.has(message)) {
message = translation.get(message);
}
Swal.fire({
icon: 'error',
title: title.replace('%reason%', ''),
text: message,
});
if (Array.isArray(message)) {
Swal.fire({
icon: 'error',
title: title.replace('%reason%', ''),
html: message.join('<br>'),
});
} else {
Swal.fire({
icon: 'error',
title: title.replace('%reason%', ''),
text: message,
});
}
}
success(message) {