Skip to content

Commit 699dbe8

Browse files
Freshservice Integration (#2222)
* to be determined * feat(freshservice): Improve styling of toggl button --------- Co-authored-by: Shrey Gupta <[email protected]>
1 parent 2df786a commit 699dbe8

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

src/content/freshservice.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
'use strict';
2+
/**
3+
* @name FreshService
4+
* @urlAlias freshservice.com
5+
* @urlRegex *://*.freshservice.com/*
6+
*/
7+
8+
// Main function
9+
togglbutton.render('.tkt-quick-action:not(.toggl)', { observe: true }, function (elem) {
10+
const titleElem = $('.summary-content .subject-text');
11+
const idElem = $('.ticket-details-breadcrumb h3');
12+
const id = idElem.textContent.replace('#','');
13+
const description = id.trim() + ' ' + titleElem.textContent.trim();
14+
15+
const link = togglbutton.createTimerLink({
16+
className: 'freshservice',
17+
description: description,
18+
projectname: '',
19+
});
20+
21+
elem.prepend(link);
22+
}
23+
);

src/origins.js

+5
Original file line numberDiff line numberDiff line change
@@ -690,5 +690,10 @@ export default {
690690
'zube.io': {
691691
url: '*://zube.io/*',
692692
name: 'Zube'
693+
},
694+
'freshservice.com': {
695+
url: '*://*.freshservice.com/*',
696+
name: 'Freshservice',
697+
file: 'freshservice.js'
693698
}
694699
};

src/styles/style.css

+7
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,13 @@ li > .toggl-button.phabricator {
871871
left: 5px;
872872
}
873873

874+
875+
/********* FRESHSERVICE *********/
876+
.toggl-button.freshservice {
877+
margin-top: 5px;
878+
margin-right: 10px;
879+
}
880+
874881
/********* Clickup *********/
875882
.toggl-button.clickup.min svg,
876883
.toggl-button.clickup.min span {

0 commit comments

Comments
 (0)