forked from simonmartyr/MxPushNotifications
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from mendix/release/6.0.0
[UIA-33] Update module and test project to 6.0.0
- Loading branch information
Showing
518 changed files
with
22,166 additions
and
15,899 deletions.
There are no files selected for viewing
Binary file not shown.
64 changes: 64 additions & 0 deletions
64
test/javascriptsource/nanoflowcommons/actions/GenerateUniqueID.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// This file was generated by Mendix Studio Pro. | ||
// | ||
// WARNING: Only the following code will be retained when actions are regenerated: | ||
// - the import list | ||
// - the code between BEGIN USER CODE and END USER CODE | ||
// - the code between BEGIN EXTRA CODE and END EXTRA CODE | ||
// Other code you write will be lost the next time you deploy the project. | ||
import { Big } from "big.js"; | ||
|
||
// BEGIN EXTRA CODE | ||
const COUNTER_STORE = "idCounter"; | ||
let locked = false; | ||
let currentCounter; | ||
function sleep(time) { | ||
return new Promise(resolve => setTimeout(resolve, time)); | ||
} | ||
async function initializeCounter() { | ||
currentCounter = JSON.parse((await getItem(COUNTER_STORE)) || "-1"); | ||
} | ||
function getItem(key) { | ||
if (navigator && navigator.product === "ReactNative") { | ||
const AsyncStorage = require("@react-native-community/async-storage").default; | ||
return AsyncStorage.getItem(key); | ||
} | ||
if (window) { | ||
const value = window.localStorage.getItem(key); | ||
return Promise.resolve(value); | ||
} | ||
return Promise.reject(new Error("No storage API available")); | ||
} | ||
function setItem(key, value) { | ||
if (navigator && navigator.product === "ReactNative") { | ||
const AsyncStorage = require("@react-native-community/async-storage").default; | ||
return AsyncStorage.setItem(key, value); | ||
} | ||
if (window) { | ||
window.localStorage.setItem(key, value); | ||
return Promise.resolve(); | ||
} | ||
return Promise.reject(new Error("No storage API available")); | ||
} | ||
// END EXTRA CODE | ||
|
||
/** | ||
* Generates a unique ID based on the current session. | ||
* @returns {Promise.<string>} | ||
*/ | ||
export async function GenerateUniqueID() { | ||
// BEGIN USER CODE | ||
const sessionId = mx.session.getConfig("sessionObjectId"); | ||
const rnd = Math.round(Math.random() * 10000); | ||
// eslint-disable-next-line no-unmodified-loop-condition | ||
while (locked) { | ||
await sleep(10); | ||
} | ||
locked = true; | ||
if (typeof currentCounter === "undefined") { | ||
await initializeCounter(); | ||
} | ||
await setItem(COUNTER_STORE, JSON.stringify(++currentCounter)); | ||
locked = false; | ||
return `${sessionId}:${currentCounter}:${rnd}`; | ||
// END USER CODE | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"nativeDependencies": { | ||
"react-native-geocoder": "0.5.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
test/javascriptsource/nanoflowcommons/actions/GetCurrentLocation.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"nativeDependencies": { | ||
"@react-native-community/geolocation": "2.0.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
test/javascriptsource/nanoflowcommons/actions/GetStorageItemObject.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"nativeDependencies": { | ||
"@react-native-community/async-storage": "1.12.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
test/javascriptsource/nanoflowcommons/actions/GetStorageItemObjectList.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"nativeDependencies": { | ||
"@react-native-community/async-storage": "1.12.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
test/javascriptsource/nanoflowcommons/actions/GetStorageItemString.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"nativeDependencies": { | ||
"@react-native-community/async-storage": "1.12.1" | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
test/javascriptsource/nanoflowcommons/actions/RefreshEntity.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// This file was generated by Mendix Studio Pro. | ||
// | ||
// WARNING: Only the following code will be retained when actions are regenerated: | ||
// - the import list | ||
// - the code between BEGIN USER CODE and END USER CODE | ||
// - the code between BEGIN EXTRA CODE and END EXTRA CODE | ||
// Other code you write will be lost the next time you deploy the project. | ||
import { Big } from "big.js"; | ||
|
||
// BEGIN EXTRA CODE | ||
// END EXTRA CODE | ||
|
||
/** | ||
* Updates an entity without needing to refresh the whole page via passing an entity. | ||
* @param {string} entityToRefresh - Entity which will be refreshed. | ||
* @returns {Promise.<void>} | ||
*/ | ||
export async function RefreshEntity(entityToRefresh) { | ||
// BEGIN USER CODE | ||
if (!entityToRefresh) { | ||
return Promise.reject(new Error("EntityToRefresh parameter is required")); | ||
} | ||
return new Promise(resolve => { | ||
mx.data.update({ | ||
entity: entityToRefresh, | ||
callback: () => resolve(true) | ||
}); | ||
}); | ||
// END USER CODE | ||
} |
30 changes: 30 additions & 0 deletions
30
test/javascriptsource/nanoflowcommons/actions/RefreshObject.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// This file was generated by Mendix Studio Pro. | ||
// | ||
// WARNING: Only the following code will be retained when actions are regenerated: | ||
// - the import list | ||
// - the code between BEGIN USER CODE and END USER CODE | ||
// - the code between BEGIN EXTRA CODE and END EXTRA CODE | ||
// Other code you write will be lost the next time you deploy the project. | ||
import { Big } from "big.js"; | ||
|
||
// BEGIN EXTRA CODE | ||
// END EXTRA CODE | ||
|
||
/** | ||
* Updates an entity object without needing to refresh the whole page via passing an entity object. | ||
* @param {MxObject} objectToRefresh - Object which will be refreshed. | ||
* @returns {Promise.<void>} | ||
*/ | ||
export async function RefreshObject(objectToRefresh) { | ||
// BEGIN USER CODE | ||
if (!objectToRefresh) { | ||
return Promise.reject(new Error("ObjectToRefresh parameter is required")); | ||
} | ||
return new Promise(resolve => { | ||
mx.data.update({ | ||
guid: objectToRefresh.getGuid(), | ||
callback: () => resolve(true) | ||
}); | ||
}); | ||
// END USER CODE | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
test/javascriptsource/nanoflowcommons/actions/RemoveStorageItem.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"nativeDependencies": { | ||
"@react-native-community/async-storage": "1.12.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
test/javascriptsource/nanoflowcommons/actions/RequestLocationPermission.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"nativeDependencies": { | ||
"@react-native-community/geolocation": "2.0.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
test/javascriptsource/nanoflowcommons/actions/ReverseGeocode.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"nativeDependencies": { | ||
"react-native-geocoder": "0.5.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
test/javascriptsource/nanoflowcommons/actions/SetStorageItemObject.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"nativeDependencies": { | ||
"@react-native-community/async-storage": "1.12.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.