Skip to content

Commit

Permalink
fix(wrike): Fix integration on new UI
Browse files Browse the repository at this point in the history
Closes #1922
  • Loading branch information
Alissonsz committed Nov 14, 2023
1 parent 80bd205 commit c0c2422
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 6 additions & 5 deletions src/content/wrike.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@

'use strict';


togglbutton.render(
'task-title:not(.toggl)',
'work-item-title:not(.toggl)',
{ observe: true },
function (elem) {
const container = document.querySelector('settings-bar-content')
const container = document.querySelector('action-panel')
const viewContainer = document.querySelector('entity-view')

const getTitleElement = function () {
const wsTaskTitle = document.querySelectorAll('task-title');
const wsTaskTitle = elem.querySelectorAll('task-title');
if (wsTaskTitle.length === 1 && wsTaskTitle[0].textContent !== '') {
return wsTaskTitle[0];
}
Expand All @@ -25,7 +26,7 @@ togglbutton.render(
const titleElem = getTitleElement();
const titleElemText = titleElem ? titleElem.textContent : 'not found';

return `${viewContainer.querySelector('author').firstChild.textContent} ${titleElemText.trim().replace(' - Wrike', '')}`.trim();
return `${titleElemText.trim().replace(' - Wrike', '')}`.trim();
};

const projectText = function () {
Expand All @@ -40,6 +41,6 @@ togglbutton.render(
projectName: projectText
});

container.append(link);
container.prepend(link);
}
);
5 changes: 3 additions & 2 deletions src/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -766,13 +766,14 @@ a.toggl-button.toggl-plan {
/********* WRIKE *********/
.toggl-button.wrike {
display: flex !important;
height: 24px;
height: 100%;
align-items: center;
font-size: 12px;
gap: 4px;
text-decoration: none;
color: rgb(80, 79, 79);
padding: 0 0 0 16px;
padding: 0 16px 0 0;
text-wrap: nowrap;
}

/********* ASSEMBLA *********/
Expand Down

0 comments on commit c0c2422

Please sign in to comment.