Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#532: Fix scheduler offset default, improve i18n, and refactor code #566

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"test:unit:once": "vitest --environment jsdom run --outputFile.junit=target/testResults.xml --reporter=junit --reporter=default",
"generate:api": "rm -r -f src/generated-sources && openapi-generator-cli generate",
"license:check": "licensee --production --errors-only",
"license:list": "licensee --production || true"
"license:list": "licensee --production || true",
"lint:test:package": "npm run lint && npm run test:unit:once && npm run package"
},
"engines": {
"node": "18.18.0",
Expand Down
3 changes: 2 additions & 1 deletion src/components/ParticipantList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Licensed under the Elastic License 2.0. */
import {
Participant,
StudyGroup,
StudyStatus,
StudyRole,
StudyStatus,
} from '../generated-sources/openapi';
import MoreTable from './shared/MoreTable.vue';
import ConfirmDialog from 'primevue/confirmdialog';
Expand Down Expand Up @@ -364,6 +364,7 @@ Licensed under the Elastic License 2.0. */
}

const menu = ref();

function toggleButtonMenu(event: MouseEvent): void {
menu.value.toggle(event);
}
Expand Down
7 changes: 1 addition & 6 deletions src/components/dialog/StudyDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,7 @@ Licensed under the Elastic License 2.0. */
:placeholder="$t('study.placeholder.durationInput')"
:auto-resize="true"
:min="0"
@input="
(event) => {
console.log(event);
clearError('duration');
}
"
@input="clearError('duration')"
/>
<span class="w-fit">
{{ $t('scheduler.frequency.days') }}
Expand Down
2 changes: 1 addition & 1 deletion src/components/shared/RelativeScheduler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
);

const endOffset = ref<Duration>({
value: schedule.dtend?.offset?.value ?? 2,
value: schedule.dtend?.offset?.value ?? 1,
unit: DurationUnitEnum.Day,
});
const endTime = ref<DateTime>(
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@
"endAfter": "Bitte geben Sie den Offset zum Enddatum ein.",
"notValid": "Die eingegebenen Werte sind ungültig.",
"repetitionTooLong": "Wiederholungen dürfen das Studienende nicht überschreiten. Das maximale Intervall beträgt {repValue} {repUnit}.",
"repetitionEndTooLong": "Das Ende der Wiederholungen darf die Studiendauer von {durValue} {durUnit} nicht überschreiten."
"repetitionEndTooLong": "Das Ende der Wiederholungen darf die verbleibende Studiendauer von {durValue} {durUnit} nicht überschreiten."
},
"cannotRepeat": "Das Datenerhebungs-Event kann nicht erneut stattfinden, da dies über das Ende der Studie hinausgehen würde."
}
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@
"endAfter": "Fill in the offset to the end date.",
"notValid": "Values entered are not valid",
"repetitionTooLong": "Repetitions must not exceed the end of the study. The maximum interval is {repValue} {repUnit}.",
"repetitionEndTooLong": "The end of repetitions must not exceed the study duration of {durValue} {durUnit}."
"repetitionEndTooLong": "The end of repetitions must not exceed the remaining study duration of {durValue} {durUnit}."
},
"cannotRepeat": "The observation cannot occur again as it would exceed the end of the study."
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/relativeScheduleUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const correctEventRepetition = (
let frequencyEndError: ErrorValue | undefined;

const timeRemaining =
maxDurationInMinutes - (valueToMinutes(offsetStart) - minutesInDay);
maxDurationInMinutes - (valueToMinutes(offsetEnd) - minutesInDay);
if (frequencyEndInMinutes > timeRemaining) {
correctedFrequencyEnd = minutesToDuration(timeRemaining, frequencyEnd.unit);
frequencyEndInMinutes = timeRemaining;
Expand Down
Loading