Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix only provide parameters used by tool functions #200

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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