Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add full GQL support to product editor #188

Merged
merged 222 commits into from
Mar 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
222 commits
Select commit Hold shift + click to select a range
52b243b
feat: add product query definition
mikemurray Jan 23, 2020
f94aab6
feat: add product hook
mikemurray Jan 23, 2020
69f7d5a
refactor: use `useProduct` hook
mikemurray Jan 23, 2020
259deb7
refactor: initial updated to `useProduct` hook
mikemurray Jan 23, 2020
9a6cee1
refactor: disable non-gql refactored blocks
mikemurray Jan 23, 2020
da1fe8e
fix: update to latest reacto-form to fix form state bug
mikemurray Jan 24, 2020
9673849
refactor: use notistack
mikemurray Jan 24, 2020
b46a770
refactor: remove unused import
mikemurray Jan 24, 2020
07dd989
feat: allow overriding of params with default values
mikemurray Jan 24, 2020
f2c6100
feat: add hook for generating sitemaps
mikemurray Jan 24, 2020
1267710
feat: add remaining form fields
mikemurray Jan 24, 2020
e7638ac
feat: add update product mutation definition
mikemurray Jan 24, 2020
90e849a
feat: add social metadata to product
mikemurray Jan 25, 2020
293e821
refactor: import update product mutation
mikemurray Jan 25, 2020
1986724
refactor: social form to use hooks and GQL
mikemurray Jan 25, 2020
89872cb
refactor: include social form
mikemurray Jan 25, 2020
ae96ebc
feat: update catalyst and peer dependencies
mikemurray Jan 29, 2020
db15fe5
fix: use named import
mikemurray Jan 29, 2020
e16db18
fix: import from material-ui/core
mikemurray Jan 29, 2020
a0403eb
fix: use named import
mikemurray Jan 29, 2020
8e664a5
fix: use named import
mikemurray Jan 29, 2020
ca5bb61
refactor: reintroduce the tag form block
mikemurray Jan 29, 2020
f5d1e6d
feat: add bulk tag dialog
mikemurray Jan 29, 2020
fd5aeb5
feat: get tags
mikemurray Jan 29, 2020
c8e9d3b
feat: get tags
mikemurray Jan 29, 2020
3986b36
feat: add delete product tag callback
mikemurray Jan 29, 2020
8de7167
refactor: use Catalyst TextField
mikemurray Jan 29, 2020
cc8c291
refactor: use Catalyst TextField
mikemurray Jan 29, 2020
9ceb56e
feat: rebuild to use GQL and a new user experience
mikemurray Jan 29, 2020
853e1ec
refactor: remove log
mikemurray Jan 29, 2020
2c45322
feat: add create variant mutation definition
mikemurray Jan 29, 2020
364a02d
feat: add react-spring for animation
mikemurray Jan 29, 2020
ac6fdee
refactor: reintroduce variant table block
mikemurray Jan 29, 2020
0c595bb
fix: remove opaqueId conversion
mikemurray Jan 29, 2020
8b0fbd2
feat: use the `useProduct` hook
mikemurray Jan 29, 2020
9961609
fix: invalid component prop
willopez Jan 14, 2020
acc51d8
feature: WIP use Catalyst DataTable for products view
willopez Jan 14, 2020
e761413
refactor: wire up publish products action
willopez Jan 15, 2020
392f50d
refactor: wireup make visible action
willopez Jan 16, 2020
36e3148
refactor: wire up make hidden action in products view
willopez Jan 16, 2020
b5a1cf2
refactor: wire up clone and archive bulk actions
willopez Jan 16, 2020
e9d586d
refactor: some minor clean up
willopez Jan 16, 2020
1f1956a
refactor: refresh table data after action is taken on products
willopez Jan 22, 2020
48fdfb6
refactor: add filters to orders tables
willopez Jan 22, 2020
a38cf9c
chore: upgrade material ui lab package
willopez Jan 23, 2020
b47f5f4
refactor: wire up orders date range filter
willopez Jan 23, 2020
2c3a35f
fix: lint errors
willopez Jan 23, 2020
aac0951
refactor: add product thumbnail cell
willopez Jan 24, 2020
7f45fbe
refactor: add back link to order detail page
willopez Jan 24, 2020
b7c34f2
refactor: guard against undefined variables
willopez Jan 24, 2020
8fb1a2b
refactor: add "Create product" button
willopez Jan 24, 2020
0b1b7e7
feat: point to /graphql instead of /graphql-beta
aldeed Jan 24, 2020
45c017c
refactor: client side hasPermission check to get roles from Group, no…
kieckhafer Jan 22, 2020
8a0e208
refactor: update server side to use Groups instead of user.roles for …
kieckhafer Jan 22, 2020
a08a2a0
refactor: update permission checks with new style of permissions
kieckhafer Jan 22, 2020
ac1b7f8
style: update return style
kieckhafer Jan 24, 2020
2b99b8c
style: remove unneeded if
kieckhafer Jan 24, 2020
25e39de
fix: provide correct var
kieckhafer Jan 24, 2020
2ff8e8b
Update main.js
kieckhafer Jan 24, 2020
801547e
docs: update docs links with `trunk` as the new branch
kieckhafer Jan 23, 2020
e9571e8
feat: update to Meteor 1.9
aldeed Jan 26, 2020
23cfe3d
refactor: upgrade Catalyst and adapt products table to use latest
willopez Jan 27, 2020
adf169b
refator: use filtersByKey in orders table
willopez Jan 27, 2020
36f9a09
refactor: wire up filter by file
willopez Jan 27, 2020
2a3dfc3
refactor: correctly set product id column
willopez Jan 27, 2020
7783ec9
refactor: minor clean up
willopez Jan 27, 2020
977a2e3
refactor: wire up tag selector
willopez Jan 28, 2020
8aaa96d
refactor: remove unnecessary product UI and Meteor publications
willopez Jan 28, 2020
e5ac54c
refactor: revamp translations
willopez Jan 28, 2020
5b1391b
chore: upgrade Catalyst package
willopez Jan 29, 2020
02e9da0
refactor: add filter by product ids manual filter
willopez Jan 29, 2020
6502b8b
refactor: add missing translations to orders table
willopez Jan 29, 2020
619f723
chore: remove unnecessary publication
willopez Jan 29, 2020
59148a6
refactor: do not display the "create product" button when quickcard is
willopez Jan 29, 2020
620ba8e
refactor: add header to created at column
willopez Jan 29, 2020
dc74d46
feat: use supplied id's to generate the correct PDP url
mikemurray Jan 31, 2020
6b341b7
feat: supply an id
mikemurray Jan 31, 2020
9442665
feat: add update variant mutation definition
mikemurray Jan 31, 2020
4bd4956
feat: use opaque ids from url params
mikemurray Jan 31, 2020
8673dce
feat: add update product variant callback
mikemurray Jan 31, 2020
963148a
feat: merge ProductDetailMain and VariantDetailMain blocks into one l…
mikemurray Jan 31, 2020
3f27f24
feat: tree view for variant and options
mikemurray Jan 31, 2020
6ec6774
feat: re-enable blocks
mikemurray Jan 31, 2020
46d2dc8
feat: merge routes into one layout for a smoother experience
mikemurray Jan 31, 2020
fc51de5
feat: update variant detail form to use GraphQL and new UX
mikemurray Jan 31, 2020
ed0aaf6
feat: merge product header and block components
mikemurray Jan 31, 2020
2dc3dc0
feat: add media fields
mikemurray Jan 31, 2020
1afcb6c
feat: add default image
mikemurray Jan 31, 2020
44a7385
fix: use whole product object in dependency array
mikemurray Jan 31, 2020
27b15ac
BREAKING: remove variant table block definitions
mikemurray Jan 31, 2020
f7e50d2
feat: add variant action component
mikemurray Feb 3, 2020
d9d404a
feat: add variant visibility toggle callback
mikemurray Feb 3, 2020
05303b8
feat: update media fields
mikemurray Feb 3, 2020
217f475
refactor: use hooks and update source accessors
mikemurray Feb 3, 2020
1271a61
refactor: assume opaque ids by default
mikemurray Feb 3, 2020
c52af5f
feat: use variant action component
mikemurray Feb 3, 2020
51b9e15
feat: update to use the `useProduct` hook
mikemurray Feb 3, 2020
cc25a8c
feat: update to use the `useProduct` hook
mikemurray Feb 3, 2020
71ff9fd
refactor: re-enable media gallery blocks
mikemurray Feb 3, 2020
a660860
feat: update product meta form UI and use GQL
mikemurray Feb 5, 2020
62ac76b
refactor: merge helper function into useCallback hook
mikemurray Feb 5, 2020
750dbed
fix: add keys
mikemurray Feb 5, 2020
960ebeb
refactor: enable metafields block
mikemurray Feb 5, 2020
9bdec66
chore: update lockfile
mikemurray Feb 5, 2020
f150c77
chore: reconfigure docker-compose networks
aldeed Jan 30, 2020
c5eb73d
refactor: remove `removeUserPermissions` method
kieckhafer Jan 27, 2020
50cee72
refactor: use GLOBAL_GROUP const instead ofgetting from allaning:roles
kieckhafer Jan 27, 2020
1a5917f
refactor: remove `addUserPermissions` method
kieckhafer Jan 27, 2020
62ab6d1
refactor: remove setUserPermissions method
kieckhafer Jan 27, 2020
e41b3d6
refactor: remove Roles usage from collection-security
kieckhafer Jan 28, 2020
5ef046e
refactor: remove Roles from accounts publication
kieckhafer Jan 28, 2020
e3d37d7
refactor: remove getShopWithRoles
kieckhafer Jan 28, 2020
65baf1d
refactor: remove code related to shop switcher
kieckhafer Jan 28, 2020
22a047c
refactor: remove withCurrentAccount, which isn't used
kieckhafer Jan 28, 2020
8721747
refactor: remove alanning:roles package
kieckhafer Jan 28, 2020
e74a8af
refactor: remove hasOwnerAccess helper
kieckhafer Jan 28, 2020
56cc302
style: lint fixes
kieckhafer Jan 28, 2020
c6e2b4e
refactor: remove `ongoworks:security` package
kieckhafer Jan 31, 2020
4b883ff
chore: update for beta.2
kieckhafer Jan 31, 2020
232ca45
fix: permission issues no longer relevent
kieckhafer Feb 3, 2020
e96f375
revert: revert commit to wrong branch
kieckhafer Feb 3, 2020
e1130f0
chore: upgrade MUI to v4.9.0
willopez Jan 31, 2020
44fee13
chore: use Zoom animation
willopez Jan 31, 2020
6e087d3
refactor: add indicator text to show the number of selected products
willopez Jan 31, 2020
3720cc8
fix: permission issues in admin
kieckhafer Feb 3, 2020
93bbe51
chore: update for beta.3 release
kieckhafer Feb 4, 2020
64eb1cc
chore: update package-lock
kieckhafer Feb 4, 2020
a618620
chore: add clone package
mikemurray Feb 6, 2020
35292ba
fix: default value should be a string
mikemurray Feb 6, 2020
c44f287
refactor: update component name
mikemurray Feb 6, 2020
2249998
fix: use Fragment component and set key
mikemurray Feb 6, 2020
2273aa0
feat: add custom form validation
mikemurray Feb 6, 2020
766ffc0
refactor: use Catalyst text field
mikemurray Feb 6, 2020
674431e
refactor: remove log
mikemurray Feb 6, 2020
9fa2a7b
refactor: organize imports
mikemurray Feb 6, 2020
0ad3acb
refactor: remove unused CSS class
mikemurray Feb 6, 2020
27342fa
feat: update catalyst
mikemurray Feb 7, 2020
550ecd0
feat: add tax codes hook
mikemurray Feb 7, 2020
7765bda
fix: eslint issues
mikemurray Feb 7, 2020
6fbb8e7
fix: default value
mikemurray Feb 7, 2020
79289aa
feat: add variant inventory hook
mikemurray Feb 7, 2020
340259d
feat: remove hocs
mikemurray Feb 7, 2020
f46c2f2
fix: remove unused code and address lint issues
mikemurray Feb 7, 2020
9d9f103
feat: update variant tax form to use GQL and Catalyst components
mikemurray Feb 7, 2020
247b83f
feat: update variant tax form to use GQL and Catalyst components
mikemurray Feb 7, 2020
0587356
refactor: re-enable variant tax form
mikemurray Feb 7, 2020
f4a2277
feat: add back button option
mikemurray Feb 7, 2020
b61a8b6
feat: remove from app bar component
mikemurray Feb 7, 2020
174c40c
feat: use full layout
mikemurray Feb 7, 2020
b38214b
feat: remove breadcrumbs to simplify for sidebar
mikemurray Feb 7, 2020
4698489
feat: remove from card component
mikemurray Feb 7, 2020
fefb30b
feat: add product toolbar component
mikemurray Feb 7, 2020
591aa51
feat: update to a full width two column layout
mikemurray Feb 7, 2020
d7334e5
feat: link title
mikemurray Feb 7, 2020
fbfec40
update startup to wait for mongo
kieckhafer Feb 5, 2020
4263dfe
update docker compose
kieckhafer Feb 5, 2020
170afa2
feat: wait for mongo replica set
aldeed Feb 5, 2020
8fa956d
fix: wait for Hydra before trying to create client
aldeed Feb 6, 2020
1f242dc
chore: update version to beta.4
kieckhafer Feb 6, 2020
79bdf91
chore: update Docker image to 3.0.0-beta.4
aldeed Feb 6, 2020
70609fd
feat: add currentVariant return value
mikemurray Feb 8, 2020
7bb6acd
feat: add tax code fields
mikemurray Feb 8, 2020
48b8758
feat: add tax code fields
mikemurray Feb 8, 2020
fbbc607
feat: add tax code fields
mikemurray Feb 8, 2020
f40c91f
feat: add tax code fields
mikemurray Feb 8, 2020
20d4d8a
fix: remove helper on the client
kieckhafer Feb 11, 2020
989095f
style: lint fix
kieckhafer Feb 11, 2020
5207b6e
chore: update version to beta.5
kieckhafer Feb 12, 2020
399b2e8
chore: update docker-compose with new version number
kieckhafer Feb 13, 2020
733f111
Merge branch 'trunk' into feat-184-mikemurray-gql-product-edit
mikemurray Feb 19, 2020
258611f
feat: update reacto-form
mikemurray Feb 21, 2020
a713fab
fix: provide defaults if inventory info is incomplete
mikemurray Feb 21, 2020
49346f4
feat: refetch inventory info after mutation
mikemurray Feb 21, 2020
0536177
feat: use better reacto-form checkbox handling
mikemurray Feb 21, 2020
3ba6676
feat: add header blocks to main column
mikemurray Feb 24, 2020
629186c
feat: add mutations for variant actions
mikemurray Feb 24, 2020
7c012b1
fix: guard potential null value
mikemurray Feb 24, 2020
d47ef8d
feat: add variant actions create, clone, archive
mikemurray Feb 24, 2020
304c236
feat: update variant secondary actions
mikemurray Feb 24, 2020
be903b8
refactor: simplify archive button
mikemurray Feb 25, 2020
479a99e
feat: add create variant menu item
mikemurray Feb 25, 2020
2ca3b6c
feat: update expand button display
mikemurray Feb 25, 2020
0ef96e4
fix: translation key
mikemurray Feb 25, 2020
ec19ce0
feat: custom display for variant header
mikemurray Feb 25, 2020
444d539
feat: show product status in sidebar
mikemurray Feb 25, 2020
8fa4f9a
feat: update catalyst
mikemurray Feb 27, 2020
91d7e91
feat: add toast alerts
mikemurray Feb 28, 2020
a9b7743
feat: add `shouldAppearInSitemap` field
mikemurray Feb 28, 2020
9aa5b1a
feat: add `shouldAppearInSitemap` field
mikemurray Feb 28, 2020
8b6defa
fix: update translation
mikemurray Feb 28, 2020
657a450
refactor: simplify return value
mikemurray Feb 28, 2020
eb348ba
feat: open generate sitemap modal if needed
mikemurray Feb 28, 2020
f445887
fix: remove unused import
mikemurray Mar 3, 2020
9151fd2
fix: translation
mikemurray Mar 3, 2020
cf7b781
fix: use current variant id
mikemurray Mar 3, 2020
583f422
Merge branch 'trunk' into feat-184-mikemurray-gql-product-edit
mikemurray Mar 3, 2020
4964f59
fix: remove deprecated options
mikemurray Mar 3, 2020
56d3eaa
feat: add publish callback
mikemurray Mar 3, 2020
5d14469
fix: update layout
mikemurray Mar 3, 2020
22ff76b
feat: add publish controls directly to toolbar
mikemurray Mar 3, 2020
c96d14d
feat: use primary/detail layout component
mikemurray Mar 3, 2020
966c2f1
feat: add separate form for variant prices
mikemurray Mar 4, 2020
1bef7c5
feat: add variant prices block
mikemurray Mar 4, 2020
6e45b4c
feat: remove variant price fields
mikemurray Mar 4, 2020
54e7476
feat: use button from catalyst
mikemurray Mar 4, 2020
11dae9c
feat: use button from catalyst
mikemurray Mar 4, 2020
59e6184
feat: update submit button label and state
mikemurray Mar 4, 2020
ee9e087
feat: add variant price fields
mikemurray Mar 4, 2020
903cf55
feat: add callback to update variant prices
mikemurray Mar 4, 2020
51d5808
fix: removed undefined display price and translate labels
mikemurray Mar 4, 2020
e98f916
feat: use button from catalyst
mikemurray Mar 4, 2020
091099e
fix: remove loading component
mikemurray Mar 4, 2020
6bf5c52
chore: remove commented out code
mikemurray Mar 4, 2020
d12981b
feat: update translation
mikemurray Mar 4, 2020
387f4b6
feat: remove google plus message field
mikemurray Mar 4, 2020
e150343
feat: update translation
mikemurray Mar 4, 2020
afad926
fix: use reacto-form checkbox options
mikemurray Mar 4, 2020
7d627d7
fix: use product id
mikemurray Mar 4, 2020
639de1c
fix: use encoded product id
mikemurray Mar 4, 2020
c3103ab
fix: update translation
mikemurray Mar 4, 2020
87da77f
feat: add variant list item container component
mikemurray Mar 4, 2020
273fe71
refactor: use variant list item container component
mikemurray Mar 4, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 25 additions & 10 deletions imports/client/ui/components/PrimaryAppBar/PrimaryAppBar.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import React, { Children } from "react";
import PropTypes from "prop-types";
import classNames from "classnames";
import AppBar from "@material-ui/core/AppBar";
import Hidden from "@material-ui/core/Hidden";
import IconButton from "@material-ui/core/IconButton";
import Toolbar from "@material-ui/core/Toolbar";
import Typography from "@material-ui/core/Typography";
import withStyles from "@material-ui/core/styles/withStyles";
import {
AppBar,
Box,
Hidden,
IconButton,
Toolbar,
Typography,
makeStyles
} from "@material-ui/core";
import MenuIcon from "mdi-material-ui/Menu";
import ArrowLeftIcon from "mdi-material-ui/ArrowLeft";
import { UIContext } from "../../context/UIContext";

const styles = (theme) => ({
const useStyles = makeStyles((theme) => ({
action: {
marginLeft: theme.spacing()
},
Expand All @@ -23,15 +27,17 @@ const styles = (theme) => ({
title: {
flex: 1
}
});
}));

/**
* An AppBar for the main content area that provides a place for a title,
* actions to the right, and a menu button for opening and closing the sidebar drawer menu
* @param {Object} props Component props
* @returns {React.Component} A react component
*/
function PrimaryAppBar({ children, classes, title }) {
function PrimaryAppBar({ children, title, onBackButtonClick, shouldShowBackButton = true }) {
const classes = useStyles();

return (
<UIContext.Consumer>
{({ isMobile, isDetailDrawerOpen, isPrimarySidebarOpen, onTogglePrimarySidebar }) => {
Expand All @@ -55,6 +61,13 @@ function PrimaryAppBar({ children, classes, title }) {
<MenuIcon />
</IconButton>
</Hidden>
{(shouldShowBackButton && onBackButtonClick) && (
<Box paddingRight={1}>
<IconButton onClick={onBackButtonClick}>
<ArrowLeftIcon />
</IconButton>
</Box>
)}
<Typography
className={classes.title}
component="h1"
Expand All @@ -78,8 +91,10 @@ function PrimaryAppBar({ children, classes, title }) {
PrimaryAppBar.propTypes = {
children: PropTypes.node,
classes: PropTypes.object,
onBackButtonClick: PropTypes.func,
onToggleDrawerOpen: PropTypes.func,
shouldShowBackButton: PropTypes.bool,
title: PropTypes.node
};

export default withStyles(styles, { name: "RuiPrimaryAppBar" })(PrimaryAppBar);
export default PrimaryAppBar;
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Button from "@material-ui/core/Button";
import Typography from "@material-ui/core/Typography";
import withStyles from "@material-ui/core/styles/withStyles";
import { i18next } from "/client/api";
import PrimaryAppBar from "/imports/client/ui/components/PrimaryAppBar/PrimaryAppBar";
import { Box } from "@material-ui/core";

const publishProductsToCatalog = gql`
mutation ($productIds: [ID]!) {
Expand Down Expand Up @@ -67,7 +67,7 @@ class PublishControls extends Component {
const { documentIds, onPublishClick } = this.props;

return (
<PrimaryAppBar>
<Box display="flex" alignItems="center">
{this.renderChangesNotification()}
<Mutation mutation={publishProductsToCatalog} onCompleted={() => this.renderOnCompletedAlert()} onError={(error) => this.renderOnErrorAlert(error)}>
{(mutationFunc) => (
Expand All @@ -82,7 +82,7 @@ class PublishControls extends Component {
</Button>
)}
</Mutation>
</PrimaryAppBar>
</Box>
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from "prop-types";
import SimpleSchema from "simpl-schema";
import Button from "@reactioncommerce/catalyst/Button";
import TextField from "@material-ui/core/TextField";
import { makeStyles } from "@material-ui/styles";
import { makeStyles } from "@material-ui/core";
import muiOptions from "reacto-form/cjs/muiOptions";
import useReactoForm from "reacto-form/cjs/useReactoForm";

Expand Down
32 changes: 32 additions & 0 deletions imports/plugins/core/taxes/client/hooks/useTaxCodes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import gql from "graphql-tag";
import { useQuery } from "@apollo/react-hooks";

const getTaxCodes = gql`
query getTaxCodes($shopId: ID!) {
taxCodes(shopId: $shopId) {
code
label
}
}
`;

/**
* Get tax codes
* @param {Object} args An object containing arguments
* @param {String} args.shopId Shop Id
* @returns {Object} An object containing tax codes
*/
export default function useTaxCodes({ shopId }) {
const { data, isLoading, refetch } = useQuery(getTaxCodes, {
variables: {
shopId
},
skip: !shopId
});

return {
isLoading,
refetch,
taxCodes: data
};
}
Loading