fix
All checks were successful
Build And Deploy Main / build-and-deploy (push) Successful in 28s

This commit is contained in:
2026-03-09 15:33:01 -04:00
parent 3d78f2beda
commit d715d2d7fc
3 changed files with 36 additions and 69 deletions

View File

@@ -13,7 +13,7 @@ import {
import { createEventsServicePlugin } from '@schedule-x/events-service';
import { createEventModalPlugin} from '@schedule-x/event-modal';
import '@schedule-x/theme-default/dist/calendar.css';
import { Archive, PencilSquare, Filter } from "react-bootstrap-icons";
import { Filter } from "react-bootstrap-icons";
import DatePicker from "react-datepicker";
@@ -254,10 +254,6 @@ const EventsCalendar = () => {
navigate(`/medical`)
}
const goToEdit = (id) => {
navigate(`/medical/events/edit/${id}?from=calendar`)
}
const goToCreateNew = () => {
navigate(`/medical/events`)
}
@@ -274,17 +270,6 @@ const EventsCalendar = () => {
navigate(`/medical/events/${id}`)
}
const disableEvent = (id) => {
const currentEvent = events.find(item => item.id === id);
EventsService.disableEvent(id, { status: 'inactive', edit_by: localStorage.getItem('user') && JSON.parse(localStorage.getItem('user'))?.name,
edit_date: new Date(),
edit_history: currentEvent?.edit_history? [...currentEvent.edit_history, { employee: localStorage.getItem('user') && JSON.parse(localStorage.getItem('user'))?.name, date: new Date() }] : [{ employee: localStorage.getItem('user') && JSON.parse(localStorage.getItem('user'))?.name, date: new Date() }]}).then(() => {
EventsService.getAllEvents({ from: EventsService.formatDate(fromDate), to: EventsService.formatDate(toDate) }).then((data) => {
setAllEvents(data?.data);
})
});
}
const toggleColorFilter = (colorValue) => {
setSelectedColorFilters(prev =>
prev.includes(colorValue)
@@ -309,20 +294,6 @@ const EventsCalendar = () => {
<div className="sx__event-modal__title">{calendarEvent?.customer}</div>
{calendarEvent?.doctor && <div className="sx__event-modal__time">{`${calendarEvent?.doctor}`}</div>}
<div className="sx__event-modal__time">{`${calendarEvent?.start}`}</div>
<div className="sx__event-modal__time" style={{ display: 'flex', gap: '12px', marginTop: '8px' }}>
<PencilSquare
size={16}
onClick={() => goToEdit(calendarEvent?.id)}
style={{ cursor: 'pointer' }}
title="Edit"
/>
<Archive
size={16}
onClick={() => disableEvent(calendarEvent?.id)}
style={{ cursor: 'pointer' }}
title="Delete"
/>
</div>
</>
}
};

View File

@@ -292,7 +292,6 @@ const UpdateResource = () => {
<div className="list row mb-5">
<div className="col-md-12 col-sm-12 col-xs-12">
<button className="btn btn-default btn-sm float-right" onClick={() => redirectTo()}> Cancel </button>
<button className="btn btn-danger btn-sm me-2 mb-2" onClick={() => triggerShowDeleteModal()}> Delete </button>
<button className="btn btn-primary btn-sm float-right" onClick={() => saveResource()}> Save </button>
</div>
</div>

View File

@@ -336,50 +336,47 @@ const RouteReportWithSignature = () => {
</div>
{/* Vehicle Inspection Checklist */}
<div className="list row">
<div className="col-md-12">
<table className="inspection-table">
<thead>
<tr>
<th>Item</th>
<th>Inspected</th>
<th>Item</th>
<th>Inspected</th>
<th>Item</th>
<th>Inspected</th>
</tr>
</thead>
<tbody>
{checklistRows.length === 0 && (
{checklistItems.length > 0 && (
<div className="list row">
<div className="col-md-12">
<table className="inspection-table">
<thead>
<tr>
<td colSpan={6} style={{ textAlign: 'center' }}>No checklist data</td>
<th>Item</th>
<th>Inspected</th>
<th>Item</th>
<th>Inspected</th>
<th>Item</th>
<th>Inspected</th>
</tr>
)}
{checklistRows.map((row, rowIndex) => (
<tr key={`checklist-row-${rowIndex}`}>
{[0, 1, 2].map((cellIndex) => {
const item = row[cellIndex];
if (!item) {
</thead>
<tbody>
{checklistRows.map((row, rowIndex) => (
<tr key={`checklist-row-${rowIndex}`}>
{[0, 1, 2].map((cellIndex) => {
const item = row[cellIndex];
if (!item) {
return (
<React.Fragment key={`checklist-empty-${rowIndex}-${cellIndex}`}>
<td></td>
<td></td>
</React.Fragment>
);
}
return (
<React.Fragment key={`checklist-empty-${rowIndex}-${cellIndex}`}>
<td></td>
<td></td>
<React.Fragment key={`checklist-item-${rowIndex}-${cellIndex}`}>
<td>{item.label}</td>
<td style={{ textAlign: 'center' }}>{item.inspected ? '✓' : ''}</td>
</React.Fragment>
);
}
return (
<React.Fragment key={`checklist-item-${rowIndex}-${cellIndex}`}>
<td>{item.label}</td>
<td style={{ textAlign: 'center' }}>{item.inspected ? '✓' : ''}</td>
</React.Fragment>
);
})}
</tr>
))}
</tbody>
</table>
})}
</tr>
))}
</tbody>
</table>
</div>
</div>
</div>
)}
</>
);
};