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

feat: Mail validation screen #254

Draft
wants to merge 42 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
980ed6a
feat: First try at OtpTextField
LunarX Dec 5, 2024
e5c16b6
feat: Basic structure of the user email validation screen
LunarX Dec 6, 2024
568f676
feat: Import strings
LunarX Dec 6, 2024
ebf0b13
feat: Control spacing between each character
LunarX Dec 10, 2024
b6c3053
refactor: Make it so otp text field always has a "focused" visual cue…
LunarX Dec 10, 2024
c2f0e7a
feat: Add isEnabled to OtpTextField
LunarX Dec 10, 2024
db1c674
feat: Make otp load when a code is entered
LunarX Dec 10, 2024
2225e9c
fix: Correctly filter out forbidden characters
LunarX Dec 10, 2024
95fa100
fix: System contextual menu not displaying at the correct coordinates
LunarX Dec 10, 2024
b2b0b5c
feat: Adapt layout for large screens
LunarX Dec 10, 2024
cbd70db
feat: Make email validation screen scrollable
LunarX Dec 11, 2024
d349dd4
refactor: Regroup layout style choice with its enum
LunarX Dec 11, 2024
682200b
refactor: Extract OtpTextField to its own file
LunarX Dec 11, 2024
04a427f
refactor: Clean the OtpTextField file and add missing doc/preview
LunarX Dec 11, 2024
15b7fa5
feat: Add actions when the topappbar buttons are clicked
LunarX Dec 11, 2024
033861c
refactor: Reorder enum at the end of the file
LunarX Dec 11, 2024
afcce96
refactor: Remove hardcoded values
LunarX Dec 11, 2024
8f531ab
refactor: Move validate user email files to their own package
LunarX Dec 11, 2024
2670b36
feat: Validate email otp code using the correct api route
LunarX Dec 11, 2024
9513e6b
Merge remote-tracking branch 'origin/main' into t3
LunarX Dec 12, 2024
76051d8
fix: Adapt to the new button argument signature
LunarX Dec 12, 2024
8cf9cfa
feat: Add resend email code button timer
LunarX Dec 12, 2024
09b8865
feat: Disable buttons while the code is being verified
LunarX Dec 12, 2024
642f23d
feat: Remove "select all" from the current text toolbar
LunarX Dec 16, 2024
d1ae597
feat: Show snackbar when unknown validation api error occurs
LunarX Dec 16, 2024
0bcbc2d
refactor: Keep logic contained inside the inner ValidateUserEmailScreen
LunarX Dec 16, 2024
b9cff14
Merge remote-tracking branch 'origin/main' into t2
LunarX Dec 16, 2024
838ec11
feat: Take user email as nav arg
LunarX Dec 16, 2024
c6954b0
refactor: Use a data class to pass named parameters to method's lambd…
LunarX Dec 16, 2024
d153401
feat: Extract CodeVerification to its own file
LunarX Dec 16, 2024
c09d04c
refactor: Extract ResendCodeCountDownButton to its own file
LunarX Dec 16, 2024
3c90939
Merge remote-tracking branch 'origin/main' into mail-validation-ui
LunarX Dec 16, 2024
e731a5a
feat: Automatically open email validation screen when catching the as…
LunarX Dec 16, 2024
c627352
feat: Open mail apps when clicking on the associated button
LunarX Dec 17, 2024
0a5806a
refactor: Use a UiState to define the ValidateUserEmailScreen state
LunarX Dec 17, 2024
69f9fdd
refactor: Shorten long lines
LunarX Dec 17, 2024
07fef3a
Merge remote-tracking branch 'origin/main' into mail-validation-ui
LunarX Dec 17, 2024
ec33f4e
feat: Add resend email code api call to the button
LunarX Dec 17, 2024
4a13692
Merge remote-tracking branch 'origin/main' into mail-validation-ui
LunarX Dec 18, 2024
e776e53
feat: Update verifyEmailCode call to new kmp version
LunarX Dec 18, 2024
3084096
Merge remote-tracking branch 'origin/main' into mail-validation-ui
LunarX Dec 18, 2024
40e505e
wip
LunarX Dec 18, 2024
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
Prev Previous commit
Next Next commit
feat: Add resend email code api call to the button
LunarX committed Dec 17, 2024
commit ec33f4e2f0a776c3c4f3df0641876491f158c284
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ package com.infomaniak.swisstransfer.ui.screen.newtransfer.validateemail

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.infomaniak.multiplatform_swisstransfer.managers.UploadManager
import com.infomaniak.multiplatform_swisstransfer.network.exceptions.EmailValidationException
import com.infomaniak.multiplatform_swisstransfer.network.models.upload.request.VerifyEmailCodeBody
import com.infomaniak.multiplatform_swisstransfer.network.repositories.UploadRepository
@@ -33,6 +34,7 @@ import javax.inject.Inject
@HiltViewModel
class ValidateUserEmailViewModel @Inject constructor(
@IoDispatcher private val ioDispatcher: CoroutineDispatcher,
private val uploadManager: UploadManager
) : ViewModel() {

private val uploadRepository: UploadRepository by lazy { UploadRepository() }
@@ -66,7 +68,7 @@ class ValidateUserEmailViewModel @Inject constructor(

fun resendEmailCode(email: String) {
viewModelScope.launch(ioDispatcher) {
// TODO //uploadRepository.resendEmailCode(ResendEmailCodeBody(email, ))
uploadManager.resendEmailCode(email)
}
}