Skip to content

Commit

Permalink
fix: Invoice UI enhancements (#5223)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamareebjamal authored Oct 2, 2020
1 parent 1f51572 commit f55e82b
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 51 deletions.
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');
});
});

1 comment on commit f55e82b

@vercel
Copy link

@vercel vercel bot commented on f55e82b Oct 2, 2020

Choose a reason for hiding this comment

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

Please sign in to comment.