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

updated forgotpassword screen #1532

Merged
merged 1 commit into from
Oct 16, 2024
Merged

Conversation

Swathi-eGov
Copy link
Contributor

@Swathi-eGov Swathi-eGov commented Oct 16, 2024

Summary by CodeRabbit

  • New Features

    • Enhanced styling for employee login and password management components.
    • Updated input types for mobile number and city fields to improve user experience.
  • Bug Fixes

    • Improved rendering and validation for input fields in the Forgot Password component.
  • Documentation

    • Updated references to the latest versions of CSS stylesheets for improved design consistency.

@Swathi-eGov Swathi-eGov requested a review from a team as a code owner October 16, 2024 10:06
Copy link
Contributor

coderabbitai bot commented Oct 16, 2024

📝 Walkthrough

Walkthrough

The pull request includes updates to multiple files, primarily focusing on modifying stylesheet links and enhancing the styling of the employee login interface. The index.html files have had their stylesheet versions updated for the packages @egovernments/digit-ui-components-css and @egovernments/digit-ui-css. Additionally, the login.scss file features new styles for dropdown elements, while the config.js file alters input types for better rendering. Lastly, the forgotPassword.js component has transitioned to using FormComposerV2 and includes styling adjustments.

Changes

File Change Summary
micro-ui/web/micro-ui-internals/example/public/index.html Updated stylesheet link for @egovernments/digit-ui-components-css from version 0.0.2-beta.37 to 0.0.2-beta.39.
micro-ui/web/public/index.html Updated stylesheet links for @egovernments/digit-ui-css from 1.8.2-beta.41 to 1.8.2-beta.42 and for @egovernments/digit-ui-components-css from 0.0.2-beta.37 to 0.0.2-beta.39.
micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/login.scss Added new styles for dropdowns in .loginCardClassName and .employeeForgotPassword. Adjusted margins and enforced styles with !important. Implemented media queries for responsive design.
micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/config.js Changed input type for mobileNumber from "text" to "mobileNumber" and for city from "custom" to "dropdown".
micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/forgotPassword.js Replaced FormComposer with FormComposerV2. Simplified form configuration for city input and made styling adjustments to headingStyle and added descriptionStyles.

Possibly related PRs

  • bug fixes for sandbox #1439: Updates the stylesheet link for the @egovernments/digit-ui-css package in the index.html file, directly related to the version changes made in the main PR.
  • updated versions #1469: Updates the stylesheet link for the @egovernments/digit-ui-components-css package in the index.html file, reflecting a version change that aligns with the modifications in the main PR.
  • HCMPRE-700, HCMPRE-701 and HCMPRE-741 #1471: Updates the stylesheet links for both @egovernments/digit-ui-css and @egovernments/digit-ui-components-css in the index.html file, indicating a connection to the version changes in the main PR.
  • Mp assumptions #1477: Updates the version of the @egovernments/digit-ui-css stylesheet in both index.html files, consistent with the changes made in the main PR regarding stylesheet versions.

Suggested reviewers

  • jagankumar-egov

🐰 In the code we hop and play,
Styles and links, we change today.
From beta thirty-seven to thirty-nine,
Our UI shines, oh so fine!
With dropdowns bright and inputs new,
A better login just for you! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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 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.

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: 3

🧹 Outside diff range comments (2)
micro-ui/web/micro-ui-internals/example/public/index.html (1)

Line range hint 12-15: Consider cleaning up commented-out stylesheet links

There are two commented-out stylesheet links in the file:

  1. https://unpkg.com/@egovernments/digit-ui-css@1.5.41/dist/index.css
  2. https://unpkg.com/@egovernments/digit-ui-css/dist/index.css

While these are not directly related to the current changes, it might be beneficial to review if these comments are still needed or if they can be removed to keep the code clean.

Would you like me to create a separate issue to track the cleanup of these commented-out lines?

micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/forgotPassword.js (1)

Line range hint 1-124: Overall assessment: UI component upgrade with some areas needing attention

The changes in this file primarily focus on:

  1. Upgrading from FormComposer to FormComposerV2.
  2. Enhancing the city dropdown configuration.
  3. Improving the styling of the form.

These changes appear to be part of a larger UI component update and styling enhancement. The transition to FormComposerV2 is consistent and well-implemented.

However, there are a few areas that need attention:

  1. Verify that the transition to FormComposerV2 is consistent across the entire codebase.
  2. The AI summary mentioned changes to error handling that are not visible in the provided code. This discrepancy needs to be addressed.
  3. Consider implementing the suggested minor improvements for better code consistency and user experience.

Please review these points and make any necessary adjustments before merging.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between 51f8e4d and 18e4c67.

⛔ Files ignored due to path filters (14)
  • micro-ui/web/core/inter-package.json is excluded by !**/*.json
  • 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/package.json is excluded by !**/*.json
  • micro-ui/web/micro-ui-internals/packages/css/package.json is excluded by !**/*.json
  • micro-ui/web/micro-ui-internals/packages/modules/core/package.json is excluded by !**/*.json
  • micro-ui/web/micro-ui-internals/packages/modules/sandbox/package.json is excluded by !**/*.json
  • micro-ui/web/micro-ui-internals/packages/modules/utilities/package.json is excluded by !**/*.json
  • micro-ui/web/micro-ui-internals/packages/modules/workbench/package.json is excluded by !**/*.json
  • micro-ui/web/package.json is excluded by !**/*.json
  • micro-ui/web/sandbox/inter-package.json is excluded by !**/*.json
  • micro-ui/web/sandbox/package.json is excluded by !**/*.json
  • micro-ui/web/workbench/inter-package.json is excluded by !**/*.json
  • micro-ui/web/workbench/package.json is excluded by !**/*.json
📒 Files selected for processing (5)
  • micro-ui/web/micro-ui-internals/example/public/index.html (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/login.scss (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/config.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/forgotPassword.js (4 hunks)
  • micro-ui/web/public/index.html (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/config.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/forgotPassword.js (1)

Pattern **/*.js: check

🔇 Additional comments (8)
micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/config.js (2)

11-11: LGTM: Improved input type for mobile number

Changing the input type from "text" to "mobileNumber" for the mobile number field is a good improvement. This change likely enables better input validation and potentially provides a more suitable keyboard on mobile devices, enhancing the user experience.


17-17: LGTM: Changed city input to dropdown, verify implementation

Changing the city input type from "custom" to "dropdown" is a good improvement for user experience, providing a clear list of cities to choose from. However, ensure that the dropdown implementation is complete and consistent with the rest of the application.

To verify the implementation, please run the following script:

This script will help identify any inconsistencies in the city input implementation across the codebase and verify that the necessary changes have been made to support the new dropdown type.

micro-ui/web/micro-ui-internals/example/public/index.html (2)

Line range hint 1-31: Verify relevance of this change to the PR objectives

The PR title mentions updating the forgotpassword screen, but this file (index.html) doesn't seem directly related to that objective. While updating the CSS package version might indirectly affect the styling of the forgotpassword screen, it's worth confirming if this change is intentional and necessary for the stated PR objective.

Could you please clarify how this CSS version update relates to the forgotpassword screen update mentioned in the PR title? If it's not directly related, consider updating the PR description to include this change for clarity.


17-17: Version update for @egovernments/digit-ui-components-css package

The stylesheet link has been updated to use version 0.0.2-beta.39 of the @egovernments/digit-ui-components-css package, which is an increment from the previous version.

To ensure consistency across the application, please run the following script to check if this is the only occurrence of the package version:

This script will help identify if there are any inconsistencies in the package version across the project.

✅ Verification successful

Version update verified successfully

All instances of @egovernments/digit-ui-components-css are now using version 0.0.2-beta.39. No outdated or inconsistent versions were detected across the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for occurrences of different versions of @egovernments/digit-ui-components-css

# Search for all occurrences of @egovernments/digit-ui-components-css
echo "Occurrences of @egovernments/digit-ui-components-css:"
rg --type html --type javascript --type json "@egovernments/digit-ui-components-css"

# Search for any occurrences of the old version
echo "\nOccurrences of old version (0.0.2-beta.37):"
rg --type html --type javascript --type json "@egovernments/digit-ui-components-css@0.0.2-beta.37"

# Search for any occurrences of versions other than the new one
echo "\nOccurrences of versions other than 0.0.2-beta.39:"
rg --type html --type javascript --type json "@egovernments/digit-ui-components-css@(?!0\.0\.2-beta\.39)"

Length of output: 992


Script:

#!/bin/bash
# Description: Check for occurrences of different versions of @egovernments/digit-ui-components-css

# Search for all occurrences of @egovernments/digit-ui-components-css
echo "Occurrences of @egovernments/digit-ui-components-css:"
rg --type html --type js --type json "@egovernments/digit-ui-components-css"

# Search for any occurrences of the old version
echo -e "\nOccurrences of old version (0.0.2-beta.37):"
rg --type html --type js --type json "@egovernments/digit-ui-components-css@0.0.2-beta.37"

# Search for any occurrences of versions other than the new one using PCRE2 for look-around
echo -e "\nOccurrences of versions other than 0.0.2-beta.39:"
rg --pcre2 --type html --type js --type json "@egovernments/digit-ui-components-css@(?!0\.0\.2-beta\.39)"

Length of output: 938


Script:

#!/bin/bash
# Description: Verify that only version 0.0.2-beta.39 of @egovernments/digit-ui-components-css is used

# Search for all occurrences of @egovernments/digit-ui-components-css
echo "Occurrences of @egovernments/digit-ui-components-css:"
rg --type html --type js --type json "@egovernments/digit-ui-components-css"

# Search for any occurrences of the old version
echo -e "\nOccurrences of old version (0.0.2-beta.37):"
rg --type html --type js --type json "@egovernments/digit-ui-components-css@0.0.2-beta.37"

# Confirm there are no other versions besides 0.0.2-beta.39
echo -e "\nOccurrences of versions other than 0.0.2-beta.39:"
rg --pcre2 --type html --type js --type json "@egovernments/digit-ui-components-css@(?!(0\.0\.2-beta\.39))\d+\.\d+\.\d+-beta\.\d+"

Length of output: 963

micro-ui/web/public/index.html (3)

11-11: LGTM: Components CSS package version update.

The update to @egovernments/digit-ui-components-css@0.0.2-beta.39 appears appropriate. This version jump from beta.37 to beta.39 might indicate more substantial improvements or fixes.

To ensure compatibility and understand the changes, please:

  1. Verify that this new version doesn't introduce any unexpected visual changes.
  2. Check the changelog for any significant updates between beta.37 and beta.39.

Run this script to compare the versions:

#!/bin/bash
# Description: Check if the new CSS version is available and compare its content with the previous version

# Test 1: Verify the new version exists
curl -I https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.39/dist/index.css

# Test 2: Compare the content of the old and new versions
diff <(curl -s https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.37/dist/index.css) <(curl -s https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.39/dist/index.css)

10-11: Verify relevance of CSS updates to forgot password screen changes.

The PR title mentions updating the forgot password screen, but the changes in this file are limited to CSS package version updates. While these updates might be related to styling changes for the forgot password screen, it's not explicitly clear from this file alone.

Please confirm:

  1. Are these CSS updates directly related to the forgot password screen changes?
  2. Are there other files (not provided for review) that contain the main changes for the forgot password screen?

To help verify this, you can run the following script to search for forgot password related changes:

#!/bin/bash
# Description: Search for files with forgot password related changes

# Search for files containing "forgotpassword" or "forgot password" (case insensitive)
rg -i -g '!{package-lock.json,yarn.lock}' 'forgotpassword|forgot password'

10-10: LGTM: CSS package version update.

The update to @egovernments/digit-ui-css@1.8.2-beta.42 seems appropriate. This minor version bump likely includes improvements or bug fixes.

To ensure compatibility, please verify that this new version doesn't introduce any unexpected visual changes:

micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/forgotPassword.js (1)

1-2: Verify compatibility with FormComposerV2

The change from FormComposer to FormComposerV2 suggests an upgrade or refactoring. Please ensure that:

  1. FormComposerV2 is fully compatible with the existing code.
  2. All necessary functionality from FormComposer is available in FormComposerV2.
  3. This change is consistent across the entire codebase.

To check for any remaining usage of FormComposer, run:

@@ -101,7 +90,7 @@ const ForgotPassword = ({ config: propsConfig, t }) => {
<div className="employeeBackbuttonAlign">
<BackLink onClick={() => window.history.back()}/>
</div>
<FormComposer
<FormComposerV2
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Approved: FormComposerV2 integration with enhanced styling

The transition to FormComposerV2 with added styling properties improves the UI. The changes look good overall.

For consistency, consider using template literals for multi-property style objects:

-headingStyle={{ textAlign: "center",fontWeight:"bold",color:"#363636" }}
-descriptionStyles={{color:"#787878",textAlign: "center"}}
+headingStyle={{ textAlign: "center", fontWeight: "bold", color: "#363636" }}
+descriptionStyles={{ color: "#787878", textAlign: "center" }}

This improves readability and maintains a consistent coding style.

Also applies to: 104-105, 110-110

Comment on lines +74 to +76
optionsKey: "name",
required: true,
options: cities,
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Improved city dropdown configuration

The changes to the city input configuration are good:

  • Direct assignment of cities to options simplifies the code.
  • Setting required: true ensures a city is selected.

However, consider adding a default empty option to improve UX:

 populators: {
   name: city.name,
   optionsKey: "name",
   required: true,
   options: cities,
+  defaultOption: { name: "Select a city", code: "" },
 },

This allows for a clear initial state and prompts the user to make a selection.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
optionsKey: "name",
required: true,
options: cities,
optionsKey: "name",
required: true,
options: cities,
defaultOption: { name: "Select a city", code: "" },

Comment on lines +337 to +351
.loginCardClassName{
.digit-dropdown-employee-select-wrap {
.digit-dropdown-options-card{
max-height: 10vmax;
}
}
}

.employeeForgotPassword{
.digit-dropdown-employee-select-wrap {
.digit-dropdown-options-card{
max-height: 10vmax;
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

LGTM! Consider optimizing the duplicate styles.

The addition of max-height for dropdown options in both .loginCardClassName and .employeeForgotPassword is a good improvement for controlling the dropdown size across different screen sizes.

To reduce code duplication, consider creating a shared class or mixin for the dropdown options card style. For example:

@mixin limited-dropdown-height {
  .digit-dropdown-employee-select-wrap {
    .digit-dropdown-options-card {
      max-height: 10vmax;
    }
  }
}

.loginCardClassName {
  @include limited-dropdown-height;
}

.employeeForgotPassword {
  @include limited-dropdown-height;
}

This approach would make it easier to maintain and update the style in the future if needed.

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.

2 participants