File tree Expand file tree Collapse file tree 8 files changed +28
-26
lines changed Expand file tree Collapse file tree 8 files changed +28
-26
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## (IN PROGRESS)
4
4
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
+
5
8
* Use final-form "Field" component in "FieldHoldingLocation". Refs UISACQCOMP-64.
6
9
* Add resources to interact with Acquisition methods API. Refs UISACQCOMP-62.
7
10
* Rename collection field name for Acquisition method. Refs UISACQCOMP-66.
Original file line number Diff line number Diff line change 1
1
import React , { useMemo } from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
+ import { noop } from 'lodash' ;
3
4
4
5
import { SearchAndSortNoResultsMessage } from '@folio/stripes/smart-components' ;
5
6
@@ -17,7 +18,7 @@ export const NoResultsMessage = ({
17
18
( ) => ( {
18
19
loaded : ( ) => hasFilters && ! isLoading ,
19
20
pending : ( ) => isLoading ,
20
- failure : ( ) => { } ,
21
+ failure : noop ,
21
22
} ) ,
22
23
[ isLoading , hasFilters ] ,
23
24
) ;
Original file line number Diff line number Diff line change 1
1
import React , { useEffect } from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
3
import { FormattedMessage , useIntl } from 'react-intl' ;
4
- import { pickBy } from 'lodash' ;
4
+ import { pickBy , noop } from 'lodash' ;
5
5
6
6
import {
7
7
Button ,
@@ -304,5 +304,5 @@ FindRecordsModal.defaultProps = {
304
304
columnWidths : { } ,
305
305
resultsFormatter : { } ,
306
306
isMultiSelect : false ,
307
- resetData : ( ) => { } ,
307
+ resetData : noop ,
308
308
} ;
Original file line number Diff line number Diff line change @@ -286,14 +286,6 @@ class PluginFindRecordModal extends React.Component {
286
286
searchChanged,
287
287
searchValue,
288
288
} ) => {
289
- const disableReset = ( ) => {
290
- if ( filterChanged || searchChanged ) {
291
- return false ;
292
- }
293
-
294
- return true ;
295
- } ;
296
-
297
289
return (
298
290
< Paneset id = { `${ idPrefix } -paneset` } isRoot >
299
291
{ this . state . filterPaneIsVisible && (
@@ -328,7 +320,7 @@ class PluginFindRecordModal extends React.Component {
328
320
< div className = { css . resetButtonWrap } >
329
321
< Button
330
322
buttonStyle = "none"
331
- disabled = { disableReset ( ) }
323
+ disabled = { ! ( filterChanged || searchChanged ) }
332
324
fullWidth
333
325
id = "clickable-reset-all"
334
326
onClick = { resetAll }
Original file line number Diff line number Diff line change
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
+ ```
Original file line number Diff line number Diff line change @@ -3,18 +3,6 @@ import { FormattedMessage } from 'react-intl';
3
3
4
4
import { CalloutContext } from '@folio/stripes/core' ;
5
5
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
- // });
18
6
export const useShowCallout = ( ) => {
19
7
const callout = useContext ( CalloutContext ) ;
20
8
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { FormattedMessage } from 'react-intl';
3
3
4
4
import { validateRequired } from '../validateRequired' ;
5
5
6
- const REGEXP_URL = new RegExp ( ' ^$|([Hh][Tt][Tt][Pp]|[Ff][Tt][Pp])([Ss])?:/ /.+$' ) ;
6
+ const REGEXP_URL = / ^ $ | ( [ H h ] [ T t ] [ T t ] [ P p ] | [ F f ] [ T t ] [ P p ] ) ( [ S s ] ) ? : \/ \ / .+ $ / ;
7
7
8
8
export const validateURL = value => {
9
9
if ( value === undefined || REGEXP_URL . test ( value ) ) return undefined ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @folio/stripes-acq-components" ,
3
- "version" : " 3.0.2 " ,
3
+ "version" : " 3.1.0 " ,
4
4
"description" : " Component library for Stripes Acquisitions modules" ,
5
5
"publishConfig" : {
6
6
"registry" : " https://repository.folio.org/repository/npm-folio/"
You can’t perform that action at this time.
0 commit comments