Compare commits

...

1 commit

Author SHA1 Message Date
8d0d919ba8 WIP: Implement shortcuts
Signed-off-by: William Brawner <me@wbrawner.com>
2020-10-02 13:55:38 +00:00
3 changed files with 23 additions and 1 deletions

View file

@ -1,4 +1,4 @@
import { Component, Inject, ApplicationRef } from '@angular/core';
import { Component, Inject, ApplicationRef, ChangeDetectorRef } from '@angular/core';
import { Location } from '@angular/common';
import { User } from './users/user';
import { TWIGS_SERVICE, TwigsService } from './shared/twigs.service';
@ -31,6 +31,7 @@ export class AppComponent {
private activatedRoute: ActivatedRoute,
private appRef: ApplicationRef,
private updates: SwUpdate,
private changeDetector: ChangeDetectorRef,
) {
if (this.cookieService.check('Authorization')) {
this.twigsService.getProfile().subscribe(user => {
@ -82,4 +83,9 @@ export class AppComponent {
this.location.go('/');
});
}
enableBackButton(enable: boolean): void {
this.backEnabled = enable;
this.changeDetector.detectChanges();
}
}

View file

@ -21,6 +21,13 @@
<mat-radio-button [value]="true">Expense</mat-radio-button>
<mat-radio-button [value]="false">Income</mat-radio-button>
</mat-radio-group>
<mat-form-field>
<mat-select placeholder="Budget" [(ngModel)]="currentTransaction.budgetId">
<mat-option *ngFor="let budget of budgets" [value]="budget.id">
{{ budget.title }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Category" [(ngModel)]="currentTransaction.categoryId">
<mat-option *ngFor="let category of categories" [value]="category.id">

View file

@ -95,5 +95,14 @@
"type": "image/png",
"purpose": "maskable"
}
],
"shortcuts": [
{
"name": "Add Transaction",
"short_name": "Add Transaction",
"description": "Add a new transaction",
"url": "/play",
"icons": [{ "src": "/icons/play-later.png", "sizes": "192x192" }]
}
]
}