2023-02-20 15:21:28 +00:00
|
|
|
import { TopNav } from "@dashboard/components/AppLayout/TopNav";
|
2023-01-16 09:45:12 +00:00
|
|
|
import CardMenu from "@dashboard/components/CardMenu";
|
|
|
|
import CardSpacer from "@dashboard/components/CardSpacer";
|
|
|
|
import { DateTime } from "@dashboard/components/Date";
|
2023-02-28 09:33:16 +00:00
|
|
|
import { DetailPageLayout } from "@dashboard/components/Layouts";
|
2023-01-16 09:45:12 +00:00
|
|
|
import Savebar from "@dashboard/components/Savebar";
|
|
|
|
import Skeleton from "@dashboard/components/Skeleton";
|
2022-07-07 15:31:26 +00:00
|
|
|
import {
|
2022-08-10 09:11:32 +00:00
|
|
|
ChannelUsabilityDataQuery,
|
2023-04-28 11:24:10 +00:00
|
|
|
OrderDetailsFragment,
|
|
|
|
OrderErrorFragment,
|
2022-07-07 15:31:26 +00:00
|
|
|
OrderLineInput,
|
|
|
|
SearchCustomersQuery,
|
2023-01-16 09:45:12 +00:00
|
|
|
} from "@dashboard/graphql";
|
|
|
|
import { SubmitPromise } from "@dashboard/hooks/useForm";
|
|
|
|
import useNavigator from "@dashboard/hooks/useNavigator";
|
|
|
|
import OrderChannelSectionCard from "@dashboard/orders/components/OrderChannelSectionCard";
|
|
|
|
import { orderDraftListUrl } from "@dashboard/orders/urls";
|
|
|
|
import { FetchMoreProps, RelayToFlat } from "@dashboard/types";
|
|
|
|
import { Typography } from "@material-ui/core";
|
2022-08-10 09:11:32 +00:00
|
|
|
import { ConfirmButtonTransitionState } from "@saleor/macaw-ui";
|
2023-02-20 15:21:28 +00:00
|
|
|
import { Box } from "@saleor/macaw-ui/next";
|
2020-05-14 09:30:32 +00:00
|
|
|
import React from "react";
|
|
|
|
import { useIntl } from "react-intl";
|
|
|
|
|
2021-05-06 11:38:15 +00:00
|
|
|
import OrderCustomer, { CustomerEditData } from "../OrderCustomer";
|
2019-06-19 14:40:52 +00:00
|
|
|
import OrderDraftDetails from "../OrderDraftDetails/OrderDraftDetails";
|
|
|
|
import OrderHistory, { FormData as HistoryFormData } from "../OrderHistory";
|
2022-08-10 09:11:32 +00:00
|
|
|
import OrderDraftAlert from "./OrderDraftAlert";
|
2019-06-19 14:40:52 +00:00
|
|
|
|
2022-03-01 08:38:23 +00:00
|
|
|
export interface OrderDraftPageProps extends FetchMoreProps {
|
2019-06-19 14:40:52 +00:00
|
|
|
disabled: boolean;
|
2023-04-28 11:24:10 +00:00
|
|
|
order?: OrderDetailsFragment;
|
2022-08-10 09:11:32 +00:00
|
|
|
channelUsabilityData?: ChannelUsabilityDataQuery;
|
2022-03-09 08:56:55 +00:00
|
|
|
users: RelayToFlat<SearchCustomersQuery["search"]>;
|
2019-06-19 14:40:52 +00:00
|
|
|
usersLoading: boolean;
|
2022-08-10 09:11:32 +00:00
|
|
|
errors: OrderErrorFragment[];
|
2019-06-19 14:40:52 +00:00
|
|
|
saveButtonBarState: ConfirmButtonTransitionState;
|
|
|
|
fetchUsers: (query: string) => void;
|
|
|
|
onBillingAddressEdit: () => void;
|
2021-05-06 11:38:15 +00:00
|
|
|
onCustomerEdit: (data: CustomerEditData) => void;
|
2019-06-19 14:40:52 +00:00
|
|
|
onDraftFinalize: () => void;
|
|
|
|
onDraftRemove: () => void;
|
2022-02-01 09:58:06 +00:00
|
|
|
onNoteAdd: (data: HistoryFormData) => SubmitPromise<any[]>;
|
2019-06-19 14:40:52 +00:00
|
|
|
onOrderLineAdd: () => void;
|
2022-07-07 15:31:26 +00:00
|
|
|
onOrderLineChange: (id: string, data: OrderLineInput) => void;
|
2019-06-19 14:40:52 +00:00
|
|
|
onOrderLineRemove: (id: string) => void;
|
|
|
|
onProductClick: (id: string) => void;
|
|
|
|
onShippingAddressEdit: () => void;
|
|
|
|
onShippingMethodEdit: () => void;
|
|
|
|
onProfileView: () => void;
|
|
|
|
}
|
|
|
|
|
2019-10-30 14:34:24 +00:00
|
|
|
const OrderDraftPage: React.FC<OrderDraftPageProps> = props => {
|
|
|
|
const {
|
Order details datagrid (#3325)
* Show available channels
* Add price and updatedAt columns
* Fix sorting, only sort on selected columns
* Sort by channel
* Allow delete name and product type
* Fix show not product found
* Extract mssages
* Product datagrid custom column picker
* Column picker in data grid in dirty hack for bug
* fix storybook props
* Restore Datagrid defalt column picker with custom render
* Add sort by attributes
* Use datagrid loading cells
* Fix product searching
* Show attributes before last updated
* Readonly all fields in datagrid
* Fix creating new datagrid row
* Remove add new procut button from datagrid
* Show only active sorted column
* Temp fix for column filter
* Fix column mismatch
* Add comments and spred props to ColumnPicker
* Cleanup
* Update avatar size and styles
* On row click with hover on row styles
* Use new theme
* Change placeholder image
* Draw rounded image with border
* Readonly product datagrid
* Use new theme colors in datagrid
* Add vertical borders control to datagrid
* Add empty column to add padding
* Add coursor to datagrid
* Restore vertical borders, fix cursor pointer
* Add custom freezed column
* Initial tooltip for column
* Move tooltip to datagrid
* Adjust datagrid colors style, add possibility to select column
* Change datagrid selected cells colors
* Fix typo and extract messages
* Base order datagrid
* Cleanup Datagrid component
* Cleanup and code refactor
* Remove cursor pointer props from readonlyCell
* Use money cell for total column
* Add custom cell renderers and fix types
* Simple tags implemenrtion for status and payment col
* Add colors from theme
* Make tagCell more dynamic
* Refactor Datagrid file structure
* Add loading indicators
* Selecting column without cells in readonly
* Add sort icons to orders list
* Refactor after CR. fix typos
* Change color of selected colum cell on hover
* Improve selected header text contrast
* Move useColumnPickerColumns to hooks dir with tests
* Add less padding to column picker button
* Remove double border top
* Fix cursor pointer for tagCell and moneyCell
* useGetCellContent hook
* On loading show only one row
* Add missing darkmod color for warning tag
* Refactor columns in datagrid
* Add new macaw theme provider to storybook
* Fix passing props in datagrid
* Trigger deployment
* Fix column picker in products
* useDatagridColumns
* Fix one more time
* Add column picker with default columns
* Change color for selected header change to textBrandDefault
* Remove unused code, move attributes colums as last
* Cleanup useDatagridColumns
* Improve DatagridProps
* Static datagrid for products (#3144)
* Migrate top nav of product list page to new MacawUI (#3290)
* feat: migrate top nav of product page
* feat: add proper deprecation links
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
* Datagrin on order details intial
* Adjust ExtraInfoLines
* Remove padding on datagrid card content
* Remove datagrid card paddding (#3310)
* Disable column icon when no rows in orders
* Datagrid row hover show only when readonly and row clickable
* Implement card view for product list (#3292)
* Add temporary view switcher
* Add basic product tile view
* Bump macaw-ui
* Add ellipsis
* Bump macaw-ui
* Add status dot & fix non-rectangular thumbnails
* Bump macaw-ui
* Add variable size placeholder icon
* Improve loader
* Fix top nav menu key error
* Add pagination
* Add unit tests
* Extract messages
* Extract status color to function
* CR Refactor
* Hold product view state in local storage (#3315)
* Remember view state for product list
* Use util status function for status dots
* Datagrin in orderDraftDetails
* Remove not used components
* Fix for empty column and hover in datagrid for product (#3324)
* Remove datagrid card paddding (#3310)
* Fix for empty column and hover in datagrid for product (#3324)
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Add empty column from datagrid, improve theme types
* Use theme type from typeof
* Use empty column and themeValues
* Filter empty column from default
* New product header (#3346)
* Extraxt messages
* Remve title left padding
* Fix switching view
* Add margin right to nav button
* Improve view switch
* Update switch view icons
* Add spacing to switch
* Add more space
* Add new filterbar to order list
* Code refactor and tests
* Refactor OrderDraftDetailsDatagrid
* Extract messages
* Refactor OrderDraftDetailsDatagrid
* Update alert messages
* Extract messages
* Write unit tests
* Improve switch component
* Overwrite Pill styles
* Common method to get status color for pills
* Local Pill component POC
* Add ThemeProvider to test wrapper
* Extract messages
* Refactor Pill
* Fix Pill path
* Fix tests mocks
* Remove scrollbar and border bottom
* Add custom border to to datagrid
* Fix borders
* Fix border bottom
* Refactor and cleanup
* Remove not needed selectionActions code
* Move logic code t misc
* Fix scrollbar and zindex datagrid borders
* Fix product tiles condition
* Use utils functions, remove not used code
* Refactor to hooks
* Loading prps instead of disabled
* use getStatusColor
* Move getMenuItems to separate function
* Fix loading props
* Use empty colum hook in OrderDetailsDatagrid
* Fix empty column when save column change
* Fix bottom line in layout overlap
* Show moneCell with discounted price
* Make quantity ediable in order draft datagrid
* Readonly datagrid cells
* Update onyl when column is quantity
* Fix message
* Keep first column in datagrid not removable
* Fix for not existing column
* Add loader over datagrid, fix problem with border top when empty text in variants
* Fix error color and change color in datagrid
* Use formatMoneyAmount
* Fix remove order draft product with discount
* Extract messages
* Add product sku to order draft details datagrid
* Fix loading state and change cell color
* Add MoneyDiscuntedCell
* Use MoneyDiscuntedCell in order draft details datagrid
* Add trash bin icon
* Restor discount modal for order draft summary
* Fix problem with deleting quantity
* Improve await for promises and handler zero quantity error
* Fix column order issue
* Add discount modal box shadow
* Allow decimal as percentage value for discount
* Fix max fixed value
* Remove double border
* Fix z-index issue on discount modal
* Remove padding on order details datagrid
* Add proper error message to common discount modal
* Fix is submit disabled
* Move status as last column in datagrid
* Add padding to money discount cell editor
* Make quantity column smaller
* Fix recalculating disount value
* Fix calculate change discount type
* Store calculated value without triming decimal, trim decimal in input
* Refactor money cells
* markCellsDirty rename to areCellsDirty
* Remove discount from MoneyCell
* Use const to store row height in discount editor
* Fix copy in discount modal
* Remove past on money discount cell
* Remove locale in product varaints
* Fix nullable sku
* Extract messages
* Fix keeping always first column
* Remove padding on tracking info
* Fix story
* Fix render 0 money amount
* Fix displaying not empty string money
* adding new tests: add new product, change quantity, add inline discount, delete product for grid - on orders details view (#3652)
* adding new e2e for grid on orders details view
* merging conflicts fix - and adding new TC numbers to new tests
* trigger tests
* failing tests fixes
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
Co-authored-by: Krzysztof Żuraw <9116238+krzysztofzuraw@users.noreply.github.com>
Co-authored-by: Michał Droń <droniu@droniu.dev>
Co-authored-by: wojteknowacki <124166231+wojteknowacki@users.noreply.github.com>
Co-authored-by: wojteknowacki <wojciech.nowacki@saleor.io>
2023-05-18 07:52:13 +00:00
|
|
|
loading,
|
2019-06-19 14:40:52 +00:00
|
|
|
fetchUsers,
|
2019-10-15 12:17:35 +00:00
|
|
|
hasMore,
|
2019-06-19 14:40:52 +00:00
|
|
|
saveButtonBarState,
|
|
|
|
onBillingAddressEdit,
|
|
|
|
onCustomerEdit,
|
|
|
|
onDraftFinalize,
|
|
|
|
onDraftRemove,
|
2019-10-15 12:17:35 +00:00
|
|
|
onFetchMore,
|
2019-06-19 14:40:52 +00:00
|
|
|
onNoteAdd,
|
|
|
|
onOrderLineAdd,
|
|
|
|
onOrderLineChange,
|
|
|
|
onOrderLineRemove,
|
|
|
|
onShippingAddressEdit,
|
|
|
|
onShippingMethodEdit,
|
|
|
|
onProfileView,
|
|
|
|
order,
|
2022-08-10 09:11:32 +00:00
|
|
|
channelUsabilityData,
|
2019-06-19 14:40:52 +00:00
|
|
|
users,
|
2022-06-21 09:36:55 +00:00
|
|
|
usersLoading,
|
2022-08-10 09:11:32 +00:00
|
|
|
errors,
|
2019-10-30 14:34:24 +00:00
|
|
|
} = props;
|
2022-05-06 08:59:55 +00:00
|
|
|
const navigate = useNavigator();
|
2019-10-30 14:34:24 +00:00
|
|
|
|
|
|
|
const intl = useIntl();
|
2019-08-26 17:44:42 +00:00
|
|
|
|
2019-10-30 14:34:24 +00:00
|
|
|
return (
|
2023-02-28 09:33:16 +00:00
|
|
|
<DetailPageLayout>
|
2023-02-20 15:21:28 +00:00
|
|
|
<TopNav
|
|
|
|
href={orderDraftListUrl()}
|
|
|
|
title={
|
2023-05-30 06:47:21 +00:00
|
|
|
<Box display="flex" alignItems="center" gap={3}>
|
2023-02-20 15:21:28 +00:00
|
|
|
<span>{order?.number ? "#" + order?.number : undefined}</span>
|
|
|
|
<div>
|
|
|
|
{order && order.created ? (
|
|
|
|
<Typography variant="body2">
|
|
|
|
<DateTime date={order.created} plain />
|
|
|
|
</Typography>
|
|
|
|
) : (
|
|
|
|
<Skeleton style={{ width: "10em" }} />
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</Box>
|
|
|
|
}
|
2019-10-30 14:34:24 +00:00
|
|
|
>
|
|
|
|
<CardMenu
|
|
|
|
menuItems={[
|
|
|
|
{
|
|
|
|
label: intl.formatMessage({
|
2022-05-05 07:54:28 +00:00
|
|
|
id: "PAqicb",
|
2019-10-30 14:34:24 +00:00
|
|
|
defaultMessage: "Cancel order",
|
2022-06-21 09:36:55 +00:00
|
|
|
description: "button",
|
2019-10-30 14:34:24 +00:00
|
|
|
}),
|
2022-06-21 09:36:55 +00:00
|
|
|
onSelect: onDraftRemove,
|
|
|
|
},
|
2019-10-30 14:34:24 +00:00
|
|
|
]}
|
|
|
|
/>
|
2023-02-20 15:21:28 +00:00
|
|
|
</TopNav>
|
2023-02-28 09:33:16 +00:00
|
|
|
<DetailPageLayout.Content>
|
2023-02-20 15:21:28 +00:00
|
|
|
<OrderDraftAlert
|
2023-04-28 11:24:10 +00:00
|
|
|
order={order as OrderDetailsFragment}
|
2023-02-20 15:21:28 +00:00
|
|
|
channelUsabilityData={channelUsabilityData}
|
|
|
|
/>
|
|
|
|
<OrderDraftDetails
|
2023-04-28 11:24:10 +00:00
|
|
|
order={order as OrderDetailsFragment}
|
2023-02-20 15:21:28 +00:00
|
|
|
channelUsabilityData={channelUsabilityData}
|
|
|
|
errors={errors}
|
Order details datagrid (#3325)
* Show available channels
* Add price and updatedAt columns
* Fix sorting, only sort on selected columns
* Sort by channel
* Allow delete name and product type
* Fix show not product found
* Extract mssages
* Product datagrid custom column picker
* Column picker in data grid in dirty hack for bug
* fix storybook props
* Restore Datagrid defalt column picker with custom render
* Add sort by attributes
* Use datagrid loading cells
* Fix product searching
* Show attributes before last updated
* Readonly all fields in datagrid
* Fix creating new datagrid row
* Remove add new procut button from datagrid
* Show only active sorted column
* Temp fix for column filter
* Fix column mismatch
* Add comments and spred props to ColumnPicker
* Cleanup
* Update avatar size and styles
* On row click with hover on row styles
* Use new theme
* Change placeholder image
* Draw rounded image with border
* Readonly product datagrid
* Use new theme colors in datagrid
* Add vertical borders control to datagrid
* Add empty column to add padding
* Add coursor to datagrid
* Restore vertical borders, fix cursor pointer
* Add custom freezed column
* Initial tooltip for column
* Move tooltip to datagrid
* Adjust datagrid colors style, add possibility to select column
* Change datagrid selected cells colors
* Fix typo and extract messages
* Base order datagrid
* Cleanup Datagrid component
* Cleanup and code refactor
* Remove cursor pointer props from readonlyCell
* Use money cell for total column
* Add custom cell renderers and fix types
* Simple tags implemenrtion for status and payment col
* Add colors from theme
* Make tagCell more dynamic
* Refactor Datagrid file structure
* Add loading indicators
* Selecting column without cells in readonly
* Add sort icons to orders list
* Refactor after CR. fix typos
* Change color of selected colum cell on hover
* Improve selected header text contrast
* Move useColumnPickerColumns to hooks dir with tests
* Add less padding to column picker button
* Remove double border top
* Fix cursor pointer for tagCell and moneyCell
* useGetCellContent hook
* On loading show only one row
* Add missing darkmod color for warning tag
* Refactor columns in datagrid
* Add new macaw theme provider to storybook
* Fix passing props in datagrid
* Trigger deployment
* Fix column picker in products
* useDatagridColumns
* Fix one more time
* Add column picker with default columns
* Change color for selected header change to textBrandDefault
* Remove unused code, move attributes colums as last
* Cleanup useDatagridColumns
* Improve DatagridProps
* Static datagrid for products (#3144)
* Migrate top nav of product list page to new MacawUI (#3290)
* feat: migrate top nav of product page
* feat: add proper deprecation links
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
* Datagrin on order details intial
* Adjust ExtraInfoLines
* Remove padding on datagrid card content
* Remove datagrid card paddding (#3310)
* Disable column icon when no rows in orders
* Datagrid row hover show only when readonly and row clickable
* Implement card view for product list (#3292)
* Add temporary view switcher
* Add basic product tile view
* Bump macaw-ui
* Add ellipsis
* Bump macaw-ui
* Add status dot & fix non-rectangular thumbnails
* Bump macaw-ui
* Add variable size placeholder icon
* Improve loader
* Fix top nav menu key error
* Add pagination
* Add unit tests
* Extract messages
* Extract status color to function
* CR Refactor
* Hold product view state in local storage (#3315)
* Remember view state for product list
* Use util status function for status dots
* Datagrin in orderDraftDetails
* Remove not used components
* Fix for empty column and hover in datagrid for product (#3324)
* Remove datagrid card paddding (#3310)
* Fix for empty column and hover in datagrid for product (#3324)
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Add empty column from datagrid, improve theme types
* Use theme type from typeof
* Use empty column and themeValues
* Filter empty column from default
* New product header (#3346)
* Extraxt messages
* Remve title left padding
* Fix switching view
* Add margin right to nav button
* Improve view switch
* Update switch view icons
* Add spacing to switch
* Add more space
* Add new filterbar to order list
* Code refactor and tests
* Refactor OrderDraftDetailsDatagrid
* Extract messages
* Refactor OrderDraftDetailsDatagrid
* Update alert messages
* Extract messages
* Write unit tests
* Improve switch component
* Overwrite Pill styles
* Common method to get status color for pills
* Local Pill component POC
* Add ThemeProvider to test wrapper
* Extract messages
* Refactor Pill
* Fix Pill path
* Fix tests mocks
* Remove scrollbar and border bottom
* Add custom border to to datagrid
* Fix borders
* Fix border bottom
* Refactor and cleanup
* Remove not needed selectionActions code
* Move logic code t misc
* Fix scrollbar and zindex datagrid borders
* Fix product tiles condition
* Use utils functions, remove not used code
* Refactor to hooks
* Loading prps instead of disabled
* use getStatusColor
* Move getMenuItems to separate function
* Fix loading props
* Use empty colum hook in OrderDetailsDatagrid
* Fix empty column when save column change
* Fix bottom line in layout overlap
* Show moneCell with discounted price
* Make quantity ediable in order draft datagrid
* Readonly datagrid cells
* Update onyl when column is quantity
* Fix message
* Keep first column in datagrid not removable
* Fix for not existing column
* Add loader over datagrid, fix problem with border top when empty text in variants
* Fix error color and change color in datagrid
* Use formatMoneyAmount
* Fix remove order draft product with discount
* Extract messages
* Add product sku to order draft details datagrid
* Fix loading state and change cell color
* Add MoneyDiscuntedCell
* Use MoneyDiscuntedCell in order draft details datagrid
* Add trash bin icon
* Restor discount modal for order draft summary
* Fix problem with deleting quantity
* Improve await for promises and handler zero quantity error
* Fix column order issue
* Add discount modal box shadow
* Allow decimal as percentage value for discount
* Fix max fixed value
* Remove double border
* Fix z-index issue on discount modal
* Remove padding on order details datagrid
* Add proper error message to common discount modal
* Fix is submit disabled
* Move status as last column in datagrid
* Add padding to money discount cell editor
* Make quantity column smaller
* Fix recalculating disount value
* Fix calculate change discount type
* Store calculated value without triming decimal, trim decimal in input
* Refactor money cells
* markCellsDirty rename to areCellsDirty
* Remove discount from MoneyCell
* Use const to store row height in discount editor
* Fix copy in discount modal
* Remove past on money discount cell
* Remove locale in product varaints
* Fix nullable sku
* Extract messages
* Fix keeping always first column
* Remove padding on tracking info
* Fix story
* Fix render 0 money amount
* Fix displaying not empty string money
* adding new tests: add new product, change quantity, add inline discount, delete product for grid - on orders details view (#3652)
* adding new e2e for grid on orders details view
* merging conflicts fix - and adding new TC numbers to new tests
* trigger tests
* failing tests fixes
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
Co-authored-by: Krzysztof Żuraw <9116238+krzysztofzuraw@users.noreply.github.com>
Co-authored-by: Michał Droń <droniu@droniu.dev>
Co-authored-by: wojteknowacki <124166231+wojteknowacki@users.noreply.github.com>
Co-authored-by: wojteknowacki <wojciech.nowacki@saleor.io>
2023-05-18 07:52:13 +00:00
|
|
|
loading={loading}
|
2023-02-20 15:21:28 +00:00
|
|
|
onOrderLineAdd={onOrderLineAdd}
|
|
|
|
onOrderLineChange={onOrderLineChange}
|
|
|
|
onOrderLineRemove={onOrderLineRemove}
|
|
|
|
onShippingMethodEdit={onShippingMethodEdit}
|
|
|
|
/>
|
|
|
|
<OrderHistory
|
|
|
|
history={order?.events}
|
|
|
|
orderCurrency={order?.total?.gross.currency}
|
|
|
|
onNoteAdd={onNoteAdd}
|
|
|
|
/>
|
2023-02-28 09:33:16 +00:00
|
|
|
</DetailPageLayout.Content>
|
|
|
|
<DetailPageLayout.RightSidebar>
|
2023-02-20 15:21:28 +00:00
|
|
|
<OrderChannelSectionCard channel={order?.channel} />
|
|
|
|
<CardSpacer />
|
|
|
|
<OrderCustomer
|
|
|
|
canEditAddresses={!!order?.user}
|
|
|
|
canEditCustomer={true}
|
|
|
|
fetchUsers={fetchUsers}
|
|
|
|
hasMore={hasMore}
|
|
|
|
loading={usersLoading}
|
|
|
|
errors={errors}
|
2023-04-28 11:24:10 +00:00
|
|
|
order={order as OrderDetailsFragment}
|
2023-02-20 15:21:28 +00:00
|
|
|
users={users}
|
|
|
|
onBillingAddressEdit={onBillingAddressEdit}
|
|
|
|
onCustomerEdit={onCustomerEdit}
|
|
|
|
onFetchMore={onFetchMore}
|
|
|
|
onProfileView={onProfileView}
|
|
|
|
onShippingAddressEdit={onShippingAddressEdit}
|
|
|
|
/>
|
2023-02-28 09:33:16 +00:00
|
|
|
</DetailPageLayout.RightSidebar>
|
2021-07-21 08:59:52 +00:00
|
|
|
<Savebar
|
2019-10-30 14:34:24 +00:00
|
|
|
state={saveButtonBarState}
|
Order details datagrid (#3325)
* Show available channels
* Add price and updatedAt columns
* Fix sorting, only sort on selected columns
* Sort by channel
* Allow delete name and product type
* Fix show not product found
* Extract mssages
* Product datagrid custom column picker
* Column picker in data grid in dirty hack for bug
* fix storybook props
* Restore Datagrid defalt column picker with custom render
* Add sort by attributes
* Use datagrid loading cells
* Fix product searching
* Show attributes before last updated
* Readonly all fields in datagrid
* Fix creating new datagrid row
* Remove add new procut button from datagrid
* Show only active sorted column
* Temp fix for column filter
* Fix column mismatch
* Add comments and spred props to ColumnPicker
* Cleanup
* Update avatar size and styles
* On row click with hover on row styles
* Use new theme
* Change placeholder image
* Draw rounded image with border
* Readonly product datagrid
* Use new theme colors in datagrid
* Add vertical borders control to datagrid
* Add empty column to add padding
* Add coursor to datagrid
* Restore vertical borders, fix cursor pointer
* Add custom freezed column
* Initial tooltip for column
* Move tooltip to datagrid
* Adjust datagrid colors style, add possibility to select column
* Change datagrid selected cells colors
* Fix typo and extract messages
* Base order datagrid
* Cleanup Datagrid component
* Cleanup and code refactor
* Remove cursor pointer props from readonlyCell
* Use money cell for total column
* Add custom cell renderers and fix types
* Simple tags implemenrtion for status and payment col
* Add colors from theme
* Make tagCell more dynamic
* Refactor Datagrid file structure
* Add loading indicators
* Selecting column without cells in readonly
* Add sort icons to orders list
* Refactor after CR. fix typos
* Change color of selected colum cell on hover
* Improve selected header text contrast
* Move useColumnPickerColumns to hooks dir with tests
* Add less padding to column picker button
* Remove double border top
* Fix cursor pointer for tagCell and moneyCell
* useGetCellContent hook
* On loading show only one row
* Add missing darkmod color for warning tag
* Refactor columns in datagrid
* Add new macaw theme provider to storybook
* Fix passing props in datagrid
* Trigger deployment
* Fix column picker in products
* useDatagridColumns
* Fix one more time
* Add column picker with default columns
* Change color for selected header change to textBrandDefault
* Remove unused code, move attributes colums as last
* Cleanup useDatagridColumns
* Improve DatagridProps
* Static datagrid for products (#3144)
* Migrate top nav of product list page to new MacawUI (#3290)
* feat: migrate top nav of product page
* feat: add proper deprecation links
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
* Datagrin on order details intial
* Adjust ExtraInfoLines
* Remove padding on datagrid card content
* Remove datagrid card paddding (#3310)
* Disable column icon when no rows in orders
* Datagrid row hover show only when readonly and row clickable
* Implement card view for product list (#3292)
* Add temporary view switcher
* Add basic product tile view
* Bump macaw-ui
* Add ellipsis
* Bump macaw-ui
* Add status dot & fix non-rectangular thumbnails
* Bump macaw-ui
* Add variable size placeholder icon
* Improve loader
* Fix top nav menu key error
* Add pagination
* Add unit tests
* Extract messages
* Extract status color to function
* CR Refactor
* Hold product view state in local storage (#3315)
* Remember view state for product list
* Use util status function for status dots
* Datagrin in orderDraftDetails
* Remove not used components
* Fix for empty column and hover in datagrid for product (#3324)
* Remove datagrid card paddding (#3310)
* Fix for empty column and hover in datagrid for product (#3324)
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Use themeValues from macaw (#3326)
* Upgrade macaw
* Use themeValues
* Add empty column from datagrid, improve theme types
* Use theme type from typeof
* Use empty column and themeValues
* Filter empty column from default
* New product header (#3346)
* Extraxt messages
* Remve title left padding
* Fix switching view
* Add margin right to nav button
* Improve view switch
* Update switch view icons
* Add spacing to switch
* Add more space
* Add new filterbar to order list
* Code refactor and tests
* Refactor OrderDraftDetailsDatagrid
* Extract messages
* Refactor OrderDraftDetailsDatagrid
* Update alert messages
* Extract messages
* Write unit tests
* Improve switch component
* Overwrite Pill styles
* Common method to get status color for pills
* Local Pill component POC
* Add ThemeProvider to test wrapper
* Extract messages
* Refactor Pill
* Fix Pill path
* Fix tests mocks
* Remove scrollbar and border bottom
* Add custom border to to datagrid
* Fix borders
* Fix border bottom
* Refactor and cleanup
* Remove not needed selectionActions code
* Move logic code t misc
* Fix scrollbar and zindex datagrid borders
* Fix product tiles condition
* Use utils functions, remove not used code
* Refactor to hooks
* Loading prps instead of disabled
* use getStatusColor
* Move getMenuItems to separate function
* Fix loading props
* Use empty colum hook in OrderDetailsDatagrid
* Fix empty column when save column change
* Fix bottom line in layout overlap
* Show moneCell with discounted price
* Make quantity ediable in order draft datagrid
* Readonly datagrid cells
* Update onyl when column is quantity
* Fix message
* Keep first column in datagrid not removable
* Fix for not existing column
* Add loader over datagrid, fix problem with border top when empty text in variants
* Fix error color and change color in datagrid
* Use formatMoneyAmount
* Fix remove order draft product with discount
* Extract messages
* Add product sku to order draft details datagrid
* Fix loading state and change cell color
* Add MoneyDiscuntedCell
* Use MoneyDiscuntedCell in order draft details datagrid
* Add trash bin icon
* Restor discount modal for order draft summary
* Fix problem with deleting quantity
* Improve await for promises and handler zero quantity error
* Fix column order issue
* Add discount modal box shadow
* Allow decimal as percentage value for discount
* Fix max fixed value
* Remove double border
* Fix z-index issue on discount modal
* Remove padding on order details datagrid
* Add proper error message to common discount modal
* Fix is submit disabled
* Move status as last column in datagrid
* Add padding to money discount cell editor
* Make quantity column smaller
* Fix recalculating disount value
* Fix calculate change discount type
* Store calculated value without triming decimal, trim decimal in input
* Refactor money cells
* markCellsDirty rename to areCellsDirty
* Remove discount from MoneyCell
* Use const to store row height in discount editor
* Fix copy in discount modal
* Remove past on money discount cell
* Remove locale in product varaints
* Fix nullable sku
* Extract messages
* Fix keeping always first column
* Remove padding on tracking info
* Fix story
* Fix render 0 money amount
* Fix displaying not empty string money
* adding new tests: add new product, change quantity, add inline discount, delete product for grid - on orders details view (#3652)
* adding new e2e for grid on orders details view
* merging conflicts fix - and adding new TC numbers to new tests
* trigger tests
* failing tests fixes
---------
Co-authored-by: Michał Droń <dron.official@yahoo.com>
Co-authored-by: Krzysztof Żuraw <9116238+krzysztofzuraw@users.noreply.github.com>
Co-authored-by: Michał Droń <droniu@droniu.dev>
Co-authored-by: wojteknowacki <124166231+wojteknowacki@users.noreply.github.com>
Co-authored-by: wojteknowacki <wojciech.nowacki@saleor.io>
2023-05-18 07:52:13 +00:00
|
|
|
disabled={loading}
|
2022-05-06 08:59:55 +00:00
|
|
|
onCancel={() => navigate(orderDraftListUrl())}
|
2021-07-21 08:59:52 +00:00
|
|
|
onSubmit={onDraftFinalize}
|
2019-10-30 14:34:24 +00:00
|
|
|
labels={{
|
2021-07-21 08:59:52 +00:00
|
|
|
confirm: intl.formatMessage({
|
2022-05-05 07:54:28 +00:00
|
|
|
id: "4Z14xW",
|
2019-10-30 14:34:24 +00:00
|
|
|
defaultMessage: "Finalize",
|
2022-06-21 09:36:55 +00:00
|
|
|
description: "button",
|
|
|
|
}),
|
2019-10-30 14:34:24 +00:00
|
|
|
}}
|
|
|
|
/>
|
2023-02-28 09:33:16 +00:00
|
|
|
</DetailPageLayout>
|
2019-10-30 14:34:24 +00:00
|
|
|
);
|
|
|
|
};
|
2019-06-19 14:40:52 +00:00
|
|
|
OrderDraftPage.displayName = "OrderDraftPage";
|
|
|
|
export default OrderDraftPage;
|