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 missing scrollbar in xml viewer #91

Merged
merged 54 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 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
98b0b42
add scrollbar
LaviniaStiliadou Sep 18, 2023
4d42f49
New diagram dialog (#89)
LaviniaStiliadou Oct 2, 2023
9a3c9be
Fix plugin handling (#87)
LaviniaStiliadou Oct 2, 2023
a426156
fix minLines and maxLines
LaviniaStiliadou Oct 4, 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
dc7530a
Merge branch 'feature/linter' into fix/xml-viewer
wederbn Oct 24, 2023
3c4bfc9
add scrollbar
LaviniaStiliadou Sep 18, 2023
d831b78
fix minLines and maxLines
LaviniaStiliadou Oct 4, 2023
18a93c4
Merge branch 'fix/xml-viewer' of https://github.com/PlanQK/workflow-m…
wederbn Oct 24, 2023
9866036
Merge remote-tracking branch 'origin/master' into fix/xml-viewer
wederbn Oct 24, 2023
d9ea981
Remove comment
wederbn Oct 24, 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
17 changes: 14 additions & 3 deletions components/bpmn-q/modeler-component/QuantumWorkflowModeler.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
import * as editorConfig from "./editor/config/EditorConfigManager";
import { initEditorEventHandler } from "./editor/events/EditorEventHandler";
import $ from "jquery";
import { edit } from "ace-builds";
import ace from "ace-builds";

/**
* The Quantum Workflow modeler HTML web component which contains the bpmn-js modeler to model BPMN diagrams, an editor
Expand Down Expand Up @@ -200,7 +200,13 @@ export class QuantumWorkflowModeler extends HTMLElement {

let editor = document.getElementById("editor");
let dragging = false;
let aceEditor = edit(editor);
let aceEditor = ace.edit(editor);
aceEditor.setOptions({
scrollPastEnd: false,
vScrollBarAlwaysVisible: true,
minLines: 10,
maxLines: 10,
});

$("#editor_dragbar").mousedown(function (e) {
e.preventDefault();
Expand Down Expand Up @@ -231,7 +237,12 @@ export class QuantumWorkflowModeler extends HTMLElement {
editor_wrap.css("height", newHeight + "px");
editorElement.css("height", editorHeight + "px");
dragbar.css("top", newTop - dragbar.height() + "px");
aceEditor.resize();
aceEditor.setOptions({
minLines: editorHeight / 28 + 7,
maxLines: editorHeight / 28 + 7,
});

aceEditor.resize(true);
}
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@
background: url("../icons/save-outline-icon.png") no-repeat center center;
}

#editor {
position: absolute;
width: 100%;
height: 20px;
overflow-y: auto;
}

.ace_print-margin {
display: none;
}

.qwm-icon-upload:before {
content: "";
width: 15px;
Expand All @@ -222,3 +233,19 @@
display: inline-block;
float: left;
}

.qwm-icon-xml-viewer:before {
content: "";
width: 20px;
height: 18px;
margin-top: 0px;
background-size: contain;
background-image: url("../icons/xml-viewer-icon.png");
background-repeat: no-repeat;
display: inline-block;
float: left;
}

.ace_scrollbar.ace_scrollbar-h {
display: none;
}
22 changes: 15 additions & 7 deletions components/bpmn-q/modeler-component/editor/ui/XMLViewerButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ import { loadDiagram } from "../util/IoUtilities";
*/
export default function XMLViewerButton() {
const [enabledXMLView, setEnabledXMLView] = useState(false);

function update(aceEditor) {
let xml = aceEditor.getSession().getValue();
loadDiagram(xml, getModeler());
}

function enableXMLViewer(enabledXMLView) {
let modelerContainer = document.getElementById("modeler-container");
let editor = document.getElementById("editor");
Expand All @@ -20,7 +26,15 @@ export default function XMLViewerButton() {
if (!enabledXMLView) {
modelerContainer.style.height = "93vh";
editor.style.display = "block";
const minLines = aceEditor.getOption("minLines");
const maxLines = aceEditor.getOption("maxLines");
editor.style.height = "93vh";
aceEditor.setOptions({
vScrollBarAlwaysVisible: true,
minLines: minLines,
maxLines: maxLines,
});
aceEditor.resize(true);
panel.style.display = "none";
editorWrap.style.display = "block";

Expand All @@ -37,14 +51,8 @@ export default function XMLViewerButton() {
editorWrap.style.display = "none";

aceEditor.getSession().on("change", function () {
update();
update(aceEditor);
});

// eslint-disable-next-line no-inner-declarations
function update() {
let xml = aceEditor.getSession().getValue();
loadDiagram(xml, getModeler());
}
}

setEnabledXMLView(!enabledXMLView);
Expand Down