ui-soxo-bootstrap-core 2.6.7 → 2.6.9

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.
@@ -21,7 +21,7 @@ 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 }) {
24
+ export default function ExtraInfoDetail({ modeValue, icon, title, tabPosition = 'left', showDrawerData, dbPtr, callback, drawerWidth = '35%', ...record }) {
25
25
  // State to control drawer
26
26
  const [open, setOpen] = useState(false);
27
27
 
@@ -121,7 +121,7 @@ export default function ExtraInfoDetail({ modeValue, icon, title, tabPosition =
121
121
  {/* */}
122
122
 
123
123
  {/* */}
124
- <Drawer width={'35%'} title={title} onClose={onClose} open={open}>
124
+ <Drawer width={drawerWidth} title={title} onClose={onClose} open={open}>
125
125
  <div className="main-drawer-content">
126
126
  <div className="drawer-container">
127
127
  <div className="drawer-click">
@@ -95,7 +95,11 @@ const UserAdd = ({ model, callback, edit, history, formContent, match, additiona
95
95
  const [body, setBody] = useState(formContent);
96
96
 
97
97
  const [isPasswordVisible, setIsPasswordVisible] = useState(false);
98
- const [visible, setVisible] = useState(false);
98
+
99
+ // state for doctor and staff visibility
100
+ const [doctorVisible, setDoctorVisible] = useState(false);
101
+ const [staffVisible, setStaffVisible] = useState(false);
102
+
99
103
 
100
104
  const formData = {
101
105
  ...body,
@@ -541,7 +545,7 @@ const UserAdd = ({ model, callback, edit, history, formContent, match, additiona
541
545
  borderTop: '1px solid #f0f0f0',
542
546
  color: '#1890ff',
543
547
  }}
544
- onClick={() => setVisible(true)}
548
+ onClick={() => setDoctorVisible(true)}
545
549
  >
546
550
  + Add New Doctor
547
551
  </div>
@@ -570,7 +574,7 @@ const UserAdd = ({ model, callback, edit, history, formContent, match, additiona
570
574
  borderTop: '1px solid #f0f0f0',
571
575
  color: '#1890ff',
572
576
  }}
573
- onClick={() => setVisible(true)}
577
+ onClick={() => setStaffVisible(true)}
574
578
  >
575
579
  + Add New Staff
576
580
  </div>
@@ -832,15 +836,15 @@ const UserAdd = ({ model, callback, edit, history, formContent, match, additiona
832
836
  )}
833
837
  {/* Render DoctorAdd OUTSIDE the Select */}
834
838
  <DoctorAdd
835
- visible={visible}
836
- onCancel={() => setVisible(false)}
839
+ visible={doctorVisible}
840
+ onCancel={() => setDoctorVisible(false)}
837
841
  attributes={attributes}
838
842
  doctorData={selectedDoctor}
839
843
  doctorId={doctorID}
840
844
  onSuccess={getDoctors}
841
845
  />
842
846
 
843
- <StaffAdd visible={visible} onCancel={() => setVisible(false)} staffData={selectedStaff} staffId={staffID} onSuccess={getStaff} />
847
+ <StaffAdd visible={staffVisible} onCancel={() => setStaffVisible(false)} staffData={selectedStaff} staffId={staffID} onSuccess={getStaff} />
844
848
  </section>
845
849
  );
846
850
  };
@@ -37,6 +37,7 @@ export default function buildDisplayColumns({ columns = [], patients = [], isFix
37
37
  render: (value, item, index) => index + 1,
38
38
  key: 'ColumnIndex',
39
39
  fixed: isFixedIndex ? 'left' : null,
40
+ width: 2,
40
41
  },
41
42
  ];
42
43
 
@@ -105,16 +105,14 @@ export default function ReportingDashboard({
105
105
  const fetchId = idOverride || id;
106
106
  await CoreScripts.getRecord({ id: fetchId, dbPtr }).then(async ({ result }) => {
107
107
  // Check if display columns are provided from backend
108
- if (result.display_columns) {
109
- // Parse and set columns from stored JSON
110
-
111
- setColumns(JSON.parse(result.display_columns));
112
- } else {
113
- // Reset columns if no display columns exist
108
+ let parsedColumns = [];
114
109
 
115
- setColumns([]);
110
+ if (result.display_columns) {
111
+ parsedColumns = JSON.parse(result.display_columns);
116
112
  }
117
- await prepareInputParameters(result);
113
+ setColumns(parsedColumns);
114
+
115
+ await prepareInputParameters(result, parsedColumns);
118
116
 
119
117
  if (result.summary_columns) {
120
118
  setSummaryColumns(JSON.parse(result.summary_columns));
@@ -159,7 +157,7 @@ export default function ReportingDashboard({
159
157
  */
160
158
 
161
159
  //Prepare input parameters by mapping default values and binding models if needed
162
- async function prepareInputParameters(record) {
160
+ async function prepareInputParameters(record, parsedColumns) {
163
161
  setLoading(true);
164
162
  let urlParams = Location.search();
165
163
 
@@ -235,7 +233,7 @@ export default function ReportingDashboard({
235
233
  setformContents(formContent);
236
234
 
237
235
  // Trigger form submission
238
- onFinish(formContent, null, record.input_parameters);
236
+ onFinish(formContent, null, record.input_parameters, parsedColumns);
239
237
 
240
238
  setLoading(false);
241
239
 
@@ -259,7 +257,7 @@ export default function ReportingDashboard({
259
257
  getPatientDetails();
260
258
  }
261
259
 
262
- const fetchReportData = async (id, values, dbPtr, pagination) => {
260
+ const fetchReportData = async (id, values, dbPtr, pagination, parsedColumns) => {
263
261
  const { current, pageSize } = pagination || {};
264
262
  // If card script id is exist load that id otherwise load id
265
263
  const coreScriptId = scriptId.current ? scriptId.current : id;
@@ -300,8 +298,10 @@ export default function ReportingDashboard({
300
298
  }
301
299
  // Update patients
302
300
  setPatients(resultDetails || []);
301
+ console.log(parsedColumns);
302
+
303
303
  // Check if columns are not yet defined
304
- if (columns.length === 0 && resultDetails.length > 0) {
304
+ if (parsedColumns.length === 0 && resultDetails.length > 0) {
305
305
  // Create columns dynamically from resultDetails keys
306
306
  setColumns((prev) => {
307
307
  if (prev.length > 0) return prev;
@@ -363,7 +363,7 @@ export default function ReportingDashboard({
363
363
  * @param {*} values
364
364
  */
365
365
 
366
- const onFinish = async (values, resetPage, inputParamsString) => {
366
+ const onFinish = async (values, resetPage, inputParamsString, parsedColumns) => {
367
367
  setLoading(true);
368
368
  setCardLoading(true);
369
369
  // // Check if the dashboard is visible and both start and end values are provided
@@ -423,7 +423,7 @@ export default function ReportingDashboard({
423
423
 
424
424
  // Call API
425
425
  try {
426
- await fetchReportData(id, values, dbPtr, paginationData);
426
+ await fetchReportData(id, values, dbPtr, paginationData, parsedColumns);
427
427
  } finally {
428
428
  setLoading(false);
429
429
  setCardLoading(false);
@@ -634,13 +634,13 @@ function GuestList({
634
634
  useEffect(() => {
635
635
  //Cheaking if there is patient data exists
636
636
  if (patients) {
637
- let data = patients?.map((entry) => {
638
- entry.rowIndex = entry.opb_id;
637
+ // let data = patients?.map((entry) => {
638
+ // entry.rowIndex = entry.opb_id;
639
639
 
640
- entry.dispatch = dispatch;
640
+ // entry.dispatch = dispatch;
641
641
 
642
- return entry;
643
- });
642
+ // return entry;
643
+ // });
644
644
 
645
645
  // setData(data);
646
646
 
@@ -797,7 +797,6 @@ function GuestList({
797
797
  </div>
798
798
 
799
799
  <div>
800
-
801
800
  <Card>
802
801
  {loading ? (
803
802
  <>
@@ -806,10 +805,12 @@ function GuestList({
806
805
  ) : (
807
806
  <TableComponent
808
807
  size="small"
809
- scroll={{ x: 'max-content' }}
808
+ // scroll={{ x: 'max-content' }}
809
+ scroll={{ x: 'max-content', y: '60vh' }}
810
810
  rowKey={(record) => record.OpNo}
811
811
  dataSource={filtered ? filtered : patients} // In case if there is no filtered values we can use patient data
812
812
  columns={cols}
813
+ sticky
813
814
  pagination={false}
814
815
  // title={config.caption}
815
816
  summary={(pageData) => {
@@ -3,7 +3,7 @@
3
3
  * Handles navigation and action controls for a multi-step process,
4
4
  * including dynamic content rendering and process completion actions.
5
5
  */
6
- import React, { useState } from 'react';
6
+ import React, { useState, useEffect } from 'react';
7
7
  import { Skeleton } from 'antd';
8
8
  import { Button } from '../../lib';
9
9
  import './action-buttons.scss';
@@ -23,7 +23,9 @@ export default function ActionButtons({
23
23
  timelineCollapsed,
24
24
  }) {
25
25
  const [showNextProcess, setShowNextProcess] = useState(false);
26
-
26
+ useEffect(() => {
27
+ setShowNextProcess(false);
28
+ }, [steps]);
27
29
  return (
28
30
  <div className="action-buttons-layout">
29
31
  <div className="action-buttons-content">{loading ? <Skeleton active /> : renderDynamicComponent()}</div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui-soxo-bootstrap-core",
3
- "version": "2.6.7",
3
+ "version": "2.6.9",
4
4
  "description": "All the Core Components for you to start",
5
5
  "keywords": [
6
6
  "all in one"