Skip to content

Commit

Permalink
Merge pull request #200 from mdenet/fix/41-use-only-given-parameters
Browse files Browse the repository at this point in the history
Fix only provide parameters used by tool functions
  • Loading branch information
barnettwilliam authored Mar 21, 2024
2 parents 04c62fa + cbd180f commit 3eefcaf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
6 changes: 1 addition & 5 deletions platform/src/EducationPlatformApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,11 +491,7 @@ class EducationPlatformApp {

const panelConfig = parameterMap.get(param.name);

if (panelConfig == undefined){
// Set unused parameters in the request to undefined as the epsilon backend function expects them all.
actionRequestData[param.name] = "undefined";

} else {
if (panelConfig != undefined){
let parameterData = values.find(val => (val.name === param.name) );

actionRequestData[param.name] = parameterData.data;
Expand Down
5 changes: 1 addition & 4 deletions platform/test/spec/testEducationPlatformAppSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,7 @@ describe("EducationPlatformApp", () => {
expect(platform.functionRegistry_call).toHaveBeenCalledWith(ACTION_FUNCTION_ID, EXPECTED_PARAM_VALUES);
})

it("sends request to a conversion function's url with unused parameters set to undefined", async () => {
/* This behaviour was to ensure compatibility with java google cloud function based
* Epsilon playground pre Micronaut that required all parameters to be provided. */
it("sends requests to a conversion function's url without unused parameters", async () => {
const PARAM1_TYPE = ACTION_FUNCTION_PARAM1_TYPE;

const parameterMap = new Map (
Expand All @@ -323,7 +321,6 @@ describe("EducationPlatformApp", () => {
// Check the expected results
const EXPECTED_PARAM_VALUES = {
[PARAM1_NAME]: PARAM1_VALUE,
[PARAM2_NAME]: "undefined",
"language": TOOL_LANGUAGE
}

Expand Down

0 comments on commit 3eefcaf

Please sign in to comment.