-
Notifications
You must be signed in to change notification settings - Fork 31
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
base: develop
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThis 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
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
Possibly related PRs
Suggested reviewers
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
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
⛔ 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] |
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.
@abishekTa-egov change the version to 1.8.33
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.
Actionable comments posted: 1
♻️ Duplicate comments (1)
micro-ui/web/micro-ui-internals/packages/modules/core/CHANGELOG.md (1)
3-4
: 🛠️ Refactor suggestionInconsistency 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
📒 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)
FEATURE/DUCE-00246:Username and password in edit user profile
Summary by CodeRabbit