This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new 32af33024a fixes: on dev small usability fixes and fixes on filter
function (#3951)
32af33024a is described below
commit 32af33024af68ceb32526e09f1574d242b83f8db
Author: Jacqueline Höllig <[email protected]>
AuthorDate: Tue Nov 25 13:46:33 2025 +0100
fixes: on dev small usability fixes and fixes on filter function (#3951)
---
ui/deployment/i18n/de.json | 1 +
ui/deployment/i18n/en.json | 1 +
.../asset-browser-toolbar.component.ts | 1 +
.../asset-browser/asset-browser.component.ts | 1 +
.../asset-browser/asset-browser.service.ts | 26 +++++++++++--
.../asset-overview/asset-overview.component.ts | 44 +++++++++++++++++++++-
.../existing-adapters.component.ts | 11 ++++--
.../dashboard-overview-table.component.ts | 12 ++++--
.../data-explorer-overview-table.component.ts | 12 ++++--
ui/src/app/pipelines/pipelines.component.ts | 10 +++--
.../token/token-management-settings.component.html | 6 ++-
11 files changed, 104 insertions(+), 21 deletions(-)
diff --git a/ui/deployment/i18n/de.json b/ui/deployment/i18n/de.json
index 60ecb8a773..65388b02d6 100644
--- a/ui/deployment/i18n/de.json
+++ b/ui/deployment/i18n/de.json
@@ -6,6 +6,7 @@
"Name": "Name",
"Create new API key": "Neuen API-Schlüssel erstellen",
"Key created": "Schlüssel erstellt",
+ "Your new API key has been created. Please copy the key now - you won't be
able to see the key again.": "Ihr neuer API-Schlüssel wurde erstellt. Bitte
kopieren Sie den Schlüssel jetzt - Sie werden ihn nicht mehr sehen können.",
"Existing API keys": "Vorhandene API-Schlüssel",
"no keys available": "keine Schlüssel verfügbar",
"API Docs": "API-Doku",
diff --git a/ui/deployment/i18n/en.json b/ui/deployment/i18n/en.json
index 025fe9df76..c5223035e5 100644
--- a/ui/deployment/i18n/en.json
+++ b/ui/deployment/i18n/en.json
@@ -6,6 +6,7 @@
"Name": null,
"Create new API key": null,
"Key created": null,
+ "Your new API key has been created. Please copy the key now - you won't be
able to see the key again.": null,
"Existing API keys": null,
"no keys available": null,
"API Docs": null,
diff --git
a/ui/projects/streampipes/shared-ui/src/lib/components/asset-browser/asset-browser-toolbar/asset-browser-toolbar.component.ts
b/ui/projects/streampipes/shared-ui/src/lib/components/asset-browser/asset-browser-toolbar/asset-browser-toolbar.component.ts
index 6c318c82e7..ad2c175d72 100644
---
a/ui/projects/streampipes/shared-ui/src/lib/components/asset-browser/asset-browser-toolbar/asset-browser-toolbar.component.ts
+++
b/ui/projects/streampipes/shared-ui/src/lib/components/asset-browser/asset-browser-toolbar/asset-browser-toolbar.component.ts
@@ -66,6 +66,7 @@ export class AssetBrowserToolbarComponent implements OnInit,
OnDestroy {
}
ngOnDestroy() {
+ this.assetBrowserService.resetFilters();
this.assetBrowserData$?.unsubscribe();
}
diff --git
a/ui/projects/streampipes/shared-ui/src/lib/components/asset-browser/asset-browser.component.ts
b/ui/projects/streampipes/shared-ui/src/lib/components/asset-browser/asset-browser.component.ts
index cc12eee708..8d699705d6 100644
---
a/ui/projects/streampipes/shared-ui/src/lib/components/asset-browser/asset-browser.component.ts
+++
b/ui/projects/streampipes/shared-ui/src/lib/components/asset-browser/asset-browser.component.ts
@@ -124,6 +124,7 @@ export class AssetBrowserComponent implements OnInit,
OnDestroy {
}
ngOnDestroy(): void {
+ this.assetBrowserService.resetFilters();
this.assetBrowserDataSub?.unsubscribe();
this.expandedSub?.unsubscribe();
}
diff --git
a/ui/projects/streampipes/shared-ui/src/lib/components/asset-browser/asset-browser.service.ts
b/ui/projects/streampipes/shared-ui/src/lib/components/asset-browser/asset-browser.service.ts
index 07b4484af0..119bf3d81c 100644
---
a/ui/projects/streampipes/shared-ui/src/lib/components/asset-browser/asset-browser.service.ts
+++
b/ui/projects/streampipes/shared-ui/src/lib/components/asset-browser/asset-browser.service.ts
@@ -33,6 +33,7 @@ import {
AssetFilter,
FilterResult,
} from './asset-browser.model';
+import { CurrentUserService } from '../../services/current-user.service';
@Injectable({ providedIn: 'root' })
export class SpAssetBrowserService {
@@ -50,6 +51,7 @@ export class SpAssetBrowserService {
private genericStorageService = inject(GenericStorageService);
private typeService = inject(Isa95TypeService);
private assetService = inject(AssetManagementService);
+ private currentUserService = inject(CurrentUserService);
constructor() {
this.loadAssetData();
@@ -172,10 +174,16 @@ export class SpAssetBrowserService {
}
applyAssetFilter(filteredAssets: SpAsset[]) {
- const elementIds = new Set<string>();
- filteredAssets.forEach(asset => {
- this.collectElementIds(asset, this.activeAssetLink, elementIds);
- });
+ let elementIds: Set<string> | undefined = undefined;
+
+ if (filteredAssets.length === 0) {
+ elementIds = undefined;
+ } else {
+ elementIds = new Set<string>();
+ filteredAssets.forEach(asset => {
+ this.collectElementIds(asset, this.activeAssetLink,
elementIds);
+ });
+ }
const currentFilter = {
filterActive: true,
activeElementIds: elementIds,
@@ -259,6 +267,8 @@ export class SpAssetBrowserService {
asset.assets.forEach((a: SpAsset) => {
this.collectElementIds(a, filteredLinkType, elementIds);
});
+ } else {
+ elementIds = new Set<string>();
}
}
@@ -267,4 +277,12 @@ export class SpAssetBrowserService {
.filter(a => a.linkType === filteredLinkType)
.map(a => a.resourceId);
}
+
+ hasNoAssetFilterPermission(): boolean {
+ return !this.currentUserService.hasAnyRole([
+ 'ROLE_ADMIN',
+ 'ROLE_ASSET_ADMIN',
+ 'ROLE_ASSET_USER',
+ ]);
+ }
}
diff --git
a/ui/src/app/assets/components/asset-overview/asset-overview.component.ts
b/ui/src/app/assets/components/asset-overview/asset-overview.component.ts
index 4851e47e8b..11d25d3543 100644
--- a/ui/src/app/assets/components/asset-overview/asset-overview.component.ts
+++ b/ui/src/app/assets/components/asset-overview/asset-overview.component.ts
@@ -16,7 +16,7 @@
*
*/
-import { Component, OnInit } from '@angular/core';
+import { Component, inject, OnInit } from '@angular/core';
import { MatTableDataSource } from '@angular/material/table';
import {
AssetManagementService,
@@ -37,6 +37,7 @@ import { SpCreateAssetDialogComponent } from
'../../dialog/create-asset/create-a
import { IdGeneratorService } from
'../../../core-services/id-generator/id-generator.service';
import { UserPrivilege } from '../../../_enums/user-privilege.enum';
import { MatDialog } from '@angular/material/dialog';
+import { Subscription } from 'rxjs';
@Component({
selector: 'sp-asset-overview',
@@ -46,6 +47,7 @@ import { MatDialog } from '@angular/material/dialog';
})
export class SpAssetOverviewComponent implements OnInit {
existingAssets: SpAssetModel[] = [];
+ filteredAssets: SpAssetModel[] = [];
displayedColumns: string[] = ['name', 'actions'];
@@ -54,6 +56,11 @@ export class SpAssetOverviewComponent implements OnInit {
hasWritePrivilege = false;
+ assetFilter$: Subscription;
+ currentFilterIds = new Set<string>();
+
+ private assetFilterService = inject(SpAssetBrowserService);
+
constructor(
private assetService: AssetManagementService,
private breadcrumbService: SpBreadcrumbService,
@@ -72,6 +79,28 @@ export class SpAssetOverviewComponent implements OnInit {
this.breadcrumbService.updateBreadcrumb(
this.breadcrumbService.getRootLink(SpAssetRoutes.BASE),
);
+ this.assetFilter$ =
+ this.assetFilterService.currentAssetFilter$.subscribe(filter => {
+ const elementIdsSet = new Set<string>();
+
+ if (
+ filter?.selectedAssets &&
+ Array.isArray(filter.selectedAssets)
+ ) {
+ filter.selectedAssets.forEach(asset => {
+ if ((asset as SpAssetModel)?.elementId) {
+ elementIdsSet.add(
+ (asset as SpAssetModel)?.elementId,
+ );
+ }
+ });
+ }
+
+ this.currentFilterIds =
+ elementIdsSet.size > 0 ? elementIdsSet : undefined;
+
+ this.applyAssetFilters(this.currentFilterIds);
+ });
this.loadAssets();
}
@@ -82,6 +111,19 @@ export class SpAssetOverviewComponent implements OnInit {
});
}
+ applyAssetFilters(elementIds: Set<string>): void {
+ if (elementIds == undefined) {
+ this.filteredAssets = [];
+ } else if (elementIds.size == 0) {
+ this.filteredAssets = this.existingAssets;
+ } else {
+ this.filteredAssets = this.existingAssets.filter(a =>
+ elementIds.has(a.elementId),
+ );
+ }
+ this.dataSource.data = this.filteredAssets;
+ }
+
createNewAsset() {
const assetModel: SpAssetModel = {
assetName: 'New Asset',
diff --git
a/ui/src/app/connect/components/existing-adapters/existing-adapters.component.ts
b/ui/src/app/connect/components/existing-adapters/existing-adapters.component.ts
index d3fb7167cf..91c545de62 100644
---
a/ui/src/app/connect/components/existing-adapters/existing-adapters.component.ts
+++
b/ui/src/app/connect/components/existing-adapters/existing-adapters.component.ts
@@ -46,6 +46,7 @@ import { SpConnectRoutes } from '../../connect.routes';
import { Subscription } from 'rxjs';
import { ShepherdService } from '../../../services/tour/shepherd.service';
import { TranslateService } from '@ngx-translate/core';
+import { UserRole } from 'src/app/_enums/user-role.enum';
@Component({
selector: 'sp-existing-adapters',
@@ -104,8 +105,7 @@ export class ExistingAdaptersComponent implements OnInit,
OnDestroy {
this.assetFilterService.applyAssetLinkType('adapter');
this.assetFilter$ =
this.assetFilterService.currentAssetFilter$.subscribe(filter => {
- this.currentFilterIds =
- filter?.activeElementIds || new Set<string>();
+ this.currentFilterIds = filter?.activeElementIds;
this.applyAdapterFilters(this.currentFilterIds);
});
this.breadcrumbService.updateBreadcrumb(
@@ -292,11 +292,16 @@ export class ExistingAdaptersComponent implements OnInit,
OnDestroy {
}
applyAdapterFilters(elementIds: Set<string>): void {
+ if (this.assetFilterService.hasNoAssetFilterPermission()) {
+ elementIds = new Set<string>();
+ }
this.currentFilterIds = elementIds;
this.filteredAdapters = this.adapterFilter
.transform(this.existingAdapters, this.currentFilter)
.filter(a => {
- if (elementIds.size === 0) {
+ if (elementIds === undefined) {
+ return false;
+ } else if (elementIds.size === 0) {
return true;
} else {
return elementIds.has(a.elementId);
diff --git
a/ui/src/app/dashboard/components/overview/dashboard-overview-table/dashboard-overview-table.component.ts
b/ui/src/app/dashboard/components/overview/dashboard-overview-table/dashboard-overview-table.component.ts
index 713128e691..919df71aad 100644
---
a/ui/src/app/dashboard/components/overview/dashboard-overview-table/dashboard-overview-table.component.ts
+++
b/ui/src/app/dashboard/components/overview/dashboard-overview-table/dashboard-overview-table.component.ts
@@ -75,8 +75,7 @@ export class DashboardOverviewTableComponent implements
OnInit, OnDestroy {
this.assetFilterService.applyAssetLinkType('dashboard');
this.assetFilter$ =
this.assetFilterService.currentAssetFilter$.subscribe(filter => {
- this.currentFilterIds =
- filter?.activeElementIds || new Set<string>();
+ this.currentFilterIds = filter?.activeElementIds;
this.applyDashboardFilters(this.currentFilterIds);
});
this.getDashboards();
@@ -152,8 +151,13 @@ export class DashboardOverviewTableComponent implements
OnInit, OnDestroy {
});
}
- applyDashboardFilters(elementIds: Set<string> = new Set<string>()): void {
- if (elementIds.size == 0) {
+ applyDashboardFilters(elementIds: Set<string>): void {
+ if (this.assetFilterService.hasNoAssetFilterPermission()) {
+ elementIds = new Set<string>();
+ }
+ if (elementIds == undefined) {
+ this.filteredDashboards = [];
+ } else if (elementIds.size == 0) {
this.filteredDashboards = this.dashboards;
} else {
this.filteredDashboards = this.dashboards.filter(a =>
diff --git
a/ui/src/app/data-explorer/components/overview/data-explorer-overview-table/data-explorer-overview-table.component.ts
b/ui/src/app/data-explorer/components/overview/data-explorer-overview-table/data-explorer-overview-table.component.ts
index 0edf6c1cbf..4ad6f5cd57 100644
---
a/ui/src/app/data-explorer/components/overview/data-explorer-overview-table/data-explorer-overview-table.component.ts
+++
b/ui/src/app/data-explorer/components/overview/data-explorer-overview-table/data-explorer-overview-table.component.ts
@@ -68,8 +68,7 @@ export class SpDataExplorerDataViewOverviewComponent
implements OnInit {
this.assetFilterService.applyAssetLinkType('chart');
this.assetFilter$ =
this.assetFilterService.currentAssetFilter$.subscribe(filter => {
- this.currentFilterIds =
- filter?.activeElementIds || new Set<string>();
+ this.currentFilterIds = filter?.activeElementIds;
this.applyChartFilters(this.currentFilterIds);
});
this.getDataViews();
@@ -141,8 +140,13 @@ export class SpDataExplorerDataViewOverviewComponent
implements OnInit {
});
}
- applyChartFilters(elementIds: Set<string> = new Set<string>()): void {
- if (elementIds.size == 0) {
+ applyChartFilters(elementIds: Set<string>): void {
+ if (this.assetFilterService.hasNoAssetFilterPermission()) {
+ elementIds = new Set<string>();
+ }
+ if (elementIds === undefined) {
+ this.filteredCharts = [];
+ } else if (elementIds.size === 0) {
this.filteredCharts = this.charts;
} else {
this.filteredCharts = this.charts.filter(a =>
diff --git a/ui/src/app/pipelines/pipelines.component.ts
b/ui/src/app/pipelines/pipelines.component.ts
index 0d692b4190..109a089fc4 100644
--- a/ui/src/app/pipelines/pipelines.component.ts
+++ b/ui/src/app/pipelines/pipelines.component.ts
@@ -80,8 +80,7 @@ export class PipelinesComponent implements OnInit, OnDestroy {
this.assetFilterService.applyAssetLinkType('pipeline');
this.assetFilter$ =
this.assetFilterService.currentAssetFilter$.subscribe(filter => {
- this.currentFilters =
- filter?.activeElementIds || new Set<string>();
+ this.currentFilters = filter?.activeElementIds;
this.applyPipelineFilters(this.currentFilters);
});
this.breadcrumbService.updateBreadcrumb(
@@ -123,8 +122,13 @@ export class PipelinesComponent implements OnInit,
OnDestroy {
}
applyPipelineFilters(elementIds: Set<string>) {
+ if (this.assetFilterService.hasNoAssetFilterPermission()) {
+ elementIds = new Set<string>();
+ }
this.currentFilters = elementIds;
- if (elementIds.size == 0) {
+ if (elementIds === undefined) {
+ this.filteredPipelines = [];
+ } else if (elementIds.size === 0) {
this.filteredPipelines = this.pipelines;
} else {
this.filteredPipelines = this.pipelines.filter(p =>
diff --git
a/ui/src/app/profile/components/token/token-management-settings.component.html
b/ui/src/app/profile/components/token/token-management-settings.component.html
index cc5a19f9e0..f32894612b 100644
---
a/ui/src/app/profile/components/token/token-management-settings.component.html
+++
b/ui/src/app/profile/components/token/token-management-settings.component.html
@@ -81,8 +81,10 @@
{{ 'Key created' | translate }}
</div>
<div class="subsection-small">
- {{ 'Your new API key has been created. Please copy the key
now -
- you won't be able to see the key again.' | translate }}
+ {{
+ "Your new API key has been created. Please copy the
key now - you won't be able to see the key again."
+ | translate
+ }}
</div>
<div
fxFlex="100"