@os1-platform/console-ui-react 0.5.4 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/readme.md +8 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@os1-platform/console-ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
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.
|
|
30
|
+
"@os1-platform/console-ui-js": "^0.7.0",
|
|
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
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
loginRedirectPath={'/abc'} // path that will be given when someone logins into console ui for the first time
|
|
19
19
|
logoutRedirectPath={'/'} //path that needs to be redirected when someone logouts from your application.
|
|
20
20
|
devTenantId={'tenantId'} // this is an optional parameter, need only to be passed when using in development mode.
|
|
21
|
-
appId={'SolutionName-appId'} //initial appId on which you want to land when loading console ui for the first time.
|
|
21
|
+
appId={'SolutionName-appId'} //initial appId along with solution name on which you want to land when loading console ui for the first time.
|
|
22
22
|
>
|
|
23
23
|
<Initiate setConsole={handleConsoleInstanceChange} /> //This is your
|
|
24
24
|
component, which is needed to set Instance of Console ui.
|
|
@@ -200,12 +200,13 @@
|
|
|
200
200
|
|
|
201
201
|
15. If nothing is selected then, when user clicks on app for the first time, it asks how we want to redirect the app.
|
|
202
202
|
|
|
203
|
-
16. To get Access Token, use `getAuthenticationTokens` method, for userInfo, use `getUser`, and check whether user is authenticated use `isAuthenticated()`. User have to use context of consoleUi and call authInitializer method of it.
|
|
203
|
+
16. To get Access Token, use `getAuthenticationTokens` method, for userInfo, use `getUser`, and check whether user is authenticated use `isAuthenticated()`. User have to use context of consoleUi and call authInitializer method of it. `getTenantConfigurations` method, to get all the organization based tenant data.
|
|
204
204
|
```Javascript
|
|
205
205
|
if (consoleInstance) {
|
|
206
|
-
const accessToken = consoleInstance.authInitializer.getAuthenticationTokens();
|
|
207
|
-
const userInfo = consoleInstance.authInitializer.getUser();
|
|
208
|
-
const isUserAuthenticated = consoleInstance.authInitializer.isAuthenticated();
|
|
206
|
+
const accessToken = await consoleInstance.authInitializer.getAuthenticationTokens();
|
|
207
|
+
const userInfo = await consoleInstance.authInitializer.getUser();
|
|
208
|
+
const isUserAuthenticated = await consoleInstance.authInitializer.isAuthenticated();
|
|
209
|
+
const tenantInfo = await consoleInstance.authInitializer.getTenantConfigurations();
|
|
209
210
|
}
|
|
210
211
|
```
|
|
211
212
|
|
|
@@ -329,6 +330,7 @@
|
|
|
329
330
|
float: "right", // aligning the injectable control in left or right direction
|
|
330
331
|
id: "DropDown1" // unique id that can be given to injectable control
|
|
331
332
|
functionBoundOption: [{ value: "1", text: "Mobiles" },{ value:"2", text: "Laptops" }], // This field can be a function which return array of Objects or normal array of objects in the form of [{ value: string, text: string }],
|
|
333
|
+
throttleTime: 300 // this is an optional parameter which enables to set throttletime for on scroll Event. By default it is 500 ms.
|
|
332
334
|
}
|
|
333
335
|
```
|
|
334
336
|
- **Note:-**
|
|
@@ -343,7 +345,7 @@
|
|
|
343
345
|
OS1DropDownDefaultValue('initialValue', "DropDown1"); // Here first parameter contains the value that needs to passed as initialValue, second Parameter is the id of the dropdown on which Id, needs to be set.
|
|
344
346
|
}
|
|
345
347
|
```
|
|
346
|
-
- OnChange, onScroll, OnClick, OnSearch is emitted on this injectable controls
|
|
348
|
+
- OnChange, onScroll, OnClick, OnSearch, OnBlur is emitted on this injectable controls
|
|
347
349
|
## Configuration required in Next.js projects.
|
|
348
350
|
- In Next.js, we need to have some library that supports global CSS.
|
|
349
351
|
- One of these library is `next-global-css`, we require to import `withGlobalCss` from it and wrap our configuration within it. [Link to configure next-global-css](https://www.npmjs.com/package/next-global-css)
|