Skip to content

Commit 0075056

Browse files
committed
Fixing linting issues
1 parent 4f11b74 commit 0075056

23 files changed

Lines changed: 274 additions & 252 deletions

frontend/index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
<title>Windshift - Work Management</title>
1010
<script>
1111
// Flash prevention: apply theme before CSS loads
12-
(() => {
13-
const stored = localStorage.getItem('windshift-color-mode');
14-
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
15-
const mode = stored === 'dark' || (stored === 'system' && prefersDark) || (!stored && prefersDark) ? 'dark' : 'light';
16-
document.documentElement.dataset.colorMode = mode;
17-
})();
12+
(() => {
13+
const stored = localStorage.getItem('windshift-color-mode');
14+
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
15+
const mode = stored === 'dark' || (stored === 'system' && prefersDark) || (!stored && prefersDark) ? 'dark' : 'light';
16+
document.documentElement.dataset.colorMode = mode;
17+
})();
1818
</script>
1919
</head>
2020
<body>

frontend/src/lib/api/conditionSets.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,5 @@ export const conditionSets = {
2424
fetchAPI(`/condition-sets/${id}`, {
2525
method: 'DELETE',
2626
}),
27-
getByWorkflow: (workflowId) =>
28-
fetchAPI(`/workflows/${workflowId}/condition-sets`),
27+
getByWorkflow: (workflowId) => fetchAPI(`/workflows/${workflowId}/condition-sets`),
2928
};

frontend/src/lib/api/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { auth } from './auth.js';
1717
import { assetReports, channelCategories, channels, requestTypes } from './channels.js';
1818
import { collectionCategories, collections } from './collections.js';
1919
import { conditionSets } from './conditionSets.js';
20-
import { recurrence } from './recurrence.js';
2120
import {
2221
configurationSets,
2322
customFields,
@@ -69,6 +68,7 @@ import {
6968
portalAuth,
7069
portalCustomers,
7170
} from './portal.js';
71+
import { recurrence } from './recurrence.js';
7272
import { issueSync, itemSCMLinks, scmProviders, userSCM, workspaceSCM } from './scm.js';
7373
import { sso } from './sso.js';
7474
import { tests } from './tests/index.js';

frontend/src/lib/api/recurrence.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,5 @@ export const recurrence = {
3737
}),
3838

3939
// Workspace-scoped (admin)
40-
listByWorkspace: (workspaceId) =>
41-
fetchAPI(`/workspaces/${workspaceId}/recurrence-rules`),
40+
listByWorkspace: (workspaceId) => fetchAPI(`/workspaces/${workspaceId}/recurrence-rules`),
4241
};
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<script>
2+
import { onMount } from 'svelte';
3+
4+
let { children, height = 0, class: className = '', style = '' } = $props();
5+
6+
let visible = $state(false);
7+
let el = $state(null);
8+
9+
onMount(() => {
10+
const observer = new IntersectionObserver(
11+
([entry]) => {
12+
if (entry.isIntersecting) {
13+
visible = true;
14+
observer.disconnect();
15+
}
16+
},
17+
{ rootMargin: '200px' }
18+
);
19+
observer.observe(el);
20+
return () => observer.disconnect();
21+
});
22+
</script>
23+
24+
<div
25+
bind:this={el}
26+
class={className}
27+
style="{height ? `min-height: ${height}px;` : ''}{style}"
28+
>
29+
{#if visible}
30+
{@render children()}
31+
{/if}
32+
</div>

frontend/src/lib/editors/rruleUtils.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@
66

77
const DAY_NAMES = ['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU'];
88
const DAY_LABELS = {
9-
MO: 'Mon', TU: 'Tue', WE: 'Wed', TH: 'Thu',
10-
FR: 'Fri', SA: 'Sat', SU: 'Sun',
9+
MO: 'Mon',
10+
TU: 'Tue',
11+
WE: 'Wed',
12+
TH: 'Thu',
13+
FR: 'Fri',
14+
SA: 'Sat',
15+
SU: 'Sun',
1116
};
1217

1318
const FREQ_LABELS = {
@@ -57,9 +62,10 @@ export function parseRRule(rrule) {
5762
break;
5863
case 'UNTIL':
5964
// UNTIL is stored as YYYYMMDD or full datetime
60-
state.endDate = value.length === 8
61-
? `${value.slice(0, 4)}-${value.slice(4, 6)}-${value.slice(6, 8)}`
62-
: value;
65+
state.endDate =
66+
value.length === 8
67+
? `${value.slice(0, 4)}-${value.slice(4, 6)}-${value.slice(6, 8)}`
68+
: value;
6369
state.endType = 'date';
6470
break;
6571
}
@@ -82,9 +88,7 @@ export function buildRRule(state) {
8288

8389
if (state.frequency === 'WEEKLY' && state.byDay?.length > 0) {
8490
// Sort days in standard order
85-
const sorted = [...state.byDay].sort(
86-
(a, b) => DAY_NAMES.indexOf(a) - DAY_NAMES.indexOf(b)
87-
);
91+
const sorted = [...state.byDay].sort((a, b) => DAY_NAMES.indexOf(a) - DAY_NAMES.indexOf(b));
8892
parts.push(`BYDAY=${sorted.join(',')}`);
8993
}
9094

@@ -163,4 +167,4 @@ function ordinal(n) {
163167
return n + (s[(v - 20) % 10] || s[v] || s[0]);
164168
}
165169

166-
export { DAY_NAMES, DAY_LABELS, FREQ_LABELS };
170+
export { DAY_LABELS, DAY_NAMES, FREQ_LABELS };

frontend/src/lib/features/collections/BacklogSprintSection.svelte

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import Lozenge from '../../components/Lozenge.svelte';
66
import WorkItemRow from '../items/WorkItemRow.svelte';
77
import DropIndicator from '../../layout/DropIndicator.svelte';
8+
import LazyRender from '../../components/LazyRender.svelte';
89
910
let {
1011
iteration = null,
@@ -161,25 +162,29 @@
161162
data-item-id={item.id}
162163
data-section-id={sectionId}
163164
>
164-
{#if dragState.get(item.id)?.closestEdge}
165-
<DropIndicator edge={dragState.get(item.id)?.closestEdge} gap={backlogRowGap} />
166-
{/if}
167-
168-
<WorkItemRow
169-
{item}
170-
{workspace}
171-
{itemTypes}
172-
{statuses}
173-
{statusCategories}
174-
onclick={(e) => onOpenItem?.(item.id, e)}
175-
showStatus={true}
176-
>
177-
{#snippet leading()}
178-
<div class="cursor-grab active:cursor-grabbing" style="{styles.dragHandleStyle}">
179-
<GripVertical class="w-4 h-4" />
180-
</div>
165+
<LazyRender height={36}>
166+
{#snippet children()}
167+
{#if dragState.get(item.id)?.closestEdge}
168+
<DropIndicator edge={dragState.get(item.id)?.closestEdge} gap={backlogRowGap} />
169+
{/if}
170+
171+
<WorkItemRow
172+
{item}
173+
{workspace}
174+
{itemTypes}
175+
{statuses}
176+
{statusCategories}
177+
onclick={(e) => onOpenItem?.(item.id, e)}
178+
showStatus={true}
179+
>
180+
{#snippet leading()}
181+
<div class="cursor-grab active:cursor-grabbing" style="{styles.dragHandleStyle}">
182+
<GripVertical class="w-4 h-4" />
183+
</div>
184+
{/snippet}
185+
</WorkItemRow>
181186
{/snippet}
182-
</WorkItemRow>
187+
</LazyRender>
183188
</div>
184189
{/each}
185190
</div>

frontend/src/lib/features/collections/CollectionList.svelte

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import ListCellRenderer from './ListCellRenderer.svelte';
2222
import ColumnSelector from './ColumnSelector.svelte';
2323
import SubFilterBar from './SubFilterBar.svelte';
24+
import LazyRender from '../../components/LazyRender.svelte';
2425
2526
let { workspaceId, collectionId = null } = $props();
2627
@@ -406,43 +407,47 @@
406407
<div>
407408
{#each filteredItems as item (item.id)}
408409
<div class="px-4 py-3 list-row transition-colors" style="border-top: 1px solid var(--ds-border);" data-item-row data-item-id={item.id}>
409-
<div
410-
class="grid gap-4 items-center"
411-
style="grid-template-columns: {gridTemplateColumns};"
412-
>
413-
{#each listColumns as column (column.field_identifier)}
414-
<div class="min-w-0">
415-
<ListCellRenderer
416-
{item}
417-
{column}
418-
{workspace}
419-
{collectionId}
420-
{canEdit}
421-
{statuses}
422-
{statusCategories}
423-
{priorities}
424-
{milestones}
425-
{iterations}
426-
{users}
427-
{projects}
428-
{itemTypes}
429-
{customFieldDefinitions}
430-
onitemUpdated={handleItemUpdated}
431-
onupdateError={handleUpdateError}
432-
/>
410+
<LazyRender>
411+
{#snippet children()}
412+
<div
413+
class="grid gap-4 items-center"
414+
style="grid-template-columns: {gridTemplateColumns};"
415+
>
416+
{#each listColumns as column (column.field_identifier)}
417+
<div class="min-w-0">
418+
<ListCellRenderer
419+
{item}
420+
{column}
421+
{workspace}
422+
{collectionId}
423+
{canEdit}
424+
{statuses}
425+
{statusCategories}
426+
{priorities}
427+
{milestones}
428+
{iterations}
429+
{users}
430+
{projects}
431+
{itemTypes}
432+
{customFieldDefinitions}
433+
onitemUpdated={handleItemUpdated}
434+
onupdateError={handleUpdateError}
435+
/>
436+
</div>
437+
{/each}
438+
439+
<!-- Actions -->
440+
<div>
441+
<DropdownMenu
442+
triggerText=""
443+
triggerIcon={MoreHorizontal}
444+
triggerClass="p-2 rounded action-btn transition-colors"
445+
items={buildItemActions(item)}
446+
/>
447+
</div>
433448
</div>
434-
{/each}
435-
436-
<!-- Actions -->
437-
<div>
438-
<DropdownMenu
439-
triggerText=""
440-
triggerIcon={MoreHorizontal}
441-
triggerClass="p-2 rounded action-btn transition-colors"
442-
items={buildItemActions(item)}
443-
/>
444-
</div>
445-
</div>
449+
{/snippet}
450+
</LazyRender>
446451
</div>
447452
{/each}
448453
</div>

0 commit comments

Comments
 (0)