Skip to content

Commit

Permalink
fix(taiga): Fix taiga.io integration
Browse files Browse the repository at this point in the history
  • Loading branch information
EternallLight committed Jan 24, 2022
1 parent c24a7fe commit ed1d376
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/content/taiga.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
/**
* @name Taiga
* @urlAlias taiga.io
* @urlRegex *://*.taiga.io/*
*/
'use strict';

/* Epic/User story/Task/Issue details button */
togglbutton.render(
'.detail-title-wrapper:not(.toggl)',
{ observe: true },
function (elem) {
const projectElem = $('.us-detail .project-name');
const refElem = $('.detail-number', elem);
const titleElem = $('.detail-subject', elem);
const projectElem = $('tg-legacy-loader').shadowRoot.querySelector('.menu-option-text.project-name');
const refElem = $('.detail-ref', elem);
const titleElem = $('.detail-title-text > span', elem);

const link = togglbutton.createTimerLink({
className: 'taiga',
Expand Down Expand Up @@ -88,7 +93,7 @@ togglbutton.render(
className: 'taiga',
buttonType: 'minimal',
description: refElem.textContent.trim() + ' ' + titleElem.textContent,
projectName: projectElem.textContent
projectName: projectElem ? projectElem.textContent : 'kva'
});

elem.insertBefore(link, $('a', elem));
Expand All @@ -107,7 +112,7 @@ togglbutton.render(
const link = togglbutton.createTimerLink({
className: 'taiga',
buttonType: 'minimal',
projectName: projectElem.textContent,
projectName: projectElem ? projectElem.textContent : 'kva',
description: refElem.textContent.trim() + ' ' + taskElem.textContent
});

Expand Down

0 comments on commit ed1d376

Please sign in to comment.