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

[Marketplace] Set order(s) to a specific status #2613

Merged
merged 328 commits into from
Aug 24, 2017
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
328 commits
Select commit Hold shift + click to select a range
ca8c102
more props passed to wrapper
kieckhafer Jun 17, 2017
c3467f5
fixes for email table
kieckhafer Jun 17, 2017
7ac944f
update Email table to use ReactTable
kieckhafer Jun 19, 2017
48b0893
email table convert to ReactTable
kieckhafer Jun 19, 2017
dd0a77b
Bunyan and Loggly updates (#2425)
jshimko Jun 19, 2017
b64ee84
refactor default admin user creation (#2453)
jshimko Jun 19, 2017
72d1ad3
update memory usage in CircleCI build (#2462)
jshimko Jun 19, 2017
18778df
finished implementing design
Jun 19, 2017
25e8942
Navbar hover issue (#2451)
rhenshaw56 Jun 20, 2017
cea9557
set css property overflow on horizontal to hidden (#2458)
rhenshaw56 Jun 20, 2017
1d0fd64
[WIP] 2452 fix on UI icon toolbar (#2460)
rhenshaw56 Jun 20, 2017
1a6a8f3
[WIP] 2356 fix on tag menu-sidebar glitch (#2472)
rhenshaw56 Jun 20, 2017
d3e7da5
format price string for invoice details
Jun 20, 2017
b59263b
update media gallery new / deleted image indicators (#2469)
kieckhafer Jun 20, 2017
2c58cba
Merge branch 'development' into ek-newGriddle
kieckhafer Jun 20, 2017
c9a0b28
Remove random regex checks on names. Fixes #2461 (#2471)
brent-hoover Jun 20, 2017
670ee6b
remove older Blaze based launchdock plugin (#2467)
jshimko Jun 20, 2017
e87ea72
2459 router range error fix (#2476)
prosf Jun 20, 2017
8166dc1
custom pagination component for React-Table
kieckhafer Jun 20, 2017
bcb1fa3
update Avalara to use ReactTable
kieckhafer Jun 21, 2017
ee7d9a7
add spacing below tables
kieckhafer Jun 21, 2017
e083bb0
Merge branch 'development' into ek-newGriddle
kieckhafer Jun 21, 2017
c737ac9
2422 Fix on email invite link leading to blank screen (#2437)
rhenshaw56 Jun 21, 2017
c27f70e
Update current user's name on Navbar and profile page when address is…
Jun 21, 2017
698ed21
Merge branch 'development' into ek-newGriddle
Jun 21, 2017
0b97a00
add invoice actions
Jun 21, 2017
3144dc3
Updated dependencies (#2463)
Jun 21, 2017
b16eb03
Merge branch 'development' into ek-newGriddle
kieckhafer Jun 21, 2017
9c07755
remove leftover console.logs
kieckhafer Jun 21, 2017
df80998
lint fixes
kieckhafer Jun 21, 2017
ab14f03
lint fix
kieckhafer Jun 22, 2017
1c36848
query prop validation
kieckhafer Jun 22, 2017
8545717
pagination updates
kieckhafer Jun 22, 2017
3f252fe
Revert minifier to abernix fork (#2486)
jshimko Jun 22, 2017
6bbbef6
componetize pagination
kieckhafer Jun 22, 2017
990574d
Merge branch 'development' into ek-newGriddle
kieckhafer Jun 22, 2017
db4e8d2
Release 1.3.0 (#2417)
Jun 22, 2017
543ddc0
Fix error when inviting already invited user (#2433)
Jun 22, 2017
6c60ea1
Merge branch 'development' of github.com:reactioncommerce/reaction in…
Jun 22, 2017
1e11e68
Merge branch 'marketplace' of github.com:reactioncommerce/reaction in…
Jun 22, 2017
dc76234
Merge branch 'development' into ek-newGriddle
kieckhafer Jun 22, 2017
f1016d9
move emailconfig css to LESS file
kieckhafer Jun 22, 2017
b2460bd
Updated timeout time. (#2492)
rymorgan Jun 22, 2017
e47dfd9
style updates for sortableTable
kieckhafer Jun 22, 2017
f04c46f
update translations
kieckhafer Jun 22, 2017
a55229a
custom full-table filter for ReactTable
kieckhafer Jun 22, 2017
075defe
Fixed product images not displaying on order completed page (#2490)
Jun 23, 2017
5a91d9f
custom full table filter
kieckhafer Jun 23, 2017
b089d03
Merge branch 'development' into ek-newGriddle
kieckhafer Jun 23, 2017
430815a
new match-sorter package for custom filter
kieckhafer Jun 23, 2017
f7e1c4c
Fix hard refresh on clicking tag link on product detail page (#2489)
Jun 23, 2017
34162e0
Remove redundant risul:moment-timezone (#2491)
Jun 23, 2017
6e05c46
Merge 1.3.0 master into development
Jun 23, 2017
809bbb9
add translations for default table text
kieckhafer Jun 23, 2017
921e423
translations
kieckhafer Jun 23, 2017
e0cf90b
Merge branch 'development' into ek-newGriddle
kieckhafer Jun 23, 2017
751d7df
kill translations for the moment, something is acting up
kieckhafer Jun 23, 2017
ea9a4f1
add catch for error when no data is available
kieckhafer Jun 23, 2017
6d3dc05
List view toggle
joykare Jun 27, 2017
0481dfc
Merge branch 'development' into joykare-orders-listview-2323
joykare Jun 27, 2017
dd98eee
Merge branch 'ek-newGriddle' into joykare-orders-listview-2323
joykare Jun 27, 2017
9ba62c8
Use sortableTable to display list
joykare Jun 27, 2017
bef35d9
finish order line item popover functionality
Jun 27, 2017
a6c941b
Merge branch 'marketplace' of github.com:reactioncommerce/reaction in…
Jun 27, 2017
907f54f
First styling iteration
joykare Jun 28, 2017
7dc1840
Add table classname
joykare Jun 28, 2017
50c75f1
allow only users with the orders and dashboard/orders permission to v…
Jun 29, 2017
588c794
Merge branch 'michael-marketplace-line-items-refund-2377' into joykar…
joykare Jul 1, 2017
af54492
Merge with marketplace
joykare Jul 3, 2017
e8da685
Styling second iteration
joykare Jul 3, 2017
d0babc2
Rewrite orders.js into React; Remve filters on orders
Jul 4, 2017
f34865b
Add onto checking capabilty
joykare Jul 5, 2017
89c24aa
Merge branch 'joykare-orders-listview-2323' of https://github.com/rea…
joykare Jul 5, 2017
c8a1eca
Buyah
joykare Jul 5, 2017
8722120
Replace span toggles with buttons
joykare Jul 6, 2017
6f3f887
Styling iteration
joykare Jul 6, 2017
82c130b
Toggle bulk order actions bar on checkbox select
Jul 6, 2017
ab9f6b2
Select all checkbox
joykare Jul 6, 2017
c023440
Change import to match style guide
joykare Jul 6, 2017
ff54605
Fix conflicts with base branch
Jul 6, 2017
3137366
Handle multiple select of orders (part 1)
Jul 6, 2017
9fc7708
Toggle ReactTable header visibility on order(s) select
Jul 6, 2017
d1e700c
Handle multiple select of orders (part 2)
Jul 6, 2017
b58a840
Handle multiple select of orders: fully working
Jul 6, 2017
6595954
Check all
joykare Jul 7, 2017
cc482d8
Massive refactor
joykare Jul 7, 2017
ac491f8
Fix conflicts with base branch
Jul 7, 2017
27c5fef
few style additions
joykare Jul 10, 2017
ca2a285
Merge remote-tracking branch 'origin/marketplace' into joykare-orders…
joykare Jul 10, 2017
c37eef0
Hide columns on screen size change
joykare Jul 10, 2017
6c83d1a
Checkbox multi select tweak
joykare Jul 10, 2017
5d5569f
Fix conflicts with base branch
Jul 10, 2017
207d4ab
Select all orders on 'Check All' even if one was already selected
Jul 12, 2017
bbfcaa5
Vertically align bulk actions bar contents
Jul 12, 2017
14b86fc
Corrections from review
joykare Jul 12, 2017
5e2c06b
Center align checkbox/avatar with parent check-all box
Jul 12, 2017
ae5e284
Center column data
joykare Jul 12, 2017
69d9667
Change checkbox class name
Jul 12, 2017
be43f08
Change checkbox class name
Jul 12, 2017
8054401
Change checked icon to font-awesome check
Jul 13, 2017
f32e595
Merge with remote
Jul 13, 2017
c8dc32f
Add className prop to badge component
Jul 13, 2017
32e8a06
Allow for selected rows to be styled in React Table
Jul 13, 2017
0d56e30
Style selected order rows
Jul 13, 2017
4326811
Styling merge with checkboxes
joykare Jul 14, 2017
1c06ab2
Pagination reorder
joykare Jul 14, 2017
c430114
Match padding between top and bottom in bulk order actions bar
Jul 14, 2017
7e8d495
Toggle, control buttons
joykare Jul 14, 2017
55fe0f9
Remove border from selected orders
Jul 14, 2017
72f708e
Add i18n for bulk order actiobs bar elements
Jul 17, 2017
3792290
Update badge snapshot to include provided className
Jul 17, 2017
3dcfdac
Change sortable bar color
joykare Jul 17, 2017
dcc74f3
Toggle buttons within container and pagination margin increse
joykare Jul 17, 2017
f4a9e25
Remove old pagination
joykare Jul 18, 2017
86e18ad
Checkboxes add
joykare Jul 18, 2017
25d07b5
Fix collapsable column problem
joykare Jul 18, 2017
be42bfa
Center align row data
joykare Jul 18, 2017
d36580d
Merge branch 'joykare-orders-listview-2323' into kieha-select-orders-…
Jul 18, 2017
ec28de5
Merge branch 'joykare-orders-listview-2323' into kieha-select-orders-…
Jul 18, 2017
05cdec9
Bulk order actions bar styling based on new order table styles (part 1)
Jul 18, 2017
a306623
Fix row size change
joykare Jul 18, 2017
05916fc
Merge branch 'joykare-orders-listview-2323' into kieha-select-orders-…
Jul 18, 2017
62f9109
Bulk order actions bar styling based on new order table styles (part 2)
Jul 19, 2017
50c3637
Fix bithound issues
Jul 19, 2017
356cb95
Merge remote-tracking branch 'origin/marketplace' into joykare-orders…
joykare Jul 19, 2017
dbf2f7d
Add @reactioncommerce/reaction-collections
joykare Jul 19, 2017
6ba33ae
Merge branch 'joykare-orders-listview-2323' into kieha-select-orders-…
Jul 19, 2017
f97db7e
Fix bithound issues
Jul 19, 2017
9283c39
Remove line items code from merged in PR
joykare Jul 20, 2017
e18e14d
Fix minor issues as commented on PR
joykare Jul 20, 2017
42107a3
Use assign as opposed to extend
joykare Jul 20, 2017
e252336
Fix button new/prrocessing change
joykare Jul 20, 2017
0198d98
Make button unresizable
joykare Jul 20, 2017
9accb83
Use less files to style table
joykare Jul 20, 2017
425233f
Fix conflicts with base branch
Jul 20, 2017
5bbf553
Remove hardcoded selected row background color, give selected row a c…
Jul 20, 2017
5a5104f
Refactor code
joykare Jul 20, 2017
e00a960
Fix lint issues
joykare Jul 20, 2017
21b3cdb
Fix table moving up and down
joykare Jul 20, 2017
672c007
Fix conflicts with base branch
Jul 20, 2017
f18df54
Merge branch 'joykare-orders-listview-2323' into kieha-select-orders-…
Jul 20, 2017
59066e8
Modify list component to receive className, change undefined data to …
Jul 20, 2017
43d5d74
Bulk order actions button list onClick
Jul 20, 2017
01cdc15
Toggle background color and icons on list items click
Jul 21, 2017
84e3ab0
Further styling of shipping list
Jul 21, 2017
f303673
Remove hardcoded styles in the table
Jul 21, 2017
3b9fcf2
remove order actions files not being used anymore(might be reason for…
joykare Jul 21, 2017
3c81615
Prefer this.props over long destructuring statement
Jul 21, 2017
6331480
Merge branch 'kieha-select-orders-2325' into kieha-bulk-order-status-…
Jul 21, 2017
3b18108
Select Orders from main orders screen (#2549)
Jul 21, 2017
3db5597
Merge in main order-list-view branch
Jul 21, 2017
ffebdd0
Final styling of shipping list
Jul 24, 2017
adefa91
Final styling of shipping list
Jul 24, 2017
b4af025
Iteration 1 of order select and set status
Jul 25, 2017
ab31de3
First working instance for new Orders detail view
joykare Jul 26, 2017
0edf42b
Refactor code
joykare Jul 26, 2017
5c3deba
Wrap up on styling
joykare Jul 26, 2017
37d07b4
Fix broken bulk order select
joykare Jul 26, 2017
0c77e32
Merge branch 'marketplace' into joykare-orders-listview-2323
joykare Jul 26, 2017
c1e0633
Fix header padding
joykare Jul 26, 2017
1e4a12f
Iteration 2 of order select and set status
Jul 26, 2017
0a5dcfc
Merge marketplace changes
Jul 28, 2017
182cdc5
Merge changes from parent branch; code edits
Jul 28, 2017
b8a2e92
Fix toggle of shipping flow list, rename labels
Jul 28, 2017
f8cbd95
Merge branch 'marketplace' into joykare-orders-listview-2323
brent-hoover Jul 30, 2017
09f04be
Merge branch 'joykare-orders-listview-2323' into kieha-bulk-order-sta…
Jul 31, 2017
6777666
Create back end methods for labeled and picked shipping statuses, ref…
Jul 31, 2017
da73d48
Implement skipping flow statuses
Jul 31, 2017
b6c224f
Add event to order history showing bulk action state setting
Jul 31, 2017
1af4b6b
Remove bulk order bar on orders detail view
joykare Jul 31, 2017
816bd3d
Merge branch 'joykare-orders-listview-2323' into kieha-bulk-order-sta…
Jul 31, 2017
0600ce5
Merge branch 'marketplace' into joykare-orders-listview-2323
joykare Jul 31, 2017
7432962
Merge branch 'joykare-orders-listview-2323' into kieha-bulk-order-sta…
Jul 31, 2017
cfe7b00
Fix lint error
Jul 31, 2017
999231a
Merge branch 'joykare-orders-listview-2323' into kieha-bulk-order-sta…
Jul 31, 2017
4d4d336
Fix moving table
Jul 31, 2017
98d5dc7
Break down shippingStatus function into smaller functions
Jul 31, 2017
aacebe1
Reorder shipping flow
Jul 31, 2017
9a8c92f
Fix merge conflicts
Jul 31, 2017
8ce785e
Set bulk selected orders to a specific state (iteration 1)
Aug 1, 2017
a8b1aa3
Merge branch 'marketplace' into kieha-bulk-order-status-2341
Aug 1, 2017
24d4ae5
Remove unnecessary ordersContainer
Aug 1, 2017
03e7317
Refactor repeated code into common function that's re-usable
Aug 1, 2017
6633579
Remove unnecessary method binding
Aug 1, 2017
ed15acd
Set multiple orders to labeled state
Aug 2, 2017
df28375
Provide optional shipped param to shipmentShipped method
Aug 2, 2017
711a526
Set multiple orders to shipped state
Aug 2, 2017
3c05af4
Move bulk actions bar code to it's own component
Aug 2, 2017
6c8f08b
Add allowOutsideClick and cancelButtonText as alert options
Aug 2, 2017
e15f625
Document and add comments for shipping methods
Aug 2, 2017
cb9bfcb
Use reaction color variables over hardcoded colors
Aug 2, 2017
d736644
Oops
Aug 2, 2017
a5a8901
Delay success modal until all orders' state has been set
Aug 3, 2017
fb566c4
Fix interchanged states
Aug 3, 2017
5513bba
Merge branch 'marketplace' into kieha-bulk-order-status-2341
Aug 4, 2017
5561e57
Translation (part 1)
Aug 4, 2017
b456aec
Merge branch 'kieha-bulk-order-status-2341' of https://github.com/rea…
Aug 4, 2017
c743187
Correct i18nKeyLabel typo
Aug 4, 2017
e270c06
Translation (part 2), extract alerts to common function that's reusable
Aug 4, 2017
1f1907e
Merge branch 'marketplace' into kieha-bulk-order-status-2341
Aug 4, 2017
8246459
Merge branch 'marketplace' into kieha-bulk-order-status-2341
brent-hoover Aug 6, 2017
6a148fa
Standardise case in translation key
Aug 7, 2017
6a1d4d9
Fix typo in comment
Aug 7, 2017
b05fd6e
Remove testing of truthiness of order object, prefer 'check' of object
Aug 7, 2017
f2c4802
Move shipping string states to constant
Aug 7, 2017
263eb22
Remove unneeded call to shop for currency display
Aug 7, 2017
97cc49a
Merge branch 'kieha-bulk-order-status-2341' of https://github.com/rea…
Aug 7, 2017
2c80e65
Standardise naming of shipping flow steps
Aug 7, 2017
333ed7a
Rethink wording of alerts
Aug 7, 2017
426d7b3
Merge branch 'marketplace' into kieha-bulk-order-status-2341
Aug 9, 2017
2ce2523
Merge branch 'marketplace' into kieha-bulk-order-status-2341
Aug 10, 2017
cd81d1d
Use workflow object to store/determine shipping status (part 1)
Aug 10, 2017
b649bce
Remove shipping booleans from shipping schema
Aug 10, 2017
e08f839
Rewrite shipping status methods to fit use of workflow status (part 1)
Aug 10, 2017
cf524d8
Merge branch 'marketplace' into kieha-bulk-order-status-2341
Aug 11, 2017
c1bba88
Merge branch 'marketplace' into kieha-bulk-order-status-2341
Aug 14, 2017
95d962c
Merge branch 'marketplace' into kieha-bulk-order-status-2341
Aug 14, 2017
e729461
Rewrite shipping status methods to fit use of workflow status (part 2)
Aug 14, 2017
29ca951
Tests for orders/shipmentPicked and orders/shipmentLabeled; tweak tes…
Aug 14, 2017
f7caaed
Import order
Aug 14, 2017
dbfd24b
Merge branch 'marketplace' into kieha-bulk-order-status-2341
Aug 15, 2017
444405c
Remove unnecessary closing brace
Aug 15, 2017
f1f6260
Render spinner while waiting for action on bulk orders
Aug 15, 2017
d46245d
UI consistency when selecting bulk actions
Aug 15, 2017
7e908b5
Show bottom pagination on bulk orders select
Aug 15, 2017
bf46c0c
Merge branch 'marketplace' into kieha-bulk-order-status-2341
Aug 15, 2017
a21497b
Implement regression alert
Aug 15, 2017
bc9dc81
Merge branch 'kieha-bulk-order-status-2341' of https://github.com/rea…
Aug 16, 2017
da20f96
Refine regression alert
Aug 16, 2017
d981b9c
Commenting shipping state methods
Aug 16, 2017
2cdc1ad
remove deprecated use of number as first argument of Meteor.Error
Aug 16, 2017
7239bde
Switch order of shipping flow checks
Aug 16, 2017
a7fdb4e
Tweak 'picked' status regression method
Aug 16, 2017
39c9348
Merge branch 'marketplace' into kieha-bulk-order-status-2341
Aug 16, 2017
dff2ee5
Fix line length
Aug 17, 2017
dc73ba1
Rename variable
Aug 17, 2017
487b97f
Add back missing 'Processing' translation
Aug 17, 2017
79f9034
Fix random opening of status bar
Aug 17, 2017
993ca17
Use props as passed down from parent container
Aug 17, 2017
e4ce99d
Merge branch 'marketplace' into kieha-bulk-order-status-2341
Aug 17, 2017
09917fe
Merge branch 'marketplace' into kieha-bulk-order-status-2341
Aug 18, 2017
ea2131b
Turn all avatars to checkboxes on order select
Aug 18, 2017
ec80a2d
Add printing step to flow list
Aug 18, 2017
6dc056f
Merge branch 'kieha-bulk-order-status-2341' of https://github.com/rea…
Aug 18, 2017
2e63b52
Enable Capture button
Aug 21, 2017
c76d9d3
Merge branch 'marketplace' into kieha-bulk-order-status-2341
Aug 23, 2017
63aa52a
Set loading state of captore button to false on error
Aug 23, 2017
ab35062
Rename file names
Aug 23, 2017
678321d
Fix error on payment approving
Aug 23, 2017
1748247
Fix conflicts with marketplace branch
Aug 24, 2017
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
179 changes: 179 additions & 0 deletions imports/plugins/core/orders/client/components/orderBulkActionsBar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
import React, { Component } from "react";
import PropTypes from "prop-types";
import { Translation, Checkbox, Button, Icon, List, ListItem } from "@reactioncommerce/reaction-ui";

class OrderBulkActionsBar extends Component {
static propTypes = {
isLoading: PropTypes.object,
multipleSelect: PropTypes.bool,
orders: PropTypes.array,
renderFlowList: PropTypes.bool,
selectAllOrders: PropTypes.func,
selectedItems: PropTypes.array,
setShippingStatus: PropTypes.func,
shipping: PropTypes.object
};

constructor(props) {
super(props);
this.state = {
renderFlowList: props.renderFlowList,
shipping: props.shipping,
isLoading: props.isLoading
};
}

componentWillReceiveProps = (nextProps) => {
this.setState({
shipping: nextProps.shipping,
isLoading: nextProps.isLoading,
renderFlowList: nextProps.renderFlowList
});
}

toggleShippingFlowList = () => {
this.setState({
renderFlowList: !this.state.renderFlowList
});
this.setListItemsToDefault();
}

renderLoadingSpinner(status) {
return this.state.isLoading[status] ?
<Icon className="bulk-actions-icons-select" icon="fa fa-spinner fa-pulse" />
:
<Icon className="bulk-actions-icons-select" icon="fa fa-circle-o"/>;
}

renderShippingFLowList() {
if (this.state.renderFlowList) {
return (
<List className="shipping-flow-list">
<ListItem
label={this.state.shipping.picked ? "Generate Picking Report" : "Picked"}
i18nKeyLabel={this.state.shipping.picked ? "order.generatePickingReport" : "order.picked"}
value="picked"
onClick={this.handleListItemClick}
listItemClassName={this.state.shipping.picked ? "selected" : ""}
>
{this.state.shipping.picked ?
<div>
<Icon className="bulk-actions-icons" icon="fa fa-print"/>
<Icon className="bulk-actions-icons-select" icon="fa fa-check"/>
</div>
:
this.renderLoadingSpinner("picked")
}
</ListItem>
<ListItem
label="Packed"
i18nKeyLabel="order.packed"
value="packed"
onClick={this.handleListItemClick}
listItemClassName={this.state.shipping.packed ? "selected" : ""}
>
{this.state.shipping.packed ?
<Icon className="bulk-actions-icons-select" icon="fa fa-check"/>
:
this.renderLoadingSpinner("packed")
}
</ListItem>
<ListItem
label={this.state.shipping.labeled ? "Generate Label" : "Labeled"}
i18nKeyLabel={this.state.shipping.labeled ? "order.generateLabel" : "order.labeled"}
value="labeled"
onClick={this.handleListItemClick}
listItemClassName={this.state.shipping.labeled ? "selected" : ""}
>
{this.state.shipping.labeled ?
<div>
<Icon className="bulk-actions-icons" icon="fa fa-print"/>
<Icon className="bulk-actions-icons-select" icon="fa fa-check"/>
</div>
:
this.renderLoadingSpinner("labeled")
}
</ListItem>
<ListItem
label="Shipped"
i18nKeyLabel="order.shipped"
value="shipped"
onClick={this.handleListItemClick}
listItemClassName={this.state.shipping.shipped ? "selected" : ""}
>
{this.state.shipping.shipped ?
<div>
<Icon className="bulk-actions-icons" icon="fa fa-paper-plane-o" />
<Icon className="bulk-actions-icons-select" icon="fa fa-check"/>
</div>
:
this.renderLoadingSpinner("shipped")
}
</ListItem>
</List>
);
}
}

handleListItemClick = (event, value) => {
if (this.props.setShippingStatus) {
this.props.setShippingStatus(value, this.props.selectedItems);
}
}

setListItemsToDefault() {
if (this.state.renderFlowList === false) {
this.setState({
shipping: {
picked: false,
packed: false,
labeled: false,
shipped: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work if there is a shipping workflow that has additional or fewer steps?

}
});
}
}

render() {
const { orders, multipleSelect, selectedItems, selectAllOrders } = this.props;

if (selectedItems.length > 0) {
return (
<div className="bulk-order-actions-bar">
<Checkbox
className="checkbox-large orders-checkbox"
checked={selectedItems.length === orders.length || multipleSelect}
name="orders-checkbox"
onChange={() => selectAllOrders(orders, (selectedItems.length === orders.length || multipleSelect))}
/>
<Translation
className="selected-orders"
defaultValue={`${selectedItems.length} Selected`}
i18nKey={`${selectedItems.length} order.selected`}
/>
<Button
status="success"
bezelStyle="solid"
className="capture-orders-button"
label="Capture"
i18nKeyLabel="order.capture"
/>
<Button
status="default"
bezelStyle="solid"
className="bulk-actions-button"
label="Bulk Actions"
i18nKeyLabel="order.bulkActions"
icon="fa fa-chevron-down"
iconAfter={true}
onClick={this.toggleShippingFlowList}
/>
{this.renderShippingFLowList()}
</div>
);
}
return null;
}
}

export default OrderBulkActionsBar;
11 changes: 10 additions & 1 deletion imports/plugins/core/orders/client/components/orderList.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ class OrdersList extends Component {
displayMedia: PropTypes.func,
handleClick: PropTypes.func,
handleSelect: PropTypes.func,
isLoading: PropTypes.object,
multipleSelect: PropTypes.bool,
orders: PropTypes.array,
renderFlowList: PropTypes.bool,
selectAllOrders: PropTypes.func,
selectedItems: PropTypes.array
selectedItems: PropTypes.array,
setShippingStatus: PropTypes.func,
shipping: PropTypes.object

}

state = {
Expand Down Expand Up @@ -66,6 +71,10 @@ class OrdersList extends Component {
selectAllOrders={this.props.selectAllOrders}
displayMedia={this.props.displayMedia}
isOpen={this.state.openList}
shipping={this.props.shipping}
setShippingStatus={this.props.setShippingStatus}
isLoading={this.props.isLoading}
renderFlowList={this.props.renderFlowList}
/>
</div>
</div>
Expand Down
86 changes: 25 additions & 61 deletions imports/plugins/core/orders/client/components/orderTable.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import React, { Component } from "react";
import PropTypes from "prop-types";
import { Orders } from "/lib/collections";
import { SortableTable, Loading, Checkbox } from "@reactioncommerce/reaction-ui";
import OrderTableColumn from "./orderTableColumn";

import classnames from "classnames/dedupe";
import Avatar from "react-avatar";
import moment from "moment";
import classnames from "classnames/dedupe";
import { Badge, ClickToCopy, Icon, Translation, Checkbox, Loading, SortableTable } from "@reactioncommerce/reaction-ui";
import { Orders } from "/lib/collections";
import OrderTableColumn from "./orderTableColumn";
import OrderBulkActionsBar from "./orderBulkActionsBar";
import { formatPriceString } from "/client/api";
import { Badge, ClickToCopy, Icon, Translation, Button } from "@reactioncommerce/reaction-ui";
import ProductImage from "./productImage";

const classNames = {
Expand Down Expand Up @@ -39,11 +38,15 @@ class OrderTable extends Component {
displayMedia: PropTypes.func,
handleClick: PropTypes.func,
handleSelect: PropTypes.func,
isLoading: PropTypes.object,
isOpen: PropTypes.bool,
multipleSelect: PropTypes.bool,
orders: PropTypes.array,
renderFlowList: PropTypes.bool,
selectAllOrders: PropTypes.func,
selectedItems: PropTypes.array
selectedItems: PropTypes.array,
setShippingStatus: PropTypes.func,
shipping: PropTypes.object
}

/**
Expand All @@ -67,15 +70,6 @@ class OrderTable extends Component {
return "default";
}

/**
* Shipping Badge
* TODO: any logic here, we don't have shipping status changes at the moment
* @return {string} A string containing the type of Badge
*/
shippingBadgeStatus() {
return "basic";
}

renderOrderButton(order) {
const startWorkflow = order.workflow.status === "new";
const classes = classnames({
Expand Down Expand Up @@ -156,7 +150,7 @@ class OrderTable extends Component {
badgeSize="large"
i18nKeyLabel={`cartDrawer.${order.shipping[0].workflow.status}`}
label={order.shipping[0].workflow.status}
status={this.shippingBadgeStatus(order)}
status="basic"
/>
<Badge
badgeSize="large"
Expand Down Expand Up @@ -189,44 +183,6 @@ class OrderTable extends Component {
);
}

renderBulkOrderActionsBar = () => {
const { orders, multipleSelect, selectedItems, selectAllOrders } = this.props;

if (selectedItems.length > 0) {
return (
<div className="bulk-order-actions-bar">
<Checkbox
className="checkbox-large orders-checkbox"
checked={selectedItems.length === orders.length || multipleSelect}
name="orders-checkbox"
onChange={() => selectAllOrders(orders, (selectedItems.length === orders.length || multipleSelect))}
/>
<Translation
className="selected-orders"
defaultValue={`${selectedItems.length} Selected`}
i18nKey={`${selectedItems.length} order.selected`}
/>
<Button
status="success"
bezelStyle="solid"
className="capture-orders-button"
label="Capture"
i18nKeyLabel="order.capture"
/>
<Button
status="default"
bezelStyle="solid"
className="bulk-actions-button"
label="Bulk Actions"
i18nKeyLabel="order.bulkActions"
icon="fa fa-chevron-down"
iconAfter={true}
/>
</div>
);
}
}

render() {
let getTrProps = undefined;
let getTheadProps = undefined;
Expand Down Expand Up @@ -308,7 +264,6 @@ class OrderTable extends Component {
handleSelect={this.props.handleSelect}
selectedItems={this.props.selectedItems}
fulfillmentBadgeStatus={this.fulfillmentBadgeStatus}
shippingBadgeStatus={this.shippingBadgeStatus}
/>
)
};
Expand Down Expand Up @@ -350,7 +305,18 @@ class OrderTable extends Component {

return (
<div>
{this.props.isOpen && this.renderBulkOrderActionsBar()}
{this.props.isOpen &&
<OrderBulkActionsBar
shipping={this.props.shipping}
multipleSelect={this.props.multipleSelect}
orders={this.props.orders}
selectAllOrders={this.props.selectAllOrders}
selectedItems={this.props.selectedItems}
setShippingStatus={this.props.setShippingStatus}
isLoading={this.props.isLoading}
renderFlowList={this.props.renderFlowList}
/>
}
<SortableTable
tableClassName={`rui order table -highlight ${this.props.selectedItems.length > 0 ?
"table-header-hidden" :
Expand All @@ -368,13 +334,11 @@ class OrderTable extends Component {
getTrGroupProps={getTrGroupProps}
getPaginationProps={() => {
return {
className: this.props.isOpen && this.props.selectedItems.length > 0 ?
"order-table-pagination-hidden" :
"order-table-pagination-visible"
className: "order-table-pagination-visible"
};
}}
getTableProps={getTableProps}
showPaginationTop={true}
showPaginationTop={this.props.selectedItems.length ? false : true}
/>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ class OrderTableColumn extends Component {
handleClick: PropTypes.func,
handleSelect: PropTypes.func,
row: PropTypes.object,
selectedItems: PropTypes.array,
shippingBadgeStatus: PropTypes.func
selectedItems: PropTypes.array
}

render() {
const { row, selectedItems, handleClick, handleSelect, fulfillmentBadgeStatus, shippingBadgeStatus } = this.props;
const { row, selectedItems, handleClick, handleSelect, fulfillmentBadgeStatus } = this.props;
const columnAccessor = row.column.id;

if (columnAccessor === "shipping[0].address.fullName") {
Expand Down Expand Up @@ -80,7 +79,7 @@ class OrderTableColumn extends Component {
badgeSize="large"
i18nKeyLabel={`cartDrawer.${row.value}`}
label={row.value}
status={shippingBadgeStatus()}
status="basic"
/>
);
}
Expand Down
Loading