Skip to content

Commit e666792

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

File tree

3 files changed

+6
-27
lines changed

3 files changed

+6
-27
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 & 24 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 {
@@ -11,13 +11,6 @@ export interface ActivityStatusPluginOptions {
1111
activityPeriods?: ActivityPeriod[];
1212
}
1313

14-
// Extend FullCalendar's options interface
15-
declare module '@fullcalendar/core' {
16-
interface CalendarOptions {
17-
activityPeriods?: ActivityPeriod[];
18-
}
19-
}
20-
2114
/**
2215
* Creates and manages a tooltip element for activity status boxes
2316
*/
@@ -107,9 +100,6 @@ export function renderActivityStatusBoxes(
107100
// Create a single tooltip instance to be reused
108101
const tooltip = createTooltip();
109102

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

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

133121
activityPeriods.forEach((period) => {
@@ -139,15 +127,6 @@ export function renderActivityStatusBoxes(
139127
return;
140128
}
141129

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

254233
optionRefiners: {
255-
activityPeriods: (rawVal: any) => {
234+
activityPeriods: (rawVal: unknown): ActivityPeriod[] => {
256235
if (!Array.isArray(rawVal)) return [];
257-
return rawVal;
236+
return rawVal as ActivityPeriod[];
258237
},
259238
},
260239
});

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)