Skip to content

Commit

Permalink
fix empty config (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
LaviniaStiliadou authored Apr 16, 2024
1 parent 396ccea commit a93f2de
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 149 deletions.
5 changes: 5 additions & 0 deletions components/bpmn-q/modeler-component/QuantumWorkflowModeler.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
import NotificationHandler from "./editor/ui/notifications/NotificationHandler";
import { createModeler, getModeler } from "./editor/ModelerHandler";
import {
getConfigTabs,
getPluginButtons,
getTransformationButtons,
} from "./editor/plugin/PluginHandler";
Expand Down Expand Up @@ -327,6 +328,10 @@ export class QuantumWorkflowModeler extends HTMLElement {
});
if (!modeler.config) {
modeler.config = {};
let configTabs = getConfigTabs();
for (let tab of configTabs) {
tab.configTab.prototype.config();
}
}
if (this.workflowModel) {
loadDiagram(this.workflowModel, getModeler()).then();
Expand Down
10 changes: 10 additions & 0 deletions components/bpmn-q/modeler-component/editor/config/GeneralTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ export default function EditorTab() {
EditorTab.prototype.onClose = () => {
modeler.config.camundaEndpoint = camundaEndpoint;
modeler.config.fileName = fileName;
modeler.config.transformedWorkflowHandler = transformedWorkflowHandlers;
modeler.config.fileFormat = fileFormat;
modeler.config.autoSaveFileOption = autoSaveFileOption;
modeler.config.autoSaveIntervalSize = autoSaveIntervalSize;

editorConfig.setCamundaEndpoint(camundaEndpoint);
editorConfig.setTransformedWorkflowHandler(workflowHandler);
editorConfig.setAutoSaveFileOption(autoSaveFileOption);
Expand Down Expand Up @@ -190,4 +195,9 @@ EditorTab.prototype.config = () => {

modeler.config.camundaEndpoint = editorConfig.getCamundaEndpoint();
modeler.config.fileName = editorConfig.getFileName();
modeler.config.transformedWorkflowHandler =
editorConfig.getTransformedWorkflowHandler();
modeler.config.fileFormat = editorConfig.getFileFormat();
modeler.config.autoSaveFileOption = editorConfig.getAutoSaveFileOption();
modeler.config.autoSaveIntervalSize = editorConfig.getAutoSaveIntervalSize();
};

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ export default function DataFlowTab() {
dataConfigManager.getConfigurationsEndpoint()
);

const modeler = getModeler();

// save changed endpoint url if the modal is closed
DataFlowTab.prototype.onClose = () => {
modeler.config.configurationsEndpoint = configurationsEndpoint;
dataConfigManager.setConfigurationsEndpoint(configurationsEndpoint);
};

Expand Down Expand Up @@ -46,6 +49,6 @@ export default function DataFlowTab() {
DataFlowTab.prototype.config = () => {
const modeler = getModeler();

modeler.config.transformationTaskConfigurationsEndpointChanged =
modeler.config.configurationsEndpoint =
dataConfigManager.getConfigurationsEndpoint();
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import QHAnaExtensionModule from "./modeling";
import TransformationButton from "../../editor/ui/TransformationButton";
import ExtensibleButton from "../../editor/ui/ExtensibleButton";
import UpdateQHAnaConfigurationsButton from "./ui/UpdateQHAnaConfigurationsButton";
import QHAnaConfigurationsTab from "./configTabs/QHAnaConfigurationsTab";
import QHAnaConfigTab from "./configTabs/QHAnaConfigTab";
import { startQHAnaReplacementProcess } from "./replacement/QHAnaTransformationHandler";
import qhanaStyles from "./resources/styling/qhana-icons.css";

Expand All @@ -27,7 +27,7 @@ export default {
{
tabId: "QHAnaEndpointsTab",
tabTitle: "QHAna Plugin",
configTab: QHAnaConfigurationsTab,
configTab: QHAnaConfigTab,
},
],
extensionModule: QHAnaExtensionModule,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState } from "react";
import * as configManager from "../framework-config/QHAnaConfigManager";
import { getModeler } from "../../../editor/ModelerHandler";

/**
* React component specifying a tab for the configuration dialog of the modeler. The tab allows the user to change
Expand All @@ -15,9 +16,12 @@ export default function QHAnaConfigurationsTab() {
const [getPluginEndpoint, setGetPluginEndpoint] = useState(
configManager.getGetPluginsURL()
);
const modeler = getModeler();

// save changed values on close
QHAnaConfigurationsTab.prototype.onClose = () => {
modeler.config.listPluginsEndpoint = listPluginsEndpoint;
modeler.config.getGetPluginsURL = getPluginEndpoint;
configManager.setListPluginsURL(listPluginsEndpoint);
configManager.setGetPluginsURL(getPluginEndpoint);
};
Expand Down Expand Up @@ -57,4 +61,8 @@ export default function QHAnaConfigurationsTab() {
);
}

QHAnaConfigurationsTab.prototype.config = () => {};
QHAnaConfigurationsTab.prototype.config = () => {
const modeler = getModeler();
modeler.config.qhanaListPluginsURL = configManager.getListPluginsURL();
modeler.config.qhanqGetPluginURL = configManager.getGetPluginsURL();
};
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,16 @@ export default function QuantMETab() {
QuantMETab.prototype.config = () => {
const modeler = getModeler();

modeler.config.nisqAnalyzerEndpoint = config.getNisqAnalyzerEndpoint();
modeler.config.nisqAnalyzerUiEndpoint = config.getNisqAnalyzerUiEndpoint();
modeler.config.transformationFrameworkEndpoint =
config.getTransformationFrameworkEndpoint();
modeler.config.scriptSplitterEndpoint = config.getScriptSplitterEndpoint();
modeler.config.scriptSplitterThreshold = config.getScriptSplitterThreshold();
modeler.config.qiskitRuntimeHandlerEndpoint =
config.getQiskitRuntimeHandlerEndpoint();
modeler.config.hybridRuntimeProvenance = config.getHybridRuntimeProvenance();
modeler.config.awsRuntimeHandlerEndpoint =
config.getAWSRuntimeHandlerEndpoint();
modeler.config.qprovEndpoint = config.getQProvEndpoint();
modeler.config.nisqAnalyzerUiEndpoint = config.getNisqAnalyzerUiEndpoint();
};

0 comments on commit a93f2de

Please sign in to comment.