@zeniai/client-epic-state 5.0.36-betaRR01 → 5.0.36-betaRR03

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54,9 +54,19 @@ const getRecurringEndDateFromCount = (startDate, frequency, recurringCount) => {
54
54
  break;
55
55
  case 'weekly':
56
56
  case 'biweekly':
57
- case 'semi_weekly':
58
57
  endDate = startDate.add((0, exports.getRecurringFrequencyInDays)(frequency) * (recurringCount - 1), 'day');
59
58
  break;
59
+ case 'semi_weekly': {
60
+ // Two semi-weekly occurrences span exactly 7 days regardless of which
61
+ // two weekdays are picked (since gap1 + gap2 = 7). So odd counts are
62
+ // exact; even counts use the conservative half-week step (4 days).
63
+ const stepsRemaining = recurringCount - 1;
64
+ const fullWeekPairs = Math.floor(stepsRemaining / 2);
65
+ const hasOddTailStep = stepsRemaining % 2 === 1;
66
+ const days = fullWeekPairs * 7 + (hasOddTailStep ? 4 : 0);
67
+ endDate = startDate.add(days, 'day');
68
+ break;
69
+ }
60
70
  case 'monthly':
61
71
  endDate = startDate.add(recurringCount - 1, 'month');
62
72
  break;
@@ -18,6 +18,7 @@ const initializeTaskToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
18
18
  description: task.description,
19
19
  status: task.status.code,
20
20
  assignee: task.assignees,
21
+ groupAssignees: task.groupAssignees,
21
22
  dueDate: task.dueDate,
22
23
  priority: task.priority.code,
23
24
  tagIds: task.tagIds,
@@ -95,13 +95,14 @@ const prepareTaskPayload = (state, taskId, taskGroupId) => {
95
95
  recurring_start_date: localData.type.code === 'recurring'
96
96
  ? (localData.recurringStartDate?.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT) ?? null)
97
97
  : null,
98
- ...(localData.type.code === 'recurring' &&
98
+ recurring_days_of_week: localData.type.code === 'recurring' &&
99
99
  localData.recurringFrequency === 'semi_weekly'
100
- ? { recurring_days_of_week: localData.recurringDaysOfWeek ?? [] }
101
- : {}),
100
+ ? (localData.recurringDaysOfWeek ?? [])
101
+ : null,
102
102
  sync_token: syncToken,
103
103
  task_group_ids: taskGroupId != null ? [taskGroupId] : [],
104
104
  time_spent: (0, formatMinutesToFromHHMM_1.convertHHMMStrToMinutes)(localData.timeSpent),
105
+ group_assignees: localData.groupAssignees,
105
106
  ...(taskId == null ? { is_private: localData.isPrivate ?? false } : {}),
106
107
  };
107
108
  };
@@ -21,6 +21,7 @@ export interface EditTaskLocalData {
21
21
  assignee: ID[];
22
22
  description: string;
23
23
  fileIds: ID[];
24
+ groupAssignees: ID[];
24
25
  name: string;
25
26
  priority: PriorityCodeType;
26
27
  recurringEndDateLocalData: {
@@ -6,6 +6,7 @@ exports.initialTaskDetailLocalData = {
6
6
  description: '',
7
7
  status: 'todo',
8
8
  assignee: [],
9
+ groupAssignees: [],
9
10
  dueDate: undefined,
10
11
  priority: 'medium',
11
12
  tagIds: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.0.36-betaRR01",
3
+ "version": "5.0.36-betaRR03",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",