Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file modified .DS_Store
Binary file not shown.
37 changes: 37 additions & 0 deletions .github/workflows/react-native-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,4 +276,41 @@ jobs:
run: |
firebase appdistribution:distribute ./ResgridUnit-ios-adhoc.ipa --app ${{ secrets.FIREBASE_IOS_APP_ID }} --groups "testers"

- name: 📋 Extract Release Notes from PR Body
if: ${{ matrix.platform == 'android' }}
env:
PR_BODY: ${{ github.event.pull_request.body }}
run: |
set -eo pipefail
# Grab lines after "## Release Notes" until the next header
RELEASE_NOTES="$(printf '%s\n' "$PR_BODY" \
| awk 'f && /^## /{f=0} /^## Release Notes/{f=1; next} f')"
# Use a unique delimiter to write multiline into GITHUB_ENV
delimiter="EOF_$(date +%s)_$RANDOM"
{
echo "RELEASE_NOTES<<$delimiter"
printf '%s\n' "${RELEASE_NOTES:-No release notes provided.}"
echo "$delimiter"
} >> "$GITHUB_ENV"

- name: 📋 Prepare Release Notes file
if: ${{ matrix.platform == 'android' }}
run: |
{
echo "## Version 7.${{ github.run_number }} - $(date +%Y-%m-%d)"
echo
printf '%s\n' "${RELEASE_NOTES:-No release notes provided.}"
} > RELEASE_NOTES.md

- name: 📦 Create Release
if: ${{ matrix.platform == 'android' && (github.event.inputs.buildType == 'all' || github.event_name == 'push' || github.event.inputs.buildType == 'prod-apk') }}
uses: ncipollo/release-action@v1
with:
tag: "7.${{ github.run_number }}"
commit: ${{ github.sha }}
makeLatest: true
allowUpdates: true
name: "7.${{ github.run_number }}"
artifacts: "./ResgridUnit-prod.apk"
bodyFile: "RELEASE_NOTES.md"

1 change: 1 addition & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
},
assetBundlePatterns: ['**/*'],
ios: {
icon: './assets/ios-icon.png',
version: packageJSON.version,
buildNumber: packageJSON.version,
supportsTablet: true,
Expand Down
Binary file added assets/ios-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/splash-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions env.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ const client = z.object({
BASE_API_URL: z.string(),
API_VERSION: z.string(),
RESGRID_API_URL: z.string(),
CHANNEL_API_URL: z.string(),
CHANNEL_HUB_NAME: z.string(),
REALTIME_GEO_HUB_NAME: z.string(),
LOGGING_KEY: z.string(),
Expand Down Expand Up @@ -118,7 +117,6 @@ const _clientEnv = {
BASE_API_URL: process.env.UNIT_BASE_API_URL || 'https://qaapi.resgrid.dev',
API_VERSION: process.env.UNIT_API_VERSION || 'v4',
RESGRID_API_URL: process.env.UNIT_RESGRID_API_URL || '/api/v4',
CHANNEL_API_URL: process.env.UNIT_CHANNEL_API_URL || 'https://qaevents.resgrid.dev/',
CHANNEL_HUB_NAME: process.env.UNIT_CHANNEL_HUB_NAME || 'eventingHub',
REALTIME_GEO_HUB_NAME: process.env.UNIT_REALTIME_GEO_HUB_NAME || 'geolocationHub',
LOGGING_KEY: process.env.UNIT_LOGGING_KEY || '',
Expand Down
19 changes: 19 additions & 0 deletions jest-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,22 @@ jest.mock('nativewind', () => ({
})),
__esModule: true,
}));

// Mock zod globally to avoid validation schema issues in tests
jest.mock('zod', () => ({
z: {
object: jest.fn(() => ({
parse: jest.fn((data) => data),
safeParse: jest.fn((data) => ({ success: true, data })),
})),
string: jest.fn(() => ({
min: jest.fn(() => ({
parse: jest.fn((data) => data),
safeParse: jest.fn((data) => ({ success: true, data })),
})),
parse: jest.fn((data) => data),
safeParse: jest.fn((data) => ({ success: true, data })),
})),
},
__esModule: true,
}));
16 changes: 16 additions & 0 deletions src/app/call/new/__tests__/address-search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,21 @@ describe('Address Search Logic', () => {
const mockConfig: GetConfigResultData = {
GoogleMapsKey: 'test-api-key',
W3WKey: '',
EventingUrl: '',
LoggingKey: '',
MapUrl: '',
MapAttribution: '',
OpenWeatherApiKey: '',
DirectionsMapKey: '',
PersonnelLocationStaleSeconds: 300,
UnitLocationStaleSeconds: 300,
PersonnelLocationMinMeters: 15,
UnitLocationMinMeters: 15,
NovuBackendApiUrl: '',
NovuSocketUrl: '',
NovuApplicationId: '',
AnalyticsApiKey: '',
AnalyticsHost: '',
};

beforeEach(() => {
Expand Down Expand Up @@ -143,13 +151,21 @@ describe('Address Search Logic', () => {
const configWithoutKey: GetConfigResultData = {
GoogleMapsKey: '',
W3WKey: '',
EventingUrl: '',
LoggingKey: '',
MapUrl: '',
MapAttribution: '',
OpenWeatherApiKey: '',
DirectionsMapKey: '',
PersonnelLocationStaleSeconds: 300,
UnitLocationStaleSeconds: 300,
PersonnelLocationMinMeters: 15,
UnitLocationMinMeters: 15,
NovuBackendApiUrl: '',
NovuSocketUrl: '',
NovuApplicationId: '',
AnalyticsApiKey: '',
AnalyticsHost: '',
};

const result = await performAddressSearch('123 Main St', configWithoutKey);
Expand Down
16 changes: 16 additions & 0 deletions src/app/call/new/__tests__/coordinates-search.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,21 @@ describe('Coordinates Search Logic', () => {
const mockConfig: GetConfigResultData = {
GoogleMapsKey: 'test-api-key',
W3WKey: '',
EventingUrl: '',
LoggingKey: '',
MapUrl: '',
MapAttribution: '',
OpenWeatherApiKey: '',
DirectionsMapKey: '',
PersonnelLocationStaleSeconds: 300,
UnitLocationStaleSeconds: 300,
PersonnelLocationMinMeters: 15,
UnitLocationMinMeters: 15,
NovuBackendApiUrl: '',
NovuSocketUrl: '',
NovuApplicationId: '',
AnalyticsApiKey: '',
AnalyticsHost: '',
};

beforeEach(() => {
Expand Down Expand Up @@ -249,13 +257,21 @@ describe('Coordinates Search Logic', () => {
const configWithoutKey: GetConfigResultData = {
GoogleMapsKey: '',
W3WKey: '',
EventingUrl: '',
LoggingKey: '',
MapUrl: '',
MapAttribution: '',
OpenWeatherApiKey: '',
DirectionsMapKey: '',
PersonnelLocationStaleSeconds: 300,
UnitLocationStaleSeconds: 300,
PersonnelLocationMinMeters: 15,
UnitLocationMinMeters: 15,
NovuBackendApiUrl: '',
NovuSocketUrl: '',
NovuApplicationId: '',
AnalyticsApiKey: '',
AnalyticsHost: '',
};

const result = await performCoordinatesSearch('40.7128, -74.0060', configWithoutKey);
Expand Down
16 changes: 16 additions & 0 deletions src/app/call/new/__tests__/plus-code-search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,21 @@ describe('Plus Code Search Logic', () => {
const mockConfig: GetConfigResultData = {
GoogleMapsKey: 'test-api-key',
W3WKey: '',
EventingUrl: '',
LoggingKey: '',
MapUrl: '',
MapAttribution: '',
OpenWeatherApiKey: '',
DirectionsMapKey: '',
PersonnelLocationStaleSeconds: 300,
UnitLocationStaleSeconds: 300,
PersonnelLocationMinMeters: 15,
UnitLocationMinMeters: 15,
NovuBackendApiUrl: '',
NovuSocketUrl: '',
NovuApplicationId: '',
AnalyticsApiKey: '',
AnalyticsHost: '',
};

beforeEach(() => {
Expand Down Expand Up @@ -116,13 +124,21 @@ describe('Plus Code Search Logic', () => {
const configWithoutKey: GetConfigResultData = {
GoogleMapsKey: '',
W3WKey: '',
EventingUrl: '',
LoggingKey: '',
MapUrl: '',
MapAttribution: '',
OpenWeatherApiKey: '',
DirectionsMapKey: '',
PersonnelLocationStaleSeconds: 300,
UnitLocationStaleSeconds: 300,
PersonnelLocationMinMeters: 15,
UnitLocationMinMeters: 15,
NovuBackendApiUrl: '',
NovuSocketUrl: '',
NovuApplicationId: '',
AnalyticsApiKey: '',
AnalyticsHost: '',
};

const result = await performPlusCodeSearch('849VCWC8+R9', configWithoutKey);
Expand Down
8 changes: 8 additions & 0 deletions src/app/call/new/__tests__/what3words.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@ const mockedAxios = axios as jest.Mocked<typeof axios>;
const mockConfig: GetConfigResultData = {
GoogleMapsKey: 'test-mapbox-key',
W3WKey: 'test-api-key',
EventingUrl: '',
LoggingKey: '',
MapUrl: '',
MapAttribution: '',
OpenWeatherApiKey: '',
DirectionsMapKey: '',
PersonnelLocationStaleSeconds: 300,
UnitLocationStaleSeconds: 300,
PersonnelLocationMinMeters: 15,
UnitLocationMinMeters: 15,
NovuBackendApiUrl: '',
NovuSocketUrl: '',
NovuApplicationId: '',
AnalyticsApiKey: '',
AnalyticsHost: '',
};

// Mock the core store
Expand Down
Loading
Loading