@os1-platform/console-ui-react 0.1.6 → 0.1.8
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/commonjs/aaa/index.js +17 -16
- package/dist/commonjs/aaa/index.js.map +1 -1
- package/dist/commonjs/components/modal/interface.js.map +1 -1
- package/dist/commonjs/components/toast/interface.js.map +1 -1
- package/dist/commonjs/types/aaa/index.d.ts +2 -2
- package/dist/commonjs/types/components/modal/interface.d.ts +1 -5
- package/dist/commonjs/types/components/toast/interface.d.ts +1 -7
- package/package.json +2 -2
- package/readme.md +17 -27
|
@@ -76,7 +76,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
76
76
|
exports.OS1HttpClient = exports.OS1Modal = exports.OS1Toast = exports.OS1Provider = exports.ConsoleUIContext = exports.AuthContext = void 0;
|
|
77
77
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
78
78
|
var console_ui_js_1 = require("@os1-platform/console-ui-js");
|
|
79
|
-
Object.defineProperty(exports, "OS1HttpClient", { enumerable: true, get: function () { return console_ui_js_1.
|
|
79
|
+
Object.defineProperty(exports, "OS1HttpClient", { enumerable: true, get: function () { return console_ui_js_1.OS1HttpClient; } });
|
|
80
80
|
var react_1 = __importStar(require("react"));
|
|
81
81
|
var axios_1 = __importDefault(require("axios"));
|
|
82
82
|
exports.AuthContext = react_1.default.createContext(undefined);
|
|
@@ -85,7 +85,7 @@ var HeaderAndSideBar = function (props) {
|
|
|
85
85
|
var _a = (0, react_1.useState)(null), consoleInstance = _a[0], setConsoleInstance = _a[1];
|
|
86
86
|
(0, react_1.useEffect)(function () {
|
|
87
87
|
if (!props.isLoading) {
|
|
88
|
-
var console_1 = console_ui_js_1.ConsoleUiInit.getInstance(props.clientId, props.loginRedirectPath, props.logoutRedirectPath, props.
|
|
88
|
+
var console_1 = console_ui_js_1.ConsoleUiInit.getInstance(props.clientId, props.loginRedirectPath, props.logoutRedirectPath, props.authurl, props.devOrgName, props.appId, props.userManager);
|
|
89
89
|
setConsoleInstance(console_1);
|
|
90
90
|
console_1.renderHeaderAndSidebar('headerAndSidebar', props.controls);
|
|
91
91
|
}
|
|
@@ -261,6 +261,7 @@ var OS1Provider2 = function (props) {
|
|
|
261
261
|
isMountedRef.current = false;
|
|
262
262
|
};
|
|
263
263
|
}, [window.location, userManager]);
|
|
264
|
+
console.log(props);
|
|
264
265
|
return ((0, jsx_runtime_1.jsx)(exports.AuthContext.Provider, __assign({ value: value }, { children: (0, jsx_runtime_1.jsx)(HeaderAndSideBar, __assign({ userManager: userManager, isLoading: isLoading, loader: props.loader, devOrgName: props.devOrgName, controls: props.controls, appId: props.appId, authUrl: props.authUrl }, { children: props.props.children })) })));
|
|
265
266
|
};
|
|
266
267
|
var hasCodeInUrl = function (location) {
|
|
@@ -289,28 +290,28 @@ var cleanBrowserUrl = function () {
|
|
|
289
290
|
};
|
|
290
291
|
// export { Toast, Modal };
|
|
291
292
|
var OS1Toast = function (props) {
|
|
292
|
-
var
|
|
293
|
-
var
|
|
293
|
+
var _a, _b;
|
|
294
|
+
var _c = (0, react_1.useState)((_b = (_a = props.consoleInstance.authInitializer) === null || _a === void 0 ? void 0 : _a.client) === null || _b === void 0 ? void 0 : _b._settings), consoleClient = _c[0], setConsoleClient = _c[1];
|
|
294
295
|
(0, react_1.useEffect)(function () {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
var console = console_ui_js_1.ConsoleUiInit.getInstance(props.clientId, props.loginRedirectPath, props.logoutRedirectPath, props.devOrgName, authUrl, props.appId);
|
|
296
|
+
// if (consoleInstance) {
|
|
297
|
+
// setAuthUrl(consoleInstance.authInitializer?.client?._settings._authority);
|
|
298
|
+
// }
|
|
299
|
+
var console = console_ui_js_1.ConsoleUiInit.getInstance(consoleClient._client_id, consoleClient._redirect_uri, consoleClient._post_logout_redirect_uri, consoleClient._authority);
|
|
300
300
|
console.renderToast(props.elementId, props.toastConfig);
|
|
301
301
|
}, []);
|
|
302
302
|
return (0, jsx_runtime_1.jsx)("div", { id: props.elementId });
|
|
303
303
|
};
|
|
304
304
|
exports.OS1Toast = OS1Toast;
|
|
305
305
|
var OS1Modal = function (props) {
|
|
306
|
-
var
|
|
307
|
-
|
|
306
|
+
var _a, _b;
|
|
307
|
+
// const consoleInstance = React.useContext(ConsoleUIContext);
|
|
308
|
+
// const [authUrl, setAuthUrl] = useState('');
|
|
309
|
+
var _c = (0, react_1.useState)((_b = (_a = props.consoleInstance.authInitializer) === null || _a === void 0 ? void 0 : _a.client) === null || _b === void 0 ? void 0 : _b._settings), consoleClient = _c[0], setConsoleClient = _c[1];
|
|
308
310
|
(0, react_1.useEffect)(function () {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
var console = console_ui_js_1.ConsoleUiInit.getInstance(props.clientId, props.loginRedirectPath, props.logoutRedirectPath, props.devOrgName, authUrl, props.appId);
|
|
311
|
+
// if (consoleInstance) {
|
|
312
|
+
// setAuthUrl(consoleInstance.authInitializer?.client?._settings._authority);
|
|
313
|
+
// }
|
|
314
|
+
var console = console_ui_js_1.ConsoleUiInit.getInstance(consoleClient._client_id, consoleClient._redirect_uri, consoleClient._post_logout_redirect_uri, consoleClient._authority);
|
|
314
315
|
console.renderModal('modal-ele', props.modalConfig);
|
|
315
316
|
}, []);
|
|
316
317
|
return (0, jsx_runtime_1.jsx)("div", { id: "modal-ele" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/aaa/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAA6E;AA6TrB,8FA7T3B,0BAAU,OA6T8B;AA5TrE,6CAA2D;AAG3D,gDAA0B;AAEb,QAAA,WAAW,GAAG,eAAK,CAAC,aAAa,CAAkB,SAAS,CAA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B,4BAAQ;AAtB9B,IAAM,QAAQ,GAAG,UAAC,KAAiB;IACjC,IAAM,eAAe,GAAG,eAAK,CAAC,UAAU,CAAC,wBAAgB,CAAC,CAAC;IACrD,IAAA,KAAwB,IAAA,gBAAQ,EAAC,EAAE,CAAC,EAAnC,OAAO,QAAA,EAAE,UAAU,QAAgB,CAAC;IAE3C,IAAA,iBAAS,EAAC;;QACR,IAAI,eAAe,EAAE;YACnB,UAAU,CAAC,MAAA,MAAA,eAAe,CAAC,eAAe,0CAAE,MAAM,0CAAE,SAAS,CAAC,UAAU,CAAC,CAAC;SAC3E;QACD,IAAM,OAAO,GAAG,6BAAa,CAAC,WAAW,CACvC,KAAK,CAAC,QAAQ,EACd,KAAK,CAAC,iBAAiB,EACvB,KAAK,CAAC,kBAAkB,EACxB,KAAK,CAAC,UAAU,EAChB,OAAO,EACP,KAAK,CAAC,KAAK,CACZ,CAAC;QACF,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACtD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,gCAAK,EAAE,EAAC,WAAW,GAAO,CAAC;AACpC,CAAC,CAAC;AAE8B,4BAAQ","sourcesContent":["import { AAA, ConsoleUiInit, HttpClient } from '@os1-platform/console-ui-js';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { ModalProps } from '../components/modal/interface';\nimport { ToastProps } from '../components/toast/interface';\nimport axios from 'axios';\n\nexport const AuthContext = React.createContext<any | undefined>(undefined);\nexport const ConsoleUIContext = React.createContext<any>(undefined);\n\nconst HeaderAndSideBar = (props: any) => {\n const [consoleInstance, setConsoleInstance] = useState<any>(null);\n\n useEffect(() => {\n if (!props.isLoading) {\n const console = ConsoleUiInit.getInstance(\n props.clientId,\n props.loginRedirectPath,\n props.logoutRedirectPath,\n props.devOrgName,\n props.authurl,\n props.appId,\n props.userManager\n );\n\n setConsoleInstance(console);\n console.renderHeaderAndSidebar('headerAndSidebar', props.controls);\n }\n }, [props.isLoading]);\n\n if (props.isLoading) {\n if (props.loader) {\n return props.loader;\n } else {\n const keyframes = `\n @-webkit-keyframes spin {\n 0% {\n -webkit-transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n }\n }\n `;\n const styleSheets = Array.from(document.styleSheets).filter(\n (styleSheet) =>\n !styleSheet.href || styleSheet.href.startsWith(window.location.origin)\n );\n for (let style of styleSheets) {\n if (style instanceof CSSStyleSheet && style.cssRules) {\n style.insertRule(keyframes, style.cssRules.length);\n }\n }\n const loaderStyle = () => ({\n marginTop: '50vh',\n marginLeft: '50vw',\n border: '12px solid #F3F3F3',\n borderRadius: '50%',\n borderTop: '12px solid grey',\n width: '40px',\n height: '40px',\n animationName: 'spin',\n animationDuration: '2s',\n animationTimingFunction: 'linear',\n animationIterationCount: 'infinite',\n });\n return <div style={loaderStyle()}></div>;\n }\n }\n //console.log(consoleInstance, props);\n return (\n <ConsoleUIContext.Provider value={consoleInstance}>\n <div id=\"headerAndSidebar\">{props.children}</div>\n </ConsoleUIContext.Provider>\n );\n};\n\ninterface TenantDTO {\n tenantId: string;\n tenantStatus: string;\n tenantDns: string;\n stackId: string;\n stackName: string;\n organizationShortName: string;\n organizationBaseDomain: string;\n stackAuthUrl: string;\n}\n\nconst getCleanedDomain = (domain: string) => {\n const cleanedDomain = String(domain);\n const splitHost = cleanedDomain.split('.');\n const org = splitHost[0] || '';\n const cleanedOrg = org.replace('-cdev', '');\n const base = splitHost.join('.');\n return { orgShortName: cleanedOrg, baseDomain: base };\n};\n\nconst getTenantFromDevPortal = async (\n orgShortName: any\n): Promise<TenantDTO> => {\n const url = `https://api.getos1.com/app/core-api/tenant?orgShortName=${orgShortName}`;\n const response = await axios.get(url);\n return response.data.data;\n};\n\nconst getTenantId = (devOrgNameArg: string | null = null): string => {\n let devOrgName = devOrgNameArg;\n //if (!devOrgNameArg) devOrgName = getAuthConfig().devOrgName;\n\n const hostname = window.location.hostname || null;\n\n return hostname\n ? (hostname.split('.')[0] == 'developer' ||\n hostname.split('.')[0] == 'developer2' ||\n hostname.split('.')[0].includes('-cdev')) &&\n devOrgName\n ? devOrgName\n : hostname.split('.')[0]\n : '';\n};\n\nconst getKeyCloakAuthority = async (domain: string, devOrgName: string) => {\n let orgName: string = '';\n let baseDomainName: string = '';\n\n if (devOrgName != undefined) {\n orgName = devOrgName;\n baseDomainName = domain.substring(domain.indexOf('.'));\n } else {\n const { orgShortName, baseDomain } = getCleanedDomain(domain);\n\n orgName = orgShortName;\n baseDomainName = baseDomain;\n }\n\n if (baseDomainName.includes('os1')) {\n const tenant = await getTenantFromDevPortal(orgName);\n\n return `${tenant.stackAuthUrl}/auth/realms/${tenant.tenantId}`;\n }\n\n const tenantId = getTenantId(orgName);\n //console.log(tenantId);\n return `https://keycloak${baseDomainName}/auth/realms/${tenantId}`;\n};\n\nconst OS1Provider = (props: any) => {\n const [authUrl, setAuthUrl] = useState('');\n // const [tenantDns, setTenantDns] = useState('');\n // let isMountedRef = useRef<boolean>(false);\n\n let authUrls = '';\n useEffect(() => {\n (async function () {\n authUrls = await getKeyCloakAuthority(\n window.location.hostname,\n props.devOrgName\n );\n setAuthUrl(authUrls);\n })();\n }, []);\n\n return (\n <OS1Provider2\n clientId={props.clientId}\n loginRedirectPath={props.loginRedirectPath}\n logoutRedirectPath={props.logoutRedirectPath}\n devOrgName={props.devOrgName}\n appId={props.appId}\n controls={props.controls}\n authUrl={authUrl}\n props={...props}\n />\n );\n};\nconst OS1Provider2 = (props: any) => {\n //console.log(props);\n const userManager = new AAA(\n props.clientId,\n props.loginRedirectPath,\n props.logoutRedirectPath,\n props.devOrgName,\n props.authUrl\n );\n const value = '';\n //console.log('userManager', userManager);\n const [isLoading, setIsLoading] = useState(true);\n let isMountedRef = useRef<boolean>(false);\n\n useEffect(() => {\n // Store current isMounted since this could change while awaiting async operations below\n isMountedRef.current = true;\n (async () => {\n let user = undefined;\n try {\n user = await userManager!.getUserInfo();\n } catch (error: any) {\n window.console.log('Error: ', error);\n }\n /**\n * Check if the user is returning back from OIDC.\n */\n if (hasCodeInUrl(window.location)) {\n await userManager?.logincallback();\n cleanBrowserUrl();\n setIsLoading(false);\n return;\n }\n\n if (!(await userManager?.isAuthenticated())) {\n userManager?.login();\n } else if (isMountedRef.current) {\n setIsLoading(false);\n }\n })();\n\n return () => {\n isMountedRef.current = false;\n };\n }, [window.location, userManager]);\n\n return (\n <AuthContext.Provider value={value}>\n <HeaderAndSideBar\n userManager={userManager}\n isLoading={isLoading}\n loader={props.loader}\n devOrgName={props.devOrgName}\n controls={props.controls}\n appId={props.appId}\n authUrl={props.authUrl}\n >\n {props.props.children}\n </HeaderAndSideBar>\n </AuthContext.Provider>\n );\n};\nconst hasCodeInUrl = (location: Location): boolean => {\n const searchParams = new URLSearchParams(location.search);\n const hashParams = new URLSearchParams(location.hash.replace('#', '?'));\n return Boolean(\n searchParams.get('code') ||\n searchParams.get('id_token') ||\n searchParams.get('session_state') ||\n searchParams.get('state') ||\n hashParams.get('code') ||\n hashParams.get('id_token') ||\n hashParams.get('session_state') ||\n hashParams.get('state')\n );\n};\n\nconst cleanBrowserUrl = () => {\n const search = window.location.search;\n\n if (\n search &&\n (search.includes('session_state=') ||\n search.includes('state=') ||\n search.includes('code='))\n ) {\n /*\n * Use replaceState to redirect the user away and remove the querystring parameters\n */\n window.history.replaceState(\n {},\n document.title,\n window.location.href.split('?')[0]\n );\n }\n};\n\n// export { Toast, Modal };\n\nconst OS1Toast = (props: ToastProps) => {\n const consoleInstance = React.useContext(ConsoleUIContext);\n const [authUrl, setAuthUrl] = useState('');\n\n useEffect(() => {\n if (consoleInstance) {\n setAuthUrl(consoleInstance.authInitializer?.client?._settings._authority);\n }\n const console = ConsoleUiInit.getInstance(\n props.clientId,\n props.loginRedirectPath,\n props.logoutRedirectPath,\n props.devOrgName,\n authUrl,\n props.appId\n );\n console.renderToast(props.elementId, props.toastConfig);\n }, []);\n\n return <div id={props.elementId}></div>;\n};\n\nconst OS1Modal = (props: ModalProps) => {\n const consoleInstance = React.useContext(ConsoleUIContext);\n const [authUrl, setAuthUrl] = useState('');\n\n useEffect(() => {\n if (consoleInstance) {\n setAuthUrl(consoleInstance.authInitializer?.client?._settings._authority);\n }\n const console = ConsoleUiInit.getInstance(\n props.clientId,\n props.loginRedirectPath,\n props.logoutRedirectPath,\n props.devOrgName,\n authUrl,\n props.appId\n );\n console.renderModal('modal-ele', props.modalConfig);\n }, []);\n\n return <div id=\"modal-ele\"></div>;\n};\n\nexport { OS1Provider, OS1Toast, OS1Modal, HttpClient as OS1HttpClient };\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/aaa/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAAgF;AAmU9E,8FAnU2B,6BAAa,OAmU3B;AAlUf,6CAA2D;AAI3D,gDAA0B;AAEb,QAAA,WAAW,GAAG,eAAK,CAAC,aAAa,CAAkB,SAAS,CAAC,CAAC;AAC9D,QAAA,gBAAgB,GAAG,eAAK,CAAC,aAAa,CAAM,SAAS,CAAC,CAAC;AAEpE,IAAM,gBAAgB,GAAG,UAAC,KAAU;IAC5B,IAAA,KAAwC,IAAA,gBAAQ,EAAM,IAAI,CAAC,EAA1D,eAAe,QAAA,EAAE,kBAAkB,QAAuB,CAAC;IAElE,IAAA,iBAAS,EAAC;QACR,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;YACpB,IAAM,SAAO,GAAG,6BAAa,CAAC,WAAW,CACvC,KAAK,CAAC,QAAQ,EACd,KAAK,CAAC,iBAAiB,EACvB,KAAK,CAAC,kBAAkB,EACxB,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,WAAW,CAClB,CAAC;YAEF,kBAAkB,CAAC,SAAO,CAAC,CAAC;YAC5B,SAAO,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AQ","sourcesContent":["import { AAA, ConsoleUiInit, OS1HttpClient } from '@os1-platform/console-ui-js';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { ModalProps } from '../components/modal/interface';\nimport { ToastProps } from '../components/toast/interface';\n\nimport axios from 'axios';\n\nexport const AuthContext = React.createContext<any | undefined>(undefined);\nexport const ConsoleUIContext = React.createContext<any>(undefined);\n\nconst HeaderAndSideBar = (props: any) => {\n const [consoleInstance, setConsoleInstance] = useState<any>(null);\n\n useEffect(() => {\n if (!props.isLoading) {\n const console = ConsoleUiInit.getInstance(\n props.clientId,\n props.loginRedirectPath,\n props.logoutRedirectPath,\n props.authurl,\n props.devOrgName,\n props.appId,\n props.userManager\n );\n\n setConsoleInstance(console);\n console.renderHeaderAndSidebar('headerAndSidebar', props.controls);\n }\n }, [props.isLoading]);\n\n if (props.isLoading) {\n if (props.loader) {\n return props.loader;\n } else {\n const keyframes = `\n @-webkit-keyframes spin {\n 0% {\n -webkit-transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n }\n }\n `;\n const styleSheets = Array.from(document.styleSheets).filter(\n (styleSheet) =>\n !styleSheet.href || styleSheet.href.startsWith(window.location.origin)\n );\n for (let style of styleSheets) {\n if (style instanceof CSSStyleSheet && style.cssRules) {\n style.insertRule(keyframes, style.cssRules.length);\n }\n }\n const loaderStyle = () => ({\n marginTop: '50vh',\n marginLeft: '50vw',\n border: '12px solid #F3F3F3',\n borderRadius: '50%',\n borderTop: '12px solid grey',\n width: '40px',\n height: '40px',\n animationName: 'spin',\n animationDuration: '2s',\n animationTimingFunction: 'linear',\n animationIterationCount: 'infinite',\n });\n return <div style={loaderStyle()}></div>;\n }\n }\n //console.log(consoleInstance, props);\n return (\n <ConsoleUIContext.Provider value={consoleInstance}>\n <div id=\"headerAndSidebar\">{props.children}</div>\n </ConsoleUIContext.Provider>\n );\n};\n\ninterface TenantDTO {\n tenantId: string;\n tenantStatus: string;\n tenantDns: string;\n stackId: string;\n stackName: string;\n organizationShortName: string;\n organizationBaseDomain: string;\n stackAuthUrl: string;\n}\n\nconst getCleanedDomain = (domain: string) => {\n const cleanedDomain = String(domain);\n const splitHost = cleanedDomain.split('.');\n const org = splitHost[0] || '';\n const cleanedOrg = org.replace('-cdev', '');\n const base = splitHost.join('.');\n return { orgShortName: cleanedOrg, baseDomain: base };\n};\n\nconst getTenantFromDevPortal = async (\n orgShortName: any\n): Promise<TenantDTO> => {\n const url = `https://api.getos1.com/app/core-api/tenant?orgShortName=${orgShortName}`;\n const response = await axios.get(url);\n return response.data.data;\n};\n\nconst getTenantId = (devOrgNameArg: string | null = null): string => {\n let devOrgName = devOrgNameArg;\n //if (!devOrgNameArg) devOrgName = getAuthConfig().devOrgName;\n\n const hostname = window.location.hostname || null;\n\n return hostname\n ? (hostname.split('.')[0] == 'developer' ||\n hostname.split('.')[0] == 'developer2' ||\n hostname.split('.')[0].includes('-cdev')) &&\n devOrgName\n ? devOrgName\n : hostname.split('.')[0]\n : '';\n};\n\nconst getKeyCloakAuthority = async (domain: string, devOrgName: string) => {\n let orgName: string = '';\n let baseDomainName: string = '';\n\n if (devOrgName != undefined) {\n orgName = devOrgName;\n baseDomainName = domain.substring(domain.indexOf('.'));\n } else {\n const { orgShortName, baseDomain } = getCleanedDomain(domain);\n\n orgName = orgShortName;\n baseDomainName = baseDomain;\n }\n\n if (baseDomainName.includes('os1')) {\n const tenant = await getTenantFromDevPortal(orgName);\n\n return `${tenant.stackAuthUrl}/auth/realms/${tenant.tenantId}`;\n }\n\n const tenantId = getTenantId(orgName);\n //console.log(tenantId);\n return `https://keycloak${baseDomainName}/auth/realms/${tenantId}`;\n};\n\nconst OS1Provider = (props: any) => {\n const [authUrl, setAuthUrl] = useState('');\n // const [tenantDns, setTenantDns] = useState('');\n // let isMountedRef = useRef<boolean>(false);\n\n let authUrls = '';\n useEffect(() => {\n (async function () {\n authUrls = await getKeyCloakAuthority(\n window.location.hostname,\n props.devOrgName\n );\n setAuthUrl(authUrls);\n })();\n }, []);\n\n return (\n <OS1Provider2\n clientId={props.clientId}\n loginRedirectPath={props.loginRedirectPath}\n logoutRedirectPath={props.logoutRedirectPath}\n devOrgName={props.devOrgName}\n appId={props.appId}\n controls={props.controls}\n authUrl={authUrl}\n props={...props}\n />\n );\n};\nconst OS1Provider2 = (props: any) => {\n //console.log(props);\n const userManager = new AAA(\n props.clientId,\n props.loginRedirectPath,\n props.logoutRedirectPath,\n props.devOrgName,\n props.authUrl\n );\n const value = '';\n //console.log('userManager', userManager);\n const [isLoading, setIsLoading] = useState(true);\n let isMountedRef = useRef<boolean>(false);\n\n useEffect(() => {\n // Store current isMounted since this could change while awaiting async operations below\n isMountedRef.current = true;\n (async () => {\n let user = undefined;\n try {\n user = await userManager!.getUserInfo();\n } catch (error: any) {\n window.console.log('Error: ', error);\n }\n /**\n * Check if the user is returning back from OIDC.\n */\n if (hasCodeInUrl(window.location)) {\n await userManager?.logincallback();\n cleanBrowserUrl();\n setIsLoading(false);\n return;\n }\n\n if (!(await userManager?.isAuthenticated())) {\n userManager?.login();\n } else if (isMountedRef.current) {\n setIsLoading(false);\n }\n })();\n\n return () => {\n isMountedRef.current = false;\n };\n }, [window.location, userManager]);\n console.log(props);\n return (\n <AuthContext.Provider value={value}>\n <HeaderAndSideBar\n userManager={userManager}\n isLoading={isLoading}\n loader={props.loader}\n devOrgName={props.devOrgName}\n controls={props.controls}\n appId={props.appId}\n authUrl={props.authUrl}\n >\n {props.props.children}\n </HeaderAndSideBar>\n </AuthContext.Provider>\n );\n};\nconst hasCodeInUrl = (location: Location): boolean => {\n const searchParams = new URLSearchParams(location.search);\n const hashParams = new URLSearchParams(location.hash.replace('#', '?'));\n return Boolean(\n searchParams.get('code') ||\n searchParams.get('id_token') ||\n searchParams.get('session_state') ||\n searchParams.get('state') ||\n hashParams.get('code') ||\n hashParams.get('id_token') ||\n hashParams.get('session_state') ||\n hashParams.get('state')\n );\n};\n\nconst cleanBrowserUrl = () => {\n const search = window.location.search;\n\n if (\n search &&\n (search.includes('session_state=') ||\n search.includes('state=') ||\n search.includes('code='))\n ) {\n /*\n * Use replaceState to redirect the user away and remove the querystring parameters\n */\n window.history.replaceState(\n {},\n document.title,\n window.location.href.split('?')[0]\n );\n }\n};\n\n// export { Toast, Modal };\n\nconst OS1Toast = (props: ToastProps) => {\n const [consoleClient, setConsoleClient] = useState(\n props.consoleInstance.authInitializer?.client?._settings\n );\n\n useEffect(() => {\n // if (consoleInstance) {\n // setAuthUrl(consoleInstance.authInitializer?.client?._settings._authority);\n // }\n const console = ConsoleUiInit.getInstance(\n consoleClient._client_id,\n consoleClient._redirect_uri,\n consoleClient._post_logout_redirect_uri,\n consoleClient._authority\n );\n console.renderToast(props.elementId, props.toastConfig);\n }, []);\n\n return <div id={props.elementId}></div>;\n};\n\nconst OS1Modal = (props: ModalProps) => {\n // const consoleInstance = React.useContext(ConsoleUIContext);\n // const [authUrl, setAuthUrl] = useState('');\n const [consoleClient, setConsoleClient] = useState(\n props.consoleInstance.authInitializer?.client?._settings\n );\n\n useEffect(() => {\n // if (consoleInstance) {\n // setAuthUrl(consoleInstance.authInitializer?.client?._settings._authority);\n // }\n const console = ConsoleUiInit.getInstance(\n consoleClient._client_id,\n consoleClient._redirect_uri,\n consoleClient._post_logout_redirect_uri,\n consoleClient._authority\n );\n console.renderModal('modal-ele', props.modalConfig);\n }, []);\n\n return <div id=\"modal-ele\"></div>;\n};\n\n\nexport {\n OS1Provider,\n OS1Toast,\n OS1Modal,\n OS1HttpClient,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/modal/interface.ts"],"names":[],"mappings":"","sourcesContent":["export interface ModalConfig {\n bgColor: string,\n title: string,\n message: string,\n icon: string,\n buttons: Button[]\n id?: string,\n}\n\nexport interface Button {\n id: string,\n backgroundColor: string,\n text: string,\n event: string,\n}\n\nexport interface ModalProps {\n
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/modal/interface.ts"],"names":[],"mappings":"","sourcesContent":["export interface ModalConfig {\n bgColor: string,\n title: string,\n message: string,\n icon: string,\n buttons: Button[]\n id?: string,\n}\n\nexport interface Button {\n id: string,\n backgroundColor: string,\n text: string,\n event: string,\n}\n\nexport interface ModalProps {\n consoleInstance: any,\n elementId: string,\n modalConfig: ModalConfig;\n}\n\nexport interface RouterProps {\n component: string,\n path: string,\n exact: boolean,\n props?: {} | undefined\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/toast/interface.ts"],"names":[],"mappings":"","sourcesContent":["export interface ToastConfig {\n bgColor: string,\n message: string,\n timeout?: number,\n icon: string,\n closeButton: boolean,\n id?: string,\n}\n\nexport interface ToastProps {\n
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/toast/interface.ts"],"names":[],"mappings":"","sourcesContent":["export interface ToastConfig {\n bgColor: string,\n message: string,\n timeout?: number,\n icon: string,\n closeButton: boolean,\n id?: string,\n}\n\nexport interface ToastProps {\n consoleInstance:any,\n elementId: string,\n toastConfig: ToastConfig;\n}"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OS1HttpClient } from '@os1-platform/console-ui-js';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ModalProps } from '../components/modal/interface';
|
|
4
4
|
import { ToastProps } from '../components/toast/interface';
|
|
@@ -7,4 +7,4 @@ export declare const ConsoleUIContext: React.Context<any>;
|
|
|
7
7
|
declare const OS1Provider: (props: any) => JSX.Element;
|
|
8
8
|
declare const OS1Toast: (props: ToastProps) => JSX.Element;
|
|
9
9
|
declare const OS1Modal: (props: ModalProps) => JSX.Element;
|
|
10
|
-
export { OS1Provider, OS1Toast, OS1Modal,
|
|
10
|
+
export { OS1Provider, OS1Toast, OS1Modal, OS1HttpClient, };
|
|
@@ -13,11 +13,7 @@ export interface Button {
|
|
|
13
13
|
event: string;
|
|
14
14
|
}
|
|
15
15
|
export interface ModalProps {
|
|
16
|
-
|
|
17
|
-
loginRedirectPath: string;
|
|
18
|
-
logoutRedirectPath: string;
|
|
19
|
-
devOrgName: string;
|
|
20
|
-
appId: string;
|
|
16
|
+
consoleInstance: any;
|
|
21
17
|
elementId: string;
|
|
22
18
|
modalConfig: ModalConfig;
|
|
23
19
|
}
|
|
@@ -7,13 +7,7 @@ export interface ToastConfig {
|
|
|
7
7
|
id?: string;
|
|
8
8
|
}
|
|
9
9
|
export interface ToastProps {
|
|
10
|
-
|
|
11
|
-
loginRedirectPath: string;
|
|
12
|
-
logoutRedirectPath: string;
|
|
13
|
-
devOrgName: string;
|
|
14
|
-
authurl: string;
|
|
15
|
-
appId: string;
|
|
16
|
-
userManager: string;
|
|
10
|
+
consoleInstance: any;
|
|
17
11
|
elementId: string;
|
|
18
12
|
toastConfig: ToastConfig;
|
|
19
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@os1-platform/console-ui-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "React wrapper for console-ui library",
|
|
5
5
|
"main": "dist/commonjs/aaa/index.js",
|
|
6
6
|
"types": "dist/commonjs/types/aaa/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@fullhuman/postcss-purgecss": "^5.0.0",
|
|
30
|
-
"@os1-platform/console-ui-js": "^0.1.
|
|
30
|
+
"@os1-platform/console-ui-js": "^0.1.10",
|
|
31
31
|
"@react-native-community/eslint-config": "^2.0.0",
|
|
32
32
|
"@types/react": "^17.0.37",
|
|
33
33
|
"axios": "^0.21.4",
|
package/readme.md
CHANGED
|
@@ -73,10 +73,10 @@
|
|
|
73
73
|
closeButton: true, // denotes whether the close button will be present on the right of the toast
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
<OS1Toast
|
|
76
|
+
<OS1Toast consoleInstance={consoleInstance} elementId={"toastElement"} toastConfig={toastConfig} />
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
NOTE: Each toast element that is to be rendered on the page should be given a unique elementId.
|
|
79
|
+
NOTE: Each toast element that is to be rendered on the page should be given a unique elementId. Here, consoleInstance has the value of Context of ConsoleUiContext.
|
|
80
80
|
|
|
81
81
|
6. Use the Modal function to render a modal component in your webpage.
|
|
82
82
|
For example:
|
|
@@ -97,17 +97,13 @@
|
|
|
97
97
|
],
|
|
98
98
|
};
|
|
99
99
|
<OS1Modal
|
|
100
|
-
|
|
101
|
-
loginRedirectPath={'/abc'}
|
|
102
|
-
logoutRedirectPath={'/'}
|
|
103
|
-
devOrgName={'orgNme'}
|
|
104
|
-
appId={'sampleAppId'}
|
|
100
|
+
consoleInstance={consoleInstance}
|
|
105
101
|
elementId={'modalElement'}
|
|
106
102
|
modalConfig={modalConfig}
|
|
107
103
|
/>;
|
|
108
104
|
```
|
|
109
105
|
|
|
110
|
-
Note:- Listen to event when button is clicked, `event.details` will contain the modal element Id.
|
|
106
|
+
Note:- Listen to event when button is clicked, `event.details` will contain the modal element Id. Here, consoleInstance has the value of Context of ConsoleUiContext.
|
|
111
107
|
|
|
112
108
|
7. Use state variable of `ConsoleUIContext` context to listen to events emitted by injectable controls. This instance is usually passed as a prop to apps.
|
|
113
109
|
For example:
|
|
@@ -125,23 +121,17 @@
|
|
|
125
121
|
|
|
126
122
|
Note:- We are exposing OnChangeEvent, OnBlurEvent, OnScrollEvent, OnClickEvent, OnFocusEvent for injectableId's.
|
|
127
123
|
|
|
128
|
-
8. Use `OS1HttpClient` API to create a client for network requests and pass `authInitializer` property of ConsoleUiContext as a constructor parameter.
|
|
124
|
+
8. Use `OS1HttpClient` API to create a client variable for network requests and pass `authInitializer` property of ConsoleUiContext as a constructor parameter.
|
|
129
125
|
|
|
130
126
|
```javascript
|
|
131
127
|
import { OS1HttpClient } from '@os1-platform/console-ui-react';
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
constructor(`instanceName`) {
|
|
137
|
-
this.instance = OS1HttpClient.createClient({
|
|
138
|
-
baseURL: `https://abc.domain.com`,
|
|
139
|
-
},`instanceName`);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
128
|
+
if (consoleInstane) {
|
|
129
|
+
var client = new OS1HttpClient(consoleInstane.authInitializer, `https://abc.domain.com`); // Base url is set in OS1HttpClient class.
|
|
130
|
+
}
|
|
142
131
|
```
|
|
143
132
|
|
|
144
|
-
9.
|
|
133
|
+
9. Use REST api methods, on the instance created for OS1HttpClient.
|
|
134
|
+
Following headers are automatically configured to requests originating from the `NetworkClient` adding Access token(`x-coreos-access`) or Tenant id(`x-coreos-tid`) or User info(`x-coreos-userinfo`) or Auth token(`x-coreos-auth`) headers to the actual request.
|
|
145
135
|
|
|
146
136
|
- `withAccess`
|
|
147
137
|
- `withTid`
|
|
@@ -156,22 +146,22 @@
|
|
|
156
146
|
4. `x-coreos-auth` contains the id_token.
|
|
157
147
|
|
|
158
148
|
```javascript
|
|
159
|
-
import NetworkClient from "./networkClient";
|
|
160
149
|
|
|
161
150
|
const handleClick = () => {
|
|
162
151
|
//here consoleInstance is the state variable of ConsoleUIContext;
|
|
163
152
|
if (consoleInstance) {
|
|
164
|
-
const
|
|
153
|
+
const client = new OS1HttpClient(consoleInstane.authInitializer, `https://abc.domain.com`); //consoleInstance.authInitializer is an instance of AAA class that we get from ConsoleUi Context
|
|
165
154
|
const reqHeaders: any = {
|
|
166
155
|
withAccess: false,
|
|
167
156
|
withTid: false,
|
|
168
157
|
withUserInfo: false,
|
|
169
158
|
withAuth: false,
|
|
170
159
|
};
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
160
|
+
client.get(`/users`).then(response => {
|
|
161
|
+
console.log("api response", response.data)
|
|
162
|
+
}).catch(function (err) {
|
|
163
|
+
console.error('error', err);
|
|
164
|
+
});
|
|
175
165
|
};
|
|
176
166
|
};
|
|
177
167
|
```
|
|
@@ -202,7 +192,7 @@
|
|
|
202
192
|
|
|
203
193
|
15. If nothing is selected then, when user clicks on app for the first time, it asks how we want to redirect the app.
|
|
204
194
|
|
|
205
|
-
16. Link to acceess [example app](https://github.com/
|
|
195
|
+
16. Link to acceess [example app](https://github.com/OS1-logistics/vehicle-reference-app/tree/console-v2-integration)
|
|
206
196
|
|
|
207
197
|
## Configuration for Injectable Controls offered by the Library
|
|
208
198
|
|