Skip to content

Commit

Permalink
[MOO-1126]: TakePicture function in NativeMobileResources presentatio…
Browse files Browse the repository at this point in the history
…nStyle changed for mx 9.24 (#68)
  • Loading branch information
UrazAkgultan authored Aug 22, 2023
2 parents 19fcfc3 + f30839d commit 2c417a3
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 14 deletions.
36 changes: 35 additions & 1 deletion packages/jsActions/mobile-resources-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,113 +6,139 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Changed

- Minimum mx version set to 9.24.1
- We updated the default presentation mode for both "Take Picture" and "Take Picture Advanced" to full screen.

## [4.0.3] Native Mobile Resources - 2023-5-24

### Fixed

- We've updated react-native-device-info library.

## [3.2.2] BottomSheet

### Fixed

- We've updated react-native-device-info library.

## [1.0.2] Gallery

### Fixed

- We've updated react-native-device-info library.

## [3.2.3] IntroScreen

### Fixed

- We've updated react-native-device-info library.

## [4.0.2] Native Mobile Resources - 2023-5-17


## [3.0.1] BarChart

### Fixed

- We fixed an issue where height or width with a value of 0 crash the app.

## [2.0.1] ColumnChart

### Fixed

- We fixed an issue where height or width with a value of 0 crash the app.

## [3.0.1] LineChart

### Fixed

- We fixed an issue where height or width with a value of 0 crash the app.

## [2.0.1] PieDoughnutChart

### Fixed

- We fixed an issue where height or width with a value of 0 crash the app.

## [4.0.0] Native Mobile Resources - 2023-3-28

undefined

## [4.0.0] AppEvents

## BREAKING

- We made the widget compatible with React Native 0.70.7

## [3.0.0] BarChart

## BREAKING

- We made the widget compatible with React Native 0.70.7

## [4.0.0] BarcodeScanner

## BREAKING

- We made the widget compatible with React Native 0.70.7

## [3.0.0] Carousel

## BREAKING

- We made the widget compatible with React Native 0.70.7

## [2.0.0] ColorPicker

## BREAKING

- We made the widget compatible with React Native 0.70.7

## [2.0.0] ColumnChart

## BREAKING

- We made the widget compatible with React Native 0.70.7

## [4.0.0] FloatingActionButton

## BREAKING

- We made the widget compatible with React Native 0.70.7

## [3.0.0] LineChart

## BREAKING

- We made the widget compatible with React Native 0.70.7

## [3.0.0] ListViewSwipe

## BREAKING

- We made the widget compatible with React Native 0.70.7

## [4.0.0] Maps

## BREAKING

- We made the widget compatible with React Native 0.70.7

## [4.0.0] Notifications

## BREAKING

- We made the widget compatible with React Native 0.70.7

## [2.0.0] PieDoughnutChart

## BREAKING

- We made the widget compatible with React Native 0.70.7

## [3.0.0] PopupMenu

### Added

- Added id for testing
Expand All @@ -122,41 +148,49 @@ undefined
- We made the widget compatible with React Native 0.70.7

## [4.2.1] ProgressBar

### Changed

- Bumped react-native-progress dependency

## [3.1.1] ProgressCircle

### Changed

- Bumped react-native-progress dependency

## [3.0.0] Rating

## BREAKING

- We made the widget compatible with React Native 0.70.7

## [2.0.0] Signature

## BREAKING

- We made the widget compatible with React Native 0.70.7

## [3.0.0] Slider

## BREAKING

- We made the widget compatible with React Native 0.70.7

## [4.0.0] VideoPlayer

## BREAKING

- We made the widget compatible with React Native 0.70.7

## [4.0.0] WebView

## BREAKING

- We made the widget compatible with React Native 0.70.7

## [3.13.1] Native Mobile Resources - 2022-12-28

### Changed

- We reduced the widget file size by reducing the dependencies list file size.
Expand Down
6 changes: 3 additions & 3 deletions packages/jsActions/mobile-resources-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"url": "https://github.com/mendix/native-widgets.git"
},
"marketplace": {
"minimumMXVersion": "9.24.0.2965",
"minimumMXVersion": "9.24.1.4658",
"marketplaceId": 109513
},
"testProject": {
"githubUrl": "https://github.com/mendix/native-mobile-resources",
"branchName": "main"
"branchName": "lts/mx/9.24"
},
"scripts": {
"prestart": "rimraf ./dist/tsc",
Expand Down Expand Up @@ -52,4 +52,4 @@
"rimraf": "^2.7.1",
"rollup": "^2.68.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export async function TakePicture(

function takePicture(): Promise<string | undefined> {
return new Promise((resolve, reject) => {
const options = nativeVersionMajor === 2 ? getOptionsV2() : getOptionsV4();
const options = nativeVersionMajor === 2 ? getOptionsV2() : getOptions();
getPictureMethod()
.then(method =>
method(options, (response: ImagePickerV2Response | ImagePickerResponse) => {
Expand Down Expand Up @@ -241,9 +241,10 @@ export async function TakePicture(
};
}

function getOptionsV4(): CameraOptions | ImageLibraryOptions {
function getOptions(): CameraOptions | ImageLibraryOptions {
const { maxWidth, maxHeight } = getPictureQuality();
return {
presentationStyle: "fullScreen",
mediaType: "photo" as const,
maxWidth,
maxHeight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export async function TakePictureAdvanced(

function takePicture(): Promise<ImagePickerV2Response | ImagePickerResponse | undefined> {
return new Promise((resolve, reject) => {
const options = nativeVersionMajor === 2 ? getOptionsV2() : getOptionsV4();
const options = nativeVersionMajor === 2 ? getOptionsV2() : getOptions();
getPictureMethod()
.then(method =>
method(options, (response: ImagePickerV2Response | ImagePickerResponse) => {
Expand Down Expand Up @@ -294,9 +294,10 @@ export async function TakePictureAdvanced(
};
}

function getOptionsV4(): CameraOptions | ImageLibraryOptions {
function getOptions(): CameraOptions | ImageLibraryOptions {
const { maxWidth, maxHeight } = getPictureQuality();
return {
presentationStyle: "fullScreen",
mediaType: "photo" as const,
maxWidth,
maxHeight
Expand Down
4 changes: 4 additions & 0 deletions packages/jsActions/nanoflow-actions-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Changed

- Minimum mx version set to 9.24.1

## [2.6.1] Nanoflow Commons - 2022-9-23

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions packages/jsActions/nanoflow-actions-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"url": "https://github.com/mendix/native-widgets.git"
},
"marketplace": {
"minimumMXVersion": "9.24.0.2965",
"minimumMXVersion": "9.24.1.4658",
"marketplaceId": 109515
},
"testProject": {
"githubUrl": "https://github.com/mendix/native-mobile-resources",
"branchName": "main"
"branchName": "lts/mx/9.24"
},
"scripts": {
"start": "rollup --config ../../../configs/jsactions/rollup.config.js --watch --configProject nanoflowcommons",
Expand Down
4 changes: 2 additions & 2 deletions scripts/release/createNativeModules.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async function updateNativeComponentsTestProject(moduleInfo, tmpFolder, nativeWi
const tmpFolderActions = join(tmpFolder, `javascriptsource/${moduleInfo.moduleFolderNameInModeler}/actions`);

console.log("Updating NativeComponentsTestProject...");
await cloneRepo(moduleInfo.testProjectUrl, tmpFolder);
await cloneRepo(moduleInfo.testProjectUrl, moduleInfo.testProjectBranchName, tmpFolder);

console.log("Deleting existing JS Actions from test project...");
await rm(tmpFolderActions, { force: true, recursive: true }); // this is useful to avoid retaining stale dependencies in the test project.
Expand Down Expand Up @@ -199,7 +199,7 @@ async function updateNativeComponentsTestProjectWithAtlas(moduleInfo, tmpFolder)
const tmpFolderNativeStyles = join(tmpFolder, `themesource/${moduleInfo.moduleFolderNameInModeler}`);

console.log("Updating NativeComponentsTestProject..");
await cloneRepo(moduleInfo.testProjectUrl, tmpFolder);
await cloneRepo(moduleInfo.testProjectUrl, moduleInfo.testProjectBranchName, tmpFolder);

console.log("Copying Native styling files..");
await Promise.all([
Expand Down
4 changes: 2 additions & 2 deletions scripts/release/module-automation/commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,12 @@ async function githubAuthentication(moduleInfo) {
await execShellCommand(`echo "${process.env.GH_PAT}" | gh auth login --with-token`);
}

async function cloneRepo(githubUrl, localFolder) {
async function cloneRepo(githubUrl, githubBranchName, localFolder) {
const githubUrlDomain = githubUrl.replace("https://", "");
const githubUrlAuthenticated = `https://${process.env.GH_USERNAME}:${process.env.GH_PAT}@${githubUrlDomain}`;
await rm(localFolder, { recursive: true, force: true });
await mkdir(localFolder, { recursive: true });
await execShellCommand(`git clone ${githubUrlAuthenticated} ${localFolder}`);
await execShellCommand(`git clone --branch ${githubBranchName} ${githubUrlAuthenticated} ${localFolder}`);
await setLocalGitCredentials(localFolder);
}

Expand Down

0 comments on commit 2c417a3

Please sign in to comment.