Release 2.0.10 (#3927)

* allow API calls via GET
* allow to stop timesheet via GET
* improve form handling and validation
* improve stop button handling
* bump version
This commit is contained in:
Kevin Papst
2023-03-15 23:02:28 +01:00
committed by GitHub
parent 1a8c78944a
commit f007697a73
15 changed files with 34 additions and 99 deletions

View File

@@ -85,20 +85,20 @@ export default class KimaiAPILink extends KimaiPlugin {
API.handleError(message, error);
};
let data = {};
if (attributes['payload'] !== undefined) {
data = attributes['payload'];
}
if (method === 'PATCH') {
let data = {};
if (attributes['payload'] !== undefined) {
data = attributes['payload'];
}
API.patch(url, data, successHandle, errorHandle);
} else if (method === 'POST') {
let data = {};
if (attributes['payload'] !== undefined) {
data = attributes['payload'];
}
API.post(url, data, successHandle, errorHandle);
} else if (method === 'DELETE') {
API.delete(url, successHandle, errorHandle);
} else if (method === 'GET') {
API.get(url, data, successHandle, errorHandle);
}
}

View File

@@ -112,7 +112,7 @@ export default class KimaiActiveRecords extends KimaiPlugin {
}
/**
* Adapts the ticktac menus accordingg to the given entries (amount and duration).
* Adapts the ticktac menus according to the given entries (amount and duration).
* Does not influence listing pages, as those refresh themselves.
*
* @param {array} entries
@@ -168,7 +168,7 @@ export default class KimaiActiveRecords extends KimaiPlugin {
for (let link of allReplacer) {
const replacerName = link.dataset['replacer'];
if (replacerName === 'url') {
link.href = node.dataset['href'].replace('000', timesheet.id);
link.dataset['href'] = node.dataset['href'].replace('000', timesheet.id);
} else if (replacerName === 'activity') {
link.innerText = timesheet.activity.name;
} else if (replacerName === 'project') {