ui-soxo-bootstrap-core 2.4.24 → 2.4.25-dev.11

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 (37) hide show
  1. package/.github/workflows/npm-publish.yml +37 -15
  2. package/core/components/extra-info/extra-info-details.js +109 -126
  3. package/core/components/landing-api/landing-api.js +22 -30
  4. package/core/lib/Store.js +20 -18
  5. package/core/lib/components/index.js +4 -1
  6. package/core/lib/components/sidemenu/sidemenu.js +153 -256
  7. package/core/lib/components/sidemenu/sidemenu.scss +39 -26
  8. package/core/lib/elements/basic/dragabble-wrapper/draggable-wrapper.js +119 -42
  9. package/core/lib/elements/basic/rangepicker/rangepicker.js +118 -29
  10. package/core/lib/elements/basic/switch/switch.js +35 -25
  11. package/core/lib/hooks/index.js +2 -12
  12. package/core/lib/hooks/use-otp-timer.js +99 -0
  13. package/core/lib/pages/login/login.js +255 -139
  14. package/core/lib/pages/login/login.scss +140 -32
  15. package/core/models/dashboard/dashboard.js +14 -0
  16. package/core/models/doctor/components/doctor-add/doctor-add.js +403 -0
  17. package/core/models/doctor/components/doctor-add/doctor-add.scss +32 -0
  18. package/core/models/menus/components/menu-add/menu-add.js +220 -267
  19. package/core/models/menus/components/menu-lists/menu-lists.js +366 -211
  20. package/core/models/menus/components/menu-lists/menu-lists.scss +6 -2
  21. package/core/models/menus/menus.js +256 -267
  22. package/core/models/roles/components/role-add/role-add.js +265 -228
  23. package/core/models/roles/components/role-list/role-list.js +326 -348
  24. package/core/models/roles/roles.js +191 -174
  25. package/core/models/staff/components/staff-add/staff-add.js +352 -0
  26. package/core/models/staff/components/staff-add/staff-add.scss +0 -0
  27. package/core/models/users/components/user-add/user-add.js +723 -367
  28. package/core/models/users/components/user-add/user-edit.js +90 -0
  29. package/core/models/users/users.js +318 -165
  30. package/core/modules/index.js +5 -8
  31. package/core/modules/reporting/components/index.js +5 -0
  32. package/core/modules/reporting/components/reporting-dashboard/reporting-dashboard.js +65 -2
  33. package/core/modules/steps/action-buttons.js +79 -0
  34. package/core/modules/steps/steps.js +553 -0
  35. package/core/modules/steps/steps.scss +158 -0
  36. package/core/modules/steps/timeline.js +49 -0
  37. package/package.json +2 -2
@@ -11,23 +11,45 @@ jobs:
11
11
  build:
12
12
  runs-on: ubuntu-latest
13
13
  steps:
14
- - uses: actions/checkout@v3
15
- - uses: actions/setup-node@v3
16
- with:
17
- node-version: 16
18
- - run: npm i
19
- # - run: npm test
14
+ # 1. Checkout the repository
15
+ - name: Checkout Code
16
+ uses: actions/checkout@v3
20
17
 
21
- publish-npm:
22
- needs: build
23
- runs-on: ubuntu-latest
24
- steps:
25
- - uses: actions/checkout@v3
26
- - uses: actions/setup-node@v3
18
+ # 2. Setup Node.js and npm registry
19
+ - name: Setup Node.js
20
+ uses: actions/setup-node@v3
27
21
  with:
28
22
  node-version: 16
29
23
  registry-url: https://registry.npmjs.org/
30
- - run: npm i
31
- - run: npm publish
24
+
25
+ # 3. Install dependencies using ci for reproducibility
26
+ - name: Install Dependencies
27
+ run: npm ci
28
+
29
+ # 4. Verify tag matches package.json version
30
+ - name: Verify Tag Matches Version
31
+ run: |
32
+ TAG=${GITHUB_REF#refs/tags/}
33
+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
34
+ echo "Release Tag: $TAG"
35
+ echo "Package Version: $PACKAGE_VERSION"
36
+
37
+ if [[ "$TAG" != "v$PACKAGE_VERSION"* ]]; then
38
+ echo "Error: Tag does not match package.json version"
39
+ exit 1
40
+ fi
41
+
42
+ # 5. Publish the package
43
+ - name: Publish Package
44
+ run: |
45
+ TAG_NAME=${GITHUB_REF#refs/tags/}
46
+
47
+ if [[ "$TAG_NAME" == *"dev"* ]]; then
48
+ echo "Publishing development package with 'dev' tag"
49
+ npm publish --tag dev
50
+ else
51
+ echo "Publishing stable package"
52
+ npm publish
53
+ fi
32
54
  env:
33
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
55
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -1,7 +1,7 @@
1
1
  /**
2
- * ExtraInfoDetail component contains the button and the data for corresponding to script mode and will open extrainfo
2
+ * ExtraInfoDetail component contains the button and the data for corresponding to script mode and will open extrainfo
3
3
  *
4
- * @description
4
+ * @description
5
5
  * @author Sneha T
6
6
  */
7
7
 
@@ -21,152 +21,135 @@ import ExtraInfo from './extra-info';
21
21
 
22
22
  const { TabPane } = Tabs;
23
23
 
24
- export default function ExtraInfoDetail({ modeValue, icon, title, tabPosition='left',showDrawerData,dbPtr,callback,...record}) {
25
- // State to control drawer
26
- const [open, setOpen] = useState(false);
24
+ export default function ExtraInfoDetail({ modeValue, icon, title, tabPosition = 'left', showDrawerData, dbPtr, callback, ...record }) {
25
+ // State to control drawer
26
+ const [open, setOpen] = useState(false);
27
27
 
28
- // To set extra info data
29
- const [info, setInfo] = useState([]);
30
- //Setting active key for tabs
31
- const [activeKey, setActiveKey] = useState(null);
28
+ // To set extra info data
29
+ const [info, setInfo] = useState([]);
30
+ //Setting active key for tabs
31
+ const [activeKey, setActiveKey] = useState(null);
32
32
 
33
- // To strore selected item
34
- const [selectedItem, setSelectedItem] = useState(null);
33
+ // To strore selected item
34
+ const [selectedItem, setSelectedItem] = useState(null);
35
35
 
36
- const [loading, setLoading] = useState(true);
36
+ const [loading, setLoading] = useState(true);
37
37
 
38
- /**
39
- * Show Drawer
40
- */
41
- const showDrawer = () => {
42
-
43
- setActiveKey(null); // Reset activeKey before fetching new info
44
-
45
- getExtraInfo();
38
+ /**
39
+ * Show Drawer
40
+ */
41
+ const showDrawer = () => {
42
+ setActiveKey(null); // Reset activeKey before fetching new info
46
43
 
47
- setOpen(true);
44
+ getExtraInfo();
48
45
 
49
- };
46
+ setOpen(true);
47
+ };
50
48
 
51
- /**
52
- * Function to close
53
- */
54
- const onClose = () => {
55
- if (typeof callback === 'function') {
56
- // Only call if it exists
57
- callback(false);
58
- }
59
- setOpen(false);
60
- };
49
+ /**
50
+ * Function to close
51
+ */
52
+ const onClose = () => {
53
+ if (typeof callback === 'function') {
54
+ // Only call if it exists
55
+ callback(false);
56
+ }
57
+ setOpen(false);
58
+ };
61
59
 
62
- /**
63
- * Function to get Info
64
- */
65
- async function getExtraInfo() {
60
+ /**
61
+ * Function to get Info
62
+ */
63
+ async function getExtraInfo() {
64
+ setSelectedItem();
66
65
 
67
- setSelectedItem()
66
+ setLoading(true);
68
67
 
69
- setLoading(true);
68
+ let mode = modeValue;
70
69
 
71
- let mode = modeValue
70
+ const result = await Dashboard.getExtraInfo(mode);
72
71
 
73
- const result = await Dashboard.getExtraInfo(mode);
72
+ setInfo(result);
74
73
 
75
- setInfo(result);
74
+ setSelectedItem(result[0]);
76
75
 
77
- setSelectedItem(result[0])
76
+ setActiveKey(result[0].id.toString()); // Set activeKey to the first item's id
78
77
 
79
- setActiveKey(result[0].id.toString()); // Set activeKey to the first item's id
78
+ setLoading(false);
79
+ }
80
80
 
81
- setLoading(false);
81
+ useEffect(() => {
82
+ // If showDrawerData is true then call showDrawer function
83
+ if (showDrawerData) {
84
+ showDrawer();
82
85
  }
86
+ }, [showDrawerData]);
83
87
 
84
- useEffect(() => {
85
- // If showDrawerData is true then call showDrawer function
86
- if (showDrawerData) {
87
- showDrawer();
88
- }
89
- }, [showDrawerData]);
90
-
91
- /**
88
+ /**
92
89
  * Function to render icon or button
93
90
  */
94
- const renderIconOrButton = () => {
95
- switch (icon) {
96
- case 'InfoCircleFilled':
97
- return <InfoCircleFilled onClick={showDrawer} />;
98
- case 'Button':
99
- return <Button size="small" onClick={showDrawer}>Show Info</Button>;
100
- default:
101
- return null;
102
- }
103
- };
104
-
105
-
106
-
107
- return (
108
- <>
109
- {/* {loading ? (
91
+ const renderIconOrButton = () => {
92
+ switch (icon) {
93
+ case 'InfoCircleFilled':
94
+ return <InfoCircleFilled onClick={showDrawer} />;
95
+ case 'Button':
96
+ return (
97
+ <Button size="small" onClick={showDrawer}>
98
+ Show Info
99
+ </Button>
100
+ );
101
+ default:
102
+ return null;
103
+ }
104
+ };
105
+
106
+ return (
107
+ <>
108
+ {/* {loading ? (
110
109
  <>
111
110
  <Skeleton active />
112
111
  </>
113
112
  ) : ( */}
114
- <>
115
- {/* */}
116
- {/* <Button onClick={showDrawer}> */}
117
-
118
- {/* <InfoCircleFilled onMouseEnter={showDrawer} /> */}
119
-
120
- {renderIconOrButton()}
121
- {/* </Button> */}
122
- {/* */}
123
-
124
- {/* */}
125
- <Drawer
126
-
127
- width={'85%'}
128
-
129
- title={title} onClose={onClose} open={open}>
130
-
131
- <div className="main-drawer-content">
132
-
133
- <div className="drawer-container">
134
-
135
- <div className="drawer-click"> {/* Flexbox approach */}
136
- <Tabs
137
- tabPosition={tabPosition}
138
-
139
- activeKey={activeKey} // Set activeKey to control the active tab
140
-
141
- onChange={(key) => {
142
-
143
- const selectedItem = info.find(item => item.id.toString() === key);
144
-
145
- setSelectedItem(selectedItem);
146
-
147
- setActiveKey(key);
148
- }}
149
- >
150
- {info.map(item => (
151
- <TabPane tab={item.caption} key={item.id.toString()} />
152
- ))}
153
- </Tabs>
154
- </div>
155
-
156
- <div className="right-drawer">
157
-
158
- {selectedItem && !loading ? <ExtraInfo item={selectedItem} record={record} dbPtr={dbPtr}/> : null}
159
-
160
- </div>
161
-
162
- </div>
163
-
164
- </div>
165
-
166
- </Drawer>
167
-
168
- </>
169
- {/* )} */}
170
- </>
171
- );
113
+ <>
114
+ {/* */}
115
+ {/* <Button onClick={showDrawer}> */}
116
+
117
+ {/* <InfoCircleFilled onMouseEnter={showDrawer} /> */}
118
+
119
+ {renderIconOrButton()}
120
+ {/* </Button> */}
121
+ {/* */}
122
+
123
+ {/* */}
124
+ <Drawer width={'35%'} title={title} onClose={onClose} open={open}>
125
+ <div className="main-drawer-content">
126
+ <div className="drawer-container">
127
+ <div className="drawer-click">
128
+ {' '}
129
+ {/* Flexbox approach */}
130
+ <Tabs
131
+ tabPosition={tabPosition}
132
+ activeKey={activeKey} // Set activeKey to control the active tab
133
+ onChange={(key) => {
134
+ const selectedItem = info.find((item) => item.id.toString() === key);
135
+
136
+ setSelectedItem(selectedItem);
137
+
138
+ setActiveKey(key);
139
+ }}
140
+ >
141
+ {info.map((item) => (
142
+ <TabPane tab={item.caption} key={item.id.toString()} />
143
+ ))}
144
+ </Tabs>
145
+ </div>
146
+
147
+ <div className="right-drawer">{selectedItem && !loading ? <ExtraInfo item={selectedItem} record={record} dbPtr={dbPtr} /> : null}</div>
148
+ </div>
149
+ </div>
150
+ </Drawer>
151
+ </>
152
+ {/* )} */}
153
+ </>
154
+ );
172
155
  }
@@ -96,7 +96,6 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
96
96
  * @param reports
97
97
  */
98
98
  async function loadMenus(reports) {
99
-
100
99
  setLoader(true);
101
100
 
102
101
  // setReports(report)
@@ -106,16 +105,12 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
106
105
  // console.log(result);
107
106
 
108
107
  if (result && Array.isArray(result.result) && result.result.length) {
109
-
110
108
  // setModules(result.result);
111
-
112
109
  // result.result.map((ele) => {
113
110
  // let languageString = JSON.parse(ele.attributes)
114
111
  // console.log('language_string', languageString);
115
112
  // if (languageString && languageString.languages) {
116
-
117
113
  // const language = i18n.language;
118
-
119
114
  // i18n.addResourceBundle(language, 'translation', languageString.languages[i18n.language]);
120
115
  // }
121
116
  // })
@@ -126,7 +121,6 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
126
121
  dispatch({ type: 'settings', payload: result.result.settings });
127
122
  }
128
123
 
129
-
130
124
  // Reports length
131
125
  if (reports.length) {
132
126
  reportMenus = [
@@ -153,30 +147,25 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
153
147
 
154
148
  /**If there is roles assigned to the user */
155
149
  // for matria
156
- const useCoreMenus= process.env.REACT_APP_USE_CORE_MENUS === 'true';
157
- if(useCoreMenus){
158
- if (result && result.result && reportMenus) {
159
- setAllModules([...result.result, ...reportMenus, ...coreModules]);
160
- } else {
161
- //If there is no roles assigned to the user
162
- setAllModules([...coreModules]);
163
- }
164
-
165
- } else{
166
- // for nura
167
- if (result && result.result.menus && reportMenus) {
168
- setAllModules([...result.result.menus, ...reportMenus, ...coreModules]);
150
+ const useCoreMenus = process.env.REACT_APP_USE_CORE_MENUS === 'true';
151
+ if (useCoreMenus) {
152
+ if (result && result.result && reportMenus) {
153
+ setAllModules([...result.result, ...reportMenus, ...coreModules]);
154
+ } else {
155
+ //If there is no roles assigned to the user
156
+ setAllModules([...coreModules]);
157
+ }
169
158
  } else {
170
- //If there is no roles assigned to the user
171
- setAllModules([...coreModules]);
159
+ // for nura
160
+ if (result && result.result.menus && reportMenus) {
161
+ setAllModules([...result.result.menus, ...reportMenus, ...coreModules]);
162
+ } else {
163
+ //If there is no roles assigned to the user
164
+ setAllModules([...coreModules]);
165
+ }
172
166
  }
173
-
174
-
167
+ setLoader(false);
175
168
  }
176
- setLoader(false);
177
-
178
- }
179
-
180
169
 
181
170
  /**
182
171
  * Load the scripts
@@ -257,6 +246,12 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
257
246
 
258
247
  <Route exact key={'profile'} path={'/profile'} render={(props) => <Profile {...props} />} />
259
248
 
249
+ {/* More specific routes should come before general/dynamic routes */}
250
+
251
+
252
+ <Route path={'/reports/:id'} render={(props) => <ReportingDashboard CustomComponents={CustomComponents} {...props} />} />
253
+
254
+
260
255
  <Route path={'/menus/:id'} render={() => <ModuleRoutes model={MenusAPI} />} />
261
256
 
262
257
  {/* <Switch> */}
@@ -273,9 +268,6 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
273
268
  }}
274
269
  />
275
270
 
276
- {/* <Route path={'/users'} render={() => <ModuleRoutes model={UsersAPI} />} /> */}
277
-
278
- <Route path={'/reports/:id'} render={(props) => <ReportingDashboard CustomComponents={CustomComponents} {...props} />} />
279
271
 
280
272
  <Route exact key={'change-password'} path={'/change-password'} render={(props) => <ChangePassword {...props} />} />
281
273
 
package/core/lib/Store.js CHANGED
@@ -48,25 +48,25 @@ import { ConfigProvider, theme } from 'antd';
48
48
  const initialTheme = () => {
49
49
  try {
50
50
  // manage theme with env
51
- const isEnvThemeTrue = process.env.REACT_APP_THEME;
51
+ const isEnvThemeTrue = process.env.REACT_APP_THEME;
52
52
 
53
- console.log('REACT_APP_THEME:', isEnvThemeTrue);
54
- const matchedTheme = themes.find(t => t.name === isEnvThemeTrue);
53
+ console.log('REACT_APP_THEME:', isEnvThemeTrue);
54
+ const matchedTheme = themes.find((t) => t.name === isEnvThemeTrue);
55
55
 
56
56
  if (matchedTheme) return matchedTheme;
57
-
58
- // Check saved theme
59
- const savedTheme = localStorage.getItem('selectedTheme');
60
- if (savedTheme) {
61
- return JSON.parse(savedTheme);
62
- }
63
-
64
- // Fallback to default
65
- return themes[0];
66
- } catch (e) {
67
- console.error('Error loading theme:', e);
68
- return themes[0];
57
+
58
+ // Check saved theme
59
+ const savedTheme = localStorage.getItem('selectedTheme');
60
+ if (savedTheme) {
61
+ return JSON.parse(savedTheme);
69
62
  }
63
+
64
+ // Fallback to default
65
+ return themes[0];
66
+ } catch (e) {
67
+ console.error('Error loading theme:', e);
68
+ return themes[0];
69
+ }
70
70
  };
71
71
 
72
72
  const initialState = {
@@ -87,7 +87,7 @@ let app = {};
87
87
  * @param {*} param0
88
88
  * @returns
89
89
  */
90
- export const GlobalProvider = ({ children, CustomModels, appSettings: settings }) => {
90
+ export const GlobalProvider = ({ children, CustomModels,CustomComponents, appSettings: settings }) => {
91
91
  // console.log("Setting up store");
92
92
 
93
93
  const [branches, setBranches] = useState([]);
@@ -226,13 +226,14 @@ export const GlobalProvider = ({ children, CustomModels, appSettings: settings }
226
226
  let store = {
227
227
  app: app,
228
228
  user: state.user,
229
- settings:state.settings,
229
+ settings: state.settings,
230
230
  dispatch: dispatch,
231
231
  twilio: state.twilio,
232
232
  isMobile,
233
233
  branches,
234
234
  defaultBranch: state.defaultBranch,
235
235
  CustomModels: CustomModels,
236
+ CustomComponents:CustomComponents,
236
237
  selectedBranch: state.selectedBranch,
237
238
  kiosk: state.kiosk,
238
239
  state,
@@ -314,7 +315,8 @@ export const AppReducer = (state, action) => {
314
315
 
315
316
  case 'CustomModels':
316
317
  return { ...state, CustomModels: action.CustomModels };
317
-
318
+ case 'CustomComponents':
319
+ return { ...state, CustomComponents: action.CustomComponents };
318
320
  // # TODO Below Variable might be removed
319
321
  case 'selectedLocation':
320
322
  localStorage.selectedLocation = JSON.stringify(action.payload);
@@ -109,6 +109,8 @@ import ConsentComponent from './consent/consent'
109
109
  import TaskOverviewLegacy from './../models/process/components/task-overview-legacy/task-overview-legacy'
110
110
 
111
111
  import ReportingDashboard from '../../modules/reporting/components/reporting-dashboard/reporting-dashboard';
112
+
113
+ import ProcessStepsPage from '../../modules/steps/steps'
112
114
  export {
113
115
 
114
116
  // Bootstrap Components
@@ -197,7 +199,8 @@ export {
197
199
  // WebCamera,
198
200
  ConsentComponent,
199
201
 
200
- ReportingDashboard
202
+ ReportingDashboard,
203
+ ProcessStepsPage
201
204
 
202
205
 
203
206
  }