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

fix: Invoice UI enhancements #5223

Merged
merged 3 commits into from
Oct 2, 2020
Merged
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
5 changes: 0 additions & 5 deletions app/components/ui-table/cell/events/cell-download-invoice.js

This file was deleted.

5 changes: 0 additions & 5 deletions app/components/ui-table/cell/events/cell-event-invoice.js

This file was deleted.

27 changes: 18 additions & 9 deletions app/controllers/account/billing/invoices/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,27 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
cellComponent : 'ui-table/cell/events/cell-download-invoice'
},
{
name : 'Event Name',
valuePath : 'event',
cellComponent : 'ui-table/cell/events/cell-event-invoice'
name : 'Event Name',
valuePath : 'event.name'
},
{
name : 'Date',
valuePath : 'issuedAt',
isSortable : true,
name : 'Invoice Date',
valuePath : 'issuedAt',
isSortable : true,
cellComponent : 'ui-table/cell/cell-date',
options: {
timezone: 'UTC',
dateFormat: 'MMMM DD, YYYY'
options : {
timezone : 'UTC',
dateFormat : 'MMMM DD, YYYY'
}
},
{
name : 'Due Date',
valuePath : 'dueAt',
isSortable : true,
cellComponent : 'ui-table/cell/cell-date',
options : {
timezone : 'UTC',
dateFormat : 'MMMM DD, YYYY'
}
},
{
Expand Down
1 change: 1 addition & 0 deletions app/models/event-invoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default ModelBase.extend({
brand : attr('string'),
createdAt : attr('moment'),
issuedAt : attr('moment'),
dueAt : attr('moment'),
paymentMode : attr('string'),
stripeToken : attr('string'),
last4 : attr('string'),
Expand Down
2 changes: 1 addition & 1 deletion app/routes/account/billing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ export default class extends Route.extend(AuthenticatedRouteMixin) {

beforeModel() {
super.beforeModel(...arguments);
this.replaceWith('account.billing.payment-info');
this.replaceWith('account.billing.invoices');
}
}
18 changes: 0 additions & 18 deletions app/routes/account/billing/invoices/list.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Route from '@ember/routing/route';
import moment from 'moment';
import EmberTableRouteMixin from 'open-event-frontend/mixins/ember-table-route';
import { action } from '@ember/object';
import { capitalize } from 'lodash-es';
Expand All @@ -25,23 +24,6 @@ export default class extends Route.extend(EmberTableRouteMixin) {
val : params.invoice_status
}
];
} else if (params.invoice_status === 'upcoming') {
filterOptions = [
{
and: [
{
name : 'deleted-at',
op : 'eq',
val : null
},
{
name : 'issued-at',
op : 'ge',
val : moment().subtract(30, 'days').toISOString()
}
]
}
];
}


Expand Down
6 changes: 3 additions & 3 deletions app/templates/account/billing.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<div class="row">
<div class="{{if this.device.isMobile 'sixteen' 'three'}} wide column">
<TabbedNavigation @isVertical={{true}}>
<LinkTo @route="account.billing.payment-info" class="item">
{{t 'Payment Information'}}
</LinkTo>
<LinkTo @route="account.billing.invoices" class="item">
{{t 'Invoices'}}
</LinkTo>
<LinkTo @route="account.billing.payment-info" class="item">
{{t 'Payment Information'}}
</LinkTo>
</TabbedNavigation>
</div>
<div class="{{if this.device.isMobile 'sixteen' 'thirteen'}} wide column">
Expand Down
3 changes: 0 additions & 3 deletions app/templates/account/billing/invoices.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
<LinkTo @route="account.billing.invoices.list" @model="paid" class="item">
{{t 'Paid'}}
</LinkTo>
<LinkTo @route="account.billing.invoices.list" @model="upcoming" class="item">
{{t 'Upcoming'}}
</LinkTo>
<LinkTo @route="account.billing.invoices.list" @model="refunding" class="item">
{{t 'Refunding'}}
</LinkTo>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<p> {{this.record}} </p>
<a href="{{this.extraRecords.invoicePdfUrl}}">
<i class="download icon"></i>
<a href="{{@extraRecords.invoicePdfUrl}}" target="_blank" rel="noopener noreferrer">
{{@record}}
</a>

This file was deleted.

3 changes: 3 additions & 0 deletions app/templates/event-invoice/review.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<div class="item">
<strong>{{t 'Date Issued'}}:</strong> {{general-date this.model.issuedAt 'UTC' 'MMMM DD, YYYY'}}
</div>
<div class="item">
<strong>{{t 'Due Date'}}:</strong> {{general-date this.model.dueAt 'UTC' 'MMMM DD, YYYY'}}
</div>
<div class="item">
<strong>{{t 'Total Invoice Amount'}}:</strong> {{currency-symbol this.model.event.paymentCurrency}} {{format-money this.model.amount}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/invoices-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ module('Acceptance | account/billing/invoices', function(hooks) {
test('visiting account/billing/invoices with login', async function(assert) {
await login(assert);
await visit('/account/billing/invoices');
assert.equal(currentURL(), '/account/billing/invoices');
assert.equal(currentURL(), '/account/billing/invoices/all');
});
});