atp-authorization-aiqoe 1.0.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.
Files changed (48) hide show
  1. package/README.md +364 -0
  2. package/dist/index.cjs.js +7 -0
  3. package/dist/index.esm.js +7 -0
  4. package/package.json +56 -0
  5. package/rollup.config.js +32 -0
  6. package/src/App.js +19 -0
  7. package/src/HOCs/index.js +2 -0
  8. package/src/HOCs/withAllContexts.js +17 -0
  9. package/src/assets/icons - Search.svg +10 -0
  10. package/src/assets/org_code.svg +12 -0
  11. package/src/assets/org_designation.svg +10 -0
  12. package/src/assets/org_parent.svg +12 -0
  13. package/src/assets/org_person_name.svg +12 -0
  14. package/src/components/common/Required/index.js +6 -0
  15. package/src/components/common/index.js +9 -0
  16. package/src/components/common/table/index.js +2 -0
  17. package/src/components/common/table/switch.js +42 -0
  18. package/src/components/common/table/table.js +279 -0
  19. package/src/components/common/table/tablePagination.js +282 -0
  20. package/src/components/common/table/tableRow.js +345 -0
  21. package/src/components/index.js +6 -0
  22. package/src/components/practitionerForm/index.js +1 -0
  23. package/src/components/practitionerForm/practitionerForm.js +613 -0
  24. package/src/components/selectWithLabel/index.js +107 -0
  25. package/src/components/textFieldWithSelect/index.js +194 -0
  26. package/src/components/tree/index.js +394 -0
  27. package/src/config.js +47 -0
  28. package/src/contexts/index.js +82 -0
  29. package/src/index.js +1 -0
  30. package/src/redux/index.js +6 -0
  31. package/src/screen/PermissionManagement/permissionManagement.js +184 -0
  32. package/src/screen/PermissionManagement/style.js +574 -0
  33. package/src/screen/practitionerMaster/SearchWithFilter.js +102 -0
  34. package/src/screen/practitionerMaster/practitionertable.js +490 -0
  35. package/src/screen/repositary/repositaryTabs/Users.js +1889 -0
  36. package/src/screen/repositary/repositaryTabs/createNewUser.js +328 -0
  37. package/src/screen/repositary/repositaryTabs/deleteComp.js +53 -0
  38. package/src/screen/repositary/repositaryTabs/permissionList.js +713 -0
  39. package/src/screen/repositary/repositaryTabs/repostratyMain.js +53 -0
  40. package/src/screen/repositary/repositaryTabs/rolesMapping.js +872 -0
  41. package/src/screen/repositary/repositaryTabs/styles.js +579 -0
  42. package/src/stylefix.js +17 -0
  43. package/src/themeProvider.js +120 -0
  44. package/src/utils/colors/colors.js +42 -0
  45. package/src/utils/common/function.js +33 -0
  46. package/src/utils/config.js +11 -0
  47. package/src/utils/constants.js +85 -0
  48. package/src/utils/helperFunctions.js +1234 -0
package/README.md ADDED
@@ -0,0 +1,364 @@
1
+ # React & Material UI NPM package boilerplate
2
+
3
+ A shareable Material UI component library with a playground folder to live-test components as you are developing them.
4
+
5
+ ## Technologies used
6
+
7
+ - React
8
+ - Rollup
9
+ - Material UI
10
+ - To Add (TBD)
11
+ - Prettier
12
+ - Lint
13
+ - Husky
14
+
15
+
16
+
17
+ ## Procedure to use this boilerplate
18
+
19
+ 1. Take a clone of this boilerplate
20
+ 2. Run ```npm run i-all``` to install the dependencies
21
+ 3. Modify the name, description & dependencies in the ```package.json``` and also replace the ```functional-components-boilerplate``` in the dependencies of the ```playground/package.json ``` with your package name
22
+ 4. You can remove the components you don't need from the ```src/components```
23
+ 5. Create the component following the below structure (Functional Component Structure)
24
+ 6. Export the created component in the ```src/index.js``` file
25
+ 7. Import the newly created component in the ```playground/src/App.js``` file
26
+ 8. Now run ```npm run dev``` to test the component
27
+ 9. If everything is okay, follow the below instructions to publish the package (To publish the package to NPM)
28
+
29
+
30
+
31
+ ## Overall Steps to bring the functional components of the package to the UI Builder
32
+ 1. Customize the default theme of the package (If needed)
33
+ 2. Create the functional component
34
+ 1. For the styling, only use material theme by using the useTheme() hook for both material ui components & also inline styles. Hence it can be customized based on the project
35
+ 3. Export the component in the index.js file
36
+ 1. ``` export { default as CustLayout } from './components/layout' ```
37
+ 4. Run & test the functional component with the help of the playground project
38
+ 5. After testing, publish the npm package with the proper versioning
39
+ 6. Next, add the component JSON in the DB( ArangoDB) (Details Given Below)
40
+ 7. To show the component in the UI Builder, the package needs to be added to the UI Builder code, so contact the UI Builder team. (This is only required for newly created package, after that it won't be required)
41
+
42
+
43
+ ## Functional Component Structure
44
+
45
+ ```jsx
46
+ import React from 'react';
47
+ import Typography from '@material-ui/core/Typography';
48
+ import withStyleFix from '../stylefix';
49
+ import withTheme from '../themeProvider';
50
+ import { useTheme } from '@material-ui/core/styles';
51
+ import Container from '@material-ui/core/Container';
52
+
53
+ const HelloWorld=(props)=>{
54
+ const theme = useTheme();
55
+ const {name}=props;
56
+
57
+ return(
58
+ <Container disableGutters maxWidth="lg" style={{display:"grid",placeItems:"center",minHeight:"100vh"}}>
59
+ <Typography variant="h2" style={{color:theme?.palette?.primary?.main,textAlign:"center",fontWeight:500}}>Hello {name}</Typography>
60
+ </Container>
61
+ )
62
+ }
63
+
64
+
65
+ HelloWorld.defaultProps={
66
+ name:"React & Material UI NPM package boilerplate"
67
+ }
68
+
69
+ export default withStyleFix(withTheme(HelloWorld));
70
+
71
+ //withStyleFix - It can be used to avoid class name collisions when using multiple generators in the same document.
72
+ // withTheme - To Provide the theme object to the component as a property, which can be consumed by using useTheme() hook as shown above
73
+
74
+ ```
75
+
76
+
77
+ ## Component Sample JSON to put in ArangoDB to show the component in UI Builder
78
+
79
+ ```JSON
80
+ {
81
+ "componentName": "CustLayout",
82
+ "componentId": "cmuc-comp-1",
83
+ "frameWork": "custom-material-ui-component",
84
+ "componentType": "Layout",
85
+ "isLayout": true,
86
+ "supported": [
87
+ "web"
88
+ ],
89
+ "defaultProps": {
90
+ "childComponent": true
91
+ },
92
+ "props": {
93
+ "ProjectTitle": {
94
+ "componentToRender": "messageCatalog"
95
+ },
96
+ "VersionNo": {
97
+ "componentToRender": "text"
98
+ },
99
+ "Title": {
100
+ "componentToRender": "messageCatalog"
101
+ },
102
+ "SubTitle": {
103
+ "componentToRender": "text"
104
+ },
105
+ "ImageSrc": {
106
+ "componentToRender": "imageUpload"
107
+ },
108
+ "HeaderBackgroundColor": {
109
+ "componentToRender": "text"
110
+ },
111
+ "HeaderFontColor": {
112
+ "componentToRender": "text"
113
+ },
114
+ "Header": {
115
+ "componentToRender": "select",
116
+ "options": [
117
+ true,
118
+ false
119
+ ]
120
+ },
121
+ "Transtale": {
122
+ "componentToRender": "select",
123
+ "options": [
124
+ true,
125
+ false
126
+ ]
127
+ },
128
+ "Menu": {
129
+ "componentToRender": "select",
130
+ "options": [
131
+ true,
132
+ false
133
+ ]
134
+ },
135
+ "Language": {
136
+ "componentToRender": "multiSelect",
137
+ "options": []
138
+ },
139
+ "childComponent": {
140
+ "componentToRender": "select",
141
+ "options": [
142
+ true,
143
+ false
144
+ ]
145
+ },
146
+ "navBarType": {
147
+ "componentToRender": "select",
148
+ "options": [
149
+ "Normal",
150
+ "Nested"
151
+ ]
152
+ },
153
+ "pages": {
154
+ "componentToRender": "pageSelect",
155
+ "value": [
156
+ {
157
+ "name": {
158
+ "componentToRender": "text"
159
+ },
160
+ "page": {
161
+ "componentToRender": "text"
162
+ },
163
+ "childPageSelect": {
164
+ "componentToRender": "childPageSelect"
165
+ }
166
+ }
167
+ ]
168
+ }
169
+ },
170
+ "active": true
171
+ }
172
+ ```
173
+
174
+ ## Function Component Sample JSON Explanation
175
+
176
+ ```JSON
177
+ {
178
+ "componentName": "CustLayout", //component Name
179
+ "componentId": "cmuc-comp-1", // packagename(fullname or shortform in kebab case) + Unique Id (Serial No)
180
+ "frameWork": "functional-components-boilerplate", //Package Name
181
+ "componentType": "Layout", // Possible Values ["Lab","Layout","Data Display","Lab","Inputs","Surfaces"]. Refer UI Builder
182
+ "isLayout": false, // For custom components isLayout always will be false
183
+ "supported": [
184
+ "web"
185
+ ], // Default web
186
+ "defaultProps": {
187
+ "childComponent": true
188
+ }, // Pass the default props of the component
189
+ "props": {
190
+
191
+ // Basic Structure
192
+ "key":{
193
+ "componentToRender":"text" // This is for the UI Builder. It will render the property with the componentToRender type like text ,select, etc.. in the properties panel
194
+ }
195
+ //Possible Values for componentToRender ["text","number", "messageCatalog","select","icons","imageUpload","component","pageSelect","NestedNav","arrayOfObject","freeMultiSelect","multiSelect"];
196
+
197
+ //For More details contact the UI Builder Team
198
+
199
+ //Examples
200
+
201
+ "ProjectTitle": {
202
+ "componentToRender": "messageCatalog"
203
+ },
204
+ "VersionNo": {
205
+ "componentToRender": "text"
206
+ },
207
+ "Title": {
208
+ "componentToRender": "messageCatalog"
209
+ },
210
+ "SubTitle": {
211
+ "componentToRender": "text"
212
+ },
213
+ "ImageSrc": {
214
+ "componentToRender": "imageUpload"
215
+ },
216
+ "HeaderBackgroundColor": {
217
+ "componentToRender": "text"
218
+ },
219
+ "HeaderFontColor": {
220
+ "componentToRender": "text"
221
+ },
222
+ "Header": {
223
+ "componentToRender": "select",
224
+ "options": [
225
+ true,
226
+ false
227
+ ]
228
+ },
229
+ "Transtale": {
230
+ "componentToRender": "select",
231
+ "options": [
232
+ true,
233
+ false
234
+ ]
235
+ },
236
+ "Menu": {
237
+ "componentToRender": "select",
238
+ "options": [
239
+ true,
240
+ false
241
+ ]
242
+ },
243
+ "Language": {
244
+ "componentToRender": "multiSelect",
245
+ "options": []
246
+ },
247
+ "childComponent": {
248
+ "componentToRender": "select",
249
+ "options": [
250
+ true,
251
+ false
252
+ ]
253
+ },
254
+ "navBarType": {
255
+ "componentToRender": "select",
256
+ "options": [
257
+ "Normal",
258
+ "Nested"
259
+ ]
260
+ },
261
+ "pages": {
262
+ "componentToRender": "pageSelect",
263
+ "value": [
264
+ {
265
+ "name": {
266
+ "componentToRender": "text"
267
+ },
268
+ "page": {
269
+ "componentToRender": "text"
270
+ },
271
+ "childPageSelect": {
272
+ "componentToRender": "childPageSelect"
273
+ }
274
+ }
275
+ ]
276
+ }
277
+ },
278
+ "active": true // When false the component will not be shown in the UI Builder
279
+ }
280
+ ```
281
+
282
+ ## Available Scripts
283
+
284
+ ```JSON
285
+ "build": "rollup -c", // To build the package
286
+ "start": "rollup -c -w", // To build & watch the package
287
+ "start-playground": "cd playground && npm run start", // To start the playground
288
+ "i-all": "npm i && cd playground && npm i", // To the install the dependencies after cloning this boilerplate
289
+ "dev": "npm-run-all --parallel start start-playground" // To run both the package & playground project
290
+
291
+ ```
292
+
293
+ ## To package and test the created component in the playground Project
294
+
295
+ 1. Run ```npm run dev``` to live-test the components
296
+
297
+
298
+ ## To package and test the created component in a external react project
299
+
300
+ To bundle and test in local follow below steps. Make sure you have run the npm run build command or npm start before testing.
301
+
302
+ 1. Run npm link. It will create a symlink in the global folder file.
303
+
304
+ 2. Then go the project you want to use the package. And run the below command
305
+ npm link packagename(functional-components-boilerplate).
306
+
307
+ The above command just include the functional-components-boilerplate in the node_modules (not add anything in package.json).
308
+
309
+ ```jsx
310
+ import React from 'react';
311
+
312
+ import { HelloWorld } from 'functional-components-boilerplate';
313
+
314
+ const App = () => {
315
+ return <HelloWorld />
316
+ }
317
+
318
+ export default App;
319
+
320
+ ```
321
+
322
+ ## To publish the package to NPM
323
+
324
+ To publish the package to NPM follow the below setps
325
+
326
+ 1. First, build and commit the library
327
+ ```npm run build```
328
+ ```git add .```
329
+ ```git commit -m 'your commit message'```
330
+ 2. Then update the version of the package
331
+ 1. ```npm version patch``` - For a bug fix
332
+ 2. ```npm version minor``` - For a new component addition
333
+ 3. ```npm version major``` - For a completed feature.
334
+ 3. Then login to the NPM account using the below command (ignore if you already logged in) ```npm login``` It asks the NPM credentials
335
+ 4. Finally run ```npm publish --access public``` to publish
336
+ 5. Then, login into the NPM site and check the version update there.
337
+
338
+ For further more details refere the below link
339
+ [How to create,test and publish a NPM package in react.](https://gitlab.com/snippets/1995604)
340
+
341
+
342
+
343
+ ## Requirements Status
344
+ - [x] Boilerplate Setup with playground
345
+ - [x] Using components styles from the theme setup
346
+ - [ ] Access control for the components
347
+ - [ ] Multilingual setup for the components
348
+
349
+
350
+ ## Changelog
351
+
352
+ ### 14-06-22
353
+ - Boiler Plate created
354
+ - Basic instructions to use this boilerplate (```README.md```) added
355
+
356
+ ### 15-06-22
357
+ - Configured the theme setup & the style fix for the material ui components
358
+ - Added ```.npmignore```
359
+ - IDM.md file removed
360
+ - Updated the ```README.md``` file
361
+
362
+ ### 17-06-21
363
+ - Added the ```atp-casbin``` package for the IDM
364
+ - Added the instructions to use the ```atp-casbin``` package in the ```IDM.md``` file