Added Freshdesk app interface
This commit is contained in:
parent
87bac432c8
commit
0d4a56eba7
17
.gitignore
vendored
17
.gitignore
vendored
@ -1,4 +1,19 @@
|
||||
/server/node_modules/
|
||||
/server/ka.db
|
||||
/client/node_modules/
|
||||
keys.txt
|
||||
|
||||
|
||||
keys.txt
|
||||
|
||||
|
||||
/fd-client/DS_Store
|
||||
/fd-client/fdk/
|
||||
/fd-client/coverage/
|
||||
/fd-client/report.json
|
||||
/fd-client/vscode/
|
||||
/fd-client/node_modules/
|
||||
/fd-client/test_data/
|
||||
/fd-client/dist/
|
||||
/fd-client/config/oauth_config.json
|
||||
/fd-client/config/iparam_test_data.json
|
||||
/fd-client/log/
|
||||
|
||||
1
fd-client/.fdk/configs.json
Normal file
1
fd-client/.fdk/configs.json
Normal file
@ -0,0 +1 @@
|
||||
{"request":{"timeout":15000},"job":{"timeout":120000},"global_apps":{"enabled":"true"}}
|
||||
1
fd-client/.fdk/localstore
Normal file
1
fd-client/.fdk/localstore
Normal file
@ -0,0 +1 @@
|
||||
{"fd_cli_101_101_migrate_oauth_status":true,"report_hash":"8ee96e64b8a3f4c5139f4c95c579919721a060b0421ea476a0870b7403a8245e"}
|
||||
BIN
fd-client/.fdk/store.sqlite
Normal file
BIN
fd-client/.fdk/store.sqlite
Normal file
Binary file not shown.
476
fd-client/.report.json
Normal file
476
fd-client/.report.json
Normal file
@ -0,0 +1,476 @@
|
||||
{
|
||||
"lints": [
|
||||
{
|
||||
"severity": 1,
|
||||
"value": "app\\scripts\\app.js::6: 'client' declared and assigned in different scopes. Possible asynchronous race condition.",
|
||||
"type": "custom-js-lint"
|
||||
},
|
||||
{
|
||||
"severity": 1,
|
||||
"value": "app\\scripts\\app.js::21: Expected rejection to be handled.",
|
||||
"type": "custom-js-lint"
|
||||
},
|
||||
{
|
||||
"severity": 1,
|
||||
"value": "app\\scripts\\app.js::91: 'isExpanded' declared and assigned in different scopes. Possible asynchronous race condition.",
|
||||
"type": "custom-js-lint"
|
||||
},
|
||||
{
|
||||
"severity": 1,
|
||||
"value": "app\\scripts\\app.js::106: Expected rejection to be handled.",
|
||||
"type": "custom-js-lint"
|
||||
}
|
||||
],
|
||||
"coverage": {
|
||||
"app\\scripts\\app.js": {
|
||||
"path": "app\\scripts\\app.js",
|
||||
"statementMap": {
|
||||
"0": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 91,
|
||||
"column": 3
|
||||
}
|
||||
},
|
||||
"1": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 90,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"2": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 41
|
||||
}
|
||||
},
|
||||
"3": {
|
||||
"start": {
|
||||
"line": 5,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"4": {
|
||||
"start": {
|
||||
"line": 8,
|
||||
"column": 25
|
||||
},
|
||||
"end": {
|
||||
"line": 59,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"5": {
|
||||
"start": {
|
||||
"line": 62,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 62,
|
||||
"column": 64
|
||||
}
|
||||
},
|
||||
"6": {
|
||||
"start": {
|
||||
"line": 65,
|
||||
"column": 21
|
||||
},
|
||||
"end": {
|
||||
"line": 65,
|
||||
"column": 57
|
||||
}
|
||||
},
|
||||
"7": {
|
||||
"start": {
|
||||
"line": 66,
|
||||
"column": 21
|
||||
},
|
||||
"end": {
|
||||
"line": 66,
|
||||
"column": 64
|
||||
}
|
||||
},
|
||||
"8": {
|
||||
"start": {
|
||||
"line": 67,
|
||||
"column": 22
|
||||
},
|
||||
"end": {
|
||||
"line": 67,
|
||||
"column": 66
|
||||
}
|
||||
},
|
||||
"9": {
|
||||
"start": {
|
||||
"line": 68,
|
||||
"column": 24
|
||||
},
|
||||
"end": {
|
||||
"line": 68,
|
||||
"column": 64
|
||||
}
|
||||
},
|
||||
"10": {
|
||||
"start": {
|
||||
"line": 69,
|
||||
"column": 23
|
||||
},
|
||||
"end": {
|
||||
"line": 69,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"11": {
|
||||
"start": {
|
||||
"line": 71,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 83,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"12": {
|
||||
"start": {
|
||||
"line": 72,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 72,
|
||||
"column": 33
|
||||
}
|
||||
},
|
||||
"13": {
|
||||
"start": {
|
||||
"line": 74,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 82,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"14": {
|
||||
"start": {
|
||||
"line": 75,
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 75,
|
||||
"column": 39
|
||||
}
|
||||
},
|
||||
"15": {
|
||||
"start": {
|
||||
"line": 76,
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 76,
|
||||
"column": 42
|
||||
}
|
||||
},
|
||||
"16": {
|
||||
"start": {
|
||||
"line": 77,
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 77,
|
||||
"column": 38
|
||||
}
|
||||
},
|
||||
"17": {
|
||||
"start": {
|
||||
"line": 79,
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 79,
|
||||
"column": 39
|
||||
}
|
||||
},
|
||||
"18": {
|
||||
"start": {
|
||||
"line": 80,
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 80,
|
||||
"column": 41
|
||||
}
|
||||
},
|
||||
"19": {
|
||||
"start": {
|
||||
"line": 81,
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 81,
|
||||
"column": 38
|
||||
}
|
||||
},
|
||||
"20": {
|
||||
"start": {
|
||||
"line": 87,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 89,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"21": {
|
||||
"start": {
|
||||
"line": 88,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 88,
|
||||
"column": 40
|
||||
}
|
||||
}
|
||||
},
|
||||
"fnMap": {
|
||||
"0": {
|
||||
"name": "(anonymous_0)",
|
||||
"decl": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 46
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 47
|
||||
}
|
||||
},
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 58
|
||||
},
|
||||
"end": {
|
||||
"line": 91,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"line": 1
|
||||
},
|
||||
"1": {
|
||||
"name": "(anonymous_1)",
|
||||
"decl": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 25
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 43
|
||||
},
|
||||
"end": {
|
||||
"line": 90,
|
||||
"column": 3
|
||||
}
|
||||
},
|
||||
"line": 2
|
||||
},
|
||||
"2": {
|
||||
"name": "injectKBDrawer",
|
||||
"decl": {
|
||||
"start": {
|
||||
"line": 7,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 7,
|
||||
"column": 27
|
||||
}
|
||||
},
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 7,
|
||||
"column": 30
|
||||
},
|
||||
"end": {
|
||||
"line": 84,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"line": 7
|
||||
},
|
||||
"3": {
|
||||
"name": "(anonymous_3)",
|
||||
"decl": {
|
||||
"start": {
|
||||
"line": 71,
|
||||
"column": 39
|
||||
},
|
||||
"end": {
|
||||
"line": 71,
|
||||
"column": 40
|
||||
}
|
||||
},
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 71,
|
||||
"column": 51
|
||||
},
|
||||
"end": {
|
||||
"line": 83,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"line": 71
|
||||
},
|
||||
"4": {
|
||||
"name": "(anonymous_4)",
|
||||
"decl": {
|
||||
"start": {
|
||||
"line": 87,
|
||||
"column": 35
|
||||
},
|
||||
"end": {
|
||||
"line": 87,
|
||||
"column": 36
|
||||
}
|
||||
},
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 87,
|
||||
"column": 51
|
||||
},
|
||||
"end": {
|
||||
"line": 89,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"line": 87
|
||||
}
|
||||
},
|
||||
"branchMap": {
|
||||
"0": {
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 74,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 82,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"type": "if",
|
||||
"locations": [
|
||||
{
|
||||
"start": {
|
||||
"line": 74,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 82,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
{
|
||||
"start": {
|
||||
"line": 78,
|
||||
"column": 15
|
||||
},
|
||||
"end": {
|
||||
"line": 82,
|
||||
"column": 9
|
||||
}
|
||||
}
|
||||
],
|
||||
"line": 74
|
||||
}
|
||||
},
|
||||
"s": {
|
||||
"0": 8,
|
||||
"1": 8,
|
||||
"2": 7,
|
||||
"3": 7,
|
||||
"4": 7,
|
||||
"5": 7,
|
||||
"6": 7,
|
||||
"7": 7,
|
||||
"8": 7,
|
||||
"9": 7,
|
||||
"10": 7,
|
||||
"11": 7,
|
||||
"12": 0,
|
||||
"13": 0,
|
||||
"14": 0,
|
||||
"15": 0,
|
||||
"16": 0,
|
||||
"17": 0,
|
||||
"18": 0,
|
||||
"19": 0,
|
||||
"20": 7,
|
||||
"21": 7
|
||||
},
|
||||
"f": {
|
||||
"0": 8,
|
||||
"1": 7,
|
||||
"2": 7,
|
||||
"3": 0,
|
||||
"4": 7
|
||||
},
|
||||
"b": {
|
||||
"0": [
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
"_coverageSchema": "1a1c01bbd47fc00a2c39e90264f33305004495a9",
|
||||
"hash": "62a764b53a2397355729862d774423d12cc8d951"
|
||||
}
|
||||
},
|
||||
"coverageSummary": {
|
||||
"lines": {
|
||||
"total": 22,
|
||||
"covered": 14,
|
||||
"skipped": 0,
|
||||
"pct": 63.63
|
||||
},
|
||||
"statements": {
|
||||
"total": 22,
|
||||
"covered": 14,
|
||||
"skipped": 0,
|
||||
"pct": 63.63
|
||||
},
|
||||
"functions": {
|
||||
"total": 5,
|
||||
"covered": 4,
|
||||
"skipped": 0,
|
||||
"pct": 80
|
||||
},
|
||||
"branches": {
|
||||
"total": 2,
|
||||
"covered": 0,
|
||||
"skipped": 0,
|
||||
"pct": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
20
fd-client/README.md
Normal file
20
fd-client/README.md
Normal file
@ -0,0 +1,20 @@
|
||||
## Your First App
|
||||
|
||||
This app displays the name of the requester of a freshdesk ticket in the ticket_sidebar placeholder
|
||||
|
||||
### Files and Folders
|
||||
.
|
||||
├── README.md A file for your future self and developer friends to learn about app
|
||||
├── app A folder to place all assets required for frontend components
|
||||
│ ├── index.html A landing page for the user to use the app
|
||||
│ ├── scripts JavaScript to place files frontend components business logic
|
||||
│ │ └── app.js
|
||||
│ └── styles A folder to place all the styles for app
|
||||
│ ├── images
|
||||
│ │ └── icon.svg
|
||||
│ └── style.css
|
||||
├── config A folder to place all the configuration files
|
||||
│ └── iparams.json
|
||||
└── manifest.json A JSON file holding meta data for app to run on platform
|
||||
|
||||
Explore [more of app sample apps](https://community.developers.freshworks.com/t/freshworks-sample-apps/3604) on the Freshworks github respository.
|
||||
22
fd-client/app/index.html
Normal file
22
fd-client/app/index.html
Normal file
@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Knowledge Base</title>
|
||||
<link rel="stylesheet" href="styles/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="kb-container">
|
||||
<div class="kb-header">
|
||||
<button id="insert-ka-btn">Attach KA</button>
|
||||
</div>
|
||||
<iframe
|
||||
id="kb-iframe"
|
||||
src="http://localhost:5173"
|
||||
frameborder="0"
|
||||
></iframe>
|
||||
</div>
|
||||
<script src="https://static.freshdev.io/fdk/2.0/assets/fresh_client.js"></script>
|
||||
<script src="scripts/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
10
fd-client/app/scripts/app.js
Normal file
10
fd-client/app/scripts/app.js
Normal file
@ -0,0 +1,10 @@
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
app.initialized().then(function (client) {
|
||||
console.log('KB initialized');
|
||||
|
||||
document.getElementById('insert-ka-btn').addEventListener('click', function() {
|
||||
alert('Insert KA# - to be implemented');
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
14
fd-client/app/styles/images/icon.svg
Normal file
14
fd-client/app/styles/images/icon.svg
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="64px" height="64px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
|
||||
<path d="M56.7,257c0-100.5,81.8-182.2,182.2-182.2h210.5c20.5-0.7,37-16.6,38.9-36.7H238.9C118.2,38,20,136.2,20,257
|
||||
c0,120.7,98.2,219,218.9,219s219-98.2,219-219V118.6c0-9.9-7.3-18.3-17.6-18.4c0,0-174.9,0-189.9,0c-115.2,0-178.5,91.1-168.6,185.2
|
||||
c9.1,86.2,68.8,143.7,146.4,153.4C132.7,433.2,56.7,353.8,56.7,257z M191.9,294.8c0.6,1.6,1.4,3.1,2.1,4.7
|
||||
c7.1,13.6,16.7,25.1,27.8,33.9c-4.3,5.9-10,10.5-17,13.2c-21.9,8.5-47.5-5.2-57.2-30.6c-8.4-22-2-45.5,14.1-56.9
|
||||
c2.3-43.1,29.2-82.9,71.7-99.3c42.4-16.4,88.6-5,118.9,25.2c19.9-3.1,40.9,10.2,49.4,32.7c8.8,23.2,1.3,48.1-16.8,58.7
|
||||
c0,0.1,0,0.3,0,0.4c-0.1-0.1-0.3-0.1-0.4-0.1c-1.6,0.9-3.2,1.7-4.9,2.4c-4.3,1.7-8.7,2.4-13.1,2.4c-2.3,19.9-9.9,38.8-21.9,54.8
|
||||
c1.4,3.5,1,7.6-1.6,10.7l-9.5,11.6c-3.7,4.6-10.3,5.3-14.8,1.6c-4.5-3.7-5.2-10.4-1.6-14.9l9.5-11.6c2.6-3.2,6.6-4.5,10.4-3.7
|
||||
c10.3-14.4,16.9-31.7,19.3-49.6h-0.1c0.1-0.6,0.2-1.1,0.3-1.7c1.5-12.5,3.1-25.2,0.3-37.4c0,0-0.9-5.1-1.7-7.1
|
||||
c-0.2-0.7-0.4-1.3-0.7-2c-17.2-45.3-67.6-67.9-112.4-50.5C197.1,198.7,174.7,249.5,191.9,294.8z" fill="#404543"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
45
fd-client/app/styles/style.css
Normal file
45
fd-client/app/styles/style.css
Normal file
@ -0,0 +1,45 @@
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.kb-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.kb-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 12px 16px;
|
||||
background-color: #2c3e50;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.kb-header h3 {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.kb-header button {
|
||||
background-color: #27ae60;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 8px 16px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.kb-header button:hover {
|
||||
background-color: #229954;
|
||||
}
|
||||
|
||||
#kb-iframe {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
border: none;
|
||||
}
|
||||
1
fd-client/config/iparams.json
Normal file
1
fd-client/config/iparams.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
||||
17
fd-client/manifest.json
Normal file
17
fd-client/manifest.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"platform-version": "3.0",
|
||||
"modules": {
|
||||
"support_ticket": {
|
||||
"location": {
|
||||
"ticket_conversation_editor": {
|
||||
"url": "index.html",
|
||||
"icon": "styles/images/icon.svg"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": "18.20.2",
|
||||
"fdk": "9.7.3"
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user