From af8ff3188fd230e9514657dd5cab1183f46235fa Mon Sep 17 00:00:00 2001 From: Lixian Zhou Date: Thu, 12 Mar 2026 15:10:42 -0400 Subject: [PATCH] fix --- .../dashboard/DashboardCustomersList.js | 23 +--- client/src/components/home/menu.js | 6 +- .../src/components/info-screen/InfoScreen.js | 116 +++++++++--------- 3 files changed, 66 insertions(+), 79 deletions(-) diff --git a/client/src/components/dashboard/DashboardCustomersList.js b/client/src/components/dashboard/DashboardCustomersList.js index 0a5d313..d1e2cfa 100644 --- a/client/src/components/dashboard/DashboardCustomersList.js +++ b/client/src/components/dashboard/DashboardCustomersList.js @@ -3,7 +3,7 @@ import { useDispatch, useSelector } from "react-redux"; import { useNavigate, useParams } from "react-router-dom"; import { customerSlice } from "./../../store"; import { AuthService, CustomerService, EventsService } from "../../services"; -import { CUSTOMER_TYPE, CUSTOMER_TYPE_TEXT, PROGRAM_TYPE, PROGRAM_TYPE_TEXT, PAY_SOURCE, PAY_SOURCE_TEXT, TRANSPORTATION_TYPE, TRANSPORTATION_TYPE_TEXT, YES_NO, YES_NO_TEXT, ManageTable } from "../../shared"; +import { CUSTOMER_TYPE, CUSTOMER_TYPE_TEXT, PROGRAM_TYPE, PROGRAM_TYPE_TEXT, PAY_SOURCE, PAY_SOURCE_TEXT, YES_NO, YES_NO_TEXT, ManageTable } from "../../shared"; import { Spinner, Breadcrumb, BreadcrumbItem, Tabs, Tab, Dropdown, Modal } from "react-bootstrap"; import { Columns, Download, Filter, PencilSquare, PersonSquare, Plus } from "react-bootstrap-icons"; @@ -37,7 +37,6 @@ const DashboardCustomersList = ({ additionalButtons, showBreadcrumb = false, tit customerType: 'careServices', programType: 'personalInfo', paySource: 'personalInfo', - transportationType: 'careServices', eyesOn: 'medicalInsurance' }; const canViewFilterControl = (filterKey) => { @@ -48,9 +47,8 @@ const DashboardCustomersList = ({ additionalButtons, showBreadcrumb = false, tit const visibleCustomerTypeFilter = canViewFilterControl('customerType'); const visibleProgramTypeFilter = canViewFilterControl('programType'); const visiblePaySourceFilter = canViewFilterControl('paySource'); - const visibleTransportationTypeFilter = canViewFilterControl('transportationType'); const visibleEyesOnFilter = canViewFilterControl('eyesOn'); - const hasVisibleFilters = visibleCustomerTypeFilter || visibleProgramTypeFilter || visiblePaySourceFilter || visibleTransportationTypeFilter || visibleEyesOnFilter; + const hasVisibleFilters = visibleCustomerTypeFilter || visibleProgramTypeFilter || visiblePaySourceFilter || visibleEyesOnFilter; const navigate = useNavigate(); const dispatch = useDispatch(); const site = EventsService.site; @@ -68,7 +66,6 @@ const DashboardCustomersList = ({ additionalButtons, showBreadcrumb = false, tit const [customerTypeFilter, setCustomerTypeFilter] = useState(''); const [programTypeFilter, setProgramTypeFilter] = useState(''); const [paySourceFilter, setPaySourceFilter] = useState(''); - const [transportationTypeFilter, setTransportationTypeFilter] = useState(''); const [eyesOnFilter, setEyesOnFilter] = useState(''); const [showAvatarModal, setShowAvatarModal] = useState(false); const [avatarData, setAvatarData] = useState(null); @@ -223,10 +220,6 @@ const DashboardCustomersList = ({ additionalButtons, showBreadcrumb = false, tit filtered = filtered.filter((item) => (item?.pay_source || '') === paySourceFilter); } - if (transportationTypeFilter && visibleTransportationTypeFilter) { - filtered = filtered.filter((item) => (item?.transportation_type || '') === transportationTypeFilter); - } - if (eyesOnFilter && visibleEyesOnFilter) { filtered = filtered.filter((item) => { const normalized = `${item?.eyes_on || (item?.disability ? YES_NO.YES : '')}`.toLowerCase(); @@ -235,7 +228,7 @@ const DashboardCustomersList = ({ additionalButtons, showBreadcrumb = false, tit } setFilteredCustomers(filtered); - }, [keyword, customers, showInactive, customerTypeFilter, programTypeFilter, paySourceFilter, transportationTypeFilter, eyesOnFilter]) + }, [keyword, customers, showInactive, customerTypeFilter, programTypeFilter, paySourceFilter, eyesOnFilter]) useEffect(() => { const newCustomers = [...customers]; @@ -287,7 +280,6 @@ const DashboardCustomersList = ({ additionalButtons, showBreadcrumb = false, tit setCustomerTypeFilter(''); setProgramTypeFilter(''); setPaySourceFilter(''); - setTransportationTypeFilter(''); setEyesOnFilter(''); setShowFilterDropdown(false); } @@ -459,15 +451,6 @@ const DashboardCustomersList = ({ additionalButtons, showBreadcrumb = false, tit ))} } - {visibleTransportationTypeFilter &&
-
Tranportation Type
- -
}
{visibleEyesOnFilter &&
diff --git a/client/src/components/home/menu.js b/client/src/components/home/menu.js index 2680581..d70774b 100644 --- a/client/src/components/home/menu.js +++ b/client/src/components/home/menu.js @@ -176,19 +176,19 @@ const SideMenu = () => { name: 'Appointment Requests', link: '/medical/event-request/list', category: '/event-request', - roleFunc: AuthService.canViewMedicalSection + roleFunc: AuthService.canViewAppointmentRequests }, { name: 'Appointment Calendar', link: '/medical/events/calendar', category: '/events/calendar', - roleFunc: AuthService.canViewMedicalSection + roleFunc: AuthService.canViewMedicalEvents }, { name: 'Appointment Multi-Days List', link: '/medical/events/multiple-list', category: '/events/multiple-list', - roleFunc: AuthService.canViewMedicalSection + roleFunc: AuthService.canViewMedicalEvents }, { name: 'Template', diff --git a/client/src/components/info-screen/InfoScreen.js b/client/src/components/info-screen/InfoScreen.js index 31bb1a8..84ac7c9 100644 --- a/client/src/components/info-screen/InfoScreen.js +++ b/client/src/components/info-screen/InfoScreen.js @@ -7,6 +7,7 @@ import moment from 'moment'; const InfoScreen = () => { const navigate = useNavigate(); + const canViewAppointmentCalendar = AuthService.hasPermission('View_Appointment Calendar'); const [isLoading, setIsLoading] = useState(true); const [medicalEvents, setMedicalEvents] = useState([]); const [activityEvents, setActivityEvents] = useState([]); @@ -680,41 +681,43 @@ const InfoScreen = () => {
-
-
-
Appointments
-
-
-
- - - - - - - - - - {medicalEvents && medicalEvents.length > 0 ? ( - medicalEvents.map((medicalEvent, index) => ( - - - - - - )) - ) : ( + {canViewAppointmentCalendar && ( +
+
+
Appointments
+
+
+
+
TimeCustomerDriver
{medicalEvent.startTime}{medicalEvent.customer}{medicalEvent.driverInfo}
+ - + + + - )} - -
No medical appointments scheduled for todayTimeCustomerDriver
+ + + {medicalEvents && medicalEvents.length > 0 ? ( + medicalEvents.map((medicalEvent, index) => ( + + {medicalEvent.startTime} + {medicalEvent.customer} + {medicalEvent.driverInfo} + + )) + ) : ( + + No medical appointments scheduled for today + + )} + + +
-
+ )}
{/* First Piece - Time and Weather Cards */}
@@ -969,36 +972,37 @@ const InfoScreen = () => { {/* Full Screen Content */} {isFullScreen && (
- {/* Column 1 - Appointments */} -
-
-
Appointments
- - - - - - - - - - {medicalEvents && medicalEvents.length > 0 ? ( - medicalEvents.map((medicalEvent, index) => ( - - - - - - )) - ) : ( + {canViewAppointmentCalendar && ( +
+
+
Appointments
+
TimeCustomerDriver
{medicalEvent.startTime}{medicalEvent.customer}{medicalEvent.driverInfo}
+ - + + + - )} - -
No medical appointments scheduled for todayTimeCustomerDriver
+ + + {medicalEvents && medicalEvents.length > 0 ? ( + medicalEvents.map((medicalEvent, index) => ( + + {medicalEvent.startTime} + {medicalEvent.customer} + {medicalEvent.driverInfo} + + )) + ) : ( + + No medical appointments scheduled for today + + )} + + +
-
+ )} {/* Column 2 - Time, Weather, Attendance Note, Gallery */}