add navigation to add allowance page
All checks were successful
Backend Build and Test / build (push) Successful in 2m10s
All checks were successful
Backend Build and Test / build (push) Successful in 2m10s
This commit is contained in:
parent
daebcdeccd
commit
c95a9cfbf8
BIN
backend/allowance_planner.db3.backup.2
Normal file
BIN
backend/allowance_planner.db3.backup.2
Normal file
Binary file not shown.
@ -11,7 +11,6 @@ const routes: Routes = [
|
|||||||
path: '',
|
path: '',
|
||||||
loadChildren: () => import('./pages/tabs/tabs.module').then(m => m.TabsPageModule)
|
loadChildren: () => import('./pages/tabs/tabs.module').then(m => m.TabsPageModule)
|
||||||
},
|
},
|
||||||
|
|
||||||
];
|
];
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -6,6 +6,14 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
component: AllowancePage,
|
component: AllowancePage,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: ':id/add',
|
||||||
|
loadChildren: () => import('../edit-allowance/edit-allowance.module').then(m => m.EditAllowancePageModule)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: ':id/edit/:goalId',
|
||||||
|
loadChildren: () => import('../edit-allowance/edit-allowance.module').then(m => m.EditAllowancePageModule)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
<ion-header [translucent]="true" class="ion-no-border">
|
<ion-header [translucent]="true" class="ion-no-border">
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-title>
|
<div class="toolbar">
|
||||||
Allowance
|
<ion-title>
|
||||||
</ion-title>
|
Allowance
|
||||||
|
</ion-title>
|
||||||
|
<button class="top-add-button" (click)="createAllowance()">Add Goal</button>
|
||||||
|
</div>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
|
@ -58,11 +58,10 @@ button {
|
|||||||
padding-inline: 30px;
|
padding-inline: 30px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
color: white;
|
color: white;
|
||||||
font-size: 16px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
button:disabled,
|
button:disabled,
|
||||||
button[disabled]{
|
button[disabled] {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,4 +126,14 @@ button[disabled]{
|
|||||||
background-color: var(--legend-color);
|
background-color: var(--legend-color);
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
margin-right: 2px;
|
margin-right: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toolbar {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-add-button {
|
||||||
|
background-color: var(--ion-color-primary);
|
||||||
|
margin-right: 15px;
|
||||||
|
padding-inline: 15px;
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { BehaviorSubject } from 'rxjs';
|
import { BehaviorSubject } from 'rxjs';
|
||||||
import { Allowance } from 'src/app/models/allowance';
|
import { Allowance } from 'src/app/models/allowance';
|
||||||
import { AllowanceService } from 'src/app/services/allowance.service';
|
import { AllowanceService } from 'src/app/services/allowance.service';
|
||||||
@ -31,6 +31,7 @@ export class AllowancePage implements ViewWillEnter {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
|
private router: Router,
|
||||||
private allowanceService: AllowanceService
|
private allowanceService: AllowanceService
|
||||||
) {
|
) {
|
||||||
this.id = this.route.snapshot.params['id'];
|
this.id = this.route.snapshot.params['id'];
|
||||||
@ -46,7 +47,6 @@ export class AllowancePage implements ViewWillEnter {
|
|||||||
this.allowanceService.getAllowanceList(this.id).subscribe(allowance => {
|
this.allowanceService.getAllowanceList(this.id).subscribe(allowance => {
|
||||||
allowance[0].colour = '#9C4BE4';
|
allowance[0].colour = '#9C4BE4';
|
||||||
allowance[0].name = 'Main Allowance';
|
allowance[0].name = 'Main Allowance';
|
||||||
console.log('Allowance list: ', allowance);
|
|
||||||
this.allowance$.next(allowance);
|
this.allowance$.next(allowance);
|
||||||
})
|
})
|
||||||
}, 10);
|
}, 10);
|
||||||
@ -72,4 +72,8 @@ export class AllowancePage implements ViewWillEnter {
|
|||||||
}
|
}
|
||||||
return goal.progress / allowanceTotal * 100;
|
return goal.progress / allowanceTotal * 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createAllowance() {
|
||||||
|
this.router.navigate(['add'], { relativeTo: this.route });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { EditAllowancePage } from './edit-allowance.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: EditAllowancePage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class EditAllowancePageRoutingModule {}
|
@ -0,0 +1,20 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { EditAllowancePageRoutingModule } from './edit-allowance-routing.module';
|
||||||
|
|
||||||
|
import { EditAllowancePage } from './edit-allowance.page';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
EditAllowancePageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [EditAllowancePage]
|
||||||
|
})
|
||||||
|
export class EditAllowancePageModule {}
|
@ -0,0 +1,13 @@
|
|||||||
|
<ion-header [translucent]="true">
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-title>edit-allowance</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content [fullscreen]="true">
|
||||||
|
<ion-header collapse="condense">
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-title size="large">edit-allowance</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
</ion-content>
|
@ -0,0 +1,17 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
import { EditAllowancePage } from './edit-allowance.page';
|
||||||
|
|
||||||
|
describe('EditAllowancePage', () => {
|
||||||
|
let component: EditAllowancePage;
|
||||||
|
let fixture: ComponentFixture<EditAllowancePage>;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(EditAllowancePage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
@ -0,0 +1,16 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-edit-allowance',
|
||||||
|
templateUrl: './edit-allowance.page.html',
|
||||||
|
styleUrls: ['./edit-allowance.page.scss'],
|
||||||
|
standalone: false
|
||||||
|
})
|
||||||
|
export class EditAllowancePage implements OnInit {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -42,4 +42,8 @@ ion-title {
|
|||||||
|
|
||||||
ion-header {
|
ion-header {
|
||||||
border-bottom: 1px solid var(--line-color);
|
border-bottom: 1px solid var(--line-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
font-size: 16px;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user