Skip to content

Commit

Permalink
Unify plugin structure (#141)
Browse files Browse the repository at this point in the history
* start reorganizing dataflow & qhana

* update imports for dataflow

* reorganize dataflow plugin

* update structure

* fix lint

* add template for plugin structure

* update doc
  • Loading branch information
LaviniaStiliadou authored Feb 20, 2024
1 parent 734dd92 commit 1310a0b
Show file tree
Hide file tree
Showing 129 changed files with 221 additions and 144 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as configConsts from "./Constants";
import { getBusinessObject } from "bpmn-js/lib/util/ModelUtil";
import * as dataConsts from "../../extensions/data-extension/Constants";
import * as dataConsts from "../../extensions/dataflow/Constants";
import {
addCamundaInputMapParameter,
addCamundaOutputMapParameter,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PlanQKPlugin from "../../extensions/planqk/PlanQKPlugin";
import QuantMEPlugin from "../../extensions/quantme/QuantMEPlugin";
import DataFlowPlugin from "../../extensions/data-extension/DataFlowPlugin";
import DataFlowPlugin from "../../extensions/dataflow/DataFlowPlugin";
import QHAnaPlugin from "../../extensions/qhana/QHAnaPlugin";
import PatternPlugin from "../../extensions/pattern/PatternPlugin";
import OpenTOSCAPlugin from "../../extensions/opentosca/OpenTOSCAPlugin";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { deployWorkflowToCamunda } from "../util/IoUtilities";
import { getCamundaEndpoint } from "../config/EditorConfigManager";
import { getRootProcess } from "../util/ModellingUtilities";
import DeploymentSelectionModal from "./DeploymentSelectionModal";
import { startDataFlowReplacementProcess } from "../../extensions/dataflow/replacement/DataFlowTransformator";
import { startPlanqkReplacementProcess } from "../../extensions/planqk/replacement/PlanQKTransformator";
import { startDataFlowReplacementProcess } from "../../extensions/data-extension/transformation/TransformationManager";
import { checkEnabledStatus } from "../plugin/PluginHandler";
import { pluginNames } from "../EditorConstants";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React from "react";

import DataFlowExtensionModule from "./";
import DataFlowExtensionModule from "./modeling";
import TransformationButton from "../../editor/ui/TransformationButton";
import { startDataFlowReplacementProcess } from "./transformation/TransformationManager";
import TransformationTaskConfigurationsTab from "./transf-task-configs/TransformationTaskConfigurationsTab";
import dataStyles from "./resources/data-flow-styles.css";
import { startDataFlowReplacementProcess } from "./replacement/DataFlowTransformator";
import DataFlowTab from "./configTabs/DataFlowTab";
import dataStyles from "./resources/styling/data-flow-styles.css";
import ExtensibleButton from "../../editor/ui/ExtensibleButton";
import UpdateTransformationTaskConfigurationsButton from "./ui/UpdateTransformationConfigurations";
import { getModeler } from "../../editor/ModelerHandler";

let dataflowModdleDescriptor = require("./resources/data-flow-extension.json");

Expand All @@ -20,14 +21,14 @@ export default {
subButtons={[<UpdateTransformationTaskConfigurationsButton />]}
title="DataFlow"
styleClass="dataflow-plugin-icon"
description="Show buttons of the QHAna plugin"
description="Show buttons of the DataFlow plugin"
/>,
],
configTabs: [
{
tabId: "DataEndpointsTab",
tabTitle: "Data Flow Plugin",
configTab: TransformationTaskConfigurationsTab,
configTab: DataFlowTab,
},
],
extensionModule: DataFlowExtensionModule,
Expand All @@ -37,7 +38,13 @@ export default {
<TransformationButton
name="DataFlow Transformation"
transformWorkflow={async (xml) => {
return await startDataFlowReplacementProcess(xml);
let modeler = getModeler();
// Initialize 'views' as an empty object if it's undefined
let views = modeler.views || {};
let transformedXml = await startDataFlowReplacementProcess(xml);
modeler.views = views;

return transformedXml;
}}
/>
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import React, { useState } from "react";
import { getModeler } from "../../../editor/ModelerHandler";
import * as dataConfigManager from "../config/DataConfigManager";
import * as dataConfigManager from "../framework-config/DataConfigManager";

/**
* React component representing a tab for the configuration modal of the editor.
*
* @return {JSX.Element} The config tab
* @constructor
*/
export default function TransformationTaskConfigurationsTab() {
export default function DataFlowTab() {
const [configurationsEndpoint, setConfigurationsEndpoint] = useState(
dataConfigManager.getConfigurationsEndpoint()
);

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

Expand Down Expand Up @@ -43,7 +43,7 @@ export default function TransformationTaskConfigurationsTab() {
);
}

TransformationTaskConfigurationsTab.prototype.config = () => {
DataFlowTab.prototype.config = () => {
const modeler = getModeler();

modeler.config.transformationTaskConfigurationsEndpointChanged =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ConfigurationsEndpoint from "../../../editor/configurations/ConfigurationEndpoint";
import * as consts from "../Constants";
import * as dataConfig from "../config/DataConfigManager";
import * as dataConfig from "../framework-config/DataConfigManager";

/**
* Configurations Endpoint Wrapper for loading configurations for transformation tasks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from "../../../editor/util/PopupMenuUtilities";
import * as consts from "../Constants";
import { createConfigurationsEntries } from "../../../editor/configurations/ConfigurationsUtil";
import { getTransformationTaskConfigurations } from "../transf-task-configs/TransformationTaskConfigurations";
import { getTransformationTaskConfigurations } from "../configurations/TransformationTaskConfigurations";
import { replaceConnection } from "../../../editor/util/ModellingUtilities";
import { filter } from "min-dash";
import { isDifferentType } from "bpmn-js/lib/features/popup-menu/util/TypeUtil";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import DataFlowRenderer from "./rendering/DataFlowRenderer";
import DataFlowReplaceMenuProvider from "./menu/DataFlowReplaceMenuProvider";
import DataFlowPaletteProvider from "./palette/DataFlowPaletteProvider";
import DataFlowRulesProvider from "./rules/DataFlowRulesProvider";
import DataReplaceConnectionBehavior from "./rules/DataReplaceConnectionBehaviour";
import DataFlowRenderer from "./DataFlowRenderer";
import DataFlowReplaceMenuProvider from "./DataFlowReplaceMenuProvider";
import DataFlowPaletteProvider from "./DataFlowPaletteProvider";
import DataFlowRulesProvider from "./DataFlowRulesProvider";
import DataReplaceConnectionBehavior from "./DataReplaceConnectionBehaviour";
import DataFlowPropertiesProvider from "./properties-panel/DataFlowPropertiesProvider";

export default {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import keyValueMap from "./KeyValueMap";
import { is } from "bpmn-js/lib/util/ModelUtil";
import { ListGroup } from "@bpmn-io/properties-panel";
import * as consts from "../Constants";
import * as configConsts from "../../../editor/configurations/Constants";
import ConfigurationsProperties from "../../../editor/configurations/ConfigurationsProperties";
import { getTransformationTaskConfiguration } from "../transf-task-configs/TransformationTaskConfigurations";
import * as consts from "../../Constants";
import * as configConsts from "../../../../editor/configurations/Constants";
import ConfigurationsProperties from "../../../../editor/configurations/ConfigurationsProperties";
import { getTransformationTaskConfiguration } from "../../configurations/TransformationTaskConfigurations";

const LOW_PRIORITY = 500;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { getBusinessObject } from "bpmn-js/lib/util/ModelUtil";
import KeyValueEntry from "./KeyValueEntry";
import { without } from "min-dash";
import * as consts from "../Constants";
import { nextId } from "../../../editor/util/camunda-utils/ElementUtil";
import * as consts from "../../Constants";
import { nextId } from "../../../../editor/util/camunda-utils/ElementUtil";

/**
* Entry of the properties panel which displays a key value map. Entries can be added or removed over the UI of the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
width: 5px;
height: 5px;
background-size: contain;
background-image: url("../resources/icons/change-exchange-icon.svg");
background-image: url("../icons/change-exchange-icon.svg");
background-repeat: no-repeat;
display: inline-block;
float: left;
Expand All @@ -19,7 +19,7 @@
width: 30px;
height: 30px;
background-size: contain;
background-image: url("../resources/icons/data-store-map-icon.svg");
background-image: url("../icons/data-store-map-icon.svg");
background-repeat: no-repeat;
display: inline-block;
float: left;
Expand All @@ -35,7 +35,7 @@
width: 10px;
height: 10px;
background-size: contain;
background-image: url("../resources/icons/data-map-object-icon.svg");
background-image: url("../icons/data-map-object-icon.svg");
background-repeat: no-repeat;
display: inline-block;
}
Expand All @@ -45,7 +45,7 @@
width: 10px;
height: 10px;
background-size: contain;
background-image: url("../resources/icons/data-map-object-icon.svg");
background-image: url("../icons/data-map-object-icon.svg");
background-repeat: no-repeat;
display: inline-block;
}
Expand All @@ -59,7 +59,7 @@
width: 12px;
height: 12px;
background-size: contain;
background-image: url("../resources/icons/transformation-task.svg");
background-image: url("../icons/transformation-task.svg");
background-repeat: no-repeat;
display: inline-block;
transform: scale(0.6);
Expand All @@ -72,7 +72,7 @@
.dataflow-data-store-map-task-palette-icon {
content: "";
background-size: contain;
background-image: url("../resources/icons/data-store-map-icon.svg");
background-image: url("../icons/data-store-map-icon.svg");
background-repeat: no-repeat;
display: inline-block;
transform: scale(0.6);
Expand All @@ -85,7 +85,7 @@
.dataflow-data-map-object-palette-icon {
content: "";
background-size: contain;
background-image: url("../resources/icons/data-map-object-icon.svg");
background-image: url("../icons/data-map-object-icon.svg");
background-repeat: no-repeat;
transform: scale(0.8);
}
Expand All @@ -99,7 +99,7 @@
width: 20px;
height: 20px;
background-size: contain;
background-image: url("../resources/icons/transformation-association-icon.svg");
background-image: url("../icons/transformation-association-icon.svg");
background-repeat: no-repeat;
display: inline-block;
float: left;
Expand All @@ -111,7 +111,7 @@
width: 20px;
height: 20px;
background-size: contain;
background-image: url("../resources/icons/data-association.svg");
background-image: url("../icons/data-association.svg");
background-repeat: no-repeat;
display: inline-block;
float: left;
Expand All @@ -123,7 +123,7 @@
width: 15px;
height: 15px;
background-size: contain;
background-image: url("./icons/structure-diagram-icon-or.svg");
background-image: url("../icons/structure-diagram-icon-or.svg");
background-repeat: no-repeat;
display: inline-block;
float: left;
Expand All @@ -135,7 +135,7 @@
width: 15px;
height: 15px;
background-size: contain;
background-image: url("./icons/update-icon.svg");
background-image: url("../icons/update-icon.svg");
background-repeat: no-repeat;
display: inline-block;
float: left;
Expand All @@ -147,7 +147,7 @@
width: 5px;
height: 5px;
background-size: contain;
background-image: url("../resources/icons/transformation-task.svg");
background-image: url("../icons/transformation-task.svg");
background-repeat: no-repeat;
display: inline-block;
}
Expand All @@ -157,7 +157,7 @@
width: 5px;
height: 5px;
background-size: contain;
background-image: url("../resources/icons/change-exchange-icon.svg");
background-image: url("../icons/change-exchange-icon.svg");
background-repeat: no-repeat;
display: inline-block;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { updateTransformationTaskConfigurations } from "../transf-task-configs/TransformationTaskConfigurations";
import { updateTransformationTaskConfigurations } from "../configurations/TransformationTaskConfigurations";

/**
* React button component which updates the transformation task configurations when clicked.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";

import OpenTOSCAConfigTab from "./configTabs/OpenTOSCAConfigTab";

import OpenTOSCAStyles from "./styling/opentosca.css";
import OpenTOSCAStyles from "./resources/styling/opentosca.css";
import DeploymentPlugin from "./ui/deployment/services/DeploymentPlugin";
import OpenTOSCAExtensionModule from "./modeling";
let OpenTOSCAModdleExtension = require("./resources/opentosca4bpmn.json");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { createLine } from "diagram-js/lib/util/RenderUtil";
import BpmnRenderer from "bpmn-js/lib/draw/BpmnRenderer";
import { getOrientation } from "diagram-js/lib/layout/LayoutUtil";

import buttonIcon from "../resources/show-deployment-button.svg?raw";
import buttonIcon from "../resources/icons/show-deployment-button.svg?raw";
import { drawTaskSVG } from "../../../editor/util/RenderUtilities";
import NotificationHandler from "../../../editor/ui/notifications/NotificationHandler";
import {
Expand Down
Loading

0 comments on commit 1310a0b

Please sign in to comment.