Skip to content

Commit fd6faaf

Browse files
authored
Release v3.1.0 (#587)
1 parent 0fdaea7 commit fd6faaf

File tree

8 files changed

+28
-26
lines changed

8 files changed

+28
-26
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## (IN PROGRESS)
44

5+
## [3.1.0](https://github.com/folio-org/stripes-acq-components/tree/v3.1.0) (2022-02-28)
6+
[Full Changelog](https://github.com/folio-org/stripes-acq-components/compare/v3.0.2...v3.1.0)
7+
58
* Use final-form "Field" component in "FieldHoldingLocation". Refs UISACQCOMP-64.
69
* Add resources to interact with Acquisition methods API. Refs UISACQCOMP-62.
710
* Rename collection field name for Acquisition method. Refs UISACQCOMP-66.

lib/AcqList/NoResultsMessage/NoResultsMessage.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useMemo } from 'react';
22
import PropTypes from 'prop-types';
3+
import { noop } from 'lodash';
34

45
import { SearchAndSortNoResultsMessage } from '@folio/stripes/smart-components';
56

@@ -17,7 +18,7 @@ export const NoResultsMessage = ({
1718
() => ({
1819
loaded: () => hasFilters && !isLoading,
1920
pending: () => isLoading,
20-
failure: () => { },
21+
failure: noop,
2122
}),
2223
[isLoading, hasFilters],
2324
);

lib/FindRecords/FindRecordsModal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useEffect } from 'react';
22
import PropTypes from 'prop-types';
33
import { FormattedMessage, useIntl } from 'react-intl';
4-
import { pickBy } from 'lodash';
4+
import { pickBy, noop } from 'lodash';
55

66
import {
77
Button,
@@ -304,5 +304,5 @@ FindRecordsModal.defaultProps = {
304304
columnWidths: {},
305305
resultsFormatter: {},
306306
isMultiSelect: false,
307-
resetData: () => {},
307+
resetData: noop,
308308
};

lib/PluginFindRecord/PluginFindRecordModal.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,6 @@ class PluginFindRecordModal extends React.Component {
286286
searchChanged,
287287
searchValue,
288288
}) => {
289-
const disableReset = () => {
290-
if (filterChanged || searchChanged) {
291-
return false;
292-
}
293-
294-
return true;
295-
};
296-
297289
return (
298290
<Paneset id={`${idPrefix}-paneset`} isRoot>
299291
{this.state.filterPaneIsVisible && (
@@ -328,7 +320,7 @@ class PluginFindRecordModal extends React.Component {
328320
<div className={css.resetButtonWrap}>
329321
<Button
330322
buttonStyle="none"
331-
disabled={disableReset()}
323+
disabled={!(filterChanged || searchChanged)}
332324
fullWidth
333325
id="clickable-reset-all"
334326
onClick={resetAll}

lib/hooks/useShowCallout/readme.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# useShowCallout
2+
3+
## Usage
4+
5+
Example of usage of callout with error and default message:
6+
```javascript
7+
const message = (
8+
<FormattedMessage
9+
id={`ui-finance.fund.actions.save.error.${errorCode}`}
10+
defaultMessage={intl.formatMessage({ id: `ui-finance.fund.actions.save.error.${ERROR_CODE_GENERIC}` })}
11+
/>
12+
);
13+
14+
showCallout({
15+
message,
16+
type: 'error',
17+
});
18+
```

lib/hooks/useShowCallout/useShowCallout.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,6 @@ import { FormattedMessage } from 'react-intl';
33

44
import { CalloutContext } from '@folio/stripes/core';
55

6-
// Example of usage of callout with error and default message:
7-
// const message = (
8-
// <FormattedMessage
9-
// id={`ui-finance.fund.actions.save.error.${errorCode}`}
10-
// defaultMessage={intl.formatMessage({ id: `ui-finance.fund.actions.save.error.${ERROR_CODE_GENERIC}` })}
11-
// />
12-
// );
13-
14-
// showCallout({
15-
// message,
16-
// type: 'error',
17-
// });
186
export const useShowCallout = () => {
197
const callout = useContext(CalloutContext);
208

lib/utils/validateURL/validateURL.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { FormattedMessage } from 'react-intl';
33

44
import { validateRequired } from '../validateRequired';
55

6-
const REGEXP_URL = new RegExp('^$|([Hh][Tt][Tt][Pp]|[Ff][Tt][Pp])([Ss])?://.+$');
6+
const REGEXP_URL = /^$|([Hh][Tt][Tt][Pp]|[Ff][Tt][Pp])([Ss])?:\/\/.+$/;
77

88
export const validateURL = value => {
99
if (value === undefined || REGEXP_URL.test(value)) return undefined;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@folio/stripes-acq-components",
3-
"version": "3.0.2",
3+
"version": "3.1.0",
44
"description": "Component library for Stripes Acquisitions modules",
55
"publishConfig": {
66
"registry": "https://repository.folio.org/repository/npm-folio/"

0 commit comments

Comments
 (0)