From 29e454e97fb5164ec83f07d3f90d5eef98998c60 Mon Sep 17 00:00:00 2001 From: Shrey Gupta Date: Fri, 27 Sep 2024 15:52:40 +0530 Subject: [PATCH] feat(hubspot): Update config to work generic --- src/content/hubspot.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/content/hubspot.js b/src/content/hubspot.js index 9574969bf..114bdaaf5 100644 --- a/src/content/hubspot.js +++ b/src/content/hubspot.js @@ -5,8 +5,9 @@ */ 'use strict'; +// This generic implementation works for most objects details page togglbutton.render( - 'div[data-selenium-test$="-highlight-details"]:not(.toggl)', + 'div[data-selenium-component="ProfileHighlightContainer"] [data-selenium-test="highlightTitle"]:not(.toggl)', { observe: true }, $container => { try { @@ -15,22 +16,15 @@ togglbutton.render( return $description.textContent.trim(); } - function tagsSelector() { - const pipeline = $('div#pipeline-select') ? $('div#pipeline-select').textContent.trim() : ''; - const stage = $('div#stage-select') ? $('div#stage-select').textContent.trim() : ''; - - return [pipeline, stage]; - } - const link = togglbutton.createTimerLink({ className: 'hubspot', description: descriptionSelector, - tags: tagsSelector }); const rowContainer = document.createElement('div'); rowContainer.setAttribute('class', 'flex-row align-center'); rowContainer.appendChild(link); - $container.parentNode.appendChild(rowContainer); + const cardContainer = $('[data-selenium-test="highlightTitle"]') + cardContainer.parentNode.parentNode.appendChild(rowContainer); } catch (e) { console.error(e) }