Skip to content

Commit 9b9620e

Browse files
committed
feat(hubspot): Add togglbutton to hubspot ticket
1 parent d5a1b39 commit 9b9620e

File tree

3 files changed

+26
-13
lines changed

3 files changed

+26
-13
lines changed

src/content/hubspot.js

+16-13
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
1+
/**
2+
* @name Hubspot
3+
* @urlAlias hubspot.com
4+
* @urlRegex *://*.atlassian.com/*
5+
*/
16
'use strict';
2-
/* global togglbutton, $ */
37

48
togglbutton.render(
59
'div[data-selenium-test="ticket-highlight-details"]:not(.toggl)',
610
{ observe: true },
711
$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+
}
823
const link = togglbutton.createTimerLink({
924
className: 'hubspot',
1025
project: 'Hubspot',
@@ -17,15 +32,3 @@ togglbutton.render(
1732
$container.appendChild(rowContainer);
1833
}
1934
);
20-
21-
function descriptionSelector () {
22-
const $description = $('div[data-selenium-test="ticket-highlight-details"] h3');
23-
return $description.textContent.trim();
24-
}
25-
26-
function tagsSelector () {
27-
const pipeline = $('div#pipeline-select').textContent.trim();
28-
const stage = $('div#stage-select').textContent.trim();
29-
30-
return [pipeline, stage];
31-
}

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
@@ -1429,6 +1429,11 @@ body.notion-body.dark .toggl-button.notion {
14291429
margin-top: -7px;
14301430
}
14311431

1432+
/******** HUBSPOT ********/
1433+
.toggl-button.hubspot {
1434+
margin-top: 10px;
1435+
}
1436+
14321437
/********* ZENHUB *********/
14331438
.toggl-button.zenhub {
14341439
padding-left: 25px;

0 commit comments

Comments
 (0)