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

FEATURE/DUCE-00246 : Username and password in edit user profile page #2267

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

abishekTa-egov
Copy link
Contributor

@abishekTa-egov abishekTa-egov commented Mar 10, 2025

FEATURE/DUCE-00246:Username and password in edit user profile

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced the user profile experience by automatically trimming extra spaces from name and password inputs to prevent validation issues.
  • Documentation
    • Updated release notes to reflect the latest improvements in user profile data handling.
  • New Features
    • Introduced a feature for user profile password trimming to improve input handling and validation.

@abishekTa-egov abishekTa-egov requested a review from a team as a code owner March 10, 2025 11:57
Copy link
Contributor

coderabbitai bot commented Mar 10, 2025

📝 Walkthrough

Walkthrough

This update revises the changelog to add and correct an entry for version 1.8.33 related to user profile password trimming. Additionally, modifications in the UserProfile component ensure that input fields for name and passwords are trimmed before validation and processing.

Changes

File(s) Change Summary
micro-ui/web/.../CHANGELOG.md Added a new changelog entry for version 1.8.33 with feature FEATURE/DUCE-00246 and corrected the previous entry’s identifier from DUCE-0246.
micro-ui/web/.../UserProfile.js Introduced trimming operations for user inputs (name, current, new, and confirm passwords) within the update and validation flows.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant UP as UserProfile Component
  participant TV as Trimming Validator
  participant API as API Service

  U->>UP: Enter profile details
  UP->>TV: Trim name and password fields
  TV-->>UP: Return trimmed values
  UP->>UP: Validate trimmed inputs
  UP->>API: Send updateProfile request with trimmed data
  API-->>UP: Return update result
  UP-->>U: Display profile update status
Loading

Possibly related PRs

Suggested reviewers

  • nipunarora-eGov

Poem

I hopped into code with a spring so light,
Trimming spaces left and right,
A changelog penned new and true,
User profiles shining anew,
CodeRabbit cheers with joyous delight! 🐇✨


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Swathi-eGov Swathi-eGov changed the title FEATURE/DUCE-00246:Username and password in edit user profile FEATURE/DUCE-00246 : Username and password in edit user profile Mar 10, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (2)
micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/UserProfile.js (2)

378-401: 🧹 Nitpick (assertive)

Consider adding trim operation directly at input capture.

While the current implementation trims values before validation and submission, consider also trimming directly when capturing input to provide immediate visual feedback to users.

For example, modify the input handler functions to trim on input:

const setUserName = (value) => {
-  setName(value);
+  setName(value.trim());

  if (!validationConfig?.name?.test(value) || value.length === 0 || value.length > 50) {
    // ...
  }
}

This would provide real-time feedback to users about how their input will be processed.


560-568: 🧹 Nitpick (assertive)

Consider adding trimming on input change for consistency.

To maintain consistency with the trimming operations applied during submission, consider trimming the input value as it's being entered.

value={name}
-onChange={(e) => setUserName(e.target.value)}
+onChange={(e) => setUserName(e.target.value.trim())}

This would help users see exactly how their input will be processed during submission.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bf74b24 and 3e22fd1.

⛔ Files ignored due to path filters (6)
  • micro-ui/web/core/package.json is excluded by !**/*.json
  • micro-ui/web/micro-ui-internals/example/package.json is excluded by !**/*.json
  • micro-ui/web/micro-ui-internals/packages/modules/core/package.json is excluded by !**/*.json
  • micro-ui/web/package.json is excluded by !**/*.json
  • micro-ui/web/sandbox/package.json is excluded by !**/*.json
  • micro-ui/web/workbench/package.json is excluded by !**/*.json
📒 Files selected for processing (2)
  • micro-ui/web/micro-ui-internals/packages/modules/core/CHANGELOG.md (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/UserProfile.js (5 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.js`: check

**/*.js: check

  • micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/UserProfile.js
🪛 markdownlint-cli2 (0.17.2)
micro-ui/web/micro-ui-internals/packages/modules/core/CHANGELOG.md

3-3: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


4-4: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

🔇 Additional comments (7)
micro-ui/web/micro-ui-internals/packages/modules/core/CHANGELOG.md (1)

3-5: LGTM: Changelog entry for DUCE-00246 added correctly.

The addition of the new changelog entry properly documents the userprofile password trimming feature with the correct ticket number format.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

3-3: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


4-4: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/UserProfile.js (6)

224-225: Proper handling of current password input with trimming.

The implementation correctly sets the current password value. This change ensures that any whitespace in the password is properly trimmed before validation.


284-285: Good practice: Added name trimming.

Creating a separate variable for the trimmed name value is a good approach as it clearly separates the raw input from the sanitized value used for validation and submission.


289-290: LGTM: Properly using trimmed name in request data.

Using the trimmed name in the request ensures consistent data storage without leading or trailing whitespace.


296-301: Correctly updated validation to use trimmed name.

The validation logic now properly checks the trimmed name value, which prevents validation errors caused by leading/trailing whitespace.


359-364: Properly persists trimmed name in user info.

The user info is correctly updated with the trimmed name, ensuring consistent user experience across sessions.


368-376: Correctly using trimmed password values.

The implementation properly uses the trimmed password values for password change requests, which improves security by ensuring consistent password handling.

@@ -1,5 +1,8 @@
# Changelog

## [1.8.32] [10-Mar-2025]
Copy link
Contributor

Choose a reason for hiding this comment

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

@abishekTa-egov change the version to 1.8.33

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
micro-ui/web/micro-ui-internals/packages/modules/core/CHANGELOG.md (1)

3-4: 🛠️ Refactor suggestion

Inconsistency in Ticket Identifier and Duplicated Feature Entry
The changelog now includes an entry for version 1.8.33 with ticket ID DUCE-00246 (lines 3–4), while an earlier entry under version 1.8.32 (lines 6–7) still shows ticket ID DUCE-0246 for what appears to be the same feature update (user profile password trimming). This discrepancy creates duplicate and conflicting information for tracking purposes.
Please verify which version and ticket identifier are correct and consider either updating the earlier entry to match or removing the duplicate entry altogether.

Also applies to: 6-7

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

3-3: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


4-4: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3e22fd1 and 8fb157b.

📒 Files selected for processing (1)
  • micro-ui/web/micro-ui-internals/packages/modules/core/CHANGELOG.md (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
micro-ui/web/micro-ui-internals/packages/modules/core/CHANGELOG.md

3-3: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


4-4: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

⏰ Context from checks skipped due to timeout of 10000ms (1)
  • GitHub Check: Analyze (javascript-typescript)

@nipunarora-eGov nipunarora-eGov changed the title FEATURE/DUCE-00246 : Username and password in edit user profile FEATURE/DUCE-00246 : Username and password in edit user profile page Mar 10, 2025
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