diff --git a/client/src/components/dashboard/DashboardCustomersList.js b/client/src/components/dashboard/DashboardCustomersList.js index d1e2cfa..bc45757 100644 --- a/client/src/components/dashboard/DashboardCustomersList.js +++ b/client/src/components/dashboard/DashboardCustomersList.js @@ -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 } column.key !== 'pickup_status') : columns} onColumnsChange={handleColumnsChange} show={showManageTableDropdown} onToggle={(isOpen) => { diff --git a/client/src/components/events/EventsList.js b/client/src/components/events/EventsList.js index 7fe6d3f..8f477bd 100644 --- a/client/src/components/events/EventsList.js +++ b/client/src/components/events/EventsList.js @@ -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 = () => { ) } - Customer Date of Birth - Transportation @@ -472,22 +465,19 @@ const EventsList = () => { events && events.filter(event => event.status === statusParam).map((medicalEvent, index) => toggleItem(medicalEvent?.id)}/> {index + 1} - {columns.find(col => col.key === 'customer')?.show && {medicalEvent?.customer}} - {columns.find(col => col.key === 'chinese_name')?.show && {medicalEvent?.chinese_name}} + {columns.find(col => col.key === 'customer')?.show && {`${medicalEvent?.customer || ''}${medicalEvent?.chinese_name ? ` (${medicalEvent.chinese_name})` : ''}`}} {columns.find(col => col.key === 'member_type')?.show && {medicalEvent?.member_type}} + {columns.find(col => col.key === 'translation')?.show && {medicalEvent?.translation}} + {columns.find(col => col.key === 'transMethod')?.show && {medicalEvent?.transMethod}} + {columns.find(col => col.key === 'transportation')?.show && {medicalEvent?.transportation}} + {columns.find(col => col.key === 'startTime')?.show && {medicalEvent?.startTime}} {columns.find(col => col.key === 'eyes_on')?.show && {medicalEvent?.eyes_on}} + {columns.find(col => col.key === 'newPatient')?.show && {medicalEvent?.newPatient}} + {columns.find(col => col.key === 'fasting')?.show && {medicalEvent?.fasting}} + {columns.find(col => col.key === 'needId')?.show && {medicalEvent?.needId}} {columns.find(col => col.key === 'doctor')?.show && {medicalEvent?.doctor}} {columns.find(col => col.key === 'phone')?.show && {medicalEvent?.phone}} {columns.find(col => col.key === 'address')?.show && {medicalEvent?.address}} - {columns.find(col => col.key === 'translation')?.show && {medicalEvent?.translation}} - {columns.find(col => col.key === 'newPatient')?.show && {medicalEvent?.newPatient}} - {columns.find(col => col.key === 'needId')?.show && {medicalEvent?.needId}} - {columns.find(col => col.key === 'disability')?.show && {medicalEvent?.disability}} - {columns.find(col => col.key === 'startTime')?.show && {medicalEvent?.startTime}} - {columns.find(col => col.key === 'fasting')?.show && {medicalEvent?.fasting}} - {columns.find(col => col.key === 'transportation')?.show && {medicalEvent?.transportation}} - {medicalEvent?.dob} - {medicalEvent?.transMethod} ) } diff --git a/client/src/components/resources/ResourcesList.js b/client/src/components/resources/ResourcesList.js index 6854965..e6d19d4 100644 --- a/client/src/components/resources/ResourcesList.js +++ b/client/src/components/resources/ResourcesList.js @@ -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 && {resource?.type || '-'}} {columns.find(col => col.key === 'specialty')?.show && {resource?.specialty || '-'}} {columns.find(col => col.key === 'phone')?.show && {resource?.phone || '-'}} + {columns.find(col => col.key === 'contact')?.show && {resource?.contact || '-'}} + {columns.find(col => col.key === 'fax')?.show && {resource?.fax || '-'}} {columns.find(col => col.key === 'email')?.show && {resource?.email || '-'}} {columns.find(col => col.key === 'display_address')?.show && {resource?.display_address}} + {columns.find(col => col.key === 'note')?.show && {resource?.note || resource?.description || '-'}} ) }