Show EmployeeStatusID status instead of IsActive flag
- Display Pending/Invited/Active/Suspended from EmployeeStatusID - Add CSS for pending and suspended status badges - Update getStatusClass to handle employee status codes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
0b17d35b31
commit
ccb27f679f
3 changed files with 17 additions and 10 deletions
|
|
@ -424,6 +424,6 @@
|
|||
<!-- Toast Container -->
|
||||
<div class="toast-container" id="toastContainer"></div>
|
||||
|
||||
<script src="portal.js?v=5"></script>
|
||||
<script src="portal.js?v=6"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -803,11 +803,17 @@ body {
|
|||
color: var(--success);
|
||||
}
|
||||
|
||||
.status-badge.inactive {
|
||||
.status-badge.inactive,
|
||||
.status-badge.suspended {
|
||||
background: rgba(239, 68, 68, 0.1);
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
.status-badge.pending {
|
||||
background: rgba(156, 163, 175, 0.1);
|
||||
color: var(--gray-600);
|
||||
}
|
||||
|
||||
/* Modal */
|
||||
.modal-overlay {
|
||||
display: none;
|
||||
|
|
|
|||
|
|
@ -301,15 +301,16 @@ const Portal = {
|
|||
`).join('');
|
||||
},
|
||||
|
||||
// Get status class
|
||||
// Get status class for orders
|
||||
getStatusClass(statusId) {
|
||||
const classes = {
|
||||
1: 'submitted',
|
||||
2: 'preparing',
|
||||
3: 'ready',
|
||||
4: 'completed'
|
||||
0: 'pending', // Employee: Pending
|
||||
1: 'submitted', // Order: Submitted, Employee: Invited
|
||||
2: 'active', // Order: Preparing, Employee: Active
|
||||
3: 'suspended', // Order: Ready, Employee: Suspended
|
||||
4: 'completed' // Order: Completed
|
||||
};
|
||||
return classes[statusId] || 'submitted';
|
||||
return classes[statusId] || 'pending';
|
||||
},
|
||||
|
||||
// Get status text
|
||||
|
|
@ -544,8 +545,8 @@ const Portal = {
|
|||
<td>${member.Email || '-'}</td>
|
||||
<td>${this.formatPhone(member.Phone)}</td>
|
||||
<td>
|
||||
<span class="status-badge ${member.IsActive ? 'active' : 'inactive'}">
|
||||
${member.IsActive ? 'Active' : 'Inactive'}
|
||||
<span class="status-badge ${this.getStatusClass(member.StatusID)}">
|
||||
${member.StatusName || 'Unknown'}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue