Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion imports/plugins/core/tags/client/components/TagForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ class TagForm extends Component {
}

<CardActions disableSpacing>
<Button color="secondary" onClick={this.handleSubmitForm}>
<Button variant="contained" color="primary" onClick={this.handleSubmitForm}>
{i18next.t("admin.tags.form.save")}
</Button>
</CardActions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from "prop-types";
import { i18next } from "/client/api";
import {
Grid,
Grow,
Button,
Card as MuiCard,
CardHeader,
Expand All @@ -27,8 +28,7 @@ const useStyles = makeStyles((theme) => ({
display: "block"
},
helpText: {
marginLeft: theme.spacing(2),
fontWeight: theme.typography.fontWeightRegular
marginLeft: theme.spacing(2)
},
leftIcon: {
marginRight: theme.spacing(1)
Expand Down Expand Up @@ -62,61 +62,69 @@ export default function FilterByFileCard(props) {

return (
<Grid item sm={12} className={cardClasses}>
<MuiCard>
<CardHeader
action={
<IconButton aria-label="close" onClick={() => setFilterByFileVisible(false)}>
<CloseIcon />
</IconButton>
}
title={i18next.t("admin.importCard.title")}
/>
<CardContent>
{files.length > 0 ? (
<Grid container spacing={1} className={classes.cardContainer}>
<Grid item sm={12}>
{
files.map((file, index) => (
<Chip
label={file.name}
key={index}
className={classes.leftChip}
onDelete={() => handleDelete(file.name)}
/>
))
}
<Grow
in={isFilterByFileVisible}
mountOnEnter
style={{ transformOrigin: "center top" }}
timeout={180}
unmountOnExit
>
<MuiCard>
<CardHeader
action={
<IconButton aria-label="close" onClick={() => setFilterByFileVisible(false)}>
<CloseIcon />
</IconButton>
}
title={i18next.t("admin.importCard.title")}
/>
<CardContent>
{files.length > 0 ? (
<Grid container spacing={1} className={classes.cardContainer}>
<Grid item sm={12}>
{
files.map((file, index) => (
<Chip
label={file.name}
key={index}
className={classes.leftChip}
onDelete={() => handleDelete(file.name)}
/>
))
}
</Grid>
<Grid item sm={12}>
<Button
variant="contained"
color="primary"
style={{ float: "right" }}
onClick={() => importFiles(files)}
>
{i18next.t("admin.importCard.filterProducts")}
</Button>
</Grid>
</Grid>
<Grid item sm={12}>
<Button
variant="contained"
color="primary"
style={{ float: "right" }}
onClick={() => importFiles(files)}
>
{i18next.t("admin.importCard.filterProducts")}
</Button>
) : (
<Grid container spacing={1} className={classes.cardContainer}>
<Grid item sm={12}>
<Button
{...getRootProps({ className: "dropzone" })}
variant="contained"
color="primary"
>
<input {...getInputProps()} />
<ImportIcon className={classes.leftIcon} />
{i18next.t("admin.importCard.import")}
</Button>
<Typography variant="caption" display="inline" className={classes.helpText}>
{i18next.t("admin.importCard.importHelpText")}
</Typography>
</Grid>
</Grid>
</Grid>
) : (
<Grid container spacing={1} className={classes.cardContainer}>
<Grid item sm={12}>
<Button
{...getRootProps({ className: "dropzone" })}
variant="contained"
color="primary"
>
<input {...getInputProps()} />
<ImportIcon className={classes.leftIcon} />
{i18next.t("admin.importCard.import")}
</Button>
<Typography variant="h5" display="inline" className={classes.helpText}>
{i18next.t("admin.importCard.importHelpText")}
</Typography>
</Grid>
</Grid>
)}
</CardContent>
</MuiCard>
)}
</CardContent>
</MuiCard>
</Grow>
</Grid>
);
}
Expand Down
42 changes: 11 additions & 31 deletions imports/plugins/included/product-variant/components/productGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { i18next } from "/client/api";
import Button from "@material-ui/core/Button";
import Card from "@material-ui/core/Card";
import CardContent from "@material-ui/core/CardContent";
import CardHeader from "@material-ui/core/CardHeader";
import Checkbox from "@material-ui/core/Checkbox";
import Menu from "@material-ui/core/Menu";
import MenuItem from "@material-ui/core/MenuItem";
Expand All @@ -22,7 +23,6 @@ import TablePagination from "@material-ui/core/TablePagination";
import TableRow from "@material-ui/core/TableRow";
import ChevronDownIcon from "mdi-material-ui/ChevronDown";
import ConfirmDialog from "@reactioncommerce/catalyst/ConfirmDialog";
import Typography from "@material-ui/core/Typography";
import Chip from "@reactioncommerce/catalyst/Chip";
import withStyles from "@material-ui/core/styles/withStyles";

Expand Down Expand Up @@ -54,26 +54,14 @@ const styles = (theme) => ({
},
toolbar: {
marginBottom: theme.spacing(2),
minHeight: "65px",
minHeight: theme.spacing(5),
paddingLeft: 0,
paddingRight: 0,
[theme.breakpoints.up("sm")]: {
paddingLeft: 0,
paddingRight: 0
}
},
filterCountContainer: {
paddingLeft: theme.spacing(2),
paddingTop: theme.spacing(3)
},
filterCountText: {
paddingLeft: theme.spacing(2),
fontWeight: theme.typography.fontWeightRegular,
letterSpacing: "0.5px"
},
productsTitle: {
letterSpacing: "0.3px"
},
actionDropdownTrigger: {
border: `1px solid ${theme.palette.colors.coolGrey}`,
color: theme.palette.colors.coolGrey500
Expand Down Expand Up @@ -174,34 +162,26 @@ class ProductGrid extends Component {
}

renderFilteredCount() {
const { selectedProductIds, totalProductCount, classes } = this.props;
const { selectedProductIds, totalProductCount } = this.props;
const selectedCount = selectedProductIds.length;
const filterByProductIds = Session.get("filterByProductIds");
const totalCount = i18next.t("admin.productTable.bulkActions.totalCount", { count: totalProductCount });
const selected = i18next.t("admin.productTable.bulkActions.selectedCount", { count: selectedCount });

if (filterByProductIds) {
return (
<div className={classes.filterCountContainer}>
<Typography variant="h4" display="inline" className={classes.productsTitle}>
{i18next.t("admin.productTable.bulkActions.filteredProducts")}
</Typography>
<Typography variant="h5" display="inline" className={classes.filterCountText}>
{selected}
</Typography>
</div>
<CardHeader
title={i18next.t("admin.productTable.bulkActions.filteredProducts")}
subheader={selected}
/>
);
}

return (
<div className={classes.filterCountContainer}>
<Typography variant="h4" display="inline" className={classes.productsTitle}>
{i18next.t("admin.productTable.bulkActions.allProducts")}
</Typography>
<Typography variant="h5" display="inline" className={classes.filterCountText}>
{(selectedCount > 0) ? selected : totalCount}
</Typography>
</div>
<CardHeader
title={i18next.t("admin.productTable.bulkActions.allProducts")}
subheader={(selectedCount > 0) ? selected : totalCount}
/>
);
}

Expand Down
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@fortawesome/free-solid-svg-icons": "^5.7.1",
"@fortawesome/react-fontawesome": "^0.1.4",
"@material-ui/core": "^4.3.2",
"@reactioncommerce/catalyst": "~1.9.5",
"@reactioncommerce/catalyst": "~1.9.6",
"@reactioncommerce/components": "^0.67.2",
"@reactioncommerce/components-context": "1.2.0",
"@reactioncommerce/data-factory": "^1.0.0",
Expand Down