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

feat:[UIUX-707] remove box icon from the empty and other error state message #2253

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

go-jay
Copy link
Contributor

@go-jay go-jay commented Jun 6, 2024

Description

https://paladincloud.atlassian.net/browse/UIUX-707

Solution:

  1. Remove the box icon in the empty state message in associated policies and policy violation summary widget
  2. Change empty state message in the associated policies widget to “There are no active policies for this asset type“
  3. Change empty state message in the policy violation summary to “There are no violations for this asset“

Extra:

  1. In the violations by severity widget on the dashboard screen, we have removed the call-to-action (CTA) during the empty state.
Screenshot 2024-06-07 at 12 19 24 PM Screenshot 2024-06-07 at 12 19 47 PM

Type of change

  • New feature (non-breaking change which adds functionality)

Does this change include any breaking change? If Yes, please elaborate.

No

How Has This Been Tested?

  • Unit testing

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The commit message/PR follows our guidelines

Other information:

Summary by CodeRabbit

  • New Features

    • Introduced a new message indicating no violations for a specific asset.
  • Bug Fixes

    • Updated conditional rendering in compliance module to handle data errors more effectively.
    • Corrected error message display by removing the unnecessary image tag.
  • Style

    • Added a font-size property to error message styling for improved readability.
  • Improvements

    • Enhanced compliance dashboard by adding a method to fetch compliance data automatically on initialization.

Copy link
Contributor

coderabbitai bot commented Jun 6, 2024

Walkthrough

The recent updates to the web application involve refining error messages, enhancing compliance data handling, and improving UI elements. Notable changes include updating error message text and formatting, adding a new method to fetch compliance data, and modifying the rendering logic of certain UI components. These changes aim to improve user experience and data clarity.

Changes

File Path Change Summary
.../asset-details/asset-details.component.ts Updated this.violationErrorMessage assignment from 'noDataAvailable' to 'noViolationsForAsset'.
.../compliance/card/card.component.html Modified conditional rendering of mat-card-actions based on card.footer presence and dataError absence.
.../compliance/compliance-dashboard/compliance-dashboard.component.ts Added getComplianceData() method to ngOnInit() function.
.../shared/constants/messages.ts Removed title and image fields from noPolicyFound object; added noViolationsForAsset object.
.../shared/error-message/error-message.component.css Added font-size: 16px; to the CSS rule for a specific class.
.../shared/error-message/error-message.component.html Removed the <img> tag bound to errorMessages.image.

Poem

In code's embrace, we tweak and mend,
Compliance data, we now extend.
No violations, clear and bright,
Error messages, set just right.
With fonts refined and cards anew,
Our web app shines, for all to view.
🌟🐰


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
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 UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 01ef269 and 4cae5b9.

Files selected for processing (2)
  • webapp/src/app/shared/error-message/error-message.component.css (1 hunks)
  • webapp/src/app/shared/error-message/error-message.component.html (1 hunks)
Files skipped from review due to trivial changes (1)
  • webapp/src/app/shared/error-message/error-message.component.html
Additional comments not posted (1)
webapp/src/app/shared/error-message/error-message.component.css (1)

52-52: LGTM! Ensure the new font size is consistent across different devices and screen sizes.

plyubich
plyubich previously approved these changes Jun 6, 2024
Copy link

sonarqubecloud bot commented Jun 7, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4cae5b9 and 183123a.

Files selected for processing (4)
  • webapp/src/app/pacman-features/modules/assets/asset-details/asset-details.component.ts (1 hunks)
  • webapp/src/app/pacman-features/modules/compliance/card/card.component.html (1 hunks)
  • webapp/src/app/pacman-features/modules/compliance/compliance-dashboard/compliance-dashboard.component.ts (1 hunks)
  • webapp/src/app/shared/constants/messages.ts (2 hunks)
Additional context used
Biome
webapp/src/app/pacman-features/modules/compliance/compliance-dashboard/compliance-dashboard.component.ts

[error] 510-510: Avoid the delete operator which can impact performance. (lint/performance/noDelete)

Unsafe fix: Use an undefined assignment instead.

Additional comments not posted (3)
webapp/src/app/pacman-features/modules/compliance/card/card.component.html (1)

42-42: LGTM! The conditional rendering logic for mat-card-actions is correctly updated to depend on card.footer and the absence of dataError.

webapp/src/app/shared/constants/messages.ts (1)

134-136: LGTM! The changes to the MESSAGES object, including the removal of title and image fields from noPolicyFound and the addition of noViolationsForAsset, align with the PR objectives to simplify error messages.

webapp/src/app/pacman-features/modules/assets/asset-details/asset-details.component.ts (1)

682-682: LGTM! The update to violationErrorMessage to use 'noViolationsForAsset' aligns with the PR objectives to simplify error messages.

@@ -804,6 +804,7 @@ export class ComplianceDashboardComponent implements OnInit, OnDestroy {
this.policyDataError = '';
this.updatePoliciesTable();
this.getDistributionBySeverity();
this.getComplianceData();
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

Ensure proper error handling in getComplianceData.

  • The current implementation of getComplianceData does not include comprehensive error handling. While it checks for an error in the response and throws it, there is no catch block or subscription error handling to manage potential errors from the getOverallCompliance service call.

Category:

Analysis chain

Ensure proper error handling in getComplianceData.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that error handling is implemented in `getComplianceData`.

# Test: Search for error handling in the method. Expect: Error handling code.
rg --type typescript $'getComplianceData' webapp/src/app/pacman-features/modules/compliance/compliance-dashboard/compliance-dashboard.component.ts

Length of output: 180



Script:

#!/bin/bash
# Description: Verify that error handling is implemented in `getComplianceData`.

# Test: Search for error handling in the method. Expect: Error handling code.
rg --type ts 'getComplianceData' webapp/src/app/pacman-features/modules/compliance/compliance-dashboard/compliance-dashboard.component.ts

Length of output: 205



Script:

#!/bin/bash
# Description: Extract the full implementation of the `getComplianceData` method to verify error handling.

# Test: Use ast-grep to extract the method implementation.
ast-grep --lang typescript --pattern $'class ComplianceDashboardComponent {
  $$$
  private getComplianceData() {
    $$$
  }
  $$$  
}' webapp/src/app/pacman-features/modules/compliance/compliance-dashboard/compliance-dashboard.component.ts

Length of output: 242



Script:

#!/bin/bash
# Description: Extract the full implementation of the `getComplianceData` method to verify error handling.

# Test: Use rg with context lines to extract the method implementation.
rg 'private getComplianceData' -A 20 -B 2 webapp/src/app/pacman-features/modules/compliance/compliance-dashboard/compliance-dashboard.component.ts

Length of output: 1024

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