Skip to content

Commit

Permalink
fix(clickup): Switch subtasks correctly (#2300)
Browse files Browse the repository at this point in the history
* fix(clickup): Switch subtasks correctly

* Update origins.js
  • Loading branch information
with-shrey authored Apr 29, 2024
1 parent 8946b9e commit c447e5b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
24 changes: 18 additions & 6 deletions src/content/clickup.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
/**
* @name ClickUp
* @urlAlias clickup.com
* @urlRegex *://*.clickup.com/*
*/
'use strict';

function getDescription() {
const description = document.querySelector('title').textContent.split('|')[0];
const taskID = document.querySelector('div[role="dialog"]').getAttribute('data-task-id');

return `${description} - #${taskID}`;
}

togglbutton.render('#timeTrackingItem:not(.toggl)', { observe: true }, function (
elem
) {

const description = document.querySelector('title').textContent.split('|')[0];
const taskID = document.querySelector('div[role="dialog"]').getAttribute('data-task-id');

const project = elem.querySelector('.space-name').textContent;
function getProject() {
const project = elem.querySelector('.space-name').textContent;
return project
}

const link = togglbutton.createTimerLink({
className: 'clickup',
description: `${description} - #${taskID}`,
projectName: project,
description: getDescription,
projectName: getProject,
buttonType: 'minimal'
});

Expand Down
3 changes: 2 additions & 1 deletion src/origins.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ export default {
},
'clickup.com': {
url: '*://*.clickup.com/*',
name: 'ClickUp'
name: 'ClickUp',
file: 'clickup.js'
},
'cloudes.me': {
url: '*://*.cloudes.me/*',
Expand Down

0 comments on commit c447e5b

Please sign in to comment.