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

Add and apply linter #66

Merged
merged 46 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3a9f2c0
Add linter script and fix errors
wederbn Jun 15, 2023
9f73435
Apply prettier
wederbn Jun 15, 2023
0a6a75b
Add workflow executing linters
wederbn Jun 15, 2023
68b4b61
Add working directory for npm ci
wederbn Jun 15, 2023
79a3a16
Remove unknown working-directory from linting action
wederbn Jun 15, 2023
2352f74
Update linting workflow
wederbn Jun 15, 2023
1962832
Fix linting command
wederbn Jun 15, 2023
e5c1604
Fix NOTICE file
wederbn Jun 15, 2023
160145f
Fix licence years
wederbn Jun 15, 2023
0fd5db2
Fix name in Github workflow
wederbn Jun 15, 2023
dd1fabb
Enable unused variable linting rule
wederbn Jun 15, 2023
d2577e6
Run prettier
wederbn Jun 15, 2023
c0f4696
Enable unnecessary espace rule
wederbn Jun 15, 2023
25df57a
Add .eslintignore
wederbn Jun 15, 2023
1645c45
Adapt path to public folder
wederbn Jun 15, 2023
9a22188
Update ignore rules for linters
wederbn Jun 15, 2023
5fd8cd4
Merge remote-tracking branch 'origin/master' into feature/linter
wederbn Jun 16, 2023
cb38a43
Lint changes after merging master
wederbn Jun 16, 2023
d081013
Start fixing Readme
wederbn Jun 16, 2023
606b709
Merge remote-tracking branch 'origin/master' into feature/linter
wederbn Jun 23, 2023
4d3602d
Lint changes from merge
wederbn Jun 23, 2023
60444dc
Merge remote-tracking branch 'origin/master' into feature/linter
wederbn Jun 23, 2023
452e3a3
Lint master merge
wederbn Jun 23, 2023
85c3736
Merge remote-tracking branch 'origin/master' into feature/linter
wederbn Jul 25, 2023
65f4136
Lint changes after merge with origin/master
wederbn Jul 25, 2023
dbc8ef8
Replace renderer with correct file
wederbn Jul 25, 2023
25b38d5
Merge remote-tracking branch 'origin/master' into feature/linter
wederbn Aug 25, 2023
a28f6dd
Lint changes
wederbn Aug 25, 2023
4e14fe7
Merge remote-tracking branch 'origin/master' into feature/linter
wederbn Aug 25, 2023
82c83da
Merge remote-tracking branch 'origin/master' into feature/linter
wederbn Aug 25, 2023
c7bbd8f
Lint changes
wederbn Aug 25, 2023
b638937
Merge remote-tracking branch 'origin/master' into feature/linter
wederbn Aug 28, 2023
35c044c
Run linter
wederbn Aug 28, 2023
20c017a
Fix lint error
wederbn Aug 28, 2023
3680608
Merge remote-tracking branch 'origin/master' into feature/linter
wederbn Sep 2, 2023
0b3b030
Add badges to readme
wederbn Sep 2, 2023
4d42f49
New diagram dialog (#89)
LaviniaStiliadou Oct 2, 2023
9a3c9be
Fix plugin handling (#87)
LaviniaStiliadou Oct 2, 2023
eb02cbf
remove useEffect as it overwrites the transformed workflow after open…
mbeisel Oct 19, 2023
44a1d6c
Fix transformation bugs
mbeisel Oct 19, 2023
435b7cd
Merge remote-tracking branch 'origin/master' into feature/linter
wederbn Oct 23, 2023
bec05b8
Fix linting errors
wederbn Oct 23, 2023
0973ef8
Temporarily add OpenTOSCAUtils to QuantME plugin
wederbn Oct 23, 2023
f4f1a9b
Merge remote-tracking branch 'origin/master' into feature/linter
wederbn Oct 23, 2023
f3af7c5
Fix codestyle
wederbn Oct 23, 2023
db7af00
fix open modal
LaviniaStiliadou Oct 23, 2023
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
28 changes: 28 additions & 0 deletions .github/workflows/run-npm-linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check the code style of the Quantum Workflow Modeler

on:
pull_request:
types: [ opened, synchronize ]
push:
branches:
- 'master'

jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install Node.js dependencies and run linters
run: |
npm ci
npm run lint
working-directory: ./components/bpmn-q
2 changes: 1 addition & 1 deletion .github/workflows/run-npm-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run all test of the Quantum Workflow Modeler
name: Run Tests

on:
pull_request:
Expand Down
14 changes: 5 additions & 9 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@

The source code of this project is licensed under the Apache 2.0 license, found in the LICENSE file in this directory.

The code of the QuantME Plugin und certain utility functions of the editor are based on and using code from the
QuantME Transformation Framework, licensed under the MIT license and available
under https://github.com/UST-QuAntiL/QuantME-TransformationFramework.
The code of the QuantME Plugin and certain utility functions of the editor are based on and using code from the QuantME Transformation Framework, licensed under the MIT license and available under https://github.com/UST-QuAntiL/QuantME-TransformationFramework.

The code of the PlanQK Plugin is based on the code of the workflow modeler prototype of the PlanQK Platform.

Certain components of the editor use and extend the code of the bpmn-js repository, the diagram-js repository and the camunda-modeler
repository of Camunda. The bpmn-js repository is licensed under the bpmn.io license and available in the following GitHub
repository https://github.com/bpmn-io/bpmn-js. The diagram-js repository is licensed under the MIT license, available under
the following link: https://github.com/bpmn-io/diagram-js. The camunda-modeler is licensed under the MIT license and available
under the following link: https://github.com/camunda/camunda-modeler.
Certain components of the editor use and extend the code of the bpmn-js repository, the diagram-js repository and the camunda-modeler repository of Camunda.
The bpmn-js repository is licensed under the bpmn.io license and available in the following GitHub repository https://github.com/bpmn-io/bpmn-js.
The diagram-js repository is licensed under the MIT license, available under the following link: https://github.com/bpmn-io/diagram-js.
The camunda-modeler is licensed under the MIT license and available under the following link: https://github.com/camunda/camunda-modeler.

Find copies of the third party license in the THIRD_PARTY_LICENSE directory under this directory.
87 changes: 42 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
# Quantum Workflow Modeler
A web-based modelling tool for modelling BPMN 2.0-based quantum workflows. It uses and extends the
[bpmn-js Modeler](https://github.com/bpmn-io/bpmn-js/) of Camunda which is embedded in the User Interface (UI) of the
Quantum Workflow Modeler and handles the graphical modelling of workflows.

It contains several modelling extensions to the BPMN standard which enable the modeling of an explicit, executable data
flow and the modelling of quantum specific modelling elements. New model extensions can be integrated plugin-based into
the modeler. Read [this guide](doc/quantum-workflow-modeler/editor/plugin/plugin-integration.md) to learn how you can integrate
your own modelling extensions into the modeler.
[![GitHub license](https://img.shields.io/github/license/PlanQK/workflow-modeler)](https://github.com/PlanQK/workflow-modeler/blob/master/LICENSE)
[![Tests](https://github.com/PlanQK/workflow-modeler/actions/workflows/run-npm-test.yml/badge.svg)](https://github.com/PlanQK/workflow-modeler/actions/workflows/run-npm-test.yml)
[![Release](https://img.shields.io/github/v/release/PlanQK/workflow-modeler)](https://img.shields.io/github/v/release/PlanQK/workflow-modeler)

The modeler is implemented as an HTML web component and can be integrated in other web applications as a custom HMTL tag.
Read [this documentation](doc/integration-guide/integration-guide.md) to learn how you can
integrate the modeler in your application and which configuration options and interfaces you can use.
A web-based modeling tool for modeling BPMN 2.0-based quantum workflows.
It uses and extends the [bpmn-js Modeler](https://github.com/bpmn-io/bpmn-js/) of Camunda which is embedded in the User Interface (UI) of the Quantum Workflow Modeler and handles the graphical modeling of workflows.

The implementation of the modeler is located in the [bpmn-q folder](components/bpmn-q). Example Projects to integrate the
modeler in different UI frameworks can be found [here for a Vue.js app](components/bpmn-q-vue)
and [here for an Angular app](components/bpmn-q-angular).
It contains several modeling extensions to the BPMN standard which enable the modeling of quantum workflows.
New model extensions can be integrated plugin-based into the modeler.
Read [this guide](doc/quantum-workflow-modeler/editor/plugin/plugin-integration.md) to learn how you can integrate your own modeling extensions into the modeler.

The Quantum Workflow Modeler is a HTML web component.
The UI components of the modeler are defined with React-js and written in JavaScript. To package the project, webpack is used.
The modeler is implemented as an HTML web component and can be integrated into other web applications as a custom HTML tag.
Read [this documentation](doc/integration-guide/integration-guide.md) to learn how you can integrate the modeler into your application and which configuration options and interfaces you can use.

The implementation of the modeler is located in the [bpmn-q folder](components/bpmn-q).
Example projects to integrate the modeler in different UI frameworks can be found [here for a Vue.js app](components/bpmn-q-vue) and [here for an Angular app](components/bpmn-q-angular).

The Quantum Workflow Modeler is an HTML web component.
The UI components of the modeler are defined with React-js and written in JavaScript.
To package the project, webpack is used.
The tests of the project use mocha with chai for karma.

Refer to the [documentation](doc/README.md) for further information.

## Node Version

The project was created with npm 8.19.2 and node 18.12.1.

## Quickstart
Expand Down Expand Up @@ -54,18 +57,17 @@ docker run --name workflow-modeler -p 8080:8080 workflow-modeler

## How to use this Library

To use the Quantum Workflow Modeler component in your application you have to install its npm package which is published
via GitHub packages. To access the package, you first [have to register the PlanQK namespace](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#installing-a-package)
to your npm setup and then [authenticate to GitHub](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-with-a-personal-access-token).
To use the Quantum Workflow Modeler component in your application you have to install its npm package which is published via GitHub packages.
To access the package, you first [have to register the PlanQK namespace](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#installing-a-package) to your npm setup and then [authenticate to GitHub](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-with-a-personal-access-token).
A more detailed description can be found [here](doc/integration-guide/integration-guide.md).

Then install the npm package with
```
$> npm install --save @planqk/quantum-workflow-modeler
```

Register the Quantum Workflow Modeler component as a custom HTML tag in the UI framework you are using. The exact steps
depend on the specific framework, but here are guides how you can do that in [Angular](), [Vue.js]() and [plain HTML]().
Register the Quantum Workflow Modeler component as a custom HTML tag in the UI framework you are using.
The exact steps depend on the specific framework, but here are guides how you can do that in [Angular](), [Vue.js]() and [plain HTML]().

Use the tag of the component, ```quantum-workflow-modeler``` directly in your HTML
```html
Expand All @@ -82,9 +84,9 @@ const modelerComponent = document.createElement('quantum-workflow-modeler');
```
to integrate the modeler component into the UI of your application.

Activate the plugins you want to use in your instance of the modeler by setting the pluginConfig attribute. You can only
set the pluginConfigs attribute if the modelerComponent is already available in the DOM. If you do not do that, the rendering
will fail.
Activate the plugins you want to use in your instance of the modeler by setting the pluginConfig attribute.
You can only set the pluginConfigs attribute if the modelerComponent is already available in the DOM.
If you do not do that, the rendering will fail.
```javascript
modelerComponent.pluginConfigs = [
{
Expand All @@ -102,23 +104,24 @@ modelerComponent.pluginConfigs = [
]
```

You can configure the plugins like described [here](doc/quantum-workflow-modeler/editor/plugin/plugin-config.md). The structure
of the config is defined by the plugin and can be looked up in the documentation of the respective plugin.
You can configure the plugins as described [here](doc/quantum-workflow-modeler/editor/plugin/plugin-config.md).
The structure of the config is defined by the plugin and can be looked up in the documentation of the respective plugin.

You can add listeners to custom events the Quantum Workflow Modeler triggers for changes in the currently loaded workflow,
like saving or loading a workflow. Read the [EventHandler documentation](doc/quantum-workflow-modeler/editor/events/event-handler-doc.md) to learn more about the events of the modeler.

## Development Setup

To set this project up for development clone the repository and open it in your favorite editor. The project code is under
[./components](components) and is split in three parts: Under [bpmn-q](components/bpmn-q) is the actual code of the Quantum
Workflow Modeler. Under [bpmn-q-angular](components/bpmn-q-angular) is an example project with Angular which integrates the
modeler component. Under [bpmn-q-vue](components/bpmn-q-vue) is a simple Vue-js project which integrate the modeler. These
to projects do not contain code of the Quantum Workflow Modeler component. They are used for testing the integration of the
developed component to test and check its compatibility with other UI frameworks.
To set this project up for development, clone the repository and open it in your favorite editor.
The project code is under [./components](components) and is split in three parts:
Under [bpmn-q](components/bpmn-q) is the actual code of the Quantum Workflow Modeler.
Under [bpmn-q-angular](components/bpmn-q-angular) is an example project with Angular which integrates the modeler component.
Under [bpmn-q-vue](components/bpmn-q-vue) is a simple Vue-js project which integrate the modeler.
These to projects do not contain code of the Quantum Workflow Modeler component.
They are used for testing the integration of the developed component to test and check its compatibility with other UI frameworks.

The actual code for development is in [bpmn-q](components/bpmn-q). To set up the cloned project, execute the following
commands under the ./components/bpmn-q directory.
The actual code for development is in [bpmn-q](components/bpmn-q).
To set up the cloned project, execute the following commands under the ./components/bpmn-q directory.
1. Install dependencies
```
npm install
Expand All @@ -127,23 +130,23 @@ commands under the ./components/bpmn-q directory.
2. Start the Modeler

To execute the Quantum Workflow Modeler, a small test website can be run which only contains the modeler component.
To start this website, execute
To start this website, execute:
```
npm run dev
```
This will start a webpack dev server which loads the website specified in the [index.html file](components/bpmn-q/public/index.html)

3. Build the Modeler

To build the modeler execute
To build the modeler execute:
```
npm run build
```
This will build the modeler component with webpack into a single js file in the [public directory](components/bpmn-q/public).

4. Run all Tests

To execute all tests run
To execute all tests run:
```
npm test
```
Expand All @@ -155,16 +158,10 @@ commands under the ./components/bpmn-q directory.

## Disclaimer of Warranty

Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including,
without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR
PURPOSE.
You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks
associated with Your exercise of permissions under this License.
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.

## Haftungsausschluss

Dies ist ein Forschungsprototyp.
Die Haftung für entgangenen Gewinn, Produktionsausfall, Betriebsunterbrechung, entgangene Nutzungen, Verlust von Daten
und Informationen, Finanzierungsaufwendungen sowie sonstige Vermögens- und Folgeschäden ist, außer in Fällen von grober
Fahrlässigkeit, Vorsatz und Personenschäden, ausgeschlossen.
Die Haftung für entgangenen Gewinn, Produktionsausfall, Betriebsunterbrechung, entgangene Nutzungen, Verlust von Daten und Informationen, Finanzierungsaufwendungen sowie sonstige Vermögens- und Folgeschäden ist, außer in Fällen von grober Fahrlässigkeit, Vorsatz und Personenschäden, ausgeschlossen.
1 change: 1 addition & 0 deletions components/bpmn-q/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public
30 changes: 0 additions & 30 deletions components/bpmn-q/.eslintrc.js

This file was deleted.

22 changes: 22 additions & 0 deletions components/bpmn-q/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"env": {
"browser": true,
"es2021": true,
"commonjs": true,
"node": true,
"mocha": true
},
"extends": ["eslint:recommended", "plugin:react/recommended"],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react"],
"rules": {
"semi": [2, "always"],
"react/prop-types": "off",
"no-prototype-builtins": "off",
"react/jsx-key": "off"
}
}
Binary file added components/bpmn-q/.prettierignore
Binary file not shown.
1 change: 1 addition & 0 deletions components/bpmn-q/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
25 changes: 18 additions & 7 deletions components/bpmn-q/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# Quantum Workflow Modeler - HTML Web Component
This project contains the HTML web component for the Quantum Workflow Modeler and its implementation.

This project contains the HTML web component for the Quantum Workflow Modeler and its implementation.

## Node Version

The project was created with npm 8.19.2 and node 18.12.1.

## Development Setup

To set this project up for development clone the repository and open it in your favorite editor.
To set this project up for development clone the repository and open it in your favorite editor.

Execute the following commands under this directory:

### Install dependencies

```
npm install
```
Expand All @@ -18,30 +22,37 @@ npm install

To execute the Quantum Workflow Modeler, a small test website can be run which only contains the modeler component.
To start this website, execute

```
npm run dev
```

This will start a webpack dev server which loads the website specified in the [index.html file](components/bpmn-q/public/index.html)

### Build the Modeler

To build the modeler execute

```
npm run build
```

This will build the modeler component with webpack into a single js file in the [public directory](components/bpmn-q/public).

### Run all Tests

To execute all tests run

```
npm test
npm test
```
This will run all mocha test specified in [karma.conf.js](components/bpmn-q/karma.conf.js) with karma.

This will run all mocha test specified in [karma.conf.js](components/bpmn-q/karma.conf.js) with karma.

### External Endpoints
Some components of the modeler component need external endpoints to work properly. Refer to [this guide](doc/devloper-setup/developer-setup.md)
for setting up all used endpoints.

Some components of the modeler component need external endpoints to work properly. Refer to [this guide](doc/devloper-setup/developer-setup.md)
for setting up all used endpoints.

## Disclaimer of Warranty

Expand All @@ -57,4 +68,4 @@ associated with Your exercise of permissions under this License.
Dies ist ein Forschungsprototyp.
Die Haftung für entgangenen Gewinn, Produktionsausfall, Betriebsunterbrechung, entgangene Nutzungen, Verlust von Daten
und Informationen, Finanzierungsaufwendungen sowie sonstige Vermögens- und Folgeschäden ist, außer in Fällen von grober
Fahrlässigkeit, Vorsatz und Personenschäden, ausgeschlossen.
Fahrlässigkeit, Vorsatz und Personenschäden, ausgeschlossen.
Loading