From 15a941598a32854743518b3c508b8e84afd869ac Mon Sep 17 00:00:00 2001 From: Christophe Bliard Date: Fri, 3 Jan 2025 16:24:05 +0100 Subject: [PATCH 1/2] [60410] Fetch calendar non-working days for the full date range Fix https://community.openproject.org/wp/60410 When calendar widget displays a range of dates spanning multiple years, non-working days need to be fetched for the entire range or the widget may miss some of them. This is especially true for weeks spanning over two years like from 30-12-2024 to 05-01-2025. --- .../calendar/op-work-packages-calendar.service.ts | 7 +++---- .../calendar/te-calendar/te-calendar.component.ts | 12 ++++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/frontend/src/app/features/calendar/op-work-packages-calendar.service.ts b/frontend/src/app/features/calendar/op-work-packages-calendar.service.ts index 2a854e746d6e..c8569e0e911c 100644 --- a/frontend/src/app/features/calendar/op-work-packages-calendar.service.ts +++ b/frontend/src/app/features/calendar/op-work-packages-calendar.service.ts @@ -147,8 +147,8 @@ export class OpWorkPackagesCalendarService extends UntilDestroyedMixin { } } - async requireNonWorkingDays(date:Date|string) { - this.nonWorkingDays = await firstValueFrom(this.dayService.requireNonWorkingYear$(date)); + async requireNonWorkingDays(start:Date|string, end:Date|string) { + this.nonWorkingDays = await firstValueFrom(this.dayService.requireNonWorkingYears$(start, end)); } isNonWorkingDay(date:Date|string):boolean { @@ -160,8 +160,7 @@ export class OpWorkPackagesCalendarService extends UntilDestroyedMixin { fetchInfo:{ start:Date, end:Date, timeZone:string }, projectIdentifier:string|undefined, ):Promise { - await this.requireNonWorkingDays(fetchInfo.start); - await this.requireNonWorkingDays(fetchInfo.end); + await this.requireNonWorkingDays(fetchInfo.start, fetchInfo.end); if (this.areFiltersEmpty && this.querySpace.query.value) { // nothing to do diff --git a/frontend/src/app/features/calendar/te-calendar/te-calendar.component.ts b/frontend/src/app/features/calendar/te-calendar/te-calendar.component.ts index 6216191458f1..8634c3795442 100644 --- a/frontend/src/app/features/calendar/te-calendar/te-calendar.component.ts +++ b/frontend/src/app/features/calendar/te-calendar/te-calendar.component.ts @@ -181,8 +181,9 @@ export class TimeEntryCalendarComponent { void this.weekdayService.loadWeekdays() .toPromise() .then(async () => { - const date = moment(new Date()).toString(); - await this.requireNonWorkingDays(date); + const startOfWeek = moment().startOf('week').format('YYYY-MM-DD'); + const endOfWeek = moment().endOf('week').format('YYYY-MM-DD'); + await this.requireNonWorkingDays(startOfWeek, endOfWeek); this.additionalOptions.hiddenDays = this.setHiddenDays(displayedDayss); this.calendarOptions$.next( this.additionalOptions, @@ -211,8 +212,8 @@ export class TimeEntryCalendarComponent { readonly dayService:DayResourceService, ) {} - async requireNonWorkingDays(date:Date|string) { - this.nonWorkingDays = await firstValueFrom(this.dayService.requireNonWorkingYear$(date)); + async requireNonWorkingDays(start:Date|string, end:Date|string) { + this.nonWorkingDays = await firstValueFrom(this.dayService.requireNonWorkingYears$(start, end)); } public calendarEventsFunction( @@ -255,8 +256,7 @@ export class TimeEntryCalendarComponent { private async buildEntries(entries:TimeEntryResource[], fetchInfo:{ start:Date, end:Date }):Promise { this.setRatio(entries); - await this.requireNonWorkingDays(fetchInfo.start); - await this.requireNonWorkingDays(fetchInfo.end); + await this.requireNonWorkingDays(fetchInfo.start, fetchInfo.end); return this.buildTimeEntryEntries(entries) .concat(this.buildAuxEntries(entries, fetchInfo)); } From cfe8d8bb3ac5d980a026cbfa45473d2c96ea74b3 Mon Sep 17 00:00:00 2001 From: OpenProject Actions CI Date: Tue, 7 Jan 2025 03:14:12 +0000 Subject: [PATCH 2/2] update locales from crowdin [ci skip] --- config/locales/crowdin/ms.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/config/locales/crowdin/ms.yml b/config/locales/crowdin/ms.yml index 253394417509..5c7c5d44fee4 100644 --- a/config/locales/crowdin/ms.yml +++ b/config/locales/crowdin/ms.yml @@ -33,7 +33,7 @@ ms: label_activity_show_only_changes: "Show changes only" label_sort_asc: "Newest at the bottom" label_sort_desc: "Newest on top" - label_type_to_comment: "Add a comment. Type @ to notify people." + label_type_to_comment: "Tambah ulasan. Taip @ untuk memberitahu orang." label_submit_comment: "Submit comment" changed_on: "changed on" created_on: "created this on" @@ -374,7 +374,7 @@ ms: actions: label_enable_single: "Aktif dalam projek ini, klik untuk nyahaktifkan" label_disable_single: "Tidak aktif dalam projek ini, klik untuk aktifkan" - remove_from_project: "Remove from project" + remove_from_project: "Alih keluar daripada projek" is_required_blank_slate: heading: Diperlukan dalam semua projek description: Atribut projek ini telah diaktifkan dalam semua projek sejak pilihan "Diperlukan dalam semua projek" telah ditandakan. Ia tidak boleh dinyahaktifkan untuk projek individu. @@ -461,8 +461,8 @@ ms: my: access_token: create_dialog: - header: The %{type} token has been generated - warning: Note that this is the only time you will see this token, make sure to copy it now. + header: Token %{type} telah dihasilkan + warning: Ambil perhatian bahawa ini adalah satu-satunya masa anda akan melihat token ini, pastikan anda menyalinnya sekarang. errors: token_name_blank: "Please provide an API token name" token_name_in_use: "This API token name is already in use, please select a different one" @@ -679,7 +679,7 @@ ms: follows_description: "The related work package necessarily needs to finish before this one can start" label_child_singular: "child" label_child_plural: "children" - child_description: "Makes the related work package a sub-item of the current (parent) work package" + child_description: "Menjadikan pakej kerja berkaitan sub-item pakej kerja semasa (ibu bapa)." label_blocks_singular: "blocks" label_blocks_plural: "blocks" blocks_description: "The related work package cannot be closed until this one is closed first" @@ -1374,7 +1374,7 @@ ms: other: "Peranan\n" status: "Status pakej kerja" token/api: - other: Access tokens + other: Token akses type: "Jenis" user: "Pengguna" version: "Versi" @@ -2975,9 +2975,9 @@ ms: notice_locking_conflict: "Sementara itu, maklumat telah dikemas kini oleh sekurang-kurangnya salah satu pengguna lain." notice_locking_conflict_additional_information: "Kemas kini tersebut ialah daripada %{users}." notice_locking_conflict_reload_page: "Sila muat semula halaman, semak semula perubahan dan terapkan semula kemas kini anda." - notice_locking_conflict_warning: "This page has been updated by someone else. To not lose your edits, copy them locally and reload to view the updated version." - notice_locking_conflict_danger: "Could not save your changes because of conflicting modifications. To not lose your edits, copy them locally and reload to view the updated version." - notice_locking_conflict_action_button: "Discard changes and reload" + notice_locking_conflict_warning: "Halaman ini telah dikemas kini oleh orang lain. Untuk tidak kehilangan pengeditan anda, salinnya secara setempat dan muat semula untuk melihat versi yang dikemas kini." + notice_locking_conflict_danger: "Tidak dapat menyimpan perubahan anda kerana pengubahsuaian yang bercanggah. Untuk tidak kehilangan pengeditan anda, salinnya secara setempat dan muat semula untuk melihat versi yang dikemas kini." + notice_locking_conflict_action_button: "Buang perubahan dan muat semula" notice_member_added: Tambah %{name} ke projek. notice_members_added: Tambah %{number} pengguna ke projek. notice_member_removed: "Keluarkan %{user} dari projek." @@ -3860,8 +3860,8 @@ ms: access_warning: "Users will only see the projects they have access to. Sharing project lists does not impact individual project permissions." user_details: owner: "Pemilik senarai" - can_view_because_public: "Can already view because list is shared with everyone" - can_manage_public_lists: "Can edit due to global permissions" + can_view_because_public: "Sudah boleh lihat kerana senarai dikongsi dengan semua orang" + can_manage_public_lists: "Boleh mengedit kerana kebenaran global" public_flag: label: "Share with everyone at %{instance_name}" caption: "Everyone can view this project list. Those with global edit permissions can modify it." @@ -3878,7 +3878,7 @@ ms: edit: "Edit" edit_description: "Can view, share and edit this project list." upsale: - message: "Sharing project lists with individual users is an enterprise add-on." + message: "Berkongsi senarai projek dengan pengguna individu ialah alat tambah perusahaan." working_days: info: > Hari yang tidak dipilih akan dilangkau semasa penjadualan pakej kerja (dan tidak termasuk dalam kiraan hari). Ini boleh digantikan di peringkat pakej-kerja.