-
Notifications
You must be signed in to change notification settings - Fork 3
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(disable export button): Disable export button when no records available #739
Conversation
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.
The PR diff size of 32280 lines exceeds the maximum allowed for the inline comments feature.
Coverage Report
File Coverage
|
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.
LGTM. Left a few comments
react-app/src/components/Opensearch/main/Filtering/Export/Export.test.tsx
Outdated
Show resolved
Hide resolved
react-app/src/components/Opensearch/main/Filtering/Export/index.tsx
Outdated
Show resolved
Hide resolved
…ven if button is enabled
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.
The PR diff size of 32283 lines exceeds the maximum allowed for the inline comments feature.
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.
The PR diff size of 32283 lines exceeds the maximum allowed for the inline comments feature.
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.
The PR diff size of 32283 lines exceeds the maximum allowed for the inline comments feature.
Code Climate has analyzed commit 12c5ed0 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 90.4% (50% is the threshold). This pull request will bring the total coverage in the repository to 54.7% (0.1% change). View more on Code Climate. |
🎉 This PR is included in version 1.5.0-val.77 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Purpose
When there are no records to display in the Dashboard page, the "Export" button is falsely enabled. If a user tries to export the records, the button infinitely loads and it is not obvious there is an error.
Linked Issues to Close
https://qmacbis.atlassian.net/browse/OY2-28648?atlOrigin=eyJpIjoiYmZkOTIxMDg2YmYwNDgxN2E5Y2E4OWFjNmFiZDE4MjQiLCJwIjoiaiJ9
Approach
To replicate this error there should be no records available or simply typing an invalid field in the search bar that will return no records. The "Export" button will now be disabled and if hovered, a tooltip will appear telling users there are no records available to export.
Assorted Notes/Considerations/Learning
When writing the unit tests for this component, I ran into an issue while trying to render the OsExportData component stating that a function within the file (useOsUrl) was not a function. This was due to me using the automatic import VSCode suggested for the component instead of importing it with "@/". The function inside the component is imported by the "@/" syntax.
Screen.Recording.2024-08-29.at.2.13.57.PM.mov