Skip to content

Commit

Permalink
fix(clickup): Switch subtasks correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
with-shrey committed Apr 22, 2024
1 parent 8946b9e commit 83168b0
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/content/clickup.js
@@ -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

0 comments on commit 83168b0

Please sign in to comment.