diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..1ca000522 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,57 @@ +# SPDX-FileCopyrightText: 2024 The members of the EXAM Consortium +# +# SPDX-License-Identifier: EUPL-1.2 + +name: Build + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + + services: + postgres: + image: postgres + env: + POSTGRES_DB: exam_test + POSTGRES_USER: exam + POSTGRES_PASSWORD: exam + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: temurin + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Check REUSE compliance + uses: fsfe/reuse-action@v4 + + - name: Build UI + run: | + rm -rf node_modules + npm i + npm run check-format + npm run check-lint + npm run build + + - name: Build backend and run tests + run: | + sed -i 's/\/var\/log\/exam/logs/g' $GITHUB_WORKSPACE/conf/logback.xml + sbt test diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml deleted file mode 100644 index 6b68935a6..000000000 --- a/.github/workflows/scala.yml +++ /dev/null @@ -1,60 +0,0 @@ -# SPDX-FileCopyrightText: 2024 The members of the EXAM Consortium -# -# SPDX-License-Identifier: EUPL-1.2 - -name: Build - -on: [push] - -jobs: - build: - - runs-on: ubuntu-latest - - services: - postgres: - image: postgres - env: - POSTGRES_DB: exam_test - POSTGRES_USER: exam - POSTGRES_PASSWORD: exam - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5432:5432 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up JDK - uses: actions/setup-java@v4 - with: - java-version: 21 - distribution: temurin - - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: 20.x - - - name: Check REUSE compliance - uses: fsfe/reuse-action@v3 - - - name: Build UI - run: | - rm -rf node_modules - npm i - npm run check-format - npm run check-lint - npm run build - - - name: Build backend and run tests - run: | - sed -i 's/\/var\/log\/exam/logs/g' $GITHUB_WORKSPACE/conf/logback.xml - sbt test - - diff --git a/ui/src/app/facility/schedule/exception-repetition-options.component.ts b/ui/src/app/facility/schedule/exception-repetition-options.component.ts index e35e445e0..844c2f5ca 100644 --- a/ui/src/app/facility/schedule/exception-repetition-options.component.ts +++ b/ui/src/app/facility/schedule/exception-repetition-options.component.ts @@ -15,11 +15,9 @@ export type RepetitionConfig = { start: Date; end: Date; weekdays: { ord: number; name: string }[]; - // month - dayOfMonth?: number; // determine day of month + dayOfMonth?: number; monthlyOrdinal?: { name: string; ord: number }; monthlyWeekday?: { name: string; ord: number }; - // year, yearlyMonth?: { name: string; ord: number }; }; enum ORDINAL { @@ -45,8 +43,8 @@ export class ExceptionDialogRepetitionOptionsComponent { wholeDay = input(false); optionChanged = output(); - startDate = signal(DateTime.now().set({ minute: 0 }).toJSDate()); - endDate = signal(DateTime.now().set({ minute: 0 }).toJSDate()); + startDate = signal(new Date()); + endDate = signal(new Date()); wholeWeek = signal(false); weekdays = signal( this.DateTimeService.getWeekdayNames(true).map((d, i) => { @@ -80,8 +78,8 @@ export class ExceptionDialogRepetitionOptionsComponent { }); } else { untracked(() => { - this.startDate.set(new Date()); - this.endDate.set(new Date()); + this.startDate.set(DateTime.now().set({ minute: 0 }).toJSDate()); + this.endDate.set(DateTime.now().set({ minute: 0 }).toJSDate()); this.optionChanged.emit(this.getConfig()); }); } diff --git a/ui/src/app/shared/date/date-time-picker.component.ts b/ui/src/app/shared/date/date-time-picker.component.ts index c1ba70152..1fbacf141 100644 --- a/ui/src/app/shared/date/date-time-picker.component.ts +++ b/ui/src/app/shared/date/date-time-picker.component.ts @@ -56,7 +56,6 @@ export class DateTimePickerComponent implements OnInit, OnChanges { ngOnInit() { const now = new Date(); this.time = { hour: now.getHours(), minute: now.getMinutes(), second: now.getSeconds() }; - this.date = new Date(); if (this.initialTime) { this.setDateTime(this.initialTime); } @@ -65,7 +64,6 @@ export class DateTimePickerComponent implements OnInit, OnChanges { ngOnChanges() { const now = new Date(); this.time = { hour: now.getHours(), minute: now.getMinutes(), second: now.getSeconds() }; - this.date = new Date(); if (this.initialTime) { this.setDateTime(this.initialTime); } @@ -94,9 +92,6 @@ export class DateTimePickerComponent implements OnInit, OnChanges { private setDateTime = (dt: Date) => { this.date.setFullYear(dt.getFullYear()); this.date.setMonth(dt.getMonth(), dt.getDate()); - this.time.hour = dt.getHours(); - this.time.minute = dt.getMinutes(); - this.time.second = 0; - this.time.millisecond = 0; + this.time = { ...this.time, hour: dt.getHours(), minute: dt.getMinutes(), second: 0, millisecond: 0 }; }; }