Skip to content

Commit 91201db

Browse files
committed
improve idle indicator colors, fix typescript issues
1 parent 717fd35 commit 91201db

File tree

3 files changed

+6
-20
lines changed

3 files changed

+6
-20
lines changed

resources/js/packages/ui/src/FullCalendar/TimeEntryCalendar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,11 +676,11 @@ onActivated(() => {
676676
}
677677
678678
.fullcalendar :deep(.activity-status-box.idle) {
679-
background-color: rgba(239, 68, 68, 0.3) !important;
679+
background-color: rgba(156, 163, 175, 0.1) !important;
680680
}
681681
682682
.fullcalendar :deep(.activity-status-box.idle):hover {
683-
background-color: rgba(239, 68, 68, 1) !important;
683+
background-color: rgba(156, 163, 175, 0.5) !important;
684684
}
685685
686686
.fullcalendar :deep(.activity-status-box.active) {

resources/js/packages/ui/src/FullCalendar/idleStatusPlugin.ts

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createPlugin, PluginDef } from '@fullcalendar/core';
1+
import { createPlugin, type PluginDef } from '@fullcalendar/core';
22
import { computePosition, flip, shift, offset } from '@floating-ui/dom';
33

44
export interface ActivityPeriod {
@@ -107,9 +107,6 @@ export function renderActivityStatusBoxes(
107107
// Create a single tooltip instance to be reused
108108
const tooltip = createTooltip();
109109

110-
// Get the calendar's current view to determine dates
111-
const dateHeaders = calendarEl.querySelectorAll('.fc-col-header-cell');
112-
113110
lanes.forEach((lane: Element, dayIndex: number) => {
114111
// Get the date for this lane from the data attribute
115112
const laneEl = lane as HTMLElement;
@@ -126,8 +123,6 @@ export function renderActivityStatusBoxes(
126123
const laneDateEnd = new Date(laneDate);
127124
laneDateEnd.setHours(23, 59, 59, 999);
128125

129-
console.log('Processing lane', dayIndex, 'date:', dateStr);
130-
131126
let hasActivityStatusForThisDay = false;
132127

133128
activityPeriods.forEach((period) => {
@@ -139,15 +134,6 @@ export function renderActivityStatusBoxes(
139134
return;
140135
}
141136

142-
console.log(
143-
'Rendering period',
144-
period.isIdle ? 'idle' : 'active',
145-
'from',
146-
periodStart,
147-
'to',
148-
periodEnd
149-
);
150-
151137
// Calculate the position and height of the idle box
152138
const { top, height } = calculateBoxPosition(
153139
calendarEl,
@@ -252,9 +238,9 @@ const activityStatusPlugin: PluginDef = createPlugin({
252238
name: '@solidtime/activity-status',
253239

254240
optionRefiners: {
255-
activityPeriods: (rawVal: any) => {
241+
activityPeriods: (rawVal: unknown): ActivityPeriod[] => {
256242
if (!Array.isArray(rawVal)) return [];
257-
return rawVal;
243+
return rawVal as ActivityPeriod[];
258244
},
259245
},
260246
});

resources/js/packages/ui/src/TimeEntry/TimeEntryGroupedTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ onMounted(() => {
175175
<div class="@container">
176176
<div v-for="(value, key) in visibleGroupedEntries" :key="key">
177177
<TimeEntryRowHeading
178-
:date="key"
178+
:date="String(key)"
179179
:duration="sumDuration(value)"
180180
:checked="
181181
value.every((timeEntry: TimeEntry) => selectedTimeEntries.includes(timeEntry))

0 commit comments

Comments
 (0)