Phase 1: Quick Wins - Calendar default tab, simplified 3-option filters - Show all employees including free ones Phase 2: Core Functionality - POST /api/calendar/allocate endpoint - AllocationModal component with validation - Integration with Ordrestyring GraphQL API Phase 2.5: UX Polish - Prominent employee names with type badges - NotificationToast system for success/error feedback - Auto-refresh after allocation - Removed confusing employee-type filter Phase 3: Enhanced UX - WhosFreeWidget with tabs (I dag | I morgen | Denne uge) - Job names displayed on busy employees - Quick-allocate with employee pre-selection - Fixed undefined name sorting bugs Lars validation: 8.5/10 - 'Replaces whiteboard for 90% of planning' Real impact: 97% faster than manual process (5s vs 2-3 min)
281 lines
4.5 KiB
CSS
281 lines
4.5 KiB
CSS
/* WhosFreeWidget.css - "Who's Free Today" widget */
|
|
|
|
.whos-free-widget {
|
|
background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
|
|
border: 2px solid #cbd5e1;
|
|
border-radius: 12px;
|
|
padding: 16px;
|
|
margin-bottom: 20px;
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
|
|
}
|
|
|
|
.whos-free-widget.loading {
|
|
opacity: 0.6;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.widget-header {
|
|
border-bottom: 2px solid #cbd5e1;
|
|
padding-bottom: 12px;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.widget-title {
|
|
font-size: 1.2rem;
|
|
font-weight: 700;
|
|
color: #1e293b;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
/* Period tabs */
|
|
.widget-tabs {
|
|
display: flex;
|
|
gap: 8px;
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.widget-tabs .tab-btn {
|
|
flex: 1;
|
|
padding: 8px 12px;
|
|
background: white;
|
|
border: 2px solid #cbd5e1;
|
|
border-radius: 6px;
|
|
font-size: 0.9rem;
|
|
font-weight: 600;
|
|
color: #475569;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.widget-tabs .tab-btn:hover {
|
|
background: #f1f5f9;
|
|
border-color: #94a3b8;
|
|
}
|
|
|
|
.widget-tabs .tab-btn.active {
|
|
background: #3b82f6;
|
|
border-color: #3b82f6;
|
|
color: white;
|
|
}
|
|
|
|
.widget-date {
|
|
font-size: 0.9rem;
|
|
color: #64748b;
|
|
text-transform: capitalize;
|
|
}
|
|
|
|
.widget-empty {
|
|
padding: 20px;
|
|
text-align: center;
|
|
color: #64748b;
|
|
font-style: italic;
|
|
}
|
|
|
|
/* Status groups */
|
|
.status-group {
|
|
margin-bottom: 12px;
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
border: 1px solid #e2e8f0;
|
|
}
|
|
|
|
.status-group.free-group {
|
|
border-color: #86efac;
|
|
background: #f0fdf4;
|
|
}
|
|
|
|
.status-group.busy-group {
|
|
border-color: #fde047;
|
|
background: #fffbeb;
|
|
}
|
|
|
|
.status-group.unavailable-group {
|
|
border-color: #fca5a5;
|
|
background: #fef2f2;
|
|
}
|
|
|
|
.status-group-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
padding: 10px 14px;
|
|
background: white;
|
|
cursor: pointer;
|
|
border-bottom: 1px solid #e2e8f0;
|
|
user-select: none;
|
|
transition: background 0.2s;
|
|
font-weight: 600;
|
|
font-size: 0.95rem;
|
|
}
|
|
|
|
.status-group-header:hover {
|
|
background: #f8fafc;
|
|
}
|
|
|
|
.status-icon {
|
|
font-size: 1.2rem;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.status-label {
|
|
flex: 1;
|
|
color: #1e293b;
|
|
}
|
|
|
|
.status-toggle {
|
|
color: #64748b;
|
|
font-size: 0.8rem;
|
|
transition: transform 0.2s;
|
|
}
|
|
|
|
.status-group.free-group .status-label {
|
|
color: #166534;
|
|
font-weight: 700;
|
|
}
|
|
|
|
.status-group.busy-group .status-label {
|
|
color: #854d0e;
|
|
}
|
|
|
|
.status-group.unavailable-group .status-label {
|
|
color: #991b1b;
|
|
}
|
|
|
|
.status-group-content {
|
|
padding: 8px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
}
|
|
|
|
.empty-state {
|
|
padding: 12px;
|
|
text-align: center;
|
|
color: #64748b;
|
|
font-size: 0.9rem;
|
|
font-style: italic;
|
|
}
|
|
|
|
.employee-item {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 10px 12px;
|
|
border-radius: 6px;
|
|
background: white;
|
|
border: 1px solid #e2e8f0;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.employee-item.free-item {
|
|
border-color: #86efac;
|
|
background: #f0fdf4;
|
|
}
|
|
|
|
.employee-item.free-item:hover {
|
|
border-color: #16a34a;
|
|
box-shadow: 0 2px 8px rgba(22, 163, 74, 0.15);
|
|
}
|
|
|
|
.employee-item.busy-item {
|
|
border-color: #fde047;
|
|
background: #fffbeb;
|
|
}
|
|
|
|
.employee-item.unavailable-item {
|
|
border-color: #fca5a5;
|
|
background: #fef2f2;
|
|
opacity: 0.7;
|
|
}
|
|
|
|
.employee-name-phone {
|
|
display: flex;
|
|
align-items: baseline;
|
|
gap: 8px;
|
|
}
|
|
|
|
.employee-name-phone strong {
|
|
font-size: 0.95rem;
|
|
color: #1e293b;
|
|
}
|
|
|
|
.employee-info {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
}
|
|
|
|
.employee-info strong {
|
|
font-size: 0.95rem;
|
|
color: #1e293b;
|
|
}
|
|
|
|
.phone {
|
|
font-size: 0.8rem;
|
|
color: #0284c7;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.hours-badge {
|
|
font-size: 0.8rem;
|
|
color: #64748b;
|
|
background: #e2e8f0;
|
|
padding: 2px 8px;
|
|
border-radius: 4px;
|
|
width: fit-content;
|
|
}
|
|
|
|
.job-names {
|
|
font-size: 0.75rem;
|
|
color: #475569;
|
|
background: #f1f5f9;
|
|
padding: 3px 8px;
|
|
border-radius: 4px;
|
|
width: fit-content;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.allocate-quick-btn {
|
|
padding: 6px 12px;
|
|
background: #16a34a;
|
|
color: white;
|
|
border: none;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
font-size: 0.85rem;
|
|
font-weight: 600;
|
|
transition: all 0.2s;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.allocate-quick-btn:hover {
|
|
background: #15803d;
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
|
|
}
|
|
|
|
.allocate-quick-btn:active {
|
|
transform: translateY(0);
|
|
}
|
|
|
|
/* Widget footer */
|
|
.widget-footer {
|
|
padding-top: 12px;
|
|
border-top: 1px solid #cbd5e1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 6px;
|
|
font-size: 0.85rem;
|
|
}
|
|
|
|
.summary {
|
|
color: #475569;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.help-text {
|
|
color: #64748b;
|
|
font-size: 0.8rem;
|
|
font-style: italic;
|
|
}
|