saleor-dashboard/src/types.ts

220 lines
5.6 KiB
TypeScript
Raw Normal View History

Bump macaw to 0.3 (#1807) * Update to new design theme (#1631) * Update macaw to 0.3.0 (#1623) * Update macaw to 0.3 * Use proper pagination component * Fix type errors * Remove leftover import * Remove variant and color from confirm button * Remove alias * Update macaw * Fix button type * Random fixes (#1633) * Improve layout components * Use colored svgs * Minor fixes * Fix autocomplete loaders * Fix padding * Fix button variant * Remove codegen file * Fixes after bumping macaw to 0.3 part 2 (#1638) * Fix various visual bugs * Fix type errors * Bump macaw * Random fixes part 3 (#1647) * wip * Fix mismatched paddings * Fix actions container padding * Put story in the right directory * Fix shipping zone picker * Fix minor visual bugs * Remove unused imports * Move styles to separate file * Random fixes part 4 (#1641) * Fix various visual bugs * Fix type errors * Fix last table item padding * Add outline on hover * Fix spaces * Fix spaces * Remove dead code * Fix elevation * Remove dead code * Fix shadows * Add outline to expand button * Fix spacing * Fix spacings * Fix selectable tables hover * Use proper delete icon * Fix ConfirmButtonTransitionState imports * Update src/apps/components/CustomApps/CustomApps.tsx Co-authored-by: Wojciech Mista <wojciech.mista@saleor.io> Co-authored-by: Wojciech Mista <wojciech.mista@saleor.io> * Rework error page (#1670) * Remake error page * Fix types * Update error id styles * Fix types * Login page rework (#1703) * Rework login page * Remove outline * Fix logo and footer placement * Sort imports * Random fixes part 5 (#1669) * Fix text color in dark mode * Update password reset pages (#1714) * Update password reset pages * Update src/auth/components/ResetPasswordPage/ResetPasswordPage.tsx Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com> Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com> * Fix collection page * Update dark mode logo * Bring back "create app" button * Fix spacings * Fix selects * Fix login e2e test * Fix not found page displaying * Update selector * Add missing package * Let dropdown overflow through card * Fix scroll * Fix scroll * Fix overflow on grid element * Fix e2e tests * Fix data-test-id * Update snapshots * Update messages * Update macaw * Update snapshots * Use stable macaw version Co-authored-by: Wojciech Mista <wojciech.mista@saleor.io> Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com> * Update to new design theme (#1631) * Update macaw to 0.3.0 (#1623) * Update macaw to 0.3 * Use proper pagination component * Fix type errors * Remove leftover import * Remove variant and color from confirm button * Remove alias * Update macaw * Fix button type * Random fixes (#1633) * Improve layout components * Use colored svgs * Minor fixes * Fix autocomplete loaders * Fix padding * Fix button variant * Remove codegen file * Fixes after bumping macaw to 0.3 part 2 (#1638) * Fix various visual bugs * Fix type errors * Bump macaw * Random fixes part 3 (#1647) * wip * Fix mismatched paddings * Fix actions container padding * Put story in the right directory * Fix shipping zone picker * Fix minor visual bugs * Remove unused imports * Move styles to separate file * Random fixes part 4 (#1641) * Fix various visual bugs * Fix type errors * Fix last table item padding * Add outline on hover * Fix spaces * Fix spaces * Remove dead code * Fix elevation * Remove dead code * Fix shadows * Add outline to expand button * Fix spacing * Fix spacings * Fix selectable tables hover * Use proper delete icon * Fix ConfirmButtonTransitionState imports * Update src/apps/components/CustomApps/CustomApps.tsx Co-authored-by: Wojciech Mista <wojciech.mista@saleor.io> Co-authored-by: Wojciech Mista <wojciech.mista@saleor.io> * Rework error page (#1670) * Remake error page * Fix types * Update error id styles * Fix types * Login page rework (#1703) * Rework login page * Remove outline * Fix logo and footer placement * Sort imports * Random fixes part 5 (#1669) * Fix text color in dark mode * Update password reset pages (#1714) * Update password reset pages * Update src/auth/components/ResetPasswordPage/ResetPasswordPage.tsx Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com> Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com> * Fix collection page * Update dark mode logo * Bring back "create app" button * Fix spacings * Fix selects * Fix login e2e test * Fix not found page displaying * Update selector * Add missing package * Let dropdown overflow through card * Fix scroll * Fix scroll * Fix overflow on grid element * Fix e2e tests * Fix data-test-id * Update snapshots * Update messages * Update macaw * Update snapshots * Use stable macaw version Co-authored-by: Wojciech Mista <wojciech.mista@saleor.io> Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com> * Fix visual bugs and artifacts * Fix dropdown menus being clipped (#1762) * wip * Fix clipped select menus * Remove unused import * Fix spacing * Fix tests * Fix select content appearing under dialogs (#1777) * Fix type errors * Fix bulk delete button placement * Fix filter arrow buttons * Fix messages * Remove backling from pages list * Move status above events * Update messages and snapshots Co-authored-by: Wojciech Mista <wojciech.mista@saleor.io> Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com>
2022-01-28 12:34:20 +00:00
import { ConfirmButtonTransitionState } from "@saleor/macaw-ui";
Refactor changing address in order details directly (#1697) (#1818) * Refactor changing address in order details directly (#1697) * wip change address edit buttons behaviour in order draft * wip modify dialog view when customer is not changed * wip remove old address edit modal * wip rm old address modal storybook * wip async search state change * wip disable edit in draft when no customer is selected * wip fix submitting issues * wip allow single address mutation * wip fix billing change & manual address change * wip fix covered country dropdown * wip add address clone checkbox * wip normal order details & unconfirmed views * wip messages minor fixes * wip clone address checkbox on new address input option * Storybook update * cleanup * billing same as shipping fixes * improve stories titles & move to component folder * improve continueToAddressSearchState readibility * improve dialog title/description message descriptors * change .then() to await * Remove redundant onClick arrow function Co-authored-by: Dominik Żegleń <flesz3@o2.pl> * Improve OrderAddressFields component * move shipping & billing address edit props outside file * Update snapshots * fix mutation output types in order views * Fix confirm button state type * fix skipping query when modal is refreshed * fix cancel button to match designs * update dialog headers * fix customer address choice card styling for blue theme * change hidecard to showcard * export types to local file * improve isAnyAddressEditModalOpen function * fix cut hover effect on inputs * fix submitting modal when modal is closed with x button * fix validation & initial form data * update messages * Update partial mutation return type * Add vertical spacer component * Revert CardSpacer changes * Change some of Form & Card spacers to Vertical Spacers * Fix makeStyles import in VerticalSpacer * Fix border color for AddressCards * Add type to addressFieldsCommonProps object * Change stories subtitles to lowercase * Fix country choices type * Fix setState react type * Improve address change handlers * Update snapshots * Fix default country not showing up in address edit single autocomplete field Co-authored-by: Dominik Żegleń <flesz3@o2.pl> Co-authored-by: Magdalena Markusik <magdalena.markusik@mirumee.com> * Fix linter issue Co-authored-by: Dominik Żegleń <flesz3@o2.pl> Co-authored-by: Magdalena Markusik <magdalena.markusik@mirumee.com>
2022-02-02 11:22:39 +00:00
import { MutationFetchResult, MutationResult } from "react-apollo";
2019-06-19 14:40:52 +00:00
import { IFilter, IFilterElement } from "./components/Filter";
2020-01-15 15:36:45 +00:00
import { MultiAutocompleteChoiceType } from "./components/MultiAutocompleteSelectField";
import { User_userPermissions } from "./fragments/types/User";
2019-06-19 14:40:52 +00:00
export interface UserError {
2020-02-24 14:14:48 +00:00
field: string | null;
2020-03-24 14:05:26 +00:00
message?: string;
2019-06-19 14:40:52 +00:00
}
2019-11-08 10:25:17 +00:00
export interface DialogProps {
open: boolean;
onClose: () => void;
}
2019-08-09 11:14:35 +00:00
export interface ListSettings<TColumn extends string = string> {
columns?: TColumn[];
rowNumber: number;
}
export enum ListViews {
Apps (#599) * create Apps view * create more app components, generate types and messages * apps refactor, update snapshots * show error message in tooltip when app installation fail * update apps components and view, add apps list to storybook * update defaultMessages * create app details view * update AppListPage with Skeleton component * create app activate/deactivate dialogs, create app details stories * add AppHeader to AppDetailsPage * update defaultMessages * update AppDetails view and components after review * create custom app details view * refactor webhooks * update webhooks fixtures * update WebhookDetailsPage story * update strings * create CustomAppCreate view and components * update AppListPage story * create AppInstall view and page * handle errors in AppInstall view * update defaultMessages * add AppInstallPage to storybook * add status prop to MessageManager * update defaultMessages * remove service account section * remove service account routes * remove as operator from notify status * add notifications for app installations * update styles for deactivated app * update app installations with local storage * update defaultMessages * AppInstall update * dd delete button to ongoin installations table * fix active installations condition * fix error messages in AppsList * update defaultMessages * add iframe to AppDetailsPage * create AppDetailsSettingsPage * install macaw-ui * apps styles clean up * update schema, fixtures * few apps updates * WebhookCreate - fix onBack button name * WebhookCreatePage story update * rename apps table from external to thirdparty * update defaultMessages * fix test, update snapshots * AppDetailsSettings - add token to headers * fix first number in local apps query * app details settings - use shop domain host * add onSettingsRowClick to InstalledApps * resolve conflicts * update changelog and messages * add noopener noreferrer do app privacy link * update snapshots * update snapshots * updates after review * update defaultMessages * CustomAppDetails - add missing notify status
2020-07-22 10:54:15 +00:00
APPS_LIST = "APPS_LIST",
2019-08-09 11:14:35 +00:00
ATTRIBUTE_LIST = "ATTRIBUTE_LIST",
ATTRIBUTE_VALUE_LIST = "ATTRIBUTE_VALUE_LIST",
2019-08-09 11:14:35 +00:00
CATEGORY_LIST = "CATEGORY_LIST",
COLLECTION_LIST = "COLLECTION_LIST",
CUSTOMER_LIST = "CUSTOMER_LIST",
DRAFT_LIST = "DRAFT_LIST",
NAVIGATION_LIST = "NAVIGATION_LIST",
ORDER_LIST = "ORDER_LIST",
PAGES_LIST = "PAGES_LIST",
Page types (#807) * Create attribute class selector * Use ProductAttributeType to check if product is simple or with variants * Allow attribute class selection only during its creation * Update attribute type selection translations * Show only product attributes in columns picker on product list view * Cleanups in Attribute Organization component * Create Page Types list page * Create content management section in settings * Implement page types list view * Remove unused imports from page type list * Updatte page type list style * Remove legacy code from page type list component * Update PageTypeListPage component * Create Page Types details page * Fix page type attribute reordering * Implement PageType create view * Implement PageType update view * gUpdate page type details components * Fix page type update component * Update page type components stories * Update page type errors handling * Update page type details view * Create Page Types details page * Implement PageType create view * Update product attribute assignment mutations * Add page types attribute assignment mutations * Add page types attribute assignment handling * Temporarily fix page create mutation * Update page type error messages * Remove legacy storybook page type stories * Update attribute assignment dialogs stories * Update page type details error handling * Update props for page type components * Create attribute class selector * Implement page types list view * Add page type selector on page create and details views * Add attributes list to page details views * Update page types list * Use attribute errors for attributes muatations * Save attribute values on page create and update * Update messages for page view * Update page attributes fragment * Use AttributeError in AttributeBulkDelete * Update page type and its attribute selection * Handle page types deleting * Update page types deleting messages * Handle page types attribute reorder * Fix PageOrganizeContent component types * Update graphqql types * Fix page fixture * Update messages * Update test snapshots * Pass pageTypes to PageForm * Update changelog with page type addition note * Update package-lock * Update test snapshots * Fix malformed generated type * Update messages after rebase
2020-11-19 14:42:14 +00:00
PAGE_TYPES_LIST = "PAGE_TYPES_LIST",
2019-08-27 12:36:19 +00:00
PLUGINS_LIST = "PLUGIN_LIST",
2019-08-09 11:14:35 +00:00
PRODUCT_LIST = "PRODUCT_LIST",
PERMISSION_GROUP_LIST = "PERMISSION_GROUP_LIST",
2019-09-12 13:00:25 +00:00
PRODUCT_TYPE_LIST = "PRODUCT_TYPE_LIST",
2019-08-09 11:14:35 +00:00
SALES_LIST = "SALES_LIST",
SHIPPING_METHODS_LIST = "SHIPPING_METHODS_LIST",
STAFF_MEMBERS_LIST = "STAFF_MEMBERS_LIST",
2019-10-09 06:56:46 +00:00
VOUCHER_LIST = "VOUCHER_LIST",
2020-01-30 11:46:35 +00:00
WAREHOUSE_LIST = "WAREHOUSE_LIST",
WEBHOOK_LIST = "WEBHOOK_LIST",
Add Gift Cards #1 (#1291) * Add gift cards section to menu and add empty list component * Update messages * Change styling of app wide page header to match design * Add gift cards list table wip * Update prop name for status chip component to make it more consistent with other components * Replace old trash icon with new one * Add Size type based on action dialog sizes to be used app wide * Add delete icon button * Add new sizes option to status chip component * Add / update gift cards list components * Add bulk actions type * Work on gift cards list WIP * Small refactor * Fix styling of gift cards table * Remove temp files * Remove unnecessary type * Add gift cards section to menu and add empty list component * Update schema and types * Add link to gift card update page to gift cards list and add route to gift cards index * Extract order page title with status chip into a separate generic component and use it in order page title * wip * Update money component * Add gift card details card balance section * Refactor gift card details * Add vertical spacer component * Update schema and types * Add gift card tag input component along with necessary queries * Add gift card tag input to gift card update page * Add gift card update details card expiry section WIP * Add time period select field WIP * Post rebase refactor * Add time period select field to gift card update view * Fixes after review * Update schema, types and gift cards query * Add getFullName util function and replace existing manual usages * Add text with select field component * Add gift card update info card and refactor * Fix import * Add displaying order link in gift card update * Refactor * Connect gift card list to api * refactor * Add gift card create dialog * Fix gift card list styles, change location for gift card list query, minor refactor * Fix menu structure data for gift cards * Add channel currencies type to shop * Refactor text with select field * Add gift card expiry select component * Add gift card error type and fragment * Update global types * Add default prop to getFormErrors function * Move gift card details provider to providers dir * Update global utils with mapSingleValueNodeToChoice function * Update gift card tag input * Move and refactor time period field * Update schema * move format money function to other money ulities * Update gift card urls * Add content or skeleton component * Add gift card create util for extracting expiry settings input data * Remove content or skeleton component and move displaying logic to existing skeleton * Move displaying logic of gift card create dialog to list * Refactor * Add hooks for gift card bulk actions and gift card list to be used instead of context directly * Fix types for text with select field + add parsing for number typed field * Add initial currency to gift card create form * Fix gift card create dialog closing animation * Add gift card update info card * Refactor gift card update details card * Add gift card balance dialog * Move gift card update form providers to providers dir * Connect gift card update page to api, add necessary contexts etc. * Refactor * Refactor * Add hooks to use instead of gift card contexts directly * Fix types * Fix text field target name missing in passed event in text with select field * Add minimal value option to text with select field, add to gift card inputs * Fix gift card update balance dialog not changing hasChanged prop after submit * Refactor * Fix update balance dialog crashing the app when enetered wrong amount * Fix gift card list table header styles * Add enable / disable section to gift card update * Refactor * Refactor * Refactor * Add metadata to gift card update * Update messages ids * Refactor * Refactor * Refactor * Refactor * Update types after rebase * Fix types * Fixes after qa * Fix tests
2021-08-16 13:44:00 +00:00
TRANSLATION_ATTRIBUTE_VALUE_LIST = "TRANSLATION_ATTRIBUTE_VALUE_LIST",
GIFT_CARD_LIST = " GIFT_CARD_LIST"
2019-08-09 11:14:35 +00:00
}
export interface ListProps<TColumns extends string = string> {
2019-06-19 14:40:52 +00:00
disabled: boolean;
pageInfo?: {
hasNextPage: boolean;
hasPreviousPage: boolean;
};
2019-08-09 11:14:35 +00:00
settings?: ListSettings<TColumns>;
2019-06-19 14:40:52 +00:00
onNextPage: () => void;
onPreviousPage: () => void;
onRowClick: (id: string) => () => void;
2021-06-15 15:15:14 +00:00
onUpdateListSettings?: <T extends keyof ListSettings<TColumns>>(
key: T,
value: ListSettings<TColumns>[T]
2019-08-09 11:14:35 +00:00
) => void;
onListSettingsReset?: () => void;
filterDependency?: IFilterElement;
2019-06-19 14:40:52 +00:00
}
2019-09-13 11:33:42 +00:00
export interface SortPage<TSortKey extends string> {
2019-09-13 14:17:12 +00:00
sort: Sort<TSortKey>;
2019-09-26 10:14:07 +00:00
onSort: (field: TSortKey, id?: string) => void;
2019-09-13 11:33:42 +00:00
}
/**
* @param toggle Will be use to change status of item
* @param isChecked Returns true for ids of chosen items
* @param selected Number of chosen items.
*/
2019-06-19 14:40:52 +00:00
export interface ListActionsWithoutToolbar {
toggle: (id: string) => void;
toggleAll: (items: React.ReactNodeArray, selected: number) => void;
isChecked: (id: string) => boolean;
selected: number;
}
export type TabListActions<
TToolbars extends string
> = ListActionsWithoutToolbar &
Record<TToolbars, React.ReactNode | React.ReactNodeArray>;
export interface ListActions extends ListActionsWithoutToolbar {
toolbar: React.ReactNode | React.ReactNodeArray;
}
2019-08-09 11:14:35 +00:00
export interface PageListProps<TColumns extends string = string>
extends ListProps<TColumns> {
defaultSettings?: ListSettings<TColumns>;
2019-06-19 14:40:52 +00:00
onAdd: () => void;
}
2019-09-10 15:14:11 +00:00
2020-02-11 15:05:09 +00:00
export interface SearchProps {
2019-06-19 14:40:52 +00:00
onSearchChange: (value: string) => void;
}
2020-02-11 15:05:09 +00:00
export interface SearchPageProps extends SearchProps {
initialSearch: string;
}
export interface FilterPageProps<TKeys extends string, TOpts extends {}>
2019-12-20 15:53:03 +00:00
extends FilterProps<TKeys>,
SearchPageProps,
2019-09-12 14:22:42 +00:00
TabPageProps {
2019-12-20 15:53:03 +00:00
filterOpts: TOpts;
2019-09-10 15:14:11 +00:00
}
2019-12-20 15:53:03 +00:00
export interface FilterProps<TKeys extends string> {
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
currencySymbol?: string;
2019-12-20 15:53:03 +00:00
onFilterChange: (filter: IFilter<TKeys>) => void;
onFilterAttributeFocus?: (id?: string) => void;
2019-09-10 15:14:11 +00:00
}
export interface TabPageProps {
currentTab: number;
tabs: string[];
onAll: () => void;
onTabChange: (tab: number) => void;
onTabDelete: () => void;
onTabSave: () => void;
2019-06-19 14:40:52 +00:00
}
export interface ChannelProps {
selectedChannelId: string;
}
2019-06-19 14:40:52 +00:00
export interface PartialMutationProviderOutput<
TData extends {} = {},
TVariables extends {} = {}
> {
2019-12-06 17:14:19 +00:00
opts: MutationResult<TData> & MutationResultAdditionalProps;
Refactor changing address in order details directly (#1697) (#1818) * Refactor changing address in order details directly (#1697) * wip change address edit buttons behaviour in order draft * wip modify dialog view when customer is not changed * wip remove old address edit modal * wip rm old address modal storybook * wip async search state change * wip disable edit in draft when no customer is selected * wip fix submitting issues * wip allow single address mutation * wip fix billing change & manual address change * wip fix covered country dropdown * wip add address clone checkbox * wip normal order details & unconfirmed views * wip messages minor fixes * wip clone address checkbox on new address input option * Storybook update * cleanup * billing same as shipping fixes * improve stories titles & move to component folder * improve continueToAddressSearchState readibility * improve dialog title/description message descriptors * change .then() to await * Remove redundant onClick arrow function Co-authored-by: Dominik Żegleń <flesz3@o2.pl> * Improve OrderAddressFields component * move shipping & billing address edit props outside file * Update snapshots * fix mutation output types in order views * Fix confirm button state type * fix skipping query when modal is refreshed * fix cancel button to match designs * update dialog headers * fix customer address choice card styling for blue theme * change hidecard to showcard * export types to local file * improve isAnyAddressEditModalOpen function * fix cut hover effect on inputs * fix submitting modal when modal is closed with x button * fix validation & initial form data * update messages * Update partial mutation return type * Add vertical spacer component * Revert CardSpacer changes * Change some of Form & Card spacers to Vertical Spacers * Fix makeStyles import in VerticalSpacer * Fix border color for AddressCards * Add type to addressFieldsCommonProps object * Change stories subtitles to lowercase * Fix country choices type * Fix setState react type * Improve address change handlers * Update snapshots * Fix default country not showing up in address edit single autocomplete field Co-authored-by: Dominik Żegleń <flesz3@o2.pl> Co-authored-by: Magdalena Markusik <magdalena.markusik@mirumee.com> * Fix linter issue Co-authored-by: Dominik Żegleń <flesz3@o2.pl> Co-authored-by: Magdalena Markusik <magdalena.markusik@mirumee.com>
2022-02-02 11:22:39 +00:00
mutate: (variables: TVariables) => Promise<MutationFetchResult<TData>>;
2019-06-19 14:40:52 +00:00
}
export interface Node {
id: string;
}
export interface SlugNode {
slug: string;
}
2019-06-19 14:40:52 +00:00
Add Gift Cards #1 (#1291) * Add gift cards section to menu and add empty list component * Update messages * Change styling of app wide page header to match design * Add gift cards list table wip * Update prop name for status chip component to make it more consistent with other components * Replace old trash icon with new one * Add Size type based on action dialog sizes to be used app wide * Add delete icon button * Add new sizes option to status chip component * Add / update gift cards list components * Add bulk actions type * Work on gift cards list WIP * Small refactor * Fix styling of gift cards table * Remove temp files * Remove unnecessary type * Add gift cards section to menu and add empty list component * Update schema and types * Add link to gift card update page to gift cards list and add route to gift cards index * Extract order page title with status chip into a separate generic component and use it in order page title * wip * Update money component * Add gift card details card balance section * Refactor gift card details * Add vertical spacer component * Update schema and types * Add gift card tag input component along with necessary queries * Add gift card tag input to gift card update page * Add gift card update details card expiry section WIP * Add time period select field WIP * Post rebase refactor * Add time period select field to gift card update view * Fixes after review * Update schema, types and gift cards query * Add getFullName util function and replace existing manual usages * Add text with select field component * Add gift card update info card and refactor * Fix import * Add displaying order link in gift card update * Refactor * Connect gift card list to api * refactor * Add gift card create dialog * Fix gift card list styles, change location for gift card list query, minor refactor * Fix menu structure data for gift cards * Add channel currencies type to shop * Refactor text with select field * Add gift card expiry select component * Add gift card error type and fragment * Update global types * Add default prop to getFormErrors function * Move gift card details provider to providers dir * Update global utils with mapSingleValueNodeToChoice function * Update gift card tag input * Move and refactor time period field * Update schema * move format money function to other money ulities * Update gift card urls * Add content or skeleton component * Add gift card create util for extracting expiry settings input data * Remove content or skeleton component and move displaying logic to existing skeleton * Move displaying logic of gift card create dialog to list * Refactor * Add hooks for gift card bulk actions and gift card list to be used instead of context directly * Fix types for text with select field + add parsing for number typed field * Add initial currency to gift card create form * Fix gift card create dialog closing animation * Add gift card update info card * Refactor gift card update details card * Add gift card balance dialog * Move gift card update form providers to providers dir * Connect gift card update page to api, add necessary contexts etc. * Refactor * Refactor * Add hooks to use instead of gift card contexts directly * Fix types * Fix text field target name missing in passed event in text with select field * Add minimal value option to text with select field, add to gift card inputs * Fix gift card update balance dialog not changing hasChanged prop after submit * Refactor * Fix update balance dialog crashing the app when enetered wrong amount * Fix gift card list table header styles * Add enable / disable section to gift card update * Refactor * Refactor * Refactor * Add metadata to gift card update * Update messages ids * Refactor * Refactor * Refactor * Refactor * Update types after rebase * Fix types * Fixes after qa * Fix tests
2021-08-16 13:44:00 +00:00
export interface TagNode {
tag: string;
}
2019-06-19 14:40:52 +00:00
export type Pagination = Partial<{
after: string;
before: string;
}>;
export type Dialog<TDialog extends string> = Partial<{
action: TDialog;
}>;
export type ActiveTab<TTab extends string = string> = Partial<{
activeTab: TTab;
}>;
export type Filters<TFilters extends string> = Partial<
Record<TFilters, string>
>;
2019-09-05 13:05:12 +00:00
export type FiltersWithMultipleValues<TFilters extends string> = Partial<
2019-12-20 10:44:41 +00:00
Record<TFilters, string[]>
2019-09-05 13:05:12 +00:00
>;
2020-01-17 14:25:50 +00:00
export type FiltersAsDictWithMultipleValues<TFilters extends string> = Partial<
Record<TFilters, Record<string, string[]>>
>;
2020-01-09 13:38:04 +00:00
export type Search = Partial<{
query: string;
}>;
2019-06-19 14:40:52 +00:00
export type SingleAction = Partial<{
id: string;
}>;
2019-09-13 11:33:42 +00:00
export type Sort<TSort extends string = string> = Partial<{
asc: boolean;
sort: TSort;
}>;
2019-06-19 14:40:52 +00:00
export type BulkAction = Partial<{
ids: string[];
}>;
2019-08-09 11:14:35 +00:00
export interface ReorderEvent {
oldIndex: number;
newIndex: number;
}
export type ReorderAction = (event: ReorderEvent) => void;
2019-08-12 14:11:10 +00:00
export interface FetchMoreProps {
2019-08-09 11:14:35 +00:00
loading: boolean;
hasMore: boolean;
Add channel shipping zones (#1015) * Add naked input option to SingleAutocompleteSelectField and update it's stories * Add new icons - chevron up, down & trash * Add deletable item component and stories * Add card add items footer component to be used in warehouses and product stocks assign * Update schema and types * Add shipping zones card components * Update channel details page form to also include shipping zones * Update makeTopLevelSearch hook files directory and add getSearchFetchMoreProps function to avoid extracting it manually every time * Update channels types & fragments * Move getDefaultNotifierSuccessErrorData function to useNotifier utils, update dir etc., also make order discount provider use it from the new dir * Add shippinh zone to channel update and create and add shipping zone search * Update messages * Fix types * Fix lint, types etc * Small refactor from review and quick fix styles of shipping zones card * Refactor a bit and update snapshots * Refactor a bit and update snapshots * Addd / refactor channels availability components * Add useChannelsWithProductVariants hook with utils and types * Add / refactor more channels availability components * Move avatar from table cell avatar to separate component for it to be usable outside of tables * Add channels with variants logic to product create and update pages & views * Refactor components to use updated channels availability components * Remove unnecessary comments * Update storybook * Update types * Update messages * Fix prices for variants / simple product not uodating properly * Post merge cleanup, update schema, types, etc. * Change shipping zone details warehouses card into settings card and add ability to assign channels to shipping zone * Update types * Update snapshots * Fix selecting / deselecting all channels in channels with variants modal * Fixes after review, some types changes etc. * Update snapshots * Small types fixes * Make price rates views use parent shipping method channels instead of all * Make price rates views use parent shipping method channels instead of all * Update types * Fix bugs * Fixes after review * Fix channels availability data submission * Fix lint * Fix variant pricing card showing not related channels * Fixes after review * Fix types * Hide unaviable variants in add products to draft order dialog * Fix channels with variants availability modal showing confirm button as enabled when it shouldn't * Fix types * Update semi checked icon to match old designs * Update types * Update channels icon in channels with variants availability * Fix product cypress test after product channels mutation changed * Fix trash and chevron down colors in dark mode * Fix shipping zones card footer not updating query after click away * Fix types in schema, add condition not to display shipping zones select in channel details if all zones have already been selected * Fix products adding in order draft dialog * Fix simple productupdate * Update snapshots after merge with master * Update messages * Fix product api request for cypress * Add missing test id * Fix selecting if product is simple -> form being submitted with empty data sometimes * Update snapshots, messages and add fix for invalid date at product update * Remove unnecessary imports * Fix failing test in saleor 2552 (#1061) * fix * fix * fix Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com> Co-authored-by: Karolina <rakoczy.karolina@gmail.com>
2021-04-14 13:44:25 +00:00
totalCount?: number;
2019-08-09 11:14:35 +00:00
onFetchMore: () => void;
}
2019-09-10 15:14:11 +00:00
export type TabActionDialog = "save-search" | "delete-search";
2019-10-08 14:19:14 +00:00
export interface UserPermissionProps {
userPermissions: User_userPermissions[];
2019-10-08 14:19:14 +00:00
}
2019-12-06 17:14:19 +00:00
export interface MutationResultAdditionalProps {
2019-12-06 17:17:44 +00:00
status: ConfirmButtonTransitionState;
2019-12-06 17:14:19 +00:00
}
2019-12-20 15:53:03 +00:00
export type MinMax = Record<"min" | "max", string>;
export interface FilterOpts<T> {
active: boolean;
value: T;
}
2020-01-15 15:36:45 +00:00
export interface AutocompleteFilterOpts
extends Partial<FetchMoreProps>,
Partial<SearchPageProps> {
2020-01-15 15:36:45 +00:00
choices: MultiAutocompleteChoiceType[];
displayValues: MultiAutocompleteChoiceType[];
}
export type Ids = string[];