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/profile/edit profile screen UI and tests #108

Merged
merged 18 commits into from
Nov 7, 2024

Conversation

Harrish92
Copy link
Contributor

Title

Description

This PR introduces the UI for EditProfileScreen, adds the option to change the profile image, and implements validation logic for the fields. It also includes tests for these functionalities. It closes issue #88.

Changes

  • Created the UI for EditProfileScreen.
  • Added the option to change the profile image when the add_circle_icon is clicked.
  • Implemented validation logic to check if the name, date of birth, and description fields are filled.
  • Added tests to verify the UI element.

Files

Added

  • app/src/androidTest/java/com/android/periodpals/ui/profile/EditProfileScreenTest.kt

Modified

  • app/src/main/java/com/android/periodpals/ui/profile/EditProfile.kt

Removed

  • None

Dependencies Added

  • None

Testing

  • Verified that the UI elements on the EditProfileScreen are correctly displayed.
  • Ensured that all tests for the EditProfileScreen pass successfully.

Screenshots (if applicable)

- Center GlideImage horizontally in EditProfileScreen
- Adjust padding and layout for better UI alignment
- Update text styles and field arrangements
- Add rounded corners and borders to input fields
- Ensure Save Changes button is centered and styled
- Extract ProfileImage composable
- Extract ProfileTextField composable
- Extract ProfileSection composable
- Add comments for better code understanding
- Maintain existing UI layout and design
- Added UI tests for `EditProfileScreen` to verify UI elements and interactions.
- Implemented field validation to check if name, date of birth, and description fields are filled.
@Harrish92 Harrish92 linked an issue Oct 31, 2024 that may be closed by this pull request
Copy link
Contributor

@francelu francelu left a comment

Choose a reason for hiding this comment

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

Summary

Good initial implementation of the EditProfileScreen. Improvements are needed for consistency and better alignment with the Figma design.

Important

Code Quality

  • Enhance code consistency as noted in the comments.

Functionality

  • Ensure the UI matches the Figma specifications more closely. Check other screens' code for consistency and inspiration.

Testing

  • Review the existing tests to confirm they cover the updated UI and logic. Check other screens' tests for consistency, completeness, and inspiration.

Suggestions

  • Address the changes highlighted in the code and file comments.

Steps before PR approved

  • Implement the changes detailed in the code and file comments to ensure consistency and Figma alignment.

@charliemangano
Copy link
Contributor

Hi @Harrish92! I just merged a PR (#102) that refactors every testTag in a separate file for better maintainability. Can you take a look at how it's done and apply it to your code?

@charliemangano charliemangano added the enhancement New feature or request label Nov 2, 2024
@francelu francelu mentioned this pull request Nov 3, 2024
12 tasks
- Revamped the tests for EditProfile to ensure better coverage and adherence to the testTag convention.
- Improved the layout for better user experience and visual consistency.
- Added a new component to the UI for enhanced functionality.
@Harrish92 Harrish92 requested a review from francelu November 4, 2024 18:16
Copy link
Contributor

@francelu francelu left a comment

Choose a reason for hiding this comment

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

PR Review: EditProfileScreen UI Implementation

Summary:

Overall, great work on implementing the EditProfileScreen UI. The screen aligns well with the provided Figma designs and showcases attention to detail.

Review Notes:

  • A few minor issues need addressing before approval.
  • Refer to in-line code comments for specific suggestions and corrections.

Requested Changes:

  • Address code consistency and formatting issues.
  • Review and implement small optimizations as highlighted in the code comments.

Approval Status:

Pending – please make the suggested adjustments.

Good job so far! Let me know if you need further clarification on any points.

…pdate description input field

- Added tags for sectors to improve testability and organization.
- Refactored tests for better adherence to conventions.
- Changed the profile icon for a suitable look.
- Updated the description input field to be more explicit.
@Harrish92 Harrish92 requested a review from francelu November 5, 2024 10:17
@francelu
Copy link
Contributor

francelu commented Nov 5, 2024

@Harrish92
Hey, I've just noticed you answered to one of my in-line comments. Please check my proposition here :)

I also noticed your code coverage on the new code is 78.2%. Could you try to make it above 80% ? Tell ChatGPT to have at least 80% coverage, maybe it'll help :)
Never mind, line coverage is >90%. All good !

Copy link
Contributor

@francelu francelu left a comment

Choose a reason for hiding this comment

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

A few nitpicks to correct before PR approved for merge. We're almost there !! :)))

- Renamed test functions from saveValid... and saveInvalid... to editValid... and editInvalid... to better reflect their purpose.
- Removed unnecessary toggled comments for cleaner code.
- Ensured no extra spaces after test function declarations for better readability.
- Reordered lines in the same order as the testTags.
- Simplified validation logic for email.
@Harrish92 Harrish92 requested a review from francelu November 5, 2024 22:01
Copy link
Contributor

@francelu francelu left a comment

Choose a reason for hiding this comment

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

PR Review

Summary

Overall, a strong effort. The code mostly adheres to the standards and the Figma design, and the intended functionality is clear.

Important

Code Quality

The code is generally readable and consistent. However, there are a few areas where the naming conventions and spacing can be improved to better align with project guidelines.

Functionality

The feature works as expected, handling most scenarios effectively.

Testing

UI tests appear thorough and well-implemented.

Documentation

No changes are needed to external documentation.

Suggestions

Consider implementing the suggested naming convention changes for better readability and consistency.

Steps before PR Merge

Address the code naming changes as mentioned in the comments.

Copy link
Contributor

@taghizadlaura taghizadlaura left a comment

Choose a reason for hiding this comment

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

Summary

They are only small adjustments to fit the figma (please see comments).

Important

Code Quality

LGTM

Functionality

LGTM

Testing

LGTM please check when you change the code that it doesn't affect the tests.

Documentation

LGTM. There's a lot of comments which strongly contribute to the understanding of the code.

Steps before PR approved

Please read the comments to fit more to the figma

- Set `fillMaxWidth` to name, email, and dob for `OutlineFieldText`.
- Removed the background color for the save button.
- Removed the `HorizontalDivider`.
- Resized profile image profile to 190.dp.
- Renamed button to "Save".
Copy link
Contributor

@taghizadlaura taghizadlaura left a comment

Choose a reason for hiding this comment

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

Please also remove the color of the button.

Copy link

sonarqubecloud bot commented Nov 7, 2024

Copy link
Contributor

@taghizadlaura taghizadlaura left a comment

Choose a reason for hiding this comment

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

LGTM now :)

@Harrish92 Harrish92 merged commit 8f7b780 into main Nov 7, 2024
3 checks passed
@Harrish92 Harrish92 deleted the feat/profile/editProfileScreen-ui-and-tests branch November 7, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement EditProfileScreen UI and tests
4 participants