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

UIBULKED-351 Hide Query tab - fix #389

Merged
merged 6 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions src/components/BulkEdit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,21 @@ describe('BulkEdit', () => {
renderBulkEdit();

expect(screen.getByRole('button', { name: /list.filters.identifier/ })).toBeEnabled();
expect(screen.getByRole('button', { name: /list.filters.query/ })).toBeEnabled();
// expect(screen.getByRole('button', { name: /list.filters.query/ })).toBeEnabled();
});


it('should change active filter criteria ', () => {
renderBulkEdit();

const queryButton = screen.getByRole('button', { name: /list.filters.query/ });
// const queryButton = screen.getByRole('button', { name: /list.filters.query/ });
const identifierButton = screen.getByRole('button', { name: /list.filters.identifier/ });

act(() => {
/* act(() => {
userEvent.click(queryButton);
});
}); */

expect(queryButton).toHaveAttribute('class', 'button primary');
// expect(queryButton).toHaveAttribute('class', 'button primary');

act(() => {
userEvent.click(identifierButton);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { FormattedMessage } from 'react-intl';
import PropTypes from 'prop-types';
import { CRITERIA } from '../../../../constants';

const FilterTabs = ({ criteria, hasQueryViewPerms, onCriteriaChange }) => {
const FilterTabs = ({ criteria, hasLogViewPerms, onCriteriaChange }) => {
const buttonStyleActive = (criteriaToCompare) => (criteria === criteriaToCompare ? 'primary' : 'default');

return (
Expand All @@ -15,31 +15,30 @@ const FilterTabs = ({ criteria, hasQueryViewPerms, onCriteriaChange }) => {
>
<FormattedMessage id="ui-bulk-edit.list.filters.identifier" />
</Button>
{hasQueryViewPerms && (
{/* temporarily commented out because of https://issues.folio.org/browse/UIBULKED-351 */}
{/* {hasQueryViewPerms && (
<Button
buttonStyle={buttonStyleActive(CRITERIA.QUERY)}
onClick={() => onCriteriaChange(CRITERIA.QUERY)}
>
<FormattedMessage id="ui-bulk-edit.list.filters.query" />
</Button>
)}
{/* temporarily commented out because of https://issues.folio.org/browse/UIBULKED-351 */}
{/* {hasLogViewPerms && (
)} */}
{hasLogViewPerms && (
<Button
buttonStyle={buttonStyleActive(CRITERIA.LOGS)}
onClick={() => onCriteriaChange(CRITERIA.LOGS)}
>
<FormattedMessage id="ui-bulk-edit.list.filters.logs" />
</Button>
)} */}
)}
</>
);
};

FilterTabs.propTypes = {
criteria: PropTypes.string,
hasLogViewPerms: PropTypes.bool,
hasQueryViewPerms: PropTypes.bool,
onCriteriaChange: PropTypes.func,
};

Expand Down
Loading