diff --git a/.eslintrc.json b/.eslintrc.json index 35b72d8..c9ed8da 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -22,6 +22,11 @@ }, "sourceType": "module" }, + "settings": { + "react": { + "version": "detect" + } + }, "rules": { "strict": 0, "semi": ["error", "never"], diff --git a/src/js/api/Client.js b/src/js/api/Client.js index 7545a5b..c35e59f 100644 --- a/src/js/api/Client.js +++ b/src/js/api/Client.js @@ -3,19 +3,15 @@ import { formatDate } from "utils" const baseURL = subdomain => { if (process.env.NODE_ENV === "production") { - return `https://${encodeURIComponent( - subdomain - )}.mocoapp.com/api/browser_extensions` + return `https://${encodeURIComponent(subdomain)}.mocoapp.com/api/browser_extensions` } else { - return `http://${encodeURIComponent( - subdomain - )}.mocoapp.localhost:3001/api/browser_extensions` + return `http://${encodeURIComponent(subdomain)}.mocoapp.localhost:3001/api/browser_extensions` } } export default class Client { - #client; - #apiKey; + #client + #apiKey constructor({ subdomain, apiKey, version }) { this.#apiKey = apiKey @@ -25,9 +21,9 @@ export default class Client { headers: { common: { "x-api-key": apiKey, - "x-extension-version": version - } - } + "x-extension-version": version, + }, + }, }) } @@ -35,29 +31,29 @@ export default class Client { this.#client.post("session", { api_key: this.#apiKey, remote_service: service?.name, - remote_id: service?.id - }); + remote_id: service?.id, + }) - projects = () => this.#client.get("projects"); + projects = () => this.#client.get("projects") schedules = (fromDate, toDate) => this.#client.get("schedules", { - params: { date: `${formatDate(fromDate)}:${formatDate(toDate)}` } - }); + params: { date: `${formatDate(fromDate)}:${formatDate(toDate)}` }, + }) activities = (fromDate, toDate) => this.#client.get("activities", { - params: { date: `${formatDate(fromDate)}:${formatDate(toDate)}` } - }); + params: { date: `${formatDate(fromDate)}:${formatDate(toDate)}` }, + }) bookedHours = service => { if (!service) { return Promise.resolve({ data: { hours: 0 } }) } return this.#client.get("activities/tags", { - params: { selection: [service.id], remote_service: service.name } + params: { selection: [service.id], remote_service: service.name }, }) - }; + } - createActivity = activity => this.#client.post("activities", { activity }); + createActivity = activity => this.#client.post("activities", { activity }) } diff --git a/src/js/components/Calendar/Day.js b/src/js/components/Calendar/Day.js index 1e9afa7..ac62a7f 100644 --- a/src/js/components/Calendar/Day.js +++ b/src/js/components/Calendar/Day.js @@ -10,15 +10,11 @@ const Day = ({ date, hours, absence, active, onClick }) => { return (
- Die installierte MOCO Browser-Erweiterung ist veraltet — bitte - aktualisieren. -
+Die installierte MOCO Browser-Erweiterung ist veraltet — bitte aktualisieren.
{isChrome() ? (