Add support for WRIKE
This commit is contained in:
@@ -10,6 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Add support for starting/stopping a timer
|
- Add support for starting/stopping a timer
|
||||||
- Show hours as HH:MM or decimal in the Bubble, depending on setting in MOCO
|
- Show hours as HH:MM or decimal in the Bubble, depending on setting in MOCO
|
||||||
|
|
||||||
|
## [1.2.0] - 2019-04-26
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Add support for wrike.com
|
||||||
|
|
||||||
## [1.1.5] - 2019-04-24
|
## [1.1.5] - 2019-04-24
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "moco-browser-extensions",
|
"name": "moco-browser-extensions",
|
||||||
"description": "Browser plugin for MOCO",
|
"description": "Browser plugin for MOCO",
|
||||||
"version": "1.1.5",
|
"version": "1.2.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "yarn start:chrome",
|
"start": "yarn start:chrome",
|
||||||
|
|||||||
@@ -68,6 +68,7 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
background-color: rgba(0, 0, 0, 0.4);
|
background-color: rgba(0, 0, 0, 0.4);
|
||||||
|
z-index: 9999;
|
||||||
|
|
||||||
.moco-bx-popup-content {
|
.moco-bx-popup-content {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
|
|||||||
@@ -95,6 +95,25 @@ export default {
|
|||||||
description: document => document.querySelector("yt-issue-body h1")?.textContent?.trim(),
|
description: document => document.querySelector("yt-issue-body h1")?.textContent?.trim(),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
wrike: {
|
||||||
|
name: "wrike",
|
||||||
|
urlPatterns: [
|
||||||
|
"https\\://www.wrike.com/workspace.htm#path=mywork",
|
||||||
|
"https\\://www.wrike.com/workspace.htm#path=folder",
|
||||||
|
],
|
||||||
|
queryParams: {
|
||||||
|
id: ["t", "ot"],
|
||||||
|
},
|
||||||
|
description: document => document.querySelector(".title-field-ghost")?.textContent?.trim(),
|
||||||
|
projectId: document => {
|
||||||
|
const match = document
|
||||||
|
.querySelector(".header-title__main")
|
||||||
|
?.textContent?.trim()
|
||||||
|
?.match(projectRegex)
|
||||||
|
return match && match[1]
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
wunderlist: {
|
wunderlist: {
|
||||||
name: "wunderlist",
|
name: "wunderlist",
|
||||||
urlPatterns: ["https\\://www.wunderlist.com/(webapp)#/tasks/:id(/*)"],
|
urlPatterns: ["https\\://www.wunderlist.com/(webapp)#/tasks/:id(/*)"],
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export const ERROR_UPGRADE_REQUIRED = "upgrade-required"
|
|||||||
export const ERROR_UNKNOWN = "unknown"
|
export const ERROR_UNKNOWN = "unknown"
|
||||||
|
|
||||||
export const noop = () => null
|
export const noop = () => null
|
||||||
|
export const asArray = input => (Array.isArray(input) ? input : [input])
|
||||||
|
|
||||||
export const findProjectBy = prop => val => projects => {
|
export const findProjectBy = prop => val => projects => {
|
||||||
if (!val) {
|
if (!val) {
|
||||||
|
|||||||
@@ -1,10 +1,28 @@
|
|||||||
import UrlPattern from "url-pattern"
|
import UrlPattern from "url-pattern"
|
||||||
import { isFunction, isUndefined, compose, toPairs, map, pipe } from "lodash/fp"
|
import { isFunction, isUndefined, compose, toPairs, map, pipe, isNil } from "lodash/fp"
|
||||||
|
import { asArray } from "./index"
|
||||||
import queryString from "query-string"
|
import queryString from "query-string"
|
||||||
|
|
||||||
const extractQueryParams = (queryParams, query) => {
|
function parseUrl(url) {
|
||||||
return toPairs(queryParams).reduce((acc, [key, param]) => {
|
const urlObject = new URL(url)
|
||||||
acc[key] = query[param]
|
const { origin, pathname, search } = urlObject
|
||||||
|
let { hash } = urlObject
|
||||||
|
const query = {
|
||||||
|
...queryString.parse(search),
|
||||||
|
...queryString.parse(hash),
|
||||||
|
}
|
||||||
|
if (hash) {
|
||||||
|
hash = hash.match(/#[^&]+/)[0]
|
||||||
|
}
|
||||||
|
return { origin, pathname, hash, query }
|
||||||
|
}
|
||||||
|
|
||||||
|
function extractQueryParams(queryParams, query) {
|
||||||
|
return toPairs(queryParams).reduce((acc, [key, params]) => {
|
||||||
|
const param = asArray(params).find(param => !isNil(query[param]))
|
||||||
|
if (param) {
|
||||||
|
acc[key] = query[param]
|
||||||
|
}
|
||||||
return acc
|
return acc
|
||||||
}, {})
|
}, {})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user