@rh-support/react-context 0.2.86 → 0.2.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/GlobalContextWrapper.d.ts +1 -0
- package/lib/esm/GlobalContextWrapper.d.ts.map +1 -1
- package/lib/esm/components/EmbeddedServiceChat/EmbeddedServiceChat.d.ts +4 -0
- package/lib/esm/components/EmbeddedServiceChat/EmbeddedServiceChat.d.ts.map +1 -0
- package/lib/esm/components/EmbeddedServiceChat/EmbeddedServiceChat.js +103 -0
- package/lib/esm/components/EmbeddedServiceChat/embeddedServiceChat.css +7 -0
- package/lib/esm/components/EmbeddedServiceChat/index.d.ts +2 -0
- package/lib/esm/components/EmbeddedServiceChat/index.d.ts.map +1 -0
- package/lib/esm/components/EmbeddedServiceChat/index.js +1 -0
- package/lib/esm/components/index.d.ts +1 -0
- package/lib/esm/components/index.d.ts.map +1 -1
- package/lib/esm/components/index.js +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalContextWrapper.d.ts","sourceRoot":"","sources":["../../src/GlobalContextWrapper.tsx"],"names":[],"mappings":"AAoBA,UAAU,MAAM;IACZ,QAAQ,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CACzC;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,SAAS,EAAE,GAAG,CAAC;QACf,oBAAoB,EAAE,GAAG,CAAC;QAC1B,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,OAAA,KAAK,GAAG,KAAK,GAAG,CAAC;QAC9E,MAAM,EAAE,GAAG,CAAC;QACZ,KAAK,EAAE,GAAG,CAAC;QACX,eAAe,EAAE,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"GlobalContextWrapper.d.ts","sourceRoot":"","sources":["../../src/GlobalContextWrapper.tsx"],"names":[],"mappings":"AAoBA,UAAU,MAAM;IACZ,QAAQ,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CACzC;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,SAAS,EAAE,GAAG,CAAC;QACf,oBAAoB,EAAE,GAAG,CAAC;QAC1B,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,OAAA,KAAK,GAAG,KAAK,GAAG,CAAC;QAC9E,MAAM,EAAE,GAAG,CAAC;QACZ,KAAK,EAAE,GAAG,CAAC;QACX,eAAe,EAAE,GAAG,CAAC;QACrB,YAAY,EAAE,GAAG,CAAC;KACrB;IAED,UAAU,QAAQ;QACd,YAAY,EAAE,GAAG,CAAC;KACrB;CACJ;AA6FD,eAAO,MAAM,oBAAoB,UAAW,MAAM,gBAKjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmbeddedServiceChat.d.ts","sourceRoot":"","sources":["../../../../src/components/EmbeddedServiceChat/EmbeddedServiceChat.tsx"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AAGnC,OAAO,EAAE,EAAE,EAAyB,MAAM,OAAO,CAAC;AAWlD,eAAO,MAAM,mBAAmB,EAAE,EAuGjC,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import './embeddedServiceChat.css';
|
|
11
|
+
import { publicApi } from '@cee-eng/hydrajs';
|
|
12
|
+
import { useContext, useEffect } from 'react';
|
|
13
|
+
import { GlobalMetadataStateContext } from '../../context/GlobalMetadataContext';
|
|
14
|
+
export const EmbeddedServiceChat = () => {
|
|
15
|
+
const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
16
|
+
// This effect is require to init chat
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const prepareChatConfig = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
const ssoName = (_a = loggedInUserRights === null || loggedInUserRights === void 0 ? void 0 : loggedInUserRights.data) === null || _a === void 0 ? void 0 : _a.getSSOUsername();
|
|
21
|
+
const name = loggedInUserRights.data.getUserFullName();
|
|
22
|
+
const accountNumber = (_b = loggedInUserRights === null || loggedInUserRights === void 0 ? void 0 : loggedInUserRights.data) === null || _b === void 0 ? void 0 : _b.getAccountNumber();
|
|
23
|
+
const { message: sessionId } = yield publicApi.chat.getChatSession();
|
|
24
|
+
const extraPreChatFormDetails = [
|
|
25
|
+
{
|
|
26
|
+
label: 'SSO Name',
|
|
27
|
+
value: ssoName,
|
|
28
|
+
transcriptFields: ['SSO_Username__c'],
|
|
29
|
+
displayToAgent: true,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: 'SessionId',
|
|
33
|
+
value: sessionId,
|
|
34
|
+
transcriptFields: ['SessionId__c'],
|
|
35
|
+
displayToAgent: true,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: 'name',
|
|
39
|
+
value: name,
|
|
40
|
+
displayToAgent: true,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: 'account',
|
|
44
|
+
value: accountNumber,
|
|
45
|
+
displayToAgent: true,
|
|
46
|
+
},
|
|
47
|
+
// In the next task we need to set `currentCaseNumber` dynamically in chat is being opened in case details view
|
|
48
|
+
// {
|
|
49
|
+
// label: 'currentCaseNumber',
|
|
50
|
+
// value: '01939785',
|
|
51
|
+
// displayToAgent: true,
|
|
52
|
+
// },
|
|
53
|
+
];
|
|
54
|
+
initESW('https://service.force.com', extraPreChatFormDetails);
|
|
55
|
+
});
|
|
56
|
+
prepareChatConfig();
|
|
57
|
+
}, [loggedInUserRights.data]);
|
|
58
|
+
const initESW = (gslbBaseURL, extraPreChatFormDetails) => {
|
|
59
|
+
window.embedded_svc.settings.displayHelpButton = true; //Or false
|
|
60
|
+
window.embedded_svc.settings.language = ''; //For example, enter 'en' or 'en-US'
|
|
61
|
+
window.embedded_svc.settings.enabledFeatures = ['LiveAgent'];
|
|
62
|
+
window.embedded_svc.settings.entryFeature = 'LiveAgent';
|
|
63
|
+
window.embedded_svc.settings.extraPrechatFormDetails = extraPreChatFormDetails;
|
|
64
|
+
window.embedded_svc.settings.extraPrechatInfo = [
|
|
65
|
+
{
|
|
66
|
+
entityFieldMaps: [
|
|
67
|
+
{
|
|
68
|
+
doCreate: false,
|
|
69
|
+
doFind: true,
|
|
70
|
+
fieldName: 'SSO_Username__c',
|
|
71
|
+
isExactMatch: true,
|
|
72
|
+
label: 'SSO Name',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
doCreate: false,
|
|
76
|
+
doFind: true,
|
|
77
|
+
fieldName: 'ContactSessionId__c',
|
|
78
|
+
isExactMatch: false,
|
|
79
|
+
label: 'SessionId',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
doCreate: false,
|
|
83
|
+
doFind: true,
|
|
84
|
+
fieldName: 'Account',
|
|
85
|
+
isExactMatch: true,
|
|
86
|
+
label: 'account',
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
entityName: '',
|
|
90
|
+
saveToTranscript: 'SSO_Username__c',
|
|
91
|
+
},
|
|
92
|
+
];
|
|
93
|
+
window.embedded_svc.init('https://gss--qa.my.salesforce.com', 'https://qa-gssdex.cs203.force.com/botchat', gslbBaseURL, '00D7j0000008oSo', 'RedHatChatBot', {
|
|
94
|
+
baseLiveAgentContentURL: 'https://c.la3-c1cs-ia4.salesforceliveagent.com/content',
|
|
95
|
+
deploymentId: '5727j0000004CqR',
|
|
96
|
+
buttonId: '5737j0000004CKB',
|
|
97
|
+
baseLiveAgentURL: 'https://d.la3-c1cs-ia4.salesforceliveagent.com/chat',
|
|
98
|
+
eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04I7j000000CadEEAS_180b2280b37',
|
|
99
|
+
isOfflineSupportEnabled: false,
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
return null;
|
|
103
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/EmbeddedServiceChat/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './EmbeddedServiceChat';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/react-context",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.87",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"not ie <= 11",
|
|
90
90
|
"not op_mini all"
|
|
91
91
|
],
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "f13b9ffab88047bf60aa9f153c5f2e877a5b5ed2"
|
|
93
93
|
}
|