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

fixed : #2516 Refactor CSS files in src/screens/OrganizationFunds #2743

Conversation

gurramkarthiknetha
Copy link

@gurramkarthiknetha gurramkarthiknetha commented Dec 23, 2024

What kind of change does this PR introduce?

Refactoring

Issue Number:

Fixes #2516

Did you add tests for your changes?

No (Not applicable for this refactoring task).

Snapshots/Videos:

Not applicable.

If relevant, did you update the documentation?

Not applicable for this task.

Summary

This PR focuses on refactoring the CSS files in src/screens/ManageTag and its related components to align with the unified design system in Talawa-Admin.

Key objectives achieved:

  1. Consolidated all CSS styles into a single global file (src/style/app.module.css).
  2. Improved UI/UX for color-blind users by adhering to accessibility standards.
  3. Deleted all redundant CSS files in src/screens/ManageTag and its related components.
  4. Updated all references in the affected components to use the global CSS file.

This refactoring improves maintainability and consistency across the application.

Does this PR introduce a breaking change?

No

Other information

The foundational work for this refactoring was completed in PR: Chore/css changes #2466. This work builds on that effort to finalize the migration to the unified CSS design.

Have you read the contributing guide?

Yes

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced new styles for various UI components, including input fields, modals, and buttons.
    • Added new classes for improved styling of table headers and row backgrounds.
  • Bug Fixes

    • Removed outdated styles affecting the Organization Funds screen.
  • Chores

    • Cleaned up unused CSS to enhance application performance and maintainability.
    • Reorganized CSS classes for better structure and responsiveness.
    • Updated naming conventions for CSS classes to maintain consistency.

Copy link

coderabbitai bot commented Dec 23, 2024

Walkthrough

This pull request focuses on refactoring the CSS files for the Organization Funds screen by removing the local CSS module and consolidating styles into the global app.module.css file. The changes involve deleting the OrganizationFunds.module.css file and updating the OrganizationFunds.tsx component to use the new global CSS classes. Multiple new CSS classes have been added to the global stylesheet to maintain the existing styling while streamlining the CSS architecture.

Changes

File Change Summary
src/screens/OrganizationFunds/OrganizationFunds.module.css Completely removed
src/screens/OrganizationFunds/OrganizationFunds.tsx Updated class names to reference global CSS classes
src/style/app.module.css Added multiple new CSS classes for styling Organization Funds screen elements, removed .tagsBreadCrumbs, and renamed .tableHeader to .tableHeaders

Assessment against linked issues

Objective Addressed Explanation
Merge CSS files into global file [#2516]
Delete local CSS files [#2516]
Reference only global CSS file [#2516]

Possibly related issues

Possibly related PRs

Suggested labels

ignore-sensitive-files-pr

Suggested reviewers

  • palisadoes
  • AVtheking

Poem

🐰 Hop, hop, CSS on the move!
Styles dancing to a new groove
Global file, our new home sweet
Refactoring makes our code neat
Goodbye module, hello clean slate! 🎨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 707f6b6 and 94021a1.

📒 Files selected for processing (1)
  • src/screens/OrganizationFunds/OrganizationFunds.module.css (0 hunks)
💤 Files with no reviewable changes (1)
  • src/screens/OrganizationFunds/OrganizationFunds.module.css

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

@palisadoes
Copy link
Contributor

Please fix the conflicting file and ensure coderabbit.ai approves your PR

Copy link

@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)

646-667: Improve modal styling consistency and responsiveness

Several improvements can be made to the modal styles:

  1. Inconsistent naming: rename .titlemodal to .modalTitle
  2. Use CSS variables for colors
  3. Consider using relative units or media queries for better responsiveness

Apply this diff:

 .fundModal {
   max-width: 80vw;
-  margin-top: 2vh;
-  margin-left: 13vw;
+  margin: 2vh auto 0;
 }

-.titlemodal {
-  color: #707070;
+.modalTitle {
+  color: var(--text-secondary);
   font-weight: 600;
   font-size: 32px;
   width: 65%;
   margin-bottom: 0px;
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2d7b26f and 8d0491c.

📒 Files selected for processing (3)
  • src/screens/OrganizationFunds/OrganizationFunds.module.css (0 hunks)
  • src/screens/OrganizationFunds/OrganizationFunds.tsx (10 hunks)
  • src/style/app.module.css (1 hunks)
💤 Files with no reviewable changes (1)
  • src/screens/OrganizationFunds/OrganizationFunds.module.css
✅ Files skipped from review due to trivial changes (1)
  • src/screens/OrganizationFunds/OrganizationFunds.tsx
🔇 Additional comments (2)
src/style/app.module.css (2)

632-644: LGTM! Clean and semantic styling

The styling for fund-specific elements is well-implemented, using appropriate CSS variables and semantic properties.


707-716: LGTM! Accessible table styling

The table styles follow good practices:

  • Uses CSS variables for colors
  • Maintains good contrast for accessibility
  • Clear and focused styling

src/style/app.module.css Outdated Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
Copy link

@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

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

1-26: Improve organization of CSS custom properties

Consider grouping related variables and adding comments to document their purpose:

 :root {
+  /* Colors */
   --brown-color: #555555;
   --dropdown-hover-color: #eff1f7;
   --grey-bg-color: #eaebef;
   --subtle-blue-grey: #7c9beb;
   --subtle-blue-grey-hover: #5f7e91;
+  /* Dimensions */
   --modal-width: 670px;
   --modal-max-width: 680px;
+  /* Component-specific */
   --input-shadow-color: #dddddd;
   --delete-button-bg: #f8d6dc;
   --delete-button-color: #ff4d4f;
   /* ... rest of the variables ... */
 }

829-891: Consolidate and organize media queries

Consider:

  1. Grouping all media queries at the end of the file
  2. Using CSS variables for breakpoints
  3. Combining media queries with the same breakpoint
+ :root {
+   --breakpoint-sm: 480px;
+   --breakpoint-md: 768px;
+   --breakpoint-lg: 1024px;
+ }

 /* Move all media queries to the end of the file */
 @media (max-width: var(--breakpoint-lg)) {
   .pageNotFound h1.head {
     font-size: 200px;
   }
   
   /* Combine other styles for this breakpoint */
   .contract {
     padding-left: calc(250px + 2rem + 1.5rem);
   }
 }

Also applies to: 893-947

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8d0491c and 96b9645.

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

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
Copy link

@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: 0

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

461-467: Remove commented-out code

The checkbox button styles are commented out but still present in the codebase. Since these styles are not being used, they should be removed to maintain code cleanliness.

-/* .checkboxButton{
-    background-color: transparent;
-  }
-  
-  .checkboxButton:checked{
-    background-color: var(--subtle-blue-grey);
-    color:white
-  } */

971-974: Rename class to follow camelCase convention

The class name list_box uses snake_case naming convention while the rest of the codebase follows camelCase. This inconsistency should be fixed.

-.list_box {
+.listBox {
   height: auto;
   overflow-y: auto;
   width: 100%;
}

977-978: Use CSS variables for consistent theming

The color #31bb6b is hardcoded. Consider using CSS variables for better maintainability and consistency.

.inputFields {
-  box-shadow: 0 1px 1px #31bb6b;
+  box-shadow: 0 1px 1px var(--brand-primary);
}

1105-1120: Fix duplicate margin-top declaration

The .manageBtn class has duplicate margin-top declarations which can lead to confusion.

.manageBtn {
-  margin: 1rem 0 0;
-  margin-top: 15px;
+  margin-top: 1rem;
   border: 1px solid #e8e5e5;
   box-shadow: 0 2px 2px #e8e5e5;
   padding: 10px 10px;
   border-radius: 5px;
   font-size: 16px;
   color: white;
   outline: none;
   font-weight: 600;
   cursor: pointer;
   width: 45%;
   transition:
     transform 0.2s,
     box-shadow 0.2s;
}

1167-1167: Use CSS variables consistently

The class redefines .inputFields with a hardcoded color value. This should use the CSS variable for consistency.

.inputFields {
-  box-shadow: 0 1px 1px var(--brand-primary);
+  box-shadow: 0 1px 1px var(--bs-primary);
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 96b9645 and 82970a7.

📒 Files selected for processing (1)
  • src/style/app.module.css (5 hunks)
🔇 Additional comments (3)
src/style/app.module.css (3)

986-999: LGTM: Modal styles are well-structured

The modal styles are well-organized and use semantic class names. The use of CSS variables for colors and spacing is consistent with best practices.


1001-1005: LGTM: Button container styles follow flexbox best practices

The button container styles use flexbox appropriately for layout and spacing.


1016-1016: LGTM: Table header styles use semantic variables

The table header styles make good use of CSS variables for colors and maintain consistency with the design system.

Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.11%. Comparing base (47c0e3b) to head (94021a1).
Report is 2 commits behind head on develop-postgres.

Additional details and impacted files
@@                  Coverage Diff                  @@
##           develop-postgres    #2743       +/-   ##
=====================================================
+ Coverage             72.46%   87.11%   +14.65%     
=====================================================
  Files                   296      313       +17     
  Lines                  7357     8204      +847     
  Branches               1606     1848      +242     
=====================================================
+ Hits                   5331     7147     +1816     
+ Misses                 1766      875      -891     
+ Partials                260      182       -78     

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

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 23, 2024
gurramkarthiknetha

This comment was marked as off-topic.

@palisadoes
Copy link
Contributor

Please ensure coderabbit.ai approves your PR

Copy link

@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: 0

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

962-965: Use consistent naming convention

The class name uses snake_case while the rest of the codebase uses camelCase.

-.list_box {
+.listBox {
   height: auto;
   overflow-y: auto;
   width: 100%;
}

968-969: Use CSS variables for consistent theming

The color #31bb6b is hardcoded. Use the --brand-primary CSS variable instead.

 .inputFields {
-  box-shadow: 0 1px 1px #31bb6b;
+  box-shadow: 0 1px 1px var(--brand-primary);
 }

1093-1094: Fix duplicate properties and improve consistency

Issues found:

  1. .greenregbtn has a duplicate width: 100% property
  2. .manageBtn has duplicate margin-top properties
 .greenregbtn {
   /* ... other properties ... */
   width: 100%;
-  width: 100%;
 }

 .manageBtn {
   margin: 1rem 0 0;
-  margin-top: 15px;
   border: 1px solid #e8e5e5;
   /* ... other properties ... */
 }

Also applies to: 1096-1111


Line range hint 1158-1167: Use CSS variables for color consistency

The .dropdowns class uses hardcoded color values. Use CSS variables for better maintainability.

 .inputFields {
   box-shadow: 0 1px 1px var(--brand-primary);
 }

 .dropdowns {
   background-color: white;
-  border: 1px solid #31bb6b;
+  border: 1px solid var(--brand-primary);
   position: relative;
   display: inline-block;
-  color: #31bb6b;
+  color: var(--brand-primary);
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 82970a7 and 707f6b6.

📒 Files selected for processing (1)
  • src/style/app.module.css (4 hunks)
🔇 Additional comments (1)
src/style/app.module.css (1)

972-974: LGTM!

These class definitions look good:

  • .fundName: Proper styling for clickable text
  • .modalHeader: Clean modal styling
  • .label: Good use of Bootstrap variable
  • .fundModal: Proper modal positioning
  • .btnsContainer .btnsBlock button: Good button alignment
  • .tableHeaders: Proper use of Bootstrap variables

Also applies to: 977-979, 982-984, 986-990, 992-996, 1007-1011

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 24, 2024
@gurramkarthiknetha
Copy link
Author

Please ensure coderabbit.ai approves your PR

now it's approved

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.

  1. You have truncated file src/screens/OrganizationFunds/OrganizationFunds.module.css
  2. It should not exist. Please fix

@gurramkarthiknetha
Copy link
Author

  1. You have truncated file src/screens/OrganizationFunds/OrganizationFunds.module.css
  2. It should not exist. Please fix

now is this ok?

@palisadoes palisadoes self-requested a review December 24, 2024 09:15
@palisadoes palisadoes merged commit 3b68136 into PalisadoesFoundation:develop-postgres Dec 24, 2024
13 checks passed
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