You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2024/08/13 19:29:31 UTC
(streampipes) branch 3112-opc-ua-multi-node-selection-editor updated (fd38380fdf -> bf1d163e0a)
This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a change to branch 3112-opc-ua-multi-node-selection-editor
in repository https://gitbox.apache.org/repos/asf/streampipes.git
from fd38380fdf feat(#3112): Add description header to text editor
new d917cd567e feat(#3112): Remove empty lines
new bf1d163e0a feat(#3112): Fix tree view editor navigation
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../utils/userInput/TreeStaticPropertyUtils.ts | 4 ++--
...atic-runtime-resolvable-tree-input.component.ts | 25 ++++++++++++++++------
.../static-tree-input-browse-nodes.component.ts | 1 +
.../static-tree-input-button-menu.component.html | 4 ++--
.../static-tree-input-text-editor.component.ts | 6 ++++--
5 files changed, 27 insertions(+), 13 deletions(-)
(streampipes) 02/02: feat(#3112): Fix tree view editor navigation
Posted by ze...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch 3112-opc-ua-multi-node-selection-editor
in repository https://gitbox.apache.org/repos/asf/streampipes.git
commit bf1d163e0a89e9bbb641d20a725c3ff7c463f60b
Author: Philipp Zehnder <te...@users.noreply.github.com>
AuthorDate: Tue Aug 13 21:29:12 2024 +0200
feat(#3112): Fix tree view editor navigation
---
.../utils/userInput/TreeStaticPropertyUtils.ts | 4 ++--
...atic-runtime-resolvable-tree-input.component.ts | 25 ++++++++++++++++------
.../static-tree-input-browse-nodes.component.ts | 1 +
.../static-tree-input-button-menu.component.html | 4 ++--
4 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/ui/cypress/support/utils/userInput/TreeStaticPropertyUtils.ts b/ui/cypress/support/utils/userInput/TreeStaticPropertyUtils.ts
index ee98177d66..03f1ee619b 100644
--- a/ui/cypress/support/utils/userInput/TreeStaticPropertyUtils.ts
+++ b/ui/cypress/support/utils/userInput/TreeStaticPropertyUtils.ts
@@ -37,14 +37,14 @@ export class TreeStaticPropertyUtils {
* Opens the text editor
*/
public static switchToTextEditor() {
- cy.dataCy('opc-ua-editor-mode-text').click();
+ cy.dataCy('editor-mode-text').click();
}
/**
* Opens the tree editor
*/
public static switchToTreeEditor() {
- cy.dataCy('opc-ua-editor-mode-tree').click();
+ cy.dataCy('editor-mode-tree').click();
}
/**
diff --git a/ui/src/app/core-ui/static-properties/static-runtime-resolvable-tree-input/static-runtime-resolvable-tree-input.component.ts b/ui/src/app/core-ui/static-properties/static-runtime-resolvable-tree-input/static-runtime-resolvable-tree-input.component.ts
index 80dce0944c..819afae9e1 100644
--- a/ui/src/app/core-ui/static-properties/static-runtime-resolvable-tree-input/static-runtime-resolvable-tree-input.component.ts
+++ b/ui/src/app/core-ui/static-properties/static-runtime-resolvable-tree-input/static-runtime-resolvable-tree-input.component.ts
@@ -42,7 +42,7 @@ export class StaticRuntimeResolvableTreeInputComponent
editorMode: 'tree' | 'text' = 'tree';
@ViewChild('staticTreeInputBrowseNodesComponent')
- staticTreeInputBrowseNodesComponent: StaticTreeInputBrowseNodesComponent;
+ private staticTreeInputBrowseNodesComponent: StaticTreeInputBrowseNodesComponent;
constructor(
runtimeResolvableService: RuntimeResolvableService,
@@ -59,7 +59,7 @@ export class StaticRuntimeResolvableTreeInputComponent
) {
this.loadOptionsFromRestApi();
} else if (this.staticProperty.nodes.length > 0) {
- this.staticTreeInputBrowseNodesComponent.updateNodes(
+ this.staticTreeInputBrowseNodesComponent?.updateNodes(
this.staticProperty.nodes,
);
this.showOptions = true;
@@ -92,11 +92,11 @@ export class StaticRuntimeResolvableTreeInputComponent
}
} else {
this.staticProperty.nodes = staticProperty.nodes;
- this.staticTreeInputBrowseNodesComponent.updateNodes(
+ this.staticTreeInputBrowseNodesComponent?.updateNodes(
this.staticProperty.nodes,
);
}
- this.staticTreeInputBrowseNodesComponent.refreshTree();
+ this.staticTreeInputBrowseNodesComponent?.refreshTree();
this.performValidation();
}
@@ -125,7 +125,7 @@ export class StaticRuntimeResolvableTreeInputComponent
afterErrorReceived() {
this.staticProperty.nodes = [];
- this.staticTreeInputBrowseNodesComponent.updateNodes([]);
+ this.staticTreeInputBrowseNodesComponent?.updateNodes([]);
this.performValidation();
}
@@ -137,7 +137,7 @@ export class StaticRuntimeResolvableTreeInputComponent
this.staticProperty.nextBaseNodeToResolve = undefined;
this.staticProperty.selectedNodesInternalNames = [];
this.staticProperty.latestFetchedNodes = [];
- this.staticTreeInputBrowseNodesComponent.updateNodes([]);
+ this.staticTreeInputBrowseNodesComponent?.updateNodes([]);
this.loadOptionsFromRestApi();
}
@@ -157,7 +157,18 @@ export class StaticRuntimeResolvableTreeInputComponent
this.editorMode = mode;
if (mode === 'tree') {
- this.reload();
+ this.resetStaticPropertyStateAndReload();
}
}
+
+ /**
+ * The static property keeps the state of the last fetched nodes to be able
+ * to set the subtree to the right node. When a user switches the editor
+ * this state should be reset
+ */
+ private resetStaticPropertyStateAndReload() {
+ this.staticProperty.latestFetchedNodes = [];
+ this.staticProperty.nextBaseNodeToResolve = undefined;
+ this.reload();
+ }
}
diff --git a/ui/src/app/core-ui/static-properties/static-runtime-resolvable-tree-input/static-tree-input-browse-nodes/static-tree-input-browse-nodes.component.ts b/ui/src/app/core-ui/static-properties/static-runtime-resolvable-tree-input/static-tree-input-browse-nodes/static-tree-input-browse-nodes.component.ts
index de04432f80..478c719509 100644
--- a/ui/src/app/core-ui/static-properties/static-runtime-resolvable-tree-input/static-tree-input-browse-nodes/static-tree-input-browse-nodes.component.ts
+++ b/ui/src/app/core-ui/static-properties/static-runtime-resolvable-tree-input/static-tree-input-browse-nodes/static-tree-input-browse-nodes.component.ts
@@ -78,6 +78,7 @@ export class StaticTreeInputBrowseNodesComponent implements OnInit {
}
updateNodes(nodes: TreeInputNode[]) {
+ console.log(nodes);
this.dataSource.data = nodes;
}
diff --git a/ui/src/app/core-ui/static-properties/static-runtime-resolvable-tree-input/static-tree-input-button-menu/static-tree-input-button-menu.component.html b/ui/src/app/core-ui/static-properties/static-runtime-resolvable-tree-input/static-tree-input-button-menu/static-tree-input-button-menu.component.html
index 447eb449b5..a7ae7baa17 100644
--- a/ui/src/app/core-ui/static-properties/static-runtime-resolvable-tree-input/static-tree-input-button-menu/static-tree-input-button-menu.component.html
+++ b/ui/src/app/core-ui/static-properties/static-runtime-resolvable-tree-input/static-tree-input-button-menu/static-tree-input-button-menu.component.html
@@ -60,10 +60,10 @@
[(value)]="editorMode"
(change)="onChangeEditor($event.value)"
>
- <mat-button-toggle data-cy="opc-ua-editor-mode-tree" value="tree"
+ <mat-button-toggle data-cy="editor-mode-tree" value="tree"
>Tree</mat-button-toggle
>
- <mat-button-toggle data-cy="opc-ua-editor-mode-text" value="text"
+ <mat-button-toggle data-cy="editor-mode-text" value="text"
>Text</mat-button-toggle
>
</mat-button-toggle-group>
(streampipes) 01/02: feat(#3112): Remove empty lines
Posted by ze...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch 3112-opc-ua-multi-node-selection-editor
in repository https://gitbox.apache.org/repos/asf/streampipes.git
commit d917cd567e4521ae37a69db85edf3fa4f2f2e8a4
Author: Philipp Zehnder <te...@users.noreply.github.com>
AuthorDate: Tue Aug 13 14:49:32 2024 +0200
feat(#3112): Remove empty lines
---
.../static-tree-input-text-editor.component.ts | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ui/src/app/core-ui/static-properties/static-runtime-resolvable-tree-input/static-tree-input-text-editor/static-tree-input-text-editor.component.ts b/ui/src/app/core-ui/static-properties/static-runtime-resolvable-tree-input/static-tree-input-text-editor/static-tree-input-text-editor.component.ts
index 0dfcc08ffd..66ba60a724 100644
--- a/ui/src/app/core-ui/static-properties/static-runtime-resolvable-tree-input/static-tree-input-text-editor/static-tree-input-text-editor.component.ts
+++ b/ui/src/app/core-ui/static-properties/static-runtime-resolvable-tree-input/static-tree-input-text-editor/static-tree-input-text-editor.component.ts
@@ -68,8 +68,10 @@ export class StaticTreeInputTextEditorComponent implements OnInit {
}
onTextChange(value: string): void {
- const lines = value.split('\n').filter(line => !line.startsWith('#'));
- this.staticProperty.selectedNodesInternalNames = lines;
+ this.staticProperty.selectedNodesInternalNames = value
+ .split('\n')
+ // remove empty lines and comments starting with #
+ .filter(line => line.trim() !== '' && !line.startsWith('#'));
this.performValidationEmitter.emit();
}
}