diff options
author | Tyler Ferrari <69283684+Sowgro@users.noreply.github.com> | 2025-03-31 20:19:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-31 20:19:44 -0400 |
commit | b7539414ac6aa8efd423a3a9a0a2b5586757e19c (patch) | |
tree | 39a21dc367d3891c53e849f5e1ce81eaebc0fd21 /ufund-ui/src/app | |
parent | 459c716d5429c040ac25435aab93f896f2fd79c3 (diff) | |
parent | a2e1329a510375fdada021c3d6a2f631a9c162ee (diff) | |
download | JellySolutions-b7539414ac6aa8efd423a3a9a0a2b5586757e19c.tar.gz JellySolutions-b7539414ac6aa8efd423a3a9a0a2b5586757e19c.tar.bz2 JellySolutions-b7539414ac6aa8efd423a3a9a0a2b5586757e19c.zip |
Merge pull request #21 from RIT-SWEN-261-02/need-description
Need description and image support
Diffstat (limited to 'ufund-ui/src/app')
4 files changed, 23 insertions, 6 deletions
diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.html b/ufund-ui/src/app/components/cupboard/cupboard.component.html index 25b88ba..855bd7e 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>Image:</label><br> + <input type="text" name="image" ngModel><br> <label>Location:</label><br> <input type="text" name="location" ngModel><br> <label>Max Goal:</label><br> @@ -24,6 +26,8 @@ <label>Physical</label><br> <input type="checkbox" name="urgent" value="false" ngModel> <label>Urgent</label><br> + <label>Description</label> + <textarea name="description" [(ngModel)]="selectedNeed.description"></textarea><br> <input type="submit" value="Submit"> </form> @@ -35,6 +39,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="image" [(ngModel)]="selectedNeed.image"><br> <input type="text" name="location" [(ngModel)]="selectedNeed.location"><br> <label>Max Goal:</label><br> <input type="number" name="maxGoal" [(ngModel)]="selectedNeed.maxGoal"><br> @@ -45,8 +50,10 @@ <label>Physical</label><br> <input type="checkbox" name="urgent" [(ngModel)]="selectedNeed.urgent"> <label>Urgent</label> <br> + <label>Description</label> <br> + <textarea name="description" [(ngModel)]="selectedNeed.description"></textarea><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 85ffd17..9c8a173 100644 --- a/ufund-ui/src/app/components/cupboard/cupboard.component.ts +++ b/ufund-ui/src/app/components/cupboard/cupboard.component.ts @@ -85,13 +85,15 @@ export class CupboardComponent implements OnInit { console.log(form); const need: Need = { name: form.name, + image: form.image, 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 + current: 0, + description: form.description }; this.cupboardService.updateNeed(need.id, need) @@ -121,13 +123,15 @@ export class CupboardComponent implements OnInit { submit(form: any) { const need: Need = { name: form.name, + image: form.image, location: form.location, id: 0, maxGoal: form.maxGoal, type: form.type, urgent: form.urgent ? true : false, filterAttributes: [], - current: 0 + current: 0, + description: form.description }; console.log("need:", need); console.log("form submitted. creating need: ", need); diff --git a/ufund-ui/src/app/components/need-list/need-list.component.html b/ufund-ui/src/app/components/need-list/need-list.component.html index e24ee09..c325320 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.html +++ b/ufund-ui/src/app/components/need-list/need-list.component.html @@ -32,20 +32,24 @@ <span class="needName">{{need.name}}</span> <span class="needType">{{need.type}}</span> </div> - + <div class="right"> <span *ngIf="need.urgent" class="urgent">URGENT</span> <span *ngIf="need.location"><span class="icon">location_on</span>{{need.location}}</span> </div> </div> - + <div class="prog"> <span id="hover-status-label-{{need.id}}"> </span> <span>{{need.current}}/{{need.maxGoal}} ({{((need.current / need.maxGoal) * 100).toFixed(0)}}%)</span> <progress [value]="need.current" [max]="need.maxGoal"></progress> </div> - </div> + <div class="description"> + {{need.description}} + </div> + </div> + <div> <button *ngIf="isHelper()" (click)="add(need)">Add To Basket</button> <button *ngIf="isManager()" (click)="select(need)"> diff --git a/ufund-ui/src/app/models/Need.ts b/ufund-ui/src/app/models/Need.ts index 1451cad..6cf7e76 100644 --- a/ufund-ui/src/app/models/Need.ts +++ b/ufund-ui/src/app/models/Need.ts @@ -1,5 +1,6 @@ export interface Need { name: string, + image: string, id: number, filterAttributes: string[], location: string; @@ -7,6 +8,7 @@ export interface Need { maxGoal: number; current: number; urgent: boolean; + description: string; } export enum GoalType { |