This commit is contained in:
@@ -13,7 +13,7 @@ import {
|
|||||||
import { createEventsServicePlugin } from '@schedule-x/events-service';
|
import { createEventsServicePlugin } from '@schedule-x/events-service';
|
||||||
import { createEventModalPlugin} from '@schedule-x/event-modal';
|
import { createEventModalPlugin} from '@schedule-x/event-modal';
|
||||||
import '@schedule-x/theme-default/dist/calendar.css';
|
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";
|
import DatePicker from "react-datepicker";
|
||||||
|
|
||||||
|
|
||||||
@@ -254,10 +254,6 @@ const EventsCalendar = () => {
|
|||||||
navigate(`/medical`)
|
navigate(`/medical`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const goToEdit = (id) => {
|
|
||||||
navigate(`/medical/events/edit/${id}?from=calendar`)
|
|
||||||
}
|
|
||||||
|
|
||||||
const goToCreateNew = () => {
|
const goToCreateNew = () => {
|
||||||
navigate(`/medical/events`)
|
navigate(`/medical/events`)
|
||||||
}
|
}
|
||||||
@@ -274,17 +270,6 @@ const EventsCalendar = () => {
|
|||||||
navigate(`/medical/events/${id}`)
|
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) => {
|
const toggleColorFilter = (colorValue) => {
|
||||||
setSelectedColorFilters(prev =>
|
setSelectedColorFilters(prev =>
|
||||||
prev.includes(colorValue)
|
prev.includes(colorValue)
|
||||||
@@ -309,20 +294,6 @@ const EventsCalendar = () => {
|
|||||||
<div className="sx__event-modal__title">{calendarEvent?.customer}</div>
|
<div className="sx__event-modal__title">{calendarEvent?.customer}</div>
|
||||||
{calendarEvent?.doctor && <div className="sx__event-modal__time">{`${calendarEvent?.doctor}`}</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">{`${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>
|
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -292,7 +292,6 @@ const UpdateResource = () => {
|
|||||||
<div className="list row mb-5">
|
<div className="list row mb-5">
|
||||||
<div className="col-md-12 col-sm-12 col-xs-12">
|
<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-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>
|
<button className="btn btn-primary btn-sm float-right" onClick={() => saveResource()}> Save </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -336,50 +336,47 @@ const RouteReportWithSignature = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Vehicle Inspection Checklist */}
|
{/* Vehicle Inspection Checklist */}
|
||||||
<div className="list row">
|
{checklistItems.length > 0 && (
|
||||||
<div className="col-md-12">
|
<div className="list row">
|
||||||
<table className="inspection-table">
|
<div className="col-md-12">
|
||||||
<thead>
|
<table className="inspection-table">
|
||||||
<tr>
|
<thead>
|
||||||
<th>Item</th>
|
|
||||||
<th>Inspected</th>
|
|
||||||
<th>Item</th>
|
|
||||||
<th>Inspected</th>
|
|
||||||
<th>Item</th>
|
|
||||||
<th>Inspected</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{checklistRows.length === 0 && (
|
|
||||||
<tr>
|
<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>
|
</tr>
|
||||||
)}
|
</thead>
|
||||||
{checklistRows.map((row, rowIndex) => (
|
<tbody>
|
||||||
<tr key={`checklist-row-${rowIndex}`}>
|
{checklistRows.map((row, rowIndex) => (
|
||||||
{[0, 1, 2].map((cellIndex) => {
|
<tr key={`checklist-row-${rowIndex}`}>
|
||||||
const item = row[cellIndex];
|
{[0, 1, 2].map((cellIndex) => {
|
||||||
if (!item) {
|
const item = row[cellIndex];
|
||||||
|
if (!item) {
|
||||||
|
return (
|
||||||
|
<React.Fragment key={`checklist-empty-${rowIndex}-${cellIndex}`}>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<React.Fragment key={`checklist-empty-${rowIndex}-${cellIndex}`}>
|
<React.Fragment key={`checklist-item-${rowIndex}-${cellIndex}`}>
|
||||||
<td></td>
|
<td>{item.label}</td>
|
||||||
<td></td>
|
<td style={{ textAlign: 'center' }}>{item.inspected ? '✓' : ''}</td>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
})}
|
||||||
return (
|
</tr>
|
||||||
<React.Fragment key={`checklist-item-${rowIndex}-${cellIndex}`}>
|
))}
|
||||||
<td>{item.label}</td>
|
</tbody>
|
||||||
<td style={{ textAlign: 'center' }}>{item.inspected ? '✓' : ''}</td>
|
</table>
|
||||||
</React.Fragment>
|
</div>
|
||||||
);
|
|
||||||
})}
|
|
||||||
</tr>
|
|
||||||
))}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user