3 Commits

Author SHA1 Message Date
Huffle
85f796814c add max validator in spend allowance page
All checks were successful
Backend Build and Test / build (push) Successful in 2m43s
2025-05-27 18:38:35 +02:00
Huffle
93e8a79bcc Merge branch 'main' into AP-69 2025-05-27 18:25:09 +02:00
Huffle
90c64f2ca6 Add functionality to add allowance
All checks were successful
Backend Build and Test / build (push) Successful in 2m5s
2025-05-27 15:16:58 +02:00
12 changed files with 8 additions and 3487 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -47,7 +47,6 @@
"@angular/cli": "^19.0.0", "@angular/cli": "^19.0.0",
"@angular/compiler-cli": "^19.0.0", "@angular/compiler-cli": "^19.0.0",
"@angular/language-service": "^19.0.0", "@angular/language-service": "^19.0.0",
"@capacitor/assets": "^3.0.5",
"@capacitor/cli": "7.2.0", "@capacitor/cli": "7.2.0",
"@ionic/angular-toolkit": "^12.0.0", "@ionic/angular-toolkit": "^12.0.0",
"@types/jasmine": "~5.1.0", "@types/jasmine": "~5.1.0",

View File

@@ -36,7 +36,7 @@ export class AllowancePage implements ViewWillEnter {
allowance[0].name = 'Main Allowance'; allowance[0].name = 'Main Allowance';
this.allowance$.next(allowance); this.allowance$.next(allowance);
}) })
}, 50); }, 20);
} }
canFinishGoal(allowance: Allowance): boolean { canFinishGoal(allowance: Allowance): boolean {
@@ -57,9 +57,6 @@ export class AllowancePage implements ViewWillEnter {
for (let allowance of allowanceList) { for (let allowance of allowanceList) {
allowanceTotal += allowance.progress; allowanceTotal += allowance.progress;
} }
if (allowanceTotal === 0) {
return 0;
}
return goal.progress / allowanceTotal * 100; return goal.progress / allowanceTotal * 100;
} }

View File

@@ -19,7 +19,6 @@
<button (click)="completeTask(task.id)">Done</button> <button (click)="completeTask(task.id)">Done</button>
<div (click)="updateTask(task.id)" class="item"> <div (click)="updateTask(task.id)" class="item">
<div class="name">{{ task.name }}</div> <div class="name">{{ task.name }}</div>
<div class="assigned">{{ usernames[task.assigned ? task.assigned : 0] }}</div>
<div <div
class="reward" class="reward"
[ngClass]="{ 'negative': task.reward < 0 }" [ngClass]="{ 'negative': task.reward < 0 }"

View File

@@ -67,10 +67,4 @@ button {
background-color: var(--ion-color-primary); background-color: var(--ion-color-primary);
margin-right: 15px; margin-right: 15px;
width: 75px; width: 75px;
}
.assigned {
color: var(--line-color);
margin-left: 3px;
font-size: 12px;
} }

View File

@@ -14,7 +14,6 @@ import { ViewWillEnter } from '@ionic/angular';
}) })
export class TasksPage implements ViewWillEnter { export class TasksPage implements ViewWillEnter {
public tasks$: BehaviorSubject<Array<Task>> = new BehaviorSubject<Array<Task>>([]); public tasks$: BehaviorSubject<Array<Task>> = new BehaviorSubject<Array<Task>>([]);
public usernames = ['', 'See', 'Huffle']
constructor( constructor(
private taskService: TaskService, private taskService: TaskService,
@@ -33,7 +32,7 @@ export class TasksPage implements ViewWillEnter {
this.taskService.getTaskList().subscribe(tasks => { this.taskService.getTaskList().subscribe(tasks => {
this.tasks$.next(tasks); this.tasks$.next(tasks);
}); });
}, 50); }, 10);
} }
createTask() { createTask() {

View File

@@ -7,7 +7,7 @@ import { Allowance } from '../models/allowance';
providedIn: 'root' providedIn: 'root'
}) })
export class AllowanceService { export class AllowanceService {
private url = 'https://allowanceplanner.seeseepuff.be/api'; private url = 'http://localhost:8080/api';
constructor(private http: HttpClient) {} constructor(private http: HttpClient) {}

View File

@@ -7,7 +7,7 @@ import { History } from '../models/history';
providedIn: 'root' providedIn: 'root'
}) })
export class HistoryService { export class HistoryService {
private url = 'https://allowanceplanner.seeseepuff.be/api'; private url = 'http://localhost:8080/api';
constructor(private http: HttpClient) {} constructor(private http: HttpClient) {}

View File

@@ -7,7 +7,7 @@ import { Task } from '../models/task';
providedIn: 'root' providedIn: 'root'
}) })
export class TaskService { export class TaskService {
private url = 'https://allowanceplanner.seeseepuff.be/api'; private url = 'http://localhost:8080/api';
constructor(private http: HttpClient) {} constructor(private http: HttpClient) {}

View File

@@ -7,7 +7,7 @@ import { User } from '../models/user';
providedIn: 'root', providedIn: 'root',
}) })
export class UserService { export class UserService {
private url = 'https://allowanceplanner.seeseepuff.be/api'; private url = 'http://localhost:8080/api';
constructor(private http: HttpClient) {} constructor(private http: HttpClient) {}
getUserList(): Observable<Array<User>> { getUserList(): Observable<Array<User>> {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB