-
Notifications
You must be signed in to change notification settings - Fork 0
mathieu/feature/Edit email in App if admin #1803
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
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job! 👍 I've added some requests to the review
Modules/AccountKit/Sources/Managers/Caregivers/CaregiverManager.swift
Outdated
Show resolved
Hide resolved
ced43c3 to
98d7f30
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces changes to support editing emails in the App, with added logic for handling admin caregivers and verifying email changes. Key changes include:
- Adding an isAdmin property to the Caregiver model and updating its initialization and JSON coding keys.
- Implementing new email update logic in AuthManager with email verification before changing the email.
- Adding new views (ChangeEmailView and EnterNewEmailView) and updating SettingsView to allow email re-authentication and change for admin caregivers, along with corresponding localization updates.
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Modules/AccountKit/Sources/Models/CaregiverModel/Caregiver.swift | Added optional isAdmin property with default false and updated CodingKeys. |
| Modules/AccountKit/Sources/Models/CaregiverModel/Caregiver+Init.swift | Extended initializer to include isAdmin, and assigned it accordingly. |
| Modules/AccountKit/Sources/Managers/Caregivers/CaregiverManager.swift | Updated caregiver data payload and added delete-caregiver logic to prevent admin deletion. |
| Modules/AccountKit/Sources/Authentication/AuthManager.swift | Added email verification logic before updating email and new user action state. |
| Apps/LekaApp/Sources/Views/Settings/SettingsView.swift | Introduced a ChangeEmailView button displayed conditionally for admin caregivers. |
| Apps/LekaApp/Sources/Views/Settings/SettingsView+l10n.swift | Added localization for the Change Email button label. |
| Apps/LekaApp/Sources/Views/EnterNewEmailView.swift | Implemented a new view for entering a new email address with email verification trigger. |
| Apps/LekaApp/Sources/Views/EnterNewEmailView+l10n.swift | Added localization strings for the EnterNewEmailView. |
| Apps/LekaApp/Sources/Views/ChangeEmailView.swift | Implemented a view for confirming email change via password re-authentication. |
| Apps/LekaApp/Sources/Views/ChangeEmailView+l10n.swift | Added localization strings for the ChangeEmailView. |
Files not reviewed (1)
- Apps/LekaApp/Resources/l10n/Localizable.xcstrings: Language not supported
Comments suppressed due to low confidence (1)
Modules/AccountKit/Sources/Models/CaregiverModel/Caregiver.swift:27
- [nitpick] Consider making 'isAdmin' a non-optional Bool instead of Bool? since it always defaults to false, which could simplify the code by removing the need for optional unwrapping.
public var isAdmin: Bool? = false
b8a0585 to
8b57a3c
Compare
8b57a3c to
07e1f0c
Compare
b4e4f76 to
746a277
Compare
fe2d4c8 to
9f0cba0
Compare
7a75629 to
d19f5de
Compare
514c69b to
a64fb73
Compare
a64fb73 to
f2312ca
Compare
|





No description provided.