aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components
diff options
context:
space:
mode:
Diffstat (limited to 'ufund-ui/src/app/components')
-rw-r--r--ufund-ui/src/app/components/cupboard/cupboard.component.html9
-rw-r--r--ufund-ui/src/app/components/cupboard/cupboard.component.ts8
-rw-r--r--ufund-ui/src/app/components/need-list/need-list.component.ts12
3 files changed, 22 insertions, 7 deletions
diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.html b/ufund-ui/src/app/components/cupboard/cupboard.component.html
index d54eed9..bc5ac1c 100644
--- a/ufund-ui/src/app/components/cupboard/cupboard.component.html
+++ b/ufund-ui/src/app/components/cupboard/cupboard.component.html
@@ -13,6 +13,8 @@
<form #cupboardForm="ngForm" (ngSubmit)="submit(cupboardForm.value)">
<label>Name:</label><br>
<input type="text" name="name" ngModel><br>
+ <label>Location:</label><br>
+ <input type="text" name="location" ngModel><br>
<label>Max Goal:</label><br>
<input type="number" name="maxGoal" ngModel><br>
<label>Type</label><br>
@@ -20,7 +22,10 @@
<label>Monetary</label><br>
<input type="radio" name="type" value="PHYSICAL" ngModel>
<label>Physical</label><br>
+ <input type="checkbox" name="urgent" value="false" ngModel>
+ <label>Urgent</label><br>
<input type="submit" value="Submit">
+
</form>
<span *ngIf="statusText">{{statusText | async}}</span>
@@ -30,6 +35,7 @@
<label>Needs:</label><br>
<form #updateForm="ngForm" (ngSubmit)="update(updateForm.value)">
<input type="text" name="name" [(ngModel)]="selectedNeed.name"><br>
+ <input type="text" name="location" [(ngModel)]="selectedNeed.location"><br>
<label>Max Goal:</label><br>
<input type="number" name="maxGoal" [(ngModel)]="selectedNeed.maxGoal"><br>
<label>Type</label><br>
@@ -37,7 +43,10 @@
<label>Monetary</label><br>
<input type="radio" name="type" value="PHYSICAL" [(ngModel)]="selectedNeed.type">
<label>Physical</label><br>
+ <input type="checkbox" name="urgent" [(ngModel)]="selectedNeed.urgent">
+ <label>Urgent</label> <br>
<input type="submit" value="Submit">
+
</form>
<span *ngIf="statusText">{{statusText | async}}</span>
diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.ts b/ufund-ui/src/app/components/cupboard/cupboard.component.ts
index a8b9c14..540a058 100644
--- a/ufund-ui/src/app/components/cupboard/cupboard.component.ts
+++ b/ufund-ui/src/app/components/cupboard/cupboard.component.ts
@@ -32,9 +32,11 @@ export class CupboardComponent implements OnInit {
selectedNeed: any = {
name: '',
+ location:'',
id: null,
maxGoal: null,
- type: ''
+ type: '',
+ urgent: false
};
selectedNeedId: number | null = null;
searchResults: any[] = [];
@@ -79,9 +81,11 @@ export class CupboardComponent implements OnInit {
console.log(form);
const need: Need = {
name: form.name,
+ location: form.location,
id: this.selectedNeed.id, //system will control this
maxGoal: form.maxGoal,
type: GoalType[form.type as keyof typeof GoalType],
+ urgent: form.urgent,
filterAttributes: [],
current: 0
};
@@ -113,9 +117,11 @@ export class CupboardComponent implements OnInit {
submit(form: any) {
const need: Need = {
name: form.name,
+ location: form.location,
id: 0,
maxGoal: form.maxGoal,
type: form.type,
+ urgent: form.urgent,
filterAttributes: [],
current: 0
};
diff --git a/ufund-ui/src/app/components/need-list/need-list.component.ts b/ufund-ui/src/app/components/need-list/need-list.component.ts
index 4359cfa..37a3775 100644
--- a/ufund-ui/src/app/components/need-list/need-list.component.ts
+++ b/ufund-ui/src/app/components/need-list/need-list.component.ts
@@ -1,5 +1,4 @@
-import {Component, input, Output, EventEmitter} from '@angular/core';
-import { NgForm } from '@angular/forms';
+import {Component , Output, EventEmitter} from '@angular/core';
import {Need} from '../../models/Need';
import {CupboardService} from '../../services/cupboard.service';
import { UsersService } from '../../services/users.service';
@@ -39,12 +38,13 @@ export class NeedListComponent {
searchResults: Need[] = [];
sortMode = 'Ascending'
- currentSortAlgo: sortAlgo = sortByGoal;
- sortSelection: string = 'sortByGoal';
+ currentSortAlgo: sortAlgo = sortByName;
+ sortSelection: string = 'sortByName';
SortingAlgoArrays: {func:sortAlgo,name:string, display:string[]}[] = [
- {func:sortByGoal,name:"sortByGoal", display:["Maximum Goal", "Minimum Goal"]},
- {func:sortByName,name:"sortByName", display:["Name", "Name (Descending)"]},
+ {func:sortByName,name:"sortByName", display:["Name (Alphabetical)", "Name (Reverse)"]},
+ {func:sortByGoal,name:"sortByGoal", display:["Largest Maximum Goal", "Smallest Maximum Goal"]},
+ {func:sortByName,name:"sortByPriority", display:["Highest Priority", "Lowest Priority"]},
];
@Output() currentNeed = new EventEmitter<Need>();