@@ -42,15 +42,10 @@ const InstanceMovement = ({
};
InstanceMovement.propTypes = {
- instanceFrom: PropTypes.object,
- instanceTo: PropTypes.object,
onClose: PropTypes.func.isRequired,
moveHoldings: PropTypes.func.isRequired,
-};
-
-InstanceMovement.defaultProps = {
- instanceFrom: {},
- instanceTo: {},
+ instanceFrom: PropTypes.object,
+ instanceTo: PropTypes.object,
};
export default InstanceMovement;
diff --git a/src/Instance/InstanceMovement/InstanceMovementDetails/InstanceMovementDetails.js b/src/Instance/InstanceMovement/InstanceMovementDetails/InstanceMovementDetails.js
index 339048e5e..5d7d07f7d 100644
--- a/src/Instance/InstanceMovement/InstanceMovementDetails/InstanceMovementDetails.js
+++ b/src/Instance/InstanceMovement/InstanceMovementDetails/InstanceMovementDetails.js
@@ -14,10 +14,10 @@ import { HoldingsListContainer } from '../../HoldingsList';
import InstanceMovementDetailsActions from './InstanceMovementDetailsActions';
const InstanceMovementDetails = ({
- instance,
onClose,
hasMarc,
- id,
+ instance = {},
+ id = 'movement-instance-details',
}) => {
const stripes = useStripes();
@@ -85,15 +85,10 @@ const InstanceMovementDetails = ({
};
InstanceMovementDetails.propTypes = {
- instance: PropTypes.object,
- hasMarc: PropTypes.bool,
onClose: PropTypes.func.isRequired,
+ hasMarc: PropTypes.bool,
+ instance: PropTypes.object,
id: PropTypes.string,
};
-InstanceMovementDetails.defaultProps = {
- instance: {},
- id: 'movement-instance-details',
-};
-
export default InstanceMovementDetails;
diff --git a/src/Instance/InstanceMovement/InstanceMovementDetails/InstanceMovementDetailsActions.js b/src/Instance/InstanceMovement/InstanceMovementDetails/InstanceMovementDetailsActions.js
index a8eecf02e..43b0d58e1 100644
--- a/src/Instance/InstanceMovement/InstanceMovementDetails/InstanceMovementDetailsActions.js
+++ b/src/Instance/InstanceMovement/InstanceMovementDetails/InstanceMovementDetailsActions.js
@@ -18,8 +18,8 @@ import {
const InstanceMovementDetailsActions = ({
onToggle,
- instance,
hasMarc,
+ instance = {},
}) => {
const history = useHistory();
const location = useLocation();
@@ -86,8 +86,4 @@ InstanceMovementDetailsActions.propTypes = {
hasMarc: PropTypes.bool,
};
-InstanceMovementDetailsActions.defaultProps = {
- instance: {},
-};
-
export default InstanceMovementDetailsActions;
diff --git a/src/Instance/InstanceMovement/InstanceMovementDetails/InstanceMovementDetailsContainer.js b/src/Instance/InstanceMovement/InstanceMovementDetails/InstanceMovementDetailsContainer.js
index 68ba2179b..e968d217a 100644
--- a/src/Instance/InstanceMovement/InstanceMovementDetails/InstanceMovementDetailsContainer.js
+++ b/src/Instance/InstanceMovement/InstanceMovementDetails/InstanceMovementDetailsContainer.js
@@ -9,10 +9,10 @@ import { stripesConnect } from '@folio/stripes/core';
import InstanceMovementDetails from './InstanceMovementDetails';
const InstanceMovementDetailsContainer = ({
- instance,
onClose,
mutator,
- id,
+ instance = {},
+ id = 'movement-instance-details',
}) => {
const [marc, setMarc] = useState();
@@ -33,17 +33,12 @@ const InstanceMovementDetailsContainer = ({
};
InstanceMovementDetailsContainer.propTypes = {
- instance: PropTypes.object,
onClose: PropTypes.func.isRequired,
mutator: PropTypes.object.isRequired,
+ instance: PropTypes.object,
id: PropTypes.string,
};
-InstanceMovementDetailsContainer.defaultProps = {
- instance: {},
- id: 'movement-instance-details',
-};
-
InstanceMovementDetailsContainer.manifest = Object.freeze({
marcRecord: {
type: 'okapi',
diff --git a/src/Instance/ItemsList/ItemsList.js b/src/Instance/ItemsList/ItemsList.js
index e6fefd4e7..6e975addf 100644
--- a/src/Instance/ItemsList/ItemsList.js
+++ b/src/Instance/ItemsList/ItemsList.js
@@ -155,18 +155,18 @@ const rowMetadata = ['id', 'holdingsRecordId'];
const ItemsList = ({
holding,
- items,
setOffset,
setSorting,
- total,
- draggable,
- offset,
- isItemsDragSelected,
selectItemsForDrag,
+ isItemsDragSelected,
getDraggingItems,
- isFetching,
isBarcodeAsHotlink,
tenantId,
+ items = [],
+ total = 0,
+ draggable = false,
+ offset = 0,
+ isFetching = false,
}) => {
const { boundWithHoldings: holdings, isLoading } = useBoundWithHoldings(items, tenantId);
const holdingsMapById = keyBy(holdings, 'id');
@@ -264,22 +264,18 @@ const ItemsList = ({
ItemsList.propTypes = {
holding: PropTypes.object.isRequired,
- items: PropTypes.arrayOf(PropTypes.object),
setOffset: PropTypes.func.isRequired,
setSorting: PropTypes.func.isRequired,
- offset: PropTypes.number,
- total: PropTypes.number,
- draggable: PropTypes.bool,
selectItemsForDrag: PropTypes.func.isRequired,
isItemsDragSelected: PropTypes.func.isRequired,
getDraggingItems: PropTypes.func.isRequired,
- isFetching: PropTypes.bool,
- tenantId: PropTypes.string,
isBarcodeAsHotlink: PropTypes.bool,
-};
-
-ItemsList.defaultProps = {
- items: [],
+ tenantId: PropTypes.string,
+ items: PropTypes.arrayOf(PropTypes.object),
+ offset: PropTypes.number,
+ total: PropTypes.number,
+ draggable: PropTypes.bool,
+ isFetching: PropTypes.bool,
};
export default ItemsList;
diff --git a/src/components/AdministrativeNoteList/AdministrativeNoteList.js b/src/components/AdministrativeNoteList/AdministrativeNoteList.js
index 3fb89b5c0..f5cad82a6 100644
--- a/src/components/AdministrativeNoteList/AdministrativeNoteList.js
+++ b/src/components/AdministrativeNoteList/AdministrativeNoteList.js
@@ -23,7 +23,7 @@ const formatter = {
};
const AdministrativeNoteList = ({
- administrativeNotes,
+ administrativeNotes = [],
}) => {
const intl = useIntl();
const columnMapping = useMemo(() => getColumnMapping(intl), []);
@@ -48,8 +48,4 @@ AdministrativeNoteList.propTypes = {
administrativeNotes: PropTypes.arrayOf(PropTypes.string),
};
-AdministrativeNoteList.defaultProps = {
- administrativeNotes: [],
-};
-
export default AdministrativeNoteList;
diff --git a/src/components/FacetOptionFormatter/FacetOptionFormatter.js b/src/components/FacetOptionFormatter/FacetOptionFormatter.js
index 7cb1d7abd..e9039a446 100644
--- a/src/components/FacetOptionFormatter/FacetOptionFormatter.js
+++ b/src/components/FacetOptionFormatter/FacetOptionFormatter.js
@@ -9,7 +9,10 @@ const propTypes = {
searchTerm: PropTypes.string,
};
-const FacetOptionFormatter = ({ option, searchTerm }) => {
+const FacetOptionFormatter = ({
+ option = null,
+ searchTerm = '',
+}) => {
if (!option) {
return null;
}
@@ -26,9 +29,4 @@ const FacetOptionFormatter = ({ option, searchTerm }) => {
FacetOptionFormatter.propTypes = propTypes;
-FacetOptionFormatter.defaultProps = {
- option: null,
- searchTerm: '',
-};
-
export default FacetOptionFormatter;
diff --git a/src/components/FilterNavigation/FilterNavigation.js b/src/components/FilterNavigation/FilterNavigation.js
index d07652469..61b6221d5 100644
--- a/src/components/FilterNavigation/FilterNavigation.js
+++ b/src/components/FilterNavigation/FilterNavigation.js
@@ -16,8 +16,8 @@ import { useLastSearchTerms } from '../../hooks';
const FilterNavigation = ({
data,
- segment,
onChange,
+ segment = segments.instances,
}) => {
const { getLastSearch } = useLastSearchTerms();
@@ -55,12 +55,8 @@ const FilterNavigation = ({
FilterNavigation.propTypes = {
data: PropTypes.object.isRequired,
- segment: PropTypes.string,
onChange: PropTypes.func,
-};
-
-FilterNavigation.defaultProps = {
- segment: segments.instances,
+ segment: PropTypes.string,
};
export default FilterNavigation;
diff --git a/src/components/WarningMessage/WarningMessage.js b/src/components/WarningMessage/WarningMessage.js
index 152239fc5..05b8d8564 100644
--- a/src/components/WarningMessage/WarningMessage.js
+++ b/src/components/WarningMessage/WarningMessage.js
@@ -18,7 +18,12 @@ const renderIcon = (icon, iconClassName) => (
/>
);
-const WarningMessage = ({ id, icon, fill, iconPosition }) => (
+const WarningMessage = ({
+ id,
+ icon = 'exclamation-circle',
+ iconPosition = 'start',
+ fill = false,
+}) => (
{iconPosition === 'start' && renderIcon(icon, css.iconStart)}
@@ -33,10 +38,4 @@ WarningMessage.propTypes = {
fill: PropTypes.bool,
};
-WarningMessage.defaultProps = {
- icon: 'exclamation-circle',
- iconPosition: 'start',
- fill: false,
-};
-
export default WarningMessage;
diff --git a/src/edit/InstanceForm.js b/src/edit/InstanceForm.js
index f0571a8de..9a2c148ce 100644
--- a/src/edit/InstanceForm.js
+++ b/src/edit/InstanceForm.js
@@ -181,6 +181,42 @@ class InstanceForm extends React.Component {
},
});
+ static propTypes = {
+ onClose: PropTypes.func, // eslint-disable-line react/no-unused-prop-types
+ newinstance: PropTypes.bool, // eslint-disable-line react/no-unused-prop-types
+ handleSubmit: PropTypes.func.isRequired,
+ pristine: PropTypes.bool,
+ submitting: PropTypes.bool,
+ onCancel: PropTypes.func,
+ initialValues: PropTypes.object,
+ referenceTables: PropTypes.object.isRequired,
+ copy: PropTypes.bool,
+ setKeepEditing: PropTypes.func,
+ showKeepEditingButton: PropTypes.bool,
+ stripes: PropTypes.shape({
+ connect: PropTypes.func.isRequired,
+ locale: PropTypes.string.isRequired,
+ logger: PropTypes.object.isRequired,
+ }).isRequired,
+ resources: PropTypes.shape({
+ instanceBlockedFields: PropTypes.shape({
+ records: PropTypes.arrayOf(PropTypes.object),
+ }),
+ }),
+ instanceSource: PropTypes.string,
+ history: PropTypes.object.isRequired,
+ id: PropTypes.string,
+ httpError: PropTypes.object,
+ };
+
+ static defaultProps = {
+ instanceSource: 'FOLIO',
+ initialValues: {},
+ id: 'instance-form',
+ showKeepEditingButton: false,
+ setKeepEditing: noop,
+ };
+
constructor(props) {
super(props);
@@ -852,41 +888,6 @@ class InstanceForm extends React.Component {
}
}
-InstanceForm.propTypes = {
- onClose: PropTypes.func, // eslint-disable-line react/no-unused-prop-types
- newinstance: PropTypes.bool, // eslint-disable-line react/no-unused-prop-types
- handleSubmit: PropTypes.func.isRequired,
- pristine: PropTypes.bool,
- submitting: PropTypes.bool,
- onCancel: PropTypes.func,
- initialValues: PropTypes.object,
- referenceTables: PropTypes.object.isRequired,
- copy: PropTypes.bool,
- setKeepEditing: PropTypes.func,
- showKeepEditingButton: PropTypes.bool,
- stripes: PropTypes.shape({
- connect: PropTypes.func.isRequired,
- locale: PropTypes.string.isRequired,
- logger: PropTypes.object.isRequired,
- }).isRequired,
- resources: PropTypes.shape({
- instanceBlockedFields: PropTypes.shape({
- records: PropTypes.arrayOf(PropTypes.object),
- }),
- }),
- instanceSource: PropTypes.string,
- history: PropTypes.object.isRequired,
- id: PropTypes.string,
- httpError: PropTypes.object,
-};
-InstanceForm.defaultProps = {
- instanceSource: 'FOLIO',
- initialValues: {},
- id: 'instance-form',
- showKeepEditingButton: false,
- setKeepEditing: noop,
-};
-
export default withRouter(stripesFinalForm({
validate,
navigationCheck: true,
diff --git a/src/edit/alternativeTitles.js b/src/edit/alternativeTitles.js
index 42c2a0a47..dfdf9f0d3 100644
--- a/src/edit/alternativeTitles.js
+++ b/src/edit/alternativeTitles.js
@@ -16,15 +16,14 @@ import {
Col,
} from '@folio/stripes/components';
-const AlternativeTitles = props => {
+const AlternativeTitles = ({
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+ alternativeTitleTypes = [],
+}) => {
const { formatMessage } = useIntl();
- const {
- alternativeTitleTypes,
- canAdd,
- canEdit,
- canDelete,
- } = props;
const alternativeTitleTypeOptions = alternativeTitleTypes.map(it => ({
label: it.name,
value: it.id,
@@ -99,10 +98,5 @@ AlternativeTitles.propTypes = {
canEdit: PropTypes.bool,
canDelete: PropTypes.bool,
};
-AlternativeTitles.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
export default AlternativeTitles;
diff --git a/src/edit/classificationFields.js b/src/edit/classificationFields.js
index 66fff796a..8e910b5f3 100644
--- a/src/edit/classificationFields.js
+++ b/src/edit/classificationFields.js
@@ -16,15 +16,14 @@ import {
Label,
} from '@folio/stripes/components';
-const ClassificationFields = props => {
+const ClassificationFields = ({
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+ classificationTypes = [],
+}) => {
const { formatMessage } = useIntl();
- const {
- classificationTypes,
- canAdd,
- canEdit,
- canDelete,
- } = props;
const classificationTypeOptions = classificationTypes.map(it => ({
label: it.name,
value: it.id,
@@ -97,10 +96,5 @@ ClassificationFields.propTypes = {
canEdit: PropTypes.bool,
canDelete: PropTypes.bool,
};
-ClassificationFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
export default ClassificationFields;
diff --git a/src/edit/contributorFields.js b/src/edit/contributorFields.js
index f7a9b2533..842f2dbc4 100644
--- a/src/edit/contributorFields.js
+++ b/src/edit/contributorFields.js
@@ -18,16 +18,15 @@ import {
import PrimaryToggleButton from './components/PrimaryToggleButton';
-const ContributorFields = props => {
+const ContributorFields = ({
+ contributorNameTypes = [],
+ contributorTypes = [],
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+}) => {
const { formatMessage } = useIntl();
- const {
- contributorNameTypes,
- contributorTypes,
- canAdd,
- canEdit,
- canDelete,
- } = props;
const contributorNameTypeOptions = contributorNameTypes.map(it => ({
label: it.name,
value: it.id,
@@ -154,10 +153,5 @@ ContributorFields.propTypes = {
canEdit: PropTypes.bool,
canDelete: PropTypes.bool,
};
-ContributorFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
export default ContributorFields;
diff --git a/src/edit/descriptionFields.js b/src/edit/descriptionFields.js
index 95e0c0165..4322ec93f 100644
--- a/src/edit/descriptionFields.js
+++ b/src/edit/descriptionFields.js
@@ -13,15 +13,13 @@ import {
RepeatableField,
} from '@folio/stripes/components';
-const DescriptionFields = props => {
+const DescriptionFields = ({
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+}) => {
const { formatMessage } = useIntl();
- const {
- canAdd,
- canEdit,
- canDelete,
- } = props;
-
const physicalDescriptionLabel = formatMessage({ id: 'ui-inventory.physicalDescription' });
const legend = (
@@ -59,10 +57,5 @@ DescriptionFields.propTypes = {
canEdit: PropTypes.bool,
canDelete: PropTypes.bool,
};
-DescriptionFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
export default DescriptionFields;
diff --git a/src/edit/editionFields.js b/src/edit/editionFields.js
index b436450cf..8f604c4ea 100644
--- a/src/edit/editionFields.js
+++ b/src/edit/editionFields.js
@@ -13,15 +13,13 @@ import {
TextField,
} from '@folio/stripes/components';
-const EditionFields = props => {
+const EditionFields = ({
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+}) => {
const { formatMessage } = useIntl();
- const {
- canAdd,
- canEdit,
- canDelete,
- } = props;
-
const editionLabel = formatMessage({ id: 'ui-inventory.edition' });
const legend = (
@@ -59,10 +57,5 @@ EditionFields.propTypes = {
canEdit: PropTypes.bool,
canDelete: PropTypes.bool,
};
-EditionFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
export default EditionFields;
diff --git a/src/edit/electronicAccessFields.js b/src/edit/electronicAccessFields.js
index a37d9727c..dff4a77c9 100644
--- a/src/edit/electronicAccessFields.js
+++ b/src/edit/electronicAccessFields.js
@@ -18,15 +18,14 @@ import {
import { parseEmptyFormValue } from '../utils';
-const ElectronicAccessFields = props => {
+const ElectronicAccessFields = ({
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+ relationship = [],
+}) => {
const { formatMessage } = useIntl();
- const {
- relationship,
- canAdd,
- canEdit,
- canDelete,
- } = props;
const relationshipOptions = relationship.map(it => ({
label: it.name,
value: it.id,
@@ -141,11 +140,4 @@ ElectronicAccessFields.propTypes = {
canDelete: PropTypes.bool,
};
-ElectronicAccessFields.defaultProps = {
- relationship: [],
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
-
export default ElectronicAccessFields;
diff --git a/src/edit/holdings/repeatableFields/FormerHoldingsIdFields.js b/src/edit/holdings/repeatableFields/FormerHoldingsIdFields.js
index 5b4ff3c33..db90c3aa5 100644
--- a/src/edit/holdings/repeatableFields/FormerHoldingsIdFields.js
+++ b/src/edit/holdings/repeatableFields/FormerHoldingsIdFields.js
@@ -14,9 +14,9 @@ import {
} from '@folio/stripes/components';
const FormerHoldingsIdFields = ({
- canAdd,
- canEdit,
- canDelete,
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
}) => {
const { formatMessage } = useIntl();
@@ -57,10 +57,4 @@ FormerHoldingsIdFields.propTypes = {
canDelete: PropTypes.bool,
};
-FormerHoldingsIdFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
-
export default FormerHoldingsIdFields;
diff --git a/src/edit/holdings/repeatableFields/HoldingsStatementFields.js b/src/edit/holdings/repeatableFields/HoldingsStatementFields.js
index ef7bc0d28..f95ecb17f 100644
--- a/src/edit/holdings/repeatableFields/HoldingsStatementFields.js
+++ b/src/edit/holdings/repeatableFields/HoldingsStatementFields.js
@@ -16,9 +16,9 @@ import {
} from '@folio/stripes/components';
const HoldingsStatementFields = ({
- canAdd,
- canEdit,
- canDelete,
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
}) => {
const { formatMessage } = useIntl();
@@ -103,10 +103,4 @@ HoldingsStatementFields.propTypes = {
canDelete: PropTypes.bool,
};
-HoldingsStatementFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
-
export default HoldingsStatementFields;
diff --git a/src/edit/holdings/repeatableFields/HoldingsStatementForIndexesFields.js b/src/edit/holdings/repeatableFields/HoldingsStatementForIndexesFields.js
index 92131cf22..61c166a71 100644
--- a/src/edit/holdings/repeatableFields/HoldingsStatementForIndexesFields.js
+++ b/src/edit/holdings/repeatableFields/HoldingsStatementForIndexesFields.js
@@ -16,9 +16,9 @@ import {
} from '@folio/stripes/components';
const HoldingsStatementForIndexesFields = ({
- canAdd,
- canEdit,
- canDelete,
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
}) => {
const { formatMessage } = useIntl();
@@ -102,10 +102,4 @@ HoldingsStatementForIndexesFields.propTypes = {
canDelete: PropTypes.bool,
};
-HoldingsStatementForIndexesFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
-
export default HoldingsStatementForIndexesFields;
diff --git a/src/edit/holdings/repeatableFields/HoldingsStatementForSupplementsFields.js b/src/edit/holdings/repeatableFields/HoldingsStatementForSupplementsFields.js
index 35cef5d85..ca2f7934f 100644
--- a/src/edit/holdings/repeatableFields/HoldingsStatementForSupplementsFields.js
+++ b/src/edit/holdings/repeatableFields/HoldingsStatementForSupplementsFields.js
@@ -16,9 +16,9 @@ import {
} from '@folio/stripes/components';
const HoldingsStatementForSupplementsFields = ({
- canAdd,
- canEdit,
- canDelete,
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
}) => {
const { formatMessage } = useIntl();
@@ -104,10 +104,4 @@ HoldingsStatementForSupplementsFields.propTypes = {
canDelete: PropTypes.bool,
};
-HoldingsStatementForSupplementsFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
-
export default HoldingsStatementForSupplementsFields;
diff --git a/src/edit/holdings/repeatableFields/NoteFields.js b/src/edit/holdings/repeatableFields/NoteFields.js
index 771fce770..da2a90412 100644
--- a/src/edit/holdings/repeatableFields/NoteFields.js
+++ b/src/edit/holdings/repeatableFields/NoteFields.js
@@ -26,10 +26,10 @@ import {
} from '../../../constants';
const NoteFields = ({
- noteTypeOptions,
- canAdd,
- canEdit,
- canDelete,
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+ noteTypeOptions = [],
}) => {
const { formatMessage } = useIntl();
@@ -128,10 +128,4 @@ NoteFields.propTypes = {
noteTypeOptions: PropTypes.arrayOf(PropTypes.object),
};
-NoteFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
-
export default NoteFields;
diff --git a/src/edit/holdings/repeatableFields/ReceivingHistoryFields.js b/src/edit/holdings/repeatableFields/ReceivingHistoryFields.js
index a43b0a7f4..646665f5a 100644
--- a/src/edit/holdings/repeatableFields/ReceivingHistoryFields.js
+++ b/src/edit/holdings/repeatableFields/ReceivingHistoryFields.js
@@ -17,9 +17,9 @@ import {
} from '@folio/stripes/components';
const ReceivingHistoryFields = ({
- canAdd,
- canEdit,
- canDelete,
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
}) => {
const { formatMessage } = useIntl();
@@ -103,10 +103,4 @@ ReceivingHistoryFields.propTypes = {
canDelete: PropTypes.bool,
};
-ReceivingHistoryFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
-
export default ReceivingHistoryFields;
diff --git a/src/edit/identifierFields.js b/src/edit/identifierFields.js
index 811c4c377..4ba40555a 100644
--- a/src/edit/identifierFields.js
+++ b/src/edit/identifierFields.js
@@ -16,13 +16,12 @@ import {
TextField,
} from '@folio/stripes/components';
-const IdentifierFields = props => {
- const {
- identifierTypes,
- canAdd,
- canEdit,
- canDelete,
- } = props;
+const IdentifierFields = ({
+ identifierTypes = [],
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+}) => {
const { formatMessage } = useIntl();
const identifierTypeOptions = identifierTypes.map(it => ({
@@ -94,10 +93,5 @@ IdentifierFields.propTypes = {
canEdit: PropTypes.bool,
canDelete: PropTypes.bool,
};
-IdentifierFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
export default IdentifierFields;
diff --git a/src/edit/instanceFormatFields.js b/src/edit/instanceFormatFields.js
index 3af8eac11..8d045ed3f 100644
--- a/src/edit/instanceFormatFields.js
+++ b/src/edit/instanceFormatFields.js
@@ -13,16 +13,14 @@ import {
RepeatableField,
} from '@folio/stripes/components';
-const InstanceFormatFields = props => {
+const InstanceFormatFields = ({
+ instanceFormats = [],
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+}) => {
const { formatMessage } = useIntl();
- const {
- instanceFormats,
- canAdd,
- canEdit,
- canDelete,
- } = props;
-
const instanceFormatOptions = instanceFormats
? instanceFormats.map(it => ({
label: it.name,
@@ -72,10 +70,5 @@ InstanceFormatFields.propTypes = {
canEdit: PropTypes.bool,
canDelete: PropTypes.bool,
};
-InstanceFormatFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
export default InstanceFormatFields;
diff --git a/src/edit/items/repeatableFields/CirculationNotesFields.js b/src/edit/items/repeatableFields/CirculationNotesFields.js
index 015178794..26dca9669 100644
--- a/src/edit/items/repeatableFields/CirculationNotesFields.js
+++ b/src/edit/items/repeatableFields/CirculationNotesFields.js
@@ -17,15 +17,13 @@ import {
Label,
} from '@folio/stripes/components';
-const CirculationNotesFields = props => {
+const CirculationNotesFields = ({
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+}) => {
const { formatMessage } = useIntl();
- const {
- canAdd,
- canEdit,
- canDelete,
- } = props;
-
const noteTypeOptions = [
{ label: formatMessage({ id: 'ui-inventory.selectType' }), value: '' },
{ label: 'Check in note', value: 'Check in' },
@@ -115,10 +113,5 @@ CirculationNotesFields.propTypes = {
canEdit: PropTypes.bool,
canDelete: PropTypes.bool,
};
-CirculationNotesFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
export default CirculationNotesFields;
diff --git a/src/edit/items/repeatableFields/FormerIdentifierFields.js b/src/edit/items/repeatableFields/FormerIdentifierFields.js
index e878b70d7..d8710c98a 100644
--- a/src/edit/items/repeatableFields/FormerIdentifierFields.js
+++ b/src/edit/items/repeatableFields/FormerIdentifierFields.js
@@ -14,9 +14,9 @@ import {
} from '@folio/stripes/components';
const FormerIdentifierFields = ({
- canAdd,
- canEdit,
- canDelete,
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
}) => {
const { formatMessage } = useIntl();
@@ -57,10 +57,4 @@ FormerIdentifierFields.propTypes = {
canDelete: PropTypes.bool,
};
-FormerIdentifierFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
-
export default FormerIdentifierFields;
diff --git a/src/edit/items/repeatableFields/YearCaptionFields.js b/src/edit/items/repeatableFields/YearCaptionFields.js
index 28db287fc..6a3c9461d 100644
--- a/src/edit/items/repeatableFields/YearCaptionFields.js
+++ b/src/edit/items/repeatableFields/YearCaptionFields.js
@@ -14,9 +14,9 @@ import {
} from '@folio/stripes/components';
const YearCaptionFields = ({
- canAdd,
- canEdit,
- canDelete,
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
}) => {
const { formatMessage } = useIntl();
@@ -57,10 +57,4 @@ YearCaptionFields.propTypes = {
canDelete: PropTypes.bool,
};
-YearCaptionFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
-
export default YearCaptionFields;
diff --git a/src/edit/languageFields.js b/src/edit/languageFields.js
index 27e9d0dcd..da3fb8ce4 100644
--- a/src/edit/languageFields.js
+++ b/src/edit/languageFields.js
@@ -15,13 +15,11 @@ import {
Label,
} from '@folio/stripes/components';
-const LanguageFields = props => {
- const {
- canAdd,
- canEdit,
- canDelete,
- } = props;
-
+const LanguageFields = ({
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+}) => {
const intl = useIntl();
const stripes = useStripes();
const langOptions = languageOptions(intl, stripes.locale);
@@ -68,10 +66,5 @@ LanguageFields.propTypes = {
canEdit: PropTypes.bool,
canDelete: PropTypes.bool,
};
-LanguageFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
export default LanguageFields;
diff --git a/src/edit/natureOfContentFields.js b/src/edit/natureOfContentFields.js
index e8109a6e6..3a783deb9 100644
--- a/src/edit/natureOfContentFields.js
+++ b/src/edit/natureOfContentFields.js
@@ -13,16 +13,14 @@ import {
Select,
} from '@folio/stripes/components';
-const NatureOfContentFields = props => {
+const NatureOfContentFields = ({
+ natureOfContentTerms = [],
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+}) => {
const { formatMessage } = useIntl();
- const {
- canAdd,
- canEdit,
- canDelete,
- natureOfContentTerms,
- } = props;
-
const natureOfContentTermOptions = natureOfContentTerms
? natureOfContentTerms.map(it => ({
label: it.name,
@@ -66,15 +64,10 @@ const NatureOfContentFields = props => {
};
NatureOfContentFields.propTypes = {
+ natureOfContentTerms: PropTypes.arrayOf(PropTypes.object),
canAdd: PropTypes.bool,
canEdit: PropTypes.bool,
canDelete: PropTypes.bool,
- natureOfContentTerms: PropTypes.arrayOf(PropTypes.object),
-};
-NatureOfContentFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
};
export default NatureOfContentFields;
diff --git a/src/edit/noteFields.js b/src/edit/noteFields.js
index debda500c..a8f5829f3 100644
--- a/src/edit/noteFields.js
+++ b/src/edit/noteFields.js
@@ -25,19 +25,17 @@ import {
NOTE_CHARS_MAX_LENGTH
} from '../constants';
-const NoteFields = props => {
+const NoteFields = ({
+ noteTypeIdField,
+ noteTypeOptions = [],
+ requiredFields = [],
+ renderLegend = true,
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+}) => {
const { formatMessage } = useIntl();
- const {
- noteTypeOptions,
- noteTypeIdField,
- requiredFields,
- renderLegend,
- canAdd,
- canEdit,
- canDelete,
- } = props;
-
const noteTypeLabel = formatMessage({ id: 'ui-inventory.noteType' });
const noteLabel = formatMessage({ id: 'ui-inventory.note' });
const staffOnlyLabel = formatMessage({ id: 'ui-inventory.staffOnly' });
@@ -134,13 +132,5 @@ NoteFields.propTypes = {
canEdit: PropTypes.bool,
canDelete: PropTypes.bool,
};
-NoteFields.defaultProps = {
- noteTypeOptions: [],
- requiredFields: [],
- renderLegend: true,
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
export default NoteFields;
diff --git a/src/edit/precedingTitleFields.js b/src/edit/precedingTitleFields.js
index bef88aa7b..7f4148aa8 100644
--- a/src/edit/precedingTitleFields.js
+++ b/src/edit/precedingTitleFields.js
@@ -7,7 +7,12 @@ import { RepeatableField } from '@folio/stripes/components';
import TitleField from '../components/TitleField';
-const PrecedingTitles = ({ canAdd, canEdit, canDelete, isDisabled }) => (
+const PrecedingTitles = ({
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+ isDisabled = false,
+}) => (
}
legend={}
@@ -36,11 +41,4 @@ PrecedingTitles.propTypes = {
isDisabled: PropTypes.bool,
};
-PrecedingTitles.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
- isDisabled: false,
-};
-
export default PrecedingTitles;
diff --git a/src/edit/publicationFields.js b/src/edit/publicationFields.js
index 192b3d6c7..28b6f53b3 100644
--- a/src/edit/publicationFields.js
+++ b/src/edit/publicationFields.js
@@ -16,15 +16,13 @@ import {
Label,
} from '@folio/stripes/components';
-const PublicationFields = props => {
+const PublicationFields = ({
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+}) => {
const { formatMessage } = useIntl();
- const {
- canAdd,
- canEdit,
- canDelete,
- } = props;
-
const publisherLabel = formatMessage({ id: 'ui-inventory.publisher' });
const publisherRoleLabel = formatMessage({ id: 'ui-inventory.publisherRole' });
const placeLabel = formatMessage({ id: 'ui-inventory.place' });
@@ -119,10 +117,5 @@ PublicationFields.propTypes = {
canEdit: PropTypes.bool,
canDelete: PropTypes.bool,
};
-PublicationFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
export default PublicationFields;
diff --git a/src/edit/publicationFrequencyFields.js b/src/edit/publicationFrequencyFields.js
index c42a7b26a..c266aea1a 100644
--- a/src/edit/publicationFrequencyFields.js
+++ b/src/edit/publicationFrequencyFields.js
@@ -13,15 +13,13 @@ import {
TextArea,
} from '@folio/stripes/components';
-const PublicationFrequencyFields = props => {
+const PublicationFrequencyFields = ({
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+}) => {
const { formatMessage } = useIntl();
- const {
- canAdd,
- canEdit,
- canDelete,
- } = props;
-
const publicationFrequencyLabel = formatMessage({ id: 'ui-inventory.publicationFrequency' });
const legend = (
@@ -60,10 +58,5 @@ PublicationFrequencyFields.propTypes = {
canEdit: PropTypes.bool,
canDelete: PropTypes.bool,
};
-PublicationFrequencyFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
export default PublicationFrequencyFields;
diff --git a/src/edit/publicationRangeFields.js b/src/edit/publicationRangeFields.js
index 578b61cc7..61c5bb679 100644
--- a/src/edit/publicationRangeFields.js
+++ b/src/edit/publicationRangeFields.js
@@ -13,15 +13,13 @@ import {
TextArea,
} from '@folio/stripes/components';
-const PublicationRangeFields = props => {
+const PublicationRangeFields = ({
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+}) => {
const { formatMessage } = useIntl();
- const {
- canAdd,
- canEdit,
- canDelete,
- } = props;
-
const publicationRangeLabel = formatMessage({ id: 'ui-inventory.publicationRange' });
const legend = (
@@ -60,10 +58,5 @@ PublicationRangeFields.propTypes = {
canEdit: PropTypes.bool,
canDelete: PropTypes.bool,
};
-PublicationRangeFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
export default PublicationRangeFields;
diff --git a/src/edit/seriesFields.js b/src/edit/seriesFields.js
index 02f685de7..3c053825b 100644
--- a/src/edit/seriesFields.js
+++ b/src/edit/seriesFields.js
@@ -13,15 +13,13 @@ import {
TextArea,
} from '@folio/stripes/components';
-const SeriesFields = props => {
+const SeriesFields = ({
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+}) => {
const { formatMessage } = useIntl();
- const {
- canAdd,
- canEdit,
- canDelete,
- } = props;
-
const seriesStatementsLabel = formatMessage({ id: 'ui-inventory.seriesStatements' });
const legend = (
@@ -60,10 +58,5 @@ SeriesFields.propTypes = {
canEdit: PropTypes.bool,
canDelete: PropTypes.bool,
};
-SeriesFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
export default SeriesFields;
diff --git a/src/edit/statisticalCodeFields.js b/src/edit/statisticalCodeFields.js
index e9f0d060a..49a05ff04 100644
--- a/src/edit/statisticalCodeFields.js
+++ b/src/edit/statisticalCodeFields.js
@@ -15,10 +15,10 @@ import {
} from '@folio/stripes/components';
const StatisticalCodeFields = ({
- canAdd,
- canEdit,
- canDelete,
- statisticalCodeOptions,
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+ statisticalCodeOptions = [],
}) => {
const { formatMessage } = useIntl();
@@ -66,10 +66,4 @@ StatisticalCodeFields.propTypes = {
canDelete: PropTypes.bool,
};
-StatisticalCodeFields.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
-};
-
export default StatisticalCodeFields;
diff --git a/src/edit/succeedingTitleFields.js b/src/edit/succeedingTitleFields.js
index 854597a72..d7618f272 100644
--- a/src/edit/succeedingTitleFields.js
+++ b/src/edit/succeedingTitleFields.js
@@ -7,7 +7,12 @@ import { RepeatableField } from '@folio/stripes/components';
import { TitleField } from '../components';
-const SucceedingTitles = ({ canAdd, canEdit, canDelete, isDisabled }) => (
+const SucceedingTitles = ({
+ canAdd = true,
+ canEdit = true,
+ canDelete = true,
+ isDisabled = false,
+}) => (
}
legend={}
@@ -36,11 +41,4 @@ SucceedingTitles.propTypes = {
isDisabled: PropTypes.bool,
};
-SucceedingTitles.defaultProps = {
- canAdd: true,
- canEdit: true,
- canDelete: true,
- isDisabled: false,
-};
-
export default SucceedingTitles;
diff --git a/src/views/ItemStatus/ItemStatus.js b/src/views/ItemStatus/ItemStatus.js
index 41ddd520c..c116d8c9c 100644
--- a/src/views/ItemStatus/ItemStatus.js
+++ b/src/views/ItemStatus/ItemStatus.js
@@ -19,7 +19,12 @@ import { getDateWithTime } from '../../utils';
const label = ;
-const ItemStatus = ({ itemId, status, openLoan, mutator }) => {
+const ItemStatus = ({
+ itemId,
+ status,
+ mutator,
+ openLoan = {},
+}) => {
const [servicePoint, setServicePoint] = useState();
useEffect(
@@ -94,12 +99,8 @@ ItemStatus.manifest = Object.freeze({
ItemStatus.propTypes = {
itemId: PropTypes.string.isRequired,
status: PropTypes.object.isRequired,
- openLoan: PropTypes.object,
mutator: PropTypes.object.isRequired,
-};
-
-ItemStatus.defaultProps = {
- openLoan: {},
+ openLoan: PropTypes.object,
};
export default stripesConnect(ItemStatus);