updated frontend builds (#5210)
* do not rely on node_modules path * bump eslint to v9, run eslint via npm task, remove from build task * loosen dependencies and update all packages * rebuild assets with latest frontend packages * bump webpack encore and dependencies * bump to latest stable yarn * explicitly mention dependencies
This commit is contained in:
@@ -154,7 +154,7 @@ export default class KimaiPlugin {
|
||||
const width = Math.max(
|
||||
document.documentElement.clientWidth,
|
||||
window.innerWidth || 0
|
||||
)
|
||||
);
|
||||
|
||||
return width < 576;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ export default class KimaiCopyDataForm extends KimaiFormPlugin {
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
*/
|
||||
activateForm(form) // eslint-disable-line no-unused-vars
|
||||
activateForm(form)
|
||||
{
|
||||
if (this._eventHandler === undefined) {
|
||||
this._eventHandler = (event) => {
|
||||
@@ -63,7 +63,7 @@ export default class KimaiCopyDataForm extends KimaiFormPlugin {
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
*/
|
||||
destroyForm(form) // eslint-disable-line no-unused-vars
|
||||
destroyForm(form)
|
||||
{
|
||||
form.removeEventListener('click', this._eventHandler);
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ export default class KimaiFormSelect extends KimaiFormTomselectPlugin {
|
||||
// append the ones with no parent at the end (e.g. global activities)
|
||||
const optGroupEmpty = this._createOptgroup('');
|
||||
emptyOpts.forEach(child => optGroupEmpty.appendChild(child));
|
||||
node.appendChild(optGroupEmpty)
|
||||
node.appendChild(optGroupEmpty);
|
||||
|
||||
// if available, re-select the previous selected option (mostly usable for global activities)
|
||||
node.value = selectedValue;
|
||||
@@ -440,7 +440,7 @@ export default class KimaiFormSelect extends KimaiFormTomselectPlugin {
|
||||
targetSelect.dataset['reloading'] = '0';
|
||||
targetSelect.disabled = false;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener('change', this._eventHandlerApiSelects);
|
||||
}
|
||||
@@ -476,14 +476,14 @@ export default class KimaiFormSelect extends KimaiFormTomselectPlugin {
|
||||
newValue = [...targetField.selectedOptions].map(o => o.value);
|
||||
} else if (newValue !== '') {
|
||||
if (targetField.type === 'date') {
|
||||
const timeId = targetField.id.replace('_date', '_time')
|
||||
const timeId = targetField.id.replace('_date', '_time');
|
||||
const timeElement = document.getElementById(timeId);
|
||||
const time = timeElement === null ? '12:00:00' : timeElement.value;
|
||||
// using 12:00 as fallback, because timezone handling might change the date if we use 00:00
|
||||
const newDate = this.getDateUtils().fromHtml5Input(newValue, time);
|
||||
newValue = this.getDateUtils().formatForAPI(newDate, false);
|
||||
} else if (targetField.type === 'text' && targetField.name.includes('date')) {
|
||||
const timeId = targetField.id.replace('_date', '_time')
|
||||
const timeId = targetField.id.replace('_date', '_time');
|
||||
const timeElement = document.getElementById(timeId);
|
||||
// using 12:00 as fallback, because timezone handling might change the date if we use 00:00
|
||||
let time = '12:00:00';
|
||||
|
||||
@@ -28,12 +28,12 @@ export default class KimaiFormTomselectPlugin extends KimaiFormPlugin {
|
||||
return null;
|
||||
}
|
||||
const tpl = this.translate('select.search.create');
|
||||
const tplReplaced = tpl.replace('%input%', '<strong>' + name + '</strong>')
|
||||
const tplReplaced = tpl.replace('%input%', '<strong>' + name + '</strong>');
|
||||
return '<div class="create">' + tplReplaced + '</div>';
|
||||
},
|
||||
no_results: (data, escape) => {
|
||||
const tpl = this.translate('select.search.notfound');
|
||||
const tplReplaced = tpl.replace('%input%', '<strong>' + escape(data.input) + '</strong>')
|
||||
const tplReplaced = tpl.replace('%input%', '<strong>' + escape(data.input) + '</strong>');
|
||||
return '<div class="no-results">' + tplReplaced + '</div>';
|
||||
},
|
||||
};
|
||||
|
||||
@@ -69,7 +69,7 @@ export default class KimaiAjaxModalForm extends KimaiReducedClickHandler {
|
||||
|
||||
_getModal()
|
||||
{
|
||||
return Modal.getOrCreateInstance(this._getModalElement())
|
||||
return Modal.getOrCreateInstance(this._getModalElement());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -208,7 +208,7 @@ export default class KimaiAlert extends KimaiPlugin {
|
||||
const toast = new Toast(element);
|
||||
element.addEventListener('hidden.bs.toast', function () {
|
||||
container.removeChild(element);
|
||||
})
|
||||
});
|
||||
toast.show();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ export default class KimaiHotkeys extends KimaiPlugin {
|
||||
elements[0].click();
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// adopted from Bootstrap 5.1.1, MIT
|
||||
|
||||
@@ -64,7 +64,7 @@ export default class KimaiMultiUpdateTable extends KimaiPlugin {
|
||||
*/
|
||||
_toggleForm(table)
|
||||
{
|
||||
const card = table.closest('div.card.data_table')
|
||||
const card = table.closest('div.card.data_table');
|
||||
|
||||
let ids = [];
|
||||
for (const box of table.querySelectorAll('input.multi_update_single:checked')) {
|
||||
|
||||
@@ -43,7 +43,7 @@ export default class KimaiNotification extends KimaiPlugin {
|
||||
callback(false);
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
} catch (e) { // eslint-disable-line no-unused-vars
|
||||
Notification.requestPermission((permission) => {
|
||||
if (permission === "granted") {
|
||||
callback(true);
|
||||
|
||||
@@ -34,7 +34,7 @@ export default class KimaiRemoteModal extends KimaiPlugin {
|
||||
this._showModal(event.currentTarget);
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
}
|
||||
};
|
||||
|
||||
for (let link of document.querySelectorAll(this._selector)) {
|
||||
link.addEventListener('click', this.handle);
|
||||
|
||||
@@ -14,7 +14,7 @@ import dayGridPlugin from '@fullcalendar/daygrid';
|
||||
import timeGridPlugin from '@fullcalendar/timegrid';
|
||||
import bootstrap5Plugin, { BootstrapTheme } from '@fullcalendar/bootstrap5';
|
||||
import googlePlugin from '@fullcalendar/google-calendar';
|
||||
import iCalendarPlugin from '@fullcalendar/icalendar'
|
||||
import iCalendarPlugin from '@fullcalendar/icalendar';
|
||||
import interactionPlugin, { Draggable } from '@fullcalendar/interaction';
|
||||
import arLocale from '@fullcalendar/core/locales/ar';
|
||||
import csLocale from '@fullcalendar/core/locales/cs';
|
||||
@@ -264,7 +264,7 @@ export default class KimaiCalendar {
|
||||
contextMenu.createFromApi(jsEvent, result);
|
||||
}, (e) => { console.log('Failed to load actions for context menu', e); });
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -409,13 +409,13 @@ export default class KimaiCalendar {
|
||||
this.hidePopover(info.el);
|
||||
},
|
||||
eventDrop: (eventDropInfo) => {
|
||||
this.changeHandler(eventDropInfo)
|
||||
this.changeHandler(eventDropInfo);
|
||||
},
|
||||
eventResizeStart: (info) => {
|
||||
this.hidePopover(info.el);
|
||||
},
|
||||
eventResize: (eventResizeInfo) => {
|
||||
this.changeHandler(eventResizeInfo)
|
||||
this.changeHandler(eventResizeInfo);
|
||||
},
|
||||
}};
|
||||
}
|
||||
@@ -568,7 +568,7 @@ export default class KimaiCalendar {
|
||||
color = apiItem.project.customer.color;
|
||||
}
|
||||
}
|
||||
if (color == null) {
|
||||
if (color === null) {
|
||||
color = defaultColor;
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ export default class KimaiContextMenu {
|
||||
}
|
||||
dropdownElement.removeEventListener('click', dropdownListener);
|
||||
document.removeEventListener('click', dropdownListener);
|
||||
}
|
||||
};
|
||||
|
||||
dropdownElement.addEventListener('click', dropdownListener);
|
||||
document.addEventListener('click', dropdownListener);
|
||||
|
||||
@@ -61,7 +61,7 @@ export default class KimaiPaginatedBoxWidget {
|
||||
// and this event will hide it afterwards
|
||||
const hideOverlay = () => {
|
||||
document.dispatchEvent(new Event('kimai.reloadedContent'));
|
||||
}
|
||||
};
|
||||
|
||||
window.kimai.getPlugin('fetch').fetch(url)
|
||||
.then(response => {
|
||||
|
||||
@@ -26,17 +26,17 @@ $fa-font-path: "~@fortawesome/fontawesome-free/webfonts/";
|
||||
/**
|
||||
* We need that, to compile the rest of the file
|
||||
*/
|
||||
@import "bootstrap/scss/functions";
|
||||
@import "~bootstrap/scss/functions";
|
||||
|
||||
@import "@tabler/core/src/scss/variables";
|
||||
@import "@tabler/core/src/scss/variables-dark";
|
||||
@import "@tabler/core/src/scss/mixins";
|
||||
@import "~@tabler/core/src/scss/variables";
|
||||
@import "~@tabler/core/src/scss/variables-dark";
|
||||
@import "~@tabler/core/src/scss/mixins";
|
||||
|
||||
@import "bootstrap/scss/variables";
|
||||
@import "bootstrap/scss/variables-dark";
|
||||
@import "bootstrap/scss/maps";
|
||||
@import "bootstrap/scss/mixins";
|
||||
@import "bootstrap/scss/utilities";
|
||||
@import "~bootstrap/scss/variables";
|
||||
@import "~bootstrap/scss/variables-dark";
|
||||
@import "~bootstrap/scss/maps";
|
||||
@import "~bootstrap/scss/mixins";
|
||||
@import "~bootstrap/scss/utilities";
|
||||
|
||||
/**
|
||||
* Kimai related stuff
|
||||
|
||||
Reference in New Issue
Block a user