From 9c5efc6dfea13a198cb541a49e66eec04b3b7866 Mon Sep 17 00:00:00 2001 From: sws2apps-admin Date: Fri, 6 Dec 2024 22:39:42 +0300 Subject: [PATCH 01/31] chore(locales): updated translation from Crowdin --- src/locales/tl-PH/errors.json | 30 ++++++++++++++--------------- src/locales/tl-PH/general.json | 8 ++++---- src/locales/tl-PH/ministry.json | 6 +++--- src/locales/uk-UA/congregation.json | 6 +++--- src/locales/uk-UA/errors.json | 10 +++++----- src/locales/uk-UA/profile.json | 2 +- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/locales/tl-PH/errors.json b/src/locales/tl-PH/errors.json index 810855d8a6..c39e0a29af 100644 --- a/src/locales/tl-PH/errors.json +++ b/src/locales/tl-PH/errors.json @@ -1,19 +1,19 @@ { "error_app_security_invalid-master-key": "Mali ang master key", - "error_api_invalid-endpoint": "The resource you are accessing is not available", - "error_api_internal-error": "An internal error has occurred on our side. Please try again later", - "error_auth_email-already-exists": "The provided email is already in use by an existing user. Each user must have a unique email", - "error_auth_user-not-found": "There is no existing user record corresponding to the provided identifier", - "error_api_unauthorized-request": "You do not have access to this resource", - "error_app_security_invalid-invitation-code-title": "Wrong invitation code", - "error_app_security_invalid-invitation-code": "Please double-check the code you provided", - "error_app_generic-title": "An error occurred", - "error_app_generic-desc": "An error occurred. Try to refresh the page. If this won’t help, try to fully restart Organized. Note, that this will clear all your unsynced data.", + "error_api_invalid-endpoint": "Hindi pa ito available", + "error_api_internal-error": "Mayroong internal error sa amin. Subukan mamaya", + "error_auth_email-already-exists": "Ginagamit na ibang user ang email na binigay. Kailangang may sariling email ang bawat user", + "error_auth_user-not-found": "Walang record ang user sa ibinigay na impormasyon", + "error_api_unauthorized-request": "Ikaw ay walang access", + "error_app_security_invalid-invitation-code-title": "Maling invitation code", + "error_app_security_invalid-invitation-code": "Siguraduhing wasto ang code na ibinigay", + "error_app_generic-title": "Nagkaroon ng error", + "error_app_generic-desc": "Nagkaroon ng error. Subukang i-refresh ang page. Kung hindi ito nakatulong, subukang i-restart ang Organized. Tandaan, mawawala lahat ng hindi nai-sync na data.", "error_app_unsupported-browser-title": "Unsupported browser", - "error_app_unsupported-browser-desc": "You are using an unsupported browser for the Organized app. Please ensure your browser is up to date and that private or incognito mode is turned off. Alternatively, try using a different browser.", - "error_app_security_user-not-found": "No user found with this email address", - "error_app_persons_spiritual-status-change": "Cannot change spiritual status", - "error_app_persons_spiritual-status-baptized-unbaptized": "A baptized publisher cannot be changed to unbaptized.", - "error_app_persons_spiritual-status-baptized-midweek": "A baptized publisher cannot be changed to midweek student.", - "error_app_persons_spiritual-status-unbaptized-midweek": "An unbaptized publisher cannot be changed to midweek student." + "error_app_unsupported-browser-desc": "Hindi suportado ang browser na ginagamit para sa Organized app. Siguraduhing updated ang iyong browser at hindi naka-private o incognito mode. Puwede rin na gumamit ng ibang browser.", + "error_app_security_user-not-found": "Walang user na nakita sa email address na ito", + "error_app_persons_spiritual-status-change": "Hindi maaaring baguhin ang espirituwal na kalagayan", + "error_app_persons_spiritual-status-baptized-unbaptized": "Hindi maaaring baguhin ang isang baptized publisher at gawing unbaptized.", + "error_app_persons_spiritual-status-baptized-midweek": "Hindi maaring gawing estudyante sa midweek ang bautisadong publisher.", + "error_app_persons_spiritual-status-unbaptized-midweek": "Hindi maaring gawing estudyante sa midweek ang di-bautisadong publisher." } diff --git a/src/locales/tl-PH/general.json b/src/locales/tl-PH/general.json index 602a832ce5..62464a0920 100644 --- a/src/locales/tl-PH/general.json +++ b/src/locales/tl-PH/general.json @@ -124,10 +124,10 @@ "tr_dateRangeSelectStart": "Pumili muna ng panimulang petsa", "tr_noNotifications": "Walang notification", "tr_noNotificationsDesc": "Lilitaw rito ang mga importanteng notification.", - "tr_userRoleChanged": "Access changed", + "tr_userRoleChanged": "Binago ang access", "tr_userRoleChangedDesc": "Ang access mo sa Organized ay nabago kamakailan. Mag-log in muli sa iyong account upang magkaroon ang pagbabago.\n\n", - "tr_appliesOnlyToBrothers": "Applies only to brothers", + "tr_appliesOnlyToBrothers": "Sa mga brother lamang", "tr_circuit": "Circuit: {{ circuitNumber }}", - "tr_ageInYearsAndMonths": "{{ years }} years, {{months}} months", - "tr_personHasNoAssignmentHistory": "This person has no assignment history yet" + "tr_ageInYearsAndMonths": "{{ years }} taon, {{months}} buwan", + "tr_personHasNoAssignmentHistory": "Hindi pa siya nabibigyan ng bahagi" } diff --git a/src/locales/tl-PH/ministry.json b/src/locales/tl-PH/ministry.json index 6b6a18505b..7b0f2fa641 100644 --- a/src/locales/tl-PH/ministry.json +++ b/src/locales/tl-PH/ministry.json @@ -124,7 +124,7 @@ "tr_reminderPublisherReportDesc": "Dapat itong ibigay sa kalihim na hindi lalampas ng ika-6 araw ng buwan.", "tr_reminderBranchReport": "Ang ulat ng Field Service at Meeting Attendance ng Kongregasyon (S-1) ay hindi pa naipapasa", "tr_reminderBranchReportDesc": "Dapat na ipasa ito sa tanggapan ng sangay hindi bababa sa ika-20 araw ng buwan.", - "tr_onlyAvailableForPioneers": "Only available for pioneers", - "tr_firstReport": "First report", - "tr_firstReportDesc": "The month when the person’s field service report was first collected" + "tr_onlyAvailableForPioneers": "Available lamang sa mga pioneer", + "tr_firstReport": "Unang ulat", + "tr_firstReportDesc": "Buwan na nakuha ang unang ulat ng kapatid" } diff --git a/src/locales/uk-UA/congregation.json b/src/locales/uk-UA/congregation.json index 0609e700fd..9a25cda131 100644 --- a/src/locales/uk-UA/congregation.json +++ b/src/locales/uk-UA/congregation.json @@ -44,7 +44,7 @@ "tr_video": "Відео", "tr_microphones": "Мікрофони", "tr_stage": "Сцена", - "tr_hallOverseer": "Наглядач залу", + "tr_hallOverseer": "Обслуговуючий в аудиторії", "tr_savedDesc": "Зміни збережено", "tr_deletePerson": "Видалити особу", "tr_deletePersonConfirmation": "Видалити дані про особу з записів твого збору? Якщо в неї є акаунт Organized, вона особа втратить доступу до всієї інформації про збір.", @@ -437,7 +437,7 @@ "tr_speakersLocal": "Місцеві промовці", "tr_addUserSyncNeeded": "Увімкни синхронізацію для збору, щоб додавати користувачів", "tr_addUserSyncNeededDesc": "Щоб додати більше користувачів до збору, увімкни функцію синхронізації для твого збору. Це дозволить тобі додати більше користувачів та пристроїв для покращення співпраці. Її можна ввімкнути або вимкнути у будь-який час на сторінці налаштування збору.", - "tr_deleteCongregationDesc": "Are you sure to delete your congregation from Organized? This will completely remove all your congregation data and there is no way to recover them anymore. All user accounts linked to your congregation will also be deleted. Enter below the congregation master key to confirm the deletion.", + "tr_deleteCongregationDesc": "Ти впевнений, що хочеш видалити свій збір з Organized? Це повністю видалить всі дані твого збору, і їх неможливо буде відновити. Всі облікові записи користувачів, пов'язані з твоїм збором, також будуть видалені. Введи головний ключ збору нижче, щоб підтвердити видалення.", "tr_deleteCongregationMasterKeyRequired": "Введи головний ключ", - "tr_entranceAttendant": "Entrance attendant" + "tr_entranceAttendant": "Обслуговуючий блія входу" } diff --git a/src/locales/uk-UA/errors.json b/src/locales/uk-UA/errors.json index aa4c5a19e2..1ad23becfc 100644 --- a/src/locales/uk-UA/errors.json +++ b/src/locales/uk-UA/errors.json @@ -1,14 +1,14 @@ { "error_app_security_invalid-master-key": "Введений головний ключ неправильний", - "error_api_invalid-endpoint": "The resource you are accessing is not available", - "error_api_internal-error": "An internal error has occurred on our side. Please try again later", - "error_auth_email-already-exists": "The provided email is already in use by an existing user. Each user must have a unique email", - "error_auth_user-not-found": "There is no existing user record corresponding to the provided identifier", + "error_api_invalid-endpoint": "Ресурс, до якого ти хочеш отримати доступ, не доступний", + "error_api_internal-error": "Сталася внутрішня помилка з нашого боку. Будь ласка, спробуй ще раз пізніше", + "error_auth_email-already-exists": "Надана адреса електронної пошти вже використовується існуючим користувачем. Кожен користувач повинен мати унікальну адресу електронної пошти", + "error_auth_user-not-found": "Немає записів користувача, що відповідає наданому ідентифікатору", "error_api_unauthorized-request": "У тебе немає доступу до цього ресурсу", "error_app_security_invalid-invitation-code-title": "Неправильний код запрошення", "error_app_security_invalid-invitation-code": "Будь ласка, ще раз перевір вказаний код", "error_app_generic-title": "Сталася помилка", - "error_app_generic-desc": "An error occurred. Try to refresh the page. If this won’t help, try to fully restart Organized. Note, that this will clear all your unsynced data.", + "error_app_generic-desc": "Сталася помилка. Спробуй оновити сторінку. Якщо це не допоможе, спробуй повністю перезапустити Organized. Зверни увагу, що це очистить усі твої несинхронізовані дані.", "error_app_unsupported-browser-title": "Браузер не підтримується", "error_app_unsupported-browser-desc": "Ти використовуєш непідтримуваний браузер для додатку Organized. Будь ласка, переконайся, що твій браузер оновлений, та що приватний режим або режим інкогніто вимкнений. Або ж, спробуй скористатися іншим браузером.", "error_app_security_user-not-found": "Користувача з цією електронною адресою не знайдено", diff --git a/src/locales/uk-UA/profile.json b/src/locales/uk-UA/profile.json index 7f09a55a24..d4aa4af68e 100644 --- a/src/locales/uk-UA/profile.json +++ b/src/locales/uk-UA/profile.json @@ -79,6 +79,6 @@ "tr_terminatedDesc": "Сесія припинена", "tr_deleteAccount": "Видалити мій аккаунт", "tr_deleteAccountDesc": "Ти впевнений, що хочеш видалити свій акаунт з Organized?", - "tr_deleteAccountWithCongregationDesc": "Are you sure to delete your account from Organized? This will also delete your congregation since you are its only one user. Enter below the congregation master key to confirm the deletion.", + "tr_deleteAccountWithCongregationDesc": "Ти впевнений, що хочеш видалити свій обліковий запис з Organized? Це також видалить твій збір, оскільки ти є його єдиним користувачем. Введи головний ключ збору нижче, щоб підтвердити видалення.", "tr_deleteAccountAssignAdminFirst": "Перш ніж видалити свій обліковий запис, обовʼязково признач іншого адміністратора додатку, що підтримувати користувачів у твоєму зборі." } From 569ad6e50eb880815d91d11c5e33ea892d8a1c00 Mon Sep 17 00:00:00 2001 From: Max Makaluk <70341920+FussuChalice@users.noreply.github.com> Date: Sun, 8 Dec 2024 12:17:08 +0200 Subject: [PATCH 02/31] fix(reports): add indeterminate state for S-21 export checkboxes --- .../active_publishers/useActivePublishers.tsx | 11 ++++- .../useFieldServiceGroups.tsx | 11 ++++- .../useInactivePublishers.tsx | 11 ++++- .../useParentUncheckHandler.tsx | 46 +++++++++++++++++++ 4 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 src/features/reports/publisher_records/export_S21/specific_records/useParentUncheckHandler.tsx diff --git a/src/features/reports/publisher_records/export_S21/specific_records/active_publishers/useActivePublishers.tsx b/src/features/reports/publisher_records/export_S21/specific_records/active_publishers/useActivePublishers.tsx index 804bd68eda..b19941e22b 100644 --- a/src/features/reports/publisher_records/export_S21/specific_records/active_publishers/useActivePublishers.tsx +++ b/src/features/reports/publisher_records/export_S21/specific_records/active_publishers/useActivePublishers.tsx @@ -8,11 +8,13 @@ import { fullnameOptionState } from '@states/settings'; import { buildPersonFullname } from '@utils/common'; import { ActivePublishersProps } from './index.types'; import usePersons from '@features/persons/hooks/usePersons'; +import useParentUncheckHandler from '../useParentUncheckHandler'; const useActivePublishers = ({ onExport }: ActivePublishersProps) => { const { t } = useAppTranslation(); const { getFTSMonths, getAPMonths, getPublisherMonths } = usePersons(); + const { deleteSelectionFromParentItem } = useParentUncheckHandler(); const toggledItemRef = useRef<{ [itemId: string]: boolean }>({}); @@ -157,7 +159,14 @@ const useActivePublishers = ({ onExport }: ActivePublishersProps) => { ) ); - setSelected(newSelectedItemsWithChildren); + // remove parent check if at least one child element has been unchecked. + const selectedItemsWithoutParent = deleteSelectionFromParentItem( + newSelectedItemsWithChildren, + groups, + selected + ); + + setSelected(selectedItemsWithoutParent); toggledItemRef.current = {}; }; diff --git a/src/features/reports/publisher_records/export_S21/specific_records/field_service_groups/useFieldServiceGroups.tsx b/src/features/reports/publisher_records/export_S21/specific_records/field_service_groups/useFieldServiceGroups.tsx index a8be442e54..6032d9c1df 100644 --- a/src/features/reports/publisher_records/export_S21/specific_records/field_service_groups/useFieldServiceGroups.tsx +++ b/src/features/reports/publisher_records/export_S21/specific_records/field_service_groups/useFieldServiceGroups.tsx @@ -11,11 +11,13 @@ import { FieldServiceGroupType } from '@definition/field_service_groups'; import { personsState } from '@states/persons'; import { FieldServiceGroupsProps } from './index.types'; import usePersons from '@features/persons/hooks/usePersons'; +import useParentUncheckHandler from '../useParentUncheckHandler'; const useFieldServiceGroups = ({ onExport }: FieldServiceGroupsProps) => { const { t } = useAppTranslation(); const { getPublishersActive } = usePersons(); + const { deleteSelectionFromParentItem } = useParentUncheckHandler(); const toggledItemRef = useRef<{ [itemId: string]: boolean }>({}); @@ -148,7 +150,14 @@ const useFieldServiceGroups = ({ onExport }: FieldServiceGroupsProps) => { ) ); - setSelected(newSelectedItemsWithChildren); + // remove parent check if at least one child element has been unchecked. + const selectedItemsWithoutParent = deleteSelectionFromParentItem( + newSelectedItemsWithChildren, + groups, + selected + ); + + setSelected(selectedItemsWithoutParent); toggledItemRef.current = {}; }; diff --git a/src/features/reports/publisher_records/export_S21/specific_records/inactive_publishers/useInactivePublishers.tsx b/src/features/reports/publisher_records/export_S21/specific_records/inactive_publishers/useInactivePublishers.tsx index a53dfc9c9b..d087e99645 100644 --- a/src/features/reports/publisher_records/export_S21/specific_records/inactive_publishers/useInactivePublishers.tsx +++ b/src/features/reports/publisher_records/export_S21/specific_records/inactive_publishers/useInactivePublishers.tsx @@ -8,11 +8,13 @@ import { fullnameOptionState } from '@states/settings'; import { buildPersonFullname } from '@utils/common'; import { InactivePublishersProps } from './index.types'; import usePersons from '@features/persons/hooks/usePersons'; +import useParentUncheckHandler from '../useParentUncheckHandler'; const useInactivePublishers = ({ onExport }: InactivePublishersProps) => { const { t } = useAppTranslation(); const { getPublishersInactive } = usePersons(); + const { deleteSelectionFromParentItem } = useParentUncheckHandler(); const toggledItemRef = useRef<{ [itemId: string]: boolean }>({}); @@ -113,7 +115,14 @@ const useInactivePublishers = ({ onExport }: InactivePublishersProps) => { ) ); - setSelected(newSelectedItemsWithChildren); + // remove parent check if at least one child element has been unchecked. + const selectedItemsWithoutParent = deleteSelectionFromParentItem( + newSelectedItemsWithChildren, + groups, + selected + ); + + setSelected(selectedItemsWithoutParent); toggledItemRef.current = {}; }; diff --git a/src/features/reports/publisher_records/export_S21/specific_records/useParentUncheckHandler.tsx b/src/features/reports/publisher_records/export_S21/specific_records/useParentUncheckHandler.tsx new file mode 100644 index 0000000000..4159ecee1f --- /dev/null +++ b/src/features/reports/publisher_records/export_S21/specific_records/useParentUncheckHandler.tsx @@ -0,0 +1,46 @@ +import { TreeViewBaseItem } from '@mui/x-tree-view'; + +const useParentUncheckHandler = () => { + const findParentIdByItem = ( + dataSource: TreeViewBaseItem[], + itemId: string, + parentId: string = null + ) => { + for (const item of dataSource) { + if (item.id === itemId) { + return parentId; + } + if (item.children) { + const found = findParentIdByItem(item.children, itemId, item.id); + if (found) { + return found; + } + } + } + return null; + }; + + const deleteSelectionFromParentItem = ( + oldSelectedList: string[], + groups: TreeViewBaseItem[], + selected: string[] + ) => { + const missedItem = selected.filter( + (item) => !oldSelectedList.includes(item) + )[0]; + + if (!missedItem) { + return oldSelectedList; + } + + const missedItemParent = findParentIdByItem(groups, missedItem); + + return oldSelectedList.filter((item) => item !== missedItemParent); + }; + + return { + deleteSelectionFromParentItem, + }; +}; + +export default useParentUncheckHandler; From 1a147a179b36239818645dae2a04f457fb9747d3 Mon Sep 17 00:00:00 2001 From: sws2apps-admin Date: Sat, 7 Dec 2024 02:44:05 +0300 Subject: [PATCH 03/31] New translations onboarding.json (Portuguese, Brazilian) --- src/locales/pt-BR/onboarding.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locales/pt-BR/onboarding.json b/src/locales/pt-BR/onboarding.json index 169e2d80cf..adcfcb0af1 100644 --- a/src/locales/pt-BR/onboarding.json +++ b/src/locales/pt-BR/onboarding.json @@ -32,8 +32,8 @@ "tr_illustrationSecretaryHeader": "Todos os relatórios do secretário", "tr_illustrationSecretaryDescription": "Acompanhe os relatórios de presença das reuniões, tanto mensalmente como anualmente. Veja os relatórios dos publicadores e envie facilmente todos os relatórios necessários diretamente para a filial. Receba e veja as petições dos pioneiros.", "tr_selectAccount": "Para começar a usar o Organized, escolha a opção que se aplica a você:", - "tr_accountPublisherStudent": "Sem privilégios de serviço (irmãos e irmãs batizados, publicadores e estudantes da reunião do meio de semana)", - "tr_accountBaptizedBrother": "Com privilégios de serviço (servos ministeriais e anciãos)", + "tr_accountPublisherStudent": "Publicador ou estudante da reunião do meio de semana", + "tr_accountBaptizedBrother": "Irmão batizado", "tr_connectCongregation": "Conecte-se à sua congregação", "tr_invitationCode": "Código do convite", "tr_orLabel": "ou", From a57ffae453450bee567ab3dc512498fa5b8643c0 Mon Sep 17 00:00:00 2001 From: sws2apps-admin Date: Sat, 7 Dec 2024 18:26:38 +0300 Subject: [PATCH 04/31] New translations onboarding.json (Italian) --- src/locales/it-IT/onboarding.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locales/it-IT/onboarding.json b/src/locales/it-IT/onboarding.json index 42d60a02bf..8588844bc9 100644 --- a/src/locales/it-IT/onboarding.json +++ b/src/locales/it-IT/onboarding.json @@ -13,7 +13,7 @@ "tr_readComplete": "I accept the Terms of Use and Privacy Policy and consent to the processing of my personal data as described.", "tr_email": "Email", "tr_accountCreated": "Your Organized account is registered. Notify your congregation administrator so he can assign you the required permissions. Then refresh the page to log in.", - "tr_createCongregationAccount": "Create congregation", + "tr_createCongregationAccount": "Crea congregazione", "tr_unauthorizedRole": "

Your account is all set! To access the Organized app, please ask your congregation’s app administrator to give you permissions and refresh the page in 5 minutes.

Elders can contact us at support@organized-app.com if they need assistance.

", "tr_oauthAccept": "

Learn more about out Terms of Use and Privacy Policy.

", "tr_signInDesc": "Choose how you want to log in", From 512f8af095fe0613d98b985f0a4f83890e3ad719 Mon Sep 17 00:00:00 2001 From: sws2apps-admin Date: Sat, 7 Dec 2024 20:01:02 +0300 Subject: [PATCH 05/31] New translations general.json (Slovenian) --- src/locales/sl-SI/general.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/locales/sl-SI/general.json b/src/locales/sl-SI/general.json index 859cd25adf..70a862ae38 100644 --- a/src/locales/sl-SI/general.json +++ b/src/locales/sl-SI/general.json @@ -124,10 +124,10 @@ "tr_dateRangeSelectStart": "Najprej izberi datum začetka", "tr_noNotifications": "Ni še obvestil", "tr_noNotificationsDesc": "Tu bodo prikazana pomembna obvestila.", - "tr_userRoleChanged": "Access changed", + "tr_userRoleChanged": "Dostop je spremenjen", "tr_userRoleChangedDesc": "Nedavno je bil spremenjen tvoj dostop v aplikaciji Organized. Ponovno se prijavi v svoj račun, da bodo spremembe začele veljati.", - "tr_appliesOnlyToBrothers": "Applies only to brothers", - "tr_circuit": "Circuit: {{ circuitNumber }}", - "tr_ageInYearsAndMonths": "{{ years }} years, {{months}} months", - "tr_personHasNoAssignmentHistory": "This person has no assignment history yet" + "tr_appliesOnlyToBrothers": "Nanaša se samo na brate", + "tr_circuit": "Okraj: {{ circuitNumber }}", + "tr_ageInYearsAndMonths": "let: {{ years }}; mesecev: {{months}}", + "tr_personHasNoAssignmentHistory": "Ta oseba še nima zgodovine nalog" } From 5a95fa7282728d9bb10b5980b24c9709b02a862c Mon Sep 17 00:00:00 2001 From: sws2apps-admin Date: Sat, 7 Dec 2024 20:01:03 +0300 Subject: [PATCH 06/31] New translations meetings.json (Slovenian) --- src/locales/sl-SI/meetings.json | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/locales/sl-SI/meetings.json b/src/locales/sl-SI/meetings.json index a39b4ba043..c61cc1e73b 100644 --- a/src/locales/sl-SI/meetings.json +++ b/src/locales/sl-SI/meetings.json @@ -74,7 +74,7 @@ "tr_successfullyPublished": "Uspešno objavljeno", "tr_successfullyPublishedDesc": "Zdaj lahko vsi v občini vidijo razpored in se pripravijo na naloge", "tr_lastUpdated": "Nazadnje posodobljeno: {{ date }}", - "tr_outgoingTalks": "Govori bratov, ki lahko imajo shode v drugih občinah", + "tr_outgoingTalks": "Govori, ki jih imajo bratje v drugih občinah", "tr_infoOutgoingTalk": "Bratje, ki bodo imeli javni govor v drugih občinah", "tr_speakersWithCount": "Govorniki: {{ speakersCount }}", "tr_JWImport": "Uvažanje gradiva z jw.org", @@ -134,17 +134,17 @@ "tr_visitinSpeakerHelpText": "Govornike lahko dodaš ročno, vendar priporočamo, da jih vnaprej dodaš na stran Seznam govornikov", "tr_noSpeakersYet": "Še ni govornikov", "tr_speakersCatalog": "Seznam govornikov", - "tr_speakersCatalogLocalDesc": "Based on your selection, you see visiting speakers from other congregations. To assign another speaker not from the catalog, simply close this window and select him in the 'Speaker' field.", - "tr_speakersCatalogVisitingDesc": "Based on your selection, you see the outgoing speakers of your congregatiog. To assign another local brother not from the catalog, simply close this window and select him in the speaker field.", - "tr_clearMultipleAssignments": "Clear multiple meeting assignments", - "tr_outgoingTalk": "Outgoing talk", - "tr_outgoingTalkSynced": "This outgoing talk has been synced with the {{ congregation }} congregation schedule. Please contact their public talk coordinator for any corrections or updates.", - "tr_clearOutgoingTalkDesc": "Are you sure you want to clear all assignments and congregation details for this outgoing talk? You can always fill out them later.", - "tr_outgoingTalkDelete": "Delete outgoing talk", - "tr_outgoingTalkDeleteDesc": "Are you sure you want to delete this outgoing talk schedule?", - "tr_deliveredBy": "Delivers: {{ name }}", - "tr_toCurrentWeek": "To current week", - "tr_recordAttendance": "Attendance records", - "tr_assignmentPreferences": "Assignment preferences", - "tr_notEditableInEditPartsMode": "Not editable in ‘Edit parts’ mode" + "tr_speakersCatalogLocalDesc": "Glede na tvojo izbiro vidiš gostujoče govornike iz drugih občin. Če želiš izbrati drugega govornika, ki ga ni na seznamu, preprosto zapri to okno in ga izberi v polju 'Govornik'.", + "tr_speakersCatalogVisitingDesc": "Glede na tvojo izbiro vidiš brate iz svoje občine, ki imajo govore v drugih občinah. Če želiš izbrati drugega lokalnega brata, ki ga ni na seznamu, preprosto zapri to okno in ga izberi v polju govornik.", + "tr_clearMultipleAssignments": "Počisti več nalog na shodu", + "tr_outgoingTalk": "Govor, ki ga bo imel brat v drugi občini", + "tr_outgoingTalkSynced": "Ta govor, ki ga bo imel brat v drugi občini, je bil sinhroniran z razporedom občine {{ congregation }}. Glede morebitnih popravkov ali sprememb kontaktiraj njihovega koordinatorja za javne govore.", + "tr_clearOutgoingTalkDesc": "Ali si prepričan, da želiš počistiti vse naloge in občinske podrobnosti za ta govor, ki ga bo imel brat v drugi občini? Kasneje jih lahko še vedno dodaš.", + "tr_outgoingTalkDelete": "Izbriši govor, ki ga bo imel brat v drug občini", + "tr_outgoingTalkDeleteDesc": "Ali si prepričan, da želiš izbrisati razpored tega govora, ki ga bodo imeli bratje v drugih občinah?", + "tr_deliveredBy": "Predava: {{ name }}", + "tr_toCurrentWeek": "Do trenutnega tedna", + "tr_recordAttendance": "Poročila o obisku", + "tr_assignmentPreferences": "Nastavitve za naloge", + "tr_notEditableInEditPartsMode": "Ni mogoče urejati v načinu ‘Uredi točke’" } From cd9309948ccfd4dd54c81c9e0e6de73d9db47c65 Mon Sep 17 00:00:00 2001 From: sws2apps-admin Date: Sat, 7 Dec 2024 20:01:04 +0300 Subject: [PATCH 07/31] New translations errors.json (Slovenian) --- src/locales/sl-SI/errors.json | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/locales/sl-SI/errors.json b/src/locales/sl-SI/errors.json index 8ef44a85da..1ad3b2361d 100644 --- a/src/locales/sl-SI/errors.json +++ b/src/locales/sl-SI/errors.json @@ -1,19 +1,19 @@ { - "error_app_security_invalid-master-key": "The master key you provided is incorrect", - "error_api_invalid-endpoint": "The resource you are accessing is not available", - "error_api_internal-error": "An internal error has occurred on our side. Please try again later", - "error_auth_email-already-exists": "The provided email is already in use by an existing user. Each user must have a unique email", - "error_auth_user-not-found": "There is no existing user record corresponding to the provided identifier", - "error_api_unauthorized-request": "You do not have access to this resource", - "error_app_security_invalid-invitation-code-title": "Wrong invitation code", - "error_app_security_invalid-invitation-code": "Please double-check the code you provided", - "error_app_generic-title": "An error occurred", - "error_app_generic-desc": "An error occurred. Try to refresh the page. If this won’t help, try to fully restart Organized. Note, that this will clear all your unsynced data.", - "error_app_unsupported-browser-title": "Unsupported browser", - "error_app_unsupported-browser-desc": "You are using an unsupported browser for the Organized app. Please ensure your browser is up to date and that private or incognito mode is turned off. Alternatively, try using a different browser.", - "error_app_security_user-not-found": "No user found with this email address", - "error_app_persons_spiritual-status-change": "Cannot change spiritual status", - "error_app_persons_spiritual-status-baptized-unbaptized": "A baptized publisher cannot be changed to unbaptized.", - "error_app_persons_spiritual-status-baptized-midweek": "A baptized publisher cannot be changed to midweek student.", - "error_app_persons_spiritual-status-unbaptized-midweek": "An unbaptized publisher cannot be changed to midweek student." + "error_app_security_invalid-master-key": "Glavni ključ, ki si ga vpisal, ni pravilen", + "error_api_invalid-endpoint": "Vir, do katerega želiš dostopati, ni na voljo", + "error_api_internal-error": "Na naši strani je prišlo do notranje napake. Prosimo, poskusi kasneje", + "error_auth_email-already-exists": "Navedeni e-poštni naslov že uporablja drug uporabnik. Vsak uporabnik mora imeti edinstven e-poštni naslov.", + "error_auth_user-not-found": "Ni nobene obstoječe uporabniške evidence, ki bi ustrezala navedenemu identifikatorju.", + "error_api_unauthorized-request": "Nimaš dostopa do tega vira", + "error_app_security_invalid-invitation-code-title": "Napačna koda povabila", + "error_app_security_invalid-invitation-code": "Prosimo, znova preveri kodo, ki si jo vpisal", + "error_app_generic-title": "Prišlo je do napake", + "error_app_generic-desc": "Prišlo je do napake. Poskusi osvežiti stran. Če to ne bo pomagalo, zapri aplikacijo in jo ponovno zaženi. Upoštevaj, da se bodo s tem izbrisali vsi podatki, ki še niso bili sinhronizirani.", + "error_app_unsupported-browser-title": "Nepodprt brskalnik", + "error_app_unsupported-browser-desc": "Uporabljaš nepodprt brskalnik za aplikacijo Organized. Prosimo, poskrbi, da bo tvoj brskalnik posodobljen in da je način zasebnega brskanja izklopljen. Lahko tudi poskusiš uporabiti drug brskalnik.", + "error_app_security_user-not-found": "Noben uporabnik ni najden s tem e-poštnim naslovom", + "error_app_persons_spiritual-status-change": "Ni mogoče spremeniti duhovnega statusa", + "error_app_persons_spiritual-status-baptized-unbaptized": "Krščenega oznanjevalca ni mogoče spremeniti v nekrščenega.", + "error_app_persons_spiritual-status-baptized-midweek": "Krščenega oznanjevalca ni mogoče spremeniti v učenca za shod med tednom.", + "error_app_persons_spiritual-status-unbaptized-midweek": "Nekrščenega oznanjevalca ni mogoče spremeniti v učenca za shod med tednom." } From 0a8c1a57da1b86c65f15df4be33c6856ea5b7a72 Mon Sep 17 00:00:00 2001 From: sws2apps-admin Date: Sat, 7 Dec 2024 21:13:07 +0300 Subject: [PATCH 08/31] New translations ministry.json (Slovenian) --- src/locales/sl-SI/ministry.json | 234 ++++++++++++++++---------------- 1 file changed, 117 insertions(+), 117 deletions(-) diff --git a/src/locales/sl-SI/ministry.json b/src/locales/sl-SI/ministry.json index 8cf9e6aadd..d19682c60a 100644 --- a/src/locales/sl-SI/ministry.json +++ b/src/locales/sl-SI/ministry.json @@ -1,130 +1,130 @@ { - "tr_addServiceTime": "Add service time", - "tr_hours": "Hours", - "tr_btnAdd": "Add", - "tr_creditHours": "Credit hours", - "tr_addNewStudy": "Add new Bible study", - "tr_editBibleStudy": "Edit Bible study", - "tr_pioneerSchool": "Pioneer school", - "tr_ministryTimeHours": "{{ ministryTime }} hours", - "tr_SKE": "School for Kingdom Evangelizers", - "tr_languageCourse": "Language class", - "tr_personalDay": "Personal day", - "tr_saveChanges": "Save changes", - "tr_deleteStudy": "Delete the study", - "tr_timeInService": "Time already in service", - "tr_timeInServiceDesc": "The time will be added to the ministry timer", - "tr_monthlyReport": "Monthly report", - "tr_sharedMinistry": "Shared in any form of ministry during this month", - "tr_dailyHistory": "Daily history", - "tr_btnAddRecord": "Add record", - "tr_addRecordDesc": "You don’t have any daily service records yet. Add them here to fill out your monthly report.", - "tr_btnSubmitReport": "Submit report", - "tr_badgeGoalHours": "out of {{ ministryTime }} h", - "tr_btnAddCreditHours": "Add hours credit", - "tr_extraTime": "You have extra minutes: {{ ministryTime }}", - "tr_extraTimeDesc": "Do you want to transfer this time over to the next month?", - "tr_btnTransfer": "Transfer", - "tr_btnNoKeepIt": "No, keep it", - "tr_btnUndoSumbission": "Undo sumbission", - "tr_totalHours": "Total hours", - "tr_fieldMinistry": "Field ministry", - "tr_averageMonthlyBibleStudies": "Average Bible studies per month", - "tr_maximumMonthlyBibleStudies": "Peak Bible studies per month", - "tr_monthlyHistory": "Monthly history", - "tr_ahead": "Ahead", - "tr_inProgress": "In progress", - "tr_pioneerServiceStats": "Pioneer service stats", - "tr_goalForYear": "Goal for this year", - "tr_hoursLeft": "Hours left", - "tr_currentMonthlyGoal": "Current monthly goal", - "tr_hoursBalance": "Hours balance", - "tr_applicationAuxiliaryPioneer": "Auxiliary pioneer application", - "tr_submitApplication": "Submit the application", - "tr_serviceOverseer": "Service overseer", - "tr_auxiliaryPioneer": "Auxiliary pioneer", - "tr_comments": "Comments", - "tr_PWLocations": "Public witnessing locations", - "tr_PW": "Public witnessing", - "tr_maxPublisherShift": "Max. publishers per shift: {{ maxPublisherCount }}", - "tr_partnerNeeded": "Partner needed", - "tr_partnerNeededDesc": "Other publishers will see this and be able to arrange with you", - "tr_locationName": "Location name", - "tr_GeneralTimeRules": "General time rules", - "tr_maxPublisherLabel": "Max. publishers per shift", - "tr_PWShifts": "Public witnessing shifts", - "tr_selectDays": "Select days", - "tr_everyDay": "Every day", - "tr_daysShifts": "Shifts: {{ dayName }}", - "tr_addShift": "Add shift", - "tr_confirmArrangement": "Confirm the arrangement", - "tr_havePartner": "I have a partner", - "tr_havePartnerDesc": "Select your partner from the list or enter their name", - "tr_arrangementWith": "With: {{ publisherName }}", - "tr_addToCalendar": "Add to calendar", + "tr_addServiceTime": "Dodaj čas oznanjevanja", + "tr_hours": "Ure", + "tr_btnAdd": "Dodaj", + "tr_creditHours": "Priznane ure", + "tr_addNewStudy": "Dodaj nov svetopisemski tečaj", + "tr_editBibleStudy": "Uredi svetopisemski tečaj", + "tr_pioneerSchool": "Šola za pionirje", + "tr_ministryTimeHours": "ure: {{ ministryTime }}", + "tr_SKE": "Šola za oznanjevalce Kraljestva", + "tr_languageCourse": "Jezikovni tečaj", + "tr_personalDay": "Prost dan", + "tr_saveChanges": "Shrani spremembe", + "tr_deleteStudy": "Izbriši tečaj", + "tr_timeInService": "Čas, že preživet na oznanjevanju", + "tr_timeInServiceDesc": "Čas bo dodan k oznanjevalskemu časovniku", + "tr_monthlyReport": "Mesečno poročilo", + "tr_sharedMinistry": "V tem mesecu je sodeloval v eni od oblik oznanjevanja", + "tr_dailyHistory": "Dnevna zgodovina", + "tr_btnAddRecord": "Dodaj poročilo", + "tr_addRecordDesc": "Še nimaš dnevnih oznanjevalskih poročil. Dodaj jih sem, da izpolniš svoje mesečno poročilo.", + "tr_btnSubmitReport": "Pošlji poročilo", + "tr_badgeGoalHours": "od {{ ministryTime }} ur", + "tr_btnAddCreditHours": "Dodaj priznane ure", + "tr_extraTime": "Imaš dodatne minute: {{ ministryTime }}", + "tr_extraTimeDesc": "Ali želiš ta čas prenesti v naslednji mesec?", + "tr_btnTransfer": "Prenesi", + "tr_btnNoKeepIt": "Ne, obdrži ga", + "tr_btnUndoSumbission": "Razveljavi pošiljanje", + "tr_totalHours": "Skupaj ur", + "tr_fieldMinistry": "Terenska služba", + "tr_averageMonthlyBibleStudies": "Povprečno svetopisemskih tečajev na mesec", + "tr_maximumMonthlyBibleStudies": "Najvišje število svetopisemskih tečajev na mesec", + "tr_monthlyHistory": "Mesečna zgodovina", + "tr_ahead": "Naprej", + "tr_inProgress": "V teku", + "tr_pioneerServiceStats": "Oznanjevalska statistika pionirjev", + "tr_goalForYear": "Cilj za to leto", + "tr_hoursLeft": "Preostale ure", + "tr_currentMonthlyGoal": "Trenutni mesečni cilj", + "tr_hoursBalance": "Seštevek ur", + "tr_applicationAuxiliaryPioneer": "Prošnja za pomožno pionirsko službo", + "tr_submitApplication": "Pošlji prošnjo", + "tr_serviceOverseer": "Službeni nadzornik", + "tr_auxiliaryPioneer": "Pomožni pionir", + "tr_comments": "Opombe", + "tr_PWLocations": "Lokacije za oznanjevanje na javnih krajih", + "tr_PW": "Oznanjevanje na javnih krajih", + "tr_maxPublisherShift": "Najvišje št. oznanjevalcev na stran: {{ maxPublisherCount }}", + "tr_partnerNeeded": "Potreben je sodelavec", + "tr_partnerNeededDesc": "Drugi oznanjevalci bodo to videli in se bodo lahko dogovorili s teboj", + "tr_locationName": "Ime lokacije", + "tr_GeneralTimeRules": "Splošna časovna pravila", + "tr_maxPublisherLabel": "Najvišje št. oznanjevalcev na stran", + "tr_PWShifts": "Izmene za oznanjevanje na javnih krajih", + "tr_selectDays": "Izberi dneve", + "tr_everyDay": "Vsak dan", + "tr_daysShifts": "Izmene: {{ dayName }}", + "tr_addShift": "Dodaj izmeno", + "tr_confirmArrangement": "Potrdi dogovor", + "tr_havePartner": "Imam sodelavca", + "tr_havePartnerDesc": "Izberi sodelavca s seznama ali vnesi njegovo ime", + "tr_arrangementWith": "Z: {{ publisherName }}", + "tr_addToCalendar": "Dodaj v koledar", "tr_addToCalendarDesc": "Do you want to add this event to your personal calendar? You should have a calendar app installed on your device.", - "tr_forMyself": "For myself", - "tr_forOthers": "For others", - "tr_publisherWithNumber": "Publisher {{ publisherNumber }}", - "tr_occupied": "{{ number }} occupied", - "tr_available": "{{ number }} available", - "tr_deletePWLocation": "Delete the public witnessing location", - "tr_deletePWLocationDesc": "Deleting this location permanently removes all its data and arrangements. This action cannot be undone.", - "tr_changeImage": "Change image", - "tr_addImage": "Add image", + "tr_forMyself": "Za mene", + "tr_forOthers": "Za druge", + "tr_publisherWithNumber": "Oznanjevalec {{ publisherNumber }}", + "tr_occupied": "{{ number }} zasedeno", + "tr_available": "{{ number }} na voljo", + "tr_deletePWLocation": "Izbriši lokacijo za javno oznanjevanje", + "tr_deletePWLocationDesc": "Z izbrisom te lokacije boš trajno odstranil vse njene podatke in dogovore. Tega dejanja ni mogoče razveljaviti.", + "tr_changeImage": "Spremeni sliko", + "tr_addImage": "Dodaj sliko", "tr_cantDeductStudiesDesc": "You can’t select fewer studies than you already have selected in the 'Bible studies' menu.", - "tr_cantDeductStudiesTitle": "Cannot deduct Bible studies", - "tr_includesServiceAndCredit": "Includes field service and credit hours", + "tr_cantDeductStudiesTitle": "Ni mogoče odšteti svetopisemskih tečajev", + "tr_includesServiceAndCredit": "Vključuje oznanjevanje in priznane ure", "tr_noDailyRecordsDesc": "No daily service records yet. Add the record to include it in your monthly report.", - "tr_editServiceTime": "Edit service time", - "tr_reportStatus": "Report status", - "tr_reportSubmitted": "Report submitted", - "tr_reportNotSubmitted": "Report not submitted", + "tr_editServiceTime": "Uredi čas oznanjevanja", + "tr_reportStatus": "Status poročila", + "tr_reportSubmitted": "Poročilo poslano", + "tr_reportNotSubmitted": "Poročilo ni bilo poslano", "tr_assignAuxPioBtn": "Assign Auxiliary Pioneer this month", - "tr_lateReport": "Late report", - "tr_continuousAuxPio": "Continuous Auxiliary Pioneer", - "tr_receivedReports": "Received reports", + "tr_lateReport": "Pozno poročilo", + "tr_continuousAuxPio": "Stalni pomožni pionir", + "tr_receivedReports": "Prejeta poročila", "tr_reportPageInfo": "On this page, you can view reports from publishers and add reports from those who do not use Organized. Select a publisher to start.", - "tr_rejected": "Rejected", + "tr_rejected": "Zavrnjeno", "tr_alreadySubmittedWarning": "This month’s report has already been submitted to the Branch Office. Only late reports can be added, unless you undo the submission.", - "tr_publishersCountReport": "Publishers: {{ publishersCount }}", + "tr_publishersCountReport": "Oznanjevalci: {{ publishersCount }}", "tr_cartStorage": "Cart storage location", "tr_individualBibleStudies": "Individual Bible studies", "tr_theocraticAssignments": "Theocratic assignments", "tr_submitReportDesc": "Submit the report for this month to your elders?", - "tr_noDailyRecordsMonthClosed": "No daily service records for this month.", - "tr_undoSubmissionDesc": "Are you sure to undo the submission of this report? Please note that this will also remove the report already sent to the secretary.", - "tr_undoSubmissionDone": "Please make any necessary adjustments to this report and submit it again as soon as possible", - "tr_specialMonths": "Special months", - "tr_specialMonthsDesc": "List of months where auxiliary pioneers can report 15 hours", - "tr_reportHoursCredit": "Report credit hours", - "tr_bibleStudiesNotice": "Report one study per student each month", - "tr_presets": "Presets", - "tr_hoursCreditPresetAddedInfo": "The chosen credit hours preset will appear in the monthly report's comment field. Edit it there if needed.", - "tr_lateReportSent": "Sent to Bethel: {{ date }}", - "tr_fieldService": "Field service", - "tr_S10ReportNotGenerated": "This year’s report hasn’t been generated yet. Generate it to see all the details and then submit.", - "tr_quickAssignAP": "Auxiliary pioneer assigned", - "tr_quickAssignAPDesc": "This publisher is assigned as an auxiliary pioneer this month. You can change this on the publisher's enrollments list on the Persons page.", - "tr_reactivatePublisher": "Reactivate this publisher", - "tr_S21CardTitle": "Export multiple publisher records (S-21)", - "tr_S21CardTitleDesc": "Select ‘All publishers’ to export and sort all records for publishers, full-time, and auxiliary servants, or ‘Specific publishers’ to export records only for selected publishers.", - "tr_allPublisherRecords": "All publishers", - "tr_specificPublisherRecords": "Specific publishers", - "tr_S21ExportMultipleDesc": "Select the publishers you want to include in the exported records. Each publisher will be included in a separate file.", - "tr_activePublishersAll": "All other publishers", - "tr_markAsVerified": "Mark as verified", - "tr_averageMonthlyHours": "Average monthly", - "tr_reportVerified": "Verified reports", - "tr_reportUnverified": "Reports awaiting verification", - "tr_unverifiedReportTitle": "You have unverified reports", - "tr_unverifiedReportDesc": "Open the Field service reports page to check and verify reports from the publishers.", + "tr_noDailyRecordsMonthClosed": "Za ta mesec ni dnevnih oznanjevalskih poročil.", + "tr_undoSubmissionDesc": "Ali si prepričan, da želiš razveljaviti pošiljanje tega poročila? Upoštevaj, da se bo s tem odstranilo tudi poročilo, ki je bilo že poslano tajniku.", + "tr_undoSubmissionDone": "Prosimo, vnesi potrebne spremembe v to poročilo in ga čim prej ponovno pošlji", + "tr_specialMonths": "Posebni meseci", + "tr_specialMonthsDesc": "Seznam mesecev, v katerih lahko pomožni pionirji poročajo 15 ur", + "tr_reportHoursCredit": "Poročaj priznane ure", + "tr_bibleStudiesNotice": "Vsak mesec poročaj en tečaj na učenca", + "tr_presets": "Prednastavitve", + "tr_hoursCreditPresetAddedInfo": "Izbrana prednastavitev priznanih ur bo prikazana v polju z opombami v mesečnem poročilu. Po potrebi jo tam uredi.", + "tr_lateReportSent": "Poslano Betelu: {{ date }}", + "tr_fieldService": "Terenska služba", + "tr_S10ReportNotGenerated": "Poročilo za to leto še ni bilo ustvarjeno. Generiraj ga, da vidiš vse podrobnosti, in ga nato oddaj.", + "tr_quickAssignAP": "Postavljen za pomožnega pionirja", + "tr_quickAssignAPDesc": "Ta oznanjevalec je bil v tem mesecu postavljen za pomožnega pionirja. To lahko spremeniš na strani Osebe, kjer so navedene naloge oznanjevalca.", + "tr_reactivatePublisher": "Ponovno aktiviraj tega oznanjevalca", + "tr_S21CardTitle": "Izvozi več oznanjevalskih kartic (S-21)", + "tr_S21CardTitleDesc": "Izberi ‘Vsi oznanjevalci’, če želiš izvoziti in razvrstiti vse evidence oznanjevalcev, polnočasnih službanikov in pomožnih pionirjev, ali ‘Določeni oznanjevalci’, če želiš izvoziti evidence samo določenih oznanjevalcev.", + "tr_allPublisherRecords": "Vsi oznanjevalci", + "tr_specificPublisherRecords": "Določeni oznanjevalci", + "tr_S21ExportMultipleDesc": "Izberi vse oznanjevalce, ki jih želiš vključiti v izvožene evidence. Vsak oznanjevalec bo vključen v ločeno datoteko.", + "tr_activePublishersAll": "Vsi drugi oznanjevalci", + "tr_markAsVerified": "Označi kot preverjeno", + "tr_averageMonthlyHours": "Povprečno mesečno", + "tr_reportVerified": "Preverjena poročila", + "tr_reportUnverified": "Poročila, ki čakajo na preverjanje", + "tr_unverifiedReportTitle": "Imaš nepreverjena poročila", + "tr_unverifiedReportDesc": "Odpri stran Poročila o oznanjevanju, če želiš preveriti in potrditi poročila oznanjevalcev.", "tr_pioneers": "Pioneers", - "tr_reminderPublisherReport": "Submit your monthly field service report", - "tr_reminderPublisherReportDesc": "It should be submitted to the secretary no later than the 6th day of the month.", - "tr_reminderBranchReport": "The Congregation Field Service and Meeting Attendance (S-1) report hasn’t been submitted yet", - "tr_reminderBranchReportDesc": "It should be submitted to the branch office no later than the 20th day of the month.", - "tr_onlyAvailableForPioneers": "Only available for pioneers", - "tr_firstReport": "First report", - "tr_firstReportDesc": "The month when the person’s field service report was first collected" + "tr_reminderPublisherReport": "Pošlji svoje mesečno poročilo o oznanjevanju", + "tr_reminderPublisherReportDesc": "Tajniku bi ga moral poslati najkasneje do 6. v mesecu.", + "tr_reminderBranchReport": "Občinsko poročilo o oznanjevanju in obiskovanju shodov (S-1) še ni bilo oddano", + "tr_reminderBranchReportDesc": "Podružničnemu uradu bi ga morali poslati najkasneje do 20. v mesecu.", + "tr_onlyAvailableForPioneers": "Na voljo samo za pionirje", + "tr_firstReport": "Prvo poročilo", + "tr_firstReportDesc": "Mesec, ko je oseba prvič oddala svoje poročilo o oznanjevanju" } From 888cd92df77d6c4b314f39fcb56a0d0086c7d7d8 Mon Sep 17 00:00:00 2001 From: sws2apps-admin Date: Sun, 8 Dec 2024 10:23:21 +0300 Subject: [PATCH 09/31] New translations ministry.json (Slovenian) --- src/locales/sl-SI/ministry.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/locales/sl-SI/ministry.json b/src/locales/sl-SI/ministry.json index d19682c60a..ea48a59573 100644 --- a/src/locales/sl-SI/ministry.json +++ b/src/locales/sl-SI/ministry.json @@ -86,12 +86,12 @@ "tr_receivedReports": "Prejeta poročila", "tr_reportPageInfo": "On this page, you can view reports from publishers and add reports from those who do not use Organized. Select a publisher to start.", "tr_rejected": "Zavrnjeno", - "tr_alreadySubmittedWarning": "This month’s report has already been submitted to the Branch Office. Only late reports can be added, unless you undo the submission.", + "tr_alreadySubmittedWarning": "Poročilo za ta mesec je že bilo poslano podružničnemu uradu. Dodati je možno le pozna poročila, razen če razveljaviš pošiljanje.", "tr_publishersCountReport": "Oznanjevalci: {{ publishersCount }}", - "tr_cartStorage": "Cart storage location", - "tr_individualBibleStudies": "Individual Bible studies", - "tr_theocraticAssignments": "Theocratic assignments", - "tr_submitReportDesc": "Submit the report for this month to your elders?", + "tr_cartStorage": "Lokacija, kjer je shranjen voziček", + "tr_individualBibleStudies": "Posamezni svetopisemski tečaji", + "tr_theocraticAssignments": "Teokratične naloge", + "tr_submitReportDesc": "Ali želiš starešinam poslati poročilo za ta mesec?", "tr_noDailyRecordsMonthClosed": "Za ta mesec ni dnevnih oznanjevalskih poročil.", "tr_undoSubmissionDesc": "Ali si prepričan, da želiš razveljaviti pošiljanje tega poročila? Upoštevaj, da se bo s tem odstranilo tudi poročilo, ki je bilo že poslano tajniku.", "tr_undoSubmissionDone": "Prosimo, vnesi potrebne spremembe v to poročilo in ga čim prej ponovno pošlji", From 1072cf85c3d9cd3e703c69f04fa15674b68f6caa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2024 23:42:39 +0000 Subject: [PATCH 10/31] build(deps): bump @tanstack/react-query from 5.62.2 to 5.62.3 Bumps [@tanstack/react-query](https://github.com/TanStack/query/tree/HEAD/packages/react-query) from 5.62.2 to 5.62.3. - [Release notes](https://github.com/TanStack/query/releases) - [Commits](https://github.com/TanStack/query/commits/v5.62.3/packages/react-query) --- updated-dependencies: - dependency-name: "@tanstack/react-query" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 18 ++++++++---------- package.json | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 189ff15a29..67a22c1fd6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@react-pdf/renderer": "^4.1.5", "@smakss/random-string": "^2.0.2", "@sws2apps/react-sw-helper": "^1.25.0", - "@tanstack/react-query": "^5.62.2", + "@tanstack/react-query": "^5.62.3", "comlink": "^4.4.2", "crypto-es": "^2.1.0", "date-fns": "^4.0.0", @@ -6416,22 +6416,20 @@ } }, "node_modules/@tanstack/query-core": { - "version": "5.62.2", - "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.62.2.tgz", - "integrity": "sha512-LcwVcC5qpsDpHcqlXUUL5o9SaOBwhNkGeV+B06s0GBoyBr8FqXPuXT29XzYXR36lchhnerp6XO+CWc84/vh7Zg==", - "license": "MIT", + "version": "5.62.3", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.62.3.tgz", + "integrity": "sha512-Jp/nYoz8cnO7kqhOlSv8ke/0MJRJVGuZ0P/JO9KQ+f45mpN90hrerzavyTKeSoT/pOzeoOUkv1Xd0wPsxAWXfg==", "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" } }, "node_modules/@tanstack/react-query": { - "version": "5.62.2", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.62.2.tgz", - "integrity": "sha512-fkTpKKfwTJtVPKVR+ag7YqFgG/7TRVVPzduPAUF9zRCiiA8Wu305u+KJl8rCrh98Qce77vzIakvtUyzWLtaPGA==", - "license": "MIT", + "version": "5.62.3", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.62.3.tgz", + "integrity": "sha512-y2zDNKuhgiuMgsKkqd4AcsLIBiCfEO8U11AdrtAUihmLbRNztPrlcZqx2lH1GacZsx+y1qRRbCcJLYTtF1vKsw==", "dependencies": { - "@tanstack/query-core": "5.62.2" + "@tanstack/query-core": "5.62.3" }, "funding": { "type": "github", diff --git a/package.json b/package.json index 1be8544d20..14204643f0 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "@react-pdf/renderer": "^4.1.5", "@smakss/random-string": "^2.0.2", "@sws2apps/react-sw-helper": "^1.25.0", - "@tanstack/react-query": "^5.62.2", + "@tanstack/react-query": "^5.62.3", "comlink": "^4.4.2", "crypto-es": "^2.1.0", "date-fns": "^4.0.0", From 92b1b3b80baabe13db2dc8010cdcb540ed558781 Mon Sep 17 00:00:00 2001 From: sws2apps-admin Date: Sun, 8 Dec 2024 14:47:05 +0300 Subject: [PATCH 11/31] chore(locales): updated translation from Crowdin --- src/locales/mg-MG/forms-templates.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locales/mg-MG/forms-templates.json b/src/locales/mg-MG/forms-templates.json index 870b993a70..782dd6d67e 100644 --- a/src/locales/mg-MG/forms-templates.json +++ b/src/locales/mg-MG/forms-templates.json @@ -24,7 +24,7 @@ "tr_partLessTime": "{{ duration }} min. na latsaka", "tr_cbs": "Fianarana Baiboly Ataon’ny Fiangonana", "tr_cbsConductor": "Mpitarika", - "tr_cbsReader": "Mpamaky Fehintsoratra", + "tr_cbsReader": "Mpamaky", "tr_concludingComments": "Teny Famaranana", "tr_coTalk": "Lahateny ataon’ny Mpiandraikitra ny Faritra", "tr_auxClass": "Efitrano faharoa", From 8543aaf06cdcf45ec58b56ec3a60e3afec914830 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 8 Dec 2024 10:18:57 +0000 Subject: [PATCH 12/31] build(deps): bump @eslint/compat from 1.2.3 to 1.2.4 Bumps [@eslint/compat](https://github.com/eslint/rewrite) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/eslint/rewrite/releases) - [Changelog](https://github.com/eslint/rewrite/blob/main/release-please-config.json) - [Commits](https://github.com/eslint/rewrite/compare/compat-v1.2.3...compat-v1.2.4) --- updated-dependencies: - dependency-name: "@eslint/compat" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 67a22c1fd6..ba1f958a9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -54,7 +54,7 @@ }, "devDependencies": { "@babel/plugin-transform-private-property-in-object": "^7.25.9", - "@eslint/compat": "^1.2.3", + "@eslint/compat": "^1.2.4", "@eslint/eslintrc": "^3.2.0", "@eslint/js": "^9.16.0", "@semantic-release/changelog": "^6.0.3", @@ -2212,9 +2212,9 @@ } }, "node_modules/@eslint/compat": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-1.2.3.tgz", - "integrity": "sha512-wlZhwlDFxkxIZ571aH0FoK4h4Vwx7P3HJx62Gp8hTc10bfpwT2x0nULuAHmQSJBOWPgPeVf+9YtnD4j50zVHmA==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-1.2.4.tgz", + "integrity": "sha512-S8ZdQj/N69YAtuqFt7653jwcvuUj131+6qGLUyDqfDg1OIoBQ66OCuXC473YQfO2AaxITTutiRQiDwoo7ZLYyg==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" diff --git a/package.json b/package.json index 14204643f0..30790909cb 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ }, "devDependencies": { "@babel/plugin-transform-private-property-in-object": "^7.25.9", - "@eslint/compat": "^1.2.3", + "@eslint/compat": "^1.2.4", "@eslint/eslintrc": "^3.2.0", "@eslint/js": "^9.16.0", "@semantic-release/changelog": "^6.0.3", From f176e3467f188b69b055932a98e39881ba65ad10 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 8 Dec 2024 10:18:56 +0000 Subject: [PATCH 13/31] build(deps): bump react-refresh from 0.14.2 to 0.16.0 Bumps [react-refresh](https://github.com/facebook/react/tree/HEAD/packages/react) from 0.14.2 to 0.16.0. - [Release notes](https://github.com/facebook/react/releases) - [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/react/commits/HEAD/packages/react) --- updated-dependencies: - dependency-name: react-refresh dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 17 +++++++++++++---- package.json | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index ba1f958a9f..0e0d2a4a23 100644 --- a/package-lock.json +++ b/package-lock.json @@ -82,7 +82,7 @@ "husky": "^9.1.7", "lint-staged": "^15.2.10", "prettier": "^3.4.1", - "react-refresh": "^0.14.2", + "react-refresh": "^0.16.0", "rollup": "^4.28.0", "semantic-release": "^24.2.0", "serve": "^14.2.4", @@ -6968,6 +6968,14 @@ "vite": "^4.2.0 || ^5.0.0 || ^6.0.0" } }, + "node_modules/@vitejs/plugin-react/node_modules/react-refresh": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", + "integrity": "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@zeit/schemas": { "version": "2.36.0", "resolved": "https://registry.npmjs.org/@zeit/schemas/-/schemas-2.36.0.tgz", @@ -18678,9 +18686,10 @@ } }, "node_modules/react-refresh": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", - "integrity": "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==", + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.16.0.tgz", + "integrity": "sha512-FPvF2XxTSikpJxcr+bHut2H4gJ17+18Uy20D5/F+SKzFap62R3cM5wH6b8WN3LyGSYeQilLEcJcR1fjBSI2S1A==", + "dev": true, "engines": { "node": ">=0.10.0" } diff --git a/package.json b/package.json index 30790909cb..cf8521c731 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "husky": "^9.1.7", "lint-staged": "^15.2.10", "prettier": "^3.4.1", - "react-refresh": "^0.14.2", + "react-refresh": "^0.16.0", "rollup": "^4.28.0", "semantic-release": "^24.2.0", "serve": "^14.2.4", From 115d41e176037836d8636826015a603f409b7c69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 8 Dec 2024 11:48:40 +0000 Subject: [PATCH 14/31] build(deps): bump prettier from 3.4.1 to 3.4.2 Bumps [prettier](https://github.com/prettier/prettier) from 3.4.1 to 3.4.2. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.4.1...3.4.2) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 9 ++++----- package.json | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0e0d2a4a23..b084ef9f28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -81,7 +81,7 @@ "globals": "^15.13.0", "husky": "^9.1.7", "lint-staged": "^15.2.10", - "prettier": "^3.4.1", + "prettier": "^3.4.2", "react-refresh": "^0.16.0", "rollup": "^4.28.0", "semantic-release": "^24.2.0", @@ -18272,11 +18272,10 @@ } }, "node_modules/prettier": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.1.tgz", - "integrity": "sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", + "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", "dev": true, - "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, diff --git a/package.json b/package.json index cf8521c731..4d2df5f87f 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "globals": "^15.13.0", "husky": "^9.1.7", "lint-staged": "^15.2.10", - "prettier": "^3.4.1", + "prettier": "^3.4.2", "react-refresh": "^0.16.0", "rollup": "^4.28.0", "semantic-release": "^24.2.0", From 2bc73615c533f17651264ae3a9df5607a95cf3f4 Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Wed, 4 Dec 2024 00:54:55 +0300 Subject: [PATCH 15/31] fix(congregation): unwanted error message for changing codes --- .../container/useContainer.tsx | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/features/app_notification/container/useContainer.tsx b/src/features/app_notification/container/useContainer.tsx index d123c6c7ca..b631183775 100644 --- a/src/features/app_notification/container/useContainer.tsx +++ b/src/features/app_notification/container/useContainer.tsx @@ -20,11 +20,7 @@ import { dbVisitingSpeakersUpdateRemote, decryptVisitingSpeakers, } from '@services/dexie/visiting_speakers'; -import { - accountTypeState, - congAccessCodeState, - congMasterKeyState, -} from '@states/settings'; +import { accountTypeState } from '@states/settings'; import { decryptData, decryptObject } from '@services/encryption'; import { displaySnackNotification } from '@services/recoil/app'; import { getMessageByCode } from '@services/i18n/translation'; @@ -37,6 +33,7 @@ import usePendingRequests from './usePendingRequests'; import useRemoteNotifications from './useRemoteNotifications'; import useUnverifiedReports from './useUnverifiedReports'; import { apiFetchNotifications } from '@services/api/notification'; +import appDb from '@db/appDb'; const useContainer = () => { const { t } = useAppTranslation(); @@ -61,12 +58,11 @@ const useContainer = () => { const congregationsNotDisapproved = useRecoilValue( congregationsNotDisapprovedState ); - const congMasterKey = useRecoilValue(congMasterKeyState); - const congAccessCode = useRecoilValue(congAccessCodeState); + const accountType = useRecoilValue(accountTypeState); const userID = useRecoilValue(userIDState); - const { data, isPending } = useQuery({ + const { data, isFetching } = useQuery({ enabled: userID.length > 0 && accountType === 'vip' && @@ -160,6 +156,9 @@ const useContainer = () => { ); if (foundCong) { + const settings = await appDb.app_settings.get(1); + const congMasterKey = settings.cong_settings.cong_master_key; + const masterKey = decryptData( data.result.cong_master_key, congMasterKey @@ -184,14 +183,7 @@ const useContainer = () => { severity: 'error', }); } - }, [ - data, - pendingRequests, - setNotifications, - t, - congregationRemotes, - congMasterKey, - ]); + }, [data, pendingRequests, setNotifications, t, congregationRemotes]); const handleRejectedRequests = useCallback(async () => { try { @@ -276,6 +268,9 @@ const useContainer = () => { if (!incoming) return; + const settings = await appDb.app_settings.get(1); + const congAccessCode = settings.cong_settings.cong_access_code; + const remoteAccessCode = data.result.cong_access_code; const accessCode = decryptData(remoteAccessCode, congAccessCode); @@ -295,7 +290,7 @@ const useContainer = () => { severity: 'error', }); } - }, [data, congAccessCode, setApplications]); + }, [data, setApplications]); const handleUnauthorized = useCallback(async () => { const status = data?.status; @@ -311,6 +306,9 @@ const useContainer = () => { if (!incoming) return; + const settings = await appDb.app_settings.get(1); + const congAccessCode = settings.cong_settings.cong_access_code; + const remoteAccessCode = data.result.cong_access_code; const accessCode = decryptData(remoteAccessCode, congAccessCode); @@ -330,10 +328,10 @@ const useContainer = () => { severity: 'error', }); } - }, [data, congAccessCode]); + }, [data]); useEffect(() => { - if (!isPending) { + if (!isFetching) { handleUnauthorized(); handlePendingSpeakersRequests(); @@ -349,7 +347,8 @@ const useContainer = () => { checkUnverifiedReports(); } }, [ - isPending, + data, + isFetching, handleUnauthorized, handlePendingSpeakersRequests, handleRemoteCongregations, From 3c9a449b92dc56066e8fae8e073a6fd4c36589b8 Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Wed, 4 Dec 2024 01:13:15 +0300 Subject: [PATCH 16/31] fix(dashboard): manual backup not running --- src/hooks/useUserAutoLogin.tsx | 53 ++++++++++++++-------------------- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/src/hooks/useUserAutoLogin.tsx b/src/hooks/useUserAutoLogin.tsx index 1646bd17e9..815d3332c4 100644 --- a/src/hooks/useUserAutoLogin.tsx +++ b/src/hooks/useUserAutoLogin.tsx @@ -16,11 +16,7 @@ import { apiValidateMe } from '@services/api/user'; import { userSignOut } from '@services/firebase/auth'; import { handleDeleteDatabase } from '@services/app'; import { APP_ROLES, isDemo, VIP_ROLES } from '@constants/index'; -import { - accountTypeState, - backupAutoState, - congNumberState, -} from '@states/settings'; +import { accountTypeState, congNumberState } from '@states/settings'; import useFirebaseAuth from '@hooks/useFirebaseAuth'; import logger from '@services/logger/index'; import worker from '@services/worker/backupWorker'; @@ -51,7 +47,6 @@ const useUserAutoLogin = () => { const isAppLoad = useRecoilValue(isAppLoadState); const accountType = useRecoilValue(accountTypeState); const congNumber = useRecoilValue(congNumberState); - const backupAuto = useRecoilValue(backupAutoState); const runFetchVip = useMemo(() => { return ( @@ -195,21 +190,19 @@ const useUserAutoLogin = () => { setCongConnected(true); setIsMFAEnabled(dataVip.result.mfa); - if (backupAuto) { - worker.postMessage({ - field: 'userID', - value: dataVip.result.id, - }); + worker.postMessage({ + field: 'userID', + value: dataVip.result.id, + }); - worker.postMessage({ - field: 'congID', - value: dataVip.result.cong_id, - }); + worker.postMessage({ + field: 'congID', + value: dataVip.result.cong_id, + }); - worker.postMessage({ field: 'accountType', value: 'vip' }); + worker.postMessage({ field: 'accountType', value: 'vip' }); - worker.postMessage('startWorker'); - } + worker.postMessage('startWorker'); } } @@ -230,7 +223,6 @@ const useUserAutoLogin = () => { dataVip, errorVip, congNumber, - backupAuto, setCongConnected, setCongID, setUserID, @@ -287,21 +279,19 @@ const useUserAutoLogin = () => { setCongID(dataPocket.result.app_settings.cong_settings.id); setCongConnected(true); - if (backupAuto) { - worker.postMessage({ - field: 'userID', - value: dataPocket.result.id, - }); + worker.postMessage({ + field: 'userID', + value: dataPocket.result.id, + }); - worker.postMessage({ - field: 'congID', - value: dataPocket.result.app_settings.cong_settings.id, - }); + worker.postMessage({ + field: 'congID', + value: dataPocket.result.app_settings.cong_settings.id, + }); - worker.postMessage({ field: 'accountType', value: 'pocket' }); + worker.postMessage({ field: 'accountType', value: 'pocket' }); - worker.postMessage('startWorker'); - } + worker.postMessage('startWorker'); } setAutoLoginStatus('auto login process completed'); @@ -320,7 +310,6 @@ const useUserAutoLogin = () => { dataPocket, errorPocket, congNumber, - backupAuto, setCongConnected, setCongID, setUserID, From 662f04e10f0bfd143bc9560db197e3b36964967b Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Wed, 4 Dec 2024 19:23:32 +0300 Subject: [PATCH 17/31] fix(startup): screens mixed up in some conditions --- .../app_start/shared/hooks/useFeedback.tsx | 4 ++- src/features/app_start/vip/startup/index.tsx | 26 ++++++++++++++----- .../app_start/vip/startup/useStartup.tsx | 2 +- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/features/app_start/shared/hooks/useFeedback.tsx b/src/features/app_start/shared/hooks/useFeedback.tsx index 4a311a465c..a3bc69cde6 100644 --- a/src/features/app_start/shared/hooks/useFeedback.tsx +++ b/src/features/app_start/shared/hooks/useFeedback.tsx @@ -14,7 +14,9 @@ const useFeedback = () => { document.querySelector('#onboarding-error'); const hideMessage = () => { - onboardingError.style.animation = 'fade-out 0.15s forwards'; + if (onboardingError) { + onboardingError.style.animation = 'fade-out 0.15s forwards'; + } }; const showMessage = () => { diff --git a/src/features/app_start/vip/startup/index.tsx b/src/features/app_start/vip/startup/index.tsx index 6522f24135..8d098992cf 100644 --- a/src/features/app_start/vip/startup/index.tsx +++ b/src/features/app_start/vip/startup/index.tsx @@ -27,13 +27,25 @@ const VipStartup = () => { {!isCongCreate && !isEncryptionCodeOpen && isLoading && ( )} - {isUserSignIn && } - {isUserMfaVerify && } - {isUserAccountCreated && } - {isCongCreate && } - {isEmailAuth && } - {isEmailLinkAuth && } - {isEncryptionCodeOpen && } + + {!isLoading && ( + <> + {isUserSignIn && } + + {!isUserSignIn && ( + <> + {isUserMfaVerify && } + {isUserAccountCreated && } + {isCongCreate && } + {isEmailAuth && } + {isEmailLinkAuth && } + {!isCongCreate && isEncryptionCodeOpen && ( + + )} + + )} + + )} ); }; diff --git a/src/features/app_start/vip/startup/useStartup.tsx b/src/features/app_start/vip/startup/useStartup.tsx index 4d068f4081..cb9375ba24 100644 --- a/src/features/app_start/vip/startup/useStartup.tsx +++ b/src/features/app_start/vip/startup/useStartup.tsx @@ -169,7 +169,7 @@ const useStartup = () => { return; } - if (congAccessCode.length === 0) { + if (congAccessCode.length === 0 && congName.length > 0) { setIsStart(false); setIsEncryptionCodeOpen(true); } From e4cd3d1875d3c1d1ccc5cd50907e89e6370c16c3 Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Wed, 4 Dec 2024 19:35:27 +0300 Subject: [PATCH 18/31] fix(app): persist some app data when logging out --- .../useCongregationAccessCode.tsx | 1 + .../useCongregationDetails.tsx | 1 + .../useCongregationMasterKey.tsx | 1 + src/services/app/index.ts | 14 +++++++++++--- src/services/dexie/app.ts | 2 -- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/features/app_start/vip/congregation_create/congregation_access_code/useCongregationAccessCode.tsx b/src/features/app_start/vip/congregation_create/congregation_access_code/useCongregationAccessCode.tsx index 6dcfa773e3..22c95bca9c 100644 --- a/src/features/app_start/vip/congregation_create/congregation_access_code/useCongregationAccessCode.tsx +++ b/src/features/app_start/vip/congregation_create/congregation_access_code/useCongregationAccessCode.tsx @@ -60,6 +60,7 @@ const useCongregationAccessCode = () => { await dbAppSettingsUpdate({ 'cong_settings.cong_access_code': tmpAccessCode, + 'cong_settings.cong_new': true, }); setIsSetup(false); diff --git a/src/features/app_start/vip/congregation_create/congregation_details/useCongregationDetails.tsx b/src/features/app_start/vip/congregation_create/congregation_details/useCongregationDetails.tsx index aa0f6e2218..142ec6ca18 100644 --- a/src/features/app_start/vip/congregation_create/congregation_details/useCongregationDetails.tsx +++ b/src/features/app_start/vip/congregation_create/congregation_details/useCongregationDetails.tsx @@ -136,6 +136,7 @@ const useCongregationDetails = () => { 'cong_settings.cong_circuit': result.cong_settings.cong_circuit, 'cong_settings.midweek_meeting': midweekMeeting, 'cong_settings.weekend_meeting': weekendMeeting, + 'cong_settings.cong_new': true, }); await setIsNewCongregation(true); diff --git a/src/features/app_start/vip/congregation_create/congregation_master_key/useCongregationMasterKey.tsx b/src/features/app_start/vip/congregation_create/congregation_master_key/useCongregationMasterKey.tsx index e602089a28..e6e80b3296 100644 --- a/src/features/app_start/vip/congregation_create/congregation_master_key/useCongregationMasterKey.tsx +++ b/src/features/app_start/vip/congregation_create/congregation_master_key/useCongregationMasterKey.tsx @@ -58,6 +58,7 @@ const useCongregationMasterKey = () => { await dbAppSettingsUpdate({ 'cong_settings.cong_master_key': tmpMasterKey, + 'cong_settings.cong_new': true, }); setCurrentStep(2); diff --git a/src/services/app/index.ts b/src/services/app/index.ts index 0783721731..f758530402 100644 --- a/src/services/app/index.ts +++ b/src/services/app/index.ts @@ -58,9 +58,17 @@ export const handleDeleteDatabase = async () => { setRootModalOpen(true); await dbAppDelete(); await userSignOut(); - localStorage.removeItem('email'); - localStorage.removeItem('organized_jw_import_next_sync'); - localStorage.removeItem('organized_weekly_schedules'); + + const freezeKeys = ['userConsent', 'organized_whatsnew']; + + const storageKeys = Object.keys(localStorage).filter( + (key) => !freezeKeys.includes(key) + ); + + for (const key of storageKeys) { + localStorage.removeItem(key); + } + window.location.href = './'; }; diff --git a/src/services/dexie/app.ts b/src/services/dexie/app.ts index 8d99dd0fe2..e04c458f31 100644 --- a/src/services/dexie/app.ts +++ b/src/services/dexie/app.ts @@ -4,8 +4,6 @@ import appDb from '@db/appDb'; export const dbAppDelete = async () => { await appDb.close(); await Dexie.delete('organized'); - - localStorage.clear(); }; export const dbAppOpen = async () => { From adb25e4b91e32c7f3774b1ab3f7c5a57dd6737ce Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Wed, 4 Dec 2024 21:20:20 +0300 Subject: [PATCH 19/31] fix(reminders): check if publisher in current report month --- src/features/reminders/useReminders.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/features/reminders/useReminders.tsx b/src/features/reminders/useReminders.tsx index 60a2650c2b..c9b95840a6 100644 --- a/src/features/reminders/useReminders.tsx +++ b/src/features/reminders/useReminders.tsx @@ -4,16 +4,19 @@ import { useAppTranslation } from '@hooks/index'; import { formatDate } from '@services/dateformat'; import { addDays, addMonths, currentReportMonth } from '@utils/date'; import { ReminderItemProps } from './index.types'; +import { branchFieldReportsState } from '@states/branch_field_service_reports'; import useCurrentUser from '@hooks/useCurrentUser'; import useMinistryMonthlyRecord from '@features/ministry/hooks/useMinistryMonthlyRecord'; -import { branchFieldReportsState } from '@states/branch_field_service_reports'; +import usePerson from '@features/persons/hooks/usePerson'; const useReminders = () => { const { t } = useAppTranslation(); + const { personIsPublisher } = usePerson(); + const currentReport = useMemo(() => currentReportMonth(), []); - const { isPublisher, isSecretary } = useCurrentUser(); + const { isSecretary, person } = useCurrentUser(); const { status } = useMinistryMonthlyRecord(currentReport); @@ -22,7 +25,10 @@ const useReminders = () => { const [reminders, setReminders] = useState([]); const checkPubReport = useCallback(() => { + const isPublisher = personIsPublisher(person, currentReport); + if (!isPublisher) return; + if (status !== 'pending') return; const nextMonth = addMonths(`${currentReport}/01`, 1).getMonth(); @@ -45,7 +51,7 @@ const useReminders = () => { return newValues; }); } - }, [isPublisher, status, currentReport, t]); + }, [status, currentReport, t, person, personIsPublisher]); const checkBranchReport = useCallback(() => { if (!isSecretary) return; From 4d2a285302f8535427cd7a30da91093f15e6519c Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Fri, 6 Dec 2024 23:40:48 +0300 Subject: [PATCH 20/31] fix(ministry): report submission flow --- package-lock.json | 22 +++++++++++++++++++ package.json | 1 + .../withdraw_report/useWithdrawReport.tsx | 1 - .../ministry_report/useMinistryReport.tsx | 2 ++ src/services/app/index.ts | 8 ++++++- 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index b084ef9f28..aaa9e72d5c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,7 @@ "firebase": "^11.0.2", "i18next": "^24.0.5", "interweave": "^13.1.0", + "jotai": "^2.10.3", "jszip": "^3.10.1", "jw-epub-parser": "^3.29.1", "mui-one-time-password-input": "^3.0.1", @@ -12609,6 +12610,27 @@ "restructure": "^3.0.0" } }, + "node_modules/jotai": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/jotai/-/jotai-2.10.3.tgz", + "integrity": "sha512-Nnf4IwrLhNfuz2JOQLI0V/AgwcpxvVy8Ec8PidIIDeRi4KCFpwTFIpHAAcU+yCgnw/oASYElq9UY0YdUUegsSA==", + "license": "MIT", + "engines": { + "node": ">=12.20.0" + }, + "peerDependencies": { + "@types/react": ">=17.0.0", + "react": ">=17.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "react": { + "optional": true + } + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", diff --git a/package.json b/package.json index 4d2df5f87f..9b9c4dc0c9 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "firebase": "^11.0.2", "i18next": "^24.0.5", "interweave": "^13.1.0", + "jotai": "^2.10.3", "jszip": "^3.10.1", "jw-epub-parser": "^3.29.1", "mui-one-time-password-input": "^3.0.1", diff --git a/src/features/ministry/report/publisher_report/monthly_report/withdraw_report/useWithdrawReport.tsx b/src/features/ministry/report/publisher_report/monthly_report/withdraw_report/useWithdrawReport.tsx index c002d2eef8..d58dcbe9de 100644 --- a/src/features/ministry/report/publisher_report/monthly_report/withdraw_report/useWithdrawReport.tsx +++ b/src/features/ministry/report/publisher_report/monthly_report/withdraw_report/useWithdrawReport.tsx @@ -81,7 +81,6 @@ const useWithdrawReport = ({ onClose }: WithdrawReportProps) => { ); const report = structuredClone(findReport); - report.report_data.status = 'pending'; await dbUserFieldServiceReportsSave(report); diff --git a/src/pages/ministry/ministry_report/useMinistryReport.tsx b/src/pages/ministry/ministry_report/useMinistryReport.tsx index d51c739cc5..f70fb61938 100644 --- a/src/pages/ministry/ministry_report/useMinistryReport.tsx +++ b/src/pages/ministry/ministry_report/useMinistryReport.tsx @@ -21,6 +21,8 @@ const useMinistryReport = () => { if (status === 'confirmed') return true; + if (status === 'received') return true; + return !shared_ministry; }, [settings, shared_ministry, status]); diff --git a/src/services/app/index.ts b/src/services/app/index.ts index f758530402..2dc3de689f 100644 --- a/src/services/app/index.ts +++ b/src/services/app/index.ts @@ -59,7 +59,13 @@ export const handleDeleteDatabase = async () => { await dbAppDelete(); await userSignOut(); - const freezeKeys = ['userConsent', 'organized_whatsnew']; + const freezeKeys = [ + 'userConsent', + 'organized_whatsnew', + 'theme', + 'ui_lang', + 'app_font', + ]; const storageKeys = Object.keys(localStorage).filter( (key) => !freezeKeys.includes(key) From a2dd64759951076e332f7bd4bc3a86fcf5451f8f Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Sat, 7 Dec 2024 07:11:03 +0300 Subject: [PATCH 21/31] chore(reminders): prevent infinite loop --- package-lock.json | 22 ------- package.json | 1 - src/features/reminders/useReminders.tsx | 78 ++++++++++++------------- 3 files changed, 38 insertions(+), 63 deletions(-) diff --git a/package-lock.json b/package-lock.json index aaa9e72d5c..b084ef9f28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,7 +30,6 @@ "firebase": "^11.0.2", "i18next": "^24.0.5", "interweave": "^13.1.0", - "jotai": "^2.10.3", "jszip": "^3.10.1", "jw-epub-parser": "^3.29.1", "mui-one-time-password-input": "^3.0.1", @@ -12610,27 +12609,6 @@ "restructure": "^3.0.0" } }, - "node_modules/jotai": { - "version": "2.10.3", - "resolved": "https://registry.npmjs.org/jotai/-/jotai-2.10.3.tgz", - "integrity": "sha512-Nnf4IwrLhNfuz2JOQLI0V/AgwcpxvVy8Ec8PidIIDeRi4KCFpwTFIpHAAcU+yCgnw/oASYElq9UY0YdUUegsSA==", - "license": "MIT", - "engines": { - "node": ">=12.20.0" - }, - "peerDependencies": { - "@types/react": ">=17.0.0", - "react": ">=17.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "react": { - "optional": true - } - } - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", diff --git a/package.json b/package.json index 9b9c4dc0c9..4d2df5f87f 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,6 @@ "firebase": "^11.0.2", "i18next": "^24.0.5", "interweave": "^13.1.0", - "jotai": "^2.10.3", "jszip": "^3.10.1", "jw-epub-parser": "^3.29.1", "mui-one-time-password-input": "^3.0.1", diff --git a/src/features/reminders/useReminders.tsx b/src/features/reminders/useReminders.tsx index c9b95840a6..f24c0cebb0 100644 --- a/src/features/reminders/useReminders.tsx +++ b/src/features/reminders/useReminders.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useMemo, useState } from 'react'; +import { useEffect, useMemo, useState } from 'react'; import { useRecoilValue } from 'recoil'; import { useAppTranslation } from '@hooks/index'; import { formatDate } from '@services/dateformat'; @@ -24,37 +24,28 @@ const useReminders = () => { const [reminders, setReminders] = useState([]); - const checkPubReport = useCallback(() => { + const checkPubReport = useMemo(() => { + if (!person) return false; + const isPublisher = personIsPublisher(person, currentReport); - if (!isPublisher) return; + if (!isPublisher) return false; - if (status !== 'pending') return; + if (status !== 'pending') return false; const nextMonth = addMonths(`${currentReport}/01`, 1).getMonth(); const todayMonth = new Date().getMonth(); const todayDate = new Date().getDate(); if (nextMonth === todayMonth && todayDate <= 6) { - setReminders((prev) => { - const newValues = prev.filter( - (record) => record.id !== 'publisher-report' - ); - - newValues.push({ - id: 'publisher-report', - title: t('tr_reminderPublisherReport'), - description: t('tr_reminderPublisherReportDesc'), - path: '/ministry-report', - }); - - return newValues; - }); + return true; } - }, [status, currentReport, t, person, personIsPublisher]); - const checkBranchReport = useCallback(() => { - if (!isSecretary) return; + return false; + }, [currentReport, person, personIsPublisher, status]); + + const checkBranchReport = useMemo(() => { + if (!isSecretary) return false; const branchReport = branchReports.find( (record) => record.report_date === currentReport @@ -62,29 +53,18 @@ const useReminders = () => { const submitted = branchReport?.report_data.submitted ?? false; - if (submitted) return; + if (submitted) return false; const nextMonth = addMonths(`${currentReport}/01`, 1).getMonth(); const todayMonth = new Date().getMonth(); const todayDate = new Date().getDate(); if (nextMonth === todayMonth && todayDate >= 10 && todayDate <= 28) { - setReminders((prev) => { - const newValues = prev.filter( - (record) => record.id !== 'branch-report' - ); - - newValues.push({ - id: 'branch-report', - title: t('tr_reminderBranchReport'), - description: t('tr_reminderBranchReportDesc'), - path: '/reports/branch-office', - }); - - return newValues; - }); + return true; } - }, [isSecretary, branchReports, currentReport, t]); + + return false; + }, [branchReports, currentReport, isSecretary]); const reminderMeTomorrow = () => { const tomorrow = addDays(new Date(), 1); @@ -105,10 +85,28 @@ const useReminders = () => { return; } - checkPubReport(); + const values: ReminderItemProps[] = []; + + if (checkPubReport) { + values.push({ + id: 'publisher-report', + title: t('tr_reminderPublisherReport'), + description: t('tr_reminderPublisherReportDesc'), + path: '/ministry-report', + }); + } + + if (checkBranchReport) { + values.push({ + id: 'branch-report', + title: t('tr_reminderBranchReport'), + description: t('tr_reminderBranchReportDesc'), + path: '/reports/branch-office', + }); + } - checkBranchReport(); - }, [checkPubReport, checkBranchReport]); + setReminders(values); + }, [checkPubReport, checkBranchReport, t]); return { reminders, reminderMeTomorrow }; }; From 4f52dfb3602f2f2e84c1a4dc9e18cd39488c737b Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Sun, 8 Dec 2024 12:33:51 +0300 Subject: [PATCH 22/31] fix(reports): update submission flow --- .firebaserc | 7 --- src/definition/ministry.ts | 1 - .../submit_report/useSubmitReport.tsx | 11 +++- .../withdraw_report/useWithdrawReport.tsx | 37 ++++++++++- src/pages/ministry/ministry_report/index.tsx | 8 +-- .../ministry_report/useMinistryReport.tsx | 28 +++++++-- .../dexie/cong_field_service_reports.ts | 62 +++++++++++-------- src/services/worker/backupUtils.ts | 4 +- 8 files changed, 108 insertions(+), 50 deletions(-) delete mode 100644 .firebaserc diff --git a/.firebaserc b/.firebaserc deleted file mode 100644 index f06555e1fb..0000000000 --- a/.firebaserc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "projects": { - "production": "cpe-sws", - "default": "cpe-sws" - }, - "targets": {} -} diff --git a/src/definition/ministry.ts b/src/definition/ministry.ts index d91e9d4964..eed84cc6cc 100644 --- a/src/definition/ministry.ts +++ b/src/definition/ministry.ts @@ -24,7 +24,6 @@ export type APRecordType = { }; export type IncomingReport = { - report_id: string; person_uid: string; bible_studies: number; comments: string; diff --git a/src/features/ministry/report/publisher_report/monthly_report/submit_report/useSubmitReport.tsx b/src/features/ministry/report/publisher_report/monthly_report/submit_report/useSubmitReport.tsx index 60164a19a8..2a8f9f0313 100644 --- a/src/features/ministry/report/publisher_report/monthly_report/submit_report/useSubmitReport.tsx +++ b/src/features/ministry/report/publisher_report/monthly_report/submit_report/useSubmitReport.tsx @@ -34,6 +34,7 @@ import { apiPocketValidateMe, } from '@services/api/pocket'; import { decryptData, encryptObject } from '@services/encryption'; +import { CongFieldServiceReportType } from '@definition/cong_field_service_reports'; const useSubmitReport = ({ onClose }: SubmitReportProps) => { const { t } = useAppTranslation(); @@ -146,13 +147,19 @@ const useSubmitReport = ({ onClose }: SubmitReportProps) => { }; const handleSubmitSelf = async () => { - let report = congReports.find( + let report: CongFieldServiceReportType; + + const current = congReports.find( (record) => record.report_data.person_uid === userUID && record.report_data.report_date === selectedMonth ); - if (!report) { + if (current) { + report = structuredClone(current); + } + + if (!current) { report = structuredClone(congFieldServiceReportSchema); report.report_id = crypto.randomUUID(); report.report_data.report_date = selectedMonth; diff --git a/src/features/ministry/report/publisher_report/monthly_report/withdraw_report/useWithdrawReport.tsx b/src/features/ministry/report/publisher_report/monthly_report/withdraw_report/useWithdrawReport.tsx index d58dcbe9de..a94f5b0c8f 100644 --- a/src/features/ministry/report/publisher_report/monthly_report/withdraw_report/useWithdrawReport.tsx +++ b/src/features/ministry/report/publisher_report/monthly_report/withdraw_report/useWithdrawReport.tsx @@ -23,6 +23,9 @@ import { apiPocketFieldServiceReportPost, apiPocketValidateMe, } from '@services/api/pocket'; +import { UserFieldServiceMonthlyReportType } from '@definition/user_field_service_reports'; +import { userFieldServiceMonthlyReportSchema } from '@services/dexie/schema'; +import { congFieldServiceReportsState } from '@states/field_service_reports'; const useWithdrawReport = ({ onClose }: WithdrawReportProps) => { const { t } = useAppTranslation(); @@ -34,6 +37,7 @@ const useWithdrawReport = ({ onClose }: WithdrawReportProps) => { const accountType = useRecoilValue(accountTypeState); const userUID = useRecoilValue(userLocalUIDState); const localAccessCode = useRecoilValue(congAccessCodeState); + const congReports = useRecoilValue(congFieldServiceReportsState); const [isProcessing, setIsProcessing] = useState(false); @@ -80,10 +84,37 @@ const useWithdrawReport = ({ onClose }: WithdrawReportProps) => { (record) => record.report_date === selectedMonth ); - const report = structuredClone(findReport); - report.report_data.status = 'pending'; + let report: UserFieldServiceMonthlyReportType; + + if (!findReport) { + const congReport = congReports.find( + (record) => + record.report_data.person_uid === userUID && + record.report_data.report_date === selectedMonth + ); + + if (congReport) { + report = structuredClone(userFieldServiceMonthlyReportSchema); + report.report_date = selectedMonth; + report.report_data.bible_studies = + congReport.report_data.bible_studies; + report.report_data.comments = congReport.report_data.comments; + report.report_data.hours = congReport.report_data.hours; + report.report_data.shared_ministry = + congReport.report_data.shared_ministry; + report.report_data.status = 'pending'; + report.report_data.updatedAt = congReport.report_data.updatedAt; + } + } + + if (findReport) { + report = structuredClone(findReport); + report.report_data.status = 'pending'; + } - await dbUserFieldServiceReportsSave(report); + if (report) { + await dbUserFieldServiceReportsSave(report); + } await displaySnackNotification({ header: t('tr_done'), diff --git a/src/pages/ministry/ministry_report/index.tsx b/src/pages/ministry/ministry_report/index.tsx index 86cb662121..44218ff91f 100644 --- a/src/pages/ministry/ministry_report/index.tsx +++ b/src/pages/ministry/ministry_report/index.tsx @@ -18,10 +18,10 @@ const MinistryReport = () => { submitOpen, handleCloseSubmit, handleOpenModal, - status, withdrawOpen, handleCloseWithdraw, disabled, + reportStatus, } = useMinistryReport(); return ( @@ -33,10 +33,10 @@ const MinistryReport = () => { variant="main" onClick={handleOpenModal} disabled={disabled} - startIcon={status === 'pending' ? : } - color={status !== 'pending' && 'orange'} + startIcon={reportStatus === 'pending' ? : } + color={reportStatus !== 'pending' && 'orange'} > - {status === 'pending' + {reportStatus === 'pending' ? t('tr_btnSubmitReport') : t('tr_undoSubmission')} diff --git a/src/pages/ministry/ministry_report/useMinistryReport.tsx b/src/pages/ministry/ministry_report/useMinistryReport.tsx index f70fb61938..b7836e866f 100644 --- a/src/pages/ministry/ministry_report/useMinistryReport.tsx +++ b/src/pages/ministry/ministry_report/useMinistryReport.tsx @@ -1,6 +1,9 @@ import { useMemo, useState } from 'react'; import { useRecoilValue } from 'recoil'; -import { reportUserSelectedMonthState } from '@states/user_field_service_reports'; +import { + reportUserSelectedMonthState, + userFieldServiceMonthlyReportsState, +} from '@states/user_field_service_reports'; import { settingsState } from '@states/settings'; import useMinistryMonthlyRecord from '@features/ministry/hooks/useMinistryMonthlyRecord'; @@ -10,10 +13,25 @@ const useMinistryReport = () => { const { status, shared_ministry } = useMinistryMonthlyRecord(selectedMonth); const settings = useRecoilValue(settingsState); + const monthlyReports = useRecoilValue(userFieldServiceMonthlyReportsState); const [submitOpen, setSubmitOpen] = useState(false); const [withdrawOpen, setWithdrawOpen] = useState(false); + const reportStatus = useMemo(() => { + const report = monthlyReports.find( + (record) => record.report_date === selectedMonth + ); + + if (!report) return status; + + const userStatus = report.report_data.status; + + if (userStatus === 'pending') return 'pending'; + + return status; + }, [status, monthlyReports, selectedMonth]); + const disabled = useMemo(() => { if (!settings.cong_settings.data_sync.value) { return true; @@ -21,8 +39,6 @@ const useMinistryReport = () => { if (status === 'confirmed') return true; - if (status === 'received') return true; - return !shared_ministry; }, [settings, shared_ministry, status]); @@ -31,11 +47,11 @@ const useMinistryReport = () => { const handleCloseWithdraw = () => setWithdrawOpen(false); const handleOpenModal = () => { - if (status === 'pending') { + if (reportStatus === 'pending') { setSubmitOpen(true); } - if (status === 'submitted') { + if (reportStatus === 'submitted' || reportStatus === 'received') { setWithdrawOpen(true); } }; @@ -44,10 +60,10 @@ const useMinistryReport = () => { submitOpen, handleOpenModal, handleCloseSubmit, - status, handleCloseWithdraw, withdrawOpen, disabled, + reportStatus, }; }; diff --git a/src/services/dexie/cong_field_service_reports.ts b/src/services/dexie/cong_field_service_reports.ts index 0914965541..5dc50c64ce 100644 --- a/src/services/dexie/cong_field_service_reports.ts +++ b/src/services/dexie/cong_field_service_reports.ts @@ -17,6 +17,7 @@ export const dbFieldServiceReportsBulkSave = async ( export const dbHandleIncomingReports = async (reports: IncomingReport[]) => { const congReportsAll = await appDb.cong_field_service_reports.toArray(); + const congReports = congReportsAll.filter( (record) => !record.report_data._deleted ); @@ -32,7 +33,9 @@ export const dbHandleIncomingReports = async (reports: IncomingReport[]) => { ); const findReport = congReports.find( - (r) => r.report_id === record.report_id + (r) => + r.report_data.report_date === record.report_month && + r.report_data.person_uid === record.person_uid ); let allowAdd = false; @@ -62,42 +65,49 @@ export const dbHandleIncomingReports = async (reports: IncomingReport[]) => { if (!allowAdd) continue; // remove deleted report on current - if (record._deleted) { + if (record._deleted && findReport) { const report = structuredClone(findReport); report.report_data._deleted = true; report.report_data.updatedAt = record.updatedAt; await dbFieldServiceReportsSave(report); - - continue; } // add new report - let report: CongFieldServiceReportType; + if (!record._deleted) { + const pubReport = congReportsAll.find( + (r) => + r.report_data.report_date === record.report_month && + r.report_data.person_uid === record.person_uid + ); - if (!findReport) { - report = structuredClone(congFieldServiceReportSchema); - report.report_id = record.report_id; - report.report_data.person_uid = record.person_uid; - } + let report: CongFieldServiceReportType; - if (findReport) { - report = structuredClone(findReport); - } + if (!pubReport) { + report = structuredClone(congFieldServiceReportSchema); + report.report_id = crypto.randomUUID(); + report.report_data.person_uid = record.person_uid; + } - report.report_data.updatedAt = record.updatedAt; - report.report_data.bible_studies = record.bible_studies; - report.report_data.comments = record.comments; - report.report_data.hours.field_service = record.hours; - report.report_data.hours.credit = { - approved: 0, - value: record.hours_credits, - }; - report.report_data.report_date = record.report_month; - report.report_data.shared_ministry = record.shared_ministry; - report.report_data.status = 'received'; - - await dbFieldServiceReportsSave(report); + if (pubReport) { + report = structuredClone(pubReport); + } + + report.report_data.updatedAt = record.updatedAt; + report.report_data.bible_studies = record.bible_studies; + report.report_data.comments = record.comments; + report.report_data.hours.field_service = record.hours; + report.report_data.hours.credit = { + approved: 0, + value: record.hours_credits, + }; + report.report_data.report_date = record.report_month; + report.report_data.shared_ministry = record.shared_ministry; + report.report_data.status = 'received'; + report.report_data._deleted = false; + + await dbFieldServiceReportsSave(report); + } } }; diff --git a/src/services/worker/backupUtils.ts b/src/services/worker/backupUtils.ts index 785ad6d2ad..f6f6d00122 100644 --- a/src/services/worker/backupUtils.ts +++ b/src/services/worker/backupUtils.ts @@ -1238,7 +1238,9 @@ export const dbExportDataBackup = async (backupData: BackupDataType) => { for (const report of remoteReports) { const findReport = cong_field_service_reports.find( - (record) => record.report_id === report.report_id + (record) => + record.report_data.person_uid === report.person_uid && + record.report_data.report_date === report.report_month ); if (!findReport) { From bc90ace295c124223c8deb1239d1aa5c6dd339ba Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Sun, 8 Dec 2024 13:13:48 +0300 Subject: [PATCH 23/31] fix(reports): remove duplicate reports --- src/services/app/index.ts | 2 + .../dexie/cong_field_service_reports.ts | 77 +++++++++++++++++++ 2 files changed, 79 insertions(+) diff --git a/src/services/app/index.ts b/src/services/app/index.ts index 2dc3de689f..4bdf5ab1f7 100644 --- a/src/services/app/index.ts +++ b/src/services/app/index.ts @@ -20,6 +20,7 @@ import { setSongs } from '@services/recoil/songs'; import { schedulesBuildHistoryList } from './schedules'; import { setAssignmentsHistory } from '@services/recoil/schedules'; import { dbSchedAuxClassUpdate } from '@services/dexie/schedules'; +import { dbRemoveDuplicateReports } from '@services/dexie/cong_field_service_reports'; export const loadApp = async () => { const appLang = await promiseGetRecoil(appLangState); @@ -42,6 +43,7 @@ export const runUpdater = async () => { await dbWeekTypeUpdate(); await dbAssignmentUpdate(); await dbSchedAuxClassUpdate(); + await dbRemoveDuplicateReports(); }; export const userLogoutSuccess = async () => { diff --git a/src/services/dexie/cong_field_service_reports.ts b/src/services/dexie/cong_field_service_reports.ts index 5dc50c64ce..e2616ef73b 100644 --- a/src/services/dexie/cong_field_service_reports.ts +++ b/src/services/dexie/cong_field_service_reports.ts @@ -111,3 +111,80 @@ export const dbHandleIncomingReports = async (reports: IncomingReport[]) => { } } }; + +export const dbRemoveDuplicateReports = async () => { + try { + const congReportsAll = await appDb.cong_field_service_reports.toArray(); + + const congReports = congReportsAll.filter( + (record) => !record.report_data._deleted + ); + + type recType = { + person_uid: string; + months: { + report_date: string; + reports: CongFieldServiceReportType[]; + }[]; + }[]; + + const personReportsByMonth = congReports.reduce((acc: recType, record) => { + const personRecord = acc.find( + (p) => p.person_uid === record.report_data.person_uid + ); + + if (!personRecord) { + acc.push({ + person_uid: record.report_data.person_uid, + months: [ + { + report_date: record.report_data.report_date, + reports: [record], + }, + ], + }); + } + + if (personRecord) { + const monthReport = personRecord.months.find( + (r) => r.report_date === record.report_data.report_date + ); + + if (!monthReport) { + personRecord.months.push({ + report_date: record.report_data.report_date, + reports: [record], + }); + } + + if (monthReport) { + monthReport.reports.push(record); + } + } + + return acc; + }, []); + + const duplicateReports = personReportsByMonth.filter((record) => + record.months.find((month) => month.reports.length > 1) + ); + + for await (const person of duplicateReports) { + for await (const month of person.months) { + const leastReport = month.reports + .sort((a, b) => + a.report_data.updatedAt.localeCompare(b.report_data.updatedAt) + ) + .at(0); + + const report = structuredClone(leastReport); + report.report_data._deleted = true; + report.report_data.updatedAt = new Date().toISOString(); + + await dbFieldServiceReportsSave(report); + } + } + } catch (error) { + console.error(error); + } +}; From 246e8c86123736d4dc045d01484f7e43ef2798f6 Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Sun, 8 Dec 2024 13:41:38 +0300 Subject: [PATCH 24/31] fix(reports): update year range when exporting congregation cards --- src/features/reports/hooks/useCongregationCard.tsx | 10 +++++----- src/views/reports/S21/shared/TableHeader.tsx | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/features/reports/hooks/useCongregationCard.tsx b/src/features/reports/hooks/useCongregationCard.tsx index 6d6f4e609d..ae7d71b778 100644 --- a/src/features/reports/hooks/useCongregationCard.tsx +++ b/src/features/reports/hooks/useCongregationCard.tsx @@ -2,7 +2,7 @@ import { useMemo } from 'react'; import { useRecoilValue } from 'recoil'; import { useAppTranslation } from '@hooks/index'; import { S21CardData, S21CardMonthData } from '@definition/report'; -import { createArrayFromMonths, currentReportMonth } from '@utils/date'; +import { createArrayFromMonths, currentServiceYear } from '@utils/date'; import { JWLangState, monthNamesState } from '@states/app'; import useReportMonthly from './useReportMonthly'; @@ -17,11 +17,11 @@ const useCongregationCard = () => { const years = useMemo(() => { const result: string[] = []; - const currentMonth = currentReportMonth(); - const year = currentMonth.split('/')[0]; - const prevYear = String(+year - 1).toString(); - result.push(prevYear, year); + const currentYear = currentServiceYear(); + const prevYear = String(+currentYear - 1).toString(); + + result.push(prevYear, currentYear); return result; }, []); diff --git a/src/views/reports/S21/shared/TableHeader.tsx b/src/views/reports/S21/shared/TableHeader.tsx index b79cd5d8b2..b694e165bf 100644 --- a/src/views/reports/S21/shared/TableHeader.tsx +++ b/src/views/reports/S21/shared/TableHeader.tsx @@ -11,7 +11,7 @@ const TableHeader = ({ data }: S21Type) => { - {t('tr_serviceYear')} + {t('tr_serviceYear').replaceAll('-', '-\u000A')} {data.year} From 8335cf6dd5a23c5f64a292f1efc2208c7530442b Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Sun, 8 Dec 2024 13:43:35 +0300 Subject: [PATCH 25/31] fix(locales): update language path for hungarian --- src/constants/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants/index.ts b/src/constants/index.ts index be23487d94..5607abd640 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -65,7 +65,7 @@ export const LANGUAGE_LIST = [ { code: 'cv', locale: 'ceb-PH', name: 'Cebuano' }, { code: 'kha', locale: 'mn-MN', name: 'монгол' }, { code: 'rea', locale: 'hy-AM', name: 'Հայերեն' }, - { code: 'h', locale: 'hy-HU', name: 'magyar' }, + { code: 'h', locale: 'hu-HU', name: 'magyar' }, { code: 'tpo', locale: 'pt-PT', name: 'Português (Portugal)' }, { code: 'fi', locale: 'fi-FI', name: 'suomi' }, { code: 'st', locale: 'et-EE', name: 'eesti' }, From 04823d9d71a9c25bcfc91bc12896e32d1c05568c Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Sun, 8 Dec 2024 14:24:09 +0300 Subject: [PATCH 26/31] fix(locales): issue with tagalog language translation --- src/RootWrap.tsx | 15 +------- src/constants/index.ts | 2 +- .../language_switcher/useLanguage.tsx | 27 +++----------- src/features/whats_new/useWhatsNew.tsx | 13 +++++-- src/hooks/useAppTranslation.tsx | 9 ++++- src/services/i18n/index.ts | 36 +++++++++---------- src/services/i18n/public_talks.ts | 7 +++- src/services/i18n/songs.ts | 7 +++- src/services/i18n/translation.ts | 9 +++++ src/states/app.ts | 15 +------- 10 files changed, 63 insertions(+), 77 deletions(-) diff --git a/src/RootWrap.tsx b/src/RootWrap.tsx index be4331c299..44a299e490 100644 --- a/src/RootWrap.tsx +++ b/src/RootWrap.tsx @@ -21,20 +21,7 @@ import WaitingLoader from '@components/waiting_loader'; const Migration = lazy(() => import('./migration')); -const getFont = () => { - const cookiesConsent = Boolean(localStorage.getItem('userConsent')); - - if (cookiesConsent) { - return localStorage.getItem('app_font') || 'Inter'; - } - - const hash = new URL(window.location.href).hash; - const params = new URLSearchParams(hash.substring(2)); - - return params.get('font') || 'Inter'; -}; - -const font = getFont(); +const font = localStorage.getItem('app_font') || 'Inter'; const cache = createCache({ key: 'css', diff --git a/src/constants/index.ts b/src/constants/index.ts index 5607abd640..aa5bfac446 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -19,7 +19,7 @@ export const LANGUAGE_LIST = [ { code: 't', locale: 'pt-BR', name: 'Português (Brasil)' }, { code: 'u', locale: 'ru-RU', name: 'русский' }, { code: 'm', locale: 'ro-RO', name: 'Română' }, - { code: 'tg', locale: 'tl-PH', name: 'Tagalog' }, + { code: 'tg', locale: 'tl-PH', name: 'Tagalog', identifier: 'tgl' }, { code: 'tnd', locale: 'mg-TND', diff --git a/src/features/language_switcher/useLanguage.tsx b/src/features/language_switcher/useLanguage.tsx index d33e6a07bb..287dfdae62 100644 --- a/src/features/language_switcher/useLanguage.tsx +++ b/src/features/language_switcher/useLanguage.tsx @@ -1,28 +1,19 @@ import { useEffect, useState } from 'react'; -import { useSearchParams } from 'react-router-dom'; import { useRecoilValue } from 'recoil'; import { useBreakpoints } from '@hooks/index'; -import { cookiesConsentState, isAppLoadState } from '@states/app'; +import { isAppLoadState } from '@states/app'; import { LANGUAGE_LIST } from '@constants/index'; import { getTranslation } from '@services/i18n/translation'; import { FullnameOption } from '@definition/settings'; import { dbAppSettingsUpdate } from '@services/dexie/settings'; -import { - accountTypeState, - settingsState, - userDataViewState, -} from '@states/settings'; +import { settingsState, userDataViewState } from '@states/settings'; const useLanguage = () => { const { tabletDown } = useBreakpoints(); - const [, setParams] = useSearchParams(); - const isAppLoad = useRecoilValue(isAppLoadState); const dataView = useRecoilValue(userDataViewState); const settings = useRecoilValue(settingsState); - const cookiesConsent = useRecoilValue(cookiesConsentState); - const accountType = useRecoilValue(accountTypeState); const [anchorEl, setAnchorEl] = useState(null); const isMenuOpen = Boolean(anchorEl); @@ -45,18 +36,8 @@ const useLanguage = () => { const font = LANGUAGE_LIST.find((lang) => lang.locale === ui_lang)?.font || 'Inter'; - if (cookiesConsent || accountType === 'pocket') { - localStorage.setItem('ui_lang', ui_lang); - localStorage.setItem('app_font', font); - } - - if (!cookiesConsent && accountType !== 'pocket') { - setParams((params) => { - params.set('locale', ui_lang); - params.set('font', font); - return params; - }); - } + localStorage.setItem('ui_lang', ui_lang); + localStorage.setItem('app_font', font); handleClose(); window.location.reload(); diff --git a/src/features/whats_new/useWhatsNew.tsx b/src/features/whats_new/useWhatsNew.tsx index 228b504236..6d4c39df0a 100644 --- a/src/features/whats_new/useWhatsNew.tsx +++ b/src/features/whats_new/useWhatsNew.tsx @@ -3,7 +3,7 @@ import { SwiperRef } from 'swiper/react'; import { useRecoilValue } from 'recoil'; import { useAppTranslation } from '@hooks/index'; import { ReleaseNoteType, UpdateStatusType } from '@definition/app'; -import { isDemo } from '@constants/index'; +import { isDemo, LANGUAGE_LIST } from '@constants/index'; import { ImageSlide } from './index.types'; import { appLangState } from '@states/app'; @@ -22,9 +22,16 @@ const useWhatsNew = () => { const [improvements, setImprovements] = useState([]); const [currentImage, setCurrentImage] = useState(0); + const identifier = useMemo(() => { + return ( + LANGUAGE_LIST.find((record) => record.locale === appLang)?.identifier || + appLang + ); + }, [appLang]); + const releases = useMemo(() => { - return i18n.options.resources[appLang].releases as ReleaseNoteType; - }, [appLang, i18n]); + return i18n.options.resources[identifier].releases as ReleaseNoteType; + }, [identifier, i18n]); const version = useMemo(() => { const releasesDates = Object.keys(releases); diff --git a/src/hooks/useAppTranslation.tsx b/src/hooks/useAppTranslation.tsx index 69d813849f..9ea74db51b 100644 --- a/src/hooks/useAppTranslation.tsx +++ b/src/hooks/useAppTranslation.tsx @@ -1,7 +1,14 @@ +import { LANGUAGE_LIST } from '@constants/index'; import { useTranslation } from 'react-i18next'; const useHookTranslation = () => { - const { t, i18n } = useTranslation(); + const appLang = localStorage.getItem('ui_lang'); + + const identifier = + LANGUAGE_LIST.find((record) => record.locale === appLang)?.identifier || + appLang; + + const { t, i18n } = useTranslation('ui', { lng: identifier }); return { t, i18n }; }; diff --git a/src/services/i18n/index.ts b/src/services/i18n/index.ts index 99b5b89a87..07f14691c2 100644 --- a/src/services/i18n/index.ts +++ b/src/services/i18n/index.ts @@ -1,37 +1,34 @@ -import i18n from 'i18next'; import { initReactI18next } from 'react-i18next'; +import i18n from 'i18next'; + +import { LANGUAGE_LIST } from '@constants/index'; export const defaultNS = 'ui'; const resources = {}; -const getAppLang = () => { - const langStorage = localStorage.getItem('ui_lang'); - - if (langStorage) { - return langStorage; - } +const appLang = localStorage.getItem('ui_lang'); - const hash = new URL(window.location.href).hash; - const params = new URLSearchParams(hash.substring(2)); +const identifier = + LANGUAGE_LIST.find((record) => record.locale === appLang)?.identifier || + appLang; - return params.get('locale')?.toString() || 'en'; -}; +const languages = [{ locale: appLang, identifier }]; -const appLang = getAppLang(); - -const languages = [appLang]; - -if (!languages.includes('en')) languages.push('en'); +if (!languages.some((r) => r.locale === 'en')) + languages.push({ locale: 'en', identifier: 'en' }); // programatically load all locales -for await (const language of languages) { +for await (const record of languages) { + const language = record.locale; + const activities = await import(`@locales/${language}/activities.json`).then( (module) => module.default ); const congregation = await import( `@locales/${language}/congregation.json` ).then((module) => module.default); + const dashboard = await import(`@locales/${language}/dashboard.json`).then( (module) => module.default ); @@ -72,7 +69,7 @@ for await (const language of languages) { (module) => module.default ); - resources[language] = { + resources[record.identifier] = { ui: { ...activities, ...congregation, @@ -94,8 +91,9 @@ for await (const language of languages) { i18n.use(initReactI18next).init({ resources, defaultNS, - lng: appLang, + lng: identifier, fallbackLng: 'en', + supportedLngs: ['en', identifier], interpolation: { escapeValue: false }, }); diff --git a/src/services/i18n/public_talks.ts b/src/services/i18n/public_talks.ts index 3ac359ad91..d682a35b50 100644 --- a/src/services/i18n/public_talks.ts +++ b/src/services/i18n/public_talks.ts @@ -1,8 +1,13 @@ import { getI18n } from 'react-i18next'; import { PublicTalkType } from '@definition/public_talks'; +import { LANGUAGE_LIST } from '@constants/index'; export const publicTalksBuildList = (language: string) => { - const translations = getI18n().options.resources[language].talks; + const identifier = + LANGUAGE_LIST.find((record) => record.locale === language)?.identifier || + language; + + const translations = getI18n().options.resources[identifier].talks; const result: PublicTalkType[] = []; for (const [key, value] of Object.entries(translations)) { diff --git a/src/services/i18n/songs.ts b/src/services/i18n/songs.ts index 72231b239a..b0b5ea4bf4 100644 --- a/src/services/i18n/songs.ts +++ b/src/services/i18n/songs.ts @@ -1,8 +1,13 @@ import { getI18n } from 'react-i18next'; import { SongType } from '@definition/songs'; +import { LANGUAGE_LIST } from '@constants/index'; export const songsBuildList = (language: string) => { - const translations = getI18n().options.resources[language].songs; + const identifier = + LANGUAGE_LIST.find((record) => record.locale === language)?.identifier || + language; + + const translations = getI18n().options.resources[identifier].songs; const result: SongType[] = []; for (const [key, value] of Object.entries(translations)) { diff --git a/src/services/i18n/translation.ts b/src/services/i18n/translation.ts index ac82459398..676813a301 100644 --- a/src/services/i18n/translation.ts +++ b/src/services/i18n/translation.ts @@ -1,3 +1,4 @@ +import { LANGUAGE_LIST } from '@constants/index'; import { getI18n } from 'react-i18next'; export const getTranslation = ({ @@ -14,6 +15,14 @@ export const getTranslation = ({ if (i18n) { if (!language) language = i18n.language; + if (language) { + const identifier = + LANGUAGE_LIST.find((record) => record.locale === language) + ?.identifier || language; + + language = identifier; + } + return i18n.t(key, { lng: language, ...params }); } }; diff --git a/src/states/app.ts b/src/states/app.ts index d8d3de7702..ea6701564c 100644 --- a/src/states/app.ts +++ b/src/states/app.ts @@ -9,19 +9,6 @@ import { ReactElement } from 'react'; import { LANGUAGE_LIST } from '@constants/index'; import { CongregationUserType } from '@definition/api'; -const getAppLang = () => { - const langStorage = localStorage.getItem('ui_lang'); - - if (langStorage) { - return langStorage; - } - - const hash = new URL(window.location.href).hash; - const params = new URLSearchParams(hash.substring(2)); - - return params.get('locale')?.toString() || 'en'; -}; - export const isDarkThemeState = atom({ key: 'isDarkTheme', default: localStorageGetItem('theme') === 'dark' ? true : false, @@ -64,7 +51,7 @@ export const isLoginOpenState = atom({ export const appLangState = atom({ key: 'appLang', - default: getAppLang(), + default: localStorage?.getItem('ui_lang') || 'en', }); export const monthNamesState = selector({ From ccb02fa7c87385c7b12e5dd5ca1fd3c908fbf6c3 Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Sun, 8 Dec 2024 14:44:47 +0300 Subject: [PATCH 27/31] fix(templates): use 24 hour format settings in exported pdf --- .../midweek_meeting/useMidweekMeeting.tsx | 15 +++++++++++--- .../weekend_meeting/useWeekendMeeting.tsx | 20 ++++++++++++++++--- src/services/app/schedules.ts | 11 +++++++++- src/services/i18n/index.ts | 2 +- 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/features/meetings/weekly_schedules/midweek_meeting/useMidweekMeeting.tsx b/src/features/meetings/weekly_schedules/midweek_meeting/useMidweekMeeting.tsx index 54cd47b3fc..590034a126 100644 --- a/src/features/meetings/weekly_schedules/midweek_meeting/useMidweekMeeting.tsx +++ b/src/features/meetings/weekly_schedules/midweek_meeting/useMidweekMeeting.tsx @@ -2,9 +2,10 @@ import { useMemo, useState } from 'react'; import { useRecoilValue } from 'recoil'; import { useAppTranslation, useIntersectionObserver } from '@hooks/index'; import { schedulesState } from '@states/schedules'; -import { addMonths, getWeekDate } from '@utils/date'; +import { addMonths, generateDateFromTime, getWeekDate } from '@utils/date'; import { formatDate } from '@services/dateformat'; import { + hour24FormatState, midweekMeetingClassCountState, midweekMeetingOpeningPrayerAutoAssign, midweekMeetingTimeState, @@ -38,6 +39,7 @@ const useMidweekMeeting = () => { const userUID = useRecoilValue(userLocalUIDState); const pgmStart = useRecoilValue(midweekMeetingTimeState); const lang = useRecoilValue(JWLangState); + const use24 = useRecoilValue(hour24FormatState); const openingPrayerAuto = useRecoilValue( midweekMeetingOpeningPrayerAutoAssign ); @@ -168,16 +170,23 @@ const useMidweekMeeting = () => { const partTimings = useMemo(() => { if (!schedule && !source) return; + let meetingStart = pgmStart; + + if (!use24) { + const date = generateDateFromTime(pgmStart); + meetingStart = formatDate(date, 'h:mm'); + } + const result = schedulesMidweekGetTiming({ schedule, dataView, - pgmStart, + pgmStart: meetingStart, source, lang, }); return result; - }, [schedule, source, dataView, pgmStart, lang]); + }, [schedule, source, dataView, pgmStart, lang, use24]); const handleGoCurrent = () => { const now = getWeekDate(); diff --git a/src/features/meetings/weekly_schedules/weekend_meeting/useWeekendMeeting.tsx b/src/features/meetings/weekly_schedules/weekend_meeting/useWeekendMeeting.tsx index ea984da0dd..119e2cced9 100644 --- a/src/features/meetings/weekly_schedules/weekend_meeting/useWeekendMeeting.tsx +++ b/src/features/meetings/weekly_schedules/weekend_meeting/useWeekendMeeting.tsx @@ -2,9 +2,15 @@ import { useMemo, useState } from 'react'; import { useRecoilValue } from 'recoil'; import { useAppTranslation, useIntersectionObserver } from '@hooks/index'; import { schedulesState } from '@states/schedules'; -import { addMonths, getWeekDate, timeAddMinutes } from '@utils/date'; +import { + addMonths, + generateDateFromTime, + getWeekDate, + timeAddMinutes, +} from '@utils/date'; import { formatDate } from '@services/dateformat'; import { + hour24FormatState, userDataViewState, userLocalUIDState, weekendMeetingOpeningPrayerAutoAssignState, @@ -39,6 +45,7 @@ const useWeekendMeeting = () => { const sources = useRecoilValue(sourcesState); const userUID = useRecoilValue(userLocalUIDState); const pgmStart = useRecoilValue(weekendMeetingTimeState); + const use24 = useRecoilValue(hour24FormatState); const openingPrayerAuto = useRecoilValue( weekendMeetingOpeningPrayerAutoAssignState ); @@ -179,7 +186,14 @@ const useWeekendMeeting = () => { const partTimings = useMemo(() => { const timings = {} as WeekendMeetingTimingsType; - timings.pgm_start = timeAddMinutes(pgmStart, 0); + let meetingStart = pgmStart; + + if (!use24) { + const date = generateDateFromTime(pgmStart); + meetingStart = formatDate(date, 'h:mm'); + } + + timings.pgm_start = timeAddMinutes(meetingStart, 0); timings.public_talk = timeAddMinutes(timings.pgm_start, 5); timings.middle_song = timeAddMinutes(timings.public_talk, 30); timings.w_study = timeAddMinutes(timings.middle_song, 5); @@ -194,7 +208,7 @@ const useWeekendMeeting = () => { } return timings; - }, [pgmStart, weekType]); + }, [pgmStart, weekType, use24]); const handleGoCurrent = () => { const now = getWeekDate(); diff --git a/src/services/app/schedules.ts b/src/services/app/schedules.ts index c7ee379c62..2ee5a789a6 100644 --- a/src/services/app/schedules.ts +++ b/src/services/app/schedules.ts @@ -19,6 +19,7 @@ import { weekendMeetingOpeningPrayerAutoAssignState, weekendMeetingWeekdayState, weekendMeetingWTStudyConductorDefaultState, + hour24FormatState, } from '@states/settings'; import { sourcesState } from '@states/sources'; import { assignmentsHistoryState, schedulesState } from '@states/schedules'; @@ -64,6 +65,7 @@ import { addMonths, addWeeks, dateFormatFriendly, + generateDateFromTime, timeAddMinutes, } from '@utils/date'; import { applyAssignmentFilters, personIsElder } from './persons'; @@ -2052,7 +2054,14 @@ export const schedulesMidweekData = async ( const result = {} as MidweekMeetingDataType; // get meeting parts timing - const pgmStart = await promiseGetRecoil(midweekMeetingTimeState); + let pgmStart: string = await promiseGetRecoil(midweekMeetingTimeState); + const use24: boolean = await promiseGetRecoil(hour24FormatState); + + if (!use24) { + const date = generateDateFromTime(pgmStart); + pgmStart = formatDate(date, 'h:mm'); + } + result.timing = schedulesMidweekGetTiming({ schedule, source, diff --git a/src/services/i18n/index.ts b/src/services/i18n/index.ts index 07f14691c2..5cd6284d99 100644 --- a/src/services/i18n/index.ts +++ b/src/services/i18n/index.ts @@ -7,7 +7,7 @@ export const defaultNS = 'ui'; const resources = {}; -const appLang = localStorage.getItem('ui_lang'); +const appLang = localStorage.getItem('ui_lang') || 'en'; const identifier = LANGUAGE_LIST.find((record) => record.locale === appLang)?.identifier || From 4a60e74d802eae732cab0e675d362b06cce5445a Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Sun, 8 Dec 2024 14:58:26 +0300 Subject: [PATCH 28/31] fix(persons): update date of baptism change flow --- .../baptized_publisher/useBaptizedPublisher.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/features/persons/spiritual_status/baptized_publisher/useBaptizedPublisher.tsx b/src/features/persons/spiritual_status/baptized_publisher/useBaptizedPublisher.tsx index ac26956af1..09d19e646e 100644 --- a/src/features/persons/spiritual_status/baptized_publisher/useBaptizedPublisher.tsx +++ b/src/features/persons/spiritual_status/baptized_publisher/useBaptizedPublisher.tsx @@ -184,6 +184,7 @@ const useBaptizedPublisher = () => { newPerson.person_data.publisher_baptized.baptism_date.value = value === null ? null : new Date(value).toISOString(); + newPerson.person_data.publisher_baptized.baptism_date.updatedAt = new Date().toISOString(); @@ -191,7 +192,9 @@ const useBaptizedPublisher = () => { (record) => !record._deleted && record.start_date !== null ); - if (histories.length === 0 && value) { + const firstReport = person.person_data.first_report?.value || ''; + + if (histories.length === 0 && value && firstReport.length === 0) { const startMonth = dateFirstDayMonth(value).toISOString(); newPerson.person_data.publisher_baptized.history.push({ From d3b423e479637f36f44374cd6d43b86d366f3ab2 Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Sun, 8 Dec 2024 15:10:29 +0300 Subject: [PATCH 29/31] chore(hooks): add default fallback language --- src/hooks/useAppTranslation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useAppTranslation.tsx b/src/hooks/useAppTranslation.tsx index 9ea74db51b..617c3b6dfc 100644 --- a/src/hooks/useAppTranslation.tsx +++ b/src/hooks/useAppTranslation.tsx @@ -2,7 +2,7 @@ import { LANGUAGE_LIST } from '@constants/index'; import { useTranslation } from 'react-i18next'; const useHookTranslation = () => { - const appLang = localStorage.getItem('ui_lang'); + const appLang = localStorage.getItem('ui_lang') || 'en'; const identifier = LANGUAGE_LIST.find((record) => record.locale === appLang)?.identifier || From 6596fd294f00100f154970b06a94bb8ccbc3731f Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Sun, 8 Dec 2024 15:23:53 +0300 Subject: [PATCH 30/31] chore(demo): add first report value for persons --- src/utils/dev.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/utils/dev.ts b/src/utils/dev.ts index 8e14eba938..6a40266d75 100644 --- a/src/utils/dev.ts +++ b/src/utils/dev.ts @@ -225,6 +225,11 @@ export const importDummyPersons = async (showLoading?: boolean) => { } if (femaleStatus === 'unbaptized') { + person.person_data.first_report = { + value: startDateTemp, + updatedAt: new Date().toISOString(), + }; + person.person_data.publisher_unbaptized = { active: { value: true, updatedAt: new Date().toISOString() }, history: [ @@ -275,6 +280,11 @@ export const importDummyPersons = async (showLoading?: boolean) => { ) ); + person.person_data.first_report = { + value: startDateTemp, + updatedAt: new Date().toISOString(), + }; + person.person_data.publisher_baptized = { active: { value: true, updatedAt: new Date().toISOString() }, baptism_date: { From efe909144b6dbf6d660f25197c6ba664ebf58b89 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 8 Dec 2024 12:48:58 +0000 Subject: [PATCH 31/31] chore(release): 3.3.0 [skip ci] # [3.3.0](https://github.com/sws2apps/organized-app/compare/v3.2.0...v3.3.0) (2024-12-08) ### Bug Fixes * **app:** persist some app data when logging out ([e4cd3d1](https://github.com/sws2apps/organized-app/commit/e4cd3d1875d3c1d1ccc5cd50907e89e6370c16c3)) * **components:** update margin for typography in assignments checklist ([082ca1e](https://github.com/sws2apps/organized-app/commit/082ca1e172bcb529a260e27cd887a05cf5b2d9e4)) * **congregation:** unwanted error message for changing codes ([2bc7361](https://github.com/sws2apps/organized-app/commit/2bc73615c533f17651264ae3a9df5607a95cf3f4)) * **dashboard:** manual backup not running ([3c9a449](https://github.com/sws2apps/organized-app/commit/3c9a449b92dc56066e8fae8e073a6fd4c36589b8)) * **locales:** issue with tagalog language translation ([04823d9](https://github.com/sws2apps/organized-app/commit/04823d9d71a9c25bcfc91bc12896e32d1c05568c)) * **locales:** update language path for hungarian ([8335cf6](https://github.com/sws2apps/organized-app/commit/8335cf6dd5a23c5f64a292f1efc2208c7530442b)) * **ministry:** month selector in dark them for pioneer applications ([4d367c9](https://github.com/sws2apps/organized-app/commit/4d367c9637c305106ba510a0968f3657276f45c8)) * **ministry:** report submission flow ([4d2a285](https://github.com/sws2apps/organized-app/commit/4d2a285302f8535427cd7a30da91093f15e6519c)) * **persons:** update date of baptism change flow ([4a60e74](https://github.com/sws2apps/organized-app/commit/4a60e74d802eae732cab0e675d362b06cce5445a)) * **reminders:** check if publisher in current report month ([adb25e4](https://github.com/sws2apps/organized-app/commit/adb25e4b91e32c7f3774b1ab3f7c5a57dd6737ce)) * **reports:** add indeterminate state for S-21 export checkboxes ([569ad6e](https://github.com/sws2apps/organized-app/commit/569ad6e50eb880815d91d11c5e33ea892d8a1c00)) * **reports:** remove duplicate reports ([bc90ace](https://github.com/sws2apps/organized-app/commit/bc90ace295c124223c8deb1239d1aa5c6dd339ba)) * **reports:** update submission flow ([4f52dfb](https://github.com/sws2apps/organized-app/commit/4f52dfb3602f2f2e84c1a4dc9e18cd39488c737b)) * **reports:** update year range when exporting congregation cards ([246e8c8](https://github.com/sws2apps/organized-app/commit/246e8c86123736d4dc045d01484f7e43ef2798f6)) * **startup:** screens mixed up in some conditions ([662f04e](https://github.com/sws2apps/organized-app/commit/662f04e10f0bfd143bc9560db197e3b36964967b)) * **templates:** use 24 hour format settings in exported pdf ([ccb02fa](https://github.com/sws2apps/organized-app/commit/ccb02fa7c87385c7b12e5dd5ca1fd3c908fbf6c3)) ### Features * **meetings:** add 'No assignments yet' in the assignment history ([41b2955](https://github.com/sws2apps/organized-app/commit/41b2955a4c69ef7eaf88a8c41d2c0c673c4fce0e)) --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42a7b647be..a45e72c927 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,30 @@ +# [3.3.0](https://github.com/sws2apps/organized-app/compare/v3.2.0...v3.3.0) (2024-12-08) + + +### Bug Fixes + +* **app:** persist some app data when logging out ([e4cd3d1](https://github.com/sws2apps/organized-app/commit/e4cd3d1875d3c1d1ccc5cd50907e89e6370c16c3)) +* **components:** update margin for typography in assignments checklist ([082ca1e](https://github.com/sws2apps/organized-app/commit/082ca1e172bcb529a260e27cd887a05cf5b2d9e4)) +* **congregation:** unwanted error message for changing codes ([2bc7361](https://github.com/sws2apps/organized-app/commit/2bc73615c533f17651264ae3a9df5607a95cf3f4)) +* **dashboard:** manual backup not running ([3c9a449](https://github.com/sws2apps/organized-app/commit/3c9a449b92dc56066e8fae8e073a6fd4c36589b8)) +* **locales:** issue with tagalog language translation ([04823d9](https://github.com/sws2apps/organized-app/commit/04823d9d71a9c25bcfc91bc12896e32d1c05568c)) +* **locales:** update language path for hungarian ([8335cf6](https://github.com/sws2apps/organized-app/commit/8335cf6dd5a23c5f64a292f1efc2208c7530442b)) +* **ministry:** month selector in dark them for pioneer applications ([4d367c9](https://github.com/sws2apps/organized-app/commit/4d367c9637c305106ba510a0968f3657276f45c8)) +* **ministry:** report submission flow ([4d2a285](https://github.com/sws2apps/organized-app/commit/4d2a285302f8535427cd7a30da91093f15e6519c)) +* **persons:** update date of baptism change flow ([4a60e74](https://github.com/sws2apps/organized-app/commit/4a60e74d802eae732cab0e675d362b06cce5445a)) +* **reminders:** check if publisher in current report month ([adb25e4](https://github.com/sws2apps/organized-app/commit/adb25e4b91e32c7f3774b1ab3f7c5a57dd6737ce)) +* **reports:** add indeterminate state for S-21 export checkboxes ([569ad6e](https://github.com/sws2apps/organized-app/commit/569ad6e50eb880815d91d11c5e33ea892d8a1c00)) +* **reports:** remove duplicate reports ([bc90ace](https://github.com/sws2apps/organized-app/commit/bc90ace295c124223c8deb1239d1aa5c6dd339ba)) +* **reports:** update submission flow ([4f52dfb](https://github.com/sws2apps/organized-app/commit/4f52dfb3602f2f2e84c1a4dc9e18cd39488c737b)) +* **reports:** update year range when exporting congregation cards ([246e8c8](https://github.com/sws2apps/organized-app/commit/246e8c86123736d4dc045d01484f7e43ef2798f6)) +* **startup:** screens mixed up in some conditions ([662f04e](https://github.com/sws2apps/organized-app/commit/662f04e10f0bfd143bc9560db197e3b36964967b)) +* **templates:** use 24 hour format settings in exported pdf ([ccb02fa](https://github.com/sws2apps/organized-app/commit/ccb02fa7c87385c7b12e5dd5ca1fd3c908fbf6c3)) + + +### Features + +* **meetings:** add 'No assignments yet' in the assignment history ([41b2955](https://github.com/sws2apps/organized-app/commit/41b2955a4c69ef7eaf88a8c41d2c0c673c4fce0e)) + # [3.2.0](https://github.com/sws2apps/organized-app/compare/v3.1.0...v3.2.0) (2024-12-03) diff --git a/package.json b/package.json index 4d2df5f87f..2f412f41c3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "organized", "private": true, - "version": "3.2.0", + "version": "3.3.0", "license": "MIT", "type": "module", "repository": {