-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated internal dependencies to match Mx8.15
- Loading branch information
1 parent
05ff7a6
commit 1c7042c
Showing
171 changed files
with
13,428 additions
and
11,623 deletions.
There are no files selected for viewing
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 @@ | ||
test/ |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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 | ||
} |
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
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
Oops, something went wrong.