File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+ /* global togglbutton, $ */
3
+
4
+ togglbutton . render (
5
+ 'div[data-selenium-test="ticket-highlight-details"]:not(.toggl)' ,
6
+ { observe : true } ,
7
+ $container => {
8
+ const link = togglbutton . createTimerLink ( {
9
+ className : 'hubspot' ,
10
+ project : 'Hubspot' ,
11
+ description : descriptionSelector ,
12
+ tags : tagsSelector
13
+ } ) ;
14
+ const rowContainer = document . createElement ( 'div' ) ;
15
+ rowContainer . setAttribute ( 'class' , 'flex-row align-center' ) ;
16
+ rowContainer . appendChild ( link ) ;
17
+ $container . appendChild ( rowContainer ) ;
18
+ }
19
+ ) ;
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
+ }
You can’t perform that action at this time.
0 commit comments