Skip to content

Conversation

@macteuts
Copy link
Contributor

@macteuts macteuts commented Apr 2, 2025

No description provided.

@macteuts macteuts self-assigned this Apr 2, 2025
Copy link
Member

@ladislas ladislas left a 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

@macteuts macteuts force-pushed the mathieu/feature/Edit-email-in-App-if-admin branch 3 times, most recently from ced43c3 to 98d7f30 Compare April 7, 2025 10:06
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 7, 2025

@ladislas ladislas requested a review from Copilot April 22, 2025 11:18
Copy link

Copilot AI left a 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

@macteuts macteuts force-pushed the mathieu/feature/Edit-email-in-App-if-admin branch 4 times, most recently from b8a0585 to 8b57a3c Compare June 10, 2025 14:21
@macteuts macteuts force-pushed the mathieu/feature/Edit-email-in-App-if-admin branch from 8b57a3c to 07e1f0c Compare June 11, 2025 14:48
@macteuts macteuts force-pushed the mathieu/feature/Edit-email-in-App-if-admin branch 3 times, most recently from b4e4f76 to 746a277 Compare July 1, 2025 08:04
@macteuts macteuts force-pushed the mathieu/feature/Edit-email-in-App-if-admin branch 4 times, most recently from fe2d4c8 to 9f0cba0 Compare July 9, 2025 15:25
@macteuts macteuts force-pushed the mathieu/feature/Edit-email-in-App-if-admin branch 2 times, most recently from 7a75629 to d19f5de Compare July 17, 2025 17:11
@macteuts macteuts force-pushed the mathieu/feature/Edit-email-in-App-if-admin branch 2 times, most recently from 514c69b to a64fb73 Compare July 23, 2025 16:44
@macteuts macteuts force-pushed the mathieu/feature/Edit-email-in-App-if-admin branch from a64fb73 to f2312ca Compare July 25, 2025 07:31
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
5.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants