saleor-dashboard/src/components/CardMenu/CardMenu.tsx

201 lines
5.3 KiB
TypeScript
Raw Normal View History

import {
Gift cards post mvp (#1632) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add error message to invalid expiryDate (#1518) * Add error message to invalid expiryDate * Add default messages * Replace filter with some * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Gift card customer page (#1520) * Add gift cards card to customer page (#1456) * WIP * WIP * Extract activate/deactivate logic to a hook * add optional side action * Add query for customer's gift cards * Add component for giftcard status chip * Graphql run types * Add gift card card to customer page * Fix status chip header * Revert style change * Unify status chip logic * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Add queries to refetch prop * Simplify gift card list component * Fix order status chip * Extract messages to separate file * Remove unused lines of code * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Change variable name * Fix formatted message * Check if giftcards exist before rendering collection * Add loading button to CardMenu component (#1476) * WIP * WIP * Add gift card card to customer page * Fix status chip header * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Remove unused lines of code * Revert style change * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Add loading animation to card menu buttons * Added default messages * Change conditional prop checking to filtering * Issue gift card in customer page (#1468) * WIP * WIP * Replace typed query with make query * Add customer details context to customer page * Add context to customer gift cards * Disable customer select when initial customer is present * Pass initial customer to create gift card form * Fixes after cherry-pick * Code cleanup * Remove getInitialData function * Remove unused package * Remove new line * Post-rebase fixes * Code cleanup & extract messages * Remove unused code * Create customer details hook * Minor fixes * Update default messages * Update gift card types * Type fixes * Change directory of useCustomerDetails hook * CR Fixes * Update tests * Make PageTitleWithStatusChip use ExtendedPageHeader * Update tests * Update hook name * Post-rebase fixes * Eslint fix * Fix scrollbar appearing in menu issue (#1539) * Change displayCode to last4CodeChars (#1573) * Add filtered redirect to gift card page from customer details (#1556) * Limit number of channel list items (#1607) * Add max height to single select field menu items container * Add storybook case * Update stories tests * Fix gift card product changing to preorder on save issue (#1583) * Variant preorder fix * Global threshold input should be optional * update snapshot * Add displaying logic gift cards list toolbar (#1617) * add displaying logic for gift card toolbar * Logic fix * Handle bulk export after creation (#1544) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Handle export after bulk gift card creation * Add default messages * Create an util function to get correct input for export * Update component's name * Change modal's title * Update messages Co-authored-by: Magdalena Markusik <magdalena@markusik.com> * Gift Card List item number change doesn't refetch fix (#1643) * Fix number of rows change not refetching list * Add pagination reset * Update descriptions for gift card messages to be more descriptive (#1648) * Gift card history timeline (#1597) * Update queries and mutations * Allow title to be a react node * Show user name if it exists in data object * Update types * Refresh queries on note add * Add gift card history * type fix * Update messages * Fix timeline note * Add event fragment to form update result * Update types * Fix typo * Update messages * Disable input if gift card is expired * Remove unused imports * CR Fixes * Change messages location * Change message to include user in order * Allow adding notes to expired gift cards * Fix disabled input showing dropdown issue (#1636) * On click is disabled when component is disabled * update tests * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Gift card filter in product list view (#1621) * Add GiftCard or Normal filter in Product List View * Fix tests * Fix type check * Don't filter if query param is not in enum * Update messages * Update tests * Code cleanup * Add default messages * Pass intl rather than initialise it in util * Post-rebase fixes * Change product type details messages (#1642) * Update product type gift card options messages * update tests * Add sorting to gift card list (#1569) * Update queries and types for sorting * Add optional handleError method to makeQuery * Add sorting to gift card list * Sorting hook uses useGiftCardList hook * Convert to boolean * Add default sorting field * format fix * Add expiry error handling for issuing gift cards (#1634) * Add expiry error handling for issuing gift cards * Add expiry error message to gift card bulk issue * Update Gift Card tag queries to utilise multiple tags (#1685) * Change displayCode to last4CodeChars (#1573) * Update types * WIP * Update gift card forms to utilise multiple tags * Code cleanup * Update gift card event types * Fixes * Change column with no click handler behaviour * Remove an ability to sort by tags * Remove unused code * Update tests * Update timeline events * Update messages * change array reduce to join * Add Y scroll to dialog content * Bulk create Y scroll fix * Endless loading fix (#1732) * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Wip * Extract dialog component outside of gift card create * Update component's name * Extract dialog component outside of export component to provider * Update tests * Various gift card bugs fixes (#1749) * Change currency to options field * Fix hover and font size * Fix gift card list width * Fix bulk delete dialog * Allow balance to be sorted only when currency is filtered * Sorting by balance after removing currency filter defualts to usedBy * Fix trash icon * Add filter dependency * Fix single deletion with bulk * Update tests * Refactor Links used in Gift Cards * Fix export dialog (#1791) Co-authored-by: Magdalena Markusik <magdalena@markusik.com>
2022-01-25 12:44:19 +00:00
CircularProgress,
ClickAwayListener,
Grow,
MenuItem,
MenuList,
Paper,
Gift cards post mvp (#1632) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add error message to invalid expiryDate (#1518) * Add error message to invalid expiryDate * Add default messages * Replace filter with some * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Gift card customer page (#1520) * Add gift cards card to customer page (#1456) * WIP * WIP * Extract activate/deactivate logic to a hook * add optional side action * Add query for customer's gift cards * Add component for giftcard status chip * Graphql run types * Add gift card card to customer page * Fix status chip header * Revert style change * Unify status chip logic * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Add queries to refetch prop * Simplify gift card list component * Fix order status chip * Extract messages to separate file * Remove unused lines of code * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Change variable name * Fix formatted message * Check if giftcards exist before rendering collection * Add loading button to CardMenu component (#1476) * WIP * WIP * Add gift card card to customer page * Fix status chip header * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Remove unused lines of code * Revert style change * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Add loading animation to card menu buttons * Added default messages * Change conditional prop checking to filtering * Issue gift card in customer page (#1468) * WIP * WIP * Replace typed query with make query * Add customer details context to customer page * Add context to customer gift cards * Disable customer select when initial customer is present * Pass initial customer to create gift card form * Fixes after cherry-pick * Code cleanup * Remove getInitialData function * Remove unused package * Remove new line * Post-rebase fixes * Code cleanup & extract messages * Remove unused code * Create customer details hook * Minor fixes * Update default messages * Update gift card types * Type fixes * Change directory of useCustomerDetails hook * CR Fixes * Update tests * Make PageTitleWithStatusChip use ExtendedPageHeader * Update tests * Update hook name * Post-rebase fixes * Eslint fix * Fix scrollbar appearing in menu issue (#1539) * Change displayCode to last4CodeChars (#1573) * Add filtered redirect to gift card page from customer details (#1556) * Limit number of channel list items (#1607) * Add max height to single select field menu items container * Add storybook case * Update stories tests * Fix gift card product changing to preorder on save issue (#1583) * Variant preorder fix * Global threshold input should be optional * update snapshot * Add displaying logic gift cards list toolbar (#1617) * add displaying logic for gift card toolbar * Logic fix * Handle bulk export after creation (#1544) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Handle export after bulk gift card creation * Add default messages * Create an util function to get correct input for export * Update component's name * Change modal's title * Update messages Co-authored-by: Magdalena Markusik <magdalena@markusik.com> * Gift Card List item number change doesn't refetch fix (#1643) * Fix number of rows change not refetching list * Add pagination reset * Update descriptions for gift card messages to be more descriptive (#1648) * Gift card history timeline (#1597) * Update queries and mutations * Allow title to be a react node * Show user name if it exists in data object * Update types * Refresh queries on note add * Add gift card history * type fix * Update messages * Fix timeline note * Add event fragment to form update result * Update types * Fix typo * Update messages * Disable input if gift card is expired * Remove unused imports * CR Fixes * Change messages location * Change message to include user in order * Allow adding notes to expired gift cards * Fix disabled input showing dropdown issue (#1636) * On click is disabled when component is disabled * update tests * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Gift card filter in product list view (#1621) * Add GiftCard or Normal filter in Product List View * Fix tests * Fix type check * Don't filter if query param is not in enum * Update messages * Update tests * Code cleanup * Add default messages * Pass intl rather than initialise it in util * Post-rebase fixes * Change product type details messages (#1642) * Update product type gift card options messages * update tests * Add sorting to gift card list (#1569) * Update queries and types for sorting * Add optional handleError method to makeQuery * Add sorting to gift card list * Sorting hook uses useGiftCardList hook * Convert to boolean * Add default sorting field * format fix * Add expiry error handling for issuing gift cards (#1634) * Add expiry error handling for issuing gift cards * Add expiry error message to gift card bulk issue * Update Gift Card tag queries to utilise multiple tags (#1685) * Change displayCode to last4CodeChars (#1573) * Update types * WIP * Update gift card forms to utilise multiple tags * Code cleanup * Update gift card event types * Fixes * Change column with no click handler behaviour * Remove an ability to sort by tags * Remove unused code * Update tests * Update timeline events * Update messages * change array reduce to join * Add Y scroll to dialog content * Bulk create Y scroll fix * Endless loading fix (#1732) * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Wip * Extract dialog component outside of gift card create * Update component's name * Extract dialog component outside of export component to provider * Update tests * Various gift card bugs fixes (#1749) * Change currency to options field * Fix hover and font size * Fix gift card list width * Fix bulk delete dialog * Allow balance to be sorted only when currency is filtered * Sorting by balance after removing currency filter defualts to usedBy * Fix trash icon * Add filter dependency * Fix single deletion with bulk * Update tests * Refactor Links used in Gift Cards * Fix export dialog (#1791) Co-authored-by: Magdalena Markusik <magdalena@markusik.com>
2022-01-25 12:44:19 +00:00
Popper,
Typography
} from "@material-ui/core";
import { makeStyles, MoreIcon } from "@saleor/macaw-ui";
Gift cards post mvp (#1632) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add error message to invalid expiryDate (#1518) * Add error message to invalid expiryDate * Add default messages * Replace filter with some * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Gift card customer page (#1520) * Add gift cards card to customer page (#1456) * WIP * WIP * Extract activate/deactivate logic to a hook * add optional side action * Add query for customer's gift cards * Add component for giftcard status chip * Graphql run types * Add gift card card to customer page * Fix status chip header * Revert style change * Unify status chip logic * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Add queries to refetch prop * Simplify gift card list component * Fix order status chip * Extract messages to separate file * Remove unused lines of code * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Change variable name * Fix formatted message * Check if giftcards exist before rendering collection * Add loading button to CardMenu component (#1476) * WIP * WIP * Add gift card card to customer page * Fix status chip header * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Remove unused lines of code * Revert style change * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Add loading animation to card menu buttons * Added default messages * Change conditional prop checking to filtering * Issue gift card in customer page (#1468) * WIP * WIP * Replace typed query with make query * Add customer details context to customer page * Add context to customer gift cards * Disable customer select when initial customer is present * Pass initial customer to create gift card form * Fixes after cherry-pick * Code cleanup * Remove getInitialData function * Remove unused package * Remove new line * Post-rebase fixes * Code cleanup & extract messages * Remove unused code * Create customer details hook * Minor fixes * Update default messages * Update gift card types * Type fixes * Change directory of useCustomerDetails hook * CR Fixes * Update tests * Make PageTitleWithStatusChip use ExtendedPageHeader * Update tests * Update hook name * Post-rebase fixes * Eslint fix * Fix scrollbar appearing in menu issue (#1539) * Change displayCode to last4CodeChars (#1573) * Add filtered redirect to gift card page from customer details (#1556) * Limit number of channel list items (#1607) * Add max height to single select field menu items container * Add storybook case * Update stories tests * Fix gift card product changing to preorder on save issue (#1583) * Variant preorder fix * Global threshold input should be optional * update snapshot * Add displaying logic gift cards list toolbar (#1617) * add displaying logic for gift card toolbar * Logic fix * Handle bulk export after creation (#1544) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Handle export after bulk gift card creation * Add default messages * Create an util function to get correct input for export * Update component's name * Change modal's title * Update messages Co-authored-by: Magdalena Markusik <magdalena@markusik.com> * Gift Card List item number change doesn't refetch fix (#1643) * Fix number of rows change not refetching list * Add pagination reset * Update descriptions for gift card messages to be more descriptive (#1648) * Gift card history timeline (#1597) * Update queries and mutations * Allow title to be a react node * Show user name if it exists in data object * Update types * Refresh queries on note add * Add gift card history * type fix * Update messages * Fix timeline note * Add event fragment to form update result * Update types * Fix typo * Update messages * Disable input if gift card is expired * Remove unused imports * CR Fixes * Change messages location * Change message to include user in order * Allow adding notes to expired gift cards * Fix disabled input showing dropdown issue (#1636) * On click is disabled when component is disabled * update tests * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Gift card filter in product list view (#1621) * Add GiftCard or Normal filter in Product List View * Fix tests * Fix type check * Don't filter if query param is not in enum * Update messages * Update tests * Code cleanup * Add default messages * Pass intl rather than initialise it in util * Post-rebase fixes * Change product type details messages (#1642) * Update product type gift card options messages * update tests * Add sorting to gift card list (#1569) * Update queries and types for sorting * Add optional handleError method to makeQuery * Add sorting to gift card list * Sorting hook uses useGiftCardList hook * Convert to boolean * Add default sorting field * format fix * Add expiry error handling for issuing gift cards (#1634) * Add expiry error handling for issuing gift cards * Add expiry error message to gift card bulk issue * Update Gift Card tag queries to utilise multiple tags (#1685) * Change displayCode to last4CodeChars (#1573) * Update types * WIP * Update gift card forms to utilise multiple tags * Code cleanup * Update gift card event types * Fixes * Change column with no click handler behaviour * Remove an ability to sort by tags * Remove unused code * Update tests * Update timeline events * Update messages * change array reduce to join * Add Y scroll to dialog content * Bulk create Y scroll fix * Endless loading fix (#1732) * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Wip * Extract dialog component outside of gift card create * Update component's name * Extract dialog component outside of export component to provider * Update tests * Various gift card bugs fixes (#1749) * Change currency to options field * Fix hover and font size * Fix gift card list width * Fix bulk delete dialog * Allow balance to be sorted only when currency is filtered * Sorting by balance after removing currency filter defualts to usedBy * Fix trash icon * Add filter dependency * Fix single deletion with bulk * Update tests * Refactor Links used in Gift Cards * Fix export dialog (#1791) Co-authored-by: Magdalena Markusik <magdalena@markusik.com>
2022-01-25 12:44:19 +00:00
import classNames from "classnames";
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 React, { useEffect, useRef, useState } from "react";
Gift cards post mvp (#1632) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add error message to invalid expiryDate (#1518) * Add error message to invalid expiryDate * Add default messages * Replace filter with some * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Gift card customer page (#1520) * Add gift cards card to customer page (#1456) * WIP * WIP * Extract activate/deactivate logic to a hook * add optional side action * Add query for customer's gift cards * Add component for giftcard status chip * Graphql run types * Add gift card card to customer page * Fix status chip header * Revert style change * Unify status chip logic * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Add queries to refetch prop * Simplify gift card list component * Fix order status chip * Extract messages to separate file * Remove unused lines of code * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Change variable name * Fix formatted message * Check if giftcards exist before rendering collection * Add loading button to CardMenu component (#1476) * WIP * WIP * Add gift card card to customer page * Fix status chip header * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Remove unused lines of code * Revert style change * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Add loading animation to card menu buttons * Added default messages * Change conditional prop checking to filtering * Issue gift card in customer page (#1468) * WIP * WIP * Replace typed query with make query * Add customer details context to customer page * Add context to customer gift cards * Disable customer select when initial customer is present * Pass initial customer to create gift card form * Fixes after cherry-pick * Code cleanup * Remove getInitialData function * Remove unused package * Remove new line * Post-rebase fixes * Code cleanup & extract messages * Remove unused code * Create customer details hook * Minor fixes * Update default messages * Update gift card types * Type fixes * Change directory of useCustomerDetails hook * CR Fixes * Update tests * Make PageTitleWithStatusChip use ExtendedPageHeader * Update tests * Update hook name * Post-rebase fixes * Eslint fix * Fix scrollbar appearing in menu issue (#1539) * Change displayCode to last4CodeChars (#1573) * Add filtered redirect to gift card page from customer details (#1556) * Limit number of channel list items (#1607) * Add max height to single select field menu items container * Add storybook case * Update stories tests * Fix gift card product changing to preorder on save issue (#1583) * Variant preorder fix * Global threshold input should be optional * update snapshot * Add displaying logic gift cards list toolbar (#1617) * add displaying logic for gift card toolbar * Logic fix * Handle bulk export after creation (#1544) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Handle export after bulk gift card creation * Add default messages * Create an util function to get correct input for export * Update component's name * Change modal's title * Update messages Co-authored-by: Magdalena Markusik <magdalena@markusik.com> * Gift Card List item number change doesn't refetch fix (#1643) * Fix number of rows change not refetching list * Add pagination reset * Update descriptions for gift card messages to be more descriptive (#1648) * Gift card history timeline (#1597) * Update queries and mutations * Allow title to be a react node * Show user name if it exists in data object * Update types * Refresh queries on note add * Add gift card history * type fix * Update messages * Fix timeline note * Add event fragment to form update result * Update types * Fix typo * Update messages * Disable input if gift card is expired * Remove unused imports * CR Fixes * Change messages location * Change message to include user in order * Allow adding notes to expired gift cards * Fix disabled input showing dropdown issue (#1636) * On click is disabled when component is disabled * update tests * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Gift card filter in product list view (#1621) * Add GiftCard or Normal filter in Product List View * Fix tests * Fix type check * Don't filter if query param is not in enum * Update messages * Update tests * Code cleanup * Add default messages * Pass intl rather than initialise it in util * Post-rebase fixes * Change product type details messages (#1642) * Update product type gift card options messages * update tests * Add sorting to gift card list (#1569) * Update queries and types for sorting * Add optional handleError method to makeQuery * Add sorting to gift card list * Sorting hook uses useGiftCardList hook * Convert to boolean * Add default sorting field * format fix * Add expiry error handling for issuing gift cards (#1634) * Add expiry error handling for issuing gift cards * Add expiry error message to gift card bulk issue * Update Gift Card tag queries to utilise multiple tags (#1685) * Change displayCode to last4CodeChars (#1573) * Update types * WIP * Update gift card forms to utilise multiple tags * Code cleanup * Update gift card event types * Fixes * Change column with no click handler behaviour * Remove an ability to sort by tags * Remove unused code * Update tests * Update timeline events * Update messages * change array reduce to join * Add Y scroll to dialog content * Bulk create Y scroll fix * Endless loading fix (#1732) * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Wip * Extract dialog component outside of gift card create * Update component's name * Extract dialog component outside of export component to provider * Update tests * Various gift card bugs fixes (#1749) * Change currency to options field * Fix hover and font size * Fix gift card list width * Fix bulk delete dialog * Allow balance to be sorted only when currency is filtered * Sorting by balance after removing currency filter defualts to usedBy * Fix trash icon * Add filter dependency * Fix single deletion with bulk * Update tests * Refactor Links used in Gift Cards * Fix export dialog (#1791) Co-authored-by: Magdalena Markusik <magdalena@markusik.com>
2022-01-25 12:44:19 +00:00
import { FormattedMessage } from "react-intl";
2019-06-19 14:40:52 +00:00
import { IconButton } from "../IconButton";
Gift cards post mvp (#1632) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add error message to invalid expiryDate (#1518) * Add error message to invalid expiryDate * Add default messages * Replace filter with some * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Gift card customer page (#1520) * Add gift cards card to customer page (#1456) * WIP * WIP * Extract activate/deactivate logic to a hook * add optional side action * Add query for customer's gift cards * Add component for giftcard status chip * Graphql run types * Add gift card card to customer page * Fix status chip header * Revert style change * Unify status chip logic * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Add queries to refetch prop * Simplify gift card list component * Fix order status chip * Extract messages to separate file * Remove unused lines of code * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Change variable name * Fix formatted message * Check if giftcards exist before rendering collection * Add loading button to CardMenu component (#1476) * WIP * WIP * Add gift card card to customer page * Fix status chip header * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Remove unused lines of code * Revert style change * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Add loading animation to card menu buttons * Added default messages * Change conditional prop checking to filtering * Issue gift card in customer page (#1468) * WIP * WIP * Replace typed query with make query * Add customer details context to customer page * Add context to customer gift cards * Disable customer select when initial customer is present * Pass initial customer to create gift card form * Fixes after cherry-pick * Code cleanup * Remove getInitialData function * Remove unused package * Remove new line * Post-rebase fixes * Code cleanup & extract messages * Remove unused code * Create customer details hook * Minor fixes * Update default messages * Update gift card types * Type fixes * Change directory of useCustomerDetails hook * CR Fixes * Update tests * Make PageTitleWithStatusChip use ExtendedPageHeader * Update tests * Update hook name * Post-rebase fixes * Eslint fix * Fix scrollbar appearing in menu issue (#1539) * Change displayCode to last4CodeChars (#1573) * Add filtered redirect to gift card page from customer details (#1556) * Limit number of channel list items (#1607) * Add max height to single select field menu items container * Add storybook case * Update stories tests * Fix gift card product changing to preorder on save issue (#1583) * Variant preorder fix * Global threshold input should be optional * update snapshot * Add displaying logic gift cards list toolbar (#1617) * add displaying logic for gift card toolbar * Logic fix * Handle bulk export after creation (#1544) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Handle export after bulk gift card creation * Add default messages * Create an util function to get correct input for export * Update component's name * Change modal's title * Update messages Co-authored-by: Magdalena Markusik <magdalena@markusik.com> * Gift Card List item number change doesn't refetch fix (#1643) * Fix number of rows change not refetching list * Add pagination reset * Update descriptions for gift card messages to be more descriptive (#1648) * Gift card history timeline (#1597) * Update queries and mutations * Allow title to be a react node * Show user name if it exists in data object * Update types * Refresh queries on note add * Add gift card history * type fix * Update messages * Fix timeline note * Add event fragment to form update result * Update types * Fix typo * Update messages * Disable input if gift card is expired * Remove unused imports * CR Fixes * Change messages location * Change message to include user in order * Allow adding notes to expired gift cards * Fix disabled input showing dropdown issue (#1636) * On click is disabled when component is disabled * update tests * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Gift card filter in product list view (#1621) * Add GiftCard or Normal filter in Product List View * Fix tests * Fix type check * Don't filter if query param is not in enum * Update messages * Update tests * Code cleanup * Add default messages * Pass intl rather than initialise it in util * Post-rebase fixes * Change product type details messages (#1642) * Update product type gift card options messages * update tests * Add sorting to gift card list (#1569) * Update queries and types for sorting * Add optional handleError method to makeQuery * Add sorting to gift card list * Sorting hook uses useGiftCardList hook * Convert to boolean * Add default sorting field * format fix * Add expiry error handling for issuing gift cards (#1634) * Add expiry error handling for issuing gift cards * Add expiry error message to gift card bulk issue * Update Gift Card tag queries to utilise multiple tags (#1685) * Change displayCode to last4CodeChars (#1573) * Update types * WIP * Update gift card forms to utilise multiple tags * Code cleanup * Update gift card event types * Fixes * Change column with no click handler behaviour * Remove an ability to sort by tags * Remove unused code * Update tests * Update timeline events * Update messages * change array reduce to join * Add Y scroll to dialog content * Bulk create Y scroll fix * Endless loading fix (#1732) * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Wip * Extract dialog component outside of gift card create * Update component's name * Extract dialog component outside of export component to provider * Update tests * Various gift card bugs fixes (#1749) * Change currency to options field * Fix hover and font size * Fix gift card list width * Fix bulk delete dialog * Allow balance to be sorted only when currency is filtered * Sorting by balance after removing currency filter defualts to usedBy * Fix trash icon * Add filter dependency * Fix single deletion with bulk * Update tests * Refactor Links used in Gift Cards * Fix export dialog (#1791) Co-authored-by: Magdalena Markusik <magdalena@markusik.com>
2022-01-25 12:44:19 +00:00
import { cardMenuMessages as messages } from "./messages";
2019-06-19 14:40:52 +00:00
Gift cards post mvp (#1632) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add error message to invalid expiryDate (#1518) * Add error message to invalid expiryDate * Add default messages * Replace filter with some * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Gift card customer page (#1520) * Add gift cards card to customer page (#1456) * WIP * WIP * Extract activate/deactivate logic to a hook * add optional side action * Add query for customer's gift cards * Add component for giftcard status chip * Graphql run types * Add gift card card to customer page * Fix status chip header * Revert style change * Unify status chip logic * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Add queries to refetch prop * Simplify gift card list component * Fix order status chip * Extract messages to separate file * Remove unused lines of code * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Change variable name * Fix formatted message * Check if giftcards exist before rendering collection * Add loading button to CardMenu component (#1476) * WIP * WIP * Add gift card card to customer page * Fix status chip header * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Remove unused lines of code * Revert style change * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Add loading animation to card menu buttons * Added default messages * Change conditional prop checking to filtering * Issue gift card in customer page (#1468) * WIP * WIP * Replace typed query with make query * Add customer details context to customer page * Add context to customer gift cards * Disable customer select when initial customer is present * Pass initial customer to create gift card form * Fixes after cherry-pick * Code cleanup * Remove getInitialData function * Remove unused package * Remove new line * Post-rebase fixes * Code cleanup & extract messages * Remove unused code * Create customer details hook * Minor fixes * Update default messages * Update gift card types * Type fixes * Change directory of useCustomerDetails hook * CR Fixes * Update tests * Make PageTitleWithStatusChip use ExtendedPageHeader * Update tests * Update hook name * Post-rebase fixes * Eslint fix * Fix scrollbar appearing in menu issue (#1539) * Change displayCode to last4CodeChars (#1573) * Add filtered redirect to gift card page from customer details (#1556) * Limit number of channel list items (#1607) * Add max height to single select field menu items container * Add storybook case * Update stories tests * Fix gift card product changing to preorder on save issue (#1583) * Variant preorder fix * Global threshold input should be optional * update snapshot * Add displaying logic gift cards list toolbar (#1617) * add displaying logic for gift card toolbar * Logic fix * Handle bulk export after creation (#1544) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Handle export after bulk gift card creation * Add default messages * Create an util function to get correct input for export * Update component's name * Change modal's title * Update messages Co-authored-by: Magdalena Markusik <magdalena@markusik.com> * Gift Card List item number change doesn't refetch fix (#1643) * Fix number of rows change not refetching list * Add pagination reset * Update descriptions for gift card messages to be more descriptive (#1648) * Gift card history timeline (#1597) * Update queries and mutations * Allow title to be a react node * Show user name if it exists in data object * Update types * Refresh queries on note add * Add gift card history * type fix * Update messages * Fix timeline note * Add event fragment to form update result * Update types * Fix typo * Update messages * Disable input if gift card is expired * Remove unused imports * CR Fixes * Change messages location * Change message to include user in order * Allow adding notes to expired gift cards * Fix disabled input showing dropdown issue (#1636) * On click is disabled when component is disabled * update tests * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Gift card filter in product list view (#1621) * Add GiftCard or Normal filter in Product List View * Fix tests * Fix type check * Don't filter if query param is not in enum * Update messages * Update tests * Code cleanup * Add default messages * Pass intl rather than initialise it in util * Post-rebase fixes * Change product type details messages (#1642) * Update product type gift card options messages * update tests * Add sorting to gift card list (#1569) * Update queries and types for sorting * Add optional handleError method to makeQuery * Add sorting to gift card list * Sorting hook uses useGiftCardList hook * Convert to boolean * Add default sorting field * format fix * Add expiry error handling for issuing gift cards (#1634) * Add expiry error handling for issuing gift cards * Add expiry error message to gift card bulk issue * Update Gift Card tag queries to utilise multiple tags (#1685) * Change displayCode to last4CodeChars (#1573) * Update types * WIP * Update gift card forms to utilise multiple tags * Code cleanup * Update gift card event types * Fixes * Change column with no click handler behaviour * Remove an ability to sort by tags * Remove unused code * Update tests * Update timeline events * Update messages * change array reduce to join * Add Y scroll to dialog content * Bulk create Y scroll fix * Endless loading fix (#1732) * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Wip * Extract dialog component outside of gift card create * Update component's name * Extract dialog component outside of export component to provider * Update tests * Various gift card bugs fixes (#1749) * Change currency to options field * Fix hover and font size * Fix gift card list width * Fix bulk delete dialog * Allow balance to be sorted only when currency is filtered * Sorting by balance after removing currency filter defualts to usedBy * Fix trash icon * Add filter dependency * Fix single deletion with bulk * Update tests * Refactor Links used in Gift Cards * Fix export dialog (#1791) Co-authored-by: Magdalena Markusik <magdalena@markusik.com>
2022-01-25 12:44:19 +00:00
const ITEM_HEIGHT = 48;
2019-06-19 14:40:52 +00:00
export interface CardMenuItem {
disabled?: boolean;
2019-06-19 14:40:52 +00:00
label: string;
testId?: string;
2019-06-19 14:40:52 +00:00
onSelect: () => void;
Gift cards post mvp (#1632) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add error message to invalid expiryDate (#1518) * Add error message to invalid expiryDate * Add default messages * Replace filter with some * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Gift card customer page (#1520) * Add gift cards card to customer page (#1456) * WIP * WIP * Extract activate/deactivate logic to a hook * add optional side action * Add query for customer's gift cards * Add component for giftcard status chip * Graphql run types * Add gift card card to customer page * Fix status chip header * Revert style change * Unify status chip logic * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Add queries to refetch prop * Simplify gift card list component * Fix order status chip * Extract messages to separate file * Remove unused lines of code * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Change variable name * Fix formatted message * Check if giftcards exist before rendering collection * Add loading button to CardMenu component (#1476) * WIP * WIP * Add gift card card to customer page * Fix status chip header * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Remove unused lines of code * Revert style change * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Add loading animation to card menu buttons * Added default messages * Change conditional prop checking to filtering * Issue gift card in customer page (#1468) * WIP * WIP * Replace typed query with make query * Add customer details context to customer page * Add context to customer gift cards * Disable customer select when initial customer is present * Pass initial customer to create gift card form * Fixes after cherry-pick * Code cleanup * Remove getInitialData function * Remove unused package * Remove new line * Post-rebase fixes * Code cleanup & extract messages * Remove unused code * Create customer details hook * Minor fixes * Update default messages * Update gift card types * Type fixes * Change directory of useCustomerDetails hook * CR Fixes * Update tests * Make PageTitleWithStatusChip use ExtendedPageHeader * Update tests * Update hook name * Post-rebase fixes * Eslint fix * Fix scrollbar appearing in menu issue (#1539) * Change displayCode to last4CodeChars (#1573) * Add filtered redirect to gift card page from customer details (#1556) * Limit number of channel list items (#1607) * Add max height to single select field menu items container * Add storybook case * Update stories tests * Fix gift card product changing to preorder on save issue (#1583) * Variant preorder fix * Global threshold input should be optional * update snapshot * Add displaying logic gift cards list toolbar (#1617) * add displaying logic for gift card toolbar * Logic fix * Handle bulk export after creation (#1544) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Handle export after bulk gift card creation * Add default messages * Create an util function to get correct input for export * Update component's name * Change modal's title * Update messages Co-authored-by: Magdalena Markusik <magdalena@markusik.com> * Gift Card List item number change doesn't refetch fix (#1643) * Fix number of rows change not refetching list * Add pagination reset * Update descriptions for gift card messages to be more descriptive (#1648) * Gift card history timeline (#1597) * Update queries and mutations * Allow title to be a react node * Show user name if it exists in data object * Update types * Refresh queries on note add * Add gift card history * type fix * Update messages * Fix timeline note * Add event fragment to form update result * Update types * Fix typo * Update messages * Disable input if gift card is expired * Remove unused imports * CR Fixes * Change messages location * Change message to include user in order * Allow adding notes to expired gift cards * Fix disabled input showing dropdown issue (#1636) * On click is disabled when component is disabled * update tests * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Gift card filter in product list view (#1621) * Add GiftCard or Normal filter in Product List View * Fix tests * Fix type check * Don't filter if query param is not in enum * Update messages * Update tests * Code cleanup * Add default messages * Pass intl rather than initialise it in util * Post-rebase fixes * Change product type details messages (#1642) * Update product type gift card options messages * update tests * Add sorting to gift card list (#1569) * Update queries and types for sorting * Add optional handleError method to makeQuery * Add sorting to gift card list * Sorting hook uses useGiftCardList hook * Convert to boolean * Add default sorting field * format fix * Add expiry error handling for issuing gift cards (#1634) * Add expiry error handling for issuing gift cards * Add expiry error message to gift card bulk issue * Update Gift Card tag queries to utilise multiple tags (#1685) * Change displayCode to last4CodeChars (#1573) * Update types * WIP * Update gift card forms to utilise multiple tags * Code cleanup * Update gift card event types * Fixes * Change column with no click handler behaviour * Remove an ability to sort by tags * Remove unused code * Update tests * Update timeline events * Update messages * change array reduce to join * Add Y scroll to dialog content * Bulk create Y scroll fix * Endless loading fix (#1732) * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Wip * Extract dialog component outside of gift card create * Update component's name * Extract dialog component outside of export component to provider * Update tests * Various gift card bugs fixes (#1749) * Change currency to options field * Fix hover and font size * Fix gift card list width * Fix bulk delete dialog * Allow balance to be sorted only when currency is filtered * Sorting by balance after removing currency filter defualts to usedBy * Fix trash icon * Add filter dependency * Fix single deletion with bulk * Update tests * Refactor Links used in Gift Cards * Fix export dialog (#1791) Co-authored-by: Magdalena Markusik <magdalena@markusik.com>
2022-01-25 12:44:19 +00:00
loading?: boolean;
withLoading?: boolean;
hasError?: boolean;
2019-06-19 14:40:52 +00:00
}
export interface CardMenuProps {
className?: string;
disabled?: boolean;
menuItems: CardMenuItem[];
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
outlined?: boolean;
2019-06-19 14:40:52 +00:00
}
2019-12-03 15:28:40 +00:00
const useStyles = makeStyles(
theme => ({
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
container: {
zIndex: 1
},
2019-12-03 15:28:40 +00:00
iconButton: {
background: theme.palette.background.paper,
borderRadius: "100%",
height: 32,
padding: 0,
width: 32
},
paper: {
marginTop: theme.spacing(2),
maxHeight: ITEM_HEIGHT * 4.5,
overflowY: "scroll"
Gift cards post mvp (#1632) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add error message to invalid expiryDate (#1518) * Add error message to invalid expiryDate * Add default messages * Replace filter with some * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Gift card customer page (#1520) * Add gift cards card to customer page (#1456) * WIP * WIP * Extract activate/deactivate logic to a hook * add optional side action * Add query for customer's gift cards * Add component for giftcard status chip * Graphql run types * Add gift card card to customer page * Fix status chip header * Revert style change * Unify status chip logic * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Add queries to refetch prop * Simplify gift card list component * Fix order status chip * Extract messages to separate file * Remove unused lines of code * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Change variable name * Fix formatted message * Check if giftcards exist before rendering collection * Add loading button to CardMenu component (#1476) * WIP * WIP * Add gift card card to customer page * Fix status chip header * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Remove unused lines of code * Revert style change * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Add loading animation to card menu buttons * Added default messages * Change conditional prop checking to filtering * Issue gift card in customer page (#1468) * WIP * WIP * Replace typed query with make query * Add customer details context to customer page * Add context to customer gift cards * Disable customer select when initial customer is present * Pass initial customer to create gift card form * Fixes after cherry-pick * Code cleanup * Remove getInitialData function * Remove unused package * Remove new line * Post-rebase fixes * Code cleanup & extract messages * Remove unused code * Create customer details hook * Minor fixes * Update default messages * Update gift card types * Type fixes * Change directory of useCustomerDetails hook * CR Fixes * Update tests * Make PageTitleWithStatusChip use ExtendedPageHeader * Update tests * Update hook name * Post-rebase fixes * Eslint fix * Fix scrollbar appearing in menu issue (#1539) * Change displayCode to last4CodeChars (#1573) * Add filtered redirect to gift card page from customer details (#1556) * Limit number of channel list items (#1607) * Add max height to single select field menu items container * Add storybook case * Update stories tests * Fix gift card product changing to preorder on save issue (#1583) * Variant preorder fix * Global threshold input should be optional * update snapshot * Add displaying logic gift cards list toolbar (#1617) * add displaying logic for gift card toolbar * Logic fix * Handle bulk export after creation (#1544) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Handle export after bulk gift card creation * Add default messages * Create an util function to get correct input for export * Update component's name * Change modal's title * Update messages Co-authored-by: Magdalena Markusik <magdalena@markusik.com> * Gift Card List item number change doesn't refetch fix (#1643) * Fix number of rows change not refetching list * Add pagination reset * Update descriptions for gift card messages to be more descriptive (#1648) * Gift card history timeline (#1597) * Update queries and mutations * Allow title to be a react node * Show user name if it exists in data object * Update types * Refresh queries on note add * Add gift card history * type fix * Update messages * Fix timeline note * Add event fragment to form update result * Update types * Fix typo * Update messages * Disable input if gift card is expired * Remove unused imports * CR Fixes * Change messages location * Change message to include user in order * Allow adding notes to expired gift cards * Fix disabled input showing dropdown issue (#1636) * On click is disabled when component is disabled * update tests * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Gift card filter in product list view (#1621) * Add GiftCard or Normal filter in Product List View * Fix tests * Fix type check * Don't filter if query param is not in enum * Update messages * Update tests * Code cleanup * Add default messages * Pass intl rather than initialise it in util * Post-rebase fixes * Change product type details messages (#1642) * Update product type gift card options messages * update tests * Add sorting to gift card list (#1569) * Update queries and types for sorting * Add optional handleError method to makeQuery * Add sorting to gift card list * Sorting hook uses useGiftCardList hook * Convert to boolean * Add default sorting field * format fix * Add expiry error handling for issuing gift cards (#1634) * Add expiry error handling for issuing gift cards * Add expiry error message to gift card bulk issue * Update Gift Card tag queries to utilise multiple tags (#1685) * Change displayCode to last4CodeChars (#1573) * Update types * WIP * Update gift card forms to utilise multiple tags * Code cleanup * Update gift card event types * Fixes * Change column with no click handler behaviour * Remove an ability to sort by tags * Remove unused code * Update tests * Update timeline events * Update messages * change array reduce to join * Add Y scroll to dialog content * Bulk create Y scroll fix * Endless loading fix (#1732) * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Wip * Extract dialog component outside of gift card create * Update component's name * Extract dialog component outside of export component to provider * Update tests * Various gift card bugs fixes (#1749) * Change currency to options field * Fix hover and font size * Fix gift card list width * Fix bulk delete dialog * Allow balance to be sorted only when currency is filtered * Sorting by balance after removing currency filter defualts to usedBy * Fix trash icon * Add filter dependency * Fix single deletion with bulk * Update tests * Refactor Links used in Gift Cards * Fix export dialog (#1791) Co-authored-by: Magdalena Markusik <magdalena@markusik.com>
2022-01-25 12:44:19 +00:00
},
loadingContent: {
width: "100%",
display: "grid",
gridTemplateColumns: "1fr 24px",
gap: theme.spacing(2),
alignItems: "center",
justifyContent: "flex-end"
2019-12-03 15:28:40 +00:00
}
}),
{ name: "CardMenu" }
);
2019-06-19 14:40:52 +00:00
2019-10-30 14:34:24 +00:00
const CardMenu: React.FC<CardMenuProps> = props => {
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
const { className, disabled, menuItems, outlined, ...rest } = props;
2019-10-30 14:34:24 +00:00
const classes = useStyles(props);
2019-06-19 14:40:52 +00:00
Gift cards post mvp (#1632) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add error message to invalid expiryDate (#1518) * Add error message to invalid expiryDate * Add default messages * Replace filter with some * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Gift card customer page (#1520) * Add gift cards card to customer page (#1456) * WIP * WIP * Extract activate/deactivate logic to a hook * add optional side action * Add query for customer's gift cards * Add component for giftcard status chip * Graphql run types * Add gift card card to customer page * Fix status chip header * Revert style change * Unify status chip logic * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Add queries to refetch prop * Simplify gift card list component * Fix order status chip * Extract messages to separate file * Remove unused lines of code * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Change variable name * Fix formatted message * Check if giftcards exist before rendering collection * Add loading button to CardMenu component (#1476) * WIP * WIP * Add gift card card to customer page * Fix status chip header * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Remove unused lines of code * Revert style change * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Add loading animation to card menu buttons * Added default messages * Change conditional prop checking to filtering * Issue gift card in customer page (#1468) * WIP * WIP * Replace typed query with make query * Add customer details context to customer page * Add context to customer gift cards * Disable customer select when initial customer is present * Pass initial customer to create gift card form * Fixes after cherry-pick * Code cleanup * Remove getInitialData function * Remove unused package * Remove new line * Post-rebase fixes * Code cleanup & extract messages * Remove unused code * Create customer details hook * Minor fixes * Update default messages * Update gift card types * Type fixes * Change directory of useCustomerDetails hook * CR Fixes * Update tests * Make PageTitleWithStatusChip use ExtendedPageHeader * Update tests * Update hook name * Post-rebase fixes * Eslint fix * Fix scrollbar appearing in menu issue (#1539) * Change displayCode to last4CodeChars (#1573) * Add filtered redirect to gift card page from customer details (#1556) * Limit number of channel list items (#1607) * Add max height to single select field menu items container * Add storybook case * Update stories tests * Fix gift card product changing to preorder on save issue (#1583) * Variant preorder fix * Global threshold input should be optional * update snapshot * Add displaying logic gift cards list toolbar (#1617) * add displaying logic for gift card toolbar * Logic fix * Handle bulk export after creation (#1544) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Handle export after bulk gift card creation * Add default messages * Create an util function to get correct input for export * Update component's name * Change modal's title * Update messages Co-authored-by: Magdalena Markusik <magdalena@markusik.com> * Gift Card List item number change doesn't refetch fix (#1643) * Fix number of rows change not refetching list * Add pagination reset * Update descriptions for gift card messages to be more descriptive (#1648) * Gift card history timeline (#1597) * Update queries and mutations * Allow title to be a react node * Show user name if it exists in data object * Update types * Refresh queries on note add * Add gift card history * type fix * Update messages * Fix timeline note * Add event fragment to form update result * Update types * Fix typo * Update messages * Disable input if gift card is expired * Remove unused imports * CR Fixes * Change messages location * Change message to include user in order * Allow adding notes to expired gift cards * Fix disabled input showing dropdown issue (#1636) * On click is disabled when component is disabled * update tests * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Gift card filter in product list view (#1621) * Add GiftCard or Normal filter in Product List View * Fix tests * Fix type check * Don't filter if query param is not in enum * Update messages * Update tests * Code cleanup * Add default messages * Pass intl rather than initialise it in util * Post-rebase fixes * Change product type details messages (#1642) * Update product type gift card options messages * update tests * Add sorting to gift card list (#1569) * Update queries and types for sorting * Add optional handleError method to makeQuery * Add sorting to gift card list * Sorting hook uses useGiftCardList hook * Convert to boolean * Add default sorting field * format fix * Add expiry error handling for issuing gift cards (#1634) * Add expiry error handling for issuing gift cards * Add expiry error message to gift card bulk issue * Update Gift Card tag queries to utilise multiple tags (#1685) * Change displayCode to last4CodeChars (#1573) * Update types * WIP * Update gift card forms to utilise multiple tags * Code cleanup * Update gift card event types * Fixes * Change column with no click handler behaviour * Remove an ability to sort by tags * Remove unused code * Update tests * Update timeline events * Update messages * change array reduce to join * Add Y scroll to dialog content * Bulk create Y scroll fix * Endless loading fix (#1732) * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Wip * Extract dialog component outside of gift card create * Update component's name * Extract dialog component outside of export component to provider * Update tests * Various gift card bugs fixes (#1749) * Change currency to options field * Fix hover and font size * Fix gift card list width * Fix bulk delete dialog * Allow balance to be sorted only when currency is filtered * Sorting by balance after removing currency filter defualts to usedBy * Fix trash icon * Add filter dependency * Fix single deletion with bulk * Update tests * Refactor Links used in Gift Cards * Fix export dialog (#1791) Co-authored-by: Magdalena Markusik <magdalena@markusik.com>
2022-01-25 12:44:19 +00:00
const anchorRef = useRef<HTMLButtonElement | null>(null);
const [open, setOpen] = useState(false);
2019-06-19 14:40:52 +00:00
const handleToggle = () => setOpen(prevOpen => !prevOpen);
const handleClose = (event: React.MouseEvent<EventTarget>) => {
if (
anchorRef.current &&
anchorRef.current.contains(event.target as HTMLElement)
) {
return;
}
2019-06-19 14:40:52 +00:00
setOpen(false);
2019-10-30 14:34:24 +00:00
};
2019-06-19 14:40:52 +00:00
const handleListKeyDown = (event: React.KeyboardEvent) => {
if (event.key === "Tab") {
event.preventDefault();
setOpen(false);
}
2019-10-30 14:34:24 +00:00
};
2019-06-19 14:40:52 +00:00
Gift cards post mvp (#1632) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add error message to invalid expiryDate (#1518) * Add error message to invalid expiryDate * Add default messages * Replace filter with some * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Gift card customer page (#1520) * Add gift cards card to customer page (#1456) * WIP * WIP * Extract activate/deactivate logic to a hook * add optional side action * Add query for customer's gift cards * Add component for giftcard status chip * Graphql run types * Add gift card card to customer page * Fix status chip header * Revert style change * Unify status chip logic * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Add queries to refetch prop * Simplify gift card list component * Fix order status chip * Extract messages to separate file * Remove unused lines of code * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Change variable name * Fix formatted message * Check if giftcards exist before rendering collection * Add loading button to CardMenu component (#1476) * WIP * WIP * Add gift card card to customer page * Fix status chip header * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Remove unused lines of code * Revert style change * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Add loading animation to card menu buttons * Added default messages * Change conditional prop checking to filtering * Issue gift card in customer page (#1468) * WIP * WIP * Replace typed query with make query * Add customer details context to customer page * Add context to customer gift cards * Disable customer select when initial customer is present * Pass initial customer to create gift card form * Fixes after cherry-pick * Code cleanup * Remove getInitialData function * Remove unused package * Remove new line * Post-rebase fixes * Code cleanup & extract messages * Remove unused code * Create customer details hook * Minor fixes * Update default messages * Update gift card types * Type fixes * Change directory of useCustomerDetails hook * CR Fixes * Update tests * Make PageTitleWithStatusChip use ExtendedPageHeader * Update tests * Update hook name * Post-rebase fixes * Eslint fix * Fix scrollbar appearing in menu issue (#1539) * Change displayCode to last4CodeChars (#1573) * Add filtered redirect to gift card page from customer details (#1556) * Limit number of channel list items (#1607) * Add max height to single select field menu items container * Add storybook case * Update stories tests * Fix gift card product changing to preorder on save issue (#1583) * Variant preorder fix * Global threshold input should be optional * update snapshot * Add displaying logic gift cards list toolbar (#1617) * add displaying logic for gift card toolbar * Logic fix * Handle bulk export after creation (#1544) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Handle export after bulk gift card creation * Add default messages * Create an util function to get correct input for export * Update component's name * Change modal's title * Update messages Co-authored-by: Magdalena Markusik <magdalena@markusik.com> * Gift Card List item number change doesn't refetch fix (#1643) * Fix number of rows change not refetching list * Add pagination reset * Update descriptions for gift card messages to be more descriptive (#1648) * Gift card history timeline (#1597) * Update queries and mutations * Allow title to be a react node * Show user name if it exists in data object * Update types * Refresh queries on note add * Add gift card history * type fix * Update messages * Fix timeline note * Add event fragment to form update result * Update types * Fix typo * Update messages * Disable input if gift card is expired * Remove unused imports * CR Fixes * Change messages location * Change message to include user in order * Allow adding notes to expired gift cards * Fix disabled input showing dropdown issue (#1636) * On click is disabled when component is disabled * update tests * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Gift card filter in product list view (#1621) * Add GiftCard or Normal filter in Product List View * Fix tests * Fix type check * Don't filter if query param is not in enum * Update messages * Update tests * Code cleanup * Add default messages * Pass intl rather than initialise it in util * Post-rebase fixes * Change product type details messages (#1642) * Update product type gift card options messages * update tests * Add sorting to gift card list (#1569) * Update queries and types for sorting * Add optional handleError method to makeQuery * Add sorting to gift card list * Sorting hook uses useGiftCardList hook * Convert to boolean * Add default sorting field * format fix * Add expiry error handling for issuing gift cards (#1634) * Add expiry error handling for issuing gift cards * Add expiry error message to gift card bulk issue * Update Gift Card tag queries to utilise multiple tags (#1685) * Change displayCode to last4CodeChars (#1573) * Update types * WIP * Update gift card forms to utilise multiple tags * Code cleanup * Update gift card event types * Fixes * Change column with no click handler behaviour * Remove an ability to sort by tags * Remove unused code * Update tests * Update timeline events * Update messages * change array reduce to join * Add Y scroll to dialog content * Bulk create Y scroll fix * Endless loading fix (#1732) * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Wip * Extract dialog component outside of gift card create * Update component's name * Extract dialog component outside of export component to provider * Update tests * Various gift card bugs fixes (#1749) * Change currency to options field * Fix hover and font size * Fix gift card list width * Fix bulk delete dialog * Allow balance to be sorted only when currency is filtered * Sorting by balance after removing currency filter defualts to usedBy * Fix trash icon * Add filter dependency * Fix single deletion with bulk * Update tests * Refactor Links used in Gift Cards * Fix export dialog (#1791) Co-authored-by: Magdalena Markusik <magdalena@markusik.com>
2022-01-25 12:44:19 +00:00
const prevOpen = useRef(open);
useEffect(() => {
if (prevOpen.current === true && open === false) {
anchorRef.current!.focus();
}
prevOpen.current = open;
}, [open]);
Gift cards post mvp (#1632) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add error message to invalid expiryDate (#1518) * Add error message to invalid expiryDate * Add default messages * Replace filter with some * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Gift card customer page (#1520) * Add gift cards card to customer page (#1456) * WIP * WIP * Extract activate/deactivate logic to a hook * add optional side action * Add query for customer's gift cards * Add component for giftcard status chip * Graphql run types * Add gift card card to customer page * Fix status chip header * Revert style change * Unify status chip logic * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Add queries to refetch prop * Simplify gift card list component * Fix order status chip * Extract messages to separate file * Remove unused lines of code * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Change variable name * Fix formatted message * Check if giftcards exist before rendering collection * Add loading button to CardMenu component (#1476) * WIP * WIP * Add gift card card to customer page * Fix status chip header * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Remove unused lines of code * Revert style change * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Add loading animation to card menu buttons * Added default messages * Change conditional prop checking to filtering * Issue gift card in customer page (#1468) * WIP * WIP * Replace typed query with make query * Add customer details context to customer page * Add context to customer gift cards * Disable customer select when initial customer is present * Pass initial customer to create gift card form * Fixes after cherry-pick * Code cleanup * Remove getInitialData function * Remove unused package * Remove new line * Post-rebase fixes * Code cleanup & extract messages * Remove unused code * Create customer details hook * Minor fixes * Update default messages * Update gift card types * Type fixes * Change directory of useCustomerDetails hook * CR Fixes * Update tests * Make PageTitleWithStatusChip use ExtendedPageHeader * Update tests * Update hook name * Post-rebase fixes * Eslint fix * Fix scrollbar appearing in menu issue (#1539) * Change displayCode to last4CodeChars (#1573) * Add filtered redirect to gift card page from customer details (#1556) * Limit number of channel list items (#1607) * Add max height to single select field menu items container * Add storybook case * Update stories tests * Fix gift card product changing to preorder on save issue (#1583) * Variant preorder fix * Global threshold input should be optional * update snapshot * Add displaying logic gift cards list toolbar (#1617) * add displaying logic for gift card toolbar * Logic fix * Handle bulk export after creation (#1544) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Handle export after bulk gift card creation * Add default messages * Create an util function to get correct input for export * Update component's name * Change modal's title * Update messages Co-authored-by: Magdalena Markusik <magdalena@markusik.com> * Gift Card List item number change doesn't refetch fix (#1643) * Fix number of rows change not refetching list * Add pagination reset * Update descriptions for gift card messages to be more descriptive (#1648) * Gift card history timeline (#1597) * Update queries and mutations * Allow title to be a react node * Show user name if it exists in data object * Update types * Refresh queries on note add * Add gift card history * type fix * Update messages * Fix timeline note * Add event fragment to form update result * Update types * Fix typo * Update messages * Disable input if gift card is expired * Remove unused imports * CR Fixes * Change messages location * Change message to include user in order * Allow adding notes to expired gift cards * Fix disabled input showing dropdown issue (#1636) * On click is disabled when component is disabled * update tests * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Gift card filter in product list view (#1621) * Add GiftCard or Normal filter in Product List View * Fix tests * Fix type check * Don't filter if query param is not in enum * Update messages * Update tests * Code cleanup * Add default messages * Pass intl rather than initialise it in util * Post-rebase fixes * Change product type details messages (#1642) * Update product type gift card options messages * update tests * Add sorting to gift card list (#1569) * Update queries and types for sorting * Add optional handleError method to makeQuery * Add sorting to gift card list * Sorting hook uses useGiftCardList hook * Convert to boolean * Add default sorting field * format fix * Add expiry error handling for issuing gift cards (#1634) * Add expiry error handling for issuing gift cards * Add expiry error message to gift card bulk issue * Update Gift Card tag queries to utilise multiple tags (#1685) * Change displayCode to last4CodeChars (#1573) * Update types * WIP * Update gift card forms to utilise multiple tags * Code cleanup * Update gift card event types * Fixes * Change column with no click handler behaviour * Remove an ability to sort by tags * Remove unused code * Update tests * Update timeline events * Update messages * change array reduce to join * Add Y scroll to dialog content * Bulk create Y scroll fix * Endless loading fix (#1732) * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Wip * Extract dialog component outside of gift card create * Update component's name * Extract dialog component outside of export component to provider * Update tests * Various gift card bugs fixes (#1749) * Change currency to options field * Fix hover and font size * Fix gift card list width * Fix bulk delete dialog * Allow balance to be sorted only when currency is filtered * Sorting by balance after removing currency filter defualts to usedBy * Fix trash icon * Add filter dependency * Fix single deletion with bulk * Update tests * Refactor Links used in Gift Cards * Fix export dialog (#1791) Co-authored-by: Magdalena Markusik <magdalena@markusik.com>
2022-01-25 12:44:19 +00:00
useEffect(() => {
const hasAnyItemsLoadingOrWithError = menuItems
?.filter(({ withLoading }) => withLoading)
?.some(({ loading, hasError }) => loading || hasError);
if (!hasAnyItemsLoadingOrWithError) {
setOpen(false);
}
}, [menuItems]);
const handleMenuClick = (index: number) => {
Gift cards post mvp (#1632) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add error message to invalid expiryDate (#1518) * Add error message to invalid expiryDate * Add default messages * Replace filter with some * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Gift card customer page (#1520) * Add gift cards card to customer page (#1456) * WIP * WIP * Extract activate/deactivate logic to a hook * add optional side action * Add query for customer's gift cards * Add component for giftcard status chip * Graphql run types * Add gift card card to customer page * Fix status chip header * Revert style change * Unify status chip logic * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Add queries to refetch prop * Simplify gift card list component * Fix order status chip * Extract messages to separate file * Remove unused lines of code * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Change variable name * Fix formatted message * Check if giftcards exist before rendering collection * Add loading button to CardMenu component (#1476) * WIP * WIP * Add gift card card to customer page * Fix status chip header * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Remove unused lines of code * Revert style change * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Add loading animation to card menu buttons * Added default messages * Change conditional prop checking to filtering * Issue gift card in customer page (#1468) * WIP * WIP * Replace typed query with make query * Add customer details context to customer page * Add context to customer gift cards * Disable customer select when initial customer is present * Pass initial customer to create gift card form * Fixes after cherry-pick * Code cleanup * Remove getInitialData function * Remove unused package * Remove new line * Post-rebase fixes * Code cleanup & extract messages * Remove unused code * Create customer details hook * Minor fixes * Update default messages * Update gift card types * Type fixes * Change directory of useCustomerDetails hook * CR Fixes * Update tests * Make PageTitleWithStatusChip use ExtendedPageHeader * Update tests * Update hook name * Post-rebase fixes * Eslint fix * Fix scrollbar appearing in menu issue (#1539) * Change displayCode to last4CodeChars (#1573) * Add filtered redirect to gift card page from customer details (#1556) * Limit number of channel list items (#1607) * Add max height to single select field menu items container * Add storybook case * Update stories tests * Fix gift card product changing to preorder on save issue (#1583) * Variant preorder fix * Global threshold input should be optional * update snapshot * Add displaying logic gift cards list toolbar (#1617) * add displaying logic for gift card toolbar * Logic fix * Handle bulk export after creation (#1544) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Handle export after bulk gift card creation * Add default messages * Create an util function to get correct input for export * Update component's name * Change modal's title * Update messages Co-authored-by: Magdalena Markusik <magdalena@markusik.com> * Gift Card List item number change doesn't refetch fix (#1643) * Fix number of rows change not refetching list * Add pagination reset * Update descriptions for gift card messages to be more descriptive (#1648) * Gift card history timeline (#1597) * Update queries and mutations * Allow title to be a react node * Show user name if it exists in data object * Update types * Refresh queries on note add * Add gift card history * type fix * Update messages * Fix timeline note * Add event fragment to form update result * Update types * Fix typo * Update messages * Disable input if gift card is expired * Remove unused imports * CR Fixes * Change messages location * Change message to include user in order * Allow adding notes to expired gift cards * Fix disabled input showing dropdown issue (#1636) * On click is disabled when component is disabled * update tests * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Gift card filter in product list view (#1621) * Add GiftCard or Normal filter in Product List View * Fix tests * Fix type check * Don't filter if query param is not in enum * Update messages * Update tests * Code cleanup * Add default messages * Pass intl rather than initialise it in util * Post-rebase fixes * Change product type details messages (#1642) * Update product type gift card options messages * update tests * Add sorting to gift card list (#1569) * Update queries and types for sorting * Add optional handleError method to makeQuery * Add sorting to gift card list * Sorting hook uses useGiftCardList hook * Convert to boolean * Add default sorting field * format fix * Add expiry error handling for issuing gift cards (#1634) * Add expiry error handling for issuing gift cards * Add expiry error message to gift card bulk issue * Update Gift Card tag queries to utilise multiple tags (#1685) * Change displayCode to last4CodeChars (#1573) * Update types * WIP * Update gift card forms to utilise multiple tags * Code cleanup * Update gift card event types * Fixes * Change column with no click handler behaviour * Remove an ability to sort by tags * Remove unused code * Update tests * Update timeline events * Update messages * change array reduce to join * Add Y scroll to dialog content * Bulk create Y scroll fix * Endless loading fix (#1732) * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Wip * Extract dialog component outside of gift card create * Update component's name * Extract dialog component outside of export component to provider * Update tests * Various gift card bugs fixes (#1749) * Change currency to options field * Fix hover and font size * Fix gift card list width * Fix bulk delete dialog * Allow balance to be sorted only when currency is filtered * Sorting by balance after removing currency filter defualts to usedBy * Fix trash icon * Add filter dependency * Fix single deletion with bulk * Update tests * Refactor Links used in Gift Cards * Fix export dialog (#1791) Co-authored-by: Magdalena Markusik <magdalena@markusik.com>
2022-01-25 12:44:19 +00:00
const selectedItem = menuItems[index];
selectedItem.onSelect();
if (!selectedItem.withLoading) {
setOpen(false);
}
};
2019-10-30 14:34:24 +00:00
Gift cards post mvp (#1632) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add error message to invalid expiryDate (#1518) * Add error message to invalid expiryDate * Add default messages * Replace filter with some * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Gift card customer page (#1520) * Add gift cards card to customer page (#1456) * WIP * WIP * Extract activate/deactivate logic to a hook * add optional side action * Add query for customer's gift cards * Add component for giftcard status chip * Graphql run types * Add gift card card to customer page * Fix status chip header * Revert style change * Unify status chip logic * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Add queries to refetch prop * Simplify gift card list component * Fix order status chip * Extract messages to separate file * Remove unused lines of code * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Change variable name * Fix formatted message * Check if giftcards exist before rendering collection * Add loading button to CardMenu component (#1476) * WIP * WIP * Add gift card card to customer page * Fix status chip header * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Remove unused lines of code * Revert style change * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Add loading animation to card menu buttons * Added default messages * Change conditional prop checking to filtering * Issue gift card in customer page (#1468) * WIP * WIP * Replace typed query with make query * Add customer details context to customer page * Add context to customer gift cards * Disable customer select when initial customer is present * Pass initial customer to create gift card form * Fixes after cherry-pick * Code cleanup * Remove getInitialData function * Remove unused package * Remove new line * Post-rebase fixes * Code cleanup & extract messages * Remove unused code * Create customer details hook * Minor fixes * Update default messages * Update gift card types * Type fixes * Change directory of useCustomerDetails hook * CR Fixes * Update tests * Make PageTitleWithStatusChip use ExtendedPageHeader * Update tests * Update hook name * Post-rebase fixes * Eslint fix * Fix scrollbar appearing in menu issue (#1539) * Change displayCode to last4CodeChars (#1573) * Add filtered redirect to gift card page from customer details (#1556) * Limit number of channel list items (#1607) * Add max height to single select field menu items container * Add storybook case * Update stories tests * Fix gift card product changing to preorder on save issue (#1583) * Variant preorder fix * Global threshold input should be optional * update snapshot * Add displaying logic gift cards list toolbar (#1617) * add displaying logic for gift card toolbar * Logic fix * Handle bulk export after creation (#1544) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Handle export after bulk gift card creation * Add default messages * Create an util function to get correct input for export * Update component's name * Change modal's title * Update messages Co-authored-by: Magdalena Markusik <magdalena@markusik.com> * Gift Card List item number change doesn't refetch fix (#1643) * Fix number of rows change not refetching list * Add pagination reset * Update descriptions for gift card messages to be more descriptive (#1648) * Gift card history timeline (#1597) * Update queries and mutations * Allow title to be a react node * Show user name if it exists in data object * Update types * Refresh queries on note add * Add gift card history * type fix * Update messages * Fix timeline note * Add event fragment to form update result * Update types * Fix typo * Update messages * Disable input if gift card is expired * Remove unused imports * CR Fixes * Change messages location * Change message to include user in order * Allow adding notes to expired gift cards * Fix disabled input showing dropdown issue (#1636) * On click is disabled when component is disabled * update tests * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Gift card filter in product list view (#1621) * Add GiftCard or Normal filter in Product List View * Fix tests * Fix type check * Don't filter if query param is not in enum * Update messages * Update tests * Code cleanup * Add default messages * Pass intl rather than initialise it in util * Post-rebase fixes * Change product type details messages (#1642) * Update product type gift card options messages * update tests * Add sorting to gift card list (#1569) * Update queries and types for sorting * Add optional handleError method to makeQuery * Add sorting to gift card list * Sorting hook uses useGiftCardList hook * Convert to boolean * Add default sorting field * format fix * Add expiry error handling for issuing gift cards (#1634) * Add expiry error handling for issuing gift cards * Add expiry error message to gift card bulk issue * Update Gift Card tag queries to utilise multiple tags (#1685) * Change displayCode to last4CodeChars (#1573) * Update types * WIP * Update gift card forms to utilise multiple tags * Code cleanup * Update gift card event types * Fixes * Change column with no click handler behaviour * Remove an ability to sort by tags * Remove unused code * Update tests * Update timeline events * Update messages * change array reduce to join * Add Y scroll to dialog content * Bulk create Y scroll fix * Endless loading fix (#1732) * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Wip * Extract dialog component outside of gift card create * Update component's name * Extract dialog component outside of export component to provider * Update tests * Various gift card bugs fixes (#1749) * Change currency to options field * Fix hover and font size * Fix gift card list width * Fix bulk delete dialog * Allow balance to be sorted only when currency is filtered * Sorting by balance after removing currency filter defualts to usedBy * Fix trash icon * Add filter dependency * Fix single deletion with bulk * Update tests * Refactor Links used in Gift Cards * Fix export dialog (#1791) Co-authored-by: Magdalena Markusik <magdalena@markusik.com>
2022-01-25 12:44:19 +00:00
const isWithLoading = menuItems.some(({ withLoading }) => withLoading);
2019-10-30 14:34:24 +00:00
return (
<div className={className} {...rest}>
2019-10-30 14:34:24 +00:00
<IconButton
data-test-id="show-more-button"
2019-10-30 14:34:24 +00:00
aria-label="More"
aria-owns={open ? "long-menu" : null}
aria-haspopup="true"
color="primary"
disabled={disabled}
ref={anchorRef}
onClick={handleToggle}
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
variant={outlined ? "primary" : "secondary"}
state={open ? "active" : "default"}
2019-10-30 14:34:24 +00:00
>
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
<MoreIcon />
2019-10-30 14:34:24 +00:00
</IconButton>
<Popper
placement="bottom-end"
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
className={classes.container}
2019-10-30 14:34:24 +00:00
open={open}
anchorEl={anchorRef.current}
transition
2019-10-30 14:34:24 +00:00
>
{({ TransitionProps, placement }) => (
<Grow
{...TransitionProps}
style={{
transformOrigin:
Gift cards post mvp (#1632) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add error message to invalid expiryDate (#1518) * Add error message to invalid expiryDate * Add default messages * Replace filter with some * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Gift card customer page (#1520) * Add gift cards card to customer page (#1456) * WIP * WIP * Extract activate/deactivate logic to a hook * add optional side action * Add query for customer's gift cards * Add component for giftcard status chip * Graphql run types * Add gift card card to customer page * Fix status chip header * Revert style change * Unify status chip logic * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Add queries to refetch prop * Simplify gift card list component * Fix order status chip * Extract messages to separate file * Remove unused lines of code * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Change variable name * Fix formatted message * Check if giftcards exist before rendering collection * Add loading button to CardMenu component (#1476) * WIP * WIP * Add gift card card to customer page * Fix status chip header * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Remove unused lines of code * Revert style change * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Add loading animation to card menu buttons * Added default messages * Change conditional prop checking to filtering * Issue gift card in customer page (#1468) * WIP * WIP * Replace typed query with make query * Add customer details context to customer page * Add context to customer gift cards * Disable customer select when initial customer is present * Pass initial customer to create gift card form * Fixes after cherry-pick * Code cleanup * Remove getInitialData function * Remove unused package * Remove new line * Post-rebase fixes * Code cleanup & extract messages * Remove unused code * Create customer details hook * Minor fixes * Update default messages * Update gift card types * Type fixes * Change directory of useCustomerDetails hook * CR Fixes * Update tests * Make PageTitleWithStatusChip use ExtendedPageHeader * Update tests * Update hook name * Post-rebase fixes * Eslint fix * Fix scrollbar appearing in menu issue (#1539) * Change displayCode to last4CodeChars (#1573) * Add filtered redirect to gift card page from customer details (#1556) * Limit number of channel list items (#1607) * Add max height to single select field menu items container * Add storybook case * Update stories tests * Fix gift card product changing to preorder on save issue (#1583) * Variant preorder fix * Global threshold input should be optional * update snapshot * Add displaying logic gift cards list toolbar (#1617) * add displaying logic for gift card toolbar * Logic fix * Handle bulk export after creation (#1544) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Handle export after bulk gift card creation * Add default messages * Create an util function to get correct input for export * Update component's name * Change modal's title * Update messages Co-authored-by: Magdalena Markusik <magdalena@markusik.com> * Gift Card List item number change doesn't refetch fix (#1643) * Fix number of rows change not refetching list * Add pagination reset * Update descriptions for gift card messages to be more descriptive (#1648) * Gift card history timeline (#1597) * Update queries and mutations * Allow title to be a react node * Show user name if it exists in data object * Update types * Refresh queries on note add * Add gift card history * type fix * Update messages * Fix timeline note * Add event fragment to form update result * Update types * Fix typo * Update messages * Disable input if gift card is expired * Remove unused imports * CR Fixes * Change messages location * Change message to include user in order * Allow adding notes to expired gift cards * Fix disabled input showing dropdown issue (#1636) * On click is disabled when component is disabled * update tests * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Gift card filter in product list view (#1621) * Add GiftCard or Normal filter in Product List View * Fix tests * Fix type check * Don't filter if query param is not in enum * Update messages * Update tests * Code cleanup * Add default messages * Pass intl rather than initialise it in util * Post-rebase fixes * Change product type details messages (#1642) * Update product type gift card options messages * update tests * Add sorting to gift card list (#1569) * Update queries and types for sorting * Add optional handleError method to makeQuery * Add sorting to gift card list * Sorting hook uses useGiftCardList hook * Convert to boolean * Add default sorting field * format fix * Add expiry error handling for issuing gift cards (#1634) * Add expiry error handling for issuing gift cards * Add expiry error message to gift card bulk issue * Update Gift Card tag queries to utilise multiple tags (#1685) * Change displayCode to last4CodeChars (#1573) * Update types * WIP * Update gift card forms to utilise multiple tags * Code cleanup * Update gift card event types * Fixes * Change column with no click handler behaviour * Remove an ability to sort by tags * Remove unused code * Update tests * Update timeline events * Update messages * change array reduce to join * Add Y scroll to dialog content * Bulk create Y scroll fix * Endless loading fix (#1732) * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Wip * Extract dialog component outside of gift card create * Update component's name * Extract dialog component outside of export component to provider * Update tests * Various gift card bugs fixes (#1749) * Change currency to options field * Fix hover and font size * Fix gift card list width * Fix bulk delete dialog * Allow balance to be sorted only when currency is filtered * Sorting by balance after removing currency filter defualts to usedBy * Fix trash icon * Add filter dependency * Fix single deletion with bulk * Update tests * Refactor Links used in Gift Cards * Fix export dialog (#1791) Co-authored-by: Magdalena Markusik <magdalena@markusik.com>
2022-01-25 12:44:19 +00:00
placement === "bottom" ? "right top" : "right bottom",
overflowY: "auto"
}}
2019-10-30 14:34:24 +00:00
>
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
<Paper className={classes.paper} elevation={8}>
<ClickAwayListener onClickAway={handleClose}>
<MenuList
autoFocusItem={open}
id="menu-list-grow"
onKeyDown={handleListKeyDown}
>
{menuItems.map((menuItem, menuItemIndex) => (
<MenuItem
data-test-id={menuItem.testId}
Gift cards post mvp (#1632) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add error message to invalid expiryDate (#1518) * Add error message to invalid expiryDate * Add default messages * Replace filter with some * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Gift card customer page (#1520) * Add gift cards card to customer page (#1456) * WIP * WIP * Extract activate/deactivate logic to a hook * add optional side action * Add query for customer's gift cards * Add component for giftcard status chip * Graphql run types * Add gift card card to customer page * Fix status chip header * Revert style change * Unify status chip logic * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Add queries to refetch prop * Simplify gift card list component * Fix order status chip * Extract messages to separate file * Remove unused lines of code * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Change variable name * Fix formatted message * Check if giftcards exist before rendering collection * Add loading button to CardMenu component (#1476) * WIP * WIP * Add gift card card to customer page * Fix status chip header * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Remove unused lines of code * Revert style change * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Add loading animation to card menu buttons * Added default messages * Change conditional prop checking to filtering * Issue gift card in customer page (#1468) * WIP * WIP * Replace typed query with make query * Add customer details context to customer page * Add context to customer gift cards * Disable customer select when initial customer is present * Pass initial customer to create gift card form * Fixes after cherry-pick * Code cleanup * Remove getInitialData function * Remove unused package * Remove new line * Post-rebase fixes * Code cleanup & extract messages * Remove unused code * Create customer details hook * Minor fixes * Update default messages * Update gift card types * Type fixes * Change directory of useCustomerDetails hook * CR Fixes * Update tests * Make PageTitleWithStatusChip use ExtendedPageHeader * Update tests * Update hook name * Post-rebase fixes * Eslint fix * Fix scrollbar appearing in menu issue (#1539) * Change displayCode to last4CodeChars (#1573) * Add filtered redirect to gift card page from customer details (#1556) * Limit number of channel list items (#1607) * Add max height to single select field menu items container * Add storybook case * Update stories tests * Fix gift card product changing to preorder on save issue (#1583) * Variant preorder fix * Global threshold input should be optional * update snapshot * Add displaying logic gift cards list toolbar (#1617) * add displaying logic for gift card toolbar * Logic fix * Handle bulk export after creation (#1544) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Handle export after bulk gift card creation * Add default messages * Create an util function to get correct input for export * Update component's name * Change modal's title * Update messages Co-authored-by: Magdalena Markusik <magdalena@markusik.com> * Gift Card List item number change doesn't refetch fix (#1643) * Fix number of rows change not refetching list * Add pagination reset * Update descriptions for gift card messages to be more descriptive (#1648) * Gift card history timeline (#1597) * Update queries and mutations * Allow title to be a react node * Show user name if it exists in data object * Update types * Refresh queries on note add * Add gift card history * type fix * Update messages * Fix timeline note * Add event fragment to form update result * Update types * Fix typo * Update messages * Disable input if gift card is expired * Remove unused imports * CR Fixes * Change messages location * Change message to include user in order * Allow adding notes to expired gift cards * Fix disabled input showing dropdown issue (#1636) * On click is disabled when component is disabled * update tests * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Gift card filter in product list view (#1621) * Add GiftCard or Normal filter in Product List View * Fix tests * Fix type check * Don't filter if query param is not in enum * Update messages * Update tests * Code cleanup * Add default messages * Pass intl rather than initialise it in util * Post-rebase fixes * Change product type details messages (#1642) * Update product type gift card options messages * update tests * Add sorting to gift card list (#1569) * Update queries and types for sorting * Add optional handleError method to makeQuery * Add sorting to gift card list * Sorting hook uses useGiftCardList hook * Convert to boolean * Add default sorting field * format fix * Add expiry error handling for issuing gift cards (#1634) * Add expiry error handling for issuing gift cards * Add expiry error message to gift card bulk issue * Update Gift Card tag queries to utilise multiple tags (#1685) * Change displayCode to last4CodeChars (#1573) * Update types * WIP * Update gift card forms to utilise multiple tags * Code cleanup * Update gift card event types * Fixes * Change column with no click handler behaviour * Remove an ability to sort by tags * Remove unused code * Update tests * Update timeline events * Update messages * change array reduce to join * Add Y scroll to dialog content * Bulk create Y scroll fix * Endless loading fix (#1732) * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Wip * Extract dialog component outside of gift card create * Update component's name * Extract dialog component outside of export component to provider * Update tests * Various gift card bugs fixes (#1749) * Change currency to options field * Fix hover and font size * Fix gift card list width * Fix bulk delete dialog * Allow balance to be sorted only when currency is filtered * Sorting by balance after removing currency filter defualts to usedBy * Fix trash icon * Add filter dependency * Fix single deletion with bulk * Update tests * Refactor Links used in Gift Cards * Fix export dialog (#1791) Co-authored-by: Magdalena Markusik <magdalena@markusik.com>
2022-01-25 12:44:19 +00:00
disabled={menuItem.loading || menuItem.disabled}
onClick={() => handleMenuClick(menuItemIndex)}
key={menuItem.label}
button
>
Gift cards post mvp (#1632) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add error message to invalid expiryDate (#1518) * Add error message to invalid expiryDate * Add default messages * Replace filter with some * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Gift card customer page (#1520) * Add gift cards card to customer page (#1456) * WIP * WIP * Extract activate/deactivate logic to a hook * add optional side action * Add query for customer's gift cards * Add component for giftcard status chip * Graphql run types * Add gift card card to customer page * Fix status chip header * Revert style change * Unify status chip logic * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Add queries to refetch prop * Simplify gift card list component * Fix order status chip * Extract messages to separate file * Remove unused lines of code * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Change variable name * Fix formatted message * Check if giftcards exist before rendering collection * Add loading button to CardMenu component (#1476) * WIP * WIP * Add gift card card to customer page * Fix status chip header * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Remove unused lines of code * Revert style change * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Add loading animation to card menu buttons * Added default messages * Change conditional prop checking to filtering * Issue gift card in customer page (#1468) * WIP * WIP * Replace typed query with make query * Add customer details context to customer page * Add context to customer gift cards * Disable customer select when initial customer is present * Pass initial customer to create gift card form * Fixes after cherry-pick * Code cleanup * Remove getInitialData function * Remove unused package * Remove new line * Post-rebase fixes * Code cleanup & extract messages * Remove unused code * Create customer details hook * Minor fixes * Update default messages * Update gift card types * Type fixes * Change directory of useCustomerDetails hook * CR Fixes * Update tests * Make PageTitleWithStatusChip use ExtendedPageHeader * Update tests * Update hook name * Post-rebase fixes * Eslint fix * Fix scrollbar appearing in menu issue (#1539) * Change displayCode to last4CodeChars (#1573) * Add filtered redirect to gift card page from customer details (#1556) * Limit number of channel list items (#1607) * Add max height to single select field menu items container * Add storybook case * Update stories tests * Fix gift card product changing to preorder on save issue (#1583) * Variant preorder fix * Global threshold input should be optional * update snapshot * Add displaying logic gift cards list toolbar (#1617) * add displaying logic for gift card toolbar * Logic fix * Handle bulk export after creation (#1544) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Handle export after bulk gift card creation * Add default messages * Create an util function to get correct input for export * Update component's name * Change modal's title * Update messages Co-authored-by: Magdalena Markusik <magdalena@markusik.com> * Gift Card List item number change doesn't refetch fix (#1643) * Fix number of rows change not refetching list * Add pagination reset * Update descriptions for gift card messages to be more descriptive (#1648) * Gift card history timeline (#1597) * Update queries and mutations * Allow title to be a react node * Show user name if it exists in data object * Update types * Refresh queries on note add * Add gift card history * type fix * Update messages * Fix timeline note * Add event fragment to form update result * Update types * Fix typo * Update messages * Disable input if gift card is expired * Remove unused imports * CR Fixes * Change messages location * Change message to include user in order * Allow adding notes to expired gift cards * Fix disabled input showing dropdown issue (#1636) * On click is disabled when component is disabled * update tests * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Gift card filter in product list view (#1621) * Add GiftCard or Normal filter in Product List View * Fix tests * Fix type check * Don't filter if query param is not in enum * Update messages * Update tests * Code cleanup * Add default messages * Pass intl rather than initialise it in util * Post-rebase fixes * Change product type details messages (#1642) * Update product type gift card options messages * update tests * Add sorting to gift card list (#1569) * Update queries and types for sorting * Add optional handleError method to makeQuery * Add sorting to gift card list * Sorting hook uses useGiftCardList hook * Convert to boolean * Add default sorting field * format fix * Add expiry error handling for issuing gift cards (#1634) * Add expiry error handling for issuing gift cards * Add expiry error message to gift card bulk issue * Update Gift Card tag queries to utilise multiple tags (#1685) * Change displayCode to last4CodeChars (#1573) * Update types * WIP * Update gift card forms to utilise multiple tags * Code cleanup * Update gift card event types * Fixes * Change column with no click handler behaviour * Remove an ability to sort by tags * Remove unused code * Update tests * Update timeline events * Update messages * change array reduce to join * Add Y scroll to dialog content * Bulk create Y scroll fix * Endless loading fix (#1732) * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Wip * Extract dialog component outside of gift card create * Update component's name * Extract dialog component outside of export component to provider * Update tests * Various gift card bugs fixes (#1749) * Change currency to options field * Fix hover and font size * Fix gift card list width * Fix bulk delete dialog * Allow balance to be sorted only when currency is filtered * Sorting by balance after removing currency filter defualts to usedBy * Fix trash icon * Add filter dependency * Fix single deletion with bulk * Update tests * Refactor Links used in Gift Cards * Fix export dialog (#1791) Co-authored-by: Magdalena Markusik <magdalena@markusik.com>
2022-01-25 12:44:19 +00:00
<div
className={classNames(className, {
[classes.loadingContent]: isWithLoading
})}
>
{menuItem.loading ? (
<>
<Typography variant="subtitle1">
<FormattedMessage
{...messages.cardMenuItemLoading}
/>
</Typography>
<CircularProgress size={24} />
</>
) : (
<Typography>{menuItem.label}</Typography>
)}
</div>
</MenuItem>
))}
</MenuList>
</ClickAwayListener>
</Paper>
</Grow>
)}
</Popper>
2019-10-30 14:34:24 +00:00
</div>
);
};
2019-06-19 14:40:52 +00:00
CardMenu.displayName = "CardMenu";
export default CardMenu;