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

Updating to NEW COLOR SCHEME 2 #3293

Merged

Conversation

rahulch07
Copy link
Contributor

@rahulch07 rahulch07 commented Jan 16, 2025

What kind of change does this PR introduce?

This PR introduces a methodology that will help to make use of CSS classes present in app.module.css to be used in all components.

Issue Number:

#2880

Summary

There are many elements among the components that have similar CSS properties. Before Merging all the CSS files to app.module.css each component had its seperate CSS file. But has now all components use a common CSS file elements with silimar CSS properties can use common classes. This PR introduce a methodology that will help to achieve this goal.

Does this PR introduce a breaking change?

No

Summary by CodeRabbit

Release Notes

  • CSS Improvements

    • Implemented a global CSS strategy to reduce code redundancy and improve styling consistency.
    • Added new global CSS classes for buttons, input fields, and modal styles.
    • Updated button styling with new color variables.
  • Documentation

    • Enhanced code comments across multiple components to explain CSS methodology.
    • Improved documentation for styling approach and class usage.
  • Styling Updates

    • Commented out box-shadow effects for various button classes.
    • Introduced new CSS variables for button colors.

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 bot commented Jan 16, 2025

Walkthrough

This pull request focuses on implementing a comprehensive CSS strategy across multiple components in the Talawa Admin application. The changes involve moving common styles to a global CSS file (src/style/app.module.css), adding detailed documentation explaining the rationale behind this approach, and making minor modifications to CSS variables and class definitions. The primary goal is to reduce CSS redundancy, improve maintainability, and ensure consistent styling across different components.

Changes

File Change Summary
src/assets/css/app.css Commented out box-shadow property for button classes
src/style/app.module.css Added documentation block, new CSS variable --remove-button-color, updated .removeButton and .addButton classes
Multiple component files (e.g., AddOnEntry.tsx, AdvertisementEntry.tsx, EventCalendar.tsx, etc.) Added documentation comments explaining CSS strategy and global class usage

Possibly related issues

Possibly related PRs

Suggested labels

ignore-sensitive-files-pr

Suggested reviewers

  • palisadoes

Poem

🐰 Hop, hop, through the CSS maze,
Global styles now set ablaze!
No more redundant code to fight,
Rabbit's refactoring brings delight! 🎨
Maintainability leaps with glee!


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

🔭 Outside diff range comments (2)
src/style/app.module.css (2)

Line range hint 541-554: Update button styles to use CSS variables consistently.

The .addButton and .removeButton classes have inconsistent color value usage:

.addButton {
  margin-bottom: 10px;
-  color: var(--brown-color);
+  color: var(--button-text-color);
  background-color: var(--light-blue);
-  border-color: var(--grey-bg-color);
+  border-color: var(--button-border-color);
}

.removeButton {
  margin-bottom: 10px;
  background-color: var(--delete-button-bg);
  color: var(--remove-button-color);
  margin-right: 10px;
-  --bs-btn-border-color: #dc3545;
+  border-color: var(--delete-button-color);
}

Line range hint 1-1500: Consolidate media queries for better maintainability.

Media queries are scattered throughout the file. Consider consolidating them at the end of the file and using consistent breakpoints:

/* At the end of the file */
@media (max-width: var(--breakpoint-mobile)) {
  /* Mobile styles */
}

@media (max-width: var(--breakpoint-tablet)) {
  /* Tablet styles */
}

@media (max-width: var(--breakpoint-desktop)) {
  /* Desktop styles */
}
🧹 Nitpick comments (3)
src/style/app.module.css (3)

1-38: Documentation could be enhanced with additional guidelines.

The CSS methodology documentation is well-structured. Consider adding:

  • Browser compatibility requirements
  • Responsive design principles and breakpoint usage
  • Performance considerations for CSS selectors

Line range hint 39-148: Improve CSS variable naming consistency and value references.

Consider these improvements:

  1. Standardize color variable naming:
    • Some use format --color-name (e.g., --grey-light)
    • Others use format --name-color (e.g., --brown-color)
  2. Reference existing variables instead of hardcoding values:
- --bs-primary: #0056b3;
+ --bs-primary: var(--blue-primary);

- --table-bg-color: var(--grey-bg-color);
+ --table-bg: var(--grey-bg-color);

Line range hint 1-1500: Move component-specific styles to their respective component files.

Several classes appear to be component-specific (e.g., .cardOrgPostCard, .modalOrgPostCard). These should be moved to their respective component files to maintain better separation of concerns and reduce the size of the global CSS file.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7e650f9 and 8ff875c.

📒 Files selected for processing (34)
  • src/assets/css/app.css (1 hunks)
  • src/components/AddOn/core/AddOnEntry/AddOnEntry.tsx (1 hunks)
  • src/components/AddPeopleToTag/AddPeopleToTag.tsx (1 hunks)
  • src/components/Advertisements/core/AdvertisementEntry/AdvertisementEntry.tsx (1 hunks)
  • src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.tsx (1 hunks)
  • src/components/EventCalendar/EventCalendar.tsx (1 hunks)
  • src/components/EventCalendar/EventHeader.tsx (1 hunks)
  • src/components/EventListCard/EventListCardModals.tsx (1 hunks)
  • src/components/OrgPeopleListCard/OrgPeopleListCard.tsx (1 hunks)
  • src/components/OrgPostCard/DeletePostModal.tsx (1 hunks)
  • src/components/OrgPostCard/OrgPostCard.tsx (1 hunks)
  • src/components/TagActions/TagActions.tsx (1 hunks)
  • src/components/TagActions/TagNode.tsx (1 hunks)
  • src/components/Venues/VenueCard.tsx (1 hunks)
  • src/components/Venues/VenueModal.tsx (1 hunks)
  • src/screens/BlockUser/BlockUser.tsx (1 hunks)
  • src/screens/FundCampaignPledge/FundCampaignPledge.tsx (1 hunks)
  • src/screens/FundCampaignPledge/PledgeModal.tsx (1 hunks)
  • src/screens/ManageTag/EditUserTagModal.tsx (1 hunks)
  • src/screens/ManageTag/ManageTag.tsx (1 hunks)
  • src/screens/ManageTag/RemoveUserTagModal.tsx (1 hunks)
  • src/screens/ManageTag/UnassignUserTagModal.tsx (1 hunks)
  • src/screens/OrgList/OrgList.tsx (1 hunks)
  • src/screens/OrgPost/OrgPost.tsx (1 hunks)
  • src/screens/OrganizationActionItems/ItemUpdateStatusModal.tsx (1 hunks)
  • src/screens/OrganizationEvents/OrganizationEvents.tsx (1 hunks)
  • src/screens/OrganizationFundCampaign/CampaignModal.tsx (1 hunks)
  • src/screens/OrganizationFundCampaign/OrganizationFundCampagins.tsx (1 hunks)
  • src/screens/OrganizationFunds/FundModal.tsx (1 hunks)
  • src/screens/OrganizationFunds/OrganizationFunds.tsx (1 hunks)
  • src/screens/OrganizationPeople/AddMember.tsx (1 hunks)
  • src/screens/OrganizationTags/OrganizationTags.tsx (1 hunks)
  • src/screens/SubTags/SubTags.tsx (1 hunks)
  • src/style/app.module.css (4 hunks)
✅ Files skipped from review due to trivial changes (33)
  • src/components/OrgPeopleListCard/OrgPeopleListCard.tsx
  • src/screens/BlockUser/BlockUser.tsx
  • src/screens/ManageTag/RemoveUserTagModal.tsx
  • src/screens/OrganizationFunds/FundModal.tsx
  • src/screens/SubTags/SubTags.tsx
  • src/components/AddPeopleToTag/AddPeopleToTag.tsx
  • src/components/OrgPostCard/DeletePostModal.tsx
  • src/components/EventCalendar/EventCalendar.tsx
  • src/components/Advertisements/core/AdvertisementEntry/AdvertisementEntry.tsx
  • src/screens/ManageTag/UnassignUserTagModal.tsx
  • src/screens/OrganizationPeople/AddMember.tsx
  • src/components/Venues/VenueModal.tsx
  • src/components/Venues/VenueCard.tsx
  • src/components/TagActions/TagNode.tsx
  • src/components/EventListCard/EventListCardModals.tsx
  • src/screens/FundCampaignPledge/FundCampaignPledge.tsx
  • src/screens/OrganizationActionItems/ItemUpdateStatusModal.tsx
  • src/components/TagActions/TagActions.tsx
  • src/screens/OrgList/OrgList.tsx
  • src/components/AddOn/core/AddOnEntry/AddOnEntry.tsx
  • src/screens/FundCampaignPledge/PledgeModal.tsx
  • src/screens/OrganizationEvents/OrganizationEvents.tsx
  • src/screens/ManageTag/EditUserTagModal.tsx
  • src/screens/OrgPost/OrgPost.tsx
  • src/components/OrgPostCard/OrgPostCard.tsx
  • src/components/EventCalendar/EventHeader.tsx
  • src/screens/OrganizationFundCampaign/CampaignModal.tsx
  • src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.tsx
  • src/screens/ManageTag/ManageTag.tsx
  • src/screens/OrganizationFundCampaign/OrganizationFundCampagins.tsx
  • src/screens/OrganizationFunds/OrganizationFunds.tsx
  • src/screens/OrganizationTags/OrganizationTags.tsx
  • src/assets/css/app.css

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 16, 2025
@palisadoes
Copy link
Contributor

Make a minor commit. I've updated the countline GitHub action

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

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

1-38: Well-structured CSS methodology documentation!

The documentation clearly explains the approach to reducing CSS duplication and provides helpful examples. Consider adding information about CSS modules scoping and how it interacts with these global classes.


Line range hint 1441-1445: Consider using modern CSS features for responsive design.

The breakpoint variables are well-defined, but consider enhancing the responsive design implementation with:

  1. CSS Container Queries for component-level responsiveness
  2. CSS Grid auto-fit/auto-fill for more flexible layouts
  3. clamp() for fluid typography and spacing
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8ff875c and 7df4a85.

📒 Files selected for processing (1)
  • src/style/app.module.css (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Test Application
  • GitHub Check: Analyse Code With CodeQL (javascript)
🔇 Additional comments (2)
src/style/app.module.css (2)

148-148: Verify the relationship between color variables.

The new --remove-button-color (#c8102e) seems to serve a similar purpose to the existing --delete-button-color. Consider:

  1. Are these intentionally different colors for different purposes?
  2. Could they be consolidated to reduce color variable duplication?
✅ Verification successful

Color variables serve distinct purposes - separation is justified

The variables are used differently in the UI:

  • --delete-button-color is used extensively for delete actions (background, text, borders)
  • --remove-button-color is used specifically for text coloring in remove contexts
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for usages of both color variables to understand their distinct purposes
echo "Searching for delete-button-color usage:"
rg --type css "var\(--delete-button-color\)"
echo -e "\nSearching for remove-button-color usage:"
rg --type css "var\(--remove-button-color\)"

Length of output: 1003


541-541: Verify the visual impact of button color changes.

The color changes to .addButton and .removeButton classes might affect the application's visual consistency:

  1. .addButton now uses --brown-color instead of its previous color
  2. .removeButton uses the new --remove-button-color variable

Also applies to: 554-556

✅ Verification successful

Button color changes affect multiple components

The color updates will impact:

  • 32 instances of addButton across organization management, events, posts, and other features
  • 18 instances of removeButton, consistently used with Bootstrap's danger variant
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for components using these button classes to assess impact
echo "Components using addButton:"
rg "className=.*addButton"
echo -e "\nComponents using removeButton:"
rg "className=.*removeButton"

Length of output: 5429

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.

See comment

src/style/app.module.css Show resolved Hide resolved
@palisadoes palisadoes merged commit 82214d9 into PalisadoesFoundation:develop-postgres Jan 16, 2025
17 checks passed
Copy link

codecov bot commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.86%. Comparing base (7e650f9) to head (7df4a85).
Report is 2 commits behind head on develop-postgres.

Additional details and impacted files
@@                  Coverage Diff                  @@
##           develop-postgres    #3293       +/-   ##
=====================================================
+ Coverage              8.43%   89.86%   +81.42%     
=====================================================
  Files                   310      331       +21     
  Lines                  8069     8574      +505     
  Branches               1792     1898      +106     
=====================================================
+ Hits                    681     7705     +7024     
+ Misses                 7311      610     -6701     
- Partials                 77      259      +182     
Flag Coverage Δ
combined 89.86% <ø> (?)
vitest 89.86% <ø> (?)

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.

Dhiren-Mhatre pushed a commit to Dhiren-Mhatre/talawa-admin that referenced this pull request Jan 17, 2025
* changed green to blue

* updated funds section

* people section css updated

* updated Tags section

* venues, action items, advertisments, plugins sections updated

* fixed code coverage test

* fixed code coverage test

* CSS methodology added

* fixed linting

---------

Co-authored-by: Rahul Chougule <rahul.chougule@flairlabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants