Skip to content

Commit 7557abd

Browse files
authored
Merge pull request #155 from Resgrid/develop
CU-868f4q2qr Adding server switch to login form, eventing url change.
2 parents 4b827a8 + 174bb40 commit 7557abd

File tree

22 files changed

+1982
-27
lines changed

22 files changed

+1982
-27
lines changed

.DS_Store

0 Bytes
Binary file not shown.

.github/workflows/react-native-cicd.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,4 +276,41 @@ jobs:
276276
run: |
277277
firebase appdistribution:distribute ./ResgridUnit-ios-adhoc.ipa --app ${{ secrets.FIREBASE_IOS_APP_ID }} --groups "testers"
278278
279+
- name: 📋 Extract Release Notes from PR Body
280+
if: ${{ matrix.platform == 'android' }}
281+
env:
282+
PR_BODY: ${{ github.event.pull_request.body }}
283+
run: |
284+
set -eo pipefail
285+
# Grab lines after "## Release Notes" until the next header
286+
RELEASE_NOTES="$(printf '%s\n' "$PR_BODY" \
287+
| awk 'f && /^## /{f=0} /^## Release Notes/{f=1; next} f')"
288+
# Use a unique delimiter to write multiline into GITHUB_ENV
289+
delimiter="EOF_$(date +%s)_$RANDOM"
290+
{
291+
echo "RELEASE_NOTES<<$delimiter"
292+
printf '%s\n' "${RELEASE_NOTES:-No release notes provided.}"
293+
echo "$delimiter"
294+
} >> "$GITHUB_ENV"
295+
296+
- name: 📋 Prepare Release Notes file
297+
if: ${{ matrix.platform == 'android' }}
298+
run: |
299+
{
300+
echo "## Version 7.${{ github.run_number }} - $(date +%Y-%m-%d)"
301+
echo
302+
printf '%s\n' "${RELEASE_NOTES:-No release notes provided.}"
303+
} > RELEASE_NOTES.md
304+
305+
- name: 📦 Create Release
306+
if: ${{ matrix.platform == 'android' && (github.event.inputs.buildType == 'all' || github.event_name == 'push' || github.event.inputs.buildType == 'prod-apk') }}
307+
uses: ncipollo/release-action@v1
308+
with:
309+
tag: "7.${{ github.run_number }}"
310+
commit: ${{ github.sha }}
311+
makeLatest: true
312+
allowUpdates: true
313+
name: "7.${{ github.run_number }}"
314+
artifacts: "./ResgridUnit-prod.apk"
315+
bodyFile: "RELEASE_NOTES.md"
279316

app.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
3838
},
3939
assetBundlePatterns: ['**/*'],
4040
ios: {
41+
icon: './assets/ios-icon.png',
4142
version: packageJSON.version,
4243
buildNumber: packageJSON.version,
4344
supportsTablet: true,

assets/ios-icon.png

52.7 KB
Loading

assets/splash-icon.png

55.9 KB
Loading

env.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ const client = z.object({
8383
BASE_API_URL: z.string(),
8484
API_VERSION: z.string(),
8585
RESGRID_API_URL: z.string(),
86-
CHANNEL_API_URL: z.string(),
8786
CHANNEL_HUB_NAME: z.string(),
8887
REALTIME_GEO_HUB_NAME: z.string(),
8988
LOGGING_KEY: z.string(),
@@ -118,7 +117,6 @@ const _clientEnv = {
118117
BASE_API_URL: process.env.UNIT_BASE_API_URL || 'https://qaapi.resgrid.dev',
119118
API_VERSION: process.env.UNIT_API_VERSION || 'v4',
120119
RESGRID_API_URL: process.env.UNIT_RESGRID_API_URL || '/api/v4',
121-
CHANNEL_API_URL: process.env.UNIT_CHANNEL_API_URL || 'https://qaevents.resgrid.dev/',
122120
CHANNEL_HUB_NAME: process.env.UNIT_CHANNEL_HUB_NAME || 'eventingHub',
123121
REALTIME_GEO_HUB_NAME: process.env.UNIT_REALTIME_GEO_HUB_NAME || 'geolocationHub',
124122
LOGGING_KEY: process.env.UNIT_LOGGING_KEY || '',

jest-setup.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,22 @@ jest.mock('nativewind', () => ({
155155
})),
156156
__esModule: true,
157157
}));
158+
159+
// Mock zod globally to avoid validation schema issues in tests
160+
jest.mock('zod', () => ({
161+
z: {
162+
object: jest.fn(() => ({
163+
parse: jest.fn((data) => data),
164+
safeParse: jest.fn((data) => ({ success: true, data })),
165+
})),
166+
string: jest.fn(() => ({
167+
min: jest.fn(() => ({
168+
parse: jest.fn((data) => data),
169+
safeParse: jest.fn((data) => ({ success: true, data })),
170+
})),
171+
parse: jest.fn((data) => data),
172+
safeParse: jest.fn((data) => ({ success: true, data })),
173+
})),
174+
},
175+
__esModule: true,
176+
}));

src/app/call/new/__tests__/address-search.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,21 @@ describe('Address Search Logic', () => {
103103
const mockConfig: GetConfigResultData = {
104104
GoogleMapsKey: 'test-api-key',
105105
W3WKey: '',
106+
EventingUrl: '',
106107
LoggingKey: '',
107108
MapUrl: '',
108109
MapAttribution: '',
109110
OpenWeatherApiKey: '',
111+
DirectionsMapKey: '',
112+
PersonnelLocationStaleSeconds: 300,
113+
UnitLocationStaleSeconds: 300,
114+
PersonnelLocationMinMeters: 15,
115+
UnitLocationMinMeters: 15,
110116
NovuBackendApiUrl: '',
111117
NovuSocketUrl: '',
112118
NovuApplicationId: '',
119+
AnalyticsApiKey: '',
120+
AnalyticsHost: '',
113121
};
114122

115123
beforeEach(() => {
@@ -143,13 +151,21 @@ describe('Address Search Logic', () => {
143151
const configWithoutKey: GetConfigResultData = {
144152
GoogleMapsKey: '',
145153
W3WKey: '',
154+
EventingUrl: '',
146155
LoggingKey: '',
147156
MapUrl: '',
148157
MapAttribution: '',
149158
OpenWeatherApiKey: '',
159+
DirectionsMapKey: '',
160+
PersonnelLocationStaleSeconds: 300,
161+
UnitLocationStaleSeconds: 300,
162+
PersonnelLocationMinMeters: 15,
163+
UnitLocationMinMeters: 15,
150164
NovuBackendApiUrl: '',
151165
NovuSocketUrl: '',
152166
NovuApplicationId: '',
167+
AnalyticsApiKey: '',
168+
AnalyticsHost: '',
153169
};
154170

155171
const result = await performAddressSearch('123 Main St', configWithoutKey);

src/app/call/new/__tests__/coordinates-search.test.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,21 @@ describe('Coordinates Search Logic', () => {
113113
const mockConfig: GetConfigResultData = {
114114
GoogleMapsKey: 'test-api-key',
115115
W3WKey: '',
116+
EventingUrl: '',
116117
LoggingKey: '',
117118
MapUrl: '',
118119
MapAttribution: '',
119120
OpenWeatherApiKey: '',
121+
DirectionsMapKey: '',
122+
PersonnelLocationStaleSeconds: 300,
123+
UnitLocationStaleSeconds: 300,
124+
PersonnelLocationMinMeters: 15,
125+
UnitLocationMinMeters: 15,
120126
NovuBackendApiUrl: '',
121127
NovuSocketUrl: '',
122128
NovuApplicationId: '',
129+
AnalyticsApiKey: '',
130+
AnalyticsHost: '',
123131
};
124132

125133
beforeEach(() => {
@@ -249,13 +257,21 @@ describe('Coordinates Search Logic', () => {
249257
const configWithoutKey: GetConfigResultData = {
250258
GoogleMapsKey: '',
251259
W3WKey: '',
260+
EventingUrl: '',
252261
LoggingKey: '',
253262
MapUrl: '',
254263
MapAttribution: '',
255264
OpenWeatherApiKey: '',
265+
DirectionsMapKey: '',
266+
PersonnelLocationStaleSeconds: 300,
267+
UnitLocationStaleSeconds: 300,
268+
PersonnelLocationMinMeters: 15,
269+
UnitLocationMinMeters: 15,
256270
NovuBackendApiUrl: '',
257271
NovuSocketUrl: '',
258272
NovuApplicationId: '',
273+
AnalyticsApiKey: '',
274+
AnalyticsHost: '',
259275
};
260276

261277
const result = await performCoordinatesSearch('40.7128, -74.0060', configWithoutKey);

src/app/call/new/__tests__/plus-code-search.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,21 @@ describe('Plus Code Search Logic', () => {
7676
const mockConfig: GetConfigResultData = {
7777
GoogleMapsKey: 'test-api-key',
7878
W3WKey: '',
79+
EventingUrl: '',
7980
LoggingKey: '',
8081
MapUrl: '',
8182
MapAttribution: '',
8283
OpenWeatherApiKey: '',
84+
DirectionsMapKey: '',
85+
PersonnelLocationStaleSeconds: 300,
86+
UnitLocationStaleSeconds: 300,
87+
PersonnelLocationMinMeters: 15,
88+
UnitLocationMinMeters: 15,
8389
NovuBackendApiUrl: '',
8490
NovuSocketUrl: '',
8591
NovuApplicationId: '',
92+
AnalyticsApiKey: '',
93+
AnalyticsHost: '',
8694
};
8795

8896
beforeEach(() => {
@@ -116,13 +124,21 @@ describe('Plus Code Search Logic', () => {
116124
const configWithoutKey: GetConfigResultData = {
117125
GoogleMapsKey: '',
118126
W3WKey: '',
127+
EventingUrl: '',
119128
LoggingKey: '',
120129
MapUrl: '',
121130
MapAttribution: '',
122131
OpenWeatherApiKey: '',
132+
DirectionsMapKey: '',
133+
PersonnelLocationStaleSeconds: 300,
134+
UnitLocationStaleSeconds: 300,
135+
PersonnelLocationMinMeters: 15,
136+
UnitLocationMinMeters: 15,
123137
NovuBackendApiUrl: '',
124138
NovuSocketUrl: '',
125139
NovuApplicationId: '',
140+
AnalyticsApiKey: '',
141+
AnalyticsHost: '',
126142
};
127143

128144
const result = await performPlusCodeSearch('849VCWC8+R9', configWithoutKey);

0 commit comments

Comments
 (0)