Skip to content

Commit

Permalink
Merge branch 'main' into moo/MOO-1562-fix-native-widgets-pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaSimsic authored Sep 3, 2024
2 parents 6a18b19 + 7cf1d85 commit 1d9c405
Show file tree
Hide file tree
Showing 15 changed files with 107 additions and 35 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ jobs:
- name: "Defining environment variables"
if: startsWith(matrix.os, 'ubuntu')
id: variablesLinux
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' }}
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' }}
- name: "Defining environment variables"
if: startsWith(matrix.os, 'windows')
id: variablesWindows
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' }}
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' }}
- name: "Defining node version"
uses: actions/setup-node@d86ebcd40b3cb50b156bfa44dd277faf38282d12 # v4
with:
Expand All @@ -51,6 +51,6 @@ jobs:
- name: "Installing dependencies"
run: yarn install
- name: "Running build for development"
run: yarn workspaces foreach ${{ steps.variablesLinux.outputs.arg }} ${{ steps.variablesWindows.outputs.arg }} --all --parallel run build
run: yarn workspaces foreach ${{ steps.variablesLinux.outputs.arg }} ${{ steps.variablesWindows.outputs.arg }} --parallel run build
env:
NODE_OPTIONS: --max_old_space_size=8192
4 changes: 2 additions & 2 deletions .github/workflows/MarketplaceRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
- name: "Installing dependencies"
run: yarn install
- name: "Building native widgets and js actions"
run: yarn workspaces foreach run release
run: yarn workspaces foreach --all run release
- name: "Updating Native Mobile Resources project"
run: yarn workspaces foreach run create-modules
run: yarn workspaces foreach --all run create-modules
env:
GH_USERNAME: ${{ secrets.GH_USERNAME }}
GH_EMAIL: ${{ secrets.GH_EMAIL }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:
- name: "Defining environment variables"
if: startsWith(matrix.os, 'ubuntu')
id: variablesLinux
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' }}
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' }}
- name: "Defining environment variables"
if: startsWith(matrix.os, 'windows')
id: variablesWindows
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' }}
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' }}
- name: "Defining node version"
uses: actions/setup-node@d86ebcd40b3cb50b156bfa44dd277faf38282d12 # v4
with:
Expand All @@ -48,6 +48,6 @@ jobs:
- name: "Installing dependencies"
run: yarn install
- name: "Running release for production"
run: yarn workspaces foreach ${{ steps.variablesLinux.outputs.arg }} ${{ steps.variablesWindows.outputs.arg }} --all --parallel run release
run: yarn workspaces foreach ${{ steps.variablesLinux.outputs.arg }} ${{ steps.variablesWindows.outputs.arg }} --parallel run release
env:
NODE_OPTIONS: --max_old_space_size=8192
6 changes: 3 additions & 3 deletions .github/workflows/UnitTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: git fetch --no-tags --prune --depth=1 origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
- name: "Defining environment variables"
id: variables
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' }}
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' }}
- name: "Defining node version"
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
Expand All @@ -50,6 +50,6 @@ jobs:
- name: "Installing dependencies"
run: yarn install
- name: "Linting code"
run: yarn workspaces foreach ${{ steps.variables.outputs.arg }} --all --parallel run lint
run: yarn workspaces foreach ${{ steps.variables.outputs.arg }} --parallel run lint
- name: "Running unit tests"
run: yarn workspaces foreach ${{ steps.variables.outputs.arg }} --all --parallel run test
run: yarn workspaces foreach ${{ steps.variables.outputs.arg }} --parallel run test
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
"prettier": "prettier --config \"./prettier.config.js\" --write \"**/*.{js,jsx,ts,tsx,scss,html,xml,yml,yaml}\"",
"format": "pretty-quick --staged --config \"./prettier.config.js\" --pattern \"**/{src,script,typings,test,**}/**/*.{js,jsx,ts,tsx,scss,html,xml,md,json}\"",
"clean-all-screenshots-mac": "find . -name 'screenshot-baseline' -type d -prune -exec rm -rf '{}' +",
"information:githubrelease": "yarn workspaces foreach run information:githubrelease",
"information:githubrelease": "yarn workspaces foreach --all run information:githubrelease",
"lint": "yarn lint:src && yarn workspaces foreach --all --parallel run lint",
"lint:src": "eslint --config .eslintrc.js --ext .jsx,.js,.ts,.tsx packages/*/*/src --no-error-on-unmatched-pattern",
"lint:scripts": "eslint --fix --config .eslintrc.js --ext .jsx,.js,.ts,.tsx scripts",
"lint:detox": "eslint --fix --config .eslintrc.js --ext .jsx,.js,.ts,.tsx detox",
"lint:configs": "eslint --fix --config .eslintrc.js --ext .jsx,.js,.ts,.tsx configs",
"test": "yarn workspaces foreach --all --parallel run test",
"test:e2e:android": "yarn workspaces foreach run test:e2e:android",
"test:e2e:ios": "yarn workspaces foreach run test:e2e:ios",
"test:e2e:android": "yarn workspaces foreach --all run test:e2e:android",
"test:e2e:ios": "yarn workspaces foreach --all run test:e2e:ios",
"build": "yarn workspaces foreach --all --parallel run build",
"release": "yarn workspaces foreach --all --parallel run release",
"release:marketplace": "yarn workspaces foreach run release:marketplace",
"release:marketplace": "yarn workspaces foreach --all run release:marketplace",
"release-github:widget": "node ./scripts/release/createWidgetRelease.js",
"create-modules": "node ./scripts/release/createNativeModules.js",
"version": "ts-node --project ./scripts/tsconfig.json ./scripts/release/BumpVersion.ts",
Expand Down
50 changes: 50 additions & 0 deletions packages/jsActions/mobile-resources-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,56 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [8.0.1] Native Mobile Resources - 2024-8-29
### Fixed

- We fixed an issue where the `RequestNotificationPermission` action incorrectly returned 'true' after the user previously selected 'Don't Allow' on iOS and Android.

## [2.2.1] Accordion
### Fixed

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

- Resolved an issue where the accordion's dynamic content was not updating its height after the initial render.

## [3.3.0] BottomSheet
### Added

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

## [1.1.0] Gallery
### Added

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

### Fixed

- 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.

## [3.3.0] IntroScreen
### Added

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

## [3.1.0] ListViewSwipe
### Added

- We have upgraded React Native Gesture Handler to version 2.16.2.

## [5.0.1] Rating
### Changed

- We have updated the rating native widget to replace the use of AnimatableProps from the react-native-animatable library with AnimatableProperties.

### BREAKING

- We made the widget compatible with React Native 0.73.8

## [5.0.1] VideoPlayer
### Fixed

- We have fixed an issue where the video player was not functioning on iOS devices.

## [8.0.0] Native Mobile Resources - 2024-07-30

### BREAKING
Expand Down
4 changes: 2 additions & 2 deletions packages/jsActions/mobile-resources-native/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mobile-resources-native",
"moduleName": "Native Mobile Resources",
"version": "8.0.0",
"version": "8.0.1",
"license": "Apache-2.0",
"copyright": "© Mendix Technology BV 2022. All rights reserved.",
"repository": {
Expand Down Expand Up @@ -53,4 +53,4 @@
"rimraf": "^2.7.1",
"rollup": "^2.68.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,40 @@ import messaging from "@react-native-firebase/messaging";
*/
export async function RequestNotificationPermission(): Promise<boolean> {
// BEGIN USER CODE
// Documentation https://rnfirebase.io/docs/v5.x.x/notifications/receiving-notifications
// Documentation https://rnfirebase.io/messaging/usage

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

if (Platform.OS === "android") {
return PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS)
.then(() => {
return true;
})
.catch(() => {
return false;
});
try {
const granted = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS);
return granted === PermissionsAndroid.RESULTS.GRANTED;
} catch (error) {
console.error("Failed to request permission on Android", error);
return false;
}
}

return messaging()
.requestPermission()
.then(() =>
Platform.OS === "ios" && !messaging().isDeviceRegisteredForRemoteMessages
? messaging()
.registerDeviceForRemoteMessages()
.then(() => true)
: true
)
.catch(() => false);
try {
const authStatus = await messaging().requestPermission();
const enabled =
authStatus === messaging.AuthorizationStatus.AUTHORIZED ||
authStatus === messaging.AuthorizationStatus.PROVISIONAL;
if (!enabled) {
return false;
}

if (!messaging().isDeviceRegisteredForRemoteMessages) {
await messaging().registerDeviceForRemoteMessages();
return true;
}
return true;
} catch (error) {
console.error("Failed to request permission on iOS", error);
return false;
}

// END USER CODE
}
2 changes: 2 additions & 0 deletions packages/pluggableWidgets/accordion-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [2.2.1] - 2024-8-29

### Fixed

- Fixed a bug where the accordion state was not updating correctly when the "Collapsed" attribute was selected.
Expand Down
2 changes: 2 additions & 0 deletions packages/pluggableWidgets/bottom-sheet-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [3.3.0] - 2024-8-29

### Added

- We have upgraded React Native Device Info to version 11.1.0.
Expand Down
2 changes: 2 additions & 0 deletions packages/pluggableWidgets/gallery-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [1.1.0] - 2024-8-29

### Added

- We have upgraded React Native Device Info to version 11.1.0.
Expand Down
2 changes: 2 additions & 0 deletions packages/pluggableWidgets/intro-screen-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [3.3.0] - 2024-8-29

### Added

- We have upgraded React Native Device Info to version 11.1.0.
Expand Down
2 changes: 2 additions & 0 deletions packages/pluggableWidgets/listview-swipe-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [3.1.0] - 2024-8-29

### Added

- We have upgraded React Native Gesture Handler to version 2.16.2.
Expand Down
2 changes: 2 additions & 0 deletions packages/pluggableWidgets/rating-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [5.0.1] - 2024-8-29

### Changed

- We have updated the rating native widget to replace the use of AnimatableProps from the react-native-animatable library with AnimatableProperties.
Expand Down
2 changes: 2 additions & 0 deletions packages/pluggableWidgets/video-player-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [5.0.1] - 2024-8-29

### Fixed

- We have fixed an issue where the video player was not functioning on iOS devices.
Expand Down

0 comments on commit 1d9c405

Please sign in to comment.