Skip to content

Commit

Permalink
Add clarification to examination time selection view
Browse files Browse the repository at this point in the history
  • Loading branch information
VirmasaloA committed Sep 23, 2024
1 parent 2ec42d2 commit d67a177
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
22 changes: 19 additions & 3 deletions ui/src/app/calendar/helpers/selected-room.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ import { OrderByPipe } from 'src/app/shared/sorting/order-by.pipe';
}
</div>
</div>
@if (maintenancePeriods.length > 0) {
@if (thisWeeksMaintenancePeriods().length > 0) {
<div class="row mt-2">
<div class="col-md-2 col-12">{{ 'i18n_maintenance_periods' | translate }}:</div>
<div class="col-md-10 col-12">
@for (period of maintenancePeriods | orderBy: 'startsAt'; track period.id) {
@for (period of thisWeeksMaintenancePeriods() | orderBy: 'startsAt'; track period.id) {
<div>
{{ period.startsAt | date: 'dd.MM.yyyy HH:mm' }} -
{{ period.endsAt | date: 'dd.MM.yyyy HH:mm' }}
Expand All @@ -50,6 +50,10 @@ import { OrderByPipe } from 'src/app/shared/sorting/order-by.pipe';
}
</div>
</div>
} @else {
<div class="row mt-2">
<div class="">{{ 'i18n_no_maintenance_periods_this_week' | translate }}</div>
</div>
}
@if (exceptionHours().length > 0) {
<div class="row mt-2">
Expand All @@ -62,11 +66,15 @@ import { OrderByPipe } from 'src/app/shared/sorting/order-by.pipe';
ngbPopover="{{ eh.description | translate }}"
popoverTitle="{{ 'i18n_instructions' | translate }}"
>
{{ eh.start }} - {{ eh.end }}
{{ eh.start }} - {{ eh.end }} {{ eh.description + '' | translate }}
</div>
}
</div>
</div>
} @else {
<div class="row mt-2">
<div class="">{{ 'i18n_no_exceptions_this_week' | translate }}</div>
</div>
}
@if (getRoomInstructions()) {
<div class="row mt-2">
Expand All @@ -92,6 +100,7 @@ export class SelectedRoomComponent implements OnInit, OnChanges {

openingHours = signal<OpeningHours[]>([]);
exceptionHours = signal<(ExceptionWorkingHours & { start: string; end: string; description: string })[]>([]);
showAllMaintenancePeriods = false;

constructor(
private translate: TranslateService,
Expand Down Expand Up @@ -123,6 +132,13 @@ export class SelectedRoomComponent implements OnInit, OnChanges {
getRoomAccessibility = () =>
this.room.accessibilities ? this.room.accessibilities.map((a) => a.name).join(', ') : '';

thisWeeksMaintenancePeriods() {
const mp = [...this.maintenancePeriods];
return mp.filter((p) => {
const start = DateTime.fromISO(p.startsAt);
return start >= this.viewStart && start < this.viewStart.plus({ week: 1 });
});
}
private init() {
this.openingHours.set(this.Calendar.processOpeningHours(this.room));
this.exceptionHours.set(
Expand Down
4 changes: 3 additions & 1 deletion ui/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1179,5 +1179,7 @@
"i18n_unsaved_changes": "Unsaved changes",
"i18n_type_to_start_search": "Type to start search",
"i18n_datepicker": "Datepicker",
"i18n_move_question": "Change the order of the exam sections by dragging"
"i18n_move_question": "Change the order of the exam sections by dragging",
"i18n_no_maintenance_periods_this_week": "No service breaks this week",
"i18n_no_exceptions_this_week": "No exceptions this week"
}
10 changes: 6 additions & 4 deletions ui/src/assets/i18n/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"i18n_exams": "Tentit",
"i18n_student_exams": "Muut saman opintojakson tentit",
"i18n_exams_to_be_reviewed": "Tenttivastaukset",
"i18n_exception_datetimes": "Poikkeusaukioloajat",
"i18n_exception_datetimes": "Poikkeukset aukioloaikoihin",
"i18n_exception_time": "Poikkeusaukioloaika",
"i18n_exit_feedback": "Poistu palautteesta",
"i18n_exit_preview": "Poistu esikatselusta",
Expand Down Expand Up @@ -189,7 +189,7 @@
"i18n_room_campus": "Kampus",
"i18n_room_code": "Huonekoodi",
"i18n_room_contact_person": "Yhteyshenkilö",
"i18n_room_default_working_hours": "Oletusaukioloaika",
"i18n_room_default_working_hours": "Aukioloaika",
"i18n_room_guidance": "Tilaohjeet",
"i18n_room_out_of_service": "Tila on pois käytöstä",
"i18n_room_videorecordings_url": "Linkki videotallenteisiin",
Expand Down Expand Up @@ -898,7 +898,7 @@
"i18n_exam_rooms_administration": "Tenttitilojen ylläpito",
"i18n_exam_all_rooms": "Kaikki tenttitilat",
"i18n_exam_machine_softwares": "Tarvittavat ohjelmistot",
"i18n_openinghours_exception_datetimes": "Aukioloajat ja poikkeusaukioloajat",
"i18n_openinghours_exception_datetimes": "Aukioloajat ja Poikkeukset aukioloaikoihin",
"i18n_error_ip_address_exists_for_room": "IP-osoite on jo käytössä",
"i18n_exam_materials": "Valitse tentittävät aihealueet",
"i18n_exam_material_description": "Tenttimateriaali/sisältö, johon aihealueen kysymykset perustuvat",
Expand Down Expand Up @@ -1179,5 +1179,7 @@
"i18n_unsaved_changes": "Tallentamattomia muutoksia",
"i18n_type_to_start_search": "Kirjoita aloittaaksesi haku",
"i18n_datepicker": "Päivämäärävalitsin",
"i18n_move_question": "Vaihda kysymysten järjestystä raahaamalla tästä"
"i18n_move_question": "Vaihda kysymysten järjestystä raahaamalla tästä",
"i18n_no_maintenance_periods_this_week": "Ei huoltokatkoja tällä viikolla",
"i18n_no_exceptions_this_week": "Ei poikkeusaukioloaikoja tällä viikolla"
}
4 changes: 3 additions & 1 deletion ui/src/assets/i18n/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -1179,5 +1179,7 @@
"i18n_unsaved_changes": "Osparade ändringar",
"i18n_type_to_start_search": "Skriv för att börja söka",
"i18n_datepicker": "Välj datum",
"i18n_move_question": "Ändra ordningsföljden på frågorna genom att dra"
"i18n_move_question": "Ändra ordningsföljden på frågorna genom att dra",
"i18n_no_maintenance_periods_this_week": "Inga avvikande öppettider denna vecka",
"i18n_no_exceptions_this_week": "Inga avvikande öppettider denna vecka"
}

0 comments on commit d67a177

Please sign in to comment.