Skip to content

Commit

Permalink
feat(user-management.component): initial commit for user-management.c…
Browse files Browse the repository at this point in the history
…omponent

feat #553
  • Loading branch information
alejandrosaenz117 committed Jan 25, 2021
1 parent 37aea71 commit 7ca32e2
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 20 deletions.
12 changes: 8 additions & 4 deletions frontend/src/app/administration/administration.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<h5>Administration Area</h5>
<app-invite-user></app-invite-user>
<br>
<app-settings></app-settings>
<h5>Administration</h5>
<div class="container col-12 col-md-8 mx-auto">
<app-invite-user></app-invite-user>
<br>
<app-settings></app-settings>
<br>
<app-user-management></app-user-management>
</div>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="container col-12 col-md-7 mx-auto">
<div>
<p-card>
<h6>Invite a User</h6>
<div id="formContent">
Expand All @@ -20,4 +20,4 @@ <h6>Invite a User</h6>
</form>
</div>
</p-card>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="container col-12 col-md-7 mx-auto">
<div>
<p-card>
<h6>Application Email Settings</h6>
<div id="formContent">
Expand Down Expand Up @@ -45,4 +45,4 @@ <h6>Application Email Settings</h6>
</form>
</div>
</p-card>
</div>
</div>
2 changes: 2 additions & 0 deletions frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { CardModule } from 'primeng/card';
import { PasswordModule } from 'primeng/password';
import { EmailValidateComponent } from './email-validate/email-validate.component';
import { ChartModule } from 'primeng/chart';
import { UserManagementComponent } from './user-management/user-management.component';
@NgModule({
declarations: [
AppComponent,
Expand All @@ -68,6 +69,7 @@ import { ChartModule } from 'primeng/chart';
UserProfileComponent,
SettingsComponent,
EmailValidateComponent,
UserManagementComponent,
],
imports: [
BrowserModule,
Expand Down
18 changes: 6 additions & 12 deletions frontend/src/app/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ import { environment } from '../environments/environment';
})
export class AppService {
constructor(private http: HttpClient, private sanitizer: DomSanitizer) {}

api = environment.apiUrl;
// TODO: Delete this monstrosity that I have created
// Please forgive me coding gods!
// We need to find a better solution than to individually
// query for each image. This will not work well with reports!

/**
* Function is responsible for initial retrevial of organizations on dashboard loading
* @returns all organization information to the dashboard
Expand Down Expand Up @@ -238,7 +232,7 @@ export class AppService {
createAsset(asset: Asset) {
return this.http.post(
`${this.api}/organization/${asset.organization}/asset`,
asset,
asset
);
}

Expand All @@ -264,7 +258,7 @@ export class AppService {
updateAsset(asset: Asset) {
return this.http.patch(
`${this.api}/organization/${asset.organization}/asset/${asset.id}`,
asset,
asset
);
}

Expand Down Expand Up @@ -305,11 +299,11 @@ export class AppService {
updateAssessment(
assessment: Assessment,
assessmentId: number,
assetId: number,
assetId: number
) {
return this.http.patch(
`${this.api}/asset/${assetId}/assessment/${assessmentId}`,
assessment,
assessment
);
}

Expand All @@ -321,7 +315,7 @@ export class AppService {
*/
getAssessment(assetId: number, assessmentId: number) {
return this.http.get(
`${this.api}/asset/${assetId}/assessment/${assessmentId}`,
`${this.api}/asset/${assetId}/assessment/${assessmentId}`
);
}

Expand Down Expand Up @@ -373,7 +367,7 @@ export class AppService {
return this.http.post(
`${this.api}/report/generate`,
generateObject,
httpOptions,
httpOptions
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>user-management works!</p>
Empty file.
24 changes: 24 additions & 0 deletions frontend/src/app/user-management/user-management.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { UserManagementComponent } from './user-management.component';

describe('UserManagementComponent', () => {
let component: UserManagementComponent;
let fixture: ComponentFixture<UserManagementComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [UserManagementComponent],
}).compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(UserManagementComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
12 changes: 12 additions & 0 deletions frontend/src/app/user-management/user-management.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-user-management',
templateUrl: './user-management.component.html',
styleUrls: ['./user-management.component.sass'],
})
export class UserManagementComponent implements OnInit {
constructor() {}

ngOnInit(): void {}
}

0 comments on commit 7ca32e2

Please sign in to comment.