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

refactored: CSS files in src/screens/OrgSettings(fixes: #2523) #2610

Conversation

devender18
Copy link

@devender18 devender18 commented Dec 5, 2024

What kind of change does this PR introduce?
Refactor

Issue Number:

Fixes #2523

Did you add tests for your changes?
No

**Snapshots/Video
OrgSetting_testCases

If relevant, did you update the documentation?
Not relevant

Summary
The goal is to convert the CSS file in this subdirectory and all the components related to this screen to use this new design pattern.

Does this PR introduce a breaking change?
No

Other information

Have you read the contributing guide?
Yes

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced styling for the organization settings interface with new CSS classes for buttons, containers, and card components.
    • Introduced new CSS variables for improved accessibility and high contrast design.
    • Improved responsive design with media queries for dropdowns and tabs.
  • Bug Fixes

    • Corrected import paths for CSS styles to ensure proper styling of the General Settings component.
  • Refactor

    • Renamed the orgSettings component to OrgSettings for consistency with naming conventions.
    • Updated the import path for styles in the OrgSettings component.

Copy link

coderabbitai bot commented Dec 5, 2024

Warning

Rate limit exceeded

@devender18 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 37 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 dab0e97 and 6c663db.

Walkthrough

The pull request involves significant modifications to the CSS structure of the organization settings in the Talawa-Admin application. It replaces the existing OrgSettings.module.css with a new global CSS file located at src/style/app.module.css. The changes include renaming the orgSettings component to OrgSettings, updating import paths for styles, and removing several CSS classes from the deleted file while adding them to the new global CSS file. The functionality of the components remains unchanged, focusing solely on style management.

Changes

File Path Change Summary
src/components/OrgSettings/General/GeneralSettings.tsx Updated CSS import path from screens/OrgSettings/OrgSettings.module.css to ../../../../src/style/app.module.css.
src/screens/OrgSettings/OrgSettings.module.css Deleted file containing multiple CSS class definitions and media queries.
src/screens/OrgSettings/OrgSettings.tsx Renamed function from orgSettings to OrgSettings and updated CSS import path to ../../../src/style/app.module.css.
src/style/app.module.css Added multiple new CSS classes and media queries for styling settings-related components.

Assessment against linked issues

Objective Addressed Explanation
Streamline all CSS into a single global file (#[2523])
Merge CSS files in this subdirectory into the global CSS file (#[2523])
Delete the CSS files in this subdirectory after the merge (#[2523])
Ensure remaining files reference the global CSS file (#[2523])
Adhere to the same guidelines for CSS files in related components (#[2523]) Guidelines for other components are not addressed.

Possibly related issues

Possibly related PRs

Suggested labels

ignore-sensitive-files-pr

Poem

🐰 In the meadow where styles do play,
A global file has come to stay.
With colors bright and classes neat,
Our settings now look oh-so-sweet!
Goodbye to clutter, hello to grace,
In our app's new, stylish space! 🌼


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.

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

github-actions bot commented Dec 5, 2024

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

@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 and nitpick comments (3)
src/screens/OrgSettings/OrgSettings.tsx (1)

4-4: Consider using an absolute import path.

The relative import path ../../../src/style/app.module.css is brittle and could break if the file structure changes. Consider using an absolute import path instead.

-import styles from '../../../src/style/app.module.css';
+import styles from 'src/style/app.module.css';
src/style/app.module.css (2)

594-608: Consider using standard breakpoint values.

The current breakpoint of 577px is unconventional. Consider using standard Bootstrap breakpoints for consistency.

-@media (min-width: 577px) {
+@media (min-width: 576px) {
   .settingsDropdown {
     display: none;
   }
 }

-@media (min-width: 577px) {
+@media (min-width: 576px) {
   .settingsTabs {
     display: block;
   }
 }

Line range hint 1-671: Consider standardizing the use of CSS variables.

While consolidating styles into a global file is good, there's inconsistent usage of CSS variables throughout the file. Consider:

  1. Moving all color values to CSS variables
  2. Standardizing spacing and sizing values
  3. Creating a comprehensive theme system

This will improve maintainability and make future accessibility improvements easier.

Example approach:

:root {
  /* Colors */
  --primary: #286fe0;
  --secondary: #555555;
  /* ... */

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  /* ... */

  /* Sizes */
  --min-height-container: 100vh;
  --card-min-height: 180px;
  /* ... */
}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between c2630ae and 7ec7e52.

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

29-29: LGTM! Component naming follows React conventions.

The renaming from orgSettings to OrgSettings properly follows React's PascalCase naming convention for components.


129-129: LGTM! Export statement is consistent.

The export statement correctly matches the renamed component.

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

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.78%. Comparing base (c80b44f) to head (6c663db).
Report is 4 commits behind head on develop-postgres.

Additional details and impacted files
@@                  Coverage Diff                  @@
##           develop-postgres    #2610       +/-   ##
=====================================================
- Coverage             95.82%   83.78%   -12.04%     
=====================================================
  Files                   295      312       +17     
  Lines                  7037     8117     +1080     
  Branches               1520     1832      +312     
=====================================================
+ Hits                   6743     6801       +58     
- Misses                   98     1177     +1079     
+ Partials                196      139       -57     

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

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

🧹 Outside diff range and nitpick comments (2)
src/style/app.module.css (2)

577-597: Add documentation for the min-height value

The card component structure is clean and uses the new high contrast text appropriately. However, the min-height: 180px on .cardBody should be documented to explain its purpose.

 .cardBody {
+  /* Ensures consistent card height and prevents layout shifts when content is minimal */
   min-height: 180px;
 }

599-613: Consider using CSS custom properties for breakpoints

The responsive design logic is correct, but we could improve maintainability by using CSS custom properties for breakpoints.

+:root {
+  /* Breakpoints for consistent responsive design */
+  --breakpoint-sm: 576px;
+}

 @media (min-width: 576px) {
   .settingsDropdown {
     display: none;
   }
 }

-@media (min-width: 576px) {
+@media (min-width: var(--breakpoint-sm)) {
   .settingsTabs {
     display: block;
   }
 }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 53fc36f and dab0e97.

📒 Files selected for processing (2)
  • src/screens/OrgSettings/OrgSettings.tsx (3 hunks)
  • src/style/app.module.css (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/screens/OrgSettings/OrgSettings.tsx
🔇 Additional comments (1)
src/style/app.module.css (1)

564-575: LGTM! Clean and well-structured layout classes

The layout classes are well-organized and follow good CSS practices. The full viewport height ensures consistent layout across different screen sizes.

src/style/app.module.css Show resolved Hide resolved
@palisadoes palisadoes merged commit f1e8c32 into PalisadoesFoundation:develop-postgres Dec 7, 2024
12 of 14 checks passed
devender18 added a commit to devender18/talawa-admin that referenced this pull request Dec 7, 2024
…ndation#2523) (PalisadoesFoundation#2610)

* refactored: CSS files in src/screens/OrgSettings(fixes: PalisadoesFoundation#2523)

* refactored: CSS files in src/screens/OrgSettings(fixes: PalisadoesFoundation#2523)

* refactored: CSS files in src/screens/OrgSettings(fixes: PalisadoesFoundation#2523)

* refactored: CSS files in src/screens/OrgSettings(fixes: PalisadoesFoundation#2523)
palisadoes added a commit that referenced this pull request Dec 13, 2024
* refactored OrganizationDashboard css/ closes #2513

* refactor:OrganizationDashboard_css(fixes #2513)

* Plugin and  advertisement screen revamp (#2006)

* advertisement and plugin screen

* added revamped design

* fixes added

* fixed testcases

* chore(deps): bump sass from 1.80.6 to 1.80.7 (#2433)

Bumps [sass](https://github.com/sass/dart-sass) from 1.80.6 to 1.80.7.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](sass/dart-sass@1.80.6...1.80.7)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump eslint-plugin-import from 2.30.0 to 2.31.0 (#2434)

Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.30.0 to 2.31.0.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](import-js/eslint-plugin-import@v2.30.0...v2.31.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump @mui/x-charts from 7.22.1 to 7.22.2 (#2435)

Bumps [@mui/x-charts](https://github.com/mui/mui-x/tree/HEAD/packages/x-charts) from 7.22.1 to 7.22.2.
- [Release notes](https://github.com/mui/mui-x/releases)
- [Changelog](https://github.com/mui/mui-x/blob/v7.22.2/CHANGELOG.md)
- [Commits](https://github.com/mui/mui-x/commits/v7.22.2/packages/x-charts)

---
updated-dependencies:
- dependency-name: "@mui/x-charts"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump @types/react from 18.3.3 to 18.3.12 (#2436)

Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.3.3 to 18.3.12.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update pull-request.yml

* Update dependabot.yaml

* added docker check to workflow (#2414)

* added docker check to workflow

* made recommended changes to docker check in workflow

* added changes to docker check inn workflow as recommended

* added changes

* updated indentation in pull-request.yml file

* updated indentation in pull-request.yml file

* added Dockerfile and Docker-compose.yml file

* added Dockerfile and Docker-compose.yml file

* updated .docker-ignore file

* added recommended changes by code rabbit

* added recommended changes by code rabbit

* added recommended changes by code rabbit

* added recommended changes by code rabbit

* added recommended changes by code rabbit

* added recommended changes by code rabbit

* properly formatted code

* trying to make docker check pass

* trying to make docker check pass

* updated INSTALLATION.md

* updated INSTALLATION.md

* added recommended changes to INSTALLATION.md

* added recommended changes to INSTALLATION.md

* added recommended changes to INSTALLATION.md

* updated docker workflow

* updated INSTALLATION.md

* eslint-rule-no_unused_vars (#2428)

* Updated pr template with checklist (#2454)

* Updated pr template with checklist

* Additional changes for the PR template

* Changed the url for the PR template

* refactored addOnStore

* refactored addOnEntry v1

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Peter Harrison <[email protected]>
Co-authored-by: Vanshika Sabharwal <[email protected]>
Co-authored-by: prayansh_chhablani <[email protected]>
Co-authored-by: Dhiraj Udhani <[email protected]>

* refactored: CSS files in src/screens/OrgSettings(fixes: #2523) (#2610)

* refactored: CSS files in src/screens/OrgSettings(fixes: #2523)

* refactored: CSS files in src/screens/OrgSettings(fixes: #2523)

* refactored: CSS files in src/screens/OrgSettings(fixes: #2523)

* refactored: CSS files in src/screens/OrgSettings(fixes: #2523)

* Update pull-request.yml

* refactored: CSS files in src/screens/OrganizationDashboard(fixes: #2513)

* refactored: CSS files in src/screens/OrganizationDashboard(fixes: #2513)

* improve import for global css

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Shekhar Patel <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Peter Harrison <[email protected]>
Co-authored-by: Vanshika Sabharwal <[email protected]>
Co-authored-by: prayansh_chhablani <[email protected]>
Co-authored-by: Dhiraj Udhani <[email protected]>
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