@riosst100/pwa-marketplace 2.0.8 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/.github/workflows/dependabot.yml +28 -28
  2. package/i18n/en_US.json +508 -509
  3. package/i18n/id_ID.json +508 -509
  4. package/package.json +18 -22
  5. package/src/componentOverrideMapping.js +1 -0
  6. package/src/components/AccountLayout/index.js +15 -0
  7. package/src/components/OrderDetail/components/itemsOrdered.js +128 -0
  8. package/src/components/OrderDetail/components/rmaList.js +114 -0
  9. package/src/components/OrderDetail/orderDetail.js +204 -0
  10. package/src/components/OrderDetail/orderDetailPage.js +14 -0
  11. package/src/components/RMAPage/RMACreate.js +238 -0
  12. package/src/components/RMAPage/RMACreatePage.js +14 -0
  13. package/src/components/RMAPage/RMADetail.js +318 -0
  14. package/src/components/RMAPage/RMADetailPage.js +14 -0
  15. package/src/components/RMAPage/RMAList.js +241 -0
  16. package/src/components/RMAPage/RMASelect.js +36 -0
  17. package/src/components/RMAPage/RMASelectPage.js +13 -0
  18. package/src/components/RMAPage/components/productItem.js +114 -0
  19. package/src/components/RMAPage/components/rmaList.js +250 -0
  20. package/src/components/RMAPage/index.js +14 -0
  21. package/src/components/RMAPage/orderRow.js +318 -0
  22. package/src/components/commons/Checkbox/index.js +57 -0
  23. package/src/components/commons/Collapsible/index.js +51 -0
  24. package/src/components/commons/Select/index.js +29 -0
  25. package/src/components/commons/Textfield/index.js +20 -0
  26. package/src/intercept.js +35 -0
  27. package/src/overwrites/venia-ui/lib/components/AccountMenu/accountMenu.js +2 -1
  28. package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.module.css +38 -0
  29. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/product.js +9 -2
  30. package/src/overwrites/venia-ui/lib/components/Footer/footer.js +1 -1
  31. package/src/overwrites/venia-ui/lib/components/Header/header.js +12 -1
  32. package/src/overwrites/venia-ui/lib/components/Newsletter/newsletter.js +1 -1
  33. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderRow.js +11 -3
  34. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +34 -3
  35. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.module.css +9 -0
  36. package/src/overwrites/venia-ui/lib/components/ProductImageCarousel/carousel.module.css +1 -1
  37. package/src/overwrites/venia-ui/lib/components/WishlistPage/actionMenu.ee.js +54 -0
  38. package/src/overwrites/venia-ui/lib/components/WishlistPage/actionMenu.js +7 -0
  39. package/src/overwrites/venia-ui/lib/components/WishlistPage/createWishlist.ee.js +129 -0
  40. package/src/overwrites/venia-ui/lib/components/WishlistPage/createWishlist.js +3 -0
  41. package/src/overwrites/venia-ui/lib/components/WishlistPage/createWishlist.module.css +63 -0
  42. package/src/overwrites/venia-ui/lib/components/WishlistPage/index.js +14 -0
  43. package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlist.js +193 -0
  44. package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlist.module.css +78 -0
  45. package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistConfirmRemoveProductDialog.js +84 -0
  46. package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistConfirmRemoveProductDialog.module.css +20 -0
  47. package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistEditFavoritesListDialog.js +96 -0
  48. package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistEditFavoritesListDialog.module.css +22 -0
  49. package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistItem.js +138 -0
  50. package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistItem.module.css +78 -0
  51. package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistItems.js +45 -0
  52. package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistItems.module.css +9 -0
  53. package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistListActionsDialog.js +61 -0
  54. package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistMoreActionsDialog.js +84 -0
  55. package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistMoreActionsDialog.module.css +19 -0
  56. package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistPage.js +120 -0
  57. package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistPage.module.css +31 -0
@@ -0,0 +1,120 @@
1
+ import React, { Fragment, useMemo } from 'react';
2
+ import { FormattedMessage, useIntl } from 'react-intl';
3
+ import { useWishlistPage } from '@magento/peregrine/lib/talons/WishlistPage/useWishlistPage';
4
+ import { deriveErrorMessage } from '@magento/peregrine/lib/util/deriveErrorMessage';
5
+
6
+ import { useStyle } from '@magento/venia-ui/lib/classify';
7
+ import { fullPageLoadingIndicator } from '@magento/venia-ui/lib/components/LoadingIndicator';
8
+ import Wishlist from './wishlist';
9
+ import defaultClasses from './wishlistPage.module.css';
10
+
11
+ import CreateWishlist from './createWishlist';
12
+ import { StoreTitle } from '@magento/venia-ui/lib/components/Head';
13
+
14
+ const WishlistPage = props => {
15
+ const talonProps = useWishlistPage();
16
+ const {
17
+ errors,
18
+ loading,
19
+ shouldRenderVisibilityToggle,
20
+ wishlists
21
+ } = talonProps;
22
+ const { formatMessage } = useIntl();
23
+ const error = errors.get('getCustomerWishlistQuery');
24
+
25
+ const classes = useStyle(defaultClasses, props.classes);
26
+ const WISHLIST_DISABLED_MESSAGE = formatMessage({
27
+ id: 'wishlistPage.wishlistDisabledMessage',
28
+ defaultMessage: 'The wishlist is not currently available.'
29
+ });
30
+ const PAGE_TITLE = formatMessage({
31
+ id: 'wishlistPage.pageTitleText',
32
+ defaultMessage: 'Wishlist'
33
+ });
34
+ const wishlistElements = useMemo(() => {
35
+ if (wishlists.length === 0) {
36
+ return <Wishlist />;
37
+ }
38
+
39
+ return wishlists.map((wishlist, index) => (
40
+ <Wishlist
41
+ key={wishlist.id}
42
+ isCollapsed={index !== 0}
43
+ data={wishlist}
44
+ shouldRenderVisibilityToggle={shouldRenderVisibilityToggle}
45
+ />
46
+ ));
47
+ }, [shouldRenderVisibilityToggle, wishlists]);
48
+
49
+ if (loading && !error) {
50
+ return fullPageLoadingIndicator;
51
+ }
52
+
53
+ let content;
54
+ if (error) {
55
+ const derivedErrorMessage = deriveErrorMessage([error]);
56
+ const errorElement =
57
+ derivedErrorMessage === WISHLIST_DISABLED_MESSAGE ? (
58
+ <p>
59
+ <FormattedMessage
60
+ id={'wishlistPage.disabledMessage'}
61
+ defaultMessage={
62
+ 'Sorry, this feature has been disabled.'
63
+ }
64
+ />
65
+ </p>
66
+ ) : (
67
+ <p className={classes.fetchError}>
68
+ <FormattedMessage
69
+ id={'wishlistPage.fetchErrorMessage'}
70
+ defaultMessage={
71
+ 'Something went wrong. Please refresh and try again.'
72
+ }
73
+ />
74
+ </p>
75
+ );
76
+
77
+ content = <div className={classes.errorContainer}>{errorElement}</div>;
78
+ } else {
79
+ content = (
80
+ <Fragment>
81
+ {wishlistElements}
82
+ <CreateWishlist numberOfWishlists={wishlists.length} />
83
+ </Fragment>
84
+ );
85
+ }
86
+
87
+ const wishlistMessage = formatMessage(
88
+ {
89
+ id: 'wishlist.itemsMessage',
90
+ defaultMessage: 'You have {count} items in your wishlist.'
91
+ },
92
+ { count: wishlists[0].items_count }
93
+ );
94
+
95
+ return (
96
+ <div className={classes.root} data-cy="Wishlist-root">
97
+ {/* <div
98
+ aria-live="polite"
99
+ className={classes.heading}
100
+ data-cy="WishlistPage-heading"
101
+ >
102
+ <div aria-live="polite" aria-label={wishlistMessage} />
103
+ <FormattedMessage
104
+ values={{ count: wishlists.length }}
105
+ id={'wishlistPage.headingText'}
106
+ defaultMessage={
107
+ '{count, plural, one {Favorites List} other {Favorites Lists}}'
108
+ }
109
+ />
110
+ </div> */}
111
+ <StoreTitle>{PAGE_TITLE}</StoreTitle>
112
+ <div aria-live="polite" className="text-xl font-medium text-left">
113
+ {PAGE_TITLE}
114
+ </div>
115
+ {content}
116
+ </div>
117
+ );
118
+ };
119
+
120
+ export default WishlistPage;
@@ -0,0 +1,31 @@
1
+ .root {
2
+ composes: gap-y-xs from global;
3
+ composes: grid from global;
4
+
5
+ composes: lg_gap-y-md from global;
6
+ }
7
+
8
+ .heading {
9
+ composes: font-bold from global;
10
+ composes: font-serif from global;
11
+ composes: justify-self-center from global;
12
+ composes: pb-xs from global;
13
+
14
+ composes: lg_pb-0 from global;
15
+ }
16
+
17
+ .errorContainer {
18
+ composes: justify-self-center from global;
19
+ }
20
+
21
+ .fetchError {
22
+ composes: border-l-4 from global;
23
+ composes: border-solid from global;
24
+ composes: border-error from global;
25
+ composes: font-semibold from global;
26
+ composes: pl-xs from global;
27
+ composes: pr-0 from global;
28
+ composes: py-2.5 from global;
29
+ composes: text-error from global;
30
+ composes: text-sm from global;
31
+ }