@rh-support/react-context 0.2.87 → 0.3.2

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,7 +9,6 @@ declare global {
9
9
  portal: any;
10
10
  Raven: any;
11
11
  chrometwo_ready: any;
12
- embedded_svc: any;
13
12
  }
14
13
  interface Document {
15
14
  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;QACrB,YAAY,EAAE,GAAG,CAAC;KACrB;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":"AAmBA,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"}
@@ -8,9 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { accounts, Config } from '@cee-eng/hydrajs';
11
- import { setSecuredSupport, setStrataHeaders } from '@rh-support/api';
12
11
  import { LoginModal } from '@rh-support/components';
13
- import { getApiResourceObject } from '@rh-support/utils';
12
+ import { getApiResourceObject, setSecuredSupport, setStrataHeaders } from '@rh-support/utils';
14
13
  import isEmpty from 'lodash/isEmpty';
15
14
  import React, { useEffect, useState } from 'react';
16
15
  import { GlobalMetadataContextProvider, GlobalMetadataDispatchContext } from './context/GlobalMetadataContext';
@@ -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 with support", isChecked: isHostnamesChecked, onChange: onHostnameSwitchChange, className: "push-top-narrow" }),
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 choose to share hostnames at any time for a smoother support experience.")),
112
+ React.createElement(Trans, null, "Red Hat Support cannot currently access 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
  };
@@ -4,5 +4,4 @@ export * from './AccountSelector';
4
4
  export * from './NewFeatureAnnouncement';
5
5
  export * from './SharedModals';
6
6
  export * from './HostnameAwarenessModal';
7
- export * from './EmbeddedServiceChat';
8
7
  //# 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;AACzC,cAAc,uBAAuB,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"}
@@ -4,4 +4,3 @@ 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.87",
3
+ "version": "0.3.2",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -29,13 +29,12 @@
29
29
  "@cee-eng/hydrajs": "4.12.7",
30
30
  "@patternfly/react-core": "4.202.16",
31
31
  "@patternfly/react-icons": "4.53.16",
32
- "@rh-support/api": "0.3.9",
33
32
  "@rh-support/components": "^0.1.3",
34
33
  "@rh-support/types": "^0.1.3",
35
34
  "@rh-support/user-permissions": "^0.1.3",
36
35
  "@rh-support/utils": "^0.1.3",
37
36
  "i18next": "^19.0.1",
38
- "lodash": "^4.17.15",
37
+ "lodash": "^4.17.21",
39
38
  "react": "17.0.2",
40
39
  "react-dom": "17.0.2",
41
40
  "react-i18next": "^11.2.5",
@@ -45,14 +44,13 @@
45
44
  "@cee-eng/hydrajs": "4.12.7",
46
45
  "@patternfly/react-core": "4.202.16",
47
46
  "@patternfly/react-icons": "4.53.16",
48
- "@rh-support/api": "0.3.25",
49
- "@rh-support/components": "1.1.80",
47
+ "@rh-support/components": "1.1.82",
50
48
  "@rh-support/types": "0.2.0",
51
- "@rh-support/user-permissions": "0.2.64",
52
- "@rh-support/utils": "0.2.47",
49
+ "@rh-support/user-permissions": "0.2.66",
50
+ "@rh-support/utils": "0.2.49",
53
51
  "i18next": "^19.0.1",
54
52
  "localforage": "^1.7.3",
55
- "lodash": "^4.17.15",
53
+ "lodash": "^4.17.21",
56
54
  "react": "17.0.2",
57
55
  "react-dom": "17.0.2",
58
56
  "react-i18next": "^11.2.5",
@@ -89,5 +87,5 @@
89
87
  "not ie <= 11",
90
88
  "not op_mini all"
91
89
  ],
92
- "gitHead": "f13b9ffab88047bf60aa9f153c5f2e877a5b5ed2"
90
+ "gitHead": "f69fb5ac2a9d8561d300a9e7f02456268d1e2fc7"
93
91
  }
@@ -1,4 +0,0 @@
1
- import './embeddedServiceChat.css';
2
- import { FC } from 'react';
3
- export declare const EmbeddedServiceChat: FC;
4
- //# sourceMappingURL=EmbeddedServiceChat.d.ts.map
@@ -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,7 +0,0 @@
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
- }
@@ -1,2 +0,0 @@
1
- export * from './EmbeddedServiceChat';
2
- //# sourceMappingURL=index.d.ts.map
@@ -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';