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/dashboard/dashboard.component.css2
-rw-r--r--ufund-ui/src/app/components/dashboard/dashboard.component.html13
-rw-r--r--ufund-ui/src/app/components/need-list/need-list.component.css4
-rw-r--r--ufund-ui/src/app/components/need-list/need-list.component.html8
-rw-r--r--ufund-ui/src/app/components/need-list/need-list.component.ts19
-rw-r--r--ufund-ui/src/app/components/need-page/need-page.component.html12
-rw-r--r--ufund-ui/src/app/components/signup/signup.component.html4
-rw-r--r--ufund-ui/src/app/components/signup/signup.component.ts13
8 files changed, 42 insertions, 33 deletions
diff --git a/ufund-ui/src/app/components/dashboard/dashboard.component.css b/ufund-ui/src/app/components/dashboard/dashboard.component.css
index 78a69ba..185fdc2 100644
--- a/ufund-ui/src/app/components/dashboard/dashboard.component.css
+++ b/ufund-ui/src/app/components/dashboard/dashboard.component.css
@@ -1,7 +1,7 @@
:host {
display: flex;
flex-direction: column;
- width: 1000px;
+ width: 800px;
align-self: center;
gap: 20px
}
diff --git a/ufund-ui/src/app/components/dashboard/dashboard.component.html b/ufund-ui/src/app/components/dashboard/dashboard.component.html
index 6a95ecd..2d7b4c3 100644
--- a/ufund-ui/src/app/components/dashboard/dashboard.component.html
+++ b/ufund-ui/src/app/components/dashboard/dashboard.component.html
@@ -1,5 +1,10 @@
-<h1>Your Dashboard</h1>
-<app-mini-need-list [needList]="topNeeds" jtitle="Top needs" url="/cupboard"/>
-<app-mini-need-list [needList]="almostThere" jtitle="Almost there" url="/cupboard"/>
-<app-mini-need-list [needList]="inBasket" jtitle="In your basket" url="/basket"/>
+<h1>Admin Dashboard</h1>
+<!--<app-mini-need-list [needList]="topNeeds" jtitle="Top needs" url="/cupboard"/>-->
+<!--<app-mini-need-list [needList]="almostThere" jtitle="Almost there" url="/cupboard"/>-->
+<!--<app-mini-need-list [needList]="inBasket" jtitle="In your basket" url="/basket"/>-->
+<span>_ Registered users</span>
+<span>_ Needs with overflow</span>
+<span>_ Needs in peoples baskets</span>
+<span>_ Total monetary contributions</span>
+<span>_ </span>
diff --git a/ufund-ui/src/app/components/need-list/need-list.component.css b/ufund-ui/src/app/components/need-list/need-list.component.css
index 5f2e5e1..e17609b 100644
--- a/ufund-ui/src/app/components/need-list/need-list.component.css
+++ b/ufund-ui/src/app/components/need-list/need-list.component.css
@@ -89,6 +89,10 @@ select {
background-color: #3a3a3a;
border-radius: 5px;
cursor: pointer;
+ height: 130px;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
}
.clickable:hover {
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 c0501ba..88317dd 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
@@ -40,8 +40,6 @@
</div>
</div>
- <br>
-
<div class="prog">
<span id="hover-status-label-{{need.id}}"> </span>
<span>{{need.current}}/{{need.maxGoal}} ({{((need.current / need.maxGoal) * 100).toFixed(0)}}%)</span>
@@ -65,7 +63,9 @@
</div>
<div id="page-selector">
- <button *ngIf="currentPage > 0" (click)="decrementPage()"><span class="icon">arrow_back_ios</span></button>
+ <button [disabled]="!(currentPage !== 0)" (click)="firstPage()"><span class="icon">first_page</span></button>
+ <button [disabled]="!(currentPage > 0)" (click)="decrementPage()"><span class="icon">arrow_back_ios_new</span></button>
<span>Page {{currentPage + 1}} of {{totalPages}}</span>
- <button *ngIf="currentPage < totalPages - 1" (click)="incrementPage()"><span class="icon">arrow_forward_ios</span></button>
+ <button [disabled]="!(currentPage < totalPages - 1)" (click)="incrementPage()"><span class="icon">arrow_forward_ios</span></button>
+ <button [disabled]="!(currentPage !== totalPages - 1)" (click)="lastPage()"><span class="icon">last_page</span></button>
</div>
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 cd3d9bd..06a612e 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
@@ -74,12 +74,22 @@ export class NeedListComponent {
decrementPage() {
this.currentPage--;
- this.updateVisibleNeeds();
+ this.updateVisibleNeeds();
}
incrementPage() {
this.currentPage++;
- this.updateVisibleNeeds();
+ this.updateVisibleNeeds();
+ }
+
+ lastPage() {
+ this.currentPage = this.totalPages - 1
+ this.updateVisibleNeeds()
+ }
+
+ firstPage() {
+ this.currentPage = 0
+ this.updateVisibleNeeds()
}
editNeedsPerPage(amount: number) {
@@ -135,7 +145,7 @@ export class NeedListComponent {
ngOnInit(): void {
this.refresh()
-
+
}
changeSortMode(form : any) {
@@ -269,7 +279,4 @@ export class NeedListComponent {
}
}
}
-function not(location: string) {
- throw new Error('Function not implemented.');
-}
diff --git a/ufund-ui/src/app/components/need-page/need-page.component.html b/ufund-ui/src/app/components/need-page/need-page.component.html
index 958dfa6..522b710 100644
--- a/ufund-ui/src/app/components/need-page/need-page.component.html
+++ b/ufund-ui/src/app/components/need-page/need-page.component.html
@@ -1,14 +1,14 @@
<div id="box">
- <h1>{{need?.name}}</h1>
- <span class="needType">{{need?.type}} GOAL</span>
+ <h1>{{need.name}}</h1>
+ <span class="needType">{{need.type}} GOAL</span>
- <img *ngIf="need.image" alt="Need image" [src]="need?.image"/>
+ <img *ngIf="need.image" alt="Need image" [src]="need.image"/>
- <p>{{need?.description}}</p>
+ <p>{{need.description}}</p>
<div class="prog">
<!-- <span>{{need?.current}} / {{need?.maxGoal}}</span>-->
- <progress [value]="need?.current" [max]="need?.maxGoal"></progress>
- <span>This goal is <strong>{{(((need?.current ?? 0)*100) / (need?.maxGoal ?? 0)).toFixed(0)}}%</strong> complete!</span>
+ <progress [value]="need.current" [max]="need.maxGoal"></progress>
+ <span>This goal is <strong>{{(((need.current)*100) / (need.maxGoal)).toFixed(0)}}%</strong> complete!</span>
</div>
<span><strong>Target Goal:</strong> {{need.maxGoal}}</span>
diff --git a/ufund-ui/src/app/components/signup/signup.component.html b/ufund-ui/src/app/components/signup/signup.component.html
index bc3aaf0..84f15e4 100644
--- a/ufund-ui/src/app/components/signup/signup.component.html
+++ b/ufund-ui/src/app/components/signup/signup.component.html
@@ -8,7 +8,7 @@
<div>
<div>
<input placeholder="Password" type="password" (input)="validate(username.value, confirmPass.value, password.value)" #password>
- <progress [ngClass]="'color' + strength.getValue()" id="bar" [value]="strength | async" max="6"> </progress>
+ <progress [ngClass]="'color' + strength.getValue()" id="bar" [value]="strength | async" max="5"> </progress>
<span *ngIf="passwordStatusText">{{passwordStatusText | async}}</span>
</div>
@@ -24,8 +24,6 @@
<div>
<button [disabled]="!(ableToCreateAccount | async)" (click)="signup(username.value, password.value)">Create Account</button>
- <span *ngIf="showSuccessMessage | async">Account created <a routerLink="/login">Proceed to login</a></span>
- <span *ngIf="statusText | async">{{statusText | async}}</span>
</div>
<span>Already have an account? <a routerLink="/login">Log in</a></span>
</div>
diff --git a/ufund-ui/src/app/components/signup/signup.component.ts b/ufund-ui/src/app/components/signup/signup.component.ts
index a20d828..b040d1a 100644
--- a/ufund-ui/src/app/components/signup/signup.component.ts
+++ b/ufund-ui/src/app/components/signup/signup.component.ts
@@ -6,7 +6,6 @@ import {ToastsService, ToastType} from '../../services/toasts.service';
class PasswordRequirements {
sixLong: {title: string, value: boolean} = {title: 'Is 6 characters or longer' , value: false}
- twelveLong: {title: string, value: boolean} = {title: 'Is 12 characters or longer', value: false}
lowercase: {title: string, value: boolean} = {title: 'Includes lowercase letter' , value: false}
uppercase: {title: string, value: boolean} = {title: 'Includes uppercase letter' , value: false}
number: {title: string, value: boolean} = {title: 'Includes number' , value: false}
@@ -25,12 +24,10 @@ export class SignupComponent {
protected passwordStatusText = new BehaviorSubject("")
protected passwordsMatch = new BehaviorSubject(false)
protected usernameStatusText = new BehaviorSubject("")
- protected showSuccessMessage = new BehaviorSubject(false)
protected passwordStrongEnough = new BehaviorSubject(false)
protected ableToCreateAccount = new BehaviorSubject(false)
protected passwordRequirements: PasswordRequirements = new PasswordRequirements()
protected strength = new BehaviorSubject(0)
- protected statusText = new BehaviorSubject("");
constructor(
protected usersService: UsersService,
@@ -45,7 +42,9 @@ export class SignupComponent {
}
this.usersService.createUser(username, password).then(() => {
- this.showSuccessMessage.next(true);
+ // let action = {label: 'Proceed to login', onAction: () => this.router.navigate(["/login"])}
+ this.toastService.sendToast(ToastType.INFO, "Account successfully created")
+ this.router.navigate(["/login"])
}).catch(ex => {
this.toastService.sendToast(ToastType.ERROR, "Unable to create account: " + friendlyHttpStatus[ex.status])
console.log(ex)
@@ -74,16 +73,12 @@ export class SignupComponent {
if (password.match(/[^!-~]/g)) {
this.passwordStatusText.next("Invalid characters")
-
return
}
if (password.length > 6) {
this.passwordRequirements.sixLong.value = true
}
- if (password.length > 12) {
- this.passwordRequirements.twelveLong.value = true
- }
if (password.match(/[a-z]/g)) {
this.passwordRequirements.lowercase.value = true
}
@@ -108,7 +103,7 @@ export class SignupComponent {
} else if (strength == 0) {
this.passwordStatusText.next("")
} else {
- this.passwordStatusText.next("5/6 checks required")
+ this.passwordStatusText.next("Password must meet requirements")
}
this.strength.next(strength)