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

configured s3 image upload & download #200

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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 .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PORT=3000
MONGO_URI=mongodb://127.0.0.1:27017/mern_ecommerce
JWT_SECRET=
JWT_SECRET="secret"
MAILCHIMP_KEY=
MAILCHIMP_LIST_KEY=
MAILGUN_KEY=
Expand Down
54 changes: 54 additions & 0 deletions client/app/components/Manager/Table/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import React from 'react'
import BootstrapTable from 'react-bootstrap-table-next';
import Link from "react-router-dom"


const columns = [{
dataField: 'id',
text: 'Product ID'
}, {
dataField: 'name',
text: 'Product Name'
}, {
dataField: 'price',
text: 'Product Price'
}];

const Table = props => {
const { history, products, isLoading } = props;

const columns = [{
dataField: 'id',
text: 'Product ID',
sort: true
}, {
dataField: 'name',
text: 'Product Name',
sort: true
}, {
dataField: 'price',
text: 'Product Price',
sort: true
},
{
dataField: "databasePkey",
text: "Remove",
formatter: (cellContent, row) => (<Link
to={`/dashboard/product/edit/${row._id}`}
// key={index}
className='d-flex flex-row align-items-center mx-0 mb-3 product-box'
><button className="btn btn-danger btn-xs" onClick={() => console.log(row)}>Delete</button></Link>)}
];

const defaultSorted = [{
dataField: 'name',
order: 'desc'
}];

return (
<BootstrapTable bootstrap4 keyField='id' data={ products } columns={ columns } />

)
}

export default Table
4 changes: 4 additions & 0 deletions client/app/containers/Product/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import ProductList from '../../components/Manager/ProductList';
import SubPage from '../../components/Manager/SubPage';
import LoadingIndicator from '../../components/Common/LoadingIndicator';
import NotFound from '../../components/Common/NotFound';
import Table from '../../components/Manager/Table';


class List extends React.PureComponent {
componentDidMount() {
Expand All @@ -34,6 +36,8 @@ class List extends React.PureComponent {
<LoadingIndicator inline />
) : products.length > 0 ? (
<ProductList products={products} />
// <Table products={products}/>

) : (
<NotFound message='No products found.' />
)}
Expand Down
Loading