Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/npm_and_yarn/prime-angular-fro…
Browse files Browse the repository at this point in the history
…ntend/axios-1.7.4
  • Loading branch information
bergomi02 authored Jan 7, 2025
2 parents 691ad0c + 9fdf3e5 commit a7381d8
Show file tree
Hide file tree
Showing 185 changed files with 123,813 additions and 488 deletions.
77 changes: 0 additions & 77 deletions .github/workflows/build-deploy-backup-dev.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
paths-ignore: # do NOT trigger on changes to backup service.
- prime-database-backup/**
- .github/workflows/build-deploy-backup-dev.yml
branches-ignore:
- 'develop'
- 'test'
Expand All @@ -13,7 +12,6 @@ on:
pull_request:
paths-ignore:
- prime-database-backup/**
- .github/workflows/build-deploy-backup-dev.yml
branches-ignore:
- 'develop'
- 'test'
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
defaults:
run:
working-directory: ./prime-angular-frontend

if: github.ref != 'develop' || (github.ref == 'develop' && github.event.pull_request.merged == true)

runs-on: ubuntu-latest
Expand Down Expand Up @@ -59,15 +59,15 @@ jobs:
- name: Collect Frontend Report
run: |
cc-test-reporter format-coverage -t lcov -o coverage/frontend.json coverage/lcov.info
- name: Create frontend coverage file artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: frontend
path: ./prime-angular-frontend/coverage/frontend.json
retention-days: 1


collect-backend-coverage:
defaults:
run:
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
run: |
cd ../
dotnet tool install -g dotnet-reportgenerator-globaltool --version 5.3.6
- uses: amancevice/setup-code-climate@v0
with:
cc_test_reporter_id: ${{ secrets.CC_TEST_REPORTER_ID }}
Expand All @@ -122,12 +122,12 @@ jobs:
cd ../prime-dotnet-webapi
cc-test-reporter format-coverage -t lcov -o ../prime-dotnet-webapi-tests/coverage/backend.json ../prime-dotnet-webapi-tests/coverage/lcov.info -p /home/runner/work/moh-prime/moh-prime/prime-dotnet-webapi
- name: Create backend coverage file artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: backend
path: ./prime-dotnet-webapi-tests/coverage/backend.json
retention-days: 1


codeclimate-sum-coverage:
needs: [ collect-frontend-coverage, collect-backend-coverage ]
Expand All @@ -146,25 +146,25 @@ jobs:
cc_test_reporter_version: latest # optional

- name: Download frontend artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: frontend
# path: frontend/

- name: Download backend artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: backend
# path: backend/

- name: Sum files
run: |
run: |
cc-test-reporter sum-coverage -p 2 frontend.json backend.json
cc-test-reporter upload-coverage -i ./coverage/codeclimate.json
- name: Create summed report
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: summed
path: ./coverage/codeclimate.json
retention-days: 1
retention-days: 1
6 changes: 4 additions & 2 deletions infrastructure/prime-app-ephemeral-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ objects:
"url": "",
"realm": "",
"clientId": ""
}
}
}
}
Expand Down Expand Up @@ -688,6 +688,8 @@ objects:
name: pharmanet-api
- configMapRef:
name: verifiable-credential
- configMapRef:
name: provider-enrolment-team
- secretRef:
name: canada-post-addresscomplete-secrets
- secretRef:
Expand Down Expand Up @@ -997,7 +999,7 @@ objects:
memory: 100Mi
requests:
cpu: 5m
memory: 50Mi
memory: 50Mi
readinessProbe:
exec:
command:
Expand Down
6 changes: 4 additions & 2 deletions infrastructure/prime-app-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ objects:
- name: log-storage
mountPath: /tmp/
terminationMessagePolicy: File

triggers:
- type: ConfigChange
- type: ImageChange
Expand Down Expand Up @@ -730,6 +730,8 @@ objects:
name: pharmanet-api
- configMapRef:
name: verifiable-credential
- configMapRef:
name: provider-enrolment-team
- secretRef:
name: canada-post-addresscomplete-secrets
- secretRef:
Expand Down Expand Up @@ -1078,7 +1080,7 @@ objects:
memory: 512Mi
requests:
cpu: 5m
memory: 50Mi
memory: 50Mi
env:
- name: REDIS_PASSWORD
valueFrom:
Expand Down
17 changes: 17 additions & 0 deletions infrastructure/redis/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM rhel8/redis-6

# Redis image based on Software Collections packages
#
# Volumes:
# * /var/lib/redis/data - Datastore for Redis
# Environment:
# * $REDIS_PASSWORD - Database password

EXPOSE 6379
USER root
# Add Tini
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--", "container-entrypoint"]
CMD ["run-redis"]
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 Expand Up @@ -606,4 +630,37 @@ export class SiteResource {
})
);
}

public archiveSite(siteId: number, note: string): NoContent {
return this.apiResource.post<NoContent>(`sites/${siteId}/archive`, { note })
.pipe(
NoContentResponse,
catchError((error: any) => {
this.logger.error('[SiteRegistration] SiteResource::archiveSite error has occurred: ', error);
throw error;
})
);
}

public restoreArchivedSite(siteId: number, note: string): NoContent {
return this.apiResource.post<NoContent>(`sites/${siteId}/restore`, { note })
.pipe(
NoContentResponse,
catchError((error: any) => {
this.logger.error('[SiteRegistration] SiteResource::restoreArchivedSite error has occurred: ', error);
throw error;
})
);
}

public canRestoreSite(siteId: number): Observable<boolean> {
return this.apiResource.get<boolean>(`sites/${siteId}/can-restore`)
.pipe(
map((response: ApiHttpResponse<boolean>) => response.result),
catchError((error: any) => {
this.logger.error('[SiteRegistration] SiteResource::canRestoreSite error has occurred: ', error);
throw error;
})
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ export enum SiteAdjudicationAction {
REQUEST_CHANGES = 1,
APPROVE = 2,
REJECT = 3,
UNREJECT = 4
UNREJECT = 4,
ARCHIVE = 7,
RESTORE = 8,
}
3 changes: 2 additions & 1 deletion prime-angular-frontend/src/app/lib/enums/site-status.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ export enum SiteStatusType {
IN_REVIEW = 2,
LOCKED = 3,
EDITABLE_NOT_APPROVED = 4,
FLAGGED = 5
FLAGGED = 5,
ARCHIVED = 8,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { DefaultValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import {
Directive,
ElementRef,
HostListener,
Renderer2,
forwardRef,
} from '@angular/core';

@Directive({
selector: 'input[appTrimSpace]',
providers: [
{
provide: NG_VALUE_ACCESSOR,
multi: true,
useExisting: forwardRef(() => TrimSpaceInputDirective),
},
],
})

export class TrimSpaceInputDirective extends DefaultValueAccessor {
@HostListener('input', ['$event']) input($event: InputEvent) {
const target = $event.target as HTMLInputElement;
const start = target.selectionStart;

target.value = target.value.trim();
target.setSelectionRange(start, start);
this.onChange(target.value);
}

constructor(renderer: Renderer2, elementRef: ElementRef) {
super(renderer, elementRef, false);
}
}
Loading

0 comments on commit a7381d8

Please sign in to comment.