Fix code styles

This commit is contained in:
Manuel Bouza
2019-04-09 08:21:30 +02:00
parent e1ccb22493
commit 3903030c28

View File

@@ -5,18 +5,11 @@ export default {
name: "asana", name: "asana",
urlPatterns: [ urlPatterns: [
[/^https:\/\/app.asana.com\/0\/([^/]+)\/(\d+)/, ["domainUserId", "id"]], [/^https:\/\/app.asana.com\/0\/([^/]+)\/(\d+)/, ["domainUserId", "id"]],
[ [/^https:\/\/app.asana.com\/0\/search\/([^/]+)\/(\d+)/, ["domainUserId", "id"]],
/^https:\/\/app.asana.com\/0\/search\/([^/]+)\/(\d+)/,
["domainUserId", "id"]
]
], ],
description: document => description: document =>
document document.querySelector(".ItemRow--highlighted textarea")?.textContent?.trim() ||
.querySelector(".ItemRow--highlighted textarea") document.querySelector(".ItemRow--focused textarea")?.textContent?.trim() ||
?.textContent?.trim() ||
document
.querySelector(".ItemRow--focused textarea")
?.textContent?.trim() ||
document.querySelector(".SingleTaskPane textarea")?.textContent?.trim(), document.querySelector(".SingleTaskPane textarea")?.textContent?.trim(),
projectId: document => { projectId: document => {
const match = document const match = document
@@ -24,14 +17,13 @@ export default {
?.textContent?.trim() ?.textContent?.trim()
?.match(projectRegex) ?.match(projectRegex)
return match && match[1] return match && match[1]
} },
}, },
"github-pr": { "github-pr": {
name: "github", name: "github",
urlPatterns: ["https\\://github.com/:org/:repo/pull/:id(/:tab)"], urlPatterns: ["https\\://github.com/:org/:repo/pull/:id(/:tab)"],
id: (document, service, { org, repo, id }) => id: (document, service, { org, repo, id }) => [service.key, org, repo, id].join("."),
[service.key, org, repo, id].join("."),
description: (document, service, { org, repo, id }) => description: (document, service, { org, repo, id }) =>
document.querySelector(".js-issue-title")?.textContent?.trim(), document.querySelector(".js-issue-title")?.textContent?.trim(),
projectId: document => { projectId: document => {
@@ -40,16 +32,15 @@ export default {
?.textContent.trim() ?.textContent.trim()
?.match(projectRegex) ?.match(projectRegex)
return match && match[1] return match && match[1]
} },
}, },
"github-issue": { "github-issue": {
name: "github", name: "github",
urlPatterns: ["https\\://github.com/:org/:repo/issues/:id"], urlPatterns: ["https\\://github.com/:org/:repo/issues/:id"],
id: (document, service, { org, repo, id }) => id: (document, service, { org, repo, id }) => [service.key, org, repo, id].join("."),
[service.key, org, repo, id].join("."),
description: (document, service, { org, repo, id }) => description: (document, service, { org, repo, id }) =>
document.querySelector(".js-issue-title")?.textContent?.trim() document.querySelector(".js-issue-title")?.textContent?.trim(),
}, },
jira: { jira: {
@@ -58,11 +49,11 @@ export default {
"https\\://:org.atlassian.net/secure/RapidBoard.jspa", "https\\://:org.atlassian.net/secure/RapidBoard.jspa",
"https\\://:org.atlassian.net/browse/:id", "https\\://:org.atlassian.net/browse/:id",
"https\\://:org.atlassian.net/jira/software/projects/:projectId/boards/:board", "https\\://:org.atlassian.net/jira/software/projects/:projectId/boards/:board",
"https\\://:org.atlassian.net/jira/software/projects/:projectId/boards/:board/backlog" "https\\://:org.atlassian.net/jira/software/projects/:projectId/boards/:board/backlog",
], ],
queryParams: { queryParams: {
id: "selectedIssue", id: "selectedIssue",
projectId: "projectKey" projectId: "projectKey",
}, },
description: (document, service, { id }) => { description: (document, service, { id }) => {
const title = const title =
@@ -70,45 +61,38 @@ export default {
.querySelector('[aria-label="Edit Summary"]') .querySelector('[aria-label="Edit Summary"]')
?.parentNode?.querySelector("h1") ?.parentNode?.querySelector("h1")
?.textContent?.trim() || ?.textContent?.trim() ||
document document.querySelector(".ghx-selected .ghx-summary")?.textContent?.trim()
.querySelector(".ghx-selected .ghx-summary")
?.textContent?.trim()
return `#${id} ${title || ""}` return `#${id} ${title || ""}`
} },
}, },
meistertask: { meistertask: {
name: "meistertask", name: "meistertask",
urlPatterns: ["https\\://www.meistertask.com/app/task/:id/:slug"], urlPatterns: ["https\\://www.meistertask.com/app/task/:id/:slug"],
description: document => { description: document => {
const json = const json = document.getElementById("mt-toggl-data")?.dataset?.togglJson || "{}"
document.getElementById("mt-toggl-data")?.dataset?.togglJson || "{}"
const data = JSON.parse(json) const data = JSON.parse(json)
return data.taskName return data.taskName
}, },
projectId: document => { projectId: document => {
const json = const json = document.getElementById("mt-toggl-data")?.dataset?.togglJson || "{}"
document.getElementById("mt-toggl-data")?.dataset?.togglJson || "{}"
const data = JSON.parse(json) const data = JSON.parse(json)
const match = const match = data.taskName?.match(projectRegex) || data.projectName?.match(projectRegex)
data.taskName?.match(projectRegex) ||
data.projectName?.match(projectRegex)
return match && match[1] return match && match[1]
} },
}, },
trello: { trello: {
name: "trello", name: "trello",
urlPatterns: ["https\\://trello.com/c/:id/:title"], urlPatterns: ["https\\://trello.com/c/:id/:title"],
description: (document, service, { title }) => description: (document, service, { title }) =>
document.querySelector(".js-title-helper")?.textContent?.trim() || title document.querySelector(".js-title-helper")?.textContent?.trim() || title,
}, },
youtrack: { youtrack: {
name: "youtrack", name: "youtrack",
urlPatterns: ["https\\://:org.myjetbrains.com/youtrack/issue/:id"], urlPatterns: ["https\\://:org.myjetbrains.com/youtrack/issue/:id"],
description: document => description: document => document.querySelector("yt-issue-body h1")?.textContent?.trim(),
document.querySelector("yt-issue-body h1")?.textContent?.trim()
}, },
wunderlist: { wunderlist: {
@@ -117,6 +101,6 @@ export default {
description: document => description: document =>
document document
.querySelector(".taskItem.selected .taskItem-titleWrapper-title") .querySelector(".taskItem.selected .taskItem-titleWrapper-title")
?.textContent?.trim() ?.textContent?.trim(),
} },
} }