
* Display warehouse name for each fulfillment (#1259) * Hide no-stocks columns in fulfillment view (#1260) * Hide no-stocks columns in fulfillment view * Update tests * Refactor * Update tests * Add fulfillment settings card (#1242) * Add fulfillment setting card * Make fulfillment approvement naming consistent * Fix mutation bug * Update types * Trigger CI * Handle fulfillment acceptance on order details page (#1255) * Handle fulfillment acceptance on order details page * Make fulfillment approvement naming consistent * Update fulfillment schema and its usage * Render history events regarding waiting fulfillments (#1265) * Add awaiting for approval fulfillment order event * Fix warehouse name * Change fulfillment quantity calculation (#1267) * Change fulfillment quantity calculation * Fix warehouse name * Update messages * Trigger CI * Refactor * Fix refactor * Fix fulfillment for no variant * Allow creating fulfillments waiting for acceptance (#1248) * Fix fulfillment page style and typescript classname types perfomance issue * Allow creating fulfillments waiting for acceptance * Make fulfillment approvement naming consistent * Update schema * Add tooltip to fulfillment savebar * Update unpaid fulfillment creation restriction * Update fulfillment cration restriction * Update test snapshots * Add possibility to cancel "waiting" fulfillments (#1288) * Allow to cancel waiting fulfillments * Add delete button to fulfillment card * Update test snapshots * Handle waiting fulfillments on refund page (#1290) * Handle waiting fulfillments on refund page * Trigger CI * Trigger CI * Calculate quantity to refund on quantityToFulfill * Update changelog * Update snapshots Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com>
82 lines
2.6 KiB
TypeScript
82 lines
2.6 KiB
TypeScript
import { Typography } from "@material-ui/core";
|
|
import { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton";
|
|
import Container from "@saleor/components/Container";
|
|
import Grid from "@saleor/components/Grid";
|
|
import PageHeader from "@saleor/components/PageHeader";
|
|
import Savebar from "@saleor/components/Savebar";
|
|
import { OrderSettingsFragment } from "@saleor/fragments/types/OrderSettingsFragment";
|
|
import { ShopOrderSettingsFragment } from "@saleor/fragments/types/ShopOrderSettingsFragment";
|
|
import { SubmitPromise } from "@saleor/hooks/useForm";
|
|
import { sectionNames } from "@saleor/intl";
|
|
import { Backlink } from "@saleor/macaw-ui";
|
|
import React from "react";
|
|
import { FormattedMessage, useIntl } from "react-intl";
|
|
|
|
import OrderFulfillmentSettings from "../OrderFulfillmentSettings";
|
|
import OrderSettings from "../OrderSettings/OrderSettings";
|
|
import OrderSettingsForm, { OrderSettingsFormData } from "./form";
|
|
|
|
export interface OrderSettingsPageProps {
|
|
orderSettings: OrderSettingsFragment;
|
|
shop: ShopOrderSettingsFragment;
|
|
disabled: boolean;
|
|
saveButtonBarState: ConfirmButtonTransitionState;
|
|
onBack: () => void;
|
|
onSubmit: (data: OrderSettingsFormData) => SubmitPromise;
|
|
}
|
|
|
|
const OrderSettingsPage: React.FC<OrderSettingsPageProps> = props => {
|
|
const {
|
|
orderSettings,
|
|
shop,
|
|
disabled,
|
|
saveButtonBarState,
|
|
onBack,
|
|
onSubmit
|
|
} = props;
|
|
const intl = useIntl();
|
|
|
|
return (
|
|
<OrderSettingsForm
|
|
orderSettings={orderSettings}
|
|
shop={shop}
|
|
onSubmit={onSubmit}
|
|
>
|
|
{({ data, submit, hasChanged, change }) => (
|
|
<Container>
|
|
<Backlink onClick={onBack}>
|
|
{intl.formatMessage(sectionNames.orders)}
|
|
</Backlink>
|
|
<PageHeader
|
|
title={intl.formatMessage({
|
|
defaultMessage: "Order settings",
|
|
description: "header"
|
|
})}
|
|
/>
|
|
<Grid variant="inverted">
|
|
<div>
|
|
<Typography>
|
|
<FormattedMessage defaultMessage="General Settings" />
|
|
</Typography>
|
|
</div>
|
|
<OrderSettings data={data} disabled={disabled} onChange={change} />
|
|
<div />
|
|
<OrderFulfillmentSettings
|
|
data={data}
|
|
disabled={disabled}
|
|
onChange={change}
|
|
/>
|
|
</Grid>
|
|
<Savebar
|
|
onCancel={onBack}
|
|
onSubmit={submit}
|
|
disabled={disabled || !hasChanged}
|
|
state={saveButtonBarState}
|
|
/>
|
|
</Container>
|
|
)}
|
|
</OrderSettingsForm>
|
|
);
|
|
};
|
|
OrderSettingsPage.displayName = "OrderSettingsPage";
|
|
export default OrderSettingsPage;
|