Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced repeat rules UI #8422

Open
wants to merge 99 commits into
base: 8046-parse-advanced-repeat-rules
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
574cc3e
Fix external calendar URLs validation
Nov 6, 2024
a02b5ff
Fix Events being cut in the next month
Nov 6, 2024
8b79ed1
Created generic card component
domesticated-raptor Oct 28, 2024
3de0ce1
Created simple SingleLineTextField
andrehgdias Oct 29, 2024
6a13763
Add intelisense/autocompletion to out styles
andrehgdias Oct 30, 2024
f741834
Create Toggle component
andrehgdias Oct 30, 2024
6372370
Create Select component
Nov 4, 2024
9157a6b
Adds accessibility to Select component
Nov 5, 2024
464a905
Create TextArea component
Nov 5, 2024
17de364
Fixing components and updating their docs
andrehgdias Nov 7, 2024
d8db236
Add variant Outlined to Button.ts
Nov 5, 2024
61f8a74
Adds InputButton
Nov 11, 2024
08505f6
Adds new event editor dialog
andrehgdias Nov 7, 2024
0a96e82
Adds reminder section to new event editor
Nov 12, 2024
a88cac7
Adds time section to new event editor
domesticated-raptor Nov 12, 2024
43bf0d6
Creates RepeatRulesPage on new Event Editor
andrehgdias Nov 13, 2024
8d892c2
Implements Guests Page
Nov 15, 2024
72722fc
Fixes inputs handling
Nov 19, 2024
8e2b8d2
Applies design improvements to Event Editor
Nov 20, 2024
1563db8
Applies design improvements to Event Editor main page
Nov 22, 2024
938443a
Fix tabbing not focusing inside select items
Nov 22, 2024
5234c7d
Applies changes on RepeatRuleEditor
Nov 22, 2024
d45dae0
Applies changes on AttendeeListEditor and revert fill-available
Nov 22, 2024
0867c19
Fixes transition on iPadOS
Nov 25, 2024
26d8a05
WIP - model + parsing byrules
Nov 28, 2024
d60f9b1
WIP: Trying to handle first byrule during event creation.
andrehgdias Nov 28, 2024
f37aff7
WIP
Nov 29, 2024
7471c92
Working for daily and daily bymonth
Dec 2, 2024
8c0aea3
Daily flow working
Dec 3, 2024
c36b6b2
Weekly flow working
Dec 3, 2024
8ae6657
Monthly flow works (Missing BYMONTHDAY)
Dec 3, 2024
4241dfa
Monthly flow is complete
Dec 4, 2024
1278d04
Yearly works?
Dec 9, 2024
77daf26
Add export of advanced repeat rules
Patrik-wav Dec 10, 2024
346bb36
Apply BYMONTHDAY and BYDAY to DAILY frequency
andrehgdias Dec 12, 2024
09ade20
Filter events happening before progenitor
andrehgdias Dec 12, 2024
58a4301
WIP: BySetPos
andrehgdias Dec 9, 2024
ac06ba6
WIP: fix weekno
andrehgdias Dec 11, 2024
6c49d18
Fixes Monthly frequency
Dec 13, 2024
59e5335
fix week nr?
Dec 13, 2024
cd7385f
ByYearDay
Dec 16, 2024
7f41a44
fix byMonthDay
Dec 16, 2024
d71ef6f
TODO: Filter BYYEARDAY
Dec 16, 2024
b384f1f
ByYearDay
Dec 17, 2024
d3e4046
Fix setpos
Dec 17, 2024
dc3ee3a
Simplifies generator with advanced rules
Dec 17, 2024
e3cf764
[WIP] Added BYMONTH expansion
Dec 18, 2024
f9bf6ec
[WIP] Added BYWEEKNO expansion
Dec 18, 2024
76fe078
[WIP] Added BYYEARDAY expansion
Dec 19, 2024
508076b
[WIP] Added BYMONTHDAY expansion
Dec 19, 2024
0086a31
[WIP] BYDAY
Dec 20, 2024
bc3572c
Remove redundant code before adding new changes
Patrik-wav Dec 20, 2024
52c84e7
WIP
Patrik-wav Dec 23, 2024
e97fc66
Handles model changes for Advanced Repeat Rules
Nov 28, 2024
b7640fa
Prototype event generation using ByRules
andrehgdias Nov 28, 2024
a6614a0
Implements event expansion for daily BYDAY and BYMONTH
Dec 2, 2024
aade961
Implements event expansion for Weekly interval
Dec 3, 2024
d059676
Implements event expansion for Monthly interval
Dec 3, 2024
f9b50a4
Implements expansion for Yearly interval
Dec 9, 2024
7c0db24
Add export of advanced repeat rules
Patrik-wav Dec 10, 2024
faa342a
Implements BYMONTHDAY filtering
andrehgdias Dec 12, 2024
563fdc4
Filter events happening before progenitor
andrehgdias Dec 12, 2024
15bb385
Implements BYSETPOS filtering
andrehgdias Dec 9, 2024
d296397
Fixes BYWEEKNO expansion
andrehgdias Dec 11, 2024
6cf2997
Implements BYYEARDAY filtering
Dec 16, 2024
1211d0b
Fixes SETPOS filtering
Dec 17, 2024
a901141
Simplifies generator with advanced rules
Dec 17, 2024
841acfd
[SDK] Implements BYMONTH expansion
Dec 18, 2024
548e639
[SDK] Implements BYWEEKNO expansion
Dec 18, 2024
13e7342
[SDK] Implements BYYEARDAY expansion
Dec 19, 2024
9bd0c84
[SDK] Implements BYMONTHDAY expansion
Dec 19, 2024
51f3872
[SDK] Implements BYDAY expansion
Dec 20, 2024
eafac54
[SDK] Implements tests for the complete recurrence generation flow
Jan 6, 2025
c6bfb9a
[SDK] Exposes EventFacade to uniffi
Jan 8, 2025
162b655
[Android] Integrates SDK event expansion during alarm scheduling
Jan 8, 2025
d4f2e36
wip ios sdk advanced rules
Jan 10, 2025
f25cf50
WIP add new UI for advanced repeat rules
Patrik-wav Jan 10, 2025
9250625
Merge branch '8047-backup' into 8047-advanced-repeat-rules-ui
Patrik-wav Jan 10, 2025
b227552
Rebase onto 8046-advanced-repeat-rules
Patrik-wav Jan 10, 2025
fd38c8a
[iOS] Integrates SDK event expansion during alarm scheduling
murilopereirame Jan 13, 2025
dc6bc9f
WIP add correct format to dropdown selection
Patrik-wav Jan 13, 2025
bb98fad
Fix occurrences not being saved when closing dialog
Patrik-wav Jan 13, 2025
d93c5f7
WIP add weekdaySelector component
Patrik-wav Jan 14, 2025
bf1f3a7
Fixes BYSETPOS on Web/Desktop
Jan 14, 2025
534618e
[Desktop] Integrates event expansion during alarm scheduling
Jan 14, 2025
5ca594c
[iOS] Adds BYSETPOS handling during alarm schedule
murilopereirame Jan 15, 2025
c3c1802
[Android] Fixes BYSETPOS during alarm schedule
Jan 15, 2025
f0b0630
Adds info banner for unsupported rules
Jan 16, 2025
faa5d6f
Adds translations to Advanced Repeat Rules
murilopereirame Jan 13, 2025
1a7cf35
Add styling to WeekdaySelector
Patrik-wav Jan 17, 2025
a280847
WIP Connect WeekdaySelector to Model
Patrik-wav Jan 20, 2025
0a7c536
WIP finish WeekdaySelector
Patrik-wav Jan 21, 2025
6f252eb
Merge branch '8047-backup' into 8047-advanced-repeat-rules-ui
Patrik-wav Jan 21, 2025
b2a295d
rebase onto 8046, add new translations
Patrik-wav Jan 21, 2025
209dfe7
refactor model write operations from WeekdaySelector Component
Patrik-wav Jan 21, 2025
cf5ed67
WIP fix WeekdaySelector not writing to model, add WeekRepetitionSelector
Patrik-wav Jan 23, 2025
94cd7f7
Finish WeekdaySelector and WeekRepetitionSelector
Patrik-wav Jan 29, 2025
351d725
Fix number of weekday occurrences not being calculated correctly
Patrik-wav Jan 29, 2025
cabb90a
Fix changing date not respecting advancedRepeatRules
Patrik-wav Feb 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app-android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ android {
buildTypes.each {
it.buildConfigField 'String', 'FILE_PROVIDER_AUTHORITY', '"' + it.manifestPlaceholders['contentProviderAuthority'] + '"'
// keep in sync with src/native/main/NativePushServiceApp.ts
it.buildConfigField 'String', "SYS_MODEL_VERSION", '"99"'
it.buildConfigField 'String', "TUTANOTA_MODEL_VERSION", '"73"'
it.buildConfigField 'String', "SYS_MODEL_VERSION", '"118"'
it.buildConfigField 'String', "TUTANOTA_MODEL_VERSION", '"80"'
it.buildConfigField 'String', 'RES_ADDRESS', '"tutanota"'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package de.tutao.tutanota.alarms
import android.util.Log
import de.tutao.tutanota.*
import de.tutao.tutanota.push.LocalNotificationsFacade
import de.tutao.tutasdk.ByRule
import de.tutao.tutashared.AndroidNativeCryptoFacade
import de.tutao.tutashared.CryptoError
import de.tutao.tutashared.OperationType
Expand Down Expand Up @@ -185,7 +186,6 @@ class AlarmNotificationsManager(
alarmNotification: EncryptedAlarmNotification,
pushKeyResolver: PushKeyResolver,
) {

// The DELETE notification we receive from the server has only placeholder fields and no keys. We must use our saved alarm to cancel notifications.
val savedAlarmNotification = sseStorage.readAlarmNotifications().find {
it.alarmInfo.identifier == alarmNotification.alarmInfo.identifier
Expand Down Expand Up @@ -243,10 +243,12 @@ class AlarmNotificationsManager(
val endValue = repeatRule.endValue
val excludedDates = repeatRule.excludedDates
val alarmTrigger: AlarmInterval = alarmNotification.alarmInfo.trigger
val byRules: List<ByRule> = alarmNotification.repeatRule?.advancedRules ?: listOf()

AlarmModel.iterateAlarmOccurrences(
Date(),
timeZone, eventStart, eventEnd, frequency, interval, endType,
endValue, alarmTrigger, TimeZone.getDefault(), excludedDates, callback
endValue, alarmTrigger, TimeZone.getDefault(), excludedDates, byRules, callback
)
}

Expand Down
16 changes: 13 additions & 3 deletions app-android/app/src/test/java/de/tutao/tutanota/AlarmModelTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AlarmModelTest {
val eventStart = getDate(timeZone, 2019, 4, 2, 12, 0)
iterateAlarmOccurrences(
now, timeZone, eventStart, eventStart, RepeatPeriod.WEEKLY,
1, EndType.NEVER, 0, AlarmInterval(AlarmIntervalUnit.HOUR, 1), timeZone, emptyList()
1, EndType.NEVER, 0, AlarmInterval(AlarmIntervalUnit.HOUR, 1), timeZone, emptyList(), emptyList()
) { time: Date, _: Int, _: Date? -> occurrences.add(time) }
Assert.assertArrayEquals(
listOf(
Expand All @@ -45,8 +45,18 @@ class AlarmModelTest {
val eventEnd = getAllDayDateUTC(getDate(timeZone, 2019, 4, 3, 0, 0), timeZone)
val repeatEnd = getAllDayDateUTC(getDate(timeZone, 2019, 4, 4, 0, 0), timeZone)
iterateAlarmOccurrences(
now, repeatTimeZone, eventStart, eventEnd, RepeatPeriod.DAILY,
1, EndType.UNTIL, repeatEnd.time, AlarmInterval(AlarmIntervalUnit.DAY, 1), timeZone, emptyList()
now,
repeatTimeZone,
eventStart,
eventEnd,
RepeatPeriod.DAILY,
1,
EndType.UNTIL,
repeatEnd.time,
AlarmInterval(AlarmIntervalUnit.DAY, 1),
timeZone,
emptyList(),
emptyList()
) { time: Date, _: Int, _: Date? -> occurrences.add(time) }
val expected = listOf( // Event on 2nd, alarm on 1st
getDate(timeZone, 2019, 4, 1, 0, 0), // Event on 3rd, alarm on 2d
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,15 @@ class AlarmNotificationsManagerTest {
val repeatingAlarmIdentifier = "repeatingAlarmIdentifier"
val alarmNotification = createEncryptedAlarmNotification(userId, singleAlarmIdentifier, null, null)
val repeatRule =
EncryptedRepeatRule("1", "1", "Europe/Berlin", EndType.COUNT.ordinal.toString(), "2", emptyList())
EncryptedRepeatRule(
"1",
"1",
"Europe/Berlin",
EndType.COUNT.ordinal.toString(),
"2",
emptyList(),
emptyList()
)
val repeatingAlarmNotification = createEncryptedAlarmNotification(
userId, repeatingAlarmIdentifier, null, repeatRule
)
Expand Down Expand Up @@ -126,7 +134,15 @@ class AlarmNotificationsManagerTest {
val identifier = "notTooFarR"
val startDate = Date(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(1))
val repeatRule =
EncryptedRepeatRule(RepeatPeriod.WEEKLY.value().toString(), "1", "Europe/Berlin", "0", "0", emptyList())
EncryptedRepeatRule(
RepeatPeriod.WEEKLY.value().toString(),
"1",
"Europe/Berlin",
"0",
"0",
emptyList(),
emptyList()
)
val alarmNotification = createEncryptedAlarmNotification(userId, identifier, startDate, repeatRule)
manager.scheduleNewAlarms(listOf(alarmNotification))

Expand Down
4 changes: 2 additions & 2 deletions app-android/calendar/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ android {
"\"" + it.manifestPlaceholders["contentProviderAuthority"] + "\""
)
// keep in sync with src/native/main/NativePushServiceApp.ts
it.buildConfigField("String", "SYS_MODEL_VERSION", "\"99\"")
it.buildConfigField("String", "TUTANOTA_MODEL_VERSION", "\"73\"")
it.buildConfigField("String", "SYS_MODEL_VERSION", "\"118\"")
it.buildConfigField("String", "TUTANOTA_MODEL_VERSION", "\"80\"")
it.buildConfigField("String", "RES_ADDRESS", "\"tutanota\"")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package de.tutao.calendar.alarms
import android.util.Log
import de.tutao.calendar.*
import de.tutao.calendar.push.LocalNotificationsFacade
import de.tutao.tutasdk.ByRule
import de.tutao.tutashared.AndroidNativeCryptoFacade
import de.tutao.tutashared.CryptoError
import de.tutao.tutashared.OperationType
Expand Down Expand Up @@ -229,10 +230,12 @@ class AlarmNotificationsManager(
val endValue = repeatRule.endValue
val excludedDates = repeatRule.excludedDates
val alarmTrigger: AlarmInterval = alarmNotification.alarmInfo.trigger
val byRules: List<ByRule> = alarmNotification.repeatRule?.advancedRules ?: listOf()

AlarmModel.iterateAlarmOccurrences(
Date(),
timeZone, eventStart, eventEnd, frequency, interval, endType,
endValue, alarmTrigger, TimeZone.getDefault(), excludedDates, callback
endValue, alarmTrigger, TimeZone.getDefault(), excludedDates, byRules, callback
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.util.Log
import de.tutao.calendar.BuildConfig
import java.util.Date


Expand All @@ -17,7 +18,12 @@ class SystemAlarmFacade(private val context: Context) {
eventDate: Date,
user: String
) {
Log.d(TAG, "Scheduled notification $identifier")
if (BuildConfig.DEBUG) {
Log.d(TAG, "Scheduled notification $identifier at $alarmTime")
} else {
Log.d(TAG, "Scheduled notification $identifier")
}

val alarmManager = alarmManager
val pendingIntent = makeAlarmPendingIntent(occurrence, identifier, summary, eventDate, user)
alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, alarmTime.time, pendingIntent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,15 @@ class AlarmNotificationsManagerTest {
val repeatingAlarmIdentifier = "repeatingAlarmIdentifier"
val alarmNotification = createEncryptedAlarmNotification(userId, singleAlarmIdentifier, null, null)
val repeatRule =
EncryptedRepeatRule("1", "1", "Europe/Berlin", EndType.COUNT.ordinal.toString(), "2", emptyList())
EncryptedRepeatRule(
"1",
"1",
"Europe/Berlin",
EndType.COUNT.ordinal.toString(),
"2",
emptyList(),
emptyList()
)
val repeatingAlarmNotification = createEncryptedAlarmNotification(
userId, repeatingAlarmIdentifier, null, repeatRule
)
Expand Down Expand Up @@ -125,7 +133,15 @@ class AlarmNotificationsManagerTest {
val identifier = "notTooFarR"
val startDate = Date(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(1))
val repeatRule =
EncryptedRepeatRule(RepeatPeriod.WEEKLY.value().toString(), "1", "Europe/Berlin", "0", "0", emptyList())
EncryptedRepeatRule(
RepeatPeriod.WEEKLY.value().toString(),
"1",
"Europe/Berlin",
"0",
"0",
emptyList(),
emptyList()
)
val alarmNotification = createEncryptedAlarmNotification(userId, identifier, startDate, repeatRule)
manager.scheduleNewAlarms(listOf(alarmNotification))

Expand Down
Loading