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(disable export button): Disable export button when no records available #739

Merged
merged 19 commits into from
Sep 6, 2024

Conversation

tiffanyvu
Copy link
Collaborator

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 Shot 2024-08-28 at 1 52 47 PM
Screen Shot 2024-08-28 at 1 52 36 PM

Screen.Recording.2024-08-29.at.2.13.57.PM.mov

Copy link

@codeclimate codeclimate bot left a 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.

Copy link
Contributor

github-actions bot commented Aug 29, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 54.73% 4308 / 7870
🔵 Statements 54.57% 4537 / 8313
🔵 Functions 49.15% 1042 / 2120
🔵 Branches 27.53% 813 / 2953
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
react-app/src/components/Opensearch/main/Filtering/index.tsx 20% 100% 0% 25% 12-13, 24-28, 24-28
react-app/src/components/Opensearch/main/Filtering/Export/Export.test.tsx 100% 100% 100% 100%
react-app/src/components/Opensearch/main/Filtering/Export/index.tsx 18.18% 33.33% 50% 20% 29-31, 30, 32, 34-39, 41, 43-52, 44, 46-50, 47, 47-48, 48-49, 51, 54-57, 59, 61
react-app/src/components/Tooltip/index.tsx 100% 100% 100% 100%
Generated in workflow #187

Copy link
Collaborator

@asharonbaltazar asharonbaltazar left a 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

Copy link

@codeclimate codeclimate bot left a 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.

@tiffanyvu tiffanyvu marked this pull request as ready for review September 5, 2024 19:34
Copy link

@codeclimate codeclimate bot left a 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.

Copy link

@codeclimate codeclimate bot left a 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.

Copy link

codeclimate bot commented Sep 5, 2024

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.

@tiffanyvu tiffanyvu changed the title Feature: Disable export button when no records available feat(disable export button): Disable export button when no records available #739 Sep 6, 2024
@tiffanyvu tiffanyvu changed the title feat(disable export button): Disable export button when no records available #739 feat(disable export button): Disable export button when no records available Sep 6, 2024
@tiffanyvu tiffanyvu merged commit bf9455f into main Sep 6, 2024
20 checks passed
@asharonbaltazar asharonbaltazar deleted the tiffany branch September 6, 2024 17:52
Copy link
Contributor

github-actions bot commented Sep 6, 2024

🎉 This PR is included in version 1.5.0-val.77 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants