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

Fixes: The Login and Organization Screens #3309

Merged

Conversation

prathmesh703
Copy link
Contributor

@prathmesh703 prathmesh703 commented Jan 18, 2025

What kind of change does this PR introduce?

UI changes in Login and Organization Screens

Issue Number:

Fixes #3169

Snapshots/Videos:
Screenshot 2025-01-18 132645
Screenshot 2025-01-18 132635

Screen.Recording.2025-01-18.093827.mp4
Screen.Recording.2025-01-18.093931.mp4
Screen.Recording.2025-01-18.094302.mp4

If relevant, did you update the documentation?

NO

Does this PR introduce a breaking change?

NO

Checklist

CodeRabbit AI Review

  • I have reviewed and addressed all critical issues flagged by CodeRabbit AI
  • I have implemented or provided justification for each non-critical suggestion
  • I have documented my reasoning in the PR comments where CodeRabbit AI suggestions were not implemented

Test Coverage

  • I have written tests for all new changes/features
  • I have verified that test coverage meets or exceeds 95%
  • I have run the test suite locally and all tests pass

Other information

The Changes in the ui are made according to the Figma file provided

Have you read the contributing guide?

Yes

Summary by CodeRabbit

Based on the comprehensive summary of changes, here are the release notes:

Release Notes

  • New Features

    • Added a new styling approach using centralized CSS module
    • Enhanced profile dropdown functionality across multiple components
  • Styling Updates

    • Introduced new CSS variables for consistent theming
    • Refined button and component styles across the application
    • Improved responsive design for organization cards and sidebars
  • Component Refinements

    • Updated layout for organization and user-related components
    • Simplified navigation and sidebar interactions
    • Removed redundant CSS files in favor of a centralized styling approach
  • Performance

    • Streamlined CSS imports and styling management
  • Bug Fixes

    • Corrected minor typographical errors in labels
    • Improved autofill styling for input fields

Copy link
Contributor

coderabbitai bot commented Jan 18, 2025

Warning

Rate limit exceeded

@prathmesh703 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 45 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 739757f and 59e96a7.

📒 Files selected for processing (1)
  • src/style/app.module.css (22 hunks)

Walkthrough

This pull request focuses on consolidating CSS styles across multiple components into a single CSS module (src/style/app.module.css), removing individual CSS files, and standardizing the visual design to align more closely with the Figma style guide. The changes involve updating color schemes, introducing CSS variables, modifying button and input styles, and ensuring a consistent user interface across different screens and components.

Changes

File Change Summary
src/assets/css/app.css Added CSS rule for autofilled input fields to ensure white background
src/components/LeftDrawer/LeftDrawer.tsx Updated styling and added ProfileDropdown component
src/components/LoginPortalToggle/LoginPortalToggle.module.css Updated color variables and hover effects
Multiple components Removed individual CSS module files and migrated styles to src/style/app.module.css
src/style/app.module.css Significant expansion of CSS variables and styling rules

Assessment against linked issues

Objective Addressed Explanation
Conform to Figma style guide
Consolidate CSS into src/style/app.module.css
Use descriptive variable names Variables now describe color function
Remove HTML color codes Color codes now centralized in app.module.css
Buttons have shadows only on hover

Possibly related issues

Possibly related PRs

Suggested Labels

ui-refactor, style-guide, css-consolidation

Suggested Reviewers

  • palisadoes
  • design-team-lead
  • frontend-architect

Poem

🐰 CSS Rabbit's Rhyme 🎨

In lines of code, a style so bright,
Variables dancing with pure delight,
From scattered styles to one module's might,
We've styled the web with rabbit's insight!

Hop, hop, hurray! The design takes flight! 🚀


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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

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

Our Pull Request Approval Process

Thanks for contributing!

Testing Your Code

Remember, your PRs won't be reviewed until these criteria are met:

  1. We don't merge PRs with poor code quality.
    1. Follow coding best practices such that CodeRabbit.ai approves your PR.
  2. We don't merge PRs with failed tests.
    1. When tests fail, click on the Details link to learn more.
    2. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
    3. Tests may fail if you edit sensitive files. Ask to add the ignore-sensitive-files-pr label if the edits are necessary.
  3. We cannot merge PRs with conflicting files. These must be fixed.

Our policies make our code better.

Reviewers

Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

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

🧹 Nitpick comments (7)
src/components/UserPortal/UserSidebar/UserSidebar.tsx (1)

87-90: Simplify boolean comparisons in conditional expressions.

The explicit comparison with true is redundant and can be simplified.

-                        isActive === true
+                        isActive
-                            isActive === true
+                            isActive
-                            isActive === true
+                            isActive

Also applies to: 115-118, 145-148

src/components/LeftDrawer/LeftDrawer.tsx (1)

72-77: Consider extracting shared button styles to a common class.

The same styling patterns are repeated across multiple buttons. Consider extracting these to a shared class to improve maintainability.

+// Add to your CSS module
+.navButton {
+  &.active {
+    background-color: #EAEBEF;
+    color: var(--bs-black);
+    font-weight: bold;
+  }
+  &:not(.active) {
+    color: var(--bs-secondary);
+  }
+}

-className={` ${
-  isActive === true
-    ? 'text-black font-weight-bold'
-    : 'text-secondary'
-}`}
+className={`${styles.navButton} ${isActive ? 'active' : ''}`}

Also applies to: 102-107, 130-135

src/components/LoginPortalToggle/LoginPortalToggle.module.css (1)

9-16: Consider adding transition property for smooth color changes

The background and border color changes would benefit from a smooth transition effect.

 .navLinkClass {
+  transition: background-color 0.2s ease, border-color 0.2s ease;
   color: var(--brown-color);
   border-radius: 0.3rem;
   width: 100%;
   box-sizing: border-box;
   border: 1px solid var(--grey-light);
   font-weight: 500;
-  transition: all 0.25s ease;
   background-color: var(--grey-light);
 }
src/components/ProfileDropdown/ProfileDropdown.module.css (1)

10-12: Consider adding max-width constraint

The .profilebutton class with width: 100% might stretch too wide on larger screens.

 .profilebutton {
   width: 100%;
+  max-width: 300px;
 }
src/components/OrgListCard/OrgListCard.module.css (1)

87-88: Consider adding gap property for flex layout

The flex layout would benefit from proper spacing between items.

 .orgadmin {
   font-size: 0.9rem;
   display: flex;
   flex-direction: column;
+  gap: 0.5rem;
 }
src/assets/css/app.css (2)

3256-3260: Consider improving autofill input styles for better theme support.

The current implementation forces white backgrounds on autofilled inputs which may not work well with dark themes. Consider these improvements:

 input:-webkit-autofill {
-  background-color: white !important;
-  -webkit-box-shadow: 0 0 0px 1000px white inset !important;
-  -webkit-text-fill-color: initial !important;
+  background-color: var(--bs-body-bg) !important;
+  -webkit-box-shadow: 0 0 0px 1000px var(--bs-body-bg) inset !important;
+  -webkit-text-fill-color: var(--bs-body-color) !important;
 }

This change:

  • Uses theme variables for better dark mode support
  • Maintains consistency with the app's color scheme
  • Still preserves the functionality of overriding browser defaults

Line range hint 1-3500: Consider splitting vendor and custom styles for better maintainability.

The current approach of combining Bootstrap and custom styles in a single file could lead to maintenance challenges:

  1. Consider separating the styles into:

    • vendor.css (Bootstrap)
    • custom.css (Talawa-specific styles)
  2. Benefits:

    • Easier Bootstrap version updates
    • Better separation of concerns
    • Improved caching strategy
    • Reduced risk of style conflicts
  3. Implementation approach:

    • Use package manager for Bootstrap CSS
    • Create separate file for custom overrides
    • Use proper import order in your build system
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 81e0755 and 589d798.

⛔ Files ignored due to path filters (1)
  • public/images/svg/angleRight.svg is excluded by !**/*.svg
📒 Files selected for processing (19)
  • src/assets/css/app.css (1 hunks)
  • src/components/LeftDrawer/LeftDrawer.tsx (2 hunks)
  • src/components/LoginPortalToggle/LoginPortalToggle.module.css (1 hunks)
  • src/components/OrgListCard/OrgListCard.module.css (3 hunks)
  • src/components/OrgListCard/OrgListCard.tsx (1 hunks)
  • src/components/ProfileDropdown/ProfileDropdown.module.css (2 hunks)
  • src/components/ProfileDropdown/ProfileDropdown.tsx (1 hunks)
  • src/components/SuperAdminScreen/SuperAdminScreen.module.css (4 hunks)
  • src/components/SuperAdminScreen/SuperAdminScreen.tsx (0 hunks)
  • src/components/UserPortal/OrganizationCard/OrganizationCard.module.css (2 hunks)
  • src/components/UserPortal/OrganizationCard/OrganizationCard.tsx (1 hunks)
  • src/components/UserPortal/UserSidebar/UserSidebar.module.css (2 hunks)
  • src/components/UserPortal/UserSidebar/UserSidebar.tsx (2 hunks)
  • src/screens/ForgotPassword/ForgotPassword.tsx (1 hunks)
  • src/screens/LoginPage/LoginPage.tsx (6 hunks)
  • src/screens/OrgList/OrgList.tsx (1 hunks)
  • src/screens/UserPortal/Organizations/Organizations.module.css (5 hunks)
  • src/screens/UserPortal/Organizations/Organizations.tsx (2 hunks)
  • src/style/app.module.css (19 hunks)
💤 Files with no reviewable changes (1)
  • src/components/SuperAdminScreen/SuperAdminScreen.tsx
✅ Files skipped from review due to trivial changes (4)
  • src/components/UserPortal/OrganizationCard/OrganizationCard.tsx
  • src/screens/OrgList/OrgList.tsx
  • src/components/ProfileDropdown/ProfileDropdown.tsx
  • src/screens/ForgotPassword/ForgotPassword.tsx
🧰 Additional context used
🪛 GitHub Actions: PR Workflow
src/screens/UserPortal/Organizations/Organizations.tsx

[error] Contains code coverage disable statement. Please remove it and add the appropriate tests.

🪛 Biome (1.9.4)
src/style/app.module.css

[error] 68-68: Unexpected value or character.

Expected one of:

(parse)

🔇 Additional comments (15)
src/screens/LoginPage/LoginPage.tsx (2)

604-604: Consistent button styling implementation!

Good job on maintaining consistency by using the styles.email_button class across all icon buttons.

Also applies to: 635-635, 787-787


864-864: Well-structured button styling!

Good implementation of button styling using CSS modules and proper class combination using template literals.

Also applies to: 878-878

src/components/OrgListCard/OrgListCard.tsx (1)

115-120: LGTM! Improved layout structure for admin and member counts.

The separation of admin and member counts into distinct divs enhances readability while maintaining proper semantic structure.

src/components/UserPortal/UserSidebar/UserSidebar.tsx (1)

65-67: LGTM! Improved layout structure with flex container.

The new flex container with leftbarcompheight class ensures proper spacing and alignment of sidebar elements.

src/components/LeftDrawer/LeftDrawer.tsx (1)

67-67: LGTM! Consistent layout structure with UserSidebar.

The implementation maintains consistency with UserSidebar component, properly positioning the ProfileDropdown at the bottom.

Also applies to: 158-160

src/screens/UserPortal/Organizations/Organizations.tsx (2)

387-417: LGTM! Improved responsive layout with grid system.

The new grid layout using Bootstrap's row and col-md-6 classes provides better responsiveness for organization cards.

🧰 Tools
🪛 GitHub Actions: PR Workflow

[error] Contains code coverage disable statement. Please remove it and add the appropriate tests.


393-394: ⚠️ Potential issue

Remove code coverage disable statement and add tests.

The istanbul ignore next comment is causing pipeline failures. Instead of ignoring this condition, add appropriate tests to cover this case.

🧰 Tools
🪛 GitHub Actions: PR Workflow

[error] Contains code coverage disable statement. Please remove it and add the appropriate tests.

src/components/LoginPortalToggle/LoginPortalToggle.module.css (1)

20-22: Verify hover state color contrast ratios

Please ensure that the hover state colors maintain sufficient contrast ratios for accessibility.

Also applies to: 32-35

✅ Verification successful

Color contrast ratios are sufficient for hover states

The hover state color combinations provide adequate contrast for accessibility:

  • Text color (#555555) on light gray background (#eaebef)
  • Text color (#555555) on light blue background (#a8c7fa)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for CSS variable definitions to verify color values
rg -l "(:root|^[^/].*{)" --type css | xargs cat | grep -A 10 "(:root|^[^/].*{)" | grep -E "(--brown-color|--light-blue|--grey-light)"

Length of output: 249


Script:

#!/bin/bash
# Search for CSS root variables
echo "=== CSS Variables ==="
rg --type css ":root" -A 10

echo -e "\n=== Complete LoginPortalToggle.module.css ==="
cat src/components/LoginPortalToggle/LoginPortalToggle.module.css

echo -e "\n=== Hover States ==="
rg --type css ":hover" -B 2 -A 2

Length of output: 51293


Script:

#!/bin/bash
# Search for brown-color and light-blue variable definitions
echo "=== Color Variable Definitions ==="
rg --type css "(--brown-color|--light-blue)\s*:" -B 1 -A 1

echo -e "\n=== All CSS files that might contain these variables ==="
fd -e css -e scss | xargs grep -l "brown-color\|light-blue"

Length of output: 941

src/screens/UserPortal/Organizations/Organizations.module.css (1)

114-115: LGTM: Good use of max-width constraint

The max-width constraint helps maintain readability on larger screens.

src/style/app.module.css (4)

60-61: LGTM! New background color variables and hover shadow effect.

The new CSS variables for backgrounds and hover effects are well-defined and follow consistent naming conventions.

Also applies to: 85-87


Line range hint 2989-3097: LGTM! Enhanced login screen button styles.

The changes improve visual feedback through:

  • Consistent hover effects using the new --hover-shadow variable
  • Clear color transitions for better user interaction
  • Proper use of CSS variables for maintainability

Line range hint 2038-2170: LGTM! Enhanced organization screen styles.

The changes improve the organization screen through:

  • Better layout with flex container and proper spacing
  • Consistent styling for create organization dropdown
  • Enhanced hover effects using the new shadow variable

Line range hint 4019-4029: LGTM! Improved responsive design and performance.

Good improvements for mobile experience:

  • Proper overflow handling with overscroll-behavior
  • Touch scrolling optimization with -webkit-overflow-scrolling
  • Will-change property for better performance
src/components/UserPortal/OrganizationCard/OrganizationCard.module.css (1)

52-56: LGTM! Enhanced organization card styles.

Good improvements:

  • Consistent use of color variables for joined button
  • Better layout for admin section with flex display
  • Proper spacing with gap property

Also applies to: 91-94

src/components/UserPortal/UserSidebar/UserSidebar.module.css (1)

3-3: LGTM! Enhanced sidebar styles.

Good improvements:

  • Consistent use of profile background color
  • Enhanced hover effects with shadow
  • Better height management with flex layout

Also applies to: 59-63, 64-69

src/screens/LoginPage/LoginPage.tsx Outdated Show resolved Hide resolved
src/components/ProfileDropdown/ProfileDropdown.module.css Outdated Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
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

🧹 Nitpick comments (3)
src/style/app.module.css (2)

3006-3021: Consider using CSS variables for all color values

While the hover states are consistent, some color values are hardcoded. Consider extracting these to CSS variables for better maintainability:

.langChangeBtnStyle {
-  background-color: transparent;
+  background-color: var(--transparent-bg, transparent);
}

.langChangeBtnStyle:hover {
-  background-color: var(--light-blue) !important;
+  background-color: var(--hover-bg, var(--light-blue)) !important;
}

2040-2041: Improve responsive layout consistency

The width property could be more flexible for better responsiveness. Consider using a relative unit:

.btnsContainerOrgList {
-  width: 100%;
+  width: clamp(300px, 100%, 1200px);
}
src/components/ProfileDropdown/ProfileDropdown.module.css (1)

8-8: Consider adding hover and focus states

The profile container could benefit from interactive states for better user experience:

.profileContainer {
  background-color: var(--profile-bg) !important;
+  transition: transform 0.2s ease;
}

+.profileContainer:hover {
+  transform: translateY(-1px);
+  box-shadow: var(--hover-shadow);
+}

+.profileContainer:focus-visible {
+  outline: 3px solid var(--focus-outline-color);
+  outline-offset: 2px;
+}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 589d798 and 34c77fe.

📒 Files selected for processing (9)
  • src/components/LeftDrawer/LeftDrawer.spec.tsx (2 hunks)
  • src/components/ProfileDropdown/ProfileDropdown.module.css (2 hunks)
  • src/components/SuperAdminScreen/SuperAdminScreen.module.css (4 hunks)
  • src/components/UserPortal/UserSidebar/UserSidebar.spec.tsx (1 hunks)
  • src/components/UserPortal/UserSidebar/UserSidebar.tsx (2 hunks)
  • src/screens/LoginPage/LoginPage.tsx (5 hunks)
  • src/screens/UserPortal/Organizations/Organizations.module.css (5 hunks)
  • src/screens/UserPortal/Organizations/Organizations.tsx (2 hunks)
  • src/style/app.module.css (20 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/components/SuperAdminScreen/SuperAdminScreen.module.css
  • src/components/UserPortal/UserSidebar/UserSidebar.tsx
  • src/screens/UserPortal/Organizations/Organizations.tsx
  • src/screens/LoginPage/LoginPage.tsx
  • src/screens/UserPortal/Organizations/Organizations.module.css
🧰 Additional context used
📓 Learnings (1)
src/components/LeftDrawer/LeftDrawer.spec.tsx (1)
Learnt from: Doraemon012
PR: PalisadoesFoundation/talawa-admin#1988
File: src/components/LeftDrawerOrg/LeftDrawerOrg.test.tsx:282-282
Timestamp: 2024-11-12T10:40:58.654Z
Learning: In the test 'Component should be rendered properly' within 'Testing LeftDrawerOrg component for SUPERADMIN', setting 'SuperAdmin' to false is intentional.
🔇 Additional comments (4)
src/components/LeftDrawer/LeftDrawer.spec.tsx (1)

97-97: LGTM! Consistent test updates for button styling.

The test assertions have been properly updated to reflect the new active state styling with font-weight-bold class for both SUPERADMIN and ADMIN roles.

Also applies to: 211-211

src/components/UserPortal/UserSidebar/UserSidebar.spec.tsx (1)

465-469: Verify the text color change from white to black.

The test assertions have been updated to expect:

  1. Addition of font-weight-bold class
  2. Change of text color from text-white to text-black

While the font weight change is consistent with other components, please confirm if changing the text color from white to black is intentional and aligns with the Figma design specifications mentioned in the PR description.

src/style/app.module.css (1)

60-61: Well-structured CSS variable additions!

The new CSS variables for backgrounds (--profile-bg, --screen-bg) and hover effects (--hover-shadow) improve theming consistency and maintainability.

Also applies to: 87-89

src/components/ProfileDropdown/ProfileDropdown.module.css (1)

10-12: LGTM: New profilebutton class

The new profilebutton class with full width improves layout consistency.

src/style/app.module.css Outdated Show resolved Hide resolved
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 18, 2025
@palisadoes
Copy link
Contributor

Please fix the failing tests

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 18, 2025
Copy link

codecov bot commented Jan 18, 2025

Codecov Report

Attention: Patch coverage is 97.14286% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.77%. Comparing base (a32533b) to head (59e96a7).
Report is 3 commits behind head on develop-postgres.

Files with missing lines Patch % Lines
...screens/UserPortal/Organizations/Organizations.tsx 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##           develop-postgres    #3309       +/-   ##
=====================================================
+ Coverage              7.95%   89.77%   +81.81%     
=====================================================
  Files                   312      335       +23     
  Lines                  8109     8623      +514     
  Branches               1803     1908      +105     
=====================================================
+ Hits                    645     7741     +7096     
+ Misses                 7397      624     -6773     
- Partials                 67      258      +191     
Flag Coverage Δ
combined 89.77% <97.14%> (?)
vitest 89.77% <97.14%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@prathmesh703
Copy link
Contributor Author

prathmesh703 commented Jan 18, 2025

@palisadoes test acceptable code coverage is failing but most of the files which the test is showing are not changed .

@palisadoes
Copy link
Contributor

I've updated the threshold. Please make a minor commit to restart the workflow

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 18, 2025
Copy link
Contributor

@palisadoes palisadoes left a comment

Choose a reason for hiding this comment

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

Many change requests, but they will make the overall app experience better.

src/components/LeftDrawer/LeftDrawer.tsx Outdated Show resolved Hide resolved
src/components/LeftDrawer/LeftDrawer.tsx Outdated Show resolved Hide resolved
src/components/LeftDrawer/LeftDrawer.tsx Outdated Show resolved Hide resolved
src/components/LeftDrawer/LeftDrawer.tsx Outdated Show resolved Hide resolved
src/components/UserPortal/UserSidebar/UserSidebar.tsx Outdated Show resolved Hide resolved
src/components/UserPortal/UserSidebar/UserSidebar.tsx Outdated Show resolved Hide resolved
src/components/LeftDrawer/LeftDrawer.tsx Show resolved Hide resolved
src/components/OrgListCard/OrgListCard.tsx Show resolved Hide resolved
src/screens/ForgotPassword/ForgotPassword.tsx Show resolved Hide resolved
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

🧹 Nitpick comments (8)
src/style/app.module.css (4)

60-74: Consider reusing existing color variables for consistency.

Several new color variables are defined with hardcoded values that could reference existing color variables:

  • --sidebar-icon-stroke-inactive: #808080 could use --gray-white
  • --sidebar-option-text-inactive: #808080 could use --gray-white
  • --forgot-password-fill: #555555 could use --brown-color

103-104: Reuse existing color variables for search-related styles.

Consider using existing color variables for consistency:

  • --search-button-border: #555555 could use --brown-color
  • --search-outline: #555555 could use --brown-color

Line range hint 495-515: Enhance visual feedback for button states.

While the hover effects are well implemented, consider improving the active state feedback:

  1. Add a scale transform for better click feedback
  2. Adjust the shadow for pressed state
.searchButton:active {
+  transform: scale(0.98);
  background-color: var(--search-button-bg) !important;
  border-color: transparent !important;
+  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
}

6451-6910: Use breakpoint variables for consistent responsive design.

The responsive design implementation is good, but consider using the existing breakpoint variables for consistency:

- @media (max-width: 820px) {
+ @media (max-width: var(--breakpoint-tablet)) {
  .hideElemByDefault {
    display: none;
  }
}

- @media (max-width: 580px) {
+ @media (max-width: var(--breakpoint-mobile)) {
  .orgCard {
    height: unset;
  }
}
src/components/UserPortal/UserSidebar/UserSidebar.tsx (3)

65-67: Consider semantic class naming for the height utility.

The class name leftbarcompheight could be more semantic to better describe its purpose.

-className={`d-flex align-items  flex-column ${styles.leftbarcompheight}`}
+className={`d-flex align-items flex-column ${styles.sidebarContentWrapper}`}

Also, there's an extra space in align-items flex-column.


87-90: Simplify the conditional expression.

The explicit comparison with true is unnecessary.

-isActive === true
+isActive

71-96: Consider extracting repeated button styles.

The button styling pattern is duplicated across multiple NavLinks. Consider extracting it into a reusable component or styled component.

Example approach:

interface StyledNavButtonProps {
  isActive: boolean;
  icon: React.ReactElement;
  children: React.ReactNode;
  testId: string;
}

const StyledNavButton: React.FC<StyledNavButtonProps> = ({
  isActive,
  icon,
  children,
  testId
}) => (
  <Button
    variant={isActive ? 'success' : ''}
    style={{
      backgroundColor: isActive ? 'var(--sidebar-option-bg)' : '',
      fontWeight: isActive ? 'bold' : 'normal',
      color: isActive
        ? 'var(--sidebar-option-text-active)'
        : 'var(--sidebar-option-text-inactive)',
    }}
    data-testid={testId}
  >
    <div className={styles.iconWrapper}>
      {React.cloneElement(icon, {
        stroke: isActive
          ? 'var(--sidebar-icon-stroke-active)'
          : 'var(--sidebar-icon-stroke-inactive)'
      })}
    </div>
    {children}
  </Button>
);
src/components/LeftDrawer/LeftDrawer.tsx (1)

67-67: Maintain consistency in class naming.

The class name sidebarcompheight differs from leftbarcompheight used in UserSidebar. Consider using consistent naming across components.

-className={`d-flex flex-column ${styles.sidebarcompheight} `}
+className={`d-flex flex-column ${styles.sidebarContentWrapper}`}

Also, there's a trailing space in the className string.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dff319a and 8d87af3.

📒 Files selected for processing (15)
  • src/components/LeftDrawer/LeftDrawer.tsx (2 hunks)
  • src/components/OrgListCard/OrgListCard.module.css (0 hunks)
  • src/components/OrgListCard/OrgListCard.tsx (2 hunks)
  • src/components/ProfileDropdown/ProfileDropdown.module.css (0 hunks)
  • src/components/ProfileDropdown/ProfileDropdown.tsx (2 hunks)
  • src/components/SuperAdminScreen/SuperAdminScreen.module.css (0 hunks)
  • src/components/SuperAdminScreen/SuperAdminScreen.tsx (1 hunks)
  • src/components/UserPortal/OrganizationCard/OrganizationCard.module.css (0 hunks)
  • src/components/UserPortal/OrganizationCard/OrganizationCard.tsx (2 hunks)
  • src/components/UserPortal/UserSidebar/UserSidebar.module.css (0 hunks)
  • src/components/UserPortal/UserSidebar/UserSidebar.tsx (2 hunks)
  • src/screens/ForgotPassword/ForgotPassword.tsx (3 hunks)
  • src/screens/UserPortal/Organizations/Organizations.module.css (0 hunks)
  • src/screens/UserPortal/Organizations/Organizations.tsx (3 hunks)
  • src/style/app.module.css (21 hunks)
💤 Files with no reviewable changes (6)
  • src/components/ProfileDropdown/ProfileDropdown.module.css
  • src/components/SuperAdminScreen/SuperAdminScreen.module.css
  • src/components/UserPortal/OrganizationCard/OrganizationCard.module.css
  • src/components/UserPortal/UserSidebar/UserSidebar.module.css
  • src/components/OrgListCard/OrgListCard.module.css
  • src/screens/UserPortal/Organizations/Organizations.module.css
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/components/UserPortal/OrganizationCard/OrganizationCard.tsx
  • src/components/OrgListCard/OrgListCard.tsx
  • src/components/ProfileDropdown/ProfileDropdown.tsx
  • src/screens/UserPortal/Organizations/Organizations.tsx
  • src/screens/ForgotPassword/ForgotPassword.tsx
  • src/components/SuperAdminScreen/SuperAdminScreen.tsx
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Test Application
  • GitHub Check: Analyse Code With CodeQL (javascript)
🔇 Additional comments (6)
src/style/app.module.css (2)

94-97: Well-structured shadow implementation!

The --hover-shadow variable is well-defined with appropriate opacity values, providing consistent depth perception for hover effects across components.


304-306: LGTM! Consistent hover effect implementation.

Good use of the --hover-shadow variable for dropdown hover effects, maintaining consistency across interactive elements.

src/components/UserPortal/UserSidebar/UserSidebar.tsx (1)

8-9: LGTM! CSS module import aligned with guidelines.

The change to use app.module.css aligns with the project's guidelines for centralized styling and dark mode support.

src/components/LeftDrawer/LeftDrawer.tsx (3)

72-94: Duplicate code pattern across navigation buttons.

The same button styling pattern is repeated across three NavLinks. This is similar to the issue in UserSidebar.

Consider extracting the common button styling into a reusable component as suggested in the UserSidebar review.

Also applies to: 101-124, 129-152


158-160: LGTM! Consistent ProfileDropdown placement.

The ProfileDropdown component is consistently placed at the bottom of the sidebar using mt-auto, matching the implementation in UserSidebar.


11-11: Verify accessibility considerations.

Please ensure that:

  1. The navigation buttons have sufficient color contrast in both active and inactive states
  2. The sidebar navigation is keyboard accessible
  3. The ProfileDropdown component maintains accessibility when placed at different viewport heights

Also applies to: 67-160

src/style/app.module.css Outdated Show resolved Hide resolved
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 19, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 19, 2025
@prathmesh703
Copy link
Contributor Author

@palisadoes the vitest run test is failing in UserListCard file but i have not made any changes in that file and no such test case is present in the UserListCard in which the vitest is failing .

@palisadoes
Copy link
Contributor

Please merge with the latest upstream

@palisadoes
Copy link
Contributor

  1. Please post the latest videos if there have been updates.
  2. Is this ready for review?

@prathmesh703
Copy link
Contributor Author

1)There are no any changes in the ui .Then also if you want i can post the video.
2) yes it is ready for review

@palisadoes palisadoes self-requested a review January 20, 2025 18:34
Copy link
Contributor

@palisadoes palisadoes left a comment

Choose a reason for hiding this comment

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

src/style/app.module.css Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
@prathmesh703
Copy link
Contributor Author

I will make the changes and let you know when it is ready for review .

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 (1)
.github/workflows/push-deploy-website.yml (1)

Documentation updates required for Login and Organization UI changes

The documentation is missing user guides and screenshots for the Login and Organization screens. Since these UIs are being modified, the documentation should be updated to:

  • Add user guides explaining the login process
  • Include documentation for organization management features
  • Add screenshots of the new UI to help users understand the interface
🔗 Analysis chain

Line range hint 44-58: Verify if documentation updates are required.

The PR objectives state that documentation has not been updated, but this workflow deploys the documentation website. Since UI changes are being made to the Login and Organization screens, please verify if documentation updates are needed to reflect these changes.

Run the following script to check for any documentation-related files that might need updates:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for documentation files related to Login and Organization screens

# Look for documentation files mentioning login or organization
echo "Searching for relevant documentation files..."
rg -l -i "login|organization" docs/

# Check if there are any images in the documentation that might need updating
echo "Checking for UI-related images..."
fd -e png -e jpg -e gif -e svg . docs/ | rg -i "login|organization|screen"

Length of output: 24973


Script:

#!/bin/bash
# Description: Inspect content of key documentation files and search for user guides

# Check content of introduction and plugin docs
echo "=== Checking introduction.md content ==="
cat docs/docs/introduction.md

echo -e "\n=== Checking for user guide directories ==="
fd -t d "guide|docs|tutorial" docs/

echo -e "\n=== Searching for UI-specific instructions ==="
rg -i "screen|interface|button|click|login .+|sign.+in|organization .+page" docs/docs/ --type md

Length of output: 68764


Script:

#!/bin/bash
# Description: Search for user documentation and related files

# Look for potential user documentation files
echo "=== Checking for user documentation ==="
fd -e md . docs/docs/ --exclude auto-docs

echo -e "\n=== Checking for screenshot directories ==="
fd -t d "screen|image|screenshot|asset" docs/

echo -e "\n=== Checking README files ==="
fd -g "README*.md" .

echo -e "\n=== Checking content of non-auto-generated docs ==="
fd -e md . docs/docs/ --exclude auto-docs -x cat {}

Length of output: 13616

🧰 Tools
🪛 yamllint (1.35.1)

[error] 41-41: trailing spaces

(trailing-spaces)

🧹 Nitpick comments (2)
.github/workflows/pull-request.yml (1)

41-41: Fix path format inconsistency in exclude_files parameter.

The path /src/components/UsersTableItem/UsersTableItem.tsx starts with a forward slash while other paths don't. This inconsistency should be fixed for maintainability.

-          ./.github/workflows/scripts/countline.py --lines 600 --exclude_files src/screens/LoginPage/LoginPage.tsx src/GraphQl/Queries/Queries.ts src/screens/OrgList/OrgList.tsx src/GraphQl/Mutations/mutations.ts src/components/EventListCard/EventListCardModals.tsx src/components/TagActions/TagActionsMocks.ts src/utils/interfaces.ts src/screens/MemberDetail/MemberDetail.tsx src/components/OrgPostCard/OrgPostCard.tsx /src/components/UsersTableItem/UsersTableItem.tsx
+          ./.github/workflows/scripts/countline.py --lines 600 --exclude_files src/screens/LoginPage/LoginPage.tsx src/GraphQl/Queries/Queries.ts src/screens/OrgList/OrgList.tsx src/GraphQl/Mutations/mutations.ts src/components/EventListCard/EventListCardModals.tsx src/components/TagActions/TagActionsMocks.ts src/utils/interfaces.ts src/screens/MemberDetail/MemberDetail.tsx src/components/OrgPostCard/OrgPostCard.tsx src/components/UsersTableItem/UsersTableItem.tsx
.github/workflows/push-deploy-website.yml (1)

41-41: Good change to use LTS Node.js version, but fix formatting.

Using Node.js 20.x (LTS) instead of version 22 (alpha) is a good choice for stability. However, there's a trailing space at the end of the line.

Apply this diff to fix the formatting:

-          node-version: '20.x' 
+          node-version: '20.x'
🧰 Tools
🪛 yamllint (1.35.1)

[error] 41-41: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 726e123 and 4d5f4dd.

📒 Files selected for processing (4)
  • .github/workflows/pull-request.yml (2 hunks)
  • .github/workflows/push-deploy-website.yml (2 hunks)
  • docs/docs/auto-docs/components/LeftDrawer/LeftDrawer/functions/default.md (1 hunks)
  • docs/docs/auto-docs/components/LeftDrawer/LeftDrawer/interfaces/InterfaceLeftDrawerProps.md (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • docs/docs/auto-docs/components/LeftDrawer/LeftDrawer/functions/default.md
  • docs/docs/auto-docs/components/LeftDrawer/LeftDrawer/interfaces/InterfaceLeftDrawerProps.md
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/push-deploy-website.yml

[error] 41-41: trailing spaces

(trailing-spaces)

🔇 Additional comments (1)
.github/workflows/pull-request.yml (1)

522-522: LGTM!

The addition of a newline after the docstring compliance check command improves readability.

.github/workflows/push-deploy-website.yml Outdated Show resolved Hide resolved
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: 2

🧹 Nitpick comments (1)
src/style/app.module.css (1)

387-389: Optimize hover effect transitions.

Multiple hover effects use box-shadow which can be performance-intensive. Consider using transform and opacity for better performance, and add will-change hint for hardware acceleration.

Example optimization:

.dropdown:hover {
+ will-change: box-shadow;
  box-shadow: var(--hover-shadow);
}

.login_btn:hover {
  color: var(--login-button-fill) !important;
+ will-change: box-shadow;
  box-shadow: var(--hover-shadow);
}

Also applies to: 592-595, 3185-3188, 3206-3209

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4d5f4dd and 739757f.

📒 Files selected for processing (1)
  • src/style/app.module.css (23 hunks)
🧰 Additional context used
🪛 GitHub Actions: PR Workflow
src/style/app.module.css

[error] 7156-7159: CSS Syntax Error: Unclosed block. The CSS block starting with '.activeLink:hover' is missing a closing brace.

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyse Code With CodeQL (javascript)
🔇 Additional comments (1)
src/style/app.module.css (1)

100-114: Improve semantic naming of CSS variables.

The newly added CSS variables should be named based on their function rather than their color value. This makes the codebase more maintainable and supports future dark mode implementation.

For example:

- --profile-bg: #f6f8fc;
- --screen-bg: #f2f7ff;
+ --profile-section-background: #f6f8fc;
+ --main-content-background: #f2f7ff;

src/style/app.module.css Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
@palisadoes palisadoes merged commit bdee2c7 into PalisadoesFoundation:develop-postgres Jan 21, 2025
18 of 19 checks passed
@prathmesh703 prathmesh703 deleted the login_ui branch January 21, 2025 17:42
yugal07 pushed a commit to yugal07/talawa-admin that referenced this pull request Jan 24, 2025
* login and landing ui

* ui

* ui2

* fixed failing test

* re review

* global css

* testcases fix

* color variables

* failing test
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