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

fix(service-portal): Update notification icon styling #15219

Merged
merged 2 commits into from
Jun 13, 2024

Conversation

thordurhhh
Copy link
Member

@thordurhhh thordurhhh commented Jun 13, 2024

What

Fix logo styling for notifications

Why

Looks bad now.
Looks good with this PR ✨

Screenshots / Gifs

Currently 😞

Header
Screenshot 2024-06-13 at 10 09 48

Page
Screenshot 2024-06-13 at 10 10 46

This PR 👍

Header
Screenshot 2024-06-13 at 10 08 07

Page
Screenshot 2024-06-13 at 10 08 10

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

  • New Features
    • Enhanced the avatar image styling and rendering in notifications, allowing more flexibility with new prop options.
  • Style
    • Updated CSS for avatar images to include dimensions and display properties, ensuring consistent visual presentation.
  • Refactor
    • Adjusted the AvatarImage component to support additional props for customization of element type and CSS classes.

@thordurhhh thordurhhh added the automerge Merge this PR as soon as all checks pass label Jun 13, 2024
@thordurhhh thordurhhh requested a review from a team as a code owner June 13, 2024 10:11
Copy link
Contributor

coderabbitai bot commented Jun 13, 2024

Walkthrough

These updates enhance and standardize the presentation and functionality of avatar images across various components like NotificationLine and AvatarImage. They introduce new styling options and flexible component rendering via div or button elements. This ensures customization and consistency in the avatar image layout and behavior throughout the application.

Changes

File Change Summary
apps/service-portal/src/components/Notifications/NotificationLine.tsx Added as="div" and imageClass={styles.img} to AvatarImage for rendering and styling adjustments.
apps/service-portal/src/components/Notifications/Notifications.css.ts Introduced new img style with specific height, width, display, maxHeight, and maxWidth properties.
libs/service-portal/core/src/components/ActionCard/ActionCard.css.ts Updated circleImg style to include maxHeight, maxWidth, and changed width to auto.
libs/service-portal/documents/src/components/DocumentLine/AvatarImage.tsx Added as and imageClass props, with conditional rendering and styling based on these props.

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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
Member

@thorkellmani thorkellmani left a comment

Choose a reason for hiding this comment

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

LGTM

@thorkellmani thorkellmani removed the automerge Merge this PR as soon as all checks pass label Jun 13, 2024
@thordurhhh thordurhhh added the automerge Merge this PR as soon as all checks pass label Jun 13, 2024
@datadog-island-is
Copy link

Datadog Report

All test runs faab238 🔗

2 Total Test Services: 0 Failed, 1 Passed
➡️ Test Sessions change in coverage: 20 no change

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
service-portal-core 0 0 0 5 0 3.32s N/A Link
service-portal-health 0 0 0 0 0 591.41ms 1 no change Link

@kodiakhq kodiakhq bot merged commit 5bf7cbd into main Jun 13, 2024
41 checks passed
@kodiakhq kodiakhq bot deleted the service-portal/notifications-icon-styling branch June 13, 2024 10:30
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f26bd9d and b7c74b8.

Files selected for processing (4)
  • apps/service-portal/src/components/Notifications/NotificationLine.tsx (1 hunks)
  • apps/service-portal/src/components/Notifications/Notifications.css.ts (1 hunks)
  • libs/service-portal/core/src/components/ActionCard/ActionCard.css.ts (1 hunks)
  • libs/service-portal/documents/src/components/DocumentLine/AvatarImage.tsx (2 hunks)
Additional context used
Path-based instructions (4)
libs/service-portal/core/src/components/ActionCard/ActionCard.css.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
apps/service-portal/src/components/Notifications/Notifications.css.ts (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
libs/service-portal/documents/src/components/DocumentLine/AvatarImage.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
apps/service-portal/src/components/Notifications/NotificationLine.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
Additional comments not posted (2)
libs/service-portal/core/src/components/ActionCard/ActionCard.css.ts (1)

34-37: The changes to the circleImg class enhance responsiveness and flexibility. Please ensure to verify the styling across various devices and screen resolutions to confirm that the visual integrity is maintained.

apps/service-portal/src/components/Notifications/Notifications.css.ts (1)

12-18: The updates to the img class improve responsiveness and should better accommodate different image sizes. Please ensure to verify these changes across various screen sizes to maintain consistency in the visual presentation.

Comment on lines 16 to 17
ariaLabel?: string
imageClass?: string
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The ariaLabel and imageClass props are not consistently utilized across all instances of the AvatarImage component. Specifically, the ariaLabel prop is only used in NotificationLine.tsx. To ensure accessibility and customization, please review and update the usage of these props in the following files:

  • libs/service-portal/documents/src/components/DocumentLine/DocumentLineV2.tsx
  • libs/service-portal/documents/src/components/DocumentHeader/DocumentHeaderV2.tsx
  • libs/service-portal/documents/src/components/DocumentHeader/DocumentHeader.tsx
  • libs/service-portal/documents/src/components/DocumentLine/DocumentLine.tsx
Analysis chain

The addition of ariaLabel and imageClass props enhances accessibility and customization options for the AvatarImage component. Please ensure that these props are being utilized effectively wherever this component is used.

Also applies to: 25-26

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the effective use of `ariaLabel` and `imageClass` props in the `AvatarImage` component.

# Test: Search for the usage of `AvatarImage` component and ensure props are used.
rg --type typescript $'AvatarImage'

Length of output: 69



Script:

#!/bin/bash
# Description: Verify the effective use of `ariaLabel` and `imageClass` props in the `AvatarImage` component.

# Test: Search for the usage of `AvatarImage` component and ensure props are used.
rg --type ts 'AvatarImage'

Length of output: 1576



Script:

#!/bin/bash
# Description: Extract lines where `AvatarImage` is used to verify the usage of `ariaLabel` and `imageClass` props.

# Files where `AvatarImage` is used.
files=(
  "libs/service-portal/documents/src/components/DocumentLine/DocumentLineV2.tsx"
  "libs/service-portal/documents/src/components/DocumentHeader/DocumentHeaderV2.tsx"
  "libs/service-portal/documents/src/components/DocumentHeader/DocumentHeader.tsx"
  "libs/service-portal/documents/src/components/DocumentLine/DocumentLine.tsx"
  "apps/service-portal/src/components/Notifications/NotificationLine.tsx"
)

# Extract lines containing `AvatarImage` usage.
for file in "${files[@]}"; do
  echo "File: $file"
  rg 'AvatarImage' "$file"
  echo
done

Length of output: 2390



Script:

#!/bin/bash
# Description: Extract more context around lines where `AvatarImage` is used to verify the usage of `ariaLabel` and `imageClass` props.

# Files where `AvatarImage` is used.
files=(
  "libs/service-portal/documents/src/components/DocumentLine/DocumentLineV2.tsx"
  "libs/service-portal/documents/src/components/DocumentHeader/DocumentHeaderV2.tsx"
  "libs/service-portal/documents/src/components/DocumentHeader/DocumentHeader.tsx"
  "libs/service-portal/documents/src/components/DocumentLine/DocumentLine.tsx"
  "apps/service-portal/src/components/Notifications/NotificationLine.tsx"
)

# Extract lines containing `AvatarImage` usage with more context.
for file in "${files[@]}"; do
  echo "File: $file"
  rg -C 3 'AvatarImage' "$file"
  echo
done

Length of output: 4184

Comment on lines 54 to 55
ariaLabel="Sender"
imageClass={styles.img}
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The NotificationLine component in NotificationMenu.tsx does not currently pass the ariaLabel and imageClass props. To ensure consistency and proper utilization of these props, please update the NotificationLine usage to include them.

  • apps/service-portal/src/components/Notifications/NotificationMenu.tsx: Add ariaLabel and imageClass props to NotificationLine.
Analysis chain

The usage of ariaLabel and imageClass props in the AvatarImage component within the NotificationLine enhances accessibility and customization. Please ensure that these props are being utilized effectively across all instances where this component is used.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the effective use of `ariaLabel` and `imageClass` props in the `AvatarImage` component within `NotificationLine`.

# Test: Search for the usage of `AvatarImage` component within `NotificationLine` and ensure props are used.
rg --type typescript $'NotificationLine'

Length of output: 74



Script:

#!/bin/bash
# Correcting the file type and re-running the search for `NotificationLine` component usage.
rg --type tsx 'NotificationLine'

Length of output: 60



Script:

#!/bin/bash
# Correcting the file types and re-running the search for `NotificationLine` component usage.
rg --type-add 'ts:*.ts' --type-add 'tsx:*.tsx' --type ts,tsx 'NotificationLine'

Length of output: 110



Script:

#!/bin/bash
# Correcting the file type and re-running the search for `NotificationLine` component usage.
rg --glob '**/*.tsx' 'NotificationLine'

Length of output: 505



Script:

#!/bin/bash
# Reviewing the usage of `NotificationLine` in `NotificationMenu.tsx` to ensure `ariaLabel` and `imageClass` props are passed correctly.
rg --glob 'apps/service-portal/src/components/Notifications/NotificationMenu.tsx' 'NotificationLine'

Length of output: 320



Script:

#!/bin/bash
# Displaying relevant lines in `NotificationMenu.tsx` where `NotificationLine` is used to verify the props passed.
rg --glob 'apps/service-portal/src/components/Notifications/NotificationMenu.tsx' -A 5 'NotificationLine'

Length of output: 1325

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f26bd9d and 15a573b.

Files selected for processing (4)
  • apps/service-portal/src/components/Notifications/NotificationLine.tsx (1 hunks)
  • apps/service-portal/src/components/Notifications/Notifications.css.ts (1 hunks)
  • libs/service-portal/core/src/components/ActionCard/ActionCard.css.ts (1 hunks)
  • libs/service-portal/documents/src/components/DocumentLine/AvatarImage.tsx (2 hunks)
Additional context used
Path-based instructions (4)
libs/service-portal/core/src/components/ActionCard/ActionCard.css.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
apps/service-portal/src/components/Notifications/Notifications.css.ts (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
libs/service-portal/documents/src/components/DocumentLine/AvatarImage.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
apps/service-portal/src/components/Notifications/NotificationLine.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
Additional comments not posted (4)
libs/service-portal/core/src/components/ActionCard/ActionCard.css.ts (1)

34-37: The changes to circleImg style enhance responsiveness. Ensure this doesn't affect the layout where circleImg is used elsewhere.

apps/service-portal/src/components/Notifications/Notifications.css.ts (1)

12-18: The new img style enhances flexibility and responsiveness. Verify that this change harmonizes with existing styles and doesn't introduce any visual regressions.

libs/service-portal/documents/src/components/DocumentLine/AvatarImage.tsx (1)

16-17: The addition of as and imageClass props enhances the flexibility and reusability of the AvatarImage component. Ensure all usages of this component have been updated to accommodate these new props.

Also applies to: 25-62

apps/service-portal/src/components/Notifications/NotificationLine.tsx (1)

54-55: The use of as="div" and imageClass={styles.img} in AvatarImage is correctly implemented here, aligning with the changes in AvatarImage.tsx. Please verify the visual output to ensure it meets the design expectations.

sigruntg pushed a commit that referenced this pull request Jun 14, 2024
* Update notification icon styling

* Add option to remove button docline
lodmfjord pushed a commit that referenced this pull request Jun 14, 2024
* Update notification icon styling

* Add option to remove button docline
thordurhhh added a commit that referenced this pull request Jun 18, 2024
* Update notification icon styling

* Add option to remove button docline
kodiakhq bot added a commit that referenced this pull request Jun 18, 2024
…15255)

* fix(documents-v2): Add download URL to detail document v2 (#15194)

* fix(service-portal): Update notification icon styling (#15219)

* Update notification icon styling

* Add option to remove button docline

* fix(service-portal): Notifications - locale updates. Add cleanstring (#15239)

* Fix locale updates. Add cleanstring

* update string clean

* Update packagejson

* Update query

* Update query

* Add lang option

* Test

* Fix

* Add locale

* Test name update

* fix: force generated files

* chore: nx format:write update dirty files

* Revert test

* Remove ff

* fix: hash generated files

* fix(j-s): Null Service Reference (#15247)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* feat(native-app): Notifications final improvements (#15240)

* feat: buttons at top should not be sticky

* feat: add empty state for notifications

* fix: make sure to update unreadCount in inbox when fetching next page

* feat: add fallback icon for notifications

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* feat(consultation-portal): KAM-2522: PowerBI report added (#15251)

* fix: hash generated files (#15253)

* fix: hash generated files

* chore: nx format:write update dirty files

---------

Co-authored-by: andes-it <builders@andes.is>

* fix: remove file

* Update __config.mjs

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: lommi <jonorn@gmail.com>
Co-authored-by: andes-it <builders@andes.is>
Co-authored-by: Guðjón Guðjónsson <gudjon@kolibri.is>
Co-authored-by: Þórey Jóna <thoreyjona@gmail.com>
Co-authored-by: Karl Arnar Ægisson <korsbacka@gmail.com>

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: lommi <jonorn@gmail.com>
Co-authored-by: andes-it <builders@andes.is>
Co-authored-by: Guðjón Guðjónsson <gudjon@kolibri.is>
Co-authored-by: Þórey Jóna <thoreyjona@gmail.com>
Co-authored-by: Karl Arnar Ægisson <korsbacka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants