@rh-support/react-context 0.2.87 → 0.3.0
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 +0 -1
- package/lib/esm/GlobalContextWrapper.d.ts.map +1 -1
- package/lib/esm/components/HostnameAwarenessModal/HostnameAwarenessModal.d.ts.map +1 -1
- package/lib/esm/components/HostnameAwarenessModal/HostnameAwarenessModal.js +2 -2
- package/lib/esm/components/index.d.ts +0 -1
- package/lib/esm/components/index.d.ts.map +1 -1
- package/lib/esm/components/index.js +0 -1
- package/package.json +2 -2
- package/lib/esm/components/EmbeddedServiceChat/EmbeddedServiceChat.d.ts +0 -4
- package/lib/esm/components/EmbeddedServiceChat/EmbeddedServiceChat.d.ts.map +0 -1
- package/lib/esm/components/EmbeddedServiceChat/EmbeddedServiceChat.js +0 -103
- package/lib/esm/components/EmbeddedServiceChat/embeddedServiceChat.css +0 -7
- package/lib/esm/components/EmbeddedServiceChat/index.d.ts +0 -2
- package/lib/esm/components/EmbeddedServiceChat/index.d.ts.map +0 -1
- package/lib/esm/components/EmbeddedServiceChat/index.js +0 -1
|
@@ -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;KACxB;IAED,UAAU,QAAQ;QACd,YAAY,EAAE,GAAG,CAAC;KACrB;CACJ;AA6FD,eAAO,MAAM,oBAAoB,UAAW,MAAM,gBAKjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HostnameAwarenessModal.d.ts","sourceRoot":"","sources":["../../../../src/components/HostnameAwarenessModal/HostnameAwarenessModal.tsx"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAC;AAatC,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"HostnameAwarenessModal.d.ts","sourceRoot":"","sources":["../../../../src/components/HostnameAwarenessModal/HostnameAwarenessModal.tsx"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAC;AAatC,eAAO,MAAM,sBAAsB,mBAmJlC,CAAC"}
|
|
@@ -89,7 +89,7 @@ export const HostnameAwarenessModal = () => {
|
|
|
89
89
|
". We will not capture any information unless you choose to opt in."));
|
|
90
90
|
const modalBody = () => {
|
|
91
91
|
return (React.createElement(React.Fragment, null,
|
|
92
|
-
React.createElement(Switch, { label: "Share hostnames
|
|
92
|
+
React.createElement(Switch, { label: "Share hostnames", isChecked: isHostnamesChecked, onChange: onHostnameSwitchChange, className: "push-top-narrow" }),
|
|
93
93
|
React.createElement(Tooltip, { content: shareHostnamesClarificationCopy, position: "right" },
|
|
94
94
|
React.createElement(InfoIcon, { className: "pf-u-ml-sm hostnameInfoIcon" }))));
|
|
95
95
|
};
|
|
@@ -109,6 +109,6 @@ export const HostnameAwarenessModal = () => {
|
|
|
109
109
|
React.createElement(Checkbox, { label: "Don't ask me again", id: "dont-ask-again", "data-tracking-id": "dont-ask-again-hostname-modal", onClick: onDoNotAskAgain })),
|
|
110
110
|
] },
|
|
111
111
|
React.createElement("div", null,
|
|
112
|
-
React.createElement(Trans, null, "Support does not have access to view hostnames that have been entered on a case. You can
|
|
112
|
+
React.createElement(Trans, null, "Red Hat Support does not currently have access to view your hostnames that have been entered on a case. You can share this information at any time to improve your support experience, or you can ignore this.")),
|
|
113
113
|
modalBody())));
|
|
114
114
|
};
|
|
@@ -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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/react-context",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
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": "df9aba7f875d84c08c533f9ae63c4c7b325fe646"
|
|
93
93
|
}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,103 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/EmbeddedServiceChat/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './EmbeddedServiceChat';
|