Skip to content

Commit 26894b8

Browse files
authored
Merge pull request #186 from Resgrid/develop
RU-T44 Inbox tweak, fixing map marker.
2 parents d27b24d + 4b66f5d commit 26894b8

File tree

7 files changed

+187
-33
lines changed

7 files changed

+187
-33
lines changed

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

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,25 +302,38 @@ jobs:
302302
extract_release_notes() {
303303
local body="$1"
304304
305-
# Remove "Summary by CodeRabbit" section and auto-generated comment line
305+
# First pass: Remove everything between CodeRabbit comment markers using sed
306+
# This handles multi-line auto-generated content
306307
local cleaned_body="$(printf '%s\n' "$body" \
307-
| grep -v '<!-- end of auto-generated comment: release notes by coderabbit.ai -->' \
308+
| sed '/<!-- This is an auto-generated comment: release notes by coderabbit.ai -->/,/<!-- end of auto-generated comment: release notes by coderabbit.ai -->/d')"
309+
310+
# Second pass: Remove the "Summary by CodeRabbit" section
311+
cleaned_body="$(printf '%s\n' "$cleaned_body" \
308312
| awk '
309313
BEGIN { skip=0 }
310314
/^## Summary by CodeRabbit/ { skip=1; next }
311315
/^## / && skip==1 { skip=0 }
312316
skip==0 { print }
313317
')"
314318
315-
# Try to extract content under "## Release Notes" heading
319+
# Third pass: Remove any remaining HTML comment lines
320+
cleaned_body="$(printf '%s\n' "$cleaned_body" | sed '/^<!--.*-->$/d' | sed '/^<!--/d' | sed '/^-->$/d')"
321+
322+
# Fourth pass: Trim leading and trailing whitespace/empty lines
323+
cleaned_body="$(printf '%s\n' "$cleaned_body" | sed '/^$/d' | awk 'NF {p=1} p')"
324+
325+
# Try to extract content under "## Release Notes" heading if it exists
316326
local notes="$(printf '%s\n' "$cleaned_body" \
317327
| awk 'f && /^## /{exit} /^## Release Notes/{f=1; next} f')"
318328
319-
# If no specific section found, use the entire cleaned body (up to first 500 chars for safety)
329+
# If no specific "Release Notes" section found, use the entire cleaned body
320330
if [ -z "$notes" ]; then
321-
notes="$(printf '%s\n' "$cleaned_body" | head -c 500)"
331+
notes="$cleaned_body"
322332
fi
323333
334+
# Final trim
335+
notes="$(printf '%s\n' "$notes" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
336+
324337
printf '%s\n' "$notes"
325338
}
326339

expo-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/// <reference types="expo/types" />
22

3-
// NOTE: This file should not be edited and should be in your git ignore
3+
// NOTE: This file should not be edited and should be in your git ignore

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"@livekit/react-native-webrtc": "^137.0.2",
9090
"@microsoft/signalr": "~8.0.7",
9191
"@notifee/react-native": "^9.1.8",
92-
"@novu/react-native": "~2.6.6",
92+
"@novu/react-native": "^3.11.0",
9393
"@react-native-community/netinfo": "^11.4.1",
9494
"@react-native-firebase/app": "^23.5.0",
9595
"@react-native-firebase/messaging": "^23.5.0",

src/components/maps/location-picker.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ const LocationPicker: React.FC<LocationPickerProps> = ({ initialLocation, onLoca
6161
useEffect(() => {
6262
if (initialLocation) {
6363
setCurrentLocation(initialLocation);
64+
// Move camera to the new location
65+
if (cameraRef.current) {
66+
cameraRef.current.setCamera({
67+
centerCoordinate: [initialLocation.longitude, initialLocation.latitude],
68+
zoomLevel: 15,
69+
animationDuration: 1000,
70+
});
71+
}
6472
} else {
6573
getUserLocation().catch((error) => {
6674
console.error('Failed to get user location:', error);

src/components/notifications/NotificationInbox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export const NotificationInbox = ({ isOpen, onClose }: NotificationInboxProps) =
162162
const renderItem = ({ item }: { item: any }) => {
163163
const notification: NotificationPayload = {
164164
id: item.id,
165-
title: item.title,
165+
title: item.subject,
166166
body: item.body,
167167
createdAt: item.createdAt,
168168
read: item.read,
@@ -194,7 +194,7 @@ export const NotificationInbox = ({ isOpen, onClose }: NotificationInboxProps) =
194194
) : null}
195195

196196
<View style={styles.notificationContent}>
197-
<Text style={[styles.notificationBody, !item.read ? styles.unreadNotificationText : {}]}>{notification.body}</Text>
197+
<Text style={[styles.notificationBody, !item.read ? styles.unreadNotificationText : {}]}>{notification.title}</Text>
198198
<Text style={styles.timestamp}>
199199
{new Date(notification.createdAt).toLocaleDateString()} {new Date(notification.createdAt).toLocaleTimeString()}
200200
</Text>

src/components/notifications/__tests__/NotificationInbox.test.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ describe('NotificationInbox', () => {
207207
readAll: jest.fn(),
208208
archiveAll: jest.fn(),
209209
archiveAllRead: jest.fn(),
210+
seenAll: jest.fn(),
210211
});
211212

212213
mockUseCoreStore.mockImplementation((selector: any) => {
@@ -353,6 +354,7 @@ describe('NotificationInbox', () => {
353354
readAll: jest.fn(),
354355
archiveAll: jest.fn(),
355356
archiveAllRead: jest.fn(),
357+
seenAll: jest.fn(),
356358
});
357359

358360
const { getByTestId } = render(
@@ -373,6 +375,7 @@ describe('NotificationInbox', () => {
373375
readAll: jest.fn(),
374376
archiveAll: jest.fn(),
375377
archiveAllRead: jest.fn(),
378+
seenAll: jest.fn(),
376379
});
377380

378381
const { getByText } = render(

0 commit comments

Comments
 (0)