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(InventoryTable): RHINENG-15246 - Reword export dropdown items #2301

Merged
merged 4 commits into from
Jan 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cypress/support/component.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import '@patternfly/patternfly/patternfly.scss';
import '@cypress/code-coverage/support';
import './commands';

import chrome from '../../config/overrideChrome';

// eslint-disable-next-line rulesdir/no-chrome-api-call-from-window
window.insights = { chrome };
17 changes: 4 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
"@patternfly/react-icons": "^5.3.2",
"@patternfly/react-table": "^5.3.3",
"@redhat-cloud-services/frontend-components": "^5.1.2",
"@redhat-cloud-services/frontend-components-config-utilities": "^4.0.6",
"@redhat-cloud-services/frontend-components-notifications": "^4.1.9",
"@redhat-cloud-services/frontend-components-utilities": "^5.0.6",
"@redhat-cloud-services/host-inventory-client": "1.2.13",
6 changes: 3 additions & 3 deletions src/components/InventoryTable/EntityTableToolbar.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import '@testing-library/jest-dom';
import { render, screen, waitFor } from '@testing-library/react';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import debounce from 'lodash/debounce';
import React from 'react';
@@ -910,11 +910,11 @@ describe('EntityTableToolbar', () => {

await userEvent.click(
screen.queryByRole('menuitem', {
name: 'Export to CSV',
name: 'Export all systems to CSV',
})
);

await waitFor(() => expect(axiosPostMock).toHaveBeenCalled());
expect(axiosPostMock).toHaveBeenCalled();
});
});
});
Original file line number Diff line number Diff line change
@@ -10,6 +10,9 @@ import { buildExportRequestJson, downloadFile } from './helpers';
import useExportApi from './useExportApi';
import useExportDownloadCheck from './useExportDownloadCheck';

const CSV_ITEM_TEXT = 'Export all systems to CSV';
const JSON_ITEM_TEXT = 'Export all systems to JSON';

/**
* A hook encapsulating functionality to provide an export configuration for the InventoryTable to request an export.
*
@@ -56,6 +59,10 @@ const useInventoryExport = ({ filters = {} } = {}) => {
);

return {
itemTexts: {
csv: CSV_ITEM_TEXT,
json: JSON_ITEM_TEXT,
},
onSelect,
};
};