Skip to content

Commit

Permalink
UIIN-2453: Add default prop values
Browse files Browse the repository at this point in the history
  • Loading branch information
mariia-aloshyna committed Oct 16, 2023
1 parent 48c57d2 commit 89c6c24
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/Instance/HoldingsList/Holding/Holding.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Holding.propTypes = {
holding: PropTypes.object.isRequired,
onViewHolding: PropTypes.func.isRequired,
onAddItem: PropTypes.func.isRequired,
instanceId: PropTypes.string.isRequired,
holdings: PropTypes.arrayOf(PropTypes.object),
draggable: PropTypes.bool,
droppable: PropTypes.bool,
Expand All @@ -78,12 +79,12 @@ Holding.propTypes = {
isHoldingDragSelected: PropTypes.func,
isItemsDroppable: PropTypes.bool,
tenantId: PropTypes.string,
instanceId: PropTypes.string,
pathToAccordionsState: PropTypes.arrayOf(PropTypes.string),
};

Holding.defaultProps = {
isItemsDroppable: true,
pathToAccordionsState: [],
};

export default Holding;
2 changes: 2 additions & 0 deletions src/Instance/HoldingsList/Holding/Holding.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const HoldingSetup = () => (
<Router>
<Holding
holding={holding}
instanceId="instanceId"
onViewHolding={onViewHolding}
onAddItem={onAddItem}
holdings={holdings}
Expand All @@ -38,6 +39,7 @@ const HoldingSetup = () => (
isHoldingDragSelected={isHoldingDragSelected}
isDraggable={isDraggable}
isItemsDroppable={isItemsDroppable}
pathToAccordionsState={['holdings']}
/>
</Router>
);
Expand Down
2 changes: 2 additions & 0 deletions src/Instance/HoldingsList/Holding/HoldingAccordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,6 @@ HoldingAccordion.propTypes = {
pathToAccordionsState: PropTypes.arrayOf(PropTypes.string),
};

HoldingAccordion.defaultProps = { pathToAccordionsState: [] };

export default HoldingAccordion;
6 changes: 5 additions & 1 deletion src/Instance/HoldingsList/Holding/HoldingContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,16 @@ DraggableHolding.propTypes = {
draggingHoldingsCount: PropTypes.number,
provided: PropTypes.object.isRequired,
snapshot: PropTypes.object.isRequired,
instanceId: PropTypes.string.isRequired,
holding: PropTypes.object,
onViewHolding: PropTypes.func,
onAddItem: PropTypes.func,
tenantId: PropTypes.string,
instanceId: PropTypes.string,
pathToAccordionsState: PropTypes.arrayOf(PropTypes.string),
};

DraggableHolding.defaultProps = { pathToAccordionsState: [] };

const HoldingContainer = ({
location,
history,
Expand Down Expand Up @@ -171,4 +173,6 @@ HoldingContainer.propTypes = {
pathToAccordionsState: PropTypes.arrayOf(PropTypes.string),
};

HoldingContainer.defaultProps = { pathToAccordionsState: [] };

export default withRouter(HoldingContainer);
1 change: 1 addition & 0 deletions src/Instance/HoldingsList/HoldingsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ HoldingsList.propTypes = {

HoldingsList.defaultProps = {
holdings: [],
pathToAccordionsState: [],
};

export default HoldingsList;
6 changes: 3 additions & 3 deletions src/Instance/HoldingsList/HoldingsListContainer.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

import {
Loading,
} from '@folio/stripes/components';
import { Loading } from '@folio/stripes/components';

import HoldingsList from './HoldingsList';
import { HoldingsListMovement } from '../InstanceMovement/HoldingMovementList';
Expand Down Expand Up @@ -48,4 +46,6 @@ HoldingsListContainer.propTypes = {
pathToAccordionsState: PropTypes.arrayOf(PropTypes.string),
};

HoldingsListContainer.defaultProps = { pathToAccordionsState: [] };

export default HoldingsListContainer;
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ HoldingsListMovement.propTypes = {

HoldingsListMovement.defaultProps = {
holdings: [],
pathToAccordionsState: [],
};

export default HoldingsListMovement;

0 comments on commit 89c6c24

Please sign in to comment.