From 396cceaa38dd372b9a5f5f30316454c4cfe8a88c Mon Sep 17 00:00:00 2001 From: LaviniaStiliadou Date: Mon, 15 Apr 2024 14:22:22 +0200 Subject: [PATCH] fix checkbox (#149) --- .../extensions/quantme/configTabs/QuantMEConfigTab.js | 2 +- .../extensions/quantme/framework-config/config-manager.js | 6 ++---- components/bpmn-q/test/tests/quantme/quantme-config.spec.js | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/components/bpmn-q/modeler-component/extensions/quantme/configTabs/QuantMEConfigTab.js b/components/bpmn-q/modeler-component/extensions/quantme/configTabs/QuantMEConfigTab.js index 259ad55e..bd883e4e 100644 --- a/components/bpmn-q/modeler-component/extensions/quantme/configTabs/QuantMEConfigTab.js +++ b/components/bpmn-q/modeler-component/extensions/quantme/configTabs/QuantMEConfigTab.js @@ -20,7 +20,7 @@ export default function QuantMETab() { const [qiskitRuntimeHandlerEndpoint, setQiskitRuntimeHandlerEndpoint] = useState(config.getQiskitRuntimeHandlerEndpoint()); const [hybridRuntimeProvenance, setHybridRuntimeProvenance] = useState( - config.getHybridRuntimeProvenance() + config.getHybridRuntimeProvenance() ? true : false ); const [awsRuntimeHandlerEndpoint, setAWSRuntimeHandlerEndpoint] = useState( config.getAWSRuntimeHandlerEndpoint() diff --git a/components/bpmn-q/modeler-component/extensions/quantme/framework-config/config-manager.js b/components/bpmn-q/modeler-component/extensions/quantme/framework-config/config-manager.js index 6c38183b..a10de715 100644 --- a/components/bpmn-q/modeler-component/extensions/quantme/framework-config/config-manager.js +++ b/components/bpmn-q/modeler-component/extensions/quantme/framework-config/config-manager.js @@ -211,7 +211,7 @@ export function setScriptSplitterThreshold(threshold) { /** * Get the hybrid runtime provenance flag * - * @return {boolean} the current value of the hybrid runtime provenance flag + * @return {string} the current value of the hybrid runtime provenance flag */ export function getHybridRuntimeProvenance() { if (config.hybridRuntimeProvenance === undefined) { @@ -233,9 +233,7 @@ export function setHybridRuntimeProvenance(hybridRuntimeProvenance) { hybridRuntimeProvenance !== null && hybridRuntimeProvenance !== undefined ) { - let hybridRuntimeProvenanceBoolean = - hybridRuntimeProvenance === "true" ? true : false; - config.hybridRuntimeProvenance = hybridRuntimeProvenanceBoolean; + config.hybridRuntimeProvenance = hybridRuntimeProvenance; } } diff --git a/components/bpmn-q/test/tests/quantme/quantme-config.spec.js b/components/bpmn-q/test/tests/quantme/quantme-config.spec.js index b98aacbf..0f5307a4 100644 --- a/components/bpmn-q/test/tests/quantme/quantme-config.spec.js +++ b/components/bpmn-q/test/tests/quantme/quantme-config.spec.js @@ -44,7 +44,7 @@ describe("Test QuantME ConfigManager", function () { "http://test:8891" ); expect(quantmeConfig.getScriptSplitterThreshold()).to.equal(7); - expect(quantmeConfig.getHybridRuntimeProvenance()).to.equal(true); + expect(quantmeConfig.getHybridRuntimeProvenance()).to.equal("true"); }); }); });