Skip to content

Commit cdb227a

Browse files
authored
Merge branch 'develop' into dependabot/npm_and_yarn/prime-angular-frontend/shell-quote-1.8.4
2 parents ce7760e + 6b9b26c commit cdb227a

33 files changed

Lines changed: 22197 additions & 101 deletions
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
FROM public.ecr.aws/bitnami/python:3.12.4
2-
3-
WORKDIR /opt/app-root/src
1+
FROM python:3.12.4
42

3+
WORKDIR /opt/app-root/src/
54

65
# Install dependencies
7-
RUN install_packages gcc libc6-dev libpq-dev libmagic-dev
6+
RUN apt-get update -yqq && \
7+
apt-get install -y gcc libc6-dev libpq-dev libmagic-dev && \
8+
rm -rf /var/lib/apt/lists/*
9+
810

911
# Install the requirements
1012
COPY ./requirements.txt .
@@ -14,9 +16,13 @@ RUN pip install wheel && \
1416
RUN apt-get purge -y --auto-remove gcc libc6-dev
1517

1618
COPY . .
19+
# 4. CRITICAL FOR OPENSHIFT: Fix permissions for random user execution
20+
RUN chgrp -R 0 /opt/app-root && \
21+
chmod -R g=u /opt/app-root && \
22+
chmod +x /opt/app-root/src/app.sh
1723

1824
ENV FLASK_APP app.py
1925

2026
# Run the server
2127
EXPOSE 5001 9191
22-
ENTRYPOINT /opt/app-root/src/app.sh backend
28+
ENTRYPOINT ["./app.sh", "backend"]

infrastructure/helm/templates/frontend.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ spec:
8484
volumeMounts:
8585
- name: vanity-tls-certs
8686
readOnly: true
87-
mountPath: /opt/bitnami/nginx/conf/certs
87+
mountPath: /etc/nginx/certs
8888
- name: plr-integration-volume
8989
readOnly: true
90-
mountPath: /opt/bitnami/nginx/conf/certs/plr
90+
mountPath: /etc/nginx/certs/plr
9191
- name: nginx-config
9292
readOnly: true
93-
mountPath: /opt/bitnami/nginx/conf/nginx.conf
93+
mountPath: /etc/nginx/nginx.conf
9494
subPath: nginx.conf
9595
- name: env-config
9696
readOnly: true
@@ -160,27 +160,27 @@ data:
160160
#user www www; ## Default: nobody
161161
162162
worker_processes auto;
163-
error_log "/opt/bitnami/nginx/logs/error.log";
164-
pid "/opt/bitnami/nginx/tmp/nginx.pid";
163+
error_log "/var/log/nginx/error.log";
164+
pid "/tmp/nginx.pid";
165165
166166
events {
167167
worker_connections 1024;
168168
}
169169
170170
http {
171-
include mime.types;
171+
include /etc/nginx/mime.types;
172172
default_type application/octet-stream;
173173
log_format main '$remote_addr - $remote_user [$time_local] '
174174
'"$request" $status $body_bytes_sent "$http_referer" '
175175
'"$http_user_agent" "$http_x_forwarded_for"';
176-
access_log "/opt/bitnami/nginx/logs/access.log" main;
176+
access_log "/var/log/nginx/access.log" main;
177177
# add_header X-Frame-Options SAMEORIGIN;
178178
179-
client_body_temp_path "/opt/bitnami/nginx/tmp/client_body" 1 2;
180-
proxy_temp_path "/opt/bitnami/nginx/tmp/proxy" 1 2;
181-
fastcgi_temp_path "/opt/bitnami/nginx/tmp/fastcgi" 1 2;
182-
scgi_temp_path "/opt/bitnami/nginx/tmp/scgi" 1 2;
183-
uwsgi_temp_path "/opt/bitnami/nginx/tmp/uwsgi" 1 2;
179+
client_body_temp_path "/tmp/client_body" 1 2;
180+
proxy_temp_path "/tmp/proxy" 1 2;
181+
fastcgi_temp_path "/tmp/fastcgi" 1 2;
182+
scgi_temp_path "/tmp/scgi" 1 2;
183+
uwsgi_temp_path "/tmp/uwsgi" 1 2;
184184
185185
sendfile on;
186186
# tcp_nopush on;

infrastructure/prime-app-ephemeral-template.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,13 @@ objects:
143143
volumeMounts:
144144
- name: vanity-tls-certs
145145
readOnly: true
146-
mountPath: /opt/bitnami/nginx/conf/certs
146+
mountPath: /etc/nginx/certs
147147
- name: plr-integration-volume
148148
readOnly: true
149-
mountPath: /opt/bitnami/nginx/conf/certs/plr
149+
mountPath: /etc/nginx/certs/plr
150150
- name: nginx-config
151151
readOnly: true
152-
mountPath: /opt/bitnami/nginx/conf/nginx.conf
152+
mountPath: /etc/nginx/nginx.conf
153153
subPath: nginx.conf
154154
- name: env-config
155155
readOnly: true
@@ -218,27 +218,28 @@ objects:
218218
#user www www; ## Default: nobody
219219
220220
worker_processes auto;
221-
error_log "/opt/bitnami/nginx/logs/error.log";
222-
pid "/opt/bitnami/nginx/tmp/nginx.pid";
221+
error_log "/var/log/nginx/error.log";
222+
error_log "/tmp/error_fluentbit.log";
223+
pid "/tmp/nginx.pid";
223224
224225
events {
225226
worker_connections 1024;
226227
}
227228
228229
http {
229-
include mime.types;
230+
include /etc/nginx/mime.types;
230231
default_type application/octet-stream;
231232
log_format main '$remote_addr - $remote_user [$time_local] '
232233
'"$request" $status $body_bytes_sent "$http_referer" '
233234
'"$http_user_agent" "$http_x_forwarded_for"';
234-
access_log "/opt/bitnami/nginx/logs/access.log" main;
235+
access_log "/var/log/nginx/access.log" main;
235236
# add_header X-Frame-Options SAMEORIGIN;
236237
237-
client_body_temp_path "/opt/bitnami/nginx/tmp/client_body" 1 2;
238-
proxy_temp_path "/opt/bitnami/nginx/tmp/proxy" 1 2;
239-
fastcgi_temp_path "/opt/bitnami/nginx/tmp/fastcgi" 1 2;
240-
scgi_temp_path "/opt/bitnami/nginx/tmp/scgi" 1 2;
241-
uwsgi_temp_path "/opt/bitnami/nginx/tmp/uwsgi" 1 2;
238+
client_body_temp_path "/tmp/client_body" 1 2;
239+
proxy_temp_path "/tmp/proxy" 1 2;
240+
fastcgi_temp_path "/tmp/fastcgi" 1 2;
241+
scgi_temp_path "/tmp/scgi" 1 2;
242+
uwsgi_temp_path "/tmp/uwsgi" 1 2;
242243
243244
sendfile on;
244245
# tcp_nopush on;
@@ -419,6 +420,7 @@ objects:
419420
}
420421
}
421422
}
423+
422424

423425
# Frontend Service
424426
- apiVersion: v1
@@ -443,7 +445,8 @@ objects:
443445
port: 8890
444446
targetPort: 8890
445447
selector:
446-
name: ${SVC_NAME}-frontend
448+
app.kubernetes.io/part-of: ${SVC_NAME}
449+
app.kubernetes.io/name: frontend
447450
# Ingress
448451
- apiVersion: networking.k8s.io/v1
449452
kind: Ingress
@@ -745,7 +748,8 @@ objects:
745748
port: 8080
746749
targetPort: 8080
747750
selector:
748-
name: ${SVC_NAME}-webapi
751+
app.kubernetes.io/name: webapi
752+
app.kubernetes.io/part-of: ${SVC_NAME}
749753

750754
###########################################
751755
### Document Manager (backend) ###

infrastructure/prime-app-template.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,13 @@ objects:
158158
volumeMounts:
159159
- name: vanity-tls-certs
160160
readOnly: true
161-
mountPath: /opt/bitnami/nginx/conf/certs
161+
mountPath: /etc/nginx/certs
162162
- name: plr-integration-volume
163163
readOnly: true
164-
mountPath: /opt/bitnami/nginx/conf/certs/plr
164+
mountPath: /etc/nginx/certs/plr
165165
- name: nginx-config
166166
readOnly: true
167-
mountPath: /opt/bitnami/nginx/conf/nginx.conf
167+
mountPath: /etc/nginx/nginx.conf
168168
subPath: nginx.conf
169169
- name: env-config
170170
readOnly: true
@@ -259,28 +259,28 @@ objects:
259259
#user www www; ## Default: nobody
260260
261261
worker_processes auto;
262-
error_log "/opt/bitnami/nginx/logs/error.log";
262+
error_log "/var/log/nginx/error.log";
263263
error_log "/tmp/error_fluentbit.log";
264-
pid "/opt/bitnami/nginx/tmp/nginx.pid";
264+
pid "/tmp/nginx.pid";
265265
266266
events {
267267
worker_connections 1024;
268268
}
269269
270270
http {
271-
include mime.types;
271+
include /etc/nginx/mime.types;
272272
default_type application/octet-stream;
273273
log_format main '$remote_addr - $remote_user [$time_local] '
274274
'"$request" $status $body_bytes_sent "$http_referer" '
275275
'"$http_user_agent" "$http_x_forwarded_for"';
276-
access_log "/opt/bitnami/nginx/logs/access.log" main;
276+
access_log "/var/log/nginx/access.log" main;
277277
# add_header X-Frame-Options SAMEORIGIN;
278278
279-
client_body_temp_path "/opt/bitnami/nginx/tmp/client_body" 1 2;
280-
proxy_temp_path "/opt/bitnami/nginx/tmp/proxy" 1 2;
281-
fastcgi_temp_path "/opt/bitnami/nginx/tmp/fastcgi" 1 2;
282-
scgi_temp_path "/opt/bitnami/nginx/tmp/scgi" 1 2;
283-
uwsgi_temp_path "/opt/bitnami/nginx/tmp/uwsgi" 1 2;
279+
client_body_temp_path "/tmp/client_body" 1 2;
280+
proxy_temp_path "/tmp/proxy" 1 2;
281+
fastcgi_temp_path "/tmp/fastcgi" 1 2;
282+
scgi_temp_path "/tmp/scgi" 1 2;
283+
uwsgi_temp_path "/tmp/uwsgi" 1 2;
284284
285285
sendfile on;
286286
# tcp_nopush on;
@@ -882,8 +882,6 @@ objects:
882882
image: >-
883883
image-registry.openshift-image-registry.svc:5000/${OC_LICENSE_PLATE}-tools/prime-document-manager:${IMAGE_TAG}
884884
command:
885-
# Script force waits migration pod execution until PostgreSQL is verified to
886-
# be open to query connections.
887885
- /opt/app-root/src/app.sh
888886
args:
889887
- migrate

prime-angular-frontend/ci.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM public.ecr.aws/bitnami/nginx:1.21
1+
FROM nginxinc/nginx-unprivileged:1.20
22

33
COPY dist/angular-frontend/browser /opt/app-root/src
44

prime-angular-frontend/openshift.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ RUN ng build --configuration=production
4444
########################################
4545
### Stage 2 - Production environment ###
4646
########################################
47-
FROM public.ecr.aws/bitnami/nginx:1.20
47+
FROM nginxinc/nginx-unprivileged:1.20
4848
ARG SVC_NAME
4949
ENV SVC_NAME ${SVC_NAME}
5050

prime-angular-frontend/src/app/modules/adjudication/pages/enrollee-access-term-enrolment/enrollee-access-term-enrolment.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import { RouteUtils } from '@lib/utils/route-utils.class';
1313
import { AdjudicationRoutes } from '@adjudication/adjudication.routes';
1414

1515
@Component({
16-
selector: 'app-enrollee-access-term-enrolment',
17-
templateUrl: './enrollee-access-term-enrolment.component.html',
18-
styleUrls: ['./enrollee-access-term-enrolment.component.scss'],
19-
standalone: false
16+
selector: 'app-enrollee-access-term-enrolment',
17+
templateUrl: './enrollee-access-term-enrolment.component.html',
18+
styleUrls: ['./enrollee-access-term-enrolment.component.scss'],
19+
standalone: false
2020
})
2121
export class EnrolleeAccessTermEnrolmentComponent extends AbstractComponent implements OnInit {
2222
public busy: Subscription;
@@ -39,8 +39,8 @@ export class EnrolleeAccessTermEnrolmentComponent extends AbstractComponent impl
3939

4040
public ngOnInit() {
4141
const enrolleeId = this.route.snapshot.params.id;
42-
const accessTermId = this.route.snapshot.params.aid;
43-
this.busy = this.adjudicationResource.getSubmissionForAgreement(enrolleeId, accessTermId)
42+
const submissionId = this.route.snapshot.params.aid;
43+
this.busy = this.adjudicationResource.getSubmissionForAgreement(enrolleeId, submissionId)
4444
.subscribe((enrolmentSubmission: HttpEnrolleeSubmission) =>
4545
this.enrolmentSubmission = this.enrolleeSubmissionAdapterResponse(enrolmentSubmission)
4646
);

prime-angular-frontend/src/app/modules/adjudication/pages/enrollee-enrolments/enrollee-enrolments.component.html

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@
3636
isCurrent: enrolmentCard.isCurrent && !isUnderAdjudication(enrollee),
3737
submittedDate: enrolmentCard.submissionCreatedDate,
3838
acceptedDate: enrolmentCard.agreementAcceptedDate,
39+
approvedDate: enrolmentCard.enrolmentApprovedDate,
40+
agreementType: enrolmentCard.agreementType,
3941
remoteAccess: enrolmentCard.requestedRemoteAccess,
40-
enrolmentRoute: [enrolmentCard.agreementId, AdjudicationRoutes.ENROLLEE_ACCESS_TERM_ENROLMENT],
42+
enrolmentRoute: [enrolmentCard.submissionId, AdjudicationRoutes.ENROLLEE_ACCESS_TERM_ENROLMENT],
4143
toaRoute: [enrolmentCard.agreementId, AdjudicationRoutes.ENROLLEE_ACCESS_TERM],
4244
isLast: last
4345
}">
@@ -49,6 +51,8 @@
4951
let-isCurrent="isCurrent"
5052
let-submittedDate="submittedDate"
5153
let-acceptedDate="acceptedDate"
54+
let-approvedDate="approvedDate"
55+
let-agreementType="agreementType"
5256
let-remoteAccess="remoteAccess"
5357
let-enrolmentRoute="enrolmentRoute"
5458
let-toaRoute="toaRoute"
@@ -61,19 +65,25 @@
6165
to mat-card-title not allowing the use of flexbox
6266
-->
6367
<div class="card-title">
64-
<small>Submitted {{ submittedDate | formatDate: 'MMMM Do YYYY' }}</small>
68+
<small>Enrolment submitted on {{ submittedDate | formatDate: 'MMMM Do YYYY' }}</small>
6569
<small *ngIf="isCurrent">CURRENT</small>
6670
</div>
6771

68-
<p class="text-muted">
69-
<ng-container *ngIf="toaRoute; else current">
70-
This PRIME enrolment was approved on {{ acceptedDate | formatDate: 'MMMM Do YYYY' }}
72+
<p>
73+
<ng-container *ngIf="approvedDate; else current">
74+
{{ 'This PRIME enrolment was approved on ' + (approvedDate | formatDate: 'MMMM Do YYYY') }}
7175
</ng-container>
7276
<ng-template #current>
73-
Enrollee edited and submitted an Enrolment, but has not signed the Terms of Access
77+
This PRIME enrolment was not approved
7478
</ng-template>
7579
</p>
76-
80+
<ng-container *ngIf="approvedDate">
81+
<p>
82+
TOA assigned - {{ agreementType }}
83+
{{ acceptedDate ? ', TOA was accepted on ' + (acceptedDate | formatDate: 'MMMM Do YYYY') :
84+
', TOA was not accepted' }}
85+
</p>
86+
</ng-container>
7787
<div *ngIf="remoteAccess"
7888
class="card-title">
7989
User Requested Remote Access
@@ -82,10 +92,10 @@
8292
<mat-card-actions>
8393
<button mat-button
8494
color="primary"
85-
[routerLink]="enrolmentRoute">View Enrolment</button>
95+
[routerLink]="enrolmentRoute">View Enrolment Detail</button>
8696
<button mat-button
8797
color="primary"
88-
[disabled]="!acceptedDate"
98+
*ngIf="acceptedDate"
8999
[routerLink]="toaRoute">View Terms of Access</button>
90100
</mat-card-actions>
91101
</mat-card>

prime-angular-frontend/src/app/modules/adjudication/pages/site-overview/site-overview.component.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,16 @@
8989
</app-page-section>
9090

9191
<app-page-section *ngIf="site?.remoteUsers?.length">
92-
<app-page-subheader>
92+
<app-page-subheader class="remote-users-header">
9393
<ng-container appPageSubheaderTitle>
9494
<mat-icon class="mr-2">account_circle</mat-icon>
9595
Remote Practitioners
9696
</ng-container>
97+
<button mat-icon-button
98+
matTooltip="Remote User Export (csv file)"
99+
(click)="onExportRemoteUsers('csv')">
100+
<mat-icon>description</mat-icon>
101+
</button>
97102
<button mat-icon-button
98103
matTooltip="View Remote Practitioners"
99104
(click)="onRoute([organization.id, AdjudicationRoutes.SITE_REGISTRATION, site.id, AdjudicationRoutes.SITE_REMOTE_USERS])">

prime-angular-frontend/src/app/modules/adjudication/pages/site-overview/site-overview.component.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ import { OrganizationClaim } from '@registration/shared/models/organization-clai
2626
import { ConfigService } from '@config/config.service';
2727
import { VendorConfig } from '@config/config.model';
2828
import { LinkSiteComponent } from '@shared/components/dialogs/content/link-site/link-site.component';
29+
import { UtilsService } from '@core/services/utils.service';
2930

3031
@Component({
31-
selector: 'app-site-overview',
32-
templateUrl: './site-overview.component.html',
33-
styleUrls: ['./site-overview.component.scss'],
34-
standalone: false
32+
selector: 'app-site-overview',
33+
templateUrl: './site-overview.component.html',
34+
styleUrls: ['./site-overview.component.scss'],
35+
standalone: false
3536
})
3637
export class SiteOverviewComponent implements OnInit {
3738
public busy: Subscription;
@@ -61,6 +62,7 @@ export class SiteOverviewComponent implements OnInit {
6162
private organizationResource: OrganizationResource,
6263
private fb: UntypedFormBuilder,
6364
private configService: ConfigService,
65+
private utilsService: UtilsService,
6466
) {
6567
this.hasActions = true;
6668
this.refresh = new BehaviorSubject<boolean>(null);
@@ -179,6 +181,15 @@ export class SiteOverviewComponent implements OnInit {
179181
});
180182
}
181183

184+
public onExportRemoteUsers(type: string): void {
185+
this.busy = this.adjudicationResource.getRemoteUserExport(this.site.id, type)
186+
.subscribe((file: string) => {
187+
const blob = this.utilsService.base64ToBlob(file, 'text/csv');
188+
//const fileBlob = new Blob([file.fileContents], { type: file.contentType });
189+
this.utilsService.downloadDocument(blob, "remoteUserExport.csv");
190+
});
191+
}
192+
182193
public ngOnInit(): void {
183194
this.createFormInstance();
184195

0 commit comments

Comments
 (0)