-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add billing information in order view page (#3297)
* add billing information in order view page * fix or implementation
- Loading branch information
1 parent
45b588d
commit 9795fb7
Showing
2 changed files
with
21 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
import Component from '@ember/component'; | ||
import { computed } from '@ember/object'; | ||
import { groupBy } from 'lodash-es'; | ||
import { or } from '@ember/object/computed'; | ||
|
||
export default Component.extend({ | ||
buyer: computed('data.user', function() { | ||
return this.get('data.user'); | ||
}), | ||
holders: computed('data.attendees', function() { | ||
return this.get('data.attendees'); | ||
}), | ||
isPaidOrder: computed('data', function() { | ||
if (!this.get('data.amount')) { | ||
return false; | ||
} | ||
return true; | ||
}), | ||
allFields: computed('fields', function() { | ||
return groupBy(this.fields.toArray(), field => field.get('form')); | ||
}) | ||
}); | ||
export default class extends Component { | ||
@computed('data.user') | ||
get buyer() { | ||
return this.data.user; | ||
} | ||
|
||
@computed('data.attendees') | ||
get holders() { | ||
return this.data.attendees; | ||
} | ||
|
||
@or('data.amount', 'data.isBillingEnabled') | ||
showBillingInfo; | ||
|
||
@computed('fields.@each.form') | ||
get allFields() { | ||
return groupBy(this.fields.toArray(), field => field.form); | ||
} | ||
} |
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