@os1-platform/console-ui-react 0.1.1 → 0.1.3
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.map +1 -0
- package/{src/components/modal/index.tsx → dist/commonjs/components/modal/index.js} +2 -3
- package/dist/commonjs/components/modal/index.js.map +1 -0
- package/dist/commonjs/components/modal/interface.js +3 -0
- package/dist/commonjs/components/modal/interface.js.map +1 -0
- package/{src/components/toast/index.tsx → dist/commonjs/components/toast/index.js} +2 -3
- package/dist/commonjs/components/toast/index.js.map +1 -0
- package/dist/commonjs/components/toast/interface.js +3 -0
- package/dist/commonjs/components/toast/interface.js.map +1 -0
- package/dist/commonjs/index.js +8 -0
- package/dist/commonjs/index.js.map +1 -0
- package/{src/init/index.tsx → dist/commonjs/init/index.js} +2 -18
- package/dist/commonjs/init/index.js.map +1 -0
- package/dist/commonjs/init/interface.js +3 -0
- package/dist/commonjs/init/interface.js.map +1 -0
- package/dist/commonjs/types/aaa/index.d.ts +10 -0
- package/dist/commonjs/types/components/modal/index.d.ts +0 -0
- package/dist/commonjs/types/components/modal/interface.d.ts +29 -0
- package/dist/commonjs/types/components/toast/index.d.ts +0 -0
- package/dist/commonjs/types/components/toast/interface.d.ts +19 -0
- package/dist/commonjs/types/index.d.ts +2 -0
- package/dist/commonjs/types/init/index.d.ts +0 -0
- package/dist/commonjs/types/init/interface.d.ts +6 -0
- package/package.json +4 -3
- package/src/aaa/index.tsx +0 -318
- package/src/components/modal/interface.ts +0 -32
- package/src/components/toast/interface.ts +0 -20
- package/src/index.ts +0 -6
- package/src/init/interface.ts +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/aaa/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAA6E;AA6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1D,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,gCAAK,EAAE,EAAE,KAAK,CAAC,SAAS,GAAQ,CAAC;AAC1C,CAAC,CAAC;AAwBoB,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,7 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
// import { ConsoleUiInit } from '@foxtrotplatform/console-ui-sdk';
|
|
2
3
|
// import { useEffect } from 'react';
|
|
3
4
|
// import { ModalProps } from './interface';
|
|
4
|
-
|
|
5
5
|
// export const OS1Modal = (props: ModalProps) => {
|
|
6
6
|
// // const console = ConsoleUiInit.getInstance(
|
|
7
7
|
// // props.clientId,
|
|
@@ -9,10 +9,9 @@
|
|
|
9
9
|
// // props.logoutRedirectPath,
|
|
10
10
|
// // props.devOrgName
|
|
11
11
|
// // );
|
|
12
|
-
|
|
13
12
|
// // useEffect(() => {
|
|
14
13
|
// // console.renderModal('modal-ele', props.modalConfig);
|
|
15
14
|
// // }, []);
|
|
16
|
-
|
|
17
15
|
// return <div id="modal-ele"></div>;
|
|
18
16
|
// };
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/modal/index.tsx"],"names":[],"mappings":";AAAA,mEAAmE;AACnE,qCAAqC;AACrC,4CAA4C;AAE5C,mDAAmD;AACnD,kDAAkD;AAClD,yBAAyB;AACzB,kCAAkC;AAClC,mCAAmC;AACnC,0BAA0B;AAC1B,UAAU;AAEV,yBAAyB;AACzB,8DAA8D;AAC9D,eAAe;AAEf,uCAAuC;AACvC,KAAK","sourcesContent":["// import { ConsoleUiInit } from '@foxtrotplatform/console-ui-sdk';\n// import { useEffect } from 'react';\n// import { ModalProps } from './interface';\n\n// export const OS1Modal = (props: ModalProps) => {\n// // const console = ConsoleUiInit.getInstance(\n// // props.clientId,\n// // props.loginRedirectPath,\n// // props.logoutRedirectPath,\n// // props.devOrgName\n// // );\n\n// // useEffect(() => {\n// // console.renderModal('modal-ele', props.modalConfig);\n// // }, []);\n\n// return <div id=\"modal-ele\"></div>;\n// };\n"]}
|
|
@@ -0,0 +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 clientId: string,\n loginRedirectPath: string,\n logoutRedirectPath: string,\n devOrgName: string,\n appId: string,\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,7 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
// import { ConsoleUiInit } from '@foxtrotplatform/console-ui-sdk';
|
|
2
3
|
// import { useEffect } from 'react';
|
|
3
4
|
// import { ToastProps, ToastConfig } from './interface';
|
|
4
|
-
|
|
5
5
|
// export const OS1Toast = (props: ToastProps) => {
|
|
6
6
|
// // const console = ConsoleUiInit.getInstance(
|
|
7
7
|
// // props.clientId,
|
|
@@ -9,11 +9,10 @@
|
|
|
9
9
|
// // props.logoutRedirectPath,
|
|
10
10
|
// // props.devOrgName
|
|
11
11
|
// // );
|
|
12
|
-
|
|
13
12
|
// // useEffect(() => {
|
|
14
13
|
// // console.renderToast(props.elementId, props.toastConfig);
|
|
15
14
|
// // // console.renderHeaderAndSidebar(document.getElementById('headerAndSidebar'));
|
|
16
15
|
// // }, []);
|
|
17
|
-
|
|
18
16
|
// return <div id={props.elementId}></div>;
|
|
19
17
|
// };
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/toast/index.tsx"],"names":[],"mappings":";AAAA,mEAAmE;AACnE,qCAAqC;AACrC,yDAAyD;AAEzD,mDAAmD;AACnD,kDAAkD;AAClD,yBAAyB;AACzB,kCAAkC;AAClC,mCAAmC;AACnC,0BAA0B;AAC1B,UAAU;AAEV,yBAAyB;AACzB,kEAAkE;AAClE,yFAAyF;AACzF,eAAe;AAEf,6CAA6C;AAC7C,KAAK","sourcesContent":["// import { ConsoleUiInit } from '@foxtrotplatform/console-ui-sdk';\n// import { useEffect } from 'react';\n// import { ToastProps, ToastConfig } from './interface';\n\n// export const OS1Toast = (props: ToastProps) => {\n// // const console = ConsoleUiInit.getInstance(\n// // props.clientId,\n// // props.loginRedirectPath,\n// // props.logoutRedirectPath,\n// // props.devOrgName\n// // );\n\n// // useEffect(() => {\n// // console.renderToast(props.elementId, props.toastConfig);\n// // // console.renderHeaderAndSidebar(document.getElementById('headerAndSidebar'));\n// // }, []);\n\n// return <div id={props.elementId}></div>;\n// };\n"]}
|
|
@@ -0,0 +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 clientId: string,\n loginRedirectPath: string,\n logoutRedirectPath: string,\n devOrgName: string,\n authurl: string,\n appId: string,\n userManager: string,\n elementId: string,\n toastConfig: ToastConfig;\n}"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConsoleUIContext = exports.OS1Provider = void 0;
|
|
4
|
+
//import { AAAInstantiate, HeaderAndSideBar } from "./init";
|
|
5
|
+
var aaa_1 = require("./aaa");
|
|
6
|
+
Object.defineProperty(exports, "OS1Provider", { enumerable: true, get: function () { return aaa_1.OS1Provider; } });
|
|
7
|
+
Object.defineProperty(exports, "ConsoleUIContext", { enumerable: true, get: function () { return aaa_1.ConsoleUIContext; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,4DAA4D;AAC5D,6BAAsD;AAI7C,4FAJA,iBAAW,OAIA;AAAE,iGAJA,sBAAgB,OAIA","sourcesContent":["//import { AAAInstantiate, HeaderAndSideBar } from \"./init\";\nimport { OS1Provider, ConsoleUIContext } from './aaa';\n// import { OS1Toast } from './components/toast';\n// import { OS1Modal } from './components/modal';\n\nexport { OS1Provider, ConsoleUIContext };\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
// import {
|
|
2
3
|
// AAA,
|
|
3
4
|
// ConsoleUiInit,
|
|
@@ -7,7 +8,6 @@
|
|
|
7
8
|
// import * as React from 'react';
|
|
8
9
|
// import { useEffect, useLayoutEffect, useState } from 'react';
|
|
9
10
|
// import { AAAElements } from './interface';
|
|
10
|
-
|
|
11
11
|
// // export class ReactConsoleUiInit {
|
|
12
12
|
// // public authInitializer: any;
|
|
13
13
|
// // public console: any;
|
|
@@ -16,34 +16,27 @@
|
|
|
16
16
|
// // loginRedirectPath: string,
|
|
17
17
|
// // logoutRedirectPath: string,
|
|
18
18
|
// // devOrgName: string = '') {
|
|
19
|
-
|
|
20
19
|
// // this.console = new ConsoleUiInit(
|
|
21
20
|
// // clientId,
|
|
22
21
|
// // loginRedirectPath,
|
|
23
22
|
// // logoutRedirectPath,
|
|
24
23
|
// // devOrgName,
|
|
25
|
-
|
|
26
24
|
// // );
|
|
27
|
-
|
|
28
25
|
// // this.tenantId = devOrgName;
|
|
29
26
|
// // }
|
|
30
|
-
|
|
31
27
|
// // HeaderAndSideBar = () => {
|
|
32
|
-
|
|
33
28
|
// // return (
|
|
34
29
|
// // <div id='app'>
|
|
35
30
|
// // Hello
|
|
36
31
|
// // </div>
|
|
37
32
|
// // )
|
|
38
33
|
// // }
|
|
39
|
-
|
|
40
34
|
// // // headerAndSideBar() {
|
|
41
35
|
// // // const headerAndSideBar = new SideNav(this.tenantId, this.authInitializer);
|
|
42
36
|
// // // return headerAndSideBar.render();
|
|
43
37
|
// // // }
|
|
44
38
|
// // }
|
|
45
39
|
// let count: number = 0;
|
|
46
|
-
|
|
47
40
|
// export const AAAInstantiate = (aaaElements: AAAElements) => {
|
|
48
41
|
// const aaa: any = new AAA(
|
|
49
42
|
// aaaElements.clientId,
|
|
@@ -53,11 +46,9 @@
|
|
|
53
46
|
// );
|
|
54
47
|
// return aaa;
|
|
55
48
|
// };
|
|
56
|
-
|
|
57
49
|
// export const HeaderAndSideBar = (props: any) => {
|
|
58
50
|
// count++;
|
|
59
51
|
// window.console.log('Count: ', count);
|
|
60
|
-
|
|
61
52
|
// // const [aaaInstance, setAaaInstance] = useState<any>(null);
|
|
62
53
|
// const [consoleInstance, setConsoleInstance] = useState<any>(null);
|
|
63
54
|
// // const [userSignedIn, setUserSignedInstance] = useState<boolean>(true);
|
|
@@ -80,7 +71,6 @@
|
|
|
80
71
|
// // props.logoutRedirectPath,
|
|
81
72
|
// // props.devOrgName,
|
|
82
73
|
// // );
|
|
83
|
-
|
|
84
74
|
// (async () => {
|
|
85
75
|
// await props.aaaInstance.login();
|
|
86
76
|
// // setAaaInstance(aaa);
|
|
@@ -88,7 +78,6 @@
|
|
|
88
78
|
// })();
|
|
89
79
|
// }
|
|
90
80
|
// }, []);
|
|
91
|
-
|
|
92
81
|
// // useEffect(() => {
|
|
93
82
|
// // window.console.log("AAAINSTANCE: ", props.aaaInstance);
|
|
94
83
|
// // const console: any = new ConsoleUiInit(
|
|
@@ -99,9 +88,7 @@
|
|
|
99
88
|
// // props.aaaInstance,
|
|
100
89
|
// // );
|
|
101
90
|
// // setConsoleInstance(console);
|
|
102
|
-
|
|
103
91
|
// // }, [props.aaaInstance]);
|
|
104
|
-
|
|
105
92
|
// // useEffect(() => {
|
|
106
93
|
// // window.console.log("Initialization called: ", consoleInstance);
|
|
107
94
|
// // if (consoleInstance && props.aaaInstance) {
|
|
@@ -121,18 +108,14 @@
|
|
|
121
108
|
// // // }
|
|
122
109
|
// // // aaaInstance.loginOnload();
|
|
123
110
|
// // })()
|
|
124
|
-
|
|
125
111
|
// // }
|
|
126
112
|
// // }, [consoleInstance]);
|
|
127
|
-
|
|
128
113
|
// // (async () => {
|
|
129
114
|
// // const token = await aaaInstance.getToken();
|
|
130
115
|
// // window.console.log("Token: ", token);
|
|
131
116
|
// // })()
|
|
132
|
-
|
|
133
117
|
// return <div id="headerAndSidebar"></div>;
|
|
134
118
|
// };
|
|
135
|
-
|
|
136
119
|
// const hasCodeInUrl = (location: Location): boolean => {
|
|
137
120
|
// const searchParams = new URLSearchParams(location.search);
|
|
138
121
|
// const hashParams = new URLSearchParams(location.hash.replace('#', '?'));
|
|
@@ -147,3 +130,4 @@
|
|
|
147
130
|
// hashParams.get('state')
|
|
148
131
|
// );
|
|
149
132
|
// };
|
|
133
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/init/index.tsx"],"names":[],"mappings":";AAAA,WAAW;AACX,SAAS;AACT,mBAAmB;AACnB,0BAA0B;AAC1B,4CAA4C;AAC5C,uDAAuD;AACvD,kCAAkC;AAClC,gEAAgE;AAChE,6CAA6C;AA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,uFAAuF;AACvF,iEAAiE;AACjE,yGAAyG;AACzG,uEAAuE;AACvE,iIAAiI;AACjI,+BAA+B;AAC/B,0FAA0F;AAC1F,2DAA2D;AAC3D,qEAAqE;AACrE,yDAAyD;AACzD,4BAA4B;AAC5B,wBAAwB;AACxB,iDAAiD;AACjD,oBAAoB;AAEpB,aAAa;AACb,8BAA8B;AAE9B,sBAAsB;AACtB,uDAAuD;AACvD,iDAAiD;AACjD,YAAY;AAEZ,8CAA8C;AAC9C,KAAK;AAEL,0DAA0D;AAC1D,+DAA+D;AAC/D,6EAA6E;AAC7E,oBAAoB;AACpB,kCAAkC;AAClC,wCAAwC;AACxC,6CAA6C;AAC7C,qCAAqC;AACrC,kCAAkC;AAClC,sCAAsC;AACtC,2CAA2C;AAC3C,gCAAgC;AAChC,OAAO;AACP,KAAK","sourcesContent":["// import {\n// AAA,\n// ConsoleUiInit,\n// HttpClient as client,\n// } from '@foxtrotplatform/console-ui-sdk';\n// // import { SideNav } from '../components/side-nav';\n// import * as React from 'react';\n// import { useEffect, useLayoutEffect, useState } from 'react';\n// import { AAAElements } from './interface';\n\n// // export class ReactConsoleUiInit {\n// // public authInitializer: any;\n// // public console: any;\n// // public tenantId: string;\n// // constructor(clientId: string,\n// // loginRedirectPath: string,\n// // logoutRedirectPath: string,\n// // devOrgName: string = '') {\n\n// // this.console = new ConsoleUiInit(\n// // clientId,\n// // loginRedirectPath,\n// // logoutRedirectPath,\n// // devOrgName,\n\n// // );\n\n// // this.tenantId = devOrgName;\n// // }\n\n// // HeaderAndSideBar = () => {\n\n// // return (\n// // <div id='app'>\n// // Hello\n// // </div>\n// // )\n// // }\n\n// // // headerAndSideBar() {\n// // // const headerAndSideBar = new SideNav(this.tenantId, this.authInitializer);\n// // // return headerAndSideBar.render();\n// // // }\n// // }\n// let count: number = 0;\n\n// export const AAAInstantiate = (aaaElements: AAAElements) => {\n// const aaa: any = new AAA(\n// aaaElements.clientId,\n// aaaElements.loginRedirectPath,\n// aaaElements.logoutRedirectPath,\n// aaaElements.devOrgName\n// );\n// return aaa;\n// };\n\n// export const HeaderAndSideBar = (props: any) => {\n// count++;\n// window.console.log('Count: ', count);\n\n// // const [aaaInstance, setAaaInstance] = useState<any>(null);\n// const [consoleInstance, setConsoleInstance] = useState<any>(null);\n// // const [userSignedIn, setUserSignedInstance] = useState<boolean>(true);\n// // const aaa: any = new AAA(\n// // props.clientId,\n// // props.loginRedirectPath,\n// // props.logoutRedirectPath,\n// // props.devOrgName,\n// // );\n// // setAaaInstance(aaa);\n// useEffect(() => {\n// window.console.log('aaaInstance.client: ', props.aaaInstance.client);\n// if (hasCodeInUrl(window.location)) {\n// return;\n// }\n// if (props.aaaInstance.client) {\n// // const aaa: any = new AAA(\n// // props.clientId,\n// // props.loginRedirectPath,\n// // props.logoutRedirectPath,\n// // props.devOrgName,\n// // );\n\n// (async () => {\n// await props.aaaInstance.login();\n// // setAaaInstance(aaa);\n// // setUserSignedInstance(false);\n// })();\n// }\n// }, []);\n\n// // useEffect(() => {\n// // window.console.log(\"AAAINSTANCE: \", props.aaaInstance);\n// // const console: any = new ConsoleUiInit(\n// // props.clientId,\n// // props.loginRedirectPath,\n// // props.logoutRedirectPath,\n// // props.devOrgName,\n// // props.aaaInstance,\n// // );\n// // setConsoleInstance(console);\n\n// // }, [props.aaaInstance]);\n\n// // useEffect(() => {\n// // window.console.log(\"Initialization called: \", consoleInstance);\n// // if (consoleInstance && props.aaaInstance) {\n// // window.console.log(\"ConsoleInstance\");\n// // (async () => {\n// // // window.console.log(\"Get TOken: \", await aaaInstance.getToken());\n// // // if (await aaaInstance.isAuthenticated()) {\n// // // window.console.log(\"IsUserLoaded[authenticated]: \", aaaInstance.isUserLoaded);\n// // // window.console.log(\"Is Authenticated true\");\n// // // consoleInstance.renderHeaderAndSidebar(document.getElementById('headerAndSidebar') as HTMLDivElement);\n// // // } else {\n// // // window.console.log(\"IsUserLoaded: \", aaaInstance.isUserLoaded);\n// // // if (!aaaInstance.isUserLoaded) {\n// // // window.console.log(\"Login fn called\");\n// // // await aaaInstance.login();\n// // // }\n// // // }\n// // // aaaInstance.loginOnload();\n// // })()\n\n// // }\n// // }, [consoleInstance]);\n\n// // (async () => {\n// // const token = await aaaInstance.getToken();\n// // window.console.log(\"Token: \", token);\n// // })()\n\n// return <div id=\"headerAndSidebar\"></div>;\n// };\n\n// const 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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../src/init/interface.ts"],"names":[],"mappings":"","sourcesContent":["export interface AAAElements {\n clientId: string,\n loginRedirectPath: string,\n logoutRedirectPath: string,\n devOrgName: string,\n}"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HttpClient } from '@os1-platform/console-ui-js';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ModalProps } from '../components/modal/interface';
|
|
4
|
+
import { ToastProps } from '../components/toast/interface';
|
|
5
|
+
export declare const AuthContext: React.Context<any>;
|
|
6
|
+
export declare const ConsoleUIContext: React.Context<any>;
|
|
7
|
+
declare const OS1Provider: (props: any) => JSX.Element;
|
|
8
|
+
declare const OS1Toast: (props: ToastProps) => JSX.Element;
|
|
9
|
+
declare const OS1Modal: (props: ModalProps) => JSX.Element;
|
|
10
|
+
export { OS1Provider, OS1Toast, OS1Modal, HttpClient as OS1HttpClient };
|
|
File without changes
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface ModalConfig {
|
|
2
|
+
bgColor: string;
|
|
3
|
+
title: string;
|
|
4
|
+
message: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
buttons: Button[];
|
|
7
|
+
id?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Button {
|
|
10
|
+
id: string;
|
|
11
|
+
backgroundColor: string;
|
|
12
|
+
text: string;
|
|
13
|
+
event: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ModalProps {
|
|
16
|
+
clientId: string;
|
|
17
|
+
loginRedirectPath: string;
|
|
18
|
+
logoutRedirectPath: string;
|
|
19
|
+
devOrgName: string;
|
|
20
|
+
appId: string;
|
|
21
|
+
elementId: string;
|
|
22
|
+
modalConfig: ModalConfig;
|
|
23
|
+
}
|
|
24
|
+
export interface RouterProps {
|
|
25
|
+
component: string;
|
|
26
|
+
path: string;
|
|
27
|
+
exact: boolean;
|
|
28
|
+
props?: {} | undefined;
|
|
29
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ToastConfig {
|
|
2
|
+
bgColor: string;
|
|
3
|
+
message: string;
|
|
4
|
+
timeout?: number;
|
|
5
|
+
icon: string;
|
|
6
|
+
closeButton: boolean;
|
|
7
|
+
id?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ToastProps {
|
|
10
|
+
clientId: string;
|
|
11
|
+
loginRedirectPath: string;
|
|
12
|
+
logoutRedirectPath: string;
|
|
13
|
+
devOrgName: string;
|
|
14
|
+
authurl: string;
|
|
15
|
+
appId: string;
|
|
16
|
+
userManager: string;
|
|
17
|
+
elementId: string;
|
|
18
|
+
toastConfig: ToastConfig;
|
|
19
|
+
}
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@os1-platform/console-ui-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
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",
|
|
7
7
|
"type": "commonjs",
|
|
8
8
|
"files": [
|
|
9
9
|
"tsconfig.json",
|
|
10
|
-
"
|
|
10
|
+
"package-lock.json",
|
|
11
|
+
"dist"
|
|
11
12
|
],
|
|
12
13
|
"scripts": {
|
|
13
14
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
29
30
|
"@fullhuman/postcss-purgecss": "^5.0.0",
|
|
30
|
-
"@os1-platform/console-ui-js": "^0.1.
|
|
31
|
+
"@os1-platform/console-ui-js": "^0.1.3",
|
|
31
32
|
"@react-native-community/eslint-config": "^2.0.0",
|
|
32
33
|
"@types/react": "^17.0.37",
|
|
33
34
|
"axios": "^0.21.4",
|
package/src/aaa/index.tsx
DELETED
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
import { AAA, ConsoleUiInit, HttpClient } from '@os1-platform/console-ui-js';
|
|
2
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { ModalProps } from '../components/modal/interface';
|
|
4
|
-
import { ToastProps } from '../components/toast/interface';
|
|
5
|
-
import axios from 'axios';
|
|
6
|
-
|
|
7
|
-
export const AuthContext = React.createContext<any | undefined>(undefined);
|
|
8
|
-
export const ConsoleUIContext = React.createContext<any>(undefined);
|
|
9
|
-
|
|
10
|
-
const HeaderAndSideBar = (props: any) => {
|
|
11
|
-
const [consoleInstance, setConsoleInstance] = useState<any>(null);
|
|
12
|
-
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
if (!props.isLoading) {
|
|
15
|
-
const console = ConsoleUiInit.getInstance(
|
|
16
|
-
props.clientId,
|
|
17
|
-
props.loginRedirectPath,
|
|
18
|
-
props.logoutRedirectPath,
|
|
19
|
-
props.devOrgName,
|
|
20
|
-
props.authurl,
|
|
21
|
-
props.appId,
|
|
22
|
-
props.userManager
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
setConsoleInstance(console);
|
|
26
|
-
console.renderHeaderAndSidebar('headerAndSidebar', props.controls);
|
|
27
|
-
}
|
|
28
|
-
}, [props.isLoading]);
|
|
29
|
-
|
|
30
|
-
if (props.isLoading) {
|
|
31
|
-
if (props.loader) {
|
|
32
|
-
return props.loader;
|
|
33
|
-
} else {
|
|
34
|
-
const keyframes = `
|
|
35
|
-
@-webkit-keyframes spin {
|
|
36
|
-
0% {
|
|
37
|
-
-webkit-transform: rotate(0deg);
|
|
38
|
-
}
|
|
39
|
-
100% {
|
|
40
|
-
-webkit-transform: rotate(360deg);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
`;
|
|
44
|
-
const styleSheets = Array.from(document.styleSheets).filter(
|
|
45
|
-
(styleSheet) =>
|
|
46
|
-
!styleSheet.href || styleSheet.href.startsWith(window.location.origin)
|
|
47
|
-
);
|
|
48
|
-
for (let style of styleSheets) {
|
|
49
|
-
if (style instanceof CSSStyleSheet && style.cssRules) {
|
|
50
|
-
style.insertRule(keyframes, style.cssRules.length);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
const loaderStyle = () => ({
|
|
54
|
-
marginTop: '50vh',
|
|
55
|
-
marginLeft: '50vw',
|
|
56
|
-
border: '12px solid #F3F3F3',
|
|
57
|
-
borderRadius: '50%',
|
|
58
|
-
borderTop: '12px solid grey',
|
|
59
|
-
width: '40px',
|
|
60
|
-
height: '40px',
|
|
61
|
-
animationName: 'spin',
|
|
62
|
-
animationDuration: '2s',
|
|
63
|
-
animationTimingFunction: 'linear',
|
|
64
|
-
animationIterationCount: 'infinite',
|
|
65
|
-
});
|
|
66
|
-
return <div style={loaderStyle()}></div>;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
//console.log(consoleInstance, props);
|
|
70
|
-
return (
|
|
71
|
-
<ConsoleUIContext.Provider value={consoleInstance}>
|
|
72
|
-
<div id="headerAndSidebar">{props.children}</div>
|
|
73
|
-
</ConsoleUIContext.Provider>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
interface TenantDTO {
|
|
78
|
-
tenantId: string;
|
|
79
|
-
tenantStatus: string;
|
|
80
|
-
tenantDns: string;
|
|
81
|
-
stackId: string;
|
|
82
|
-
stackName: string;
|
|
83
|
-
organizationShortName: string;
|
|
84
|
-
organizationBaseDomain: string;
|
|
85
|
-
stackAuthUrl: string;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const getCleanedDomain = (domain: string) => {
|
|
89
|
-
const cleanedDomain = String(domain);
|
|
90
|
-
const splitHost = cleanedDomain.split('.');
|
|
91
|
-
const org = splitHost[0] || '';
|
|
92
|
-
const cleanedOrg = org.replace('-cdev', '');
|
|
93
|
-
const base = splitHost.join('.');
|
|
94
|
-
return { orgShortName: cleanedOrg, baseDomain: base };
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const getTenantFromDevPortal = async (
|
|
98
|
-
orgShortName: any
|
|
99
|
-
): Promise<TenantDTO> => {
|
|
100
|
-
const url = `https://api.getos1.com/app/core-api/tenant?orgShortName=${orgShortName}`;
|
|
101
|
-
const response = await axios.get(url);
|
|
102
|
-
return response.data.data;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
const getTenantId = (devOrgNameArg: string | null = null): string => {
|
|
106
|
-
let devOrgName = devOrgNameArg;
|
|
107
|
-
//if (!devOrgNameArg) devOrgName = getAuthConfig().devOrgName;
|
|
108
|
-
|
|
109
|
-
const hostname = window.location.hostname || null;
|
|
110
|
-
|
|
111
|
-
return hostname
|
|
112
|
-
? (hostname.split('.')[0] == 'developer' ||
|
|
113
|
-
hostname.split('.')[0] == 'developer2' ||
|
|
114
|
-
hostname.split('.')[0].includes('-cdev')) &&
|
|
115
|
-
devOrgName
|
|
116
|
-
? devOrgName
|
|
117
|
-
: hostname.split('.')[0]
|
|
118
|
-
: '';
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
const getKeyCloakAuthority = async (domain: string, devOrgName: string) => {
|
|
122
|
-
let orgName: string = '';
|
|
123
|
-
let baseDomainName: string = '';
|
|
124
|
-
|
|
125
|
-
if (devOrgName != undefined) {
|
|
126
|
-
orgName = devOrgName;
|
|
127
|
-
baseDomainName = domain.substring(domain.indexOf('.'));
|
|
128
|
-
} else {
|
|
129
|
-
const { orgShortName, baseDomain } = getCleanedDomain(domain);
|
|
130
|
-
|
|
131
|
-
orgName = orgShortName;
|
|
132
|
-
baseDomainName = baseDomain;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (baseDomainName.includes('os1')) {
|
|
136
|
-
const tenant = await getTenantFromDevPortal(orgName);
|
|
137
|
-
|
|
138
|
-
return `${tenant.stackAuthUrl}/auth/realms/${tenant.tenantId}`;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const tenantId = getTenantId(orgName);
|
|
142
|
-
//console.log(tenantId);
|
|
143
|
-
return `https://keycloak${baseDomainName}/auth/realms/${tenantId}`;
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
const OS1Provider = (props: any) => {
|
|
147
|
-
const [authUrl, setAuthUrl] = useState('');
|
|
148
|
-
// const [tenantDns, setTenantDns] = useState('');
|
|
149
|
-
// let isMountedRef = useRef<boolean>(false);
|
|
150
|
-
|
|
151
|
-
let authUrls = '';
|
|
152
|
-
useEffect(() => {
|
|
153
|
-
(async function () {
|
|
154
|
-
authUrls = await getKeyCloakAuthority(
|
|
155
|
-
window.location.hostname,
|
|
156
|
-
props.devOrgName
|
|
157
|
-
);
|
|
158
|
-
setAuthUrl(authUrls);
|
|
159
|
-
})();
|
|
160
|
-
}, []);
|
|
161
|
-
|
|
162
|
-
return (
|
|
163
|
-
<OS1Provider2
|
|
164
|
-
clientId={props.clientId}
|
|
165
|
-
loginRedirectPath={props.loginRedirectPath}
|
|
166
|
-
logoutRedirectPath={props.logoutRedirectPath}
|
|
167
|
-
devOrgName={props.devOrgName}
|
|
168
|
-
appId={props.appId}
|
|
169
|
-
controls={props.controls}
|
|
170
|
-
authUrl={authUrl}
|
|
171
|
-
props={...props}
|
|
172
|
-
/>
|
|
173
|
-
);
|
|
174
|
-
};
|
|
175
|
-
const OS1Provider2 = (props: any) => {
|
|
176
|
-
//console.log(props);
|
|
177
|
-
const userManager = new AAA(
|
|
178
|
-
props.clientId,
|
|
179
|
-
props.loginRedirectPath,
|
|
180
|
-
props.logoutRedirectPath,
|
|
181
|
-
props.devOrgName,
|
|
182
|
-
props.authUrl
|
|
183
|
-
);
|
|
184
|
-
const value = '';
|
|
185
|
-
//console.log('userManager', userManager);
|
|
186
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
187
|
-
let isMountedRef = useRef<boolean>(false);
|
|
188
|
-
|
|
189
|
-
useEffect(() => {
|
|
190
|
-
// Store current isMounted since this could change while awaiting async operations below
|
|
191
|
-
isMountedRef.current = true;
|
|
192
|
-
(async () => {
|
|
193
|
-
let user = undefined;
|
|
194
|
-
try {
|
|
195
|
-
user = await userManager!.getUserInfo();
|
|
196
|
-
} catch (error: any) {
|
|
197
|
-
window.console.log('Error: ', error);
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Check if the user is returning back from OIDC.
|
|
201
|
-
*/
|
|
202
|
-
if (hasCodeInUrl(window.location)) {
|
|
203
|
-
await userManager?.logincallback();
|
|
204
|
-
cleanBrowserUrl();
|
|
205
|
-
setIsLoading(false);
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
if (!(await userManager?.isAuthenticated())) {
|
|
210
|
-
userManager?.login();
|
|
211
|
-
} else if (isMountedRef.current) {
|
|
212
|
-
setIsLoading(false);
|
|
213
|
-
}
|
|
214
|
-
})();
|
|
215
|
-
|
|
216
|
-
return () => {
|
|
217
|
-
isMountedRef.current = false;
|
|
218
|
-
};
|
|
219
|
-
}, [window.location, userManager]);
|
|
220
|
-
|
|
221
|
-
return (
|
|
222
|
-
<AuthContext.Provider value={value}>
|
|
223
|
-
<HeaderAndSideBar
|
|
224
|
-
userManager={userManager}
|
|
225
|
-
isLoading={isLoading}
|
|
226
|
-
loader={props.loader}
|
|
227
|
-
devOrgName={props.devOrgName}
|
|
228
|
-
controls={props.controls}
|
|
229
|
-
appId={props.appId}
|
|
230
|
-
authUrl={props.authUrl}
|
|
231
|
-
>
|
|
232
|
-
{props.props.children}
|
|
233
|
-
</HeaderAndSideBar>
|
|
234
|
-
</AuthContext.Provider>
|
|
235
|
-
);
|
|
236
|
-
};
|
|
237
|
-
const hasCodeInUrl = (location: Location): boolean => {
|
|
238
|
-
const searchParams = new URLSearchParams(location.search);
|
|
239
|
-
const hashParams = new URLSearchParams(location.hash.replace('#', '?'));
|
|
240
|
-
return Boolean(
|
|
241
|
-
searchParams.get('code') ||
|
|
242
|
-
searchParams.get('id_token') ||
|
|
243
|
-
searchParams.get('session_state') ||
|
|
244
|
-
searchParams.get('state') ||
|
|
245
|
-
hashParams.get('code') ||
|
|
246
|
-
hashParams.get('id_token') ||
|
|
247
|
-
hashParams.get('session_state') ||
|
|
248
|
-
hashParams.get('state')
|
|
249
|
-
);
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
const cleanBrowserUrl = () => {
|
|
253
|
-
const search = window.location.search;
|
|
254
|
-
|
|
255
|
-
if (
|
|
256
|
-
search &&
|
|
257
|
-
(search.includes('session_state=') ||
|
|
258
|
-
search.includes('state=') ||
|
|
259
|
-
search.includes('code='))
|
|
260
|
-
) {
|
|
261
|
-
/*
|
|
262
|
-
* Use replaceState to redirect the user away and remove the querystring parameters
|
|
263
|
-
*/
|
|
264
|
-
window.history.replaceState(
|
|
265
|
-
{},
|
|
266
|
-
document.title,
|
|
267
|
-
window.location.href.split('?')[0]
|
|
268
|
-
);
|
|
269
|
-
}
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
// export { Toast, Modal };
|
|
273
|
-
|
|
274
|
-
const OS1Toast = (props: ToastProps) => {
|
|
275
|
-
const consoleInstance = React.useContext(ConsoleUIContext);
|
|
276
|
-
const [authUrl, setAuthUrl] = useState('');
|
|
277
|
-
|
|
278
|
-
useEffect(() => {
|
|
279
|
-
if (consoleInstance) {
|
|
280
|
-
setAuthUrl(consoleInstance.authInitializer?.client?._settings._authority);
|
|
281
|
-
}
|
|
282
|
-
const console = ConsoleUiInit.getInstance(
|
|
283
|
-
props.clientId,
|
|
284
|
-
props.loginRedirectPath,
|
|
285
|
-
props.logoutRedirectPath,
|
|
286
|
-
props.devOrgName,
|
|
287
|
-
authUrl,
|
|
288
|
-
props.appId
|
|
289
|
-
);
|
|
290
|
-
console.renderToast(props.elementId, props.toastConfig);
|
|
291
|
-
}, []);
|
|
292
|
-
|
|
293
|
-
return <div id={props.elementId}></div>;
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
const OS1Modal = (props: ModalProps) => {
|
|
297
|
-
const consoleInstance = React.useContext(ConsoleUIContext);
|
|
298
|
-
const [authUrl, setAuthUrl] = useState('');
|
|
299
|
-
|
|
300
|
-
useEffect(() => {
|
|
301
|
-
if (consoleInstance) {
|
|
302
|
-
setAuthUrl(consoleInstance.authInitializer?.client?._settings._authority);
|
|
303
|
-
}
|
|
304
|
-
const console = ConsoleUiInit.getInstance(
|
|
305
|
-
props.clientId,
|
|
306
|
-
props.loginRedirectPath,
|
|
307
|
-
props.logoutRedirectPath,
|
|
308
|
-
props.devOrgName,
|
|
309
|
-
authUrl,
|
|
310
|
-
props.appId
|
|
311
|
-
);
|
|
312
|
-
console.renderModal('modal-ele', props.modalConfig);
|
|
313
|
-
}, []);
|
|
314
|
-
|
|
315
|
-
return <div id="modal-ele"></div>;
|
|
316
|
-
};
|
|
317
|
-
|
|
318
|
-
export { OS1Provider, OS1Toast, OS1Modal, HttpClient as OS1HttpClient };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export interface ModalConfig {
|
|
2
|
-
bgColor: string,
|
|
3
|
-
title: string,
|
|
4
|
-
message: string,
|
|
5
|
-
icon: string,
|
|
6
|
-
buttons: Button[]
|
|
7
|
-
id?: string,
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface Button {
|
|
11
|
-
id: string,
|
|
12
|
-
backgroundColor: string,
|
|
13
|
-
text: string,
|
|
14
|
-
event: string,
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface ModalProps {
|
|
18
|
-
clientId: string,
|
|
19
|
-
loginRedirectPath: string,
|
|
20
|
-
logoutRedirectPath: string,
|
|
21
|
-
devOrgName: string,
|
|
22
|
-
appId: string,
|
|
23
|
-
elementId: string,
|
|
24
|
-
modalConfig: ModalConfig;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface RouterProps {
|
|
28
|
-
component: string,
|
|
29
|
-
path: string,
|
|
30
|
-
exact: boolean,
|
|
31
|
-
props?: {} | undefined
|
|
32
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface ToastConfig {
|
|
2
|
-
bgColor: string,
|
|
3
|
-
message: string,
|
|
4
|
-
timeout?: number,
|
|
5
|
-
icon: string,
|
|
6
|
-
closeButton: boolean,
|
|
7
|
-
id?: string,
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface ToastProps {
|
|
11
|
-
clientId: string,
|
|
12
|
-
loginRedirectPath: string,
|
|
13
|
-
logoutRedirectPath: string,
|
|
14
|
-
devOrgName: string,
|
|
15
|
-
authurl: string,
|
|
16
|
-
appId: string,
|
|
17
|
-
userManager: string,
|
|
18
|
-
elementId: string,
|
|
19
|
-
toastConfig: ToastConfig;
|
|
20
|
-
}
|
package/src/index.ts
DELETED