WIP: Implement shortcuts
Signed-off-by: William Brawner <me@wbrawner.com>
This commit is contained in:
parent
6c15da8b35
commit
8d0d919ba8
3 changed files with 23 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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" }]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue