Release 2.0.4 (#3883)
* fix column data truncated * calculate internal rate from user * show internal rate in timesheet listing * Fixed: responsivenss and size of report start page icons * fix: name display in dropdowns (and added tests) * translate reload button * fix invoice date might be in the past * fail safe customer name handling * translate invoice_date and invoice_date help * prevent URLs like start=null * prevent to reload select twice
This commit is contained in:
@@ -416,9 +416,10 @@ export default class KimaiFormSelect extends KimaiFormPlugin {
|
||||
const targetSelect = document.getElementById(apiSelect.dataset['relatedSelect']);
|
||||
|
||||
// if the related target select does not exist, we do not need to load the related data
|
||||
if (targetSelect === null) {
|
||||
if (targetSelect === null || targetSelect.dataset['reloading'] === '1') {
|
||||
return;
|
||||
}
|
||||
targetSelect.dataset['reloading'] = '1';
|
||||
|
||||
if (targetSelect.tomselect !== undefined) {
|
||||
targetSelect.tomselect.disable();
|
||||
@@ -441,6 +442,7 @@ export default class KimaiFormSelect extends KimaiFormPlugin {
|
||||
if (selectValue === undefined || selectValue === null || selectValue === '' || (Array.isArray(selectValue) && selectValue.length === 0)) {
|
||||
if (apiSelect.dataset['emptyUrl'] === undefined) {
|
||||
this._updateSelect(targetSelectId, {});
|
||||
targetSelect.dataset['reloading'] = '0';
|
||||
return;
|
||||
}
|
||||
newApiUrl = this._buildUrlWithFormFields(apiSelect.dataset['emptyUrl'], formPrefix);
|
||||
@@ -454,6 +456,7 @@ export default class KimaiFormSelect extends KimaiFormPlugin {
|
||||
if (targetSelect.tomselect !== undefined) {
|
||||
targetSelect.tomselect.enable();
|
||||
}
|
||||
targetSelect.dataset['reloading'] = '0';
|
||||
targetSelect.disabled = false;
|
||||
});
|
||||
}
|
||||
@@ -533,10 +536,16 @@ export default class KimaiFormSelect extends KimaiFormPlugin {
|
||||
if (Array.isArray(newValue)) {
|
||||
let urlParams = [];
|
||||
for (let tmpValue of newValue) {
|
||||
if (tmpValue === null) {
|
||||
tmpValue = '';
|
||||
}
|
||||
urlParams.push(originalFieldName + '=' + tmpValue);
|
||||
}
|
||||
newApiUrl = newApiUrl.replace(item, urlParams.join('&'));
|
||||
} else {
|
||||
if (newValue === null) {
|
||||
newValue = '';
|
||||
}
|
||||
newApiUrl = newApiUrl.replace(value, newValue);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user