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

Organization dash cards tests migration (fixes : #2806) #2881

Open
wants to merge 14 commits into
base: develop-postgres
Choose a base branch
from

Conversation

amaan-aly246
Copy link

@amaan-aly246 amaan-aly246 commented Dec 26, 2024

What kind of change does this PR introduce?

Migration of test cases written in Jest to Vitest and merged CSS files into app.module.css

Issue Number:

Fixes #2806

Did you add tests for your changes?

Yes, additional test cases have been added for components that did not have test cases written in Jest.

Snapshots/Videos:

Screenshot 2024-12-25 235223
Screenshot 2024-12-26 064126

If relevant, did you update the documentation?

No

Does this PR introduce a breaking change?
No

Other information

Have you read the contributing guide?

Yes

Summary by CodeRabbit

  • New Features

    • Introduced new styles for card components to enhance layout and appearance, including responsive design adjustments for smaller screens.
    • Added a loading state for card components with new test cases to ensure proper rendering.
  • Bug Fixes

    • Updated import paths for styles to ensure consistent application of styles across card components.
  • Tests

    • Added new test suites for CardItemLoading and DashBoardCardLoading components to verify rendering and child elements.
  • Chores

    • Removed outdated CSS modules that are no longer in use.

…ashCards component and also merged css files into global css file
…ashCards component and also merged css files into global css file
Copy link

coderabbitai bot commented Dec 26, 2024

Warning

Rate limit exceeded

@amaan-aly246 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 34 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 8ebcb99 and 5634bdd.

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

Walkthrough

This pull request involves a comprehensive refactoring of CSS and component files within the Organization Dashboard components. The changes primarily focus on consolidating CSS styles from multiple module files into a single global app.module.css file, updating import statements, and renaming components to follow consistent naming conventions. Additionally, new test files have been added for loading components, and existing test files have been slightly modified.

Changes

File Path Change Summary
src/components/OrganizationDashCards/CardItem.module.css Deleted CSS module file
src/components/OrganizationDashCards/CardItem.spec.tsx Reordered React import
src/components/OrganizationDashCards/CardItem.tsx Updated style import to global CSS
src/components/OrganizationDashCards/CardItemLoading.spec.tsx New test file added
src/components/OrganizationDashCards/CardItemLoading.tsx Updated component name and style import
src/components/OrganizationDashCards/DashBoardCardLoading.spec.tsx New test suite added
src/components/OrganizationDashCards/DashboardCard.spec.tsx Reordered React import
src/components/OrganizationDashCards/DashboardCard.tsx Updated style import to global CSS
src/components/OrganizationDashCards/DashboardCardLoading.tsx Updated component name, style import, and added test ID
src/components/OrganizationDashCards/Dashboardcard.module.css Deleted CSS module file
src/style/app.module.css Added new CSS classes and media queries

Assessment against linked issues

Objective Addressed Explanation
Refactor test files from Jest to Vitest [#2806] The PR does not address the refactoring of test files to Vitest as required.
Rename test files to .spec.* suffix The PR does not include renaming test files from .test.* to .spec.*.

Possibly related PRs

Suggested labels

refactor, ignore-sensitive-files-pr

Suggested reviewers

  • palisadoes

Poem

🐰 Styles dancing, modules unite
Global CSS takes its flight
Components renamed with care
Testing frameworks everywhere
A refactoring rabbit's delight! 🎨


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

@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 (2)
src/style/app.module.css (2)

804-827: Consider using relative units for typography

The mobile styles look good, but consider using relative units (rem/em) consistently for better scalability and maintainability.

  .cardBody .textWrapper .primaryText {
-    font-size: 1.5rem;
+    font-size: clamp(1.25rem, 4vw, 1.5rem);
  }

  .cardBody .textWrapper .secondaryText {
-    font-size: 1rem;
+    font-size: clamp(0.875rem, 3vw, 1rem);
  }

998-1012: Improve color management and layout flexibility

The styles can be improved for better maintainability and flexibility:

  1. Replace hardcoded color with CSS variable
  2. Use more flexible width constraints
  .cardItem .creator {
    font-size: 1rem;
-    color: rgb(33, 208, 21);
+    color: var(--bs-success, #198754);
  }

  .rightCard {
    display: flex;
    gap: 7px;
-    min-width: 170px;
+    min-width: min(170px, 30%);
    justify-content: center;
    flex-direction: column;
    margin-left: 10px;
    overflow-x: hidden;
-    width: 210px;
+    width: clamp(170px, 30%, 210px);
  }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3209a18 and 14c4c5a.

📒 Files selected for processing (11)
  • src/components/OrganizationDashCards/CardItem.module.css (0 hunks)
  • src/components/OrganizationDashCards/CardItem.spec.tsx (1 hunks)
  • src/components/OrganizationDashCards/CardItem.tsx (1 hunks)
  • src/components/OrganizationDashCards/CardItemLoading.spec.tsx (1 hunks)
  • src/components/OrganizationDashCards/CardItemLoading.tsx (2 hunks)
  • src/components/OrganizationDashCards/DashBoardCardLoading.spec.tsx (1 hunks)
  • src/components/OrganizationDashCards/DashboardCard.spec.tsx (1 hunks)
  • src/components/OrganizationDashCards/DashboardCard.tsx (1 hunks)
  • src/components/OrganizationDashCards/DashboardCardLoading.tsx (2 hunks)
  • src/components/OrganizationDashCards/Dashboardcard.module.css (0 hunks)
  • src/style/app.module.css (2 hunks)
💤 Files with no reviewable changes (2)
  • src/components/OrganizationDashCards/Dashboardcard.module.css
  • src/components/OrganizationDashCards/CardItem.module.css
✅ Files skipped from review due to trivial changes (4)
  • src/components/OrganizationDashCards/DashboardCard.spec.tsx
  • src/components/OrganizationDashCards/CardItem.spec.tsx
  • src/components/OrganizationDashCards/DashboardCard.tsx
  • src/components/OrganizationDashCards/CardItem.tsx
🔇 Additional comments (14)
src/components/OrganizationDashCards/CardItemLoading.tsx (3)

2-2: Import path successfully updated to the global CSS.
This change aligns with the PR goal of consolidating styling into a single app.module.css file.


Line range hint 8-29: Component name refactored to PascalCase.
The use of PascalCase (CardItemLoading) is consistent with React best practices for component naming. Code looks concise and correct.


31-31: Export statement correctly reflects the updated component name.
This ensures consistency with the named function and prevents any potential import issues.

src/components/OrganizationDashCards/CardItemLoading.spec.tsx (3)

1-4: Imports are properly set up for new test file.
It references the updated CardItemLoading component and necessary testing libraries.


5-9: Test suite confirms component rendering.
The test checks for the cardItemLoading test ID, verifying that the component mounts successfully.


11-23: Thorough child elements test coverage.
This test verifies all key child elements (iconWrapper, title, etc.) are present, ensuring UI integrity.

src/components/OrganizationDashCards/DashboardCardLoading.tsx (4)

4-4: Global stylesheet import is consistent.
Switching to app.module.css follows the consolidation strategy described in the PR.


10-10: Component name update to PascalCase.
This naming convention aligns with standard React patterns and ensures clarity.


12-12: Added data-testid attribute for improved testability.
Facilitates targeted queries in the new test suite.


40-40: Default export matches the updated PascalCase name.
Maintaining a consistent name prevents confusion when importing.

src/components/OrganizationDashCards/DashBoardCardLoading.spec.tsx (4)

1-4: Imports set up correctly for new test suite.
All required dependencies, including local styles, are in place.


5-8: Pre-render in beforeEach ensures each test starts fresh.
This pattern keeps tests isolated and reliable.


9-11: Test verifies main component renders properly.
Asserting the presence of data-testid confirms the component’s visibility.


13-27: Comprehensive coverage of child elements.
Ensures each sub-element (e.g., cardBody, iconWrapper, themeOverlay) is rendered, confirming UI integrity.

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

Please resolve the conflicting file

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 (1)
src/style/app.module.css (1)

2016-2087: Use CSS variables for color consistency

The creator text color is hardcoded to rgb(33, 208, 21). For better maintainability and theme consistency, consider using a CSS variable.

Apply this diff to use a CSS variable:

  .cardItem .creator {
    font-size: 1rem;
-   color: rgb(33, 208, 21);
+   color: var(--bs-success, rgb(33, 208, 21));
  }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between abcd01b and cb432e7.

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

1624-1647: LGTM! Well-implemented responsive design.

The media query for small screens effectively adjusts the card layout and typography for better mobile display. The absolute positioning of icons and text alignment changes provide an optimal viewing experience on smaller devices.


1649-1683: Ensure sufficient color contrast for accessibility

The secondary text color uses a CSS variable without a fallback value. Consider adding a fallback and ensuring the contrast ratio meets WCAG guidelines.

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 26, 2024
@amaan-aly246 amaan-aly246 force-pushed the OrganizationDashCards_tests-migration branch from ee9cce1 to e77e371 Compare December 26, 2024 10:36
@amaan-aly246 amaan-aly246 force-pushed the OrganizationDashCards_tests-migration branch from aae108f to daf829d Compare December 26, 2024 10:46
Copy link

codecov bot commented Dec 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.13%. Comparing base (1475df0) to head (3f0f011).
Report is 4 commits behind head on develop-postgres.

Additional details and impacted files
@@                  Coverage Diff                  @@
##           develop-postgres    #2881       +/-   ##
=====================================================
+ Coverage             49.35%   88.13%   +38.77%     
=====================================================
  Files                   299      316       +17     
  Lines                  7414     8265      +851     
  Branches               1621     1866      +245     
=====================================================
+ Hits                   3659     7284     +3625     
+ Misses                 3509      770     -2739     
+ Partials                246      211       -35     

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

@palisadoes
Copy link
Contributor

Please fix the conflicting file

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

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

1624-1647: Consider improving mobile layout robustness.

While the responsive design handles text sizing well, the absolute positioning of .iconWrapper could cause layout issues.

Apply this diff to make the layout more robust:

@media (max-width: 600px) {
  .cardBody {
    min-height: 120px;
+   position: relative;
  }

  .cardBody .iconWrapper {
    position: absolute;
    top: 1rem;
    left: 1rem;
+   z-index: 1;
  }

  .cardBody .textWrapper {
-   margin-top: calc(0.5rem + 36px);
+   margin-top: calc(0.5rem + 48px);
    text-align: right;
+   position: relative;
+   z-index: 0;
  }
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between cb432e7 and 65756f5.

📒 Files selected for processing (11)
  • src/components/OrganizationDashCards/CardItem.module.css (0 hunks)
  • src/components/OrganizationDashCards/CardItem.spec.tsx (1 hunks)
  • src/components/OrganizationDashCards/CardItem.tsx (4 hunks)
  • src/components/OrganizationDashCards/CardItemLoading.spec.tsx (1 hunks)
  • src/components/OrganizationDashCards/CardItemLoading.tsx (2 hunks)
  • src/components/OrganizationDashCards/DashBoardCardLoading.spec.tsx (1 hunks)
  • src/components/OrganizationDashCards/DashboardCard.spec.tsx (1 hunks)
  • src/components/OrganizationDashCards/DashboardCard.tsx (1 hunks)
  • src/components/OrganizationDashCards/DashboardCardLoading.tsx (2 hunks)
  • src/components/OrganizationDashCards/Dashboardcard.module.css (0 hunks)
  • src/style/app.module.css (2 hunks)
💤 Files with no reviewable changes (2)
  • src/components/OrganizationDashCards/Dashboardcard.module.css
  • src/components/OrganizationDashCards/CardItem.module.css
🚧 Files skipped from review as they are similar to previous changes (8)
  • src/components/OrganizationDashCards/DashboardCard.spec.tsx
  • src/components/OrganizationDashCards/DashboardCard.tsx
  • src/components/OrganizationDashCards/CardItem.spec.tsx
  • src/components/OrganizationDashCards/CardItemLoading.spec.tsx
  • src/components/OrganizationDashCards/CardItemLoading.tsx
  • src/components/OrganizationDashCards/CardItem.tsx
  • src/components/OrganizationDashCards/DashboardCardLoading.tsx
  • src/components/OrganizationDashCards/DashBoardCardLoading.spec.tsx
🔇 Additional comments (1)
src/style/app.module.css (1)

1649-1683: 🛠️ Refactor suggestion

Remove duplicate overlay styles and improve accessibility.

  1. The .themeOverlay class duplicates the overlay styles from .cardItem .iconWrapper .themeOverlay.
  2. The secondary text color might not meet WCAG contrast requirements.

Apply these changes:

  1. Remove duplicate overlay styles:
- .cardBody .iconWrapper .themeOverlay {
-   background: var(--bs-primary);
-   position: absolute;
-   top: 0;
-   right: 0;
-   bottom: 0;
-   left: 0;
-   opacity: 0.12;
-   border-radius: 50%;
- }
  1. Improve text contrast:
  .cardBody .textWrapper .secondaryText {
    font-size: 14px;
    display: block;
-   color: var(--bs-secondary);
+   color: var(--bs-secondary, #6c757d);
+   /* Ensure color meets WCAG AA contrast ratio of 4.5:1 */
  }

Likely invalid or redundant comment.

src/style/app.module.css Outdated Show resolved Hide resolved
@amaan-aly246
Copy link
Author

@palisadoes It's showing me that this branch is out-of-date with the develop-postgres branch. I'm closing this PR and will raise the new PR from the updated base branch.

@palisadoes palisadoes reopened this Dec 26, 2024
@palisadoes
Copy link
Contributor

Reopening. You don't have to do this. Just update your local branch with the latest upstream.

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

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

2346-2363: Consider extracting common overlay styles.

The overlay styles are duplicated between .cardItem .iconWrapper .themeOverlay and .cardBody .iconWrapper .themeOverlay. Consider creating a shared class to follow the DRY principle.

+.themeOverlay {
+  background: var(--bs-primary);
+  position: absolute;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  opacity: 0.12;
+  border-radius: 50%;
+}

 .cardItem .iconWrapper .themeOverlay {
-  background: var(--bs-primary);
-  position: absolute;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-  opacity: 0.12;
-  border-radius: 50%;
+  @extend .themeOverlay;
 }

2395-2398: Standardize color value format.

The creator text color uses an RGB format while other colors use CSS variables. Consider using the CSS variable with a fallback for consistency.

 .cardItem .creator {
   font-size: 1rem;
-  color: rgb(33, 208, 21);
+  color: var(--bs-success, #21d015);
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 65756f5 and 692a745.

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

1624-1647: LGTM! Well-structured responsive design.

The media query implementation follows best practices with appropriate breakpoints and layout adjustments for mobile devices.


1649-1683: Ensure sufficient color contrast for accessibility.

The secondary text color uses a CSS variable without a fallback value. Consider adding a fallback and ensuring the contrast ratio meets WCAG guidelines.

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

Please make coderabbit.ai approve 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: 1

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

1649-1683: Consolidate duplicate overlay styles.

The overlay styles are duplicated between .cardBody .iconWrapper .themeOverlay and .cardItem .iconWrapper .themeOverlay. Consider creating a shared class or CSS custom property for the overlay.

+.overlayBase {
+  position: absolute;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  opacity: 0.12;
+  border-radius: 50%;
+}

 .cardBody .iconWrapper .themeOverlay {
   background: var(--bs-primary);
-  position: absolute;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-  opacity: 0.12;
-  border-radius: 50%;
+  composes: overlayBase;
 }

 .cardItem .iconWrapper .themeOverlay {
   background: var(--bs-primary);
-  position: absolute;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-  opacity: 0.12;
-  border-radius: 50%;
+  composes: overlayBase;
 }

2366-2375: Remove duplicate text truncation properties.

The .cardItem .title has duplicate text-overflow and white-space declarations.

 .cardItem .title {
   font-size: 1rem;
   flex: 1;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
-  text-overflow: ellipsis;
-  white-space: nowrap; /* Fallback for browsers that don't support line-clamp */
   margin-left: 3px;
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 692a745 and 9f20206.

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

1624-1647: LGTM! Mobile-first responsive design implementation.

The media query effectively handles the card layout for mobile screens, with appropriate adjustments to spacing, positioning, and typography.

src/style/app.module.css Outdated Show resolved Hide resolved
coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 26, 2024
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. See comments
  2. You have not deleted the *.test.* files as requested in the PR

src/style/app.module.css Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
src/style/app.module.css Show resolved Hide resolved
src/style/app.module.css Show resolved Hide resolved
@amaan-aly246
Copy link
Author

  1. See comments
  2. You have not deleted the *.test.* files as requested in the PR

@palisadoes all *.test.* files are deleted.
Screenshot 2024-12-26 213832

@palisadoes
Copy link
Contributor

  1. See comments
  2. You have not deleted the *.test.* files as requested in the PR

@palisadoes all *.test.* files are deleted. Screenshot 2024-12-26 213832

Thanks, please address the other questions

@amaan-aly246
Copy link
Author

amaan-aly246 commented Dec 26, 2024

Thanks, please address the other questions

I have requested your review on those unresolved conversations.
Apologies for taking so much time.

@palisadoes
Copy link
Contributor

I don't understand. You haven't responded to my queries about the deleted sections in the dialog boxes.

@amaan-aly246
Copy link
Author

@palisadoes I have replied to you in those dialog boxes. I mentioned there that CodeRabbit requested the deletion of those sections because they were duplicates, in order to resolve the conversation.
The code, even after removing those sections, still passes all the test cases (if that helps).
Screenshot 2024-12-26 224650

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 (2)
src/style/app.module.css (2)

2390-2410: Remove duplicate text-overflow properties.

The .cardItem .title has duplicate text-overflow and white-space properties. Also, consider using the shared text truncation styles from the @supports block.

 .cardItem .title {
   font-size: 1rem;
   flex: 1;
   overflow: hidden;
-  text-overflow: ellipsis;
-  white-space: nowrap;
-  text-overflow: ellipsis;
-  white-space: nowrap; /* Fallback for browsers that don't support line-clamp */
+  text-overflow: ellipsis;
+  white-space: nowrap;
   margin-left: 3px;
 }

2411-2424: Remove duplicate line-clamp properties from location styles.

The .cardItem .location duplicates line-clamp properties that are already defined in the @supports block above.

 .cardItem .location {
   font-size: 0.9rem;
   color: var(--bs-primary);
   overflow: hidden;
-  display: -webkit-box;
-  -webkit-line-clamp: 1;
-  line-clamp: 1;
-  -webkit-box-orient: vertical;
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9f20206 and c17efbf.

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

1624-1647: LGTM! Responsive design implementation looks good.

The media query properly handles layout adjustments for smaller screens, with appropriate positioning and sizing of elements.


1649-1683: Remove duplicate overlay styles between .cardBody and .cardItem.

The .cardBody .iconWrapper .themeOverlay styles are duplicated with .cardItem .iconWrapper .themeOverlay. Consider extracting these into a shared class.

+.themeOverlay {
+  background: var(--bs-primary);
+  position: absolute;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  opacity: 0.12;
+  border-radius: 50%;
+}

 .cardBody .iconWrapper .themeOverlay {
-  background: var(--bs-primary);
-  position: absolute;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-  opacity: 0.12;
-  border-radius: 50%;
+  composes: themeOverlay;
 }

 .cardItem .iconWrapper .themeOverlay {
-  background: var(--bs-primary);
-  position: absolute;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-  opacity: 0.12;
-  border-radius: 50%;
+  composes: themeOverlay;
 }

2337-2344: LGTM! Card item layout implementation is solid.

The flexbox layout with proper spacing and border handling using CSS variables is well implemented.


2370-2388: LGTM! Icon wrapper implementation is clean.

The icon wrapper properly handles centering and dimensions while maintaining consistency with the design system.


2425-2454: Remove duplicate animation keyframes from .rightCard.

The zoomIn keyframes are duplicated within the .rightCard class. These animations already exist in the global scope.

 .rightCard {
   display: flex;
   gap: 7px;
   min-width: 170px;
   justify-content: center;
   flex-direction: column;
   margin-left: 10px;
   overflow-x: hidden;
   width: 210px;
-
-  @keyframes zoomIn {
-    0% {
-      opacity: 0;
-      -webkit-transform: scale(0.5);
-      transform: scale(0.5);
-    }
-
-    100% {
-      opacity: 1;
-      -webkit-transform: scale(1);
-      transform: scale(1);
-    }
-  }
 }

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 26, 2024
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 (3)
src/style/app.module.css (3)

1624-1647: Consider using a CSS variable for the breakpoint value.

The media query implementation is good, but could be more maintainable by defining the breakpoint as a CSS variable.

+:root {
+  --breakpoint-sm: 600px;
+}
-@media (max-width: 600px) {
+@media (max-width: var(--breakpoint-sm)) {
   .cardBody {
     min-height: 120px;
   }
   /* ... rest of the media query ... */
}

1679-1683: Add fallback color for better browser support.

The secondary text color uses a CSS variable without a fallback value.

 .cardBody .textWrapper .secondaryText {
   font-size: 14px;
   display: block;
-  color: var(--bs-secondary);
+  color: var(--bs-secondary, #6c757d);
 }

2391-2400: Remove duplicate text-overflow properties.

The text truncation properties are duplicated.

 .cardItem .title {
   font-size: 1rem;
   flex: 1;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
-  text-overflow: ellipsis;
-  white-space: nowrap; /* Fallback for browsers that don't support line-clamp */
   margin-left: 3px;
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c17efbf and 8ebcb99.

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

1653-1671: Remove duplicate overlay styles.

The .cardBody .iconWrapper overlay styles are duplicated with .cardItem .iconWrapper (lines 2371-2389).


2442-2454: 🛠️ Refactor suggestion

Remove duplicate animation keyframes.

The zoomIn keyframes are duplicated. They already exist in the global scope (lines 2344-2370).

 .rightCard {
   /* ... existing styles ... */
-  @keyframes zoomIn {
-    0% {
-      opacity: 0;
-      -webkit-transform: scale(0.5);
-      transform: scale(0.5);
-    }
-
-    100% {
-      opacity: 1;
-      -webkit-transform: scale(1);
-      transform: scale(1);
-    }
-  }
 }

Likely invalid or redundant comment.

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 26, 2024
@amaan-aly246 amaan-aly246 force-pushed the OrganizationDashCards_tests-migration branch 2 times, most recently from 72dc159 to 2a46807 Compare December 26, 2024 18:24
@amaan-aly246
Copy link
Author

@palisadoes Don't know what's happening , I tried to resolved this issue using npm run format:fix , even locally it corrected it , pushed the code but still failing the format check.
Now my local branch is behind or something.

Issue:
Screenshot 2024-12-26 235657
Locally :
Screenshot 2024-12-26 235927

@amaan-aly246
Copy link
Author

Suggest me what should I do now.

@palisadoes
Copy link
Contributor

Please update your local branch with the latest upstream. That should fix the issue. If not, please ask the #talawa-admin channel in slack

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