2021-05-14 08:15:15 +00:00
|
|
|
import { Typography } from "@material-ui/core";
|
2022-05-23 09:24:20 +00:00
|
|
|
import {
|
|
|
|
extensionMountPoints,
|
2022-06-24 12:17:58 +00:00
|
|
|
mapToMenuItemsForOrderDetails,
|
2022-06-21 09:36:55 +00:00
|
|
|
useExtensions,
|
2022-05-23 09:24:20 +00:00
|
|
|
} from "@saleor/apps/useExtensions";
|
2022-05-06 08:59:55 +00:00
|
|
|
import { Backlink } from "@saleor/components/Backlink";
|
2019-06-19 14:40:52 +00:00
|
|
|
import CardMenu from "@saleor/components/CardMenu";
|
|
|
|
import { CardSpacer } from "@saleor/components/CardSpacer";
|
|
|
|
import { Container } from "@saleor/components/Container";
|
|
|
|
import { DateTime } from "@saleor/components/Date";
|
2020-09-01 16:22:54 +00:00
|
|
|
import Form from "@saleor/components/Form";
|
2019-06-19 14:40:52 +00:00
|
|
|
import Grid from "@saleor/components/Grid";
|
2020-09-01 16:22:54 +00:00
|
|
|
import Metadata, { MetadataFormData } from "@saleor/components/Metadata";
|
2019-06-19 14:40:52 +00:00
|
|
|
import PageHeader from "@saleor/components/PageHeader";
|
2021-07-21 08:59:52 +00:00
|
|
|
import Savebar from "@saleor/components/Savebar";
|
2019-06-19 14:40:52 +00:00
|
|
|
import Skeleton from "@saleor/components/Skeleton";
|
2022-03-09 08:56:55 +00:00
|
|
|
import {
|
|
|
|
OrderDetailsFragment,
|
|
|
|
OrderDetailsQuery,
|
2022-08-10 09:11:32 +00:00
|
|
|
OrderErrorFragment,
|
2022-04-29 09:16:58 +00:00
|
|
|
OrderStatus,
|
2022-03-09 08:56:55 +00:00
|
|
|
} from "@saleor/graphql";
|
2020-11-02 13:26:02 +00:00
|
|
|
import { SubmitPromise } from "@saleor/hooks/useForm";
|
2022-05-06 08:59:55 +00:00
|
|
|
import useNavigator from "@saleor/hooks/useNavigator";
|
2019-08-26 17:44:42 +00:00
|
|
|
import { sectionNames } from "@saleor/intl";
|
2022-09-23 10:25:56 +00:00
|
|
|
import { ConfirmButtonTransitionState } from "@saleor/macaw-ui";
|
Multichannel (#833)
* add multichannel to configuration view
* create multichannels list view
* create multichannels list view
* add ChannelsCreate view
* update channels in configuration
* add stories
* update default messages
* fix ChannelForm props
* update channels list styles
* update snapshots
* update channel form currency input
* update Channels fragments
* extract messages
* remove tabs from channelsList
* channel details, channel delete modal (#598)
* create Channel details view
* create ChannelDeleteDialog
* add channels delete dialog to channels list
* update messages and types
* fixes after review
* channels availability (#609)
* create Channel details view
* update messages and types
* create ChannelsAvailability component
* create more product channels components
* create channels stories, update fixtures, types
* update product views with channels data
* update schema and snapshots
* update defaultMessages
* update ProductUpdate view
* create ChannelsAvailabilityDropdown component
* add product channels to local storage
* update globalTypes
* Update to new schema and resolve issues
* Update messages
* create deleteChannel mutation
* add channels availability component to product create view
* refactor ProductCreate and ProductUpdate views
* CollectionProducts view cleanup
* add disabled prop to ActionDialog
* use updateChannels mutation in ProductCreate view
* ProductCreate - update submit function
* fixes after review
* update snapshots and messages
Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
* channels shipping components (#655)
* create PricingCard, OrderValue and OrderWeight components
* create ShippingZoneRatesPage and DeleteShippingRateDialog
* update ChannelsAvailability component
* updates after review
* channels shipping views (#662)
* update ChannelsAvailability component
* updates after review
* create PriceRate views, update types
* create weight rates views
* update shipping views, stories, messages
* update snapshots
* update snapshots
* update useChannels hook
* orders channels components (#698)
* create OrderChannelSectionCard component
* update OrderDetailsPage
* update DraftOrderChannelCard
* update snapshots
* update fixtures
* small change after review, update snapshots
* product pricing (#702)
* update product types
* update Pricing in simple product view
* use productVariantCreate mutation in simple product view
* update snapshots and messages
* handle create variant (#715)
* update product types
* update Pricing in simple product view
* handle product create and update errors
* update snapshots and messages
* fix update and create product handlers
* update pricing types
* channels modal - new styles, search input (#717)
* update product types
* update Pricing in simple product view
* handle product create and update errors
* update pricing types
* add search input in ChannelsAvailabilityDialog
* update ChannelsAvailabilityDialog in all views
* update snapshots
* fix search input label styles
* update toggleAllChannels function
* update variant creator (#724)
* update product types
* update Pricing in simple product view
* handle product create and update errors
* update pricing types
* add search input in ChannelsAvailabilityDialog
* update ChannelsAvailabilityDialog in all views
* update snapshots
* add channelLisitngs to variant creator
* update variant creator price styles
* update product variant creator reducer tests
* update createVariants tests
* update error handling in product variant creator
* add Skip pricing for now option
* use PriceField instead of TextField in ProductVariantCreatorSummary
* create price validation function
* fix errors handling in ProductVariantPrice component
* fixes after review
* Product List - remove publish/unpublish buttons (#727)
* ProductList - remove publish and unpublish buttons
* update messages
* update snapshots, messages
* revert changes in ChannelsAvailabilityDropdown
* products/shipping/discount list settings (#739)
* create ChannelSettingsDialog component
* update snapshots
* ProductList - open settings modal when there is no selected channel
* add settings modal to vouchers list
* add settings dialog to sales list
* add setting modal to shipping list
* update shipping
* update snapshots, messages
* useChannelsSettings - remove selectedChannelSlug
* fix channels update handler in product and shipping view
* messages update in ChannelSettingsDialog
* handle product/discount list when there is no channels
* update onSettingsOpen prop
* collection availability dropdown (#743)
* add availability dropdown to collection products list
* update channelListingProduct fragment name
* update voucher view/components with channels (#746)
* update voucher view/components with channels
* update VoucherSummary, remove defaultCurrency from voucher components
* update snapshots
* move getChannelsVariables func to discounts handlers
* update voucher messages
* sale view/components with channels (#750)
* update sale views with channels
* small fixes in discounts
* order views with channels (#752)
* update draft orders with channels
* add channel activate/deactivate mutations
* remove sort by total in orders list
* add error notification on channel activate/deactivate
* product variants channel select (#755)
* add channels selector to ProductVariants component
* remove selectedChannel from ProductUpdate, update messages and snapshots
* update product fragments
* update translations (#762)
* update translations
* fix translation types
* update messages
* update Availability component (#766)
* update ChannelsAvailability component
* update product fixtures
* update collection and channel fixtures
* ChannelsAvailability - handle errors
* update product handlers
* update ChannelsAvailability styles
* update ProductVariant
* update snapshots
* fix missing things in multichannel (#785)
* add availability dropdown to discount products list
* fix error handling in shipping components
* update product views and components
* update messages
* update category view/components
* update CategoryProducts styles
* remove defaultCurrency from shipping components
* create ChannelsSelect component
* update channels error handling after review
* another fixes after review
* Add channels to collection views/components (#791)
** update collection components and views
* update create collection view
* update error handling in collection
* remove filter bar from collection list
* update products fragments
* small fix in collection create view
* use collectionFragment in useCatalogSearch
* update defaultMessages and snapshots
* update homepage view/drop defaultCurrency (#801)
* update homepage view
* drop defaultCurrency prop
* fix onChannelChange function in home view
* remove visibility from product list filters
* update export products with channels (#803)
* update ProductExportDialog with channels
* add new channel error code
* remover VISIBLE from product export dialog Financial information
* fix input size in ProductVariantCreatorSummary (#804)
* channels currency code select (#806)
* create select with currency codes
* fix ChannelDeleteDialog
* update defaultMessages, remove unneeded ChannelDetails handlers
* fixes after rebase
* replace channelListing with channelListings
* [multichannel] Update schema]
* Fix product create test
Co-authored-by: AlicjaSzu <alicja.szukuc@gmail.com>
Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com>
2020-11-17 16:10:42 +00:00
|
|
|
import OrderChannelSectionCard from "@saleor/orders/components/OrderChannelSectionCard";
|
2022-05-06 08:59:55 +00:00
|
|
|
import { orderListUrl } from "@saleor/orders/urls";
|
2020-09-01 16:22:54 +00:00
|
|
|
import { mapMetadataItemToInput } from "@saleor/utils/maps";
|
|
|
|
import useMetadataChangeTrigger from "@saleor/utils/metadata/useMetadataChangeTrigger";
|
2020-05-14 09:30:32 +00:00
|
|
|
import React from "react";
|
2022-09-23 10:25:56 +00:00
|
|
|
import { useIntl } from "react-intl";
|
2020-05-14 09:30:32 +00:00
|
|
|
|
2022-02-01 09:58:06 +00:00
|
|
|
import { getMutationErrors, maybe } from "../../../misc";
|
2019-06-19 14:40:52 +00:00
|
|
|
import OrderCustomer from "../OrderCustomer";
|
|
|
|
import OrderCustomerNote from "../OrderCustomerNote";
|
2021-01-29 13:14:31 +00:00
|
|
|
import OrderDraftDetails from "../OrderDraftDetails/OrderDraftDetails";
|
|
|
|
import { FormData as OrderDraftDetailsProductsFormData } from "../OrderDraftDetailsProducts";
|
2021-01-20 16:16:43 +00:00
|
|
|
import OrderFulfilledProductsCard from "../OrderFulfilledProductsCard";
|
2019-06-19 14:40:52 +00:00
|
|
|
import OrderHistory, { FormData as HistoryFormData } from "../OrderHistory";
|
2020-06-19 15:34:20 +00:00
|
|
|
import OrderInvoiceList from "../OrderInvoiceList";
|
2019-06-19 14:40:52 +00:00
|
|
|
import OrderPayment from "../OrderPayment/OrderPayment";
|
2021-01-20 16:16:43 +00:00
|
|
|
import OrderUnfulfilledProductsCard from "../OrderUnfulfilledProductsCard";
|
2022-09-23 10:25:56 +00:00
|
|
|
import { messages } from "./messages";
|
|
|
|
import { useStyles } from "./styles";
|
2022-02-17 11:08:17 +00:00
|
|
|
import Title from "./Title";
|
2021-01-20 16:16:43 +00:00
|
|
|
import { filteredConditionalItems, hasAnyItemsReplaceable } from "./utils";
|
2019-06-19 14:40:52 +00:00
|
|
|
|
2022-03-01 08:38:23 +00:00
|
|
|
export interface OrderDetailsPageProps {
|
2022-03-09 08:56:55 +00:00
|
|
|
order: OrderDetailsFragment;
|
|
|
|
shop: OrderDetailsQuery["shop"];
|
2019-06-19 14:40:52 +00:00
|
|
|
shippingMethods?: Array<{
|
|
|
|
id: string;
|
|
|
|
name: string;
|
|
|
|
}>;
|
2020-09-01 16:22:54 +00:00
|
|
|
disabled: boolean;
|
|
|
|
saveButtonBarState: ConfirmButtonTransitionState;
|
2022-08-10 09:11:32 +00:00
|
|
|
errors: OrderErrorFragment[];
|
2021-02-02 10:49:46 +00:00
|
|
|
onOrderLineAdd?: () => void;
|
|
|
|
onOrderLineChange?: (
|
|
|
|
id: string,
|
2022-06-21 09:36:55 +00:00
|
|
|
data: OrderDraftDetailsProductsFormData,
|
2021-02-02 10:49:46 +00:00
|
|
|
) => void;
|
|
|
|
onOrderLineRemove?: (id: string) => void;
|
|
|
|
onShippingMethodEdit?: () => void;
|
2019-06-19 14:40:52 +00:00
|
|
|
onBillingAddressEdit();
|
2021-08-20 14:36:05 +00:00
|
|
|
onFulfillmentApprove(id: string);
|
2019-06-19 14:40:52 +00:00
|
|
|
onFulfillmentCancel(id: string);
|
|
|
|
onFulfillmentTrackingNumberUpdate(id: string);
|
|
|
|
onOrderFulfill();
|
|
|
|
onProductClick?(id: string);
|
|
|
|
onPaymentCapture();
|
|
|
|
onPaymentPaid();
|
|
|
|
onPaymentRefund();
|
|
|
|
onPaymentVoid();
|
|
|
|
onShippingAddressEdit();
|
|
|
|
onOrderCancel();
|
|
|
|
onNoteAdd(data: HistoryFormData);
|
|
|
|
onProfileView();
|
2021-01-20 16:16:43 +00:00
|
|
|
onOrderReturn();
|
2020-07-02 11:58:44 +00:00
|
|
|
onInvoiceClick(invoiceId: string);
|
2020-06-23 12:27:44 +00:00
|
|
|
onInvoiceGenerate();
|
2020-07-02 11:58:44 +00:00
|
|
|
onInvoiceSend(invoiceId: string);
|
2020-11-02 13:26:02 +00:00
|
|
|
onSubmit(data: MetadataFormData): SubmitPromise;
|
2019-06-19 14:40:52 +00:00
|
|
|
}
|
|
|
|
|
2020-07-02 11:19:53 +00:00
|
|
|
const OrderDetailsPage: React.FC<OrderDetailsPageProps> = props => {
|
2019-10-30 14:34:24 +00:00
|
|
|
const {
|
2020-09-01 16:22:54 +00:00
|
|
|
disabled,
|
2019-06-19 14:40:52 +00:00
|
|
|
order,
|
2021-08-20 14:36:05 +00:00
|
|
|
shop,
|
2020-09-01 16:22:54 +00:00
|
|
|
saveButtonBarState,
|
2022-08-10 09:11:32 +00:00
|
|
|
errors,
|
2019-06-19 14:40:52 +00:00
|
|
|
onBillingAddressEdit,
|
2021-08-20 14:36:05 +00:00
|
|
|
onFulfillmentApprove,
|
2019-06-19 14:40:52 +00:00
|
|
|
onFulfillmentCancel,
|
|
|
|
onFulfillmentTrackingNumberUpdate,
|
|
|
|
onNoteAdd,
|
2019-10-09 10:18:44 +00:00
|
|
|
onOrderCancel,
|
2019-06-19 14:40:52 +00:00
|
|
|
onOrderFulfill,
|
|
|
|
onPaymentCapture,
|
|
|
|
onPaymentPaid,
|
|
|
|
onPaymentRefund,
|
|
|
|
onPaymentVoid,
|
|
|
|
onShippingAddressEdit,
|
2020-06-22 16:34:59 +00:00
|
|
|
onProfileView,
|
2020-06-22 16:34:59 +00:00
|
|
|
onInvoiceClick,
|
2020-06-23 12:27:44 +00:00
|
|
|
onInvoiceGenerate,
|
2020-09-01 16:22:54 +00:00
|
|
|
onInvoiceSend,
|
2021-01-20 16:16:43 +00:00
|
|
|
onOrderReturn,
|
2021-01-29 13:14:31 +00:00
|
|
|
onOrderLineAdd,
|
|
|
|
onOrderLineChange,
|
|
|
|
onOrderLineRemove,
|
|
|
|
onShippingMethodEdit,
|
2022-06-21 09:36:55 +00:00
|
|
|
onSubmit,
|
2019-10-30 14:34:24 +00:00
|
|
|
} = props;
|
|
|
|
const classes = useStyles(props);
|
2022-05-06 08:59:55 +00:00
|
|
|
const navigate = useNavigator();
|
2019-10-30 14:34:24 +00:00
|
|
|
const intl = useIntl();
|
2022-05-06 08:59:55 +00:00
|
|
|
|
2020-09-01 16:22:54 +00:00
|
|
|
const {
|
|
|
|
isMetadataModified,
|
|
|
|
isPrivateMetadataModified,
|
2021-06-17 13:11:50 +00:00
|
|
|
makeChangeHandler: makeMetadataChangeHandler,
|
2022-06-21 09:36:55 +00:00
|
|
|
resetMetadataChanged,
|
2020-09-01 16:22:54 +00:00
|
|
|
} = useMetadataChangeTrigger();
|
2019-08-26 17:44:42 +00:00
|
|
|
|
2021-02-08 13:30:06 +00:00
|
|
|
const isOrderUnconfirmed = order?.status === OrderStatus.UNCONFIRMED;
|
|
|
|
const canCancel = order?.status !== OrderStatus.CANCELED;
|
|
|
|
const canEditAddresses = order?.status !== OrderStatus.CANCELED;
|
|
|
|
const canFulfill = order?.status !== OrderStatus.CANCELED;
|
2021-08-20 14:36:05 +00:00
|
|
|
const notAllowedToFulfillUnpaid =
|
|
|
|
shop?.fulfillmentAutoApprove &&
|
|
|
|
!shop?.fulfillmentAllowUnpaid &&
|
|
|
|
!order?.isPaid;
|
2021-02-08 13:30:06 +00:00
|
|
|
const unfulfilled = (order?.lines || []).filter(
|
2022-06-21 09:36:55 +00:00
|
|
|
line => line.quantityToFulfill > 0,
|
2019-10-30 14:34:24 +00:00
|
|
|
);
|
2019-06-19 14:40:52 +00:00
|
|
|
|
2021-06-17 13:11:50 +00:00
|
|
|
const handleSubmit = async (data: MetadataFormData) => {
|
2020-09-01 16:22:54 +00:00
|
|
|
const metadata = isMetadataModified ? data.metadata : undefined;
|
|
|
|
const privateMetadata = isPrivateMetadataModified
|
|
|
|
? data.privateMetadata
|
|
|
|
: undefined;
|
|
|
|
|
2021-06-17 13:11:50 +00:00
|
|
|
const result = await onSubmit({
|
2020-09-01 16:22:54 +00:00
|
|
|
metadata,
|
2022-06-21 09:36:55 +00:00
|
|
|
privateMetadata,
|
2020-09-01 16:22:54 +00:00
|
|
|
});
|
2021-06-17 13:11:50 +00:00
|
|
|
resetMetadataChanged();
|
2022-02-01 09:58:06 +00:00
|
|
|
return getMutationErrors(result);
|
2020-09-01 16:22:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const initial: MetadataFormData = {
|
|
|
|
metadata: order?.metadata.map(mapMetadataItemToInput),
|
2022-06-21 09:36:55 +00:00
|
|
|
privateMetadata: order?.privateMetadata.map(mapMetadataItemToInput),
|
2020-09-01 16:22:54 +00:00
|
|
|
};
|
|
|
|
|
2021-02-08 13:30:06 +00:00
|
|
|
const saveLabel = isOrderUnconfirmed
|
2021-10-19 10:04:53 +00:00
|
|
|
? { confirm: intl.formatMessage(messages.confirmOrder) }
|
2021-02-08 13:30:06 +00:00
|
|
|
: undefined;
|
2020-11-30 13:19:57 +00:00
|
|
|
|
2022-05-05 07:54:28 +00:00
|
|
|
const allowSave = () => {
|
2021-02-08 13:30:06 +00:00
|
|
|
if (!isOrderUnconfirmed) {
|
2022-05-05 07:54:28 +00:00
|
|
|
return disabled;
|
2021-02-03 12:19:26 +00:00
|
|
|
} else if (!order?.lines?.length) {
|
|
|
|
return true;
|
2020-11-30 13:19:57 +00:00
|
|
|
}
|
|
|
|
return disabled;
|
|
|
|
};
|
|
|
|
|
2021-01-20 16:16:43 +00:00
|
|
|
const selectCardMenuItems = filteredConditionalItems([
|
|
|
|
{
|
|
|
|
item: {
|
|
|
|
label: intl.formatMessage(messages.cancelOrder),
|
2022-06-21 09:36:55 +00:00
|
|
|
onSelect: onOrderCancel,
|
2021-01-20 16:16:43 +00:00
|
|
|
},
|
2022-06-21 09:36:55 +00:00
|
|
|
shouldExist: canCancel,
|
2021-01-20 16:16:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
item: {
|
|
|
|
label: intl.formatMessage(messages.returnOrder),
|
2022-06-21 09:36:55 +00:00
|
|
|
onSelect: onOrderReturn,
|
2021-01-20 16:16:43 +00:00
|
|
|
},
|
2022-06-21 09:36:55 +00:00
|
|
|
shouldExist: hasAnyItemsReplaceable(order),
|
|
|
|
},
|
2021-01-20 16:16:43 +00:00
|
|
|
]);
|
|
|
|
|
2022-05-23 09:24:20 +00:00
|
|
|
const { ORDER_DETAILS_MORE_ACTIONS } = useExtensions(
|
2022-06-21 09:36:55 +00:00
|
|
|
extensionMountPoints.ORDER_DETAILS,
|
2022-05-23 09:24:20 +00:00
|
|
|
);
|
|
|
|
|
2022-06-24 12:17:58 +00:00
|
|
|
const extensionMenuItems = mapToMenuItemsForOrderDetails(
|
|
|
|
ORDER_DETAILS_MORE_ACTIONS,
|
|
|
|
order?.id,
|
|
|
|
);
|
2022-05-23 09:24:20 +00:00
|
|
|
|
2019-10-30 14:34:24 +00:00
|
|
|
return (
|
2022-02-01 09:58:06 +00:00
|
|
|
<Form confirmLeave initial={initial} onSubmit={handleSubmit}>
|
2022-05-05 07:54:28 +00:00
|
|
|
{({ change, data, submit }) => {
|
2020-09-01 16:22:54 +00:00
|
|
|
const changeMetadata = makeMetadataChangeHandler(change);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Container>
|
2022-05-06 08:59:55 +00:00
|
|
|
<Backlink href={orderListUrl()}>
|
2020-09-01 16:22:54 +00:00
|
|
|
{intl.formatMessage(sectionNames.orders)}
|
2021-07-21 08:59:52 +00:00
|
|
|
</Backlink>
|
2020-09-01 16:22:54 +00:00
|
|
|
<PageHeader
|
|
|
|
className={classes.header}
|
|
|
|
inline
|
2022-02-17 11:08:17 +00:00
|
|
|
title={<Title order={order} />}
|
2022-05-23 09:24:20 +00:00
|
|
|
cardMenu={
|
|
|
|
<CardMenu
|
|
|
|
menuItems={[...selectCardMenuItems, ...extensionMenuItems]}
|
|
|
|
/>
|
|
|
|
}
|
2022-02-03 12:59:36 +00:00
|
|
|
/>
|
2020-09-01 16:22:54 +00:00
|
|
|
<div className={classes.date}>
|
|
|
|
{order && order.created ? (
|
2021-07-21 08:59:52 +00:00
|
|
|
<Typography variant="body2">
|
2020-09-01 16:22:54 +00:00
|
|
|
<DateTime date={order.created} />
|
|
|
|
</Typography>
|
|
|
|
) : (
|
|
|
|
<Skeleton style={{ width: "10em" }} />
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
<Grid>
|
2022-02-11 11:28:55 +00:00
|
|
|
<div data-test-id="order-fulfillment">
|
2021-02-08 13:30:06 +00:00
|
|
|
{!isOrderUnconfirmed ? (
|
2021-01-29 13:14:31 +00:00
|
|
|
<OrderUnfulfilledProductsCard
|
2021-08-20 14:36:05 +00:00
|
|
|
showFulfillmentAction={canFulfill}
|
|
|
|
notAllowedToFulfillUnpaid={notAllowedToFulfillUnpaid}
|
2021-01-29 13:14:31 +00:00
|
|
|
lines={unfulfilled}
|
|
|
|
onFulfill={onOrderFulfill}
|
|
|
|
/>
|
|
|
|
) : (
|
|
|
|
<>
|
|
|
|
<OrderDraftDetails
|
|
|
|
order={order}
|
2022-08-10 09:11:32 +00:00
|
|
|
errors={errors}
|
2021-01-29 13:14:31 +00:00
|
|
|
onOrderLineAdd={onOrderLineAdd}
|
|
|
|
onOrderLineChange={onOrderLineChange}
|
|
|
|
onOrderLineRemove={onOrderLineRemove}
|
|
|
|
onShippingMethodEdit={onShippingMethodEdit}
|
|
|
|
/>
|
|
|
|
<CardSpacer />
|
|
|
|
</>
|
|
|
|
)}
|
2021-01-20 16:16:43 +00:00
|
|
|
{order?.fulfillments?.map(fulfillment => (
|
|
|
|
<React.Fragment key={fulfillment.id}>
|
|
|
|
<OrderFulfilledProductsCard
|
|
|
|
fulfillment={fulfillment}
|
2021-08-20 14:36:05 +00:00
|
|
|
fulfillmentAllowUnpaid={shop?.fulfillmentAllowUnpaid}
|
|
|
|
order={order}
|
2021-01-20 16:16:43 +00:00
|
|
|
onOrderFulfillmentCancel={() =>
|
|
|
|
onFulfillmentCancel(fulfillment.id)
|
|
|
|
}
|
|
|
|
onTrackingCodeAdd={() =>
|
|
|
|
onFulfillmentTrackingNumberUpdate(fulfillment.id)
|
|
|
|
}
|
|
|
|
onRefund={onPaymentRefund}
|
2021-08-20 14:36:05 +00:00
|
|
|
onOrderFulfillmentApprove={() =>
|
|
|
|
onFulfillmentApprove(fulfillment.id)
|
|
|
|
}
|
2021-01-20 16:16:43 +00:00
|
|
|
/>
|
|
|
|
</React.Fragment>
|
|
|
|
))}
|
2022-09-23 10:25:56 +00:00
|
|
|
<OrderPayment
|
|
|
|
order={order}
|
|
|
|
onCapture={onPaymentCapture}
|
|
|
|
onMarkAsPaid={onPaymentPaid}
|
|
|
|
onRefund={onPaymentRefund}
|
|
|
|
onVoid={onPaymentVoid}
|
|
|
|
/>
|
|
|
|
<CardSpacer />
|
|
|
|
<Metadata data={data} onChange={changeMetadata} />
|
2020-12-01 13:13:05 +00:00
|
|
|
<OrderHistory
|
|
|
|
history={order?.events}
|
|
|
|
orderCurrency={order?.total?.gross.currency}
|
|
|
|
onNoteAdd={onNoteAdd}
|
|
|
|
/>
|
2020-09-01 16:22:54 +00:00
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<OrderCustomer
|
|
|
|
canEditAddresses={canEditAddresses}
|
|
|
|
canEditCustomer={false}
|
|
|
|
order={order}
|
2022-08-10 09:11:32 +00:00
|
|
|
errors={errors}
|
2020-09-01 16:22:54 +00:00
|
|
|
onBillingAddressEdit={onBillingAddressEdit}
|
|
|
|
onShippingAddressEdit={onShippingAddressEdit}
|
|
|
|
onProfileView={onProfileView}
|
|
|
|
/>
|
|
|
|
<CardSpacer />
|
2022-08-10 09:11:32 +00:00
|
|
|
<OrderChannelSectionCard channel={order?.channel} />
|
Multichannel (#833)
* add multichannel to configuration view
* create multichannels list view
* create multichannels list view
* add ChannelsCreate view
* update channels in configuration
* add stories
* update default messages
* fix ChannelForm props
* update channels list styles
* update snapshots
* update channel form currency input
* update Channels fragments
* extract messages
* remove tabs from channelsList
* channel details, channel delete modal (#598)
* create Channel details view
* create ChannelDeleteDialog
* add channels delete dialog to channels list
* update messages and types
* fixes after review
* channels availability (#609)
* create Channel details view
* update messages and types
* create ChannelsAvailability component
* create more product channels components
* create channels stories, update fixtures, types
* update product views with channels data
* update schema and snapshots
* update defaultMessages
* update ProductUpdate view
* create ChannelsAvailabilityDropdown component
* add product channels to local storage
* update globalTypes
* Update to new schema and resolve issues
* Update messages
* create deleteChannel mutation
* add channels availability component to product create view
* refactor ProductCreate and ProductUpdate views
* CollectionProducts view cleanup
* add disabled prop to ActionDialog
* use updateChannels mutation in ProductCreate view
* ProductCreate - update submit function
* fixes after review
* update snapshots and messages
Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
* channels shipping components (#655)
* create PricingCard, OrderValue and OrderWeight components
* create ShippingZoneRatesPage and DeleteShippingRateDialog
* update ChannelsAvailability component
* updates after review
* channels shipping views (#662)
* update ChannelsAvailability component
* updates after review
* create PriceRate views, update types
* create weight rates views
* update shipping views, stories, messages
* update snapshots
* update snapshots
* update useChannels hook
* orders channels components (#698)
* create OrderChannelSectionCard component
* update OrderDetailsPage
* update DraftOrderChannelCard
* update snapshots
* update fixtures
* small change after review, update snapshots
* product pricing (#702)
* update product types
* update Pricing in simple product view
* use productVariantCreate mutation in simple product view
* update snapshots and messages
* handle create variant (#715)
* update product types
* update Pricing in simple product view
* handle product create and update errors
* update snapshots and messages
* fix update and create product handlers
* update pricing types
* channels modal - new styles, search input (#717)
* update product types
* update Pricing in simple product view
* handle product create and update errors
* update pricing types
* add search input in ChannelsAvailabilityDialog
* update ChannelsAvailabilityDialog in all views
* update snapshots
* fix search input label styles
* update toggleAllChannels function
* update variant creator (#724)
* update product types
* update Pricing in simple product view
* handle product create and update errors
* update pricing types
* add search input in ChannelsAvailabilityDialog
* update ChannelsAvailabilityDialog in all views
* update snapshots
* add channelLisitngs to variant creator
* update variant creator price styles
* update product variant creator reducer tests
* update createVariants tests
* update error handling in product variant creator
* add Skip pricing for now option
* use PriceField instead of TextField in ProductVariantCreatorSummary
* create price validation function
* fix errors handling in ProductVariantPrice component
* fixes after review
* Product List - remove publish/unpublish buttons (#727)
* ProductList - remove publish and unpublish buttons
* update messages
* update snapshots, messages
* revert changes in ChannelsAvailabilityDropdown
* products/shipping/discount list settings (#739)
* create ChannelSettingsDialog component
* update snapshots
* ProductList - open settings modal when there is no selected channel
* add settings modal to vouchers list
* add settings dialog to sales list
* add setting modal to shipping list
* update shipping
* update snapshots, messages
* useChannelsSettings - remove selectedChannelSlug
* fix channels update handler in product and shipping view
* messages update in ChannelSettingsDialog
* handle product/discount list when there is no channels
* update onSettingsOpen prop
* collection availability dropdown (#743)
* add availability dropdown to collection products list
* update channelListingProduct fragment name
* update voucher view/components with channels (#746)
* update voucher view/components with channels
* update VoucherSummary, remove defaultCurrency from voucher components
* update snapshots
* move getChannelsVariables func to discounts handlers
* update voucher messages
* sale view/components with channels (#750)
* update sale views with channels
* small fixes in discounts
* order views with channels (#752)
* update draft orders with channels
* add channel activate/deactivate mutations
* remove sort by total in orders list
* add error notification on channel activate/deactivate
* product variants channel select (#755)
* add channels selector to ProductVariants component
* remove selectedChannel from ProductUpdate, update messages and snapshots
* update product fragments
* update translations (#762)
* update translations
* fix translation types
* update messages
* update Availability component (#766)
* update ChannelsAvailability component
* update product fixtures
* update collection and channel fixtures
* ChannelsAvailability - handle errors
* update product handlers
* update ChannelsAvailability styles
* update ProductVariant
* update snapshots
* fix missing things in multichannel (#785)
* add availability dropdown to discount products list
* fix error handling in shipping components
* update product views and components
* update messages
* update category view/components
* update CategoryProducts styles
* remove defaultCurrency from shipping components
* create ChannelsSelect component
* update channels error handling after review
* another fixes after review
* Add channels to collection views/components (#791)
** update collection components and views
* update create collection view
* update error handling in collection
* remove filter bar from collection list
* update products fragments
* small fix in collection create view
* use collectionFragment in useCatalogSearch
* update defaultMessages and snapshots
* update homepage view/drop defaultCurrency (#801)
* update homepage view
* drop defaultCurrency prop
* fix onChannelChange function in home view
* remove visibility from product list filters
* update export products with channels (#803)
* update ProductExportDialog with channels
* add new channel error code
* remover VISIBLE from product export dialog Financial information
* fix input size in ProductVariantCreatorSummary (#804)
* channels currency code select (#806)
* create select with currency codes
* fix ChannelDeleteDialog
* update defaultMessages, remove unneeded ChannelDetails handlers
* fixes after rebase
* replace channelListing with channelListings
* [multichannel] Update schema]
* Fix product create test
Co-authored-by: AlicjaSzu <alicja.szukuc@gmail.com>
Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com>
2020-11-17 16:10:42 +00:00
|
|
|
<CardSpacer />
|
2021-02-08 13:30:06 +00:00
|
|
|
{!isOrderUnconfirmed && (
|
2021-01-15 10:10:52 +00:00
|
|
|
<>
|
|
|
|
<OrderInvoiceList
|
|
|
|
invoices={order?.invoices}
|
|
|
|
onInvoiceClick={onInvoiceClick}
|
|
|
|
onInvoiceGenerate={onInvoiceGenerate}
|
|
|
|
onInvoiceSend={onInvoiceSend}
|
|
|
|
/>
|
|
|
|
<CardSpacer />
|
|
|
|
</>
|
|
|
|
)}
|
2020-09-01 16:22:54 +00:00
|
|
|
<OrderCustomerNote note={maybe(() => order.customerNote)} />
|
|
|
|
</div>
|
|
|
|
</Grid>
|
2021-07-21 08:59:52 +00:00
|
|
|
<Savebar
|
2021-10-19 10:04:53 +00:00
|
|
|
labels={saveLabel}
|
2022-05-06 08:59:55 +00:00
|
|
|
onCancel={() => navigate(orderListUrl())}
|
2021-07-21 08:59:52 +00:00
|
|
|
onSubmit={submit}
|
2020-09-01 16:22:54 +00:00
|
|
|
state={saveButtonBarState}
|
2022-05-05 07:54:28 +00:00
|
|
|
disabled={allowSave()}
|
2020-09-01 16:22:54 +00:00
|
|
|
/>
|
|
|
|
</Container>
|
|
|
|
);
|
|
|
|
}}
|
|
|
|
</Form>
|
2019-10-30 14:34:24 +00:00
|
|
|
);
|
|
|
|
};
|
2021-01-20 16:16:43 +00:00
|
|
|
|
2019-06-19 14:40:52 +00:00
|
|
|
OrderDetailsPage.displayName = "OrderDetailsPage";
|
|
|
|
export default OrderDetailsPage;
|