Skip to content

Commit

Permalink
change component path
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiShumski2 committed Dec 6, 2018
1 parent fe181d3 commit 0d0df28
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import PropTypes from 'prop-types';

import { Button } from '@folio/stripes/components';

import ClosePOModalForm from './ClosePOModalForm';
import CloseOrderModalForm from './CloseOrderModalForm';

class ClosePOModal extends Component {
class CloseOrderModal extends Component {
static propTypes = {
orderId: PropTypes.string.isRequired,
};
Expand Down Expand Up @@ -44,7 +44,7 @@ class ClosePOModal extends Component {
>
<FormattedMessage id="ui-orders.paneBlock.closeBtn" />
</Button>
<ClosePOModalForm
<CloseOrderModalForm
close={this.closeModal}
orderId={orderId}
open={this.state.openModal}
Expand All @@ -54,4 +54,4 @@ class ClosePOModal extends Component {
}
}

export default ClosePOModal;
export default CloseOrderModal;
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import {
TextArea,
} from '@folio/stripes/components';

const ClosePOModalForm = ({ close, open, orderId }) => {
const cancelBtn = <FormattedMessage id="ui-orders.closePOModal.cancel" />;
const submitBtn = <FormattedMessage id="ui-orders.closePOModal.submit" />;
const CloseOrderModalForm = ({ close, open, orderId }) => {
const cancelBtn = <FormattedMessage id="ui-orders.closeOrderModal.cancel" />;
const submitBtn = <FormattedMessage id="ui-orders.closeOrderModal.submit" />;
const footer = (
<ModalFooter
secondaryButton={{
Expand All @@ -32,19 +32,19 @@ const ClosePOModalForm = ({ close, open, orderId }) => {
return (
<Modal
footer={footer}
label={<FormattedMessage id="ui-orders.closePOModal.title" values={{ orderId }} />}
label={<FormattedMessage id="ui-orders.closeOrderModal.title" values={{ orderId }} />}
open={open}
>
<Row>
<Col xs={12}>
<Field
component={Select}
label={<FormattedMessage id="ui-orders.closePOModal.reason" />}
label={<FormattedMessage id="ui-orders.closeOrderModal.reason" />}
name="reason"
/>
<Field
component={TextArea}
label={<FormattedMessage id="ui-orders.closePOModal.notes" />}
label={<FormattedMessage id="ui-orders.closeOrderModal.notes" />}
name="notes"
/>
</Col>
Expand All @@ -53,14 +53,14 @@ const ClosePOModalForm = ({ close, open, orderId }) => {
);
};

ClosePOModalForm.propTypes = {
CloseOrderModalForm.propTypes = {
close: PropTypes.func.isRequired,
open: PropTypes.bool.isRequired,
orderId: PropTypes.string.isRequired,
};

export default stripesForm({
form: 'closePOModalForm',
form: 'closeOrderModalForm',
navigationCheck: true,
enableReinitialize: true,
})(ClosePOModalForm);
})(CloseOrderModalForm);
4 changes: 4 additions & 0 deletions src/components/PurchaseOrder/CloseOrder/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import CloseOrderModal from './CloseOrderModal';
import CloseOrderModalForm from './CloseOrderModalForm';

export { CloseOrderModal, CloseOrderModalForm };
4 changes: 2 additions & 2 deletions src/components/PurchaseOrder/PO.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
LayerPOLine,
} from '../LayerCollection';
import transitionToParams from '../Utils/transitionToParams';
import ClosePOModal from '../Modal/ClosePOModal';
import { CloseOrderModal } from './CloseOrder';
import { AdjustmentView } from './Adjustment';
import LineListing from './LineListing';
import { PODetailsView } from './PODetails';
Expand Down Expand Up @@ -187,7 +187,7 @@ class PO extends Component {
const lastMenu = (
<PaneMenu>
<IfPermission perm="purchase_order.item.put">
<ClosePOModal orderId={get(initialValues, 'id', '')} />
<CloseOrderModal orderId={get(initialValues, 'id', '')} />
<FormattedMessage id="ui-orders.paneMenu.editOrder">
{ariaLabel => (
<IconButton
Expand Down
10 changes: 5 additions & 5 deletions translations/ui-orders/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,11 @@
"settings.setPOLInesLimit": "Set Purchase Order Lines Limit",
"settings.setPOLInesLimit.changed": "The Limit of Purchase Order Lines has been successfully saved",
"settings.setPOLInesLimit.validatation": "Please enter a whole number greater than 0 and less than 1000 to continue",
"closePOModal.reason": "Reason",
"closePOModal.notes": "Notes",
"closePOModal.cancel": "Cancel",
"closePOModal.submit": "Submit",
"closePOModal.title": "Close - Purchase Order #{orderId}",
"closeOrderModal.reason": "Reason",
"closeOrderModal.notes": "Notes",
"closeOrderModal.cancel": "Cancel",
"closeOrderModal.submit": "Submit",
"closeOrderModal.title": "Close - Purchase Order #{orderId}",

"errors.noMatch.oops": "Uh-oh!",
"errors.noMatch.how": "How did you get to {location}?"
Expand Down

0 comments on commit 0d0df28

Please sign in to comment.