Skip to content

Settings: Edit scan profile info #5793

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

Merged
merged 95 commits into from
Apr 28, 2025
Merged

Settings: Edit scan profile info #5793

merged 95 commits into from
Apr 28, 2025

Conversation

flozia
Copy link
Collaborator

@flozia flozia commented Apr 10, 2025

References:

Jira: MNTOR-1806
Figma: https://www.figma.com/design/2iCgADpFXKOFZTEgCPkQsR/Settings?node-id=597-10052&t=c2UkGyKPdbvneuz5-4

Description

This PR adds a redesign for the /user/settings/edit-info view. US users with plus can see their profile scan info and also edit/add their details from /user/settings/edit-profile. Any changes to the scan profile info should be reflected immediately and will be used with the next monthly scan. Things to note:

  • There are some variants depending on the location and subscription, all of which are included in the settings stories that were added.
  • The updated input error style are not part of this PR.
  • There might be some changes to how we mock Server Actions depending on if we’ll use subpath imports or pass them as props.
  • The redesigned “Edit info” feature is only shipping together with the also redesigned sidebar navigation.
  • There will be a follow-up for admins to trigger manual monthly scans on demand (MNTOR-4297) for QA purposes.

Edit:

Screenshot

Edit info Edit profile
image image

How to test

Locally

  1. Run the migrations: npm run db:migrate
  2. Enable the feature flags: SidebarNavigationRedesign and EditScanProfileDetails
  3. Visit /user/settings/edit-info
  4. You need to be authenticated as a US and have a Plus subscription to be able to edit your profile

Storybook

Checklist (Definition of Done)

  • Localization strings (if needed) have been added.
  • Commits in this PR are minimal and have descriptive commit messages.
  • I've added a unit test to test for potential regressions of this bug.
  • If this PR implements a feature flag or experimentation, I've checked that it still works with the flag both on, and with the flag off.
  • If this PR implements a feature flag or experimentation, the Ship Behind Feature Flag status in Jira has been set
  • Product Owner accepted the User Story (demo of functionality completed) or waived the privilege.
  • All acceptance criteria are met.
  • Jira ticket has been updated (if needed) to match changes made during the development process.
  • Jira ticket has been updated (if needed) with suggestions for QA when this PR is deployed to stage.

Copy link
Collaborator Author

@flozia flozia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the reviews @Vinnl and @codemist!

@Vinnl I’ve addressed the blocking issues as well as most of your comments. The only thing I could spend more time on is resolving the use of act() in the unit tests, but I’d like to move forward with testing and not block the feature on those.

@codemist Happy to pair or elaborate more on anything if you have any open questions. The relevant backend for this has already landed with #5697.

const l10n = useL10n();
const [profileFormData, setProfileFormData] = useState(props.profileData);
const [
_updateProfileActionError,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s frustrating! After bf3825f the data should not get cleared.

const addEmailButton = screen.getByRole("button", {
name: "Add email address",
});
await act(async () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is not the button itself, but the dialog that is getting shown. There are some side effects caused from it and also the input field in there. I’ll follow-up with those, but will move forward to not block the feature on these.

const addEmailButton = screen.getByRole("button", {
name: "Add email address",
});
await act(async () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flozia flozia requested review from codemist and Vinnl April 23, 2025 10:07
@flozia
Copy link
Collaborator Author

flozia commented Apr 24, 2025

@flodolo Re-requesting your review since there have been string changes/additions for error messages in fe941fa.

@flozia flozia requested a review from flodolo April 24, 2025 08:04
Copy link
Collaborator

@flodolo flodolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for the change from deadname

Copy link
Collaborator

@codemist codemist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, up to you if you want to merge this in or wait for Vincent's greenlight since many of the changes were addressing his feedback. Incredible work!

@flozia flozia merged commit 78dd384 into main Apr 28, 2025
17 checks passed
@flozia flozia deleted the mntor-4034 branch April 28, 2025 19:36
Copy link

Cleanup completed - database 'blurts-server-pr-5793' destroyed, cloud run service 'blurts-server-pr-5793' destroyed

@@ -21,6 +21,8 @@ import { ExperimentData } from "../../../../telemetry/generated/nimbus/experimen
import MonitorLogo from "../../images/monitor-logo.svg";
import styles from "./Shell.module.scss";
import { UserAnnouncementWithDetails } from "../../../../db/tables/user_announcements";
import { ToastContainer } from "react-toastify";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we need this in <ShellRedesign> as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having it here is sufficient. The ToastContainer sits outside the code path of the feature flag SidebarNavigationRedesign, which toggles the redesigned shell.

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.

4 participants