-
Notifications
You must be signed in to change notification settings - Fork 569
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
1 parent
699dbe8
commit 47135c8
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters