Skip to content

Commit

Permalink
ci: ui workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed May 25, 2024
1 parent d8c246c commit bc49e05
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 18 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: UI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build_site:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Dependencies
run: cd ui && npm install

- name: Code Lint
run: npm run lint

- name: Svelte Check
run: npm run check

- name: Unit Test
run: npm run test:unit

- name: Integration Test
run: npm run test:integration
1 change: 1 addition & 0 deletions ui/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
pnpm-lock.yaml
package-lock.json
yarn.lock
src/lib/components/*
3 changes: 1 addition & 2 deletions ui/src/lib/components/ui/button/button.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<script lang="ts">
import { Button as ButtonPrimitive } from 'bits-ui';
import { type Events, type Props, buttonVariants } from './index.js';
import { type Props, buttonVariants } from './index.js';
import { cn } from '$lib/utils.js';
type $$Props = Props;
type $$Events = Events;
let className: $$Props['class'] = undefined;
export let variant: $$Props['variant'] = 'default';
Expand Down
1 change: 0 additions & 1 deletion ui/src/lib/components/ui/calendar/calendar-day.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import { cn } from '$lib/utils.js';
type $$Props = CalendarPrimitive.DayProps;
type $$Events = CalendarPrimitive.DayEvents;
export let date: $$Props['date'];
export let month: $$Props['month'];
Expand Down
2 changes: 0 additions & 2 deletions ui/src/lib/components/ui/calendar/calendar-grid-head.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import { Calendar as CalendarPrimitive } from 'bits-ui';
import { cn } from '$lib/utils.js';
type $$Props = CalendarPrimitive.GridHeadProps;
let className: string | undefined | null = undefined;
export { className as class };
</script>
Expand Down
2 changes: 0 additions & 2 deletions ui/src/lib/components/ui/calendar/calendar-heading.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import { Calendar as CalendarPrimitive } from 'bits-ui';
import { cn } from '$lib/utils.js';
type $$Props = CalendarPrimitive.HeadingProps;
let className: string | undefined | null = undefined;
export { className as class };
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import { ChevronRight } from 'lucide-svelte';
type $$Props = CalendarPrimitive.NextButtonProps;
type $$Events = CalendarPrimitive.NextButtonEvents;
let className: $$Props['class'] = undefined;
export { className as class };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import { ChevronLeft } from 'lucide-svelte';
type $$Props = CalendarPrimitive.PrevButtonProps;
type $$Events = CalendarPrimitive.PrevButtonEvents;
let className: $$Props['class'] = undefined;
export { className as class };
Expand Down
1 change: 0 additions & 1 deletion ui/src/lib/components/ui/calendar/calendar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import { cn } from '$lib/utils.js';
type $$Props = CalendarPrimitive.Props;
type $$Events = CalendarPrimitive.Events;
export let value: $$Props['value'] = undefined;
export let placeholder: $$Props['placeholder'] = undefined;
Expand Down
4 changes: 0 additions & 4 deletions ui/src/lib/components/ui/card/card.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@
export { className as class };
</script>

<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
class={cn('rounded-xl border bg-card text-card-foreground shadow', className)}
{...$$restProps}
on:click
on:focusin
on:focusout
on:mouseenter
on:mouseleave
>
<slot />
</div>
8 changes: 4 additions & 4 deletions ui/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
class Vehicle {
license_plate!: String;
license_plate!: string;
availability!: Array<Range>;
}
Expand Down Expand Up @@ -122,7 +122,7 @@
};
class Selection {
id!: Number;
id!: number;
vehicle!: Vehicle;
start!: Range;
end!: Range;
Expand All @@ -140,11 +140,11 @@
};
};
const isSelected = (id: Number, cell: Range) => {
const isSelected = (id: number, cell: Range) => {
return selection != null && selection.id == id && overlaps(getSelection()!, cell);
};
const selectionStart = (id: Number, vehicle: Vehicle, cell: Range) => {
const selectionStart = (id: number, vehicle: Vehicle, cell: Range) => {
selection = {
id,
vehicle,
Expand Down

0 comments on commit bc49e05

Please sign in to comment.