Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRIME-2360 Community Site and HA Site Snapshot #2548

Merged
merged 35 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4ddc432
initial commit
bergomi02 Jul 12, 2024
b6f95c2
Merge branch 'develop' into feature/prime-2360_site_submission_snapshot
bergomi02 Jul 12, 2024
3b74bac
Update mock-community-site.service.ts
bergomi02 Jul 12, 2024
cc0880f
fix unit tests
bergomi02 Jul 12, 2024
0766d8d
add hyper link to download business licence document from site snapshot
bergomi02 Jul 16, 2024
61bc6e6
Merge branch 'develop' into feature/prime-2360_site_submission_snapshot
bergomi02 Jul 25, 2024
7898747
Merge branch 'develop' into feature/prime-2360_site_submission_snapshot
neophyte57 Aug 13, 2024
cc3532b
Merge branch 'develop' into feature/prime-2360_site_submission_snapshot
bergomi02 Aug 19, 2024
4136692
Merge branch 'develop' into feature/prime-2360_site_submission_snapshot
neophyte57 Aug 21, 2024
498ab9a
Merge branch 'develop' into feature/prime-2360_site_submission_snapshot
bergomi02 Aug 26, 2024
fd0c871
fix PR issue
bergomi02 Aug 27, 2024
f2ae606
Merge branch 'develop' into feature/prime-2360_site_submission_snapshot
bergomi02 Sep 3, 2024
dd7e0fd
Merge branch 'develop' into feature/prime-2360_site_submission_snapshot
neophyte57 Sep 5, 2024
220fe2e
Merge branch 'develop' into feature/prime-2360_site_submission_snapshot
neophyte57 Sep 5, 2024
9ac34cc
update site submission detail to use the same component for contacts …
bergomi02 Sep 5, 2024
5fd6fbc
bug fix
bergomi02 Sep 5, 2024
413e0a7
Merge branch 'develop' into feature/prime-2360_site_submission_snapshot
neophyte57 Sep 18, 2024
f2db586
Merge branch 'develop' into feature/prime-2360_site_submission_snapshot
bergomi02 Sep 18, 2024
3fe85aa
Merge branch 'develop' into feature/prime-2360_site_submission_snapshot
bergomi02 Sep 23, 2024
44b294f
fix PR issue
bergomi02 Sep 23, 2024
ae29691
Merge branch 'develop' into feature/prime-2360_site_submission_snapshot
neophyte57 Oct 2, 2024
b41f869
fix PR issue
bergomi02 Oct 2, 2024
9f43a6d
fix PR issue
bergomi02 Oct 3, 2024
db97d34
fix PR issues
bergomi02 Oct 4, 2024
4ff94bf
Merge branch 'develop' into feature/prime-2360_site_submission_snapshot
bergomi02 Oct 15, 2024
bf35b5e
fix migration error
bergomi02 Oct 25, 2024
80718d6
Merge branch 'develop' into feature/prime-2360_site_submission_snapshot
bergomi02 Nov 6, 2024
eb8f773
Merge branch 'develop' into feature/prime-2360_site_submission_snapshot
bergomi02 Nov 9, 2024
4d9ac31
Merge branch 'develop' into feature/prime-2360_site_submission_snapshot
bergomi02 Nov 18, 2024
7f6b7e6
update comments
bergomi02 Nov 20, 2024
3ed9347
fix PR issue
bergomi02 Nov 22, 2024
2f5814f
Merge branch 'develop' into feature/prime-2360_site_submission_snapshot
bergomi02 Nov 22, 2024
310c4b2
fix PR issues
bergomi02 Nov 25, 2024
a517ad1
Minor changes for readability
neophyte57 Nov 25, 2024
67305e4
remove unused references
bergomi02 Nov 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class HealthAuthorityResource {
});
return healthAuthoritySite;
}),
tap((healthAuthoritySite: HealthAuthoritySiteAdmin) => this.logger.info('HEALTH_AUTHORITY_SITE', healthAuthoritySite)),
tap((healthAuthoritySite: HealthAuthoritySiteAdmin) => this.logger.info('HEALTH_AUTHORITY_SITE 2', healthAuthoritySite)),
catchError((error: any) => {
this.toastService.openErrorToast('Health authority site could not be retrieved');
this.logger.error('[Core] HealthAuthorityResource::getHealthAuthorityAdminSite error has occurred: ', error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class HealthAuthoritySiteResource {
return { ...healthAuthoritySite, businessHours };
}),
map((healthAuthoritySiteDto: HealthAuthoritySiteDto) => HealthAuthoritySite.toHealthAuthoritySite(healthAuthoritySiteDto)),
tap((healthAuthoritySite: HealthAuthoritySite) => this.logger.info('HEALTH_AUTHORITY_SITE', healthAuthoritySite)),
tap((healthAuthoritySite: HealthAuthoritySite) => this.logger.info('HEALTH_AUTHORITY_SITE 1', healthAuthoritySite)),
catchError((error: any) => {
if (error.status === HttpStatusCode.NotFound) {
return of(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { SiteAdjudicationDocument } from '@registration/shared/models/adjudicati
import { BusinessLicence } from '@registration/shared/models/business-licence.model';
import { IndividualDeviceProvider } from '@registration/shared/models/individual-device-provider.model';
import { SiteRegistrationListViewModel } from '@registration/shared/models/site-registration.model';
import { SiteSubmission } from '@shared/models/site-submission.model';

@Injectable({
providedIn: 'root'
Expand Down Expand Up @@ -99,6 +100,29 @@ export class SiteResource {
);
}

public getSiteSubmissions(siteId: number): Observable<SiteSubmission[]> {
return this.apiResource.get<SiteSubmission[]>(`sites/${siteId}/site-submissions`, null, null, true)
.pipe(
tap((siteSubmissions: SiteSubmission[]) => this.logger.info('SITE_SUBMISSIONS', siteSubmissions)),
catchError((error: any) => {
this.toastService.openErrorToast('Site Submissions could not be retrieved');
this.logger.error('[SiteSubmissions] getSiteSubmissions::getSiteSubmissions error has occurred: ', error);
throw error;
})
);
}

public getSiteSubmission(siteId: number, siteSubmissionId: number): Observable<SiteSubmission> {
return this.apiResource.get<SiteSubmission>(`sites/${siteId}/site-submission/${siteSubmissionId}`, null, null, true)
.pipe(
tap((siteSubmission: SiteSubmission) => this.logger.info('SITE_SUBMISSION', siteSubmission)),
catchError((error: any) => {
this.toastService.openErrorToast('Site Submission could not be retrieved');
this.logger.error('[SiteSubmission] getSiteSubmission::getSiteSubmission error has occurred: ', error);
throw error;
})
);
}
public getSiteContacts(siteId: number): Observable<{ label: string, email: string }[]> {
return this.getSiteById(siteId)
.pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ import { SiteOverviewPageComponent } from './pages/health-authorities/site-overv
import { SiteEventsPageComponent } from './pages/health-authorities/site-events-page/site-events-page.component';
import { SiteNotesPageComponent } from './pages/health-authorities/site-notes-page/site-notes-page.component';
import { SiteDocumentsPageComponent } from './pages/health-authorities/site-documents-page/site-documents-page.component';
import { HaSiteSubmissionListPageComponent } from './pages/health-authorities/ha-site-submission-list-page/ha-site-submission-list-page.component';
import { HaSiteSubmissionPageComponent } from './pages/health-authorities/ha-site-submission-page/ha-site-submission-page.component';
import { CommunitySiteSubmissionPageComponent } from './pages/community-site-submission-page/community-site-submission-page.component';
import { CommunitySiteSubmissionListPageComponent } from './pages/community-site-submission-list-page/community-site-submission-list-page.component';
import { AdminUsersPageComponent } from './pages/admin-users-page/admin-users-page.component';

const routes: Routes = [
Expand Down Expand Up @@ -311,7 +315,22 @@ const routes: Routes = [
path: AdjudicationRoutes.EVENT_LOG,
component: SiteEventsComponent,
data: { title: 'Event Log' }
}
},
{
path: AdjudicationRoutes.SITE_SUBMISSION_LIST,
children: [
{
path: '',
component: CommunitySiteSubmissionListPageComponent,
data: { title: 'Site Submission List' }
},
{
path: `:ssid/${AdjudicationRoutes.SITE_SUBMISSION}`,
component: CommunitySiteSubmissionPageComponent,
data: { title: 'Site Submission' }
}
]
},
]
},
{
Expand Down Expand Up @@ -375,6 +394,7 @@ const routes: Routes = [
}
]
},

{
// Site registrations is synonymous with site with regards
// to Health Authorities
Expand All @@ -399,7 +419,22 @@ const routes: Routes = [
path: AdjudicationRoutes.DOCUMENT_UPLOAD,
component: SiteDocumentsPageComponent,
data: { title: 'Adjudicator Documents' }
}
},
{
path: AdjudicationRoutes.SITE_SUBMISSION_LIST,
children: [
{
path: '',
component: HaSiteSubmissionListPageComponent,
data: { title: 'Site Submission List' }
},
{
path: `:ssid/${AdjudicationRoutes.SITE_SUBMISSION}`,
component: HaSiteSubmissionPageComponent,
data: { title: 'Site Submission' }
}
]
},
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ import { SiteOverviewPageComponent } from './pages/health-authorities/site-overv
import { SiteEventsPageComponent } from './pages/health-authorities/site-events-page/site-events-page.component';
import { SiteNotesPageComponent } from './pages/health-authorities/site-notes-page/site-notes-page.component';
import { SiteDocumentsPageComponent } from './pages/health-authorities/site-documents-page/site-documents-page.component';
import { CommunitySiteSubmissionPageComponent } from './pages/community-site-submission-page/community-site-submission-page.component';
import { CommunitySiteSubmissionListPageComponent } from './pages/community-site-submission-list-page/community-site-submission-list-page.component';
import { HaSiteSubmissionListPageComponent } from './pages/health-authorities/ha-site-submission-list-page/ha-site-submission-list-page.component';
import { HaSiteSubmissionPageComponent } from './pages/health-authorities/ha-site-submission-page/ha-site-submission-page.component';
import { SiteSubmissionListComponent } from './shared/components/site-submission-list/site-submission-list.component';
import { SiteSubmissionComponent } from './shared/components/site-submission/site-submission.component';
import { AdminUsersContainerComponent } from './shared/components/admin-users-container/admin-users-container.component';
import { AdminUsersPageComponent } from './pages/admin-users-page/admin-users-page.component';
import { AdminUsersTableComponent } from './shared/components/admin-users-table/admin-users-table.component';
Expand Down Expand Up @@ -161,6 +167,12 @@ import { AdminUsersTableComponent } from './shared/components/admin-users-table/
SiteEventsPageComponent,
SiteNotesPageComponent,
SiteDocumentsPageComponent,
CommunitySiteSubmissionPageComponent,
CommunitySiteSubmissionListPageComponent,
HaSiteSubmissionListPageComponent,
HaSiteSubmissionPageComponent,
SiteSubmissionComponent,
SiteSubmissionListComponent,
AdminUsersContainerComponent,
AdminUsersPageComponent,
AdminUsersTableComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export class AdjudicationRoutes {
public static SITE_REMOTE_USERS = 'remote-users';
public static SITE_INFORMATION = 'site-information';

public static SITE_SUBMISSION_LIST = 'site-submission-list';
public static SITE_SUBMISSION = 'site-submission';

public static HEALTH_AUTHORITIES = 'health-authorities';
public static HEALTH_AUTH_CARE_TYPES = 'health-auth-care-types';
public static HEALTH_AUTH_VENDORS = 'vendors';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<app-site-registration-container [content]="content"
[hasActions]="hasActions">
<app-page-header>Site Submission List</app-page-header>
</app-site-registration-container>

<ng-template #content>
<app-site-submission-list [siteId]="siteId"
[currentSubmissionId]="currentSubmissionId"></app-site-submission-list>
</ng-template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { CommunitySiteSubmissionListPageComponent } from './community-site-submission-list-page.component';
import { RouterTestingModule } from '@angular/router/testing';
import { APP_CONFIG, APP_DI_CONFIG } from 'app/app-config.module';
import { KeycloakService } from 'keycloak-angular';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { AdjudicationModule } from '@adjudication/adjudication.module';

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

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [CommunitySiteSubmissionListPageComponent],
imports: [
BrowserAnimationsModule,
HttpClientTestingModule,
RouterTestingModule,
AdjudicationModule
],
providers: [
{
provide: APP_CONFIG,
useValue: APP_DI_CONFIG
},
KeycloakService
],
})
.compileComponents();
});

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { SiteResource } from '@core/resources/site-resource.service';
import { TechnicalSupportPageComponent } from '@registration/pages/technical-support-page/technical-support-page.component';
bergomi02 marked this conversation as resolved.
Show resolved Hide resolved

@Component({
selector: 'app-community-site-submission-list-page',
templateUrl: './community-site-submission-list-page.component.html',
styleUrls: ['./community-site-submission-list-page.component.scss']
})
export class CommunitySiteSubmissionListPageComponent implements OnInit {
public hasActions: boolean;
public siteId: number;
public currentSubmissionId: number;

constructor(
private route: ActivatedRoute,
private siteResource: SiteResource,
) {
this.hasActions = false;
}

ngOnInit(): void {
this.siteId = +this.route.snapshot.params.sid;
this.siteResource.getSiteById(this.siteId)
.subscribe(site => this.currentSubmissionId = site.currentSubmission?.id);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<app-site-registration-container [content]="content"
[hasActions]="hasActions">
<app-page-header>Site Information</app-page-header>
</app-site-registration-container>

<ng-template #content>
<app-site-submission [siteId]="siteId"
[siteSubmissionId]="siteSubmissionId"></app-site-submission>
</ng-template>

<div class="row justify-content-between">
<div class="col pt-4">

<button mat-stroked-button
type="button"
(click)="routeRelativeTo(['../'])">Back</button>

</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { CommunitySiteSubmissionPageComponent } from './community-site-submission-page.component';
import { RouterTestingModule } from '@angular/router/testing';
import { APP_CONFIG, APP_DI_CONFIG } from 'app/app-config.module';
import { KeycloakService } from 'keycloak-angular';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { AdjudicationModule } from '@adjudication/adjudication.module';

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

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [CommunitySiteSubmissionPageComponent],
imports: [
BrowserAnimationsModule,
HttpClientTestingModule,
RouterTestingModule,
AdjudicationModule
],
providers: [
{
provide: APP_CONFIG,
useValue: APP_DI_CONFIG
},
KeycloakService
],
})
.compileComponents();
});

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { AbstractComponent } from '@shared/classes/abstract-component';

@Component({
selector: 'app-community-site-submission-page',
templateUrl: './community-site-submission-page.component.html',
styleUrls: ['./community-site-submission-page.component.scss']
})
export class CommunitySiteSubmissionPageComponent extends AbstractComponent implements OnInit {
public hasActions: boolean;

public siteId: number;
public siteSubmissionId: number;

constructor(
protected route: ActivatedRoute,
protected router: Router,
) {
super(route, router);
this.hasActions = false;
}

ngOnInit(): void {
this.siteId = +this.route.snapshot.params.sid;
this.siteSubmissionId = +this.route.snapshot.params.ssid;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<app-health-authority-site-container [content]="content"
[hasActions]="hasActions">
<app-page-header>Site Submission List</app-page-header>
</app-health-authority-site-container>

<ng-template #content>
<app-site-submission-list [siteId]="siteId"
[currentSubmissionId]="currentSubmissionId"></app-site-submission-list>
</ng-template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { HaSiteSubmissionListPageComponent } from './ha-site-submission-list-page.component';
import { RouterTestingModule } from '@angular/router/testing';
import { APP_CONFIG, APP_DI_CONFIG } from 'app/app-config.module';
import { KeycloakService } from 'keycloak-angular';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { AdjudicationModule } from '@adjudication/adjudication.module';

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

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [HaSiteSubmissionListPageComponent],
imports: [
BrowserAnimationsModule,
HttpClientTestingModule,
RouterTestingModule,
AdjudicationModule
],
providers: [
{
provide: APP_CONFIG,
useValue: APP_DI_CONFIG
},
KeycloakService
],
})
.compileComponents();
});

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
Loading