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

upcoming: [DI-18419] - API error handling for global filters and dashboard component in ACLP #11170

Conversation

venkymano-akamai
Copy link
Contributor

@venkymano-akamai venkymano-akamai commented Oct 28, 2024

Description 📝

Added code for handling API errors in global filters and dashboard component

Changes 🔄

  1. Added code for handling API errors in global filters
  2. Added error handling code in dashboard component
  3. Added default values for widget color and chart type

Target release date 🗓️

11-11-2024

Preview 📷

Updates Updates
Screenshot 2024-10-28 at 4 34 23 PM Screenshot 2024-10-28 at 4 35 52 PM
Screenshot 2024-10-28 at 4 36 30 PM Screenshot 2024-10-28 at 4 37 20 PM
Screenshot 2024-10-28 at 4 38 51 PM Screenshot 2024-10-28 at 4 40 02 PM

How to test 🧪

  1. Login as mock user as some of the endpoints are not enabled in production
  2. Open inspect screen
  3. Navigate to monitor tab
  4. You can use the serverHandler.ts where our mocks are present, in each of the API's
    (monitor/services, monitor/services/:serviceType/dashboards, /regions, linode/instances in case of linode dashboard, databases/instances incase of dbaas dashboard) instead of returning a valid response, you can return HttpResponse.error() and see the error messages one by one.

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@venkymano-akamai venkymano-akamai marked this pull request as ready for review October 28, 2024 14:27
@venkymano-akamai venkymano-akamai requested a review from a team as a code owner October 28, 2024 14:27
@venkymano-akamai venkymano-akamai requested review from dwiley-akamai and hkhalil-akamai and removed request for a team October 28, 2024 14:27
@jaalah-akamai jaalah-akamai self-requested a review October 28, 2024 17:43
@jaalah-akamai
Copy link
Contributor

This should be ready for review from the team ✅

@@ -105,12 +107,20 @@ export const CloudPulseDashboard = (props: DashboardProperties) => {
Boolean(resourceList)
);

if (isDashboardApiError) {
return renderErrorState('Failed to fetch the dashboard details');
Copy link
Contributor

Choose a reason for hiding this comment

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

For this and other errors: it's convention to end error messages with a period.

<ErrorState errorText="Failed to get jwe token" />
</Grid>
);
return renderErrorState('Failed to get jwe token');
Copy link
Contributor

Choose a reason for hiding this comment

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

Should "jwe" be capitalized? Also, since this is a user-facing message, maybe we should remove "jwe" altogether?

Suggested change
return renderErrorState('Failed to get jwe token');
return renderErrorState('Failed to get token.');

}

if (dashboardsError.length > 0) {
return `Unable to load ${dashboardsError.slice(0, -1)}`;
return `Failed to fetch the dashboards`;
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use regular single quotes here instead of backticks since there's no string interpolation now.

Copy link

github-actions bot commented Oct 28, 2024

Coverage Report:
Base Coverage: 87.16%
Current Coverage: 87.16%

@venkymano-akamai
Copy link
Contributor Author

venkymano-akamai commented Oct 29, 2024

@dwiley-akamai / @hkhalil-akamai , addressed the comments and added error messages as per suggestion from tech writer, please check once

Copy link
Contributor

@hkhalil-akamai hkhalil-akamai left a comment

Choose a reason for hiding this comment

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

Thanks for consulting a writer. Included a few possible improvements.

@@ -16,7 +16,7 @@ export const CloudPulseDashboardRenderer = React.memo(
const { dashboard, filterValue, timeDuration } = props;

const selectDashboardAndFilterMessage =
'Select Dashboard and filters to visualize metrics.';
'Select dashboard and filters to visualize metrics.';
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we consult the tech writer about this suggestion?

Suggested change
'Select dashboard and filters to visualize metrics.';
'Select a dashboard and filters to visualize metrics.';

@@ -129,7 +127,7 @@ export const RenderWidgets = React.memo(
!Boolean(resourceList?.length)
) {
return renderPlaceHolder(
'Select Dashboard, Region and Resource to visualize metrics'
'Select dashboard and filters to visualize metrics.'
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above -- could this be more appropriate? I am not sure.

Suggested change
'Select dashboard and filters to visualize metrics.'
'Select a dashboard and filters to visualize metrics.'

@bnussman-akamai bnussman-akamai added Approved Multiple approvals and ready to merge! and removed Ready for Review labels Oct 30, 2024
@bnussman-akamai bnussman-akamai merged commit 898d3bf into linode:develop Nov 1, 2024
23 checks passed
Copy link

cypress bot commented Nov 1, 2024

Cloud Manager E2E    Run #6770

Run Properties:  status check passed Passed #6770  •  git commit 898d3bf784: upcoming: [DI-18419] - API error handling for global filters and dashboard compo...
Project Cloud Manager E2E
Branch Review develop
Run status status check passed Passed #6770
Run duration 26m 43s
Commit git commit 898d3bf784: upcoming: [DI-18419] - API error handling for global filters and dashboard compo...
Committer venkatmano-akamai
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 2
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 445
View all changes introduced in this branch ↗︎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! CloudPulse
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants