Skip to content

Commit 47135c8

Browse files
larsjehwith-shrey
andauthored
feat(hubspot): Add Hubspot integration (#1843)
* feat(hubspot): Add Hubspot integration * feat(hubspot): Add togglbutton to hubspot ticket --------- Co-authored-by: Shrey Gupta <[email protected]>
1 parent 699dbe8 commit 47135c8

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

src/content/hubspot.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* @name Hubspot
3+
* @urlAlias hubspot.com
4+
* @urlRegex *://*.atlassian.com/*
5+
*/
6+
'use strict';
7+
8+
togglbutton.render(
9+
'div[data-selenium-test="ticket-highlight-details"]:not(.toggl)',
10+
{ observe: true },
11+
$container => {
12+
function descriptionSelector () {
13+
const $description = $('div[data-selenium-test="ticket-highlight-details"] h3');
14+
return $description.textContent.trim();
15+
}
16+
17+
function tagsSelector () {
18+
const pipeline = $('div#pipeline-select') ? $('div#pipeline-select').textContent.trim(): '';
19+
const stage = $('div#stage-select') ? $('div#stage-select').textContent.trim(): '';
20+
21+
return [pipeline, stage];
22+
}
23+
const link = togglbutton.createTimerLink({
24+
className: 'hubspot',
25+
project: 'Hubspot',
26+
description: descriptionSelector,
27+
tags: tagsSelector
28+
});
29+
const rowContainer = document.createElement('div');
30+
rowContainer.setAttribute('class', 'flex-row align-center');
31+
rowContainer.appendChild(link);
32+
$container.appendChild(rowContainer);
33+
}
34+
);

src/origins.js

+5
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,11 @@ export default {
260260
url: '*://habitica.com/*',
261261
name: 'Habitica'
262262
},
263+
'hubspot.com': {
264+
url: '*://app.hubspot.com/*',
265+
name: 'Hubspot',
266+
file: 'hubspot.js'
267+
},
263268
'app.heflo.com': {
264269
url: '*://app.heflo.com/*',
265270
name: 'HEFLO'

src/styles/style.css

+5
Original file line numberDiff line numberDiff line change
@@ -1436,6 +1436,11 @@ body.notion-body.dark .toggl-button.notion {
14361436
margin-top: -7px;
14371437
}
14381438

1439+
/******** HUBSPOT ********/
1440+
.toggl-button.hubspot {
1441+
margin-top: 10px;
1442+
}
1443+
14391444
/********* ZENHUB *********/
14401445
.toggl-button.zenhub {
14411446
padding-left: 25px;

0 commit comments

Comments
 (0)