Skip to content

Commit

Permalink
Merge branch 'master' into UXPROD-4559-ECS
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-blazhko committed Oct 2, 2024
2 parents 3dd43f4 + 4c64216 commit 9fdbd0d
Show file tree
Hide file tree
Showing 47 changed files with 623 additions and 551 deletions.
20 changes: 15 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Change history for ui-requests

## 10.0.0 IN PROGRESS
## 9.2.0 IN PROGRESS

* Use settings/entries endpoint to get settings information. Refs UIREQ-1062.
* Use Save & close button label stripes-component translation key. Refs UIREQ-1073.
* Include single print and selection print options on results list and actions menu. Refs UIREQ-966.
* Set up default pickup service point if it is available. Refs UIREQ-1095.
* Remove bigtests from github actions. Refs UIREQ-1099.
* Requests app.: Editing requests (ECS with mod-tlr enabled). Refs UIREQ-1088.
* Requests app.: Cancelling request (ECS with mod-tlr enabled). Refs UIREQ-1090.
* Requests app.: Reorder request queue (ECS with mod-tlr enabled). Refs UIREQ-1098.
Expand All @@ -22,14 +21,25 @@
* Implement availability of "Printed" and "# Copies" columns upon "Enable view print details (Pick slips)" configuration. Refs UIREQ-1121.
* Implement availability of "Print status" filters upon "Enable view print details (Pick slips)" configuration. Refs UIREQ-1119.
* Hide Duplicate and Move action buttons in ECS env with mod-tlr enabled. Refs UIREQ-1127, UIREQ-1125.
* Fix issue with Proxy's patron group and delivery address that shown instead of Sponsor's when creating request. Refs UIREQ-1132, UIREQ-1133.
* Add missing sub-permissions to fetch staff slips records. Refs UIREQ-1129.
* Add missing sub-permissions to fetch "pick-slips" and "search-slips" records in "Requests: View, edit, cancel" permission. Refs UIREQ-1137.
* Update permissions set to be able to get item/instance information. Refs UIREQ-1148.
* Optimize performance of the "print-events-entry" API to reduce slowness during the initial call. Refs UIREQ-1130.
* *BREAKING* Migrate to new endpoints to get request types and to create a new request. Refs UIREQ-1113.
* Revert Custom "Print Status" filter code implementation. Refs UIREQ-1146.
* Add sorting to 'Printed' and '# Copies' columns in the Request App. Refs UIREQ-1140.
* Implement "Print Status" filters as server-side filters. Refs UIREQ-1147.
* Navigate to first page when saving the pick slip print log from beyond the first page. Refs UIREQ-1145.

## [9.1.2] (https://github.com/folio-org/ui-requests/tree/v9.1.2) (2024-09-13)
[Full Changelog](https://github.com/folio-org/ui-requests/compare/v9.1.1...v9.1.2)

* Remove bigtests from github actions. Refs UIREQ-1099.
* Fix issue with Proxy's patron group and delivery address that shown instead of Sponsor's when creating request. Refs UIREQ-1132, UIREQ-1133.
* Update upload-artifact actions from v1 and v2 to v4. Refs UIREQ-1150.

## [9.1.1] (https://github.com/folio-org/ui-checkin/tree/v9.1.1) (2024-03-27)
[Full Changelog](https://github.com/folio-org/ui-checkin/compare/v9.1.0...v9.1.1)
## [9.1.1] (https://github.com/folio-org/ui-requests/tree/v9.1.1) (2024-03-27)
[Full Changelog](https://github.com/folio-org/ui-requests/compare/v9.1.0...v9.1.1)

* Add support for Barcode tag with sanitize. Refs UIREQ-1080, UIREQ-1082.

Expand Down
6 changes: 3 additions & 3 deletions src/components/PrintButton/PrintButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ class PrintButton extends React.Component {
this.props.onBeforeGetContent();
}

handleBeforePrint = () => {
this.props.onBeforePrint([this.props.requestId]);
}
handleBeforePrint = async () => {
await this.props.onBeforePrint([this.props.requestId]);
};

renderTriggerButton = () => {
const fieldsToSkip = ['contentRef', 'onBeforePrint', 'onAfterPrint', 'onBeforeGetContent'];
Expand Down
15 changes: 15 additions & 0 deletions src/components/RequestsFilters/RequestsFiltersConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,19 @@ export default [
values: [],
operator: '==',
},
{
name: requestFilterTypes.PRINT_STATUS,
cql: 'printStatus',
values: [],
operator: '==',
parse: (value) => {
if (value.length === 1 && value.includes('Printed')) {
return 'printDetails.isPrinted==true';
} else if (value.length === 1 && value.includes('Not printed')) {
return 'cql.allRecords=1 NOT printDetails.isPrinted=""';
} else {
return '(cql.allRecords=1 NOT printDetails.printed="" or printDetails.printed==true)';
}
}
},
];
34 changes: 34 additions & 0 deletions src/components/RequestsFilters/RequestsFiltersConfig.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,40 @@ describe('RequestsFiltersConfig', () => {
expect(pickupServicePointFilter).toEqual(expectedResult);
});

describe('Print Status Filter configuration', () => {
it('should correctly match the filter configuration for printStatus', () => {
const printStatusFilter = filtersConfig.find(f => f.name === 'printStatus');
const expectedResult = {
name: 'printStatus',
cql: 'printStatus',
values: [],
operator: '==',
parse: expect.any(Function),
};

expect(printStatusFilter).toEqual(expectedResult);
});

it('should generate the correct query string for the "Printed" filter', () => {
const printStatusFilter = filtersConfig.find(f => f.name === 'printStatus');

expect(printStatusFilter.parse(['Printed'])).toEqual('printDetails.isPrinted==true');
});

it('should generate the correct query string for the "Not printed" filter', () => {
const printStatusFilter = filtersConfig.find(f => f.name === 'printStatus');

expect(printStatusFilter.parse(['Not printed'])).toEqual('cql.allRecords=1 NOT printDetails.isPrinted=""');
});

it('should generate the correct query string for a combination of "Printed" and "Not printed" filters', () => {
const printStatusFilter = filtersConfig.find(f => f.name === 'printStatus');

expect(printStatusFilter.parse(['Printed', 'Not printed']))
.toEqual('(cql.allRecords=1 NOT printDetails.printed="" or printDetails.printed==true)');
});
});

describe('escapingForSpecialCharactersWhichCanBreakCQL', () => {
it('should return empty string', () => {
expect(escapingForSpecialCharactersWhichCanBreakCQL()).toBe('');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const SinglePrintButtonForPickSlip = ({
pickSlipsData,
onBeforeGetContentForSinglePrintButton,
onBeforePrintForSinglePrintButton,
onAfterPrintForSinglePrintButton,
getPrintContentRef,
}) => {
const disabled = !isPrintable(request.id, pickSlipsToCheck);
Expand All @@ -28,6 +29,7 @@ const SinglePrintButtonForPickSlip = ({
requestId={request.id}
onBeforeGetContent={onBeforeGetContentForSinglePrintButton}
onBeforePrint={onBeforePrintForSinglePrintButton}
onAfterPrint={onAfterPrintForSinglePrintButton}
>
<FormattedMessage id="ui-requests.requests.printButtonLabel" />
<PrintContent
Expand All @@ -48,6 +50,7 @@ SinglePrintButtonForPickSlip.propTypes = {
pickSlipsData: PropTypes.object.isRequired,
onBeforeGetContentForSinglePrintButton: PropTypes.func.isRequired,
onBeforePrintForSinglePrintButton: PropTypes.func,
onAfterPrintForSinglePrintButton: PropTypes.func,
getPrintContentRef: PropTypes.object.isRequired,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ describe('SinglePrintButtonForPickSlip', () => {
],
onBeforeGetContentForSinglePrintButton: jest.fn(),
onBeforePrintForSinglePrintButton: jest.fn(),
onAfterPrintForSinglePrintButton: jest.fn(),
getPrintContentRef: mockAccordionStatusRef,
};

Expand Down
2 changes: 1 addition & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export const requestableItemStatuses = [
];

export const PRINT_DETAILS_COLUMNS = {
COPIES: 'printDetails.count',
COPIES: 'printDetails.printCount',
PRINTED: 'printDetails.lastPrintedDetails',
};

Expand Down
2 changes: 1 addition & 1 deletion src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('UI Requests', () => {
it('should close keyboard shortcuts modal on clicking close button', () => {
fireEvent.click(screen.getByText(labelIds.keyboardShortcuts));

const button = screen.getByRole('button', { name: /stripes-components.dismissModal/i });
const button = screen.getByLabelText('stripes-components.dismissModal');

fireEvent.click(button);

Expand Down
Loading

0 comments on commit 9fdbd0d

Please sign in to comment.