@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.
@@ -9,6 +9,7 @@ declare global {
9
9
  portal: any;
10
10
  Raven: any;
11
11
  chrometwo_ready: any;
12
+ embedded_svc: any;
12
13
  }
13
14
  interface Document {
14
15
  documentMode: any;
@@ -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;KACxB;IAED,UAAU,QAAQ;QACd,YAAY,EAAE,GAAG,CAAC;KACrB;CACJ;AA6FD,eAAO,MAAM,oBAAoB,UAAW,MAAM,gBAKjD,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,4 @@
1
+ import './embeddedServiceChat.css';
2
+ import { FC } from 'react';
3
+ export declare const EmbeddedServiceChat: FC;
4
+ //# sourceMappingURL=EmbeddedServiceChat.d.ts.map
@@ -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,7 @@
1
+ .embeddedServiceHelpButton .helpButton .uiButton {
2
+ background-color: #005290;
3
+ font-family: 'Arial', sans-serif;
4
+ }
5
+ .embeddedServiceHelpButton .helpButton .uiButton:focus {
6
+ outline: 1px solid #005290;
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from './EmbeddedServiceChat';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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';
@@ -4,4 +4,5 @@ export * from './AccountSelector';
4
4
  export * from './NewFeatureAnnouncement';
5
5
  export * from './SharedModals';
6
6
  export * from './HostnameAwarenessModal';
7
+ export * from './EmbeddedServiceChat';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -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"}
@@ -4,3 +4,4 @@ export * from './AccountSelector';
4
4
  export * from './NewFeatureAnnouncement';
5
5
  export * from './SharedModals';
6
6
  export * from './HostnameAwarenessModal';
7
+ export * from './EmbeddedServiceChat';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/react-context",
3
- "version": "0.2.86",
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": "d0acd5aa52cbe047dd35da3e11118827ae427f26"
92
+ "gitHead": "f13b9ffab88047bf60aa9f153c5f2e877a5b5ed2"
93
93
  }