Skip to content

Commit a347e40

Browse files
chore: test deployment
1 parent 893a985 commit a347e40

File tree

4 files changed

+77
-66
lines changed

4 files changed

+77
-66
lines changed

.github/workflows/main.yml

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -20,54 +20,54 @@ jobs:
2020
cancel-in-progress: true
2121
uses: ./.github/workflows/.build.yml
2222

23-
repo-analysis:
24-
name: Repository analysis
25-
concurrency:
26-
group: ${{ github.workflow }}-${{ github.ref }}-analysis
27-
cancel-in-progress: true
28-
uses: ./.github/workflows/.analysis.yml
29-
secrets: inherit
30-
31-
analysis-results:
32-
name: Analysis Results
33-
needs: [repo-analysis]
34-
if: always()
35-
runs-on: ubuntu-24.04
36-
steps:
37-
- if: contains(needs.*.result, 'failure')
38-
run: echo "At least one job has failed." && exit 1
39-
- run: echo "Success!"
40-
41-
test-admin:
42-
name: Run tests for admin app
43-
needs: build-containers
44-
uses: ./.github/workflows/.tests.yml
45-
with:
46-
app: admin
47-
secrets: inherit
48-
49-
test-public:
50-
name: Run tests for public app
51-
needs: build-containers
52-
uses: ./.github/workflows/.tests.yml
53-
with:
54-
app: public
55-
secrets: inherit
23+
# repo-analysis:
24+
# name: Repository analysis
25+
# concurrency:
26+
# group: ${{ github.workflow }}-${{ github.ref }}-analysis
27+
# cancel-in-progress: true
28+
# uses: ./.github/workflows/.analysis.yml
29+
# secrets: inherit
30+
#
31+
# analysis-results:
32+
# name: Analysis Results
33+
# needs: [repo-analysis]
34+
# if: always()
35+
# runs-on: ubuntu-24.04
36+
# steps:
37+
# - if: contains(needs.*.result, 'failure')
38+
# run: echo "At least one job has failed." && exit 1
39+
# - run: echo "Success!"
40+
#
41+
# test-admin:
42+
# name: Run tests for admin app
43+
# needs: build-containers
44+
# uses: ./.github/workflows/.tests.yml
45+
# with:
46+
# app: admin
47+
# secrets: inherit
48+
#
49+
# test-public:
50+
# name: Run tests for public app
51+
# needs: build-containers
52+
# uses: ./.github/workflows/.tests.yml
53+
# with:
54+
# app: public
55+
# secrets: inherit
5656

57-
review-and-deploy-admin:
58-
if: github.ref_name == 'main' || github.head_ref == 'main'
59-
name: Review and deploy Admin app
60-
needs: [test-admin, test-public]
61-
uses: ./.github/workflows/.review-and-deploy.yml
62-
with:
63-
app: admin
64-
tag: ${{ github.sha }}
65-
secrets: inherit
57+
# review-and-deploy-admin:
58+
# if: github.ref_name == 'main' || github.head_ref == 'main'
59+
# name: Review and deploy Admin app
60+
# needs: [test-admin, test-public]
61+
# uses: ./.github/workflows/.review-and-deploy.yml
62+
# with:
63+
# app: admin
64+
# tag: ${{ github.sha }}
65+
# secrets: inherit
6666

6767
review-and-deploy-public:
68-
if: github.ref_name == 'main' || github.head_ref == 'main'
68+
# if: github.ref_name == 'main' || github.head_ref == 'main'
6969
name: Review and deploy Public app
70-
needs: [test-admin, test-public]
70+
needs: build-containers
7171
uses: ./.github/workflows/.review-and-deploy.yml
7272
with:
7373
app: public

infrastructure/frontend/cloudfront.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ resource "aws_cloudfront_response_headers_policy" "csp_policy" {
150150
"style-src-attr 'self' 'unsafe-inline'",
151151
"font-src 'self' https://fonts.gstatic.com",
152152
"img-src 'self' data: https://fonts.googleapis.com https://*.arcgis.com https://www.w3.org ${var.csp_urls.image_src} ${var.csp_urls.matomo_src}",
153-
"connect-src 'self' ${local.api_url} https://${var.app_env}.loginproxy.gov.bc.ca https://www.arcgis.com https://services.arcgis.com https://tiles.arcgis.com https://maps.arcgis.com ${var.csp_urls.connect_src} ${var.csp_urls.matomo_src}",
153+
"connect-src 'self' ${local.api_url} https://${var.app_env}.loginproxy.gov.bc.ca https://services6.arcgis.com https://www.arcgis.com https://services.arcgis.com https://tiles.arcgis.com https://maps.arcgis.com ${var.csp_urls.connect_src} ${var.csp_urls.matomo_src}",
154154
"media-src 'self'",
155155
"frame-src 'none'",
156156
"worker-src 'self' blob: https://js.arcgis.com",

public/backend/src/recreation-resource/service/recreation-resource-search.service.ts

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,25 +78,24 @@ export class RecreationResourceSearchService {
7878
lon,
7979
});
8080

81-
const [recreationResources, aggregatedCounts, filteredIds] =
82-
await Promise.all([
83-
this.prisma.$queryRaw<any[]>(recreationResourcePageQuerySql),
84-
this.prisma.$queryRaw<AggregatedRecordCount[]>(
85-
filterOptionCountsQuerySql,
86-
),
87-
this.prisma.$queryRaw<{ rec_resource_id: string }[]>`
88-
SELECT rec_resource_id
89-
FROM recreation_resource_search_view
90-
${whereClause}
91-
`,
92-
]);
81+
const [recreationResources, filterResults] = await Promise.all([
82+
this.prisma.$queryRaw<any[]>(recreationResourcePageQuerySql),
83+
this.prisma.$queryRaw<any[]>(filterOptionCountsQuerySql),
84+
]);
85+
86+
const unpaginatedIds =
87+
filterResults.find((row) => row.type === "ids")?.rec_resource_ids ?? [];
88+
89+
const aggregatedCounts: AggregatedRecordCount[] = filterResults.filter(
90+
(row) => row.type !== "ids",
91+
);
9392

9493
return this.formatResults(
9594
recreationResources,
9695
aggregatedCounts,
9796
page,
9897
take,
99-
filteredIds,
98+
unpaginatedIds,
10099
);
101100
}
102101

@@ -124,15 +123,15 @@ export class RecreationResourceSearchService {
124123
aggregatedRecordCounts: AggregatedRecordCount[],
125124
page: number,
126125
limit?: number,
127-
filteredIds: { rec_resource_id: string }[] = [],
126+
unpaginatedIds: string[] = [],
128127
): PaginatedRecreationResourceDto {
129128
return {
130129
data: formatSearchResults(recreationResources),
131130
page,
132131
limit,
133132
total: recreationResources?.[0]?.total_count ?? 0,
134133
filters: buildFilterMenu(aggregatedRecordCounts),
135-
recResourceIds: filteredIds.map((record) => record.rec_resource_id),
134+
recResourceIds: unpaginatedIds,
136135
};
137136
}
138137

public/backend/src/recreation-resource/utils/buildSearchFilterOptionCountsQuery.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ export function buildFilterOptionCountsQuery({
3838
FROM recreation_resource_search_view
3939
${whereClause}
4040
),
41+
filtered_ids AS (
42+
SELECT ARRAY_AGG(rec_resource_id) AS rec_resource_ids
43+
FROM filtered_resources
44+
),
4145
facility_counts AS (
4246
SELECT
4347
SUM(has_toilets::int)::int AS total_toilet_count,
@@ -107,32 +111,40 @@ export function buildFilterOptionCountsQuery({
107111
'activity' AS type,
108112
ac.recreation_activity_code::TEXT AS code,
109113
ac.description,
110-
ac.recreation_activity_count AS count
114+
ac.recreation_activity_count AS count,
115+
NULL::TEXT[] AS rec_resource_ids
111116
FROM activity_counts ac
112117
113118
UNION ALL
114119
115120
SELECT
116-
'district', dc.code, dc.description, dc.count
121+
'district', dc.code, dc.description, dc.count, NULL::TEXT[] AS rec_resource_ids
117122
FROM district_counts dc
118123
119124
UNION ALL
120125
121126
SELECT
122-
'access', ac.code, ac.description, ac.count
127+
'access', ac.code, ac.description, ac.count, NULL::TEXT[] AS rec_resource_ids
123128
FROM access_counts ac
124129
125130
UNION ALL
126131
127132
SELECT
128-
'type', tc.code, tc.description, tc.count
133+
'type', tc.code, tc.description, tc.count, NULL::TEXT[] AS rec_resource_ids
129134
FROM type_counts tc
130135
131136
UNION ALL
132137
133-
SELECT 'facilities', 'toilet', 'Toilets', total_toilet_count FROM facility_counts
138+
SELECT 'facilities', 'toilet', 'Toilets', total_toilet_count, NULL::TEXT[] AS rec_resource_ids
139+
FROM facility_counts
140+
141+
UNION ALL
142+
143+
SELECT 'facilities', 'table', 'Tables', total_table_count, NULL::TEXT[] AS rec_resource_ids
144+
FROM facility_counts
134145
135146
UNION ALL
136147
137-
SELECT 'facilities', 'table', 'Tables', total_table_count FROM facility_counts;`;
148+
SELECT 'ids', NULL, NULL, NULL, rec_resource_ids
149+
FROM filtered_ids;`;
138150
}

0 commit comments

Comments
 (0)