Compare commits

..

2 Commits

Author SHA1 Message Date
337acb5448 mstodo query 2020-10-11 20:18:09 +02:00
e019d5660b added mstodo as wunderlist, gitbase as gitlab 2020-10-04 03:14:41 +02:00
7 changed files with 44 additions and 28 deletions

View File

@ -58,7 +58,7 @@
"mini-css-extract-plugin": "^0.9.0",
"node-sass": "^4.14.1",
"prettier": "^2.0.5",
"sass-loader": "^10.0.2",
"sass-loader": "^9.0.2",
"style-loader": "^1.2.1",
"svg-inline-loader": "^0.8.2",
"uuid": "^8.3.0",

View File

@ -1,11 +1,11 @@
import axios from "axios"
import { formatDate } from "utils"
const baseURL = subdomain => {
const baseURL = (subdomain) => {
if (process.env.NODE_ENV === "production") {
return `https://${encodeURIComponent(subdomain)}.mocoapp.com/api/browser_extensions`
} else {
return `http://${encodeURIComponent(subdomain)}.mocoapp.localhost:3000/api/browser_extensions`
return `https://${encodeURIComponent(subdomain)}.mocoapp.com/api/browser_extensions`
}
}
@ -27,7 +27,7 @@ export default class Client {
})
}
login = service =>
login = (service) =>
this.#client.post("session", {
api_key: this.#apiKey,
remote_service: service?.name,
@ -46,7 +46,7 @@ export default class Client {
params: { date: `${formatDate(fromDate)}:${formatDate(toDate)}` },
})
activitiesStatus = service => {
activitiesStatus = (service) => {
if (!service) {
return Promise.resolve({ data: { hours: 0 } })
}
@ -55,7 +55,7 @@ export default class Client {
})
}
createActivity = activity => this.#client.post("activities", { activity })
createActivity = (activity) => this.#client.post("activities", { activity })
stopTimer = timedActivity => this.#client.get(`activities/${timedActivity.id}/stop_timer`)
stopTimer = (timedActivity) => this.#client.get(`activities/${timedActivity.id}/stop_timer`)
}

View File

@ -122,18 +122,31 @@ export default {
allowHostOverride: false,
},
wunderlist: {
mstodo: {
name: "wunderlist",
host: "https://www.wunderlist.com",
urlPatterns: [":host:/(webapp)#/tasks/:id(/*)"],
host: "https://to-do.office.com",
urlPatterns: [":host:/tasks/id/:id(*)"],
description: (document) =>
document
.querySelector(".taskItem.selected .taskItem-titleWrapper-title")
?.textContent?.trim(),
projectId: projectIdentifierBySelector(".taskItem.selected .taskItem-titleWrapper-title"),
.querySelector(".detailHeader")
?.textContent?.replace(/^[^[]+\[/, "[")
.replace(projectRegex, "")
.trim(),
projectId: projectIdentifierBySelector(".detailHeader"),
allowHostOverride: false,
},
gitbase: {
name: "gitlab",
host: "https://gitbase.de",
urlPatterns: [":host:/:owner/:repo/issues/:id"],
description: (document) =>
document.querySelector("#issue-title")?.textContent?.replace(projectRegex, "").trim(),
projectId: projectIdentifierBySelector(".select-project.list a"),
allowHostOverride: false,
},
/*
"gitlab-mr": {
name: "gitlab",
host: "https://gitlab.com",
@ -161,6 +174,7 @@ export default {
},
allowHostOverride: true,
},
*/
monday: {
name: "monday",

View File

@ -28,6 +28,8 @@ export function tabUpdated(tab, { messenger, settings }) {
const service = matcher(tab.url)
const apiClient = new ApiClient(settings)
// console.log(service)
if (service?.match?.id) {
messenger.postMessage(tab, { type: "requestService" })
@ -67,7 +69,7 @@ export function settingsChanged(settings, { messenger }) {
queryTabs({ currentWindow: true })
.then(reject(isBrowserTab))
.then(
forEach(tab => {
forEach((tab) => {
messenger.postMessage(tab, { type: "closePopup" })
tabUpdated(tab, { settings, messenger })
}),

View File

@ -20,7 +20,7 @@ module.exports = (env) => {
...manifest,
permissions: compact([
...manifest.permissions,
env.NODE_ENV === "development" ? "http://*.mocoapp.localhost/*" : null,
env.NODE_ENV === "development" ? "https://*.mocoapp.com/*" : null,
]),
options_ui: {
...manifest.options_ui,

View File

@ -21,7 +21,7 @@ module.exports = (env) => {
...manifest,
permissions: compact([
...manifest.permissions,
env.NODE_ENV === "development" ? "http://*.mocoapp.localhost/*" : null,
env.NODE_ENV === "development" ? "https://*.mocoapp.com/*" : null,
]),
options_ui: {
...manifest.options_ui,

View File

@ -5235,10 +5235,10 @@ kleur@^3.0.3:
resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==
klona@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.3.tgz#98274552c513583ad7a01456a789a2a0b4a2a538"
integrity sha512-CgPOT3ZadDpXxKcfV56lEQ9OQSZ42Mk26gnozI+uN/k39vzD8toUhRQoqsX0m9Q3eMPEfsLWmtyUpK/yqST4yg==
klona@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/klona/-/klona-1.1.2.tgz#a79e292518a5a5412ec8d097964bff1571a64db0"
integrity sha512-xf88rTeHiXk+XE2Vhi6yj8Wm3gMZrygGdKjJqN8HkV+PwF/t50/LdAKHoHpPcxFAlmQszTZ1CugrK25S7qDRLA==
leven@^3.1.0:
version "3.1.0"
@ -7047,15 +7047,15 @@ sass-graph@2.2.5:
scss-tokenizer "^0.2.3"
yargs "^13.3.2"
sass-loader@^10.0.2:
version "10.0.2"
resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-10.0.2.tgz#c7b73010848b264792dd45372eea0b87cba4401e"
integrity sha512-wV6NDUVB8/iEYMalV/+139+vl2LaRFlZGEd5/xmdcdzQcgmis+npyco6NsDTVOlNA3y2NV9Gcz+vHyFMIT+ffg==
sass-loader@^9.0.2:
version "9.0.3"
resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-9.0.3.tgz#086adcf0bfdcc9d920413e2cdc3ba3321373d547"
integrity sha512-fOwsP98ac1VMme+V3+o0HaaMHp8Q/C9P+MUazLFVi3Jl7ORGHQXL1XeRZt3zLSGZQQPC8xE42Y2WptItvGjDQg==
dependencies:
klona "^2.0.3"
klona "^1.1.2"
loader-utils "^2.0.0"
neo-async "^2.6.2"
schema-utils "^2.7.1"
schema-utils "^2.7.0"
semver "^7.3.2"
saxes@^5.0.0:
@ -7082,7 +7082,7 @@ schema-utils@^1.0.0:
ajv-errors "^1.0.0"
ajv-keywords "^3.1.0"
schema-utils@^2.6.5, schema-utils@^2.6.6, schema-utils@^2.7.1:
schema-utils@^2.6.5, schema-utils@^2.6.6, schema-utils@^2.7.0, schema-utils@^2.7.1:
version "2.7.1"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.7.1.tgz#1ca4f32d1b24c590c203b8e7a50bf0ea4cd394d7"
integrity sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==