-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb76ba9
commit fe2e4fc
Showing
23 changed files
with
185 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
app/assets/javascripts/components/checkout/payment-list.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
class PaymentList extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.state = { | ||
payments: [] | ||
} | ||
} | ||
|
||
renderPayments() { | ||
|
||
} | ||
|
||
render() { | ||
return ( | ||
<div className='payment-list'> | ||
<ul> | ||
<li> | ||
<div>From</div> | ||
</li> | ||
</ul> | ||
</div> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
class ItemRequesters extends React.Component { | ||
static propTypes = { | ||
users: React.PropTypes.array, | ||
requesterIds: React.PropTypes.array, | ||
editable: React.PropTypes.bool, | ||
index: React.PropTypes.number | ||
} | ||
|
||
static defaultProps = { | ||
editable: false | ||
} | ||
|
||
constructor(props) { | ||
super(props); | ||
} | ||
|
||
render() { | ||
const { users, requesterIds, index } = this.props; | ||
const requesterImages = users.filter(user => requesterIds.includes(user.id)) | ||
.map(user => { | ||
const { id, image } = user; | ||
return <img key={`requester-${index}-${id}`} src={image} /> | ||
}); | ||
return ( | ||
<div className='item-requesters'> | ||
{requesterImages} | ||
</div> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,10 @@ | |
clear: both; | ||
} | ||
|
||
.card { | ||
margin: 0; | ||
} | ||
|
||
ul { | ||
max-height: 24rem; | ||
overflow: auto; | ||
|
2 changes: 1 addition & 1 deletion
2
.../components/itemlist/itemlist_editor.scss → ...onents/itemlist/itemlist-item-editor.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.itemlist-editor { | ||
.itemlist-item-editor { | ||
.estimated { | ||
padding: 3px; | ||
border-radius: 2px; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
class GroceriesItemsPayments < ApplicationRecord | ||
belongs_to :groceries_items | ||
belongs_to :payments | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
class GroceriesItemsUsers < ApplicationRecord | ||
belongs_to :groceries_item | ||
belongs_to :user | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.container.groceries-checkout | ||
.row | ||
.col.l10.offset-l1 | ||
.col.l12 | ||
= react_component 'Checkout', @checkout_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class AddItemsToPayments < ActiveRecord::Migration[5.0] | ||
def change | ||
create_join_table :groceries_items, :payments do |t| | ||
t.index :payment_id | ||
t.index :groceries_item_id | ||
end | ||
end | ||
end |
10 changes: 10 additions & 0 deletions
10
db/migrate/20170430221919_add_multiple_requesters_to_groceries_items.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class AddMultipleRequestersToGroceriesItems < ActiveRecord::Migration[5.0] | ||
def change | ||
create_join_table :groceries_items, :users do |t| | ||
t.index :user_id | ||
t.index :groceries_item_id | ||
end | ||
|
||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class RenameGroceriesItemsColumns < ActiveRecord::Migration[5.0] | ||
def change | ||
rename_column :groceries_items_users, :groceries_item_id, :groceries_items_id | ||
rename_column :groceries_items_payments, :groceries_item_id, :groceries_items_id | ||
end | ||
end |
11 changes: 11 additions & 0 deletions
11
db/migrate/20170430232621_migrate_groceries_items_requesters_to_multiple_model.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class MigrateGroceriesItemsRequestersToMultipleModel < ActiveRecord::Migration[5.0] | ||
def change | ||
GroceriesItems.all.each do |groceries_item| | ||
if requester_id = groceries_item.requester_id | ||
groceries_item.requesters << User.find(requester_id) | ||
end | ||
end | ||
|
||
remove_column :groceries_items, :requester_id | ||
end | ||
end |
Oops, something went wrong.