Skip to content

Commit 1d9c405

Browse files
authored
Merge branch 'main' into moo/MOO-1562-fix-native-widgets-pipeline
2 parents 6a18b19 + 7cf1d85 commit 1d9c405

15 files changed

Lines changed: 107 additions & 35 deletions

File tree

.github/workflows/Build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ jobs:
3838
- name: "Defining environment variables"
3939
if: startsWith(matrix.os, 'ubuntu')
4040
id: variablesLinux
41-
run: echo "arg=$(if [ "${{ steps.files.outputs.global_files }}" = "" ] && ${{ github.event_name == 'pull_request' }}; then echo '--since'; else echo ''; fi)" >> ${{ runner.os == 'Windows' && '$env:GITHUB_OUTPUT' || '$GITHUB_OUTPUT' }}
41+
run: echo "arg=$(if [ "${{ steps.files.outputs.global_files }}" = "" ] && ${{ github.event_name == 'pull_request' }}; then echo '--since'; else echo '--all'; fi)" >> ${{ runner.os == 'Windows' && '$env:GITHUB_OUTPUT' || '$GITHUB_OUTPUT' }}
4242
- name: "Defining environment variables"
4343
if: startsWith(matrix.os, 'windows')
4444
id: variablesWindows
45-
run: echo "arg=$(If ('${{ steps.files.outputs.global_files }}' -eq '' -AND '${{ github.event_name == 'pull_request' }}' -eq 'true'){ echo '--since' } Else { echo '' })" >> ${{ runner.os == 'Windows' && '$env:GITHUB_OUTPUT' || '$GITHUB_OUTPUT' }}
45+
run: echo "arg=$(If ('${{ steps.files.outputs.global_files }}' -eq '' -AND '${{ github.event_name == 'pull_request' }}' -eq 'true'){ echo '--since' } Else { echo '--all' })" >> ${{ runner.os == 'Windows' && '$env:GITHUB_OUTPUT' || '$GITHUB_OUTPUT' }}
4646
- name: "Defining node version"
4747
uses: actions/setup-node@d86ebcd40b3cb50b156bfa44dd277faf38282d12 # v4
4848
with:
@@ -51,6 +51,6 @@ jobs:
5151
- name: "Installing dependencies"
5252
run: yarn install
5353
- name: "Running build for development"
54-
run: yarn workspaces foreach ${{ steps.variablesLinux.outputs.arg }} ${{ steps.variablesWindows.outputs.arg }} --all --parallel run build
54+
run: yarn workspaces foreach ${{ steps.variablesLinux.outputs.arg }} ${{ steps.variablesWindows.outputs.arg }} --parallel run build
5555
env:
5656
NODE_OPTIONS: --max_old_space_size=8192

.github/workflows/MarketplaceRelease.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
- name: "Installing dependencies"
3232
run: yarn install
3333
- name: "Building native widgets and js actions"
34-
run: yarn workspaces foreach run release
34+
run: yarn workspaces foreach --all run release
3535
- name: "Updating Native Mobile Resources project"
36-
run: yarn workspaces foreach run create-modules
36+
run: yarn workspaces foreach --all run create-modules
3737
env:
3838
GH_USERNAME: ${{ secrets.GH_USERNAME }}
3939
GH_EMAIL: ${{ secrets.GH_EMAIL }}

.github/workflows/Release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ jobs:
3535
- name: "Defining environment variables"
3636
if: startsWith(matrix.os, 'ubuntu')
3737
id: variablesLinux
38-
run: echo "arg=$(if [ "${{ steps.files.outputs.global_files }}" = "" ] && ${{ github.event_name == 'pull_request' }}; then echo '--since'; else echo ''; fi)" >> ${{ runner.os == 'Windows' && '$env:GITHUB_OUTPUT' || '$GITHUB_OUTPUT' }}
38+
run: echo "arg=$(if [ "${{ steps.files.outputs.global_files }}" = "" ] && ${{ github.event_name == 'pull_request' }}; then echo '--since'; else echo '--all'; fi)" >> ${{ runner.os == 'Windows' && '$env:GITHUB_OUTPUT' || '$GITHUB_OUTPUT' }}
3939
- name: "Defining environment variables"
4040
if: startsWith(matrix.os, 'windows')
4141
id: variablesWindows
42-
run: echo "arg=$(If ('${{ steps.files.outputs.global_files }}' -eq '' -AND '${{ github.event_name == 'pull_request' }}' -eq 'true'){ echo '--since' } Else { echo '' })" >> ${{ runner.os == 'Windows' && '$env:GITHUB_OUTPUT' || '$GITHUB_OUTPUT' }}
42+
run: echo "arg=$(If ('${{ steps.files.outputs.global_files }}' -eq '' -AND '${{ github.event_name == 'pull_request' }}' -eq 'true'){ echo '--since' } Else { echo '--all' })" >> ${{ runner.os == 'Windows' && '$env:GITHUB_OUTPUT' || '$GITHUB_OUTPUT' }}
4343
- name: "Defining node version"
4444
uses: actions/setup-node@d86ebcd40b3cb50b156bfa44dd277faf38282d12 # v4
4545
with:
@@ -48,6 +48,6 @@ jobs:
4848
- name: "Installing dependencies"
4949
run: yarn install
5050
- name: "Running release for production"
51-
run: yarn workspaces foreach ${{ steps.variablesLinux.outputs.arg }} ${{ steps.variablesWindows.outputs.arg }} --all --parallel run release
51+
run: yarn workspaces foreach ${{ steps.variablesLinux.outputs.arg }} ${{ steps.variablesWindows.outputs.arg }} --parallel run release
5252
env:
5353
NODE_OPTIONS: --max_old_space_size=8192

.github/workflows/UnitTests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: git fetch --no-tags --prune --depth=1 origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
3232
- name: "Defining environment variables"
3333
id: variables
34-
run: echo "arg=$(if [ "${{ steps.files.outputs.global_files }}" = "" ] && ${{ github.event_name == 'pull_request' }}; then echo '--since'; else echo ''; fi)" >> ${{ runner.os == 'Windows' && '$env:GITHUB_OUTPUT' || '$GITHUB_OUTPUT' }}
34+
run: echo "arg=$(if [ "${{ steps.files.outputs.global_files }}" = "" ] && ${{ github.event_name == 'pull_request' }}; then echo '--since'; else echo '--all'; fi)" >> ${{ runner.os == 'Windows' && '$env:GITHUB_OUTPUT' || '$GITHUB_OUTPUT' }}
3535
- name: "Defining node version"
3636
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
3737
with:
@@ -50,6 +50,6 @@ jobs:
5050
- name: "Installing dependencies"
5151
run: yarn install
5252
- name: "Linting code"
53-
run: yarn workspaces foreach ${{ steps.variables.outputs.arg }} --all --parallel run lint
53+
run: yarn workspaces foreach ${{ steps.variables.outputs.arg }} --parallel run lint
5454
- name: "Running unit tests"
55-
run: yarn workspaces foreach ${{ steps.variables.outputs.arg }} --all --parallel run test
55+
run: yarn workspaces foreach ${{ steps.variables.outputs.arg }} --parallel run test

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@
1414
"prettier": "prettier --config \"./prettier.config.js\" --write \"**/*.{js,jsx,ts,tsx,scss,html,xml,yml,yaml}\"",
1515
"format": "pretty-quick --staged --config \"./prettier.config.js\" --pattern \"**/{src,script,typings,test,**}/**/*.{js,jsx,ts,tsx,scss,html,xml,md,json}\"",
1616
"clean-all-screenshots-mac": "find . -name 'screenshot-baseline' -type d -prune -exec rm -rf '{}' +",
17-
"information:githubrelease": "yarn workspaces foreach run information:githubrelease",
17+
"information:githubrelease": "yarn workspaces foreach --all run information:githubrelease",
1818
"lint": "yarn lint:src && yarn workspaces foreach --all --parallel run lint",
1919
"lint:src": "eslint --config .eslintrc.js --ext .jsx,.js,.ts,.tsx packages/*/*/src --no-error-on-unmatched-pattern",
2020
"lint:scripts": "eslint --fix --config .eslintrc.js --ext .jsx,.js,.ts,.tsx scripts",
2121
"lint:detox": "eslint --fix --config .eslintrc.js --ext .jsx,.js,.ts,.tsx detox",
2222
"lint:configs": "eslint --fix --config .eslintrc.js --ext .jsx,.js,.ts,.tsx configs",
2323
"test": "yarn workspaces foreach --all --parallel run test",
24-
"test:e2e:android": "yarn workspaces foreach run test:e2e:android",
25-
"test:e2e:ios": "yarn workspaces foreach run test:e2e:ios",
24+
"test:e2e:android": "yarn workspaces foreach --all run test:e2e:android",
25+
"test:e2e:ios": "yarn workspaces foreach --all run test:e2e:ios",
2626
"build": "yarn workspaces foreach --all --parallel run build",
2727
"release": "yarn workspaces foreach --all --parallel run release",
28-
"release:marketplace": "yarn workspaces foreach run release:marketplace",
28+
"release:marketplace": "yarn workspaces foreach --all run release:marketplace",
2929
"release-github:widget": "node ./scripts/release/createWidgetRelease.js",
3030
"create-modules": "node ./scripts/release/createNativeModules.js",
3131
"version": "ts-node --project ./scripts/tsconfig.json ./scripts/release/BumpVersion.ts",

packages/jsActions/mobile-resources-native/CHANGELOG.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,56 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
## [8.0.1] Native Mobile Resources - 2024-8-29
10+
### Fixed
11+
12+
- We fixed an issue where the `RequestNotificationPermission` action incorrectly returned 'true' after the user previously selected 'Don't Allow' on iOS and Android.
13+
14+
## [2.2.1] Accordion
15+
### Fixed
16+
17+
- Fixed a bug where the accordion state was not updating correctly when the "Collapsed" attribute was selected.
18+
19+
- Resolved an issue where the accordion's dynamic content was not updating its height after the initial render.
20+
21+
## [3.3.0] BottomSheet
22+
### Added
23+
24+
- We have upgraded React Native Device Info to version 11.1.0.
25+
26+
## [1.1.0] Gallery
27+
### Added
28+
29+
- We have upgraded React Native Device Info to version 11.1.0.
30+
31+
### Fixed
32+
33+
- We've resolved an issue where the loading indicator was triggered when pulling down the list, even in the absence of a pull-down event.
34+
35+
## [3.3.0] IntroScreen
36+
### Added
37+
38+
- We have upgraded React Native Device Info to version 11.1.0.
39+
40+
## [3.1.0] ListViewSwipe
41+
### Added
42+
43+
- We have upgraded React Native Gesture Handler to version 2.16.2.
44+
45+
## [5.0.1] Rating
46+
### Changed
47+
48+
- We have updated the rating native widget to replace the use of AnimatableProps from the react-native-animatable library with AnimatableProperties.
49+
50+
### BREAKING
51+
52+
- We made the widget compatible with React Native 0.73.8
53+
54+
## [5.0.1] VideoPlayer
55+
### Fixed
56+
57+
- We have fixed an issue where the video player was not functioning on iOS devices.
58+
959
## [8.0.0] Native Mobile Resources - 2024-07-30
1060

1161
### BREAKING

packages/jsActions/mobile-resources-native/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mobile-resources-native",
33
"moduleName": "Native Mobile Resources",
4-
"version": "8.0.0",
4+
"version": "8.0.1",
55
"license": "Apache-2.0",
66
"copyright": "© Mendix Technology BV 2022. All rights reserved.",
77
"repository": {
@@ -53,4 +53,4 @@
5353
"rimraf": "^2.7.1",
5454
"rollup": "^2.68.0"
5555
}
56-
}
56+
}

packages/jsActions/mobile-resources-native/src/notifications/RequestNotificationPermission.ts

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,40 @@ import messaging from "@react-native-firebase/messaging";
1818
*/
1919
export async function RequestNotificationPermission(): Promise<boolean> {
2020
// BEGIN USER CODE
21-
// Documentation https://rnfirebase.io/docs/v5.x.x/notifications/receiving-notifications
21+
// Documentation https://rnfirebase.io/messaging/usage
2222

2323
if (NativeModules && !NativeModules.RNFBMessagingModule) {
2424
return Promise.reject(new Error("Firebase module is not available in your app"));
2525
}
2626

2727
if (Platform.OS === "android") {
28-
return PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS)
29-
.then(() => {
30-
return true;
31-
})
32-
.catch(() => {
33-
return false;
34-
});
28+
try {
29+
const granted = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS);
30+
return granted === PermissionsAndroid.RESULTS.GRANTED;
31+
} catch (error) {
32+
console.error("Failed to request permission on Android", error);
33+
return false;
34+
}
3535
}
3636

37-
return messaging()
38-
.requestPermission()
39-
.then(() =>
40-
Platform.OS === "ios" && !messaging().isDeviceRegisteredForRemoteMessages
41-
? messaging()
42-
.registerDeviceForRemoteMessages()
43-
.then(() => true)
44-
: true
45-
)
46-
.catch(() => false);
37+
try {
38+
const authStatus = await messaging().requestPermission();
39+
const enabled =
40+
authStatus === messaging.AuthorizationStatus.AUTHORIZED ||
41+
authStatus === messaging.AuthorizationStatus.PROVISIONAL;
42+
if (!enabled) {
43+
return false;
44+
}
45+
46+
if (!messaging().isDeviceRegisteredForRemoteMessages) {
47+
await messaging().registerDeviceForRemoteMessages();
48+
return true;
49+
}
50+
return true;
51+
} catch (error) {
52+
console.error("Failed to request permission on iOS", error);
53+
return false;
54+
}
4755

4856
// END USER CODE
4957
}

packages/pluggableWidgets/accordion-native/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
## [2.2.1] - 2024-8-29
10+
911
### Fixed
1012

1113
- Fixed a bug where the accordion state was not updating correctly when the "Collapsed" attribute was selected.

packages/pluggableWidgets/bottom-sheet-native/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
## [3.3.0] - 2024-8-29
10+
911
### Added
1012

1113
- We have upgraded React Native Device Info to version 11.1.0.

0 commit comments

Comments
 (0)