saleor-dashboard/src/types.ts

261 lines
6.6 KiB
TypeScript
Raw Normal View History

import { FetchResult, MutationResult } from "@apollo/client";
import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton";
import { UserPermissionFragment } from "@dashboard/graphql";
2019-06-19 14:40:52 +00:00
import { FilterElement, IFilter } from "./components/Filter";
2020-01-15 15:36:45 +00:00
import { MultiAutocompleteChoiceType } from "./components/MultiAutocompleteSelectField";
2019-06-19 14:40:52 +00:00
export interface UserError {
2020-02-24 14:14:48 +00:00
field: string | null;
message?: string | null;
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",
ORDER_DETAILS_LIST = "ORDER_DETAILS_LIST",
ORDER_DRAFT_DETAILS_LIST = "ORDER_DRAFT_DETAILS_LIST",
2019-08-09 11:14:35 +00:00
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;
2019-08-09 11:14:35 +00:00
settings?: ListSettings<TColumns>;
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?: FilterElement;
2019-06-19 14:40:52 +00:00
}
2019-09-13 11:33:42 +00:00
Enhancements to pagination navigation (#2063) * Update macaw to include Paginator changes * Add link support to TablePagination component * Rewrite usePaginator to use context and links instead of onClick * Refactor ProductList to use new usePaginator hook * Add decorator for PaginatorContext in ProductList stories * Refactor AppList to use new usePaginator hook * Refactor AttributeList to use new usePaginator hook * Add missing pagination props for local pagination to AttributeValues * Refactor CategoryList to use new usePaginator hook * Refactor CategoryDetails to use useLocalPaginator and context * Refactor CollectionList to use new usePaginator hook * Refactor CollectionProducts to use new usePaginator hook * Refactor CustomerList to use new usePaginator hook * Refactor VoucherDetailsPage to use PaginationContext * Refactor SaleDetails to use PaginatorContext * Refactor SaleList to use new usePaginator hook * Refactor VoucherList to use new usePaginator hook * Fix type error in paginatorContextValues fixture * Refactor GitfCardList to use new usePaginator hook * Remove unused imports * Refactor MenuList to use new usePaginator hook * Refactor OrderDraftList to use new usePaginator hook * Refactor OrderListPage to use new usePaginator hook * Refactor PageList to use new usePaginator hook * Refactor PageTypeList to use new usePaginator hook * Refactor PermissionGroupList to use new usePaginator hook * Refactor PluginsList to use new usePaginator hook * Refactor ProductTypeList to use new usePaginator hook * Refactor ShippingMethodProducts to use PaginationContext * Refactor ShippingZonesList to use new usePaginator hook * Refactor StaffList to use new usePaginator hook * Fix TS errors * Update TranslationEntities and TranslationFields to use new usePaginator * Refactor WarehouseList to use new usePaginator hook * Fix errors in stories that didn't use PaginationContextDecorator * Mention changes in changelog * Update to latest macaw version, update snapshots
2022-05-31 12:53:16 +00:00
export interface PaginateListProps {
pageInfo?: {
hasNextPage: boolean;
hasPreviousPage: boolean;
};
onNextPage: () => void;
onPreviousPage: () => void;
}
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;
}
2023-04-12 07:11:11 +00:00
export type TabListActions<TToolbars extends string> =
ListActionsWithoutToolbar &
Record<TToolbars, React.ReactNode | React.ReactNodeArray>;
2019-06-19 14:40:52 +00:00
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
}
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
}
2023-07-04 07:27:17 +00:00
export interface FilterPagePropsWithPresets<
TKeys extends string,
TOpts extends {},
> extends FilterProps<TKeys>,
SearchPageProps,
FilterPresetsProps {
filterOpts: TOpts;
}
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
}
2023-07-04 07:27:17 +00:00
export interface FilterPresetsProps {
selectedFilterPreset: number | undefined;
2023-07-04 07:27:17 +00:00
filterPresets: string[];
onFilterPresetsAll: () => void;
onFilterPresetChange: (id: number) => void;
onFilterPresetUpdate: (name: string) => void;
onFilterPresetDelete: (id: number) => void;
onFilterPresetPresetSave: () => void;
hasPresetsChanged: () => boolean;
2023-07-04 07:27:17 +00:00
}
2019-09-10 15:14:11 +00:00
export interface TabPageProps {
currentTab: number | undefined;
2019-09-10 15:14:11 +00:00
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 {} = {},
2023-04-12 07:11:11 +00:00
TVariables extends {} = {},
2019-06-19 14:40:52 +00:00
> {
2019-12-06 17:14:19 +00:00
opts: MutationResult<TData> & MutationResultAdditionalProps;
mutate: (variables: TVariables) => Promise<FetchResult<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[]>>
>;
export type FiltersWithKeyValueValues<TFilters extends string> = Partial<
Record<TFilters, KeyValue[]>
>;
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 {
Use graphql-codegen (#1874) * Use generated hooks in apps * Remove unused files * Use proper types in apps * Use generated hooks in attributes * Use generated hooks in auth module * Use generated hooks in categories * Use generated hooks in channels * Use generated types in collections * Remove legacy types from background tasks * Use generated hooks in customers * Use generated hooks in discounts * Use generated hook in file upload * Use generated types in gift cards * Use generated types in home * Use generated hooks in navigation * Use generated hooks in orders * Use generated hooks in pages * Use generated hooks in page types * Use generated hooks in permission groups * Use generated hooks in plugins * Use generated hooks in products * Use fragment to mark product variants * Improve code a bit * Use generated hooks in page types * Use generated types in searches * Use generated hooks in shipping * Use generated hooks in site settings * Use generated hooks in staff members * Use generated hooks in taxes * Place all gql generated files in one directory * Use generated hooks in translations * Use global types from new generated module * Use generated hooks in warehouses * Use generated hooks in webhooks * Use generated fragment types * Unclutter types * Remove hoc components * Split hooks and types * Fetch introspection file * Delete obsolete schema file * Fix rebase artifacts * Fix autoreplace * Fix auth provider tests * Fix urls * Remove leftover types * Fix rebase artifacts
2022-03-09 08:56:55 +00:00
userPermissions: UserPermissionFragment[];
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 interface KeyValue {
key: string;
value?: string;
}
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[];
export enum StatusType {
INFO = "info",
ERROR = "error",
WARNING = "warning",
SUCCESS = "success",
}
Use graphql-codegen (#1874) * Use generated hooks in apps * Remove unused files * Use proper types in apps * Use generated hooks in attributes * Use generated hooks in auth module * Use generated hooks in categories * Use generated hooks in channels * Use generated types in collections * Remove legacy types from background tasks * Use generated hooks in customers * Use generated hooks in discounts * Use generated hook in file upload * Use generated types in gift cards * Use generated types in home * Use generated hooks in navigation * Use generated hooks in orders * Use generated hooks in pages * Use generated hooks in page types * Use generated hooks in permission groups * Use generated hooks in plugins * Use generated hooks in products * Use fragment to mark product variants * Improve code a bit * Use generated hooks in page types * Use generated types in searches * Use generated hooks in shipping * Use generated hooks in site settings * Use generated hooks in staff members * Use generated hooks in taxes * Place all gql generated files in one directory * Use generated hooks in translations * Use global types from new generated module * Use generated hooks in warehouses * Use generated hooks in webhooks * Use generated fragment types * Unclutter types * Remove hoc components * Split hooks and types * Fetch introspection file * Delete obsolete schema file * Fix rebase artifacts * Fix autoreplace * Fix auth provider tests * Fix urls * Remove leftover types * Fix rebase artifacts
2022-03-09 08:56:55 +00:00
export type RelayToFlat<T extends { edges: Array<{ node: any }> }> = Array<
T["edges"][0]["node"]
>;