Introduce budget, reimbursements for expenses #195

Merged
raucao merged 57 commits from feature/expenses into master 2021-06-03 14:23:45 +00:00
8 changed files with 75 additions and 3 deletions
Showing only changes of commit ef0fc11edf - Show all commits
@@ -0,0 +1 @@
{{yield}}
+6
View File
@@ -31,5 +31,11 @@ Router.map(function() {
});
this.route('budget', function() {
this.route('expenses');
this.route('reimbursements', function() {});
});
this.route('reimbursements', function() {
this.route('new');
});
});
+9
View File
@@ -0,0 +1,9 @@
import Route from '@ember/routing/route';
export default class ReimbursementsNewRoute extends Route {
model (params) {
return { params };
}
}
@@ -3,7 +3,7 @@ ul.reimbursement-list {
li {
display: grid;
grid-template-columns: auto auto;
grid-template-columns: auto 10rem;
grid-row-gap: 0.5rem;
padding-top: 1.6rem;
+8 -2
View File
@@ -50,8 +50,11 @@
<div id="content">
{{#if this.reimbursementsUnconfirmed}}
<section id="expenses-unconfirmed">
<header>
<header class="with-nav">
<h2>Proposed Reimbursements</h2>
<nav>
<LinkTo @route="reimbursements.new" @title="Submit a reimbursement" class="button small green">add</LinkTo>
</nav>
</header>
<div class="content">
<ReimbursementList @items={{this.reimbursementsUnconfirmed}} />
@@ -61,8 +64,11 @@
{{#if this.reimbursementsConfirmed}}
<section id="expenses-confirmed">
<header>
<header class="with-nav">
<h2>Confirmed Expenses</h2>
<nav>
<LinkTo @route="reimbursements.new" @title="Submit a reimbursement" class="button small green">add</LinkTo>
</nav>
</header>
<div class="content">
<ReimbursementList @items={{this.reimbursementsConfirmed}} />
+13
View File
@@ -0,0 +1,13 @@
<main class="center-column">
<section id="add-item">
<header>
<h2>Submit a reimbursement</h2>
</header>
<div class="content">
<AddReimbursement @attributes={{this.model.params}} />
</div>
</section>
</main>
@@ -0,0 +1,26 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | add-reimbursement', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<AddReimbursement />`);
assert.equal(this.element.textContent.trim(), '');
// Template block usage:
await render(hbs`
<AddReimbursement>
template block text
</AddReimbursement>
`);
assert.equal(this.element.textContent.trim(), 'template block text');
});
});
@@ -0,0 +1,11 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Route | reimbursements/new', function(hooks) {
setupTest(hooks);
test('it exists', function(assert) {
let route = this.owner.lookup('route:reimbursements/new');
assert.ok(route);
});
});