Skip to content

Commit

Permalink
CSCEXAM-000 Fix REUSE validation
Browse files Browse the repository at this point in the history
  • Loading branch information
lupari committed Aug 21, 2024
1 parent ddbf480 commit b1a0852
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 73 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
60 changes: 0 additions & 60 deletions .github/workflows/scala.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -45,8 +43,8 @@ export class ExceptionDialogRepetitionOptionsComponent {
wholeDay = input(false);
optionChanged = output<RepetitionConfig>();

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) => {
Expand Down Expand Up @@ -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());
});
}
Expand Down
7 changes: 1 addition & 6 deletions ui/src/app/shared/date/date-time-picker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down Expand Up @@ -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 };
};
}

0 comments on commit b1a0852

Please sign in to comment.