Skip to content

Commit

Permalink
Merge branch 'main' into CU-86c1aa2w8_FEAT-Create-Service-groups-PDF_…
Browse files Browse the repository at this point in the history
…Max-Makaluk
  • Loading branch information
FussuChalice authored Dec 16, 2024
2 parents e003515 + c5635c9 commit 5060646
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 12 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## [3.4.2](https://github.com/sws2apps/organized-app/compare/v3.4.1...v3.4.2) (2024-12-16)


### Bug Fixes

* **meetings:** exclude not monday week ([8054bf6](https://github.com/sws2apps/organized-app/commit/8054bf61f560ef0d9ccebb9415d2eeb4c3f27d83))
* **templates:** get correct classroom for assignment ([0eccd36](https://github.com/sws2apps/organized-app/commit/0eccd360c93c1cfb6e7c9ba521e920c0ccf0fd86))

## [3.4.1](https://github.com/sws2apps/organized-app/compare/v3.4.0...v3.4.1) (2024-12-16)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "organized",
"private": true,
"version": "3.4.1",
"version": "3.4.2",
"license": "MIT",
"type": "module",
"repository": {
Expand Down
5 changes: 5 additions & 0 deletions src/features/meetings/midweek_export/useMidweekExport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
TemplateS89Doc4in1,
} from '@views/index';
import { cookiesConsentState, JWLangState } from '@states/app';
import { isMondayDate } from '@utils/date';

const useMidweekExport = (onClose: MidweekExportType['onClose']) => {
const [S89Template, setS89Template] = useRecoilState(S89TemplateState);
Expand Down Expand Up @@ -180,6 +181,10 @@ const useMidweekExport = (onClose: MidweekExportType['onClose']) => {

// get affected weeks list
const weeksList = schedules.filter((schedule) => {
const isMonday = isMondayDate(schedule.weekOf);

if (!isMonday) return false;

const [yearStart, monthStart] = startMonth.split('/');
const [yearEnd, monthEnd] = endMonth.split('/');

Expand Down
7 changes: 5 additions & 2 deletions src/features/meetings/schedule_publish/useSchedulePublish.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useMemo, useState } from 'react';
import { useRecoilValue } from 'recoil';
import { useQuery } from '@tanstack/react-query';
import { addMonths, getWeekDate } from '@utils/date';
import { addMonths, getWeekDate, isMondayDate } from '@utils/date';
import { sourcesState } from '@states/sources';
import {
ScheduleListType,
Expand Down Expand Up @@ -62,7 +62,10 @@ const useSchedulePublish = ({ type, onClose }: SchedulePublishProps) => {
const weekDate = getWeekDate();
const pastDate = addMonths(weekDate, -3);

let base = sources.filter((record) => new Date(record.weekOf) >= pastDate);
let base = sources.filter(
(record) =>
isMondayDate(record.weekOf) && new Date(record.weekOf) >= pastDate
);

if (type === 'midweek') {
base = base.filter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useEffect, useMemo, useState } from 'react';
import { useRecoilValue } from 'recoil';
import { JWLangState, monthShortNamesState } from '@states/app';
import { useAppTranslation } from '@hooks/index';
import { addMonths, getWeekDate } from '@utils/date';
import { addMonths, getWeekDate, isMondayDate } from '@utils/date';
import { formatDate } from '@services/dateformat';
import { WeeklySchedulesType, WeekSelectorProps } from './index.types';
import { sourcesState } from '@states/sources';
Expand All @@ -25,7 +25,9 @@ const useWeekSelector = ({ onChange, value }: WeekSelectorProps) => {
const filteredSources = useMemo(() => {
const minDate = formatDate(addMonths(new Date(), -2), 'yyyy/MM/dd');

return sources.filter((record) => record.weekOf >= minDate);
return sources.filter(
(record) => isMondayDate(record.weekOf) && record.weekOf >= minDate
);
}, [sources]);

const defaultValue = useMemo(() => {
Expand Down
6 changes: 3 additions & 3 deletions src/locales/ru-RU/congregation.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"tr_ministerialServants": "Помощники собрания",
"tr_studentAssignments": "Учебные задания",
"tr_noAssignmentsYet": "Пока нет заданий",
"tr_noAssignmentsYetDesc": "You don’t have any upcoming assignments, or none that match your current display filter.",
"tr_noAssignmentsYetDesc": "У тебя нет предстоящих заданий или ничего не соответствует твоему текущему фильтру отображения.",
"tr_withTerritory": "С территорией",
"tr_withoutTerritory": "Без территории",
"tr_overdue": "Просрочено",
Expand Down Expand Up @@ -68,7 +68,7 @@
"tr_requiredInformation": "Эта информация обязательна",
"tr_contactInfo": "Контактная информация",
"tr_addContact": "Добавить контакт",
"tr_manageAccessFullTitle": "User account management",
"tr_manageAccessFullTitle": "Управление аккаунтами пользователей",
"tr_addUser": "Добавить пользователя",
"tr_congregationPersons": "Персоны собрания",
"tr_congregationPersonsDesc": "Bind user accounts with their Organized person records, edit their rights and roles, view the personal invitation code or delegate persons by clicking on a user.",
Expand Down Expand Up @@ -441,7 +441,7 @@
"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_deleteCongregationMasterKeyRequired": "Enter the master key",
"tr_entranceAttendant": "Entrance attendant",
"tr_importExportTitle": "Import or export congregation data",
"tr_importExportTitle": "Импорт или экспорт данных о собрании",
"tr_exportDesc": "Export your congregation data to create a local backup or transfer it to another app.",
"tr_importDesc": "Upload a file to import. Consider exporting your current data first to keep a backup for potential restoration later.",
"tr_ministryReports": "My ministry reports",
Expand Down
4 changes: 2 additions & 2 deletions src/services/app/schedules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1892,11 +1892,11 @@ export const schedulesS89Data = async (
obj.part_number = '7';
}

if (assignment.includes('_A')) {
if (assignment.endsWith('_A')) {
obj.main_hall = true;
}

if (assignment.includes('_B')) {
if (assignment.endsWith('_B')) {
obj.aux_class_1 = true;
}

Expand Down
5 changes: 4 additions & 1 deletion src/states/sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This file holds the source of the truth from the table "sources".

import { atom, selector } from 'recoil';
import { SourceWeekType, SourcesFormattedType } from '@definition/sources';
import { isMondayDate } from '@utils/date';

export const sourcesState = atom<SourceWeekType[]>({
key: 'sources',
Expand All @@ -14,7 +15,9 @@ export const sourcesFormattedState = selector({
key: 'sourcesFormatted',
get: ({ get }) => {
const sources = get(sourcesState);
const newSources = structuredClone(sources);

// remove invalid weeks
const newSources = sources.filter((record) => isMondayDate(record.weekOf));

// First, sort the data in ascending order by date
newSources.sort(
Expand Down
2 changes: 1 addition & 1 deletion src/views/meetings/midweek/S89/default/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const TemplateS89 = ({ data, lang }: S89Type) => {

<S89ToBeGiven
main_hall={data.main_hall}
aux_class_1={!data.main_hall && data.aux_class_1}
aux_class_1={data.aux_class_1}
aux_class_2={data.aux_class_2}
/>

Expand Down

0 comments on commit 5060646

Please sign in to comment.