Skip to content

Commit

Permalink
feat(hubspot): Add Hubspot integration (#1843)
Browse files Browse the repository at this point in the history
* feat(hubspot): Add Hubspot integration

* feat(hubspot): Add togglbutton to hubspot ticket

---------

Co-authored-by: Shrey Gupta <[email protected]>
  • Loading branch information
larsjeh and with-shrey authored Mar 5, 2024
1 parent 699dbe8 commit 47135c8
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/content/hubspot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* @name Hubspot
* @urlAlias hubspot.com
* @urlRegex *://*.atlassian.com/*
*/
'use strict';

togglbutton.render(
'div[data-selenium-test="ticket-highlight-details"]:not(.toggl)',
{ observe: true },
$container => {
function descriptionSelector () {
const $description = $('div[data-selenium-test="ticket-highlight-details"] h3');
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',
project: 'Hubspot',
description: descriptionSelector,
tags: tagsSelector
});
const rowContainer = document.createElement('div');
rowContainer.setAttribute('class', 'flex-row align-center');
rowContainer.appendChild(link);
$container.appendChild(rowContainer);
}
);
5 changes: 5 additions & 0 deletions src/origins.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ export default {
url: '*://habitica.com/*',
name: 'Habitica'
},
'hubspot.com': {
url: '*://app.hubspot.com/*',
name: 'Hubspot',
file: 'hubspot.js'
},
'app.heflo.com': {
url: '*://app.heflo.com/*',
name: 'HEFLO'
Expand Down
5 changes: 5 additions & 0 deletions src/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1436,6 +1436,11 @@ body.notion-body.dark .toggl-button.notion {
margin-top: -7px;
}

/******** HUBSPOT ********/
.toggl-button.hubspot {
margin-top: 10px;
}

/********* ZENHUB *********/
.toggl-button.zenhub {
padding-left: 25px;
Expand Down

0 comments on commit 47135c8

Please sign in to comment.