Skip to content

Commit 47d485d

Browse files
jettdctaza6535OwenHelfernh602
authored
Update main (#51)
* Update current-sprint (#22) * Update Main (#11) * Important changes (#3) * Add important things * Add to readme, add 2 services, add a module Co-authored-by: Jett Crowson <[email protected]> * Login route (#4) * add login route * remove deprecated test Co-authored-by: Jett Crowson <[email protected]> * Add database service, mock and impl * stash * Add announcement stuff * Add toast service error handling * Add toast service error handling * Fix test * Add getuserbyid path * Start Admin Page (#6) * User request table * Additional changes to table * Add approval and denial * Remove hardcoded height * Add text when all applicants are dealt with * Add tabs to admin table, fix tests * announcements * Add toast service. Begin blacklist users. * Fix test * Add blacklist table * Add in announcements posting. Unblacklist dbservice call. * Add in announcements posting. Unblacklist dbservice call. * Start mr changes Co-authored-by: Jett Crowson <[email protected]> * Login page (#7) * login and create account * changes to login and create account pages * login and create account changes * login and create account changes * login and create acc changes * login and create acc * Fix formatting * Aesthetic changes: * Confirm password matching * Add more validation * Tweaks * add star annotations * Add show invalid at end, validate login form Co-authored-by: Jett Crowson <[email protected]> * Rest Services + Nav Bar + Other Improvements (#8) * Add date interception, account service, announcement service * stash * fix provider * Add other services * Implement creating an account * Fix tests * add nav bar * nav tweaks * Revamp announcements page * fix tests * Change text * Add address service * Add availability service * Add blacklist service * Add phoneNumberService * Add profile photos service * Remove database service from announcements * Update eslintrc * Remove db service from blacklist table * Remove database service * Fix dateservice test * Make requested changes to create account form (#9) * Make requested changes to create account form * Add state list, phone number formatting to req Co-authored-by: Jett Crowson <[email protected]> * landing page (#10) * landing page Co-authored-by: Jett Crowson <[email protected]> Co-authored-by: taza6535 <[email protected]> * Production build changes * Update node version * Update budgets and buildspec Co-authored-by: Jett Crowson <[email protected]> Co-authored-by: taza6535 <[email protected]> * Remove redundant image service files * Email verification (#21) * Fix * Add integration for verifying emails from links * Fix tests * Fix account creation (#23) * Update announcements (#24) * Update announcements * Fix blacklist service Co-authored-by: Jett Crowson <[email protected]> * Search card (#25) * profile cards * Fix formatting * Add integration with backend. * delete redundant module * Remove test stage since we are not testing yet * Fix upper bound on distance filter * Add search bar functionality * Begin updating approval table * Approval and denial finishing touches Co-authored-by: taza6535 <[email protected]> * Pull in main * Remove test stage again * Fix small profile model and usage to match backend (#27) * Stable jwt frontend build with route guards and mock response (#13) * Stable jwt frontend build with route guards and mock response * Add dependencies to package * fix tests * Refactor login page auth * Update auth.service.ts * Fixing merge for jwt-frontend * pulled current sprint * fixing cookie issues Co-authored-by: Jett Crowson <[email protected]> * add some restrictions so only admins can see certain things, add profile nav link (#28) * Cleanup (#29) * Fix toast service, add spinner to respite search * Change icon and site name * Update README * Fix login bugs (#30) * Fix respite search on nav bar (#31) * Fix login bugs * hide respite search page * Moderator / Admin registration + approvals (#32) * Create staff registration page * Implement approval/denial table for staff * Route guard edit for checking that user's profile is completed (#33) * Implement profile completed check in user guard * Update readme * Add guard for not having completed profile yet * Profile integration (#34) * Fixed providing respite care information not appearing * Corrected change profile endpoint * Corrected frontend/backend variable name mismatch * Add account page: Update address, phone numbers, password, cw info, delete account (#35) * Implement account page and password update page * Add account deletion * Start to add fields for address and phone number on account page * Finish update address form and add update phone number form * Fix formatting on delete account page, update readme * Update address service * Update README * Update README * Update recent announcements error handling + readme * Update README.md * Add page for updating case worker information + methods to account service * Jwt frontend (#38) * Stable jwt frontend build with route guards and mock response * Add dependencies to package * fix tests * Refactor login page auth * Update auth.service.ts * Fixing merge for jwt-frontend * pulled current sprint * fixing cookie issues * first go at logout * first go at logout * refined logout * full login Co-authored-by: Jett Crowson <[email protected]> * Refactor with FormUtils (#39) * Add form utils * Update confirmPasswordValidator * Update updatePhone page to use form utils * Make update address form use form utils * Update README * Setup testing and test login modal (#40) * Test create account modal (#41) * Setup testing and test login modal * Create account modal tests * Remember me check box implementation * Do more testing (#43) * Setup testing and test login modal * Create account modal tests * Test account page * test change password component * test delete account component * Test address, cw, and phone update components * Test applicant components: staff and user * Test blacklist component * Add more tests * More testing (#44) * Begin testing image upload component * Test image upload component and finish profile page * Test landing and announcement * Test staff account create * Add email matching to verification component. * Refactor email regex * Navigate on wrong email format * Test nav bar, refactor auth service a bit, test a couple other things (#46) * add cared for medically fragile filter (#47) * Fix profiles creation and get images from s3 key. (#49) * Components for Updating Profile After Creation (#50) * Add and test update profile component * Fix == -> === * Add and test update secondary account holder page * Add and test page to create secondary account holder * Add and test add respite provider info component * Add and test update respite provider info component * eslint errors * Add and test temporary availability component * Rearrange imports * Fix up for integrations with backend, add guards * Fix test * Move function between profile service and availability service * Add Bug Reporting modal and admin table (#52) * Fix tests and esline * Fix date format * Add bug reporting modal and admin reviewing * Fix phone number backend integration * Fix esline * Update profile page + view all announcements (#53) * Add update profile aggreagation page + site footer * Add all announcements page Co-authored-by: Jett Crowson <[email protected]> Co-authored-by: taza6535 <[email protected]> Co-authored-by: taza6535 <[email protected]> Co-authored-by: Owen Helfer <[email protected]> Co-authored-by: Nicholas Henley <[email protected]>
1 parent c331781 commit 47d485d

File tree

120 files changed

+5882
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+5882
-216
lines changed

README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
- [x] Capture frontend user when they have not yet completed their account
1111
- user should not be able to visit any other page until they complete their account
1212
- [ ] Deployment
13-
- [ ] Make sure all configurations work in the cloud
14-
- [ ] Dockerize the backend?
15-
- [ ] Set up CI/CD
16-
- [ ] Set up AWS database
13+
- [ ] Bakend to Heroku
14+
- [ ] Frontent to AWS
1715
- [ ] AWS
1816
- [ ] Re-add everyone to AWS
1917
- [ ] Get out of sandbox mode on emails
@@ -35,7 +33,7 @@
3533
- [ ] Change phone number back end
3634
- [ ] Profile Page
3735
- [x] Finish profile page
38-
- [ ] Allow updating of attributes for profile
36+
- [x] Allow updating of attributes for profile
3937
- [ ] Login
4038
- [x] Work out bugs in login and sessions (ex. If you are insufficient privilege to go to a page it takes you back to the login page sometimes, whereas it should show you a 404)
4139
- [x] Logout
@@ -67,6 +65,7 @@
6765
- [ ] Get list of all staff accounts for admins
6866
- [ ] Periodically go through and get rid of unverified accounts
6967
- [ ] Reject address if not coords
68+
- [x] Add temporary availabilities
7069

7170
## Testing
7271

angular.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
{
3737
"type": "initial",
3838
"maximumWarning": "500kb",
39-
"maximumError": "2mb"
39+
"maximumError": "5mb"
4040
},
4141
{
4242
"type": "anyComponentStyle",
4343
"maximumWarning": "150kb",
44-
"maximumError": "200kb"
44+
"maximumError": "500kb"
4545
}
4646
],
4747
"fileReplacements": [

package-lock.json

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"@angular/router": "~12.2.0",
2929
"@ng-bootstrap/ng-bootstrap": "^10.0.0",
3030
"bootstrap": "^4.5.0",
31+
"bootstrap-icons": "^1.7.2",
3132
"google-libphonenumber": "^3.2.25",
3233
"jquery": "^3.6.0",
3334
"jwt-decode": "^3.1.2",

src/app/account/account-page/account-page.component.html

+9-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h3>Case Worker Information</h3>
3333
<p><b>County or Agency Certified By:</b> {{ currentAccount.certifiedBy }}</p>
3434
<!-- TODO: Make sure that users should be able to update their case worker information -->
3535
<p>
36-
<a id="edit-cw-link" [routerLink]="'/account/update-case-worker-info'"
36+
<a id="edit-cw-link" [routerLink]="'/account/update/case-worker-info'"
3737
>Click here to update your case worker information.</a
3838
>
3939
</p>
@@ -48,7 +48,7 @@ <h3>Address</h3>
4848
><br />{{ currentAccount.address.city }} {{ currentAccount.address.state }},
4949
{{ currentAccount.address.zipcode }}
5050
</p>
51-
<p><a id="update-address-link" [routerLink]="'/account/update-address'">Update your address</a></p>
51+
<p><a id="update-address-link" [routerLink]="'/account/update/address'">Update your address</a></p>
5252
</div>
5353
<div class="col-sm-12 col-md-6 mt-sm-5 mt-md-0">
5454
<h3>Phone Number<span *ngIf="currentAccount.secondaryPhoneNumber">s</span></h3>
@@ -63,7 +63,7 @@ <h3>Phone Number<span *ngIf="currentAccount.secondaryPhoneNumber">s</span></h3>
6363
}})
6464
</p>
6565
<p>
66-
<a id="update-phone-link" [routerLink]="'/account/update-phone-number'"
66+
<a id="update-phone-link" [routerLink]="'/account/update/phone-number'"
6767
>Update your phone number<span *ngIf="currentAccount.secondaryPhoneNumber">s</span
6868
><span *ngIf="!currentAccount.secondaryPhoneNumber"> or add a secondary phone number.</span></a
6969
>
@@ -73,13 +73,18 @@ <h3>Phone Number<span *ngIf="currentAccount.secondaryPhoneNumber">s</span></h3>
7373
<div class="row mt-5">
7474
<div class="col-sm-12 col-md-6">
7575
<h3>Password</h3>
76-
<p><a href="javascript:void(0)" [routerLink]="'/account/update-password'">Update your password</a></p>
76+
<p><a href="javascript:void(0)" [routerLink]="'/account/update/password'">Update your password</a></p>
7777
</div>
7878
</div>
7979
<div class="row mt-5">
8080
<div class="col-sm-12 col-md-6">
8181
<h3>Delete Your Account</h3>
8282
<p><button class="btn btn-danger mt-2 delete-button" (click)="deleteAccount()">Delete Account</button></p>
8383
</div>
84+
<div class="col-sm-12 col-md-6" *ngIf="isUser && currentAccount.profileCompleted">
85+
<h3>Profile</h3>
86+
<p><i>To view and edit your profile details, navigate to the profile update page.</i></p>
87+
<button class="btn btn-primary text-white" [routerLink]="'/user/update'">Visit Update Profile Page</button>
88+
</div>
8489
</div>
8590
</div>

src/app/account/account-routing.module.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@ const routes: Routes = [
1212
path: '',
1313
component: AccountPageComponent,
1414
},
15-
{
16-
path: 'update-password',
17-
component: ChangePasswordComponent,
18-
},
1915
{
2016
path: 'delete-account',
2117
component: DeleteAccountComponent,
2218
},
2319
{
24-
path: 'update-address',
20+
path: 'update/password',
21+
component: ChangePasswordComponent,
22+
},
23+
{
24+
path: 'update/address',
2525
component: UpdateAddressComponent,
2626
},
2727
{
28-
path: 'update-phone-number',
28+
path: 'update/phone-number',
2929
component: UpdatePhoneComponent,
3030
},
3131
{
32-
path: 'update-case-worker-info',
32+
path: 'update/case-worker-info',
3333
component: UpdateCaseWorkerComponent,
3434
},
3535
];

src/app/admin-section/admin-page/admin-page.component.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828
>
2929
</li>
3030
<li class="nav-item">
31-
<a class="nav-link disabled" [ngClass]="{ active: router.url === '/admin/bugs' }" [routerLink]="'/admin/bugs'"
31+
<a
32+
class="nav-link"
33+
[ngClass]="{ active: router.url === '/admin/bug-reports' }"
34+
[routerLink]="'/admin/bug-reports'"
3235
>Bug Reports</a
3336
>
3437
</li>

src/app/admin-section/admin-section-routing.module.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { NgModule } from '@angular/core';
2-
import { RouterModule, Routes } from '@angular/router';
3-
import { AdminPageComponent } from './admin-page/admin-page.component';
1+
import { StaffAccountRequestsComponent } from './staff-account-requests/staff-account-requests.component';
42
import { UserActionTableComponent } from './user-action-table/user-action-table.component';
53
import { BlacklistTableComponent } from './blacklist-table/blacklist-table.component';
64
import { AnnouncementsComponent } from './announcements/announcements.component';
7-
import { StaffAccountRequestsComponent } from './staff-account-requests/staff-account-requests.component';
5+
import { BugReportsComponent } from './bug-reports/bug-reports.component';
6+
import { AdminPageComponent } from './admin-page/admin-page.component';
87
import { AdminGuard } from '../guards/admin/admin.guard';
8+
import { RouterModule, Routes } from '@angular/router';
9+
import { NgModule } from '@angular/core';
910

1011
const routes: Routes = [
1112
{
@@ -29,6 +30,11 @@ const routes: Routes = [
2930
component: StaffAccountRequestsComponent,
3031
canActivate: [AdminGuard],
3132
},
33+
{
34+
path: 'bug-reports',
35+
component: BugReportsComponent,
36+
canActivate: [AdminGuard],
37+
},
3238
],
3339
},
3440
];

src/app/admin-section/admin-section.module.ts

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { NgModule } from '@angular/core';
2-
import { CommonModule } from '@angular/common';
3-
import { AdminPageComponent } from './admin-page/admin-page.component';
1+
import { StaffAccountRequestsComponent } from './staff-account-requests/staff-account-requests.component';
42
import { UserActionTableComponent } from './user-action-table/user-action-table.component';
5-
import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap';
6-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
7-
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
8-
import { AdminSectionRoutingModule } from './admin-section-routing.module';
93
import { BlacklistTableComponent } from './blacklist-table/blacklist-table.component';
104
import { AnnouncementsComponent } from './announcements/announcements.component';
5+
import { AdminSectionRoutingModule } from './admin-section-routing.module';
6+
import { BugReportsComponent } from './bug-reports/bug-reports.component';
7+
import { AdminPageComponent } from './admin-page/admin-page.component';
118
import { EditorComponent } from '../common/editor/editor.component';
12-
import { NgxEditorModule } from 'ngx-editor';
9+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
10+
import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap';
1311
import { LandingModule } from '../landing/landing.module';
14-
import { StaffAccountRequestsComponent } from './staff-account-requests/staff-account-requests.component';
12+
import { CommonModule } from '@angular/common';
13+
import { NgxEditorModule } from 'ngx-editor';
14+
import { NgModule } from '@angular/core';
1515

1616
@NgModule({
1717
declarations: [
@@ -21,6 +21,7 @@ import { StaffAccountRequestsComponent } from './staff-account-requests/staff-ac
2121
AnnouncementsComponent,
2222
EditorComponent,
2323
StaffAccountRequestsComponent,
24+
BugReportsComponent,
2425
],
2526
imports: [
2627
CommonModule,

src/app/admin-section/blacklist-table/blacklist-table.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class BlacklistTableComponent implements OnInit {
6060
}
6161

6262
public getFormattedDateForUser(index: number): string {
63-
return formatDate(this.blacklist[index].date, 'dd/MM/yyyy', 'en-US');
63+
return formatDate(this.blacklist[index].date, 'MM/dd/yyyy', 'en-US');
6464
}
6565

6666
private getAndRemoveBlacklistedByIndex(index: number): BlacklistedUser {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<div class="table-container">
2+
<div *ngFor="let bug of bugs; index as i">
3+
<div class="row fs-tan-background user-row p-4" [ngClass]="{ 'mt-4': i != 0 }">
4+
<div class="col-sm-8 m-auto">
5+
<span><b>Description</b><br /></span>
6+
<div class="ml-1 bug-desc pl-2 mb-1">
7+
<span
8+
><i>{{ bug.description }}</i></span
9+
><br />
10+
</div>
11+
<span *ngIf="bug.url"><b>URL: </b>{{ bug.url }}<br /></span>
12+
<span *ngIf="bug.stepsToReproduce"><b>Steps To Reproduce</b><br /></span>
13+
<div *ngIf="bug.stepsToReproduce" class="ml-1 bug-desc pl-2 mb-1">
14+
<span
15+
><i>{{ bug.stepsToReproduce }}</i></span
16+
><br />
17+
</div>
18+
<small>Submitted on {{ getFormattedDateForBug(i) }}</small>
19+
</div>
20+
<div class="col-xs-12 col-sm-4 m-auto">
21+
<button (click)="removeBug(i)" class="btn btn-primary mr-5 text-white w-100 my-2 remove-button">
22+
Remove Bug Report
23+
</button>
24+
</div>
25+
</div>
26+
</div>
27+
<div *ngIf="bugs.length == 0" class="row">
28+
<div class="col-xs-12 mx-auto bg-light rounded mt-5">
29+
<div class="p-5">No Bugs Found</div>
30+
</div>
31+
</div>
32+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.bug-desc {
2+
border-left: 1px solid lightgrey;
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { BugReportsComponent } from './bug-reports.component';
4+
import { HttpClientTestingModule } from '@angular/common/http/testing';
5+
import { RouterTestingModule } from '@angular/router/testing';
6+
import { BugService } from '../../services/bug-service/bug.service';
7+
import { BugMockService } from '../../services/bug-service/bug.mock.service';
8+
9+
describe('BugReportsComponent', () => {
10+
let component: BugReportsComponent;
11+
let fixture: ComponentFixture<BugReportsComponent>;
12+
13+
beforeEach(async () => {
14+
await TestBed.configureTestingModule({
15+
declarations: [BugReportsComponent],
16+
imports: [HttpClientTestingModule, RouterTestingModule],
17+
providers: [{ provide: BugService, useValue: new BugMockService() }],
18+
}).compileComponents();
19+
});
20+
21+
beforeEach(() => {
22+
fixture = TestBed.createComponent(BugReportsComponent);
23+
component = fixture.componentInstance;
24+
fixture.detectChanges();
25+
});
26+
27+
it('should create', () => {
28+
expect(component).toBeTruthy();
29+
});
30+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import { BugService } from '../../services/bug-service/bug.service';
3+
import { BugReport } from '../../models/bug.model';
4+
import { ToastService } from '../../services/toast-service/toast.service';
5+
import { formatDate } from '@angular/common';
6+
import { HttpErrorResponse } from '@angular/common/http';
7+
8+
@Component({
9+
selector: 'app-bug-reports',
10+
templateUrl: './bug-reports.component.html',
11+
styleUrls: ['./bug-reports.component.scss'],
12+
})
13+
export class BugReportsComponent implements OnInit {
14+
public bugs: BugReport[] = [];
15+
16+
constructor(private bugService: BugService, private toastService: ToastService) {}
17+
18+
ngOnInit(): void {
19+
this.bugService.getBugs().subscribe(
20+
(res) => {
21+
this.bugs = res.bugs;
22+
},
23+
(err) => {
24+
this.toastService.httpError(err);
25+
}
26+
);
27+
}
28+
29+
public removeBug(index: number): void {
30+
const toRemove: BugReport = this.getAndRemoveBugByIndex(index);
31+
32+
this.bugService.deleteBug(toRemove.id).subscribe(
33+
(res: BugReport) => {
34+
this.toastService.success('Successfully removed bug report.');
35+
},
36+
(error: HttpErrorResponse) => {
37+
this.toastService.httpError(error);
38+
}
39+
);
40+
}
41+
42+
public getFormattedDateForBug(index: number): string {
43+
return formatDate(this.bugs[index].createdAt, 'MM/dd/yyyy', 'en-US');
44+
}
45+
46+
private getAndRemoveBugByIndex(index: number): BugReport {
47+
const toGet: BugReport = this.bugs[index];
48+
this.bugs.splice(index, 1);
49+
return toGet;
50+
}
51+
}

src/app/app-routing.module.ts

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { NgModule } from '@angular/core';
2-
import { RouterModule, Routes } from '@angular/router';
31
import { PageNotFoundComponent } from './common/page-not-found/page-not-found.component';
4-
import { AdminGuard } from './guards/admin/admin.guard';
5-
import { ModGuard } from './guards/mod/mod.guard';
6-
import { UserGuard } from './guards/user/user.guard';
72
import { LoggedInGuard } from './guards/logged-in/logged-in.guard';
3+
import { RouterModule, Routes } from '@angular/router';
4+
import { UserGuard } from './guards/user/user.guard';
5+
import { ModGuard } from './guards/mod/mod.guard';
6+
import { NgModule } from '@angular/core';
87

98
const routes: Routes = [
109
{
@@ -30,6 +29,16 @@ const routes: Routes = [
3029
loadChildren: () => import('./account/account.module').then((m) => m.AccountModule),
3130
canActivate: [LoggedInGuard],
3231
},
32+
{
33+
path: 'user',
34+
loadChildren: () => import('./user/user.module').then((m) => m.UserModule),
35+
canActivate: [LoggedInGuard],
36+
},
37+
{
38+
path: 'forum',
39+
loadChildren: () => import('./forum/forum.module').then((m) => m.ForumModule),
40+
canActivate: [],
41+
},
3342
{
3443
path: '**',
3544
component: PageNotFoundComponent,

0 commit comments

Comments
 (0)