Skip to content
Open
Show file tree
Hide file tree
Changes from 97 commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
3de6ee8
Line items to camelCase
retgoat Apr 13, 2017
71ee589
Merge remote-tracking branch 'origin/master' into feature/pull_amazon…
Diokuz Apr 14, 2017
04496e1
add route
Diokuz Apr 13, 2017
f15e2d7
Wrap paymentMethods with list
retgoat Apr 17, 2017
43259f8
Add Amazon order and payload
retgoat Apr 10, 2017
13db211
Add response, routes and service
retgoat Apr 11, 2017
6664280
Fix Errors
retgoat Apr 11, 2017
49b52f5
Make order creation idempotent
retgoat Apr 11, 2017
082864f
Fix routes and response
retgoat Apr 11, 2017
25803a3
Add amazon_order_search_view and stuff
retgoat Apr 12, 2017
1f28d25
Fix seeds to run in development env
retgoat Apr 12, 2017
85c957c
Remove unused stuff
retgoat Apr 12, 2017
38593b7
Fix GR mapping
retgoat Apr 12, 2017
f504a9d
Fix typo
retgoat Apr 12, 2017
431ac3d
Fix typo
retgoat Apr 12, 2017
487d2f4
Add update action to AmazonOrder
retgoat Apr 13, 2017
8e9efbb
Revert greenriver changes
retgoat Apr 14, 2017
55c3091
Extend order and add triggers
retgoat Apr 14, 2017
6d63447
Make seeds run in test env
retgoat Apr 17, 2017
53e00d9
add flow to order
Diokuz Apr 14, 2017
494f379
add amazon order subroute
Diokuz Apr 17, 2017
1428b1a
fix some unused vars
Diokuz Apr 17, 2017
f93caf7
Merge pull request #1456 from FoxComm/add_amazon_order
tonypizzicato Apr 18, 2017
8240087
cr fixes
Diokuz Apr 18, 2017
04e7717
Store amazon orders and customers to phoenix
retgoat Apr 18, 2017
d2a4593
Fix get_scope function
retgoat Apr 18, 2017
e1209cd
add isAmazon for row
Diokuz Apr 18, 2017
0e49eaa
back watchers endpoint
Diokuz Apr 18, 2017
27d3f93
Fix typo and trigger
retgoat Apr 18, 2017
ae1fa6d
Merge pull request #1492 from FoxComm/add/amazon-order-route
tonypizzicato Apr 18, 2017
e43cbca
Merge pull request #1519 from FoxComm/pull_worker
tonypizzicato Apr 18, 2017
d55e3b6
add amazon order assinments management
tonypizzicato Apr 18, 2017
b8666b1
add amazonOrder dimension
tonypizzicato Apr 18, 2017
f7d4ba8
Merge pull request #1523 from FoxComm/feature/amazon-order-assignments
tonypizzicato Apr 18, 2017
8565436
Add customer to amazon orders
retgoat Apr 20, 2017
001607a
Rename migration file
retgoat Apr 20, 2017
c52cff7
Alter amazon_orders table
retgoat Apr 20, 2017
a2bd68b
Fix migration
retgoat Apr 20, 2017
3234333
CodeReview and rename mistyped migration
retgoat Apr 21, 2017
6864731
Fix tests. We do not need order_id in returns search view
retgoat Apr 21, 2017
fe20835
Remove comments
retgoat Apr 21, 2017
c6768ee
Add Integration tests
retgoat Apr 24, 2017
db39bdd
Merge pull request #1555 from FoxComm/add_customer_to_amazon_order
tonypizzicato Apr 24, 2017
5264dff
Merge branch 'master' into feature/pull_amazon_orders
retgoat Apr 24, 2017
d6d172d
Fix orders_search_view triggers
retgoat Apr 26, 2017
91cda79
Implemet first run
retgoat Apr 28, 2017
71852b8
Make function private
retgoat Apr 28, 2017
b099a29
Add newline
retgoat Apr 28, 2017
00f42b6
fix tests
tonypizzicato Apr 28, 2017
e1be943
add missing trait
tonypizzicato Apr 28, 2017
77c60d1
Merge pull request #1638 from FoxComm/pull_worker_update
retgoat Apr 28, 2017
afec61f
Merge from master
mbektimirov May 1, 2017
3482755
Fixed flow error
mbektimirov May 1, 2017
6cd1b21
Bump sql versions
May 1, 2017
5a776c6
Update orders fetcher
retgoat May 2, 2017
bb275bf
Fix seeder image
retgoat May 2, 2017
8f4638c
Prevent fail if no SKU in phoenix
retgoat May 2, 2017
0235eec
Fix tabernacle ENV var
retgoat May 2, 2017
dfb3e96
Fix customer creation
retgoat May 2, 2017
4ab972c
Fix hyperion tests
retgoat May 2, 2017
8dad0d5
Workers are only available in test
retgoat May 2, 2017
dc8110a
Merge branch 'master' into feature/pull_amazon_orders
tonypizzicato May 2, 2017
49aaf1e
remove primarySearchTerm for amazon order
tonypizzicato May 2, 2017
b98b80f
Fix tests
retgoat May 2, 2017
8e04455
Merge branch 'master' into feature/pull_amazon_orders
tonypizzicato May 2, 2017
a6e0b6a
bump sql versions
tonypizzicato May 2, 2017
2316bc8
Change phoenix url
retgoat May 2, 2017
bbc2c2c
Remove unused func
retgoat May 2, 2017
db4fe92
Merge pull request #1662 from FoxComm/phoenix_url_refactoring
tonypizzicato May 2, 2017
2103073
Update categories csv
retgoat May 3, 2017
d5d70f5
Workaround for images
retgoat May 4, 2017
29fa251
Remove unused stuff
retgoat May 4, 2017
1aa59cc
Merge pull request #1690 from FoxComm/fix_images_feed
tonypizzicato May 4, 2017
2ad5c96
Fetch customer by email
retgoat May 4, 2017
7165765
Use another failure
retgoat May 4, 2017
ee945d8
Fix routes and reuse code
retgoat May 4, 2017
bf6f5aa
Apply CR comments
retgoat May 4, 2017
972a143
camelCase method
retgoat May 4, 2017
d022092
Merge pull request #1695 from FoxComm/customer_by_email
May 4, 2017
60c238c
Add customer from phoenix to full order
retgoat May 5, 2017
72fff47
Add images for amazon wiki
retgoat May 5, 2017
18a8fa7
Revert "Add images for amazon wiki"
retgoat May 5, 2017
797bec0
Merge pull request #1711 from FoxComm/customer_in_amazon_order
tonypizzicato May 5, 2017
080ec0b
Merge branch 'master' into feature/pull_amazon_orders
tonypizzicato May 10, 2017
56afd19
fix build
tonypizzicato May 10, 2017
ce4fe6e
fix sql versions
tonypizzicato May 10, 2017
a8cd5b8
Merge branch 'master' into feature/pull_amazon_orders
tonypizzicato May 31, 2017
12d6880
fix flow&lint
tonypizzicato May 31, 2017
8b1ae58
drop orderId from ReturnsSearchViewResult
tonypizzicato Jun 1, 2017
fd60b76
Fix all orders integration test
retgoat Jun 1, 2017
dd29d9c
Update update_orders_view_from_orders_update_fn function
retgoat Jun 1, 2017
7ae419a
Revert "Update update_orders_view_from_orders_update_fn function"
retgoat Jun 1, 2017
d628912
Fix migrations
retgoat Jun 1, 2017
40fed5d
Apply CR comments WIP
retgoat Jun 5, 2017
e5452b8
Refactor AmazonOrders
retgoat Jun 5, 2017
9eb37e7
Update api-docs
retgoat Jun 6, 2017
339efa1
Add description
retgoat Jun 6, 2017
cd61f95
Merge commit 'f0856654f5c9e38d354b768cd9bb9dfeef77588c' into feature/…
Jun 7, 2017
8e4e8cc
Scalafmt run
Jun 7, 2017
0752459
Merge remote-tracking branch 'origin' into feature/pull_amazon_orders
Jun 7, 2017
4abecf9
Cleanup after merge
Jun 7, 2017
02c4d60
Merge branch 'master' into feature/pull_amazon_orders
tonypizzicato Jun 12, 2017
97537e3
Fix description
retgoat Jun 6, 2017
c2d4586
Fix customer email test
Jun 13, 2017
bec7053
Merge branch 'master' of github.com:FoxComm/highlander into feature/p…
Jun 13, 2017
f57bf58
fix hyperion marathon group config
tonypizzicato Jun 13, 2017
5634138
Merge branch 'master' into feature/pull_amazon_orders
tonypizzicato Jun 21, 2017
c6d9263
update sql versions
tonypizzicato Jun 21, 2017
038cee5
fix tests
tonypizzicato Jun 21, 2017
323a263
fix type in ashes
tonypizzicato Jun 21, 2017
7e666b9
fix phoenix client amazon-orders path
tonypizzicato Jun 21, 2017
1ea9a98
fix amazon entities rendering
tonypizzicato Jun 27, 2017
80d9780
more fixes for order payments
tonypizzicato Jun 27, 2017
dab8555
Merge branch 'master' into feature/pull_amazon_orders
tonypizzicato Jun 28, 2017
b94816f
fix route for order on customer transactions page
tonypizzicato Jun 28, 2017
163dfe0
fix flow
tonypizzicato Jun 28, 2017
094b285
Merge branch 'master' into feature/pull_amazon_orders
tonypizzicato Jul 6, 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
2 changes: 1 addition & 1 deletion ashes/src/components/common/state.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const states = {
const State = (props): Element<*> => {
return (
<span id={props.stateId} className="fc-model-state">
{get(states, [props.model, props.value], '[Invalid]')}
{get(states, [props.model, props.value], props.value)}
</span>
);
};
Expand Down
52 changes: 22 additions & 30 deletions ashes/src/components/customer-card/customer-card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,12 @@ import TextFit from 'components/text-fit/text-fit';
import styles from 'components/customers/title-block.css';

type Props = {
customer: {
id: number,
name: string,
email: string,
isGuest: boolean,
groups: Array<string>,
avatarUrl?: string,
rank: number,
phoneNumber: string,
location: string,
},
customer: Customer,
};

export default class CustomerInfo extends Component {
props: Props;

ensureNotEmpty(val: number|string) {
return val ? <span>{val}</span> : <span>&nbsp;</span>;
}

customerLink(text: string) {
const params = { customerId: this.props.customer.id };

Expand All @@ -48,7 +34,7 @@ export default class CustomerInfo extends Component {
</div>
);
} else {
return <div>None</div>;
return <div styleName="value">None</div>;
}
}

Expand All @@ -61,7 +47,7 @@ export default class CustomerInfo extends Component {
if (customer.avatarUrl) {
avatar = <img src={customer.avatarUrl} />;
} else {
avatar = <i className="icon-customer"></i>;
avatar = <i className="icon-customer" />;
}

return (
Expand All @@ -88,20 +74,26 @@ export default class CustomerInfo extends Component {
</div>
<article styleName="body">
<ul styleName="fields">
<li>
<i className="icon-customer"></i>
<div>{this.ensureNotEmpty(customer.id)}</div>
</li>
<li>
<i className="icon-phone"></i>
<div>{this.ensureNotEmpty(customer.phoneNumber)}</div>
</li>
<li>
<i className="icon-location"></i>
<div>{this.ensureNotEmpty(customer.location)}</div>
</li>
{customer.id &&
<li>
<i className="icon-customer" />
<div styleName="value">{customer.id}</div>
</li>
}
{customer.phoneNumber &&
<li>
<i className="icon-phone" />
<div styleName="value">{customer.phoneNumber}</div>
</li>
}
{customer.location &&
<li>
<i className="icon-location" />
<div styleName="value">{customer.location}</div>
</li>
}
<li styleName="groups">
<i className="icon-customers"></i>
<i className="icon-customers" />
{this.customerGroups}
</li>
</ul>
Expand Down
19 changes: 13 additions & 6 deletions ashes/src/components/customers/title-block.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,32 +96,38 @@
display: inline-block;
width: 50%;

&:only-child {
width: 100%;
}

& > li {
height: 40px;
display: flex;
align-items: center;

& > i {
width: 40px;
font-style: normal;
font-size: 22px;
line-height: 24px;
text-align: center;
color: var(--decor6);
}

&.fc-customer-info-days > i {
margin-right: 8px;
font-size: 15px;
font-weight: 700;
line-height: 20px;
}
}
}

.value {
margin-left: 8px;
width: 90%;
word-wrap: break-word;
}

.group {
padding: 5px 10px;
margin-right: 5px;
margin-bottom: 5px;
margin: 0 5px 5px 8px;
display: inline-block;
vertical-align: top;
font-size: 14px;
Expand All @@ -135,4 +141,5 @@
.guest {
color: var(--decor8);
padding-top: 5px;
margin-left: 8px;
}
6 changes: 3 additions & 3 deletions ashes/src/components/discounts-panel/discounts-panel.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/* @flow */

import React, { Component } from 'react';
Expand All @@ -12,7 +11,7 @@ import TableView from 'components/table/tableview';
import styles from './discounts-panel.css';

type Props = {
promotion: Object,
promotion: ?Object,
};

const viewColumns = [
Expand All @@ -30,11 +29,13 @@ export default class DiscountsPanel extends Component {

get discounts(): Array<Object> {
const { promotion } = this.props;

return promotion ? [promotion] : [];
}

get viewContent() {
const discounts = this.discounts;

if (_.isEmpty(discounts)) {
return <div styleName="empty-message">No discounts applied.</div>;
} else {
Expand All @@ -59,7 +60,6 @@ export default class DiscountsPanel extends Component {
}

render() {

return (
<ContentBox
title={this.title}
Expand Down
5 changes: 5 additions & 0 deletions ashes/src/components/gift-cards/choose-customers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ class ChooseCustomers extends Component {
renderCustomer(item: ItemType) {
// Cast the ItemType to a customer row.
const customer = ((item: any): Customer);

if (!customer.id) {
return null;
}

return <CustomerRow customer={customer} key={customer.id} />;
}

Expand Down
7 changes: 1 addition & 6 deletions ashes/src/components/gift-cards/customer-row.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ import React from 'react';
import { Checkbox } from '../checkbox/checkbox';

type Props = {
customer: {
id: number,
email: string,
phoneNumber?: string,
name: string,
},
customer: Customer,
checked?: boolean,
onToggle?: (id: number) => void,
};
Expand Down
8 changes: 6 additions & 2 deletions ashes/src/components/orders/details.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ export default class OrderDetails extends Component {
<div className="fc-order-details-body">
<div className="fc-order-details-main">
<OrderLineItems order={order} />
<DiscountsPanel promotion={order.promotion} />
<OrderCoupons isCart={false} order={order} />
{order.channel !== 'Amazon.com' &&
<DiscountsPanel promotion={order.promotion} />
}
{order.channel !== 'Amazon.com' &&
<OrderCoupons isCart={false} coupon={order.coupon} />
}
<OrderShippingAddress isCart={false} order={order} />
<OrderShippingMethod isCart={false} order={order} />
<Payments {...this.props} />
Expand Down
19 changes: 5 additions & 14 deletions ashes/src/components/orders/order-coupons.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
/* @flow */

import React, { Component, Element } from 'react';
import _ from 'lodash';
import React, { Component } from 'react';

import ContentBox from 'components/content-box/content-box';
import CouponsPanel from 'components/coupons-panel/coupons-panel';
import PanelHeader from 'components/panel-header/panel-header';

type Props = {
order: {
coupon: Object,
},
coupon: ?Object,
};

const columns = [
Expand All @@ -22,17 +19,11 @@ const columns = [
export default class OrderCoupons extends Component {
props: Props;

get coupons(): Array<Object> {
const coupon = _.get(this.props, 'order.coupon');

if (!coupon) return [];

return [coupon];
}

render() {
const title = <PanelHeader showStatus={false} isOptional={true} text="Coupons" />;
const content = <CouponsPanel coupons={this.coupons} columns={columns} />;
const coupons = this.props.coupon ? [this.props.coupon] : [];
const content = <CouponsPanel coupons={coupons} columns={columns} />;

return (
<ContentBox
title={title}
Expand Down
19 changes: 15 additions & 4 deletions ashes/src/components/orders/order-row.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import _ from 'lodash';

import MultiSelectRow from '../table/multi-select-row';
import OrderParagon from 'paragons/order';

const compileShippingStatus = order => {
if (order.state == 'canceled') {
Expand Down Expand Up @@ -76,19 +77,29 @@ const setCellContents = (order, field) => {
}
};

type Props = {
order: OrderParagon;
columns: Array<*>;
params: Object;
};

const OrderRow = (props, context) => {
const OrderRow = (props: Props) => {
const { order, columns, params } = props;
const key = `order-${order.referenceNumber}`;

// @todo verify isAmazon more strictly and convenient
const email = _.get(order, 'customer.email', '');
const isAmazon = email.endsWith('@marketplace.amazon.com');
const linkTo = isAmazon ? 'amazon-order' : 'order';

return (
<MultiSelectRow
columns={columns}
linkTo="order"
linkTo={linkTo}
linkParams={{order: order.referenceNumber}}
row={order}
setCellContents={setCellContents}
params={params} />
params={params}
/>
);
};

Expand Down
Loading