-
Notifications
You must be signed in to change notification settings - Fork 16.7k
chore(Network Errors): Update network errors on filter bars and charts #31811
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
74a6c1c
test(Error): stories
msyavuz a9f61e5
chore(Error Messages): update filter bar errors
msyavuz 9583cd3
Merge branch 'master' into msyavuz/update-network-errors
msyavuz 1fb351e
feat(NetworkError): add error message component
msyavuz adf4804
chore(log): remove console log
msyavuz 8d21492
chore(error): localize error
msyavuz c12852f
chore(ErrorModal): change header color
msyavuz c1f6800
test(NetworkErrorMessage): add some basic test for network error
msyavuz 60b341e
test(getClientErrorObject): add test for coverage
msyavuz 7c51b38
Merge branch 'master' into msyavuz/update-network-errors
msyavuz 88caace
Merge branch 'master' into msyavuz/update-network-errors
msyavuz d69c3ba
Merge branch 'master' into msyavuz/update-network-errors
msyavuz 7038026
chore(ErrorMessage): cleanup
msyavuz d22626f
chore(compact): add compact prop to ErrorWithStackTrace and network e…
msyavuz d73a6d2
chore(errors): compact on chart
msyavuz 5f7a0ee
chore: remove unneeded changes
msyavuz 19abff9
chore: remove unneeded changes
msyavuz 255c6d4
fix(filter): only filter value error compact
msyavuz d062294
chore(FilterValue): organize imports
msyavuz e1ffb38
test(NetworkError): fix and add some tests
msyavuz 1968189
chore(ErrorMessage): remove story covered by another pr
msyavuz a34ecbf
Update superset-frontend/src/components/ErrorMessage/FrontendNetworkE…
geido File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
superset-frontend/src/components/ErrorMessage/FrontendNetworkErrorMessage.test.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| /** | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| import { ErrorLevel, ErrorSource, ErrorTypeEnum } from '@superset-ui/core'; | ||
| import userEvent from '@testing-library/user-event'; | ||
| import { render, screen } from 'spec/helpers/testing-library'; | ||
| import FrontendNetworkErrorMessage from './FrontendNetworkErrorMessage'; | ||
|
|
||
| jest.mock( | ||
| 'src/components/Icons/Icon', | ||
| () => | ||
| ({ fileName }: { fileName: string }) => ( | ||
| <span role="img" aria-label={fileName.replace('_', '-')} /> | ||
| ), | ||
| ); | ||
|
|
||
| const mockedProps = { | ||
| error: { | ||
| error_type: ErrorTypeEnum.FRONTEND_NETWORK_ERROR, | ||
| extra: {}, | ||
| level: 'error' as ErrorLevel, | ||
| message: 'Error message', | ||
| }, | ||
| source: 'dashboard' as ErrorSource, | ||
| subtitle: 'Error message', | ||
| }; | ||
|
|
||
| test('should render', () => { | ||
| const nullExtraProps = { | ||
| ...mockedProps, | ||
| error: { | ||
| ...mockedProps.error, | ||
| extra: null, | ||
| }, | ||
| }; | ||
| const { container } = render( | ||
| <FrontendNetworkErrorMessage {...nullExtraProps} />, | ||
| ); | ||
| expect(container).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| test('should render the error message', () => { | ||
| render(<FrontendNetworkErrorMessage {...mockedProps} />, { useRedux: true }); | ||
| expect(screen.getByText('Error message')).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| test("should render error message in compact mode if 'compact' is true", () => { | ||
| render(<FrontendNetworkErrorMessage {...mockedProps} compact />, { | ||
| useRedux: true, | ||
| }); | ||
| expect(screen.queryByText('Error message')).not.toBeInTheDocument(); | ||
| userEvent.click(screen.getByRole('button')); | ||
| expect(screen.getByText('Error message')).toBeInTheDocument(); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused subtitle prop
Tell me more
What is the issue?
The 'subtitle' prop is declared but never used in the component, which contradicts the expected functionality of displaying a subtitle when provided.
Why this matters
If a consumer passes a subtitle prop, they would expect it to be displayed, leading to confusing behavior when the subtitle doesn't appear in the UI.
Suggested change ∙ Feature Preview
Either remove the unused subtitle prop or implement it in the ErrorAlert component:
💡 Does this comment miss the mark? Tell us why and Korbit will adapt to your team’s feedback.
💬 Chat with Korbit by mentioning @korbit-ai.