This commit is contained in:
@@ -296,7 +296,16 @@ const DashboardCustomersList = ({ additionalButtons, showBreadcrumb = false, tit
|
||||
};
|
||||
|
||||
const handleColumnsChange = (newColumns) => {
|
||||
setColumns(getVisibleColumnsByPermission(newColumns));
|
||||
const visibleNewColumns = getVisibleColumnsByPermission(newColumns);
|
||||
if (isAllCustomersPage) {
|
||||
const nextColumnByKey = new Map(visibleNewColumns.map((column) => [column.key, column]));
|
||||
setColumns((prevColumns) => prevColumns.map((column) => {
|
||||
const updatedColumn = nextColumnByKey.get(column.key);
|
||||
return updatedColumn ? { ...column, show: updatedColumn.show } : column;
|
||||
}));
|
||||
return;
|
||||
}
|
||||
setColumns(visibleNewColumns);
|
||||
}
|
||||
|
||||
const goToEdit = (id) => {
|
||||
@@ -526,7 +535,7 @@ const DashboardCustomersList = ({ additionalButtons, showBreadcrumb = false, tit
|
||||
<Dropdown.Menu as={customFilterMenu}/>
|
||||
</Dropdown>}
|
||||
<ManageTable
|
||||
columns={columns}
|
||||
columns={isAllCustomersPage ? columns.filter((column) => column.key !== 'pickup_status') : columns}
|
||||
onColumnsChange={handleColumnsChange}
|
||||
show={showManageTableDropdown}
|
||||
onToggle={(isOpen) => {
|
||||
|
||||
@@ -28,37 +28,12 @@ const EventsList = () => {
|
||||
const [columns, setColumns] = useState([
|
||||
{
|
||||
key: 'customer',
|
||||
label:'Customer',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'chinese_name',
|
||||
label: 'Preferred Name',
|
||||
label:'Customer Name (Full Name + Preferred Name)',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'member_type',
|
||||
label: 'Member Type',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'eyes_on',
|
||||
label: 'Eyes-on',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'doctor',
|
||||
label: 'Provider',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'phone',
|
||||
label: 'Phone',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'address',
|
||||
label: 'Address',
|
||||
label: 'Customer Type',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
@@ -66,6 +41,26 @@ const EventsList = () => {
|
||||
label: 'Language Support',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'transMethod',
|
||||
label: 'Transportation Support',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'transportation',
|
||||
label: 'Driver',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'startTime',
|
||||
label: 'Appointment Time',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'eyes_on',
|
||||
label: 'Eyes-On',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'newPatient',
|
||||
label: 'New Patient',
|
||||
@@ -77,24 +72,24 @@ const EventsList = () => {
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'disability',
|
||||
label: 'Disability',
|
||||
key: 'doctor',
|
||||
label: 'Provider',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'startTime',
|
||||
label: 'Appointment Time',
|
||||
key: 'phone',
|
||||
label: 'Provider Phone Number',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'address',
|
||||
label: 'Provider Address',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'fasting',
|
||||
label: 'Fasting Required',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'transportation',
|
||||
label: 'Transportation Support',
|
||||
show: true
|
||||
}
|
||||
]);
|
||||
|
||||
@@ -463,8 +458,6 @@ const EventsList = () => {
|
||||
</span>
|
||||
</th>)
|
||||
}
|
||||
<th>Customer Date of Birth</th>
|
||||
<th>Transportation</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -472,22 +465,19 @@ const EventsList = () => {
|
||||
events && events.filter(event => event.status === statusParam).map((medicalEvent, index) => <tr key={medicalEvent.id}>
|
||||
<td className="td-checkbox"><input type="checkbox" checked={selectedItems.includes(medicalEvent.id)} onClick={()=>toggleItem(medicalEvent?.id)}/></td>
|
||||
<td className="td-index">{index + 1}</td>
|
||||
{columns.find(col => col.key === 'customer')?.show && <td>{medicalEvent?.customer}</td>}
|
||||
{columns.find(col => col.key === 'chinese_name')?.show && <td>{medicalEvent?.chinese_name}</td>}
|
||||
{columns.find(col => col.key === 'customer')?.show && <td>{`${medicalEvent?.customer || ''}${medicalEvent?.chinese_name ? ` (${medicalEvent.chinese_name})` : ''}`}</td>}
|
||||
{columns.find(col => col.key === 'member_type')?.show && <td>{medicalEvent?.member_type}</td>}
|
||||
{columns.find(col => col.key === 'translation')?.show && <td>{medicalEvent?.translation}</td>}
|
||||
{columns.find(col => col.key === 'transMethod')?.show && <td>{medicalEvent?.transMethod}</td>}
|
||||
{columns.find(col => col.key === 'transportation')?.show && <td>{medicalEvent?.transportation}</td>}
|
||||
{columns.find(col => col.key === 'startTime')?.show && <td>{medicalEvent?.startTime}</td>}
|
||||
{columns.find(col => col.key === 'eyes_on')?.show && <td>{medicalEvent?.eyes_on}</td>}
|
||||
{columns.find(col => col.key === 'newPatient')?.show && <td>{medicalEvent?.newPatient}</td>}
|
||||
{columns.find(col => col.key === 'fasting')?.show && <td>{medicalEvent?.fasting}</td>}
|
||||
{columns.find(col => col.key === 'needId')?.show && <td>{medicalEvent?.needId}</td>}
|
||||
{columns.find(col => col.key === 'doctor')?.show && <td>{medicalEvent?.doctor}</td>}
|
||||
{columns.find(col => col.key === 'phone')?.show && <td>{medicalEvent?.phone}</td>}
|
||||
{columns.find(col => col.key === 'address')?.show && <td>{medicalEvent?.address}</td>}
|
||||
{columns.find(col => col.key === 'translation')?.show && <td>{medicalEvent?.translation}</td>}
|
||||
{columns.find(col => col.key === 'newPatient')?.show && <td>{medicalEvent?.newPatient}</td>}
|
||||
{columns.find(col => col.key === 'needId')?.show && <td>{medicalEvent?.needId}</td>}
|
||||
{columns.find(col => col.key === 'disability')?.show && <td>{medicalEvent?.disability}</td>}
|
||||
{columns.find(col => col.key === 'startTime')?.show && <td>{medicalEvent?.startTime}</td>}
|
||||
{columns.find(col => col.key === 'fasting')?.show && <td>{medicalEvent?.fasting}</td>}
|
||||
{columns.find(col => col.key === 'transportation')?.show && <td>{medicalEvent?.transportation}</td>}
|
||||
<td>{medicalEvent?.dob}</td>
|
||||
<td>{medicalEvent?.transMethod}</td>
|
||||
</tr>)
|
||||
}
|
||||
</tbody>
|
||||
|
||||
@@ -50,6 +50,16 @@ const ResourcesList = () => {
|
||||
label: 'Office Phone Number',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'contact',
|
||||
label: 'Secondary Phone Number',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'fax',
|
||||
label: 'Fax Number',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'email',
|
||||
label: 'Email',
|
||||
@@ -57,7 +67,12 @@ const ResourcesList = () => {
|
||||
},
|
||||
{
|
||||
key: 'display_address',
|
||||
label: 'Address',
|
||||
label: 'Provider Address',
|
||||
show: true
|
||||
},
|
||||
{
|
||||
key: 'note',
|
||||
label: 'Note',
|
||||
show: true
|
||||
}
|
||||
]);
|
||||
@@ -280,8 +295,11 @@ const ResourcesList = () => {
|
||||
{columns.find(col => col.key === 'type')?.show && <td>{resource?.type || '-'}</td>}
|
||||
{columns.find(col => col.key === 'specialty')?.show && <td>{resource?.specialty || '-'}</td>}
|
||||
{columns.find(col => col.key === 'phone')?.show && <td>{resource?.phone || '-'}</td>}
|
||||
{columns.find(col => col.key === 'contact')?.show && <td>{resource?.contact || '-'}</td>}
|
||||
{columns.find(col => col.key === 'fax')?.show && <td>{resource?.fax || '-'}</td>}
|
||||
{columns.find(col => col.key === 'email')?.show && <td>{resource?.email || '-'}</td>}
|
||||
{columns.find(col => col.key === 'display_address')?.show && <td>{resource?.display_address}</td>}
|
||||
{columns.find(col => col.key === 'note')?.show && <td>{resource?.note || resource?.description || '-'}</td>}
|
||||
</tr>)
|
||||
}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user