@unite-us/app-create-referral 0.3.4 → 0.3.5
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/dist/api/config.js
CHANGED
|
@@ -11,7 +11,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
|
11
11
|
_Object$defineProperty(exports, "__esModule", {
|
|
12
12
|
value: true
|
|
13
13
|
});
|
|
14
|
-
exports.initApp = exports.coreAxiosInstance = exports.coreApi = exports.FEATURE_FLAGS = exports.COMPONENTS = exports.CALLBACKS = exports.APP_ENVIRONMENT = void 0;
|
|
14
|
+
exports.initApp = exports.coreAxiosInstance = exports.coreApi = exports.INITIAL_ADDRESSES = exports.FEATURE_FLAGS = exports.COMPONENTS = exports.CALLBACKS = exports.APP_ENVIRONMENT = void 0;
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
16
16
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
17
17
|
var _axios = _interopRequireDefault(require("axios"));
|
|
@@ -22,6 +22,7 @@ var APP_ENVIRONMENT = exports.APP_ENVIRONMENT = {};
|
|
|
22
22
|
var CALLBACKS = exports.CALLBACKS = {};
|
|
23
23
|
var COMPONENTS = exports.COMPONENTS = {};
|
|
24
24
|
var FEATURE_FLAGS = exports.FEATURE_FLAGS = {};
|
|
25
|
+
var INITIAL_ADDRESSES = exports.INITIAL_ADDRESSES = {};
|
|
25
26
|
var coreAxiosInstance;
|
|
26
27
|
var coreApi;
|
|
27
28
|
function setupAxiosInstanceDefaults(url) {
|
|
@@ -40,7 +41,8 @@ function setupAxiosInstanceDefaults(url) {
|
|
|
40
41
|
}
|
|
41
42
|
var initApp = exports.initApp = function initApp(appSettings, callbacks, components) {
|
|
42
43
|
var env = appSettings.env,
|
|
43
|
-
feature_flags = appSettings.feature_flags
|
|
44
|
+
feature_flags = appSettings.feature_flags,
|
|
45
|
+
initialAddresses = appSettings.initialAddresses;
|
|
44
46
|
// SETTING UP APP ENVIRONMENT
|
|
45
47
|
// {
|
|
46
48
|
// getAuthToken: function, used for setting the Authorization header on requests
|
|
@@ -98,6 +100,7 @@ var initApp = exports.initApp = function initApp(appSettings, callbacks, compone
|
|
|
98
100
|
// The JSONAPIAdapter object is used to make HTTP requests
|
|
99
101
|
// and handle the serialization/deserialization of data in the JSON API format.
|
|
100
102
|
exports.coreApi = coreApi = new _jsonApiResources.JSONAPIAdapter(coreAxiosInstance, serializer);
|
|
103
|
+
exports.INITIAL_ADDRESSES = INITIAL_ADDRESSES = initialAddresses;
|
|
101
104
|
return true;
|
|
102
105
|
};
|
|
103
106
|
//# sourceMappingURL=config.js.map
|
package/dist/api/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":["_axios","_interopRequireDefault","require","_jsonApiResources","ownKeys","e","r","t","_Object$keys","_Object$getOwnPropertySymbols","o","_filterInstanceProperty","call","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","APP_ENVIRONMENT","exports","CALLBACKS","COMPONENTS","FEATURE_FLAGS","coreAxiosInstance","coreApi","setupAxiosInstanceDefaults","url","instance","axios","create","baseURL","defaults","headers","employeeId","providerId","interceptors","request","use","config","Authorization","concat","getAuthToken","error","_promise","reject","initApp","appSettings","callbacks","components","env","feature_flags","trackEventCallback","Error","notify","trackEvent","onReferralCompleted","onNavigateBack","onSaveDraftReferral","onDeselectProgram","onSubmitConsent","consent","Consent","coreUrl","serializer","buildSerializer","JSONAPIDeserializerInterceptor","buildJSONAPIDeserializerInterceptor","response","JSONAPIAdapter"],"sources":["../../src/api/config.js"],"sourcesContent":["/* eslint-disable import/no-mutable-exports */\n/* eslint-disable no-param-reassign */\n// eslint-disable import/no-mutable-exports\nimport axios from 'axios';\nimport {\n buildSerializer,\n buildJSONAPIDeserializerInterceptor,\n JSONAPIAdapter,\n} from '@unite-us/json-api-resources';\n\nlet APP_ENVIRONMENT = {};\n\nlet CALLBACKS = {};\nlet COMPONENTS = {};\nlet FEATURE_FLAGS = {};\n\nlet coreAxiosInstance;\nlet coreApi;\n\nfunction setupAxiosInstanceDefaults(url) {\n const instance = axios.create({ baseURL: url });\n instance.defaults.headers['X-EMPLOYEE-ID'] = APP_ENVIRONMENT.employeeId;\n instance.defaults.headers['X-PROVIDER-ID'] = APP_ENVIRONMENT.providerId;\n instance.interceptors.request.use(\n (config) => {\n config.headers.Authorization = `Bearer ${APP_ENVIRONMENT.getAuthToken()}`;\n return config;\n },\n (error) => Promise.reject(error),\n );\n return instance;\n}\n\nconst initApp = (appSettings, callbacks, components) => {\n const {\n env,\n feature_flags,\n } = appSettings;\n // SETTING UP APP ENVIRONMENT\n // {\n // getAuthToken: function, used for setting the Authorization header on requests\n // employeeId: string, used for setting the X-EMPLOYEE-ID header on requests\n // providerId: string, used for setting the X-PROVIDER-ID header on requests\n // isEmr: boolean: used for determining if the app is running is EMR\n // },\n APP_ENVIRONMENT = { ...env };\n\n if (!callbacks.trackEventCallback) {\n throw new Error('trackEventCallback is required in order to run APP-CREATE-REFERRAL');\n }\n CALLBACKS = {\n // notify callback is used to display notifications to the user,\n // usually toasts\n // expect the following shape for the 'notify' object:\n // {\n // success: PropTypes.func,\n // error: PropTypes.func,\n // warn: PropTypes.func,\n // }\n notify: callbacks.notify,\n // TrackEvent to send analytics event\n trackEvent: callbacks.trackEvent,\n // Function called after the referral is created (Review step)\n onReferralCompleted: callbacks.onReferralCompleted,\n // Called on Add Resources step and back button to navigate back to Search\n onNavigateBack: callbacks.onNavigateBack,\n // Function called to redirect after saving a draft referral\n onSaveDraftReferral: callbacks.onSaveDraftReferral,\n // Update Search shopping cart when removing a program.\n onDeselectProgram: callbacks.onDeselectProgram,\n // Function called after the consent form is submitted (Review step)\n onSubmitConsent: callbacks.onSubmitConsent,\n // Functions called in ConsentDialog\n consent: callbacks.consent,\n };\n\n COMPONENTS = {\n Consent: components?.consent,\n };\n\n FEATURE_FLAGS = { ...feature_flags };\n\n coreAxiosInstance = setupAxiosInstanceDefaults(env.coreUrl);\n\n // SETTING UP CORE ENDPOINT\n // creates a new serializer object using the buildSerializer() function.\n // Serializers are used to convert JavaScript objects into JSON API format and vice versa\n const serializer = buildSerializer();\n // creates a new interceptor object that deserializes JSON API responses.\n // Interceptors are used to modify HTTP requests and responses.\n const JSONAPIDeserializerInterceptor = buildJSONAPIDeserializerInterceptor(serializer);\n // adds the interceptor to the Axios instance's response interceptors.\n // This means that the JSONAPIDeserializerInterceptor\n // will be applied to all responses received by the instance.\n coreAxiosInstance.interceptors.response.use(JSONAPIDeserializerInterceptor);\n // This line creates a new JSONAPIAdapter object using the Axios instance and serializer objects.\n // The JSONAPIAdapter object is used to make HTTP requests\n // and handle the serialization/deserialization of data in the JSON API format.\n coreApi = new JSONAPIAdapter(coreAxiosInstance, serializer);\n\n return true;\n};\n\nexport {\n initApp,\n coreAxiosInstance,\n coreApi,\n APP_ENVIRONMENT,\n CALLBACKS,\n COMPONENTS,\n FEATURE_FLAGS,\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAIsC,SAAAE,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAH,CAAA,OAAAI,6BAAA,QAAAC,CAAA,GAAAD,6BAAA,CAAAJ,CAAA,GAAAC,CAAA,KAAAI,CAAA,GAAAC,uBAAA,CAAAD,CAAA,EAAAE,IAAA,CAAAF,CAAA,YAAAJ,CAAA,WAAAO,gCAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAG,CAAA,YAAAH,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAgB,MAAA,CAAAb,CAAA,OAAAc,OAAA,WAAAf,CAAA,QAAAgB,gBAAA,CAAAC,OAAA,EAAAlB,CAAA,EAAAC,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAkB,iCAAA,GAAAC,wBAAA,CAAApB,CAAA,EAAAmB,iCAAA,CAAAjB,CAAA,KAAAH,OAAA,CAAAgB,MAAA,CAAAb,CAAA,GAAAc,OAAA,WAAAf,CAAA,IAAAoB,sBAAA,CAAArB,CAAA,EAAAC,CAAA,EAAAO,gCAAA,CAAAN,CAAA,EAAAD,CAAA,iBAAAD,CAAA,IARtC,+CACA,uCACA;AAQA,IAAIsB,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,CAAC,CAAC;AAExB,IAAIE,SAAS,GAAAD,OAAA,CAAAC,SAAA,GAAG,CAAC,CAAC;AAClB,IAAIC,UAAU,GAAAF,OAAA,CAAAE,UAAA,GAAG,CAAC,CAAC;AACnB,IAAIC,aAAa,GAAAH,OAAA,CAAAG,aAAA,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","names":["_axios","_interopRequireDefault","require","_jsonApiResources","ownKeys","e","r","t","_Object$keys","_Object$getOwnPropertySymbols","o","_filterInstanceProperty","call","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","APP_ENVIRONMENT","exports","CALLBACKS","COMPONENTS","FEATURE_FLAGS","INITIAL_ADDRESSES","coreAxiosInstance","coreApi","setupAxiosInstanceDefaults","url","instance","axios","create","baseURL","defaults","headers","employeeId","providerId","interceptors","request","use","config","Authorization","concat","getAuthToken","error","_promise","reject","initApp","appSettings","callbacks","components","env","feature_flags","initialAddresses","trackEventCallback","Error","notify","trackEvent","onReferralCompleted","onNavigateBack","onSaveDraftReferral","onDeselectProgram","onSubmitConsent","consent","Consent","coreUrl","serializer","buildSerializer","JSONAPIDeserializerInterceptor","buildJSONAPIDeserializerInterceptor","response","JSONAPIAdapter"],"sources":["../../src/api/config.js"],"sourcesContent":["/* eslint-disable import/no-mutable-exports */\n/* eslint-disable no-param-reassign */\n// eslint-disable import/no-mutable-exports\nimport axios from 'axios';\nimport {\n buildSerializer,\n buildJSONAPIDeserializerInterceptor,\n JSONAPIAdapter,\n} from '@unite-us/json-api-resources';\n\nlet APP_ENVIRONMENT = {};\n\nlet CALLBACKS = {};\nlet COMPONENTS = {};\nlet FEATURE_FLAGS = {};\nlet INITIAL_ADDRESSES = {};\n\n\nlet coreAxiosInstance;\nlet coreApi;\n\nfunction setupAxiosInstanceDefaults(url) {\n const instance = axios.create({ baseURL: url });\n instance.defaults.headers['X-EMPLOYEE-ID'] = APP_ENVIRONMENT.employeeId;\n instance.defaults.headers['X-PROVIDER-ID'] = APP_ENVIRONMENT.providerId;\n instance.interceptors.request.use(\n (config) => {\n config.headers.Authorization = `Bearer ${APP_ENVIRONMENT.getAuthToken()}`;\n return config;\n },\n (error) => Promise.reject(error),\n );\n return instance;\n}\n\nconst initApp = (appSettings, callbacks, components) => {\n const {\n env,\n feature_flags,\n initialAddresses\n } = appSettings;\n // SETTING UP APP ENVIRONMENT\n // {\n // getAuthToken: function, used for setting the Authorization header on requests\n // employeeId: string, used for setting the X-EMPLOYEE-ID header on requests\n // providerId: string, used for setting the X-PROVIDER-ID header on requests\n // isEmr: boolean: used for determining if the app is running is EMR\n // },\n APP_ENVIRONMENT = { ...env };\n\n if (!callbacks.trackEventCallback) {\n throw new Error('trackEventCallback is required in order to run APP-CREATE-REFERRAL');\n }\n CALLBACKS = {\n // notify callback is used to display notifications to the user,\n // usually toasts\n // expect the following shape for the 'notify' object:\n // {\n // success: PropTypes.func,\n // error: PropTypes.func,\n // warn: PropTypes.func,\n // }\n notify: callbacks.notify,\n // TrackEvent to send analytics event\n trackEvent: callbacks.trackEvent,\n // Function called after the referral is created (Review step)\n onReferralCompleted: callbacks.onReferralCompleted,\n // Called on Add Resources step and back button to navigate back to Search\n onNavigateBack: callbacks.onNavigateBack,\n // Function called to redirect after saving a draft referral\n onSaveDraftReferral: callbacks.onSaveDraftReferral,\n // Update Search shopping cart when removing a program.\n onDeselectProgram: callbacks.onDeselectProgram,\n // Function called after the consent form is submitted (Review step)\n onSubmitConsent: callbacks.onSubmitConsent,\n // Functions called in ConsentDialog\n consent: callbacks.consent,\n };\n\n COMPONENTS = {\n Consent: components?.consent,\n };\n\n FEATURE_FLAGS = { ...feature_flags };\n\n coreAxiosInstance = setupAxiosInstanceDefaults(env.coreUrl);\n\n // SETTING UP CORE ENDPOINT\n // creates a new serializer object using the buildSerializer() function.\n // Serializers are used to convert JavaScript objects into JSON API format and vice versa\n const serializer = buildSerializer();\n // creates a new interceptor object that deserializes JSON API responses.\n // Interceptors are used to modify HTTP requests and responses.\n const JSONAPIDeserializerInterceptor = buildJSONAPIDeserializerInterceptor(serializer);\n // adds the interceptor to the Axios instance's response interceptors.\n // This means that the JSONAPIDeserializerInterceptor\n // will be applied to all responses received by the instance.\n coreAxiosInstance.interceptors.response.use(JSONAPIDeserializerInterceptor);\n // This line creates a new JSONAPIAdapter object using the Axios instance and serializer objects.\n // The JSONAPIAdapter object is used to make HTTP requests\n // and handle the serialization/deserialization of data in the JSON API format.\n coreApi = new JSONAPIAdapter(coreAxiosInstance, serializer);\n\n INITIAL_ADDRESSES = initialAddresses;\n\n return true;\n};\n\nexport {\n initApp,\n coreAxiosInstance,\n coreApi,\n APP_ENVIRONMENT,\n CALLBACKS,\n COMPONENTS,\n FEATURE_FLAGS,\n INITIAL_ADDRESSES\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAA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ider = require("../../context/AppCreateReferralProvider");
|
|
24
24
|
var _utils = require("../builder/utils");
|
|
25
25
|
var _CreateReferralContainer = _interopRequireDefault(require("../../components/CreateReferralContainer"));
|
|
26
|
+
var _useFeatureFlag = require("../../utils/useFeatureFlag");
|
|
26
27
|
function _getRequireWildcardCache(e) { if ("function" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
27
28
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
28
29
|
function ReferralsSent(_ref) {
|
|
@@ -53,6 +54,7 @@ function ReferralsSent(_ref) {
|
|
|
53
54
|
});
|
|
54
55
|
setSelectedProgramsWithName(programsWithName);
|
|
55
56
|
}, [referrals]);
|
|
57
|
+
var hint1199IsAppSharesWithSearchApi = (0, _useFeatureFlag.useFeatureFlag)('hint1199IsAppSharesWithSearchApi', false);
|
|
56
58
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CreateReferralContainer.default, {
|
|
57
59
|
isStepReferralSent: true
|
|
58
60
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -104,7 +106,9 @@ function ReferralsSent(_ref) {
|
|
|
104
106
|
},
|
|
105
107
|
resourceType: "program",
|
|
106
108
|
resources: selectedProgramsWithName,
|
|
107
|
-
providerId: _config.APP_ENVIRONMENT.providerId
|
|
109
|
+
providerId: _config.APP_ENVIRONMENT.providerId,
|
|
110
|
+
showAddressDropdown: hint1199IsAppSharesWithSearchApi,
|
|
111
|
+
initialAddresses: _config.INITIAL_ADDRESSES
|
|
108
112
|
})))));
|
|
109
113
|
}
|
|
110
114
|
//# sourceMappingURL=ReferralsSent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReferralsSent.js","names":["_ui","require","_lodash","_react","_interopRequireWildcard","_constants","_config","_sharesUtils","_AppCreateReferralProvider","_utils","_CreateReferralContainer","_interopRequireDefault","_getRequireWildcardCache","e","_WeakMap","r","t","__esModule","_typeof","default","has","get","n","__proto__","a","_Object$defineProperty","_Object$getOwnPropertyDescriptor","u","Object","prototype","hasOwnProperty","call","i","set","ReferralsSent","_ref","referrals","_useAppCreateReferral","useAppCreateReferralContext","currentEmployee","state","_useState","useState","_useState2","_slicedToArray2","shareDrawerOpen","setShareDrawerOpen","_useState3","_useState4","selectedProgramsWithName","setSelectedProgramsWithName","hasOnlyOONReferrals","every","referral","referralIsOON","useEffect","newReferrals","compact","referralsWithPrograms","_toConsumableArray2","_set","_flatMap","programs","programsWithName","_map","program","id","name","createElement","Fragment","isStepReferralSent","className","NEXT_STEPS","item","key","Button","onClick","CALLBACKS","onReferralCompleted","label","iconLeft","Icon","icon","color","primary","ShareDrawer","employeeId","coreApi","SHARES_URL","APP_ENVIRONMENT","sharesUrl","show","onClose","resourceType","resources","providerId"],"sources":["../../../src/pages/review/ReferralsSent.js"],"sourcesContent":["import { Button, Icon } from '@unite-us/ui';\nimport { compact, every } from 'lodash';\nimport React, { useState, useEffect } from 'react';\nimport {\n
|
|
1
|
+
{"version":3,"file":"ReferralsSent.js","names":["_ui","require","_lodash","_react","_interopRequireWildcard","_constants","_config","_sharesUtils","_AppCreateReferralProvider","_utils","_CreateReferralContainer","_interopRequireDefault","_useFeatureFlag","_getRequireWildcardCache","e","_WeakMap","r","t","__esModule","_typeof","default","has","get","n","__proto__","a","_Object$defineProperty","_Object$getOwnPropertyDescriptor","u","Object","prototype","hasOwnProperty","call","i","set","ReferralsSent","_ref","referrals","_useAppCreateReferral","useAppCreateReferralContext","currentEmployee","state","_useState","useState","_useState2","_slicedToArray2","shareDrawerOpen","setShareDrawerOpen","_useState3","_useState4","selectedProgramsWithName","setSelectedProgramsWithName","hasOnlyOONReferrals","every","referral","referralIsOON","useEffect","newReferrals","compact","referralsWithPrograms","_toConsumableArray2","_set","_flatMap","programs","programsWithName","_map","program","id","name","hint1199IsAppSharesWithSearchApi","useFeatureFlag","createElement","Fragment","isStepReferralSent","className","NEXT_STEPS","item","key","Button","onClick","CALLBACKS","onReferralCompleted","label","iconLeft","Icon","icon","color","primary","ShareDrawer","employeeId","coreApi","SHARES_URL","APP_ENVIRONMENT","sharesUrl","show","onClose","resourceType","resources","providerId","showAddressDropdown","initialAddresses","INITIAL_ADDRESSES"],"sources":["../../../src/pages/review/ReferralsSent.js"],"sourcesContent":["import { Button, Icon } from '@unite-us/ui';\nimport { compact, every } from 'lodash';\nimport React, { useState, useEffect } from 'react';\nimport {\n NEXT_STEPS\n} from '../builder/constants';\nimport { CALLBACKS, APP_ENVIRONMENT, INITIAL_ADDRESSES } from '../../api/config';\nimport { coreApi } from '../../api/config';\nimport { ShareDrawer } from '@unite-us/shares-utils';\nimport { useAppCreateReferralContext } from '../../context/AppCreateReferralProvider';\nimport { referralIsOON } from '../builder/utils';\nimport CreateReferralContainer from '../../components/CreateReferralContainer';\nimport { useFeatureFlag } from '../../utils/useFeatureFlag';\n\nexport default function ReferralsSent({ referrals }) {\n const { state: { currentEmployee } } = useAppCreateReferralContext();\n const [shareDrawerOpen, setShareDrawerOpen] = useState(false);\n const [selectedProgramsWithName, setSelectedProgramsWithName] = useState([]);\n const hasOnlyOONReferrals = every(referrals, (referral) => referralIsOON(referral));\n\n useEffect(() => {\n const newReferrals = compact(referrals);\n const referralsWithPrograms = [...new Set(newReferrals.flatMap((r) => r.programs))];\n const programsWithName = referralsWithPrograms.map(program => ({\n id: program.id, name: program.name\n }));\n setSelectedProgramsWithName(programsWithName);\n }, [referrals]);\n\n const hint1199IsAppSharesWithSearchApi = useFeatureFlag('hint1199IsAppSharesWithSearchApi', false);\n\n return (\n <>\n <CreateReferralContainer isStepReferralSent={true}>\n <div className='flex justify-around'>\n <div className='py-20 bg-white w-4/6'>\n <h1 className='text-5xl my-3 text-center font-bold'>Referrals Successfully Created!</h1>\n\n <div className='w-10/12 p-4 pb-4 text-center mx-auto bg-white-grey border border-solid\n border-table-border-color rounded'>\n <h1 className='font-black text-center text-xl pb-5'>Next Steps</h1>\n <div className='text-left'>\n {NEXT_STEPS.map((item) => (\n <li key={item}>{item}</li>\n ))}\n </div>\n </div>\n\n <div className='flex justify-center gap-4 mt-8'>\n <Button\n id=\"dashboard\"\n onClick={() => {\n CALLBACKS.onReferralCompleted({ hasOnlyOONReferrals });\n }}\n className=\"font-semibold normal-case w-64 border-solid border-blue-border\"\n label=\"Go to my Dashboard\"\n />\n\n <Button\n id=\"share\"\n iconLeft={<Icon icon=\"IconMailForward\" color=\"white\" />}\n onClick={() => {\n setShareDrawerOpen(true);\n }}\n primary\n className=\"font-semibold bg-current-blue normal-case w-64\"\n label=\"Share Programs\"\n />\n </div>\n\n <ShareDrawer\n employeeId={currentEmployee?.id}\n coreApi={coreApi}\n SHARES_URL={APP_ENVIRONMENT.sharesUrl}\n show={shareDrawerOpen}\n onClose={() => setShareDrawerOpen(false)}\n resourceType=\"program\"\n resources={selectedProgramsWithName}\n providerId={APP_ENVIRONMENT.providerId}\n showAddressDropdown={hint1199IsAppSharesWithSearchApi}\n initialAddresses={INITIAL_ADDRESSES}\n />\n </div>\n </div>\n </CreateReferralContainer>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAGA,IAAAK,OAAA,GAAAL,OAAA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3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"author": "Alex Morales",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@unite-us/client-utils": "^3.0.1959",
|
|
8
8
|
"@unite-us/json-api-resources": "1.2.3",
|
|
9
|
-
"@unite-us/shares-utils": "0.
|
|
9
|
+
"@unite-us/shares-utils": "0.3.1",
|
|
10
10
|
"@unite-us/surveyjs": "^0.10.28",
|
|
11
11
|
"@unite-us/ui": "^3.0.1950",
|
|
12
12
|
"axios": "0.27.2",
|