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 c4d77a3f9f fixes: some small fixes in UI translations and
functionalities (#3971)
c4d77a3f9f is described below
commit c4d77a3f9fcb525850cbe737995c635c63a9f399
Author: Jacqueline Höllig <[email protected]>
AuthorDate: Thu Dec 4 13:21:02 2025 +0100
fixes: some small fixes in UI translations and functionalities (#3971)
Co-authored-by: Philipp Zehnder <[email protected]>
---
.../streampipes/export/DataLakeExportManager.java | 17 +++----
ui/deployment/i18n/de.json | 56 ++++++++++++++++++----
ui/deployment/i18n/en.json | 53 ++++++++++++++++----
.../sp-paginator/sp-paginator.component.ts | 48 +++++++++++++++++++
.../components/sp-table/sp-table.component.html | 3 +-
.../data-download-dialog.component.html | 6 +++
.../shared-ui/src/lib/shared-ui.module.ts | 12 ++++-
.../asset-details-basics.component.html | 34 ++++++++-----
.../asset-details-labels.component.html | 7 +--
.../asset-details-site.component.html | 2 +-
.../asset-location/asset-location.component.html | 2 +-
.../asset-details-links.component.html | 5 +-
.../asset-details-links.component.ts | 8 +++-
.../edit-asset/asset-details.component.html | 4 +-
.../asset-overview/asset-overview.component.html | 5 +-
.../asset-overview/asset-overview.component.ts | 33 +++++++++----
.../create-asset-dialog.component.html | 23 ++++-----
.../edit-asset-link-dialog.component.html | 4 +-
.../manage-asset-links-dialog.component.html | 32 ++++++-------
.../files/file-overview/file-overview.component.ts | 8 ++--
.../existing-adapters.component.html | 2 +-
.../existing-adapters.component.ts | 8 ++++
.../dashboard-overview-table.component.html | 7 +--
.../dashboard-overview-table.component.ts | 25 +++++++++-
.../data-explorer-overview-table.component.html | 7 +--
.../data-explorer-overview-table.component.ts | 18 ++++++-
.../pipeline-overview.component.html | 4 +-
.../pipeline-overview.component.ts | 8 ++++
28 files changed, 331 insertions(+), 110 deletions(-)
diff --git
a/streampipes-data-export/src/main/java/org/apache/streampipes/export/DataLakeExportManager.java
b/streampipes-data-export/src/main/java/org/apache/streampipes/export/DataLakeExportManager.java
index 5078ab836e..1b64f9f4b9 100644
---
a/streampipes-data-export/src/main/java/org/apache/streampipes/export/DataLakeExportManager.java
+++
b/streampipes-data-export/src/main/java/org/apache/streampipes/export/DataLakeExportManager.java
@@ -17,6 +17,8 @@
*/
package org.apache.streampipes.export;
+import org.apache.streampipes.commons.environment.Environment;
+import org.apache.streampipes.commons.environment.Environments;
import org.apache.streampipes.dataexplorer.api.IDataExplorerQueryManagement;
import org.apache.streampipes.dataexplorer.api.IDataExplorerSchemaManagement;
import
org.apache.streampipes.dataexplorer.export.ObjectStorge.ExportProviderFactory;
@@ -45,6 +47,7 @@ import java.util.Map;
public class DataLakeExportManager {
private static final Logger LOG =
LoggerFactory.getLogger(DataLakeExportManager.class);
+ private static final Environment env = Environments.getEnvironment();
private final IDataExplorerSchemaManagement dataExplorerSchemaManagement =
new DataExplorerDispatcher()
.getDataExplorerManager()
@@ -58,7 +61,8 @@ public class DataLakeExportManager {
private void exportMeasurement(DataLakeMeasure dataLakeMeasure, Instant
now, long endDate) throws Exception {
- if (System.getenv("SP_RETENTION_LOCAL_DIR") == null ||
System.getenv("SP_RETENTION_LOCAL_DIR").isEmpty()) {
+ if (env.getRetentionLocalDir().getValueOrDefault() == null
+ || env.getRetentionLocalDir().getValueOrDefault().isEmpty()) {
LOG.error("For Local Retention Storage, please configure the
environment variable SP_RETENTION_LOCAL_DIR");
}
@@ -112,8 +116,6 @@ public class DataLakeExportManager {
ProviderType providerType = exportProviderSetting.getProviderType();
- LOG.info("Write to " + System.getenv("SP_RETENTION_LOCAL_DIR"));
-
try {
IObjectStorage exportProvider =
ExportProviderFactory.createExportProvider(
@@ -169,9 +171,6 @@ public class DataLakeExportManager {
private void deleteMeasurement(DataLakeMeasure dataLakeMeasure, Instant
now, long endDate) {
- LOG.info("Current time in millis: " + now.toEpochMilli());
- LOG.info("Current time in millis to delete: " + endDate);
-
this.dataExplorerQueryManagement.deleteData(dataLakeMeasure.getMeasureName(),
null, endDate);
}
@@ -199,7 +198,6 @@ public class DataLakeExportManager {
long endDate = (Long) result.get("endDate");
if
(dataLakeMeasure.getRetentionTime().getDataRetentionConfig().action() !=
RetentionAction.DELETE) {
- LOG.info("Start saving Measurement " +
dataLakeMeasure.getMeasureName());
try {
exportMeasurement(dataLakeMeasure, now, endDate);
} catch (Exception e) {
@@ -210,16 +208,13 @@ public class DataLakeExportManager {
LOG.info("Measurements " + dataLakeMeasure.getMeasureName() +
" successfully saved");
}
if
(dataLakeMeasure.getRetentionTime().getDataRetentionConfig().action() !=
RetentionAction.SAVE) {
- LOG.info("Start delete Measurement " +
dataLakeMeasure.getMeasureName());
deleteMeasurement(dataLakeMeasure, now, endDate);
LOG.info("Measurements " + dataLakeMeasure.getMeasureName() +
" successfully deleted");
}
success = true;
- updateLastSync(dataLakeMeasure, now, success, "-");
+ updateLastSync(dataLakeMeasure, now, success, "-");
}
-
-
}
diff --git a/ui/deployment/i18n/de.json b/ui/deployment/i18n/de.json
index ad37521bea..4a0a98f91d 100644
--- a/ui/deployment/i18n/de.json
+++ b/ui/deployment/i18n/de.json
@@ -259,16 +259,12 @@
"New Data Source": "Neue Datenquelle",
"Clone Data Source": "Datenquelle klonen",
"Delete Data Source": "Datenquelle löschen",
- "Data Source": "Datenquelle",
- "Expand Less": "Ausklappen",
- "Expand More": "Einklappen",
+ "Dataset": "Datensatz",
"No data available! Please connect an adapter or verify your pipeline is
running": "Keine Daten verfügbar! Bitte schließen Sie einen Adapter an oder
überprüfen Sie, ob Ihre Pipeline läuft",
"Connect Adapter": "Adapter anschließen",
- "Pipeline": "Pipeline",
- "Select this option if you want to use data from one of your pipelines.":
"Wählen Sie diese Option, wenn Sie Daten aus einer Ihrer Pipelines verwenden
möchten.",
- "Database Identifier": "Datenbankname",
- "Choose this option to work with individual measurements from a Data Lake.":
"Wählen Sie diese Option, um mit einzelnen Größen aus einem Data Lake zu
arbeiten.",
"Query": "Abfrage",
+ "Expand Less": "Ausklappen",
+ "Expand More": "Einklappen",
"Raw": "Rohdaten",
"Show raw data from your data source.": "Zeigen Sie Rohdaten aus Ihrer
Datenquelle an.",
"Limit": "Limit",
@@ -325,7 +321,6 @@
"Show time range selector": "Zeiteinstellungen anzeigen",
"Hide time range selector": "Zeiteinstellungen ausblenden",
"Delete dashboard": "Dashboard löschen",
- "Configure dashboard": "Dashboard konfigurieren",
"No charts found - create a new chart first to add it to this dashboard.":
"Keine Diagramme gefunden - erstellen Sie zuerst ein neues Diagramm, um es zu
diesem Dashboard hinzuzufügen.",
"Create chart": "Diagramm erstellen",
"New dashboard": "Neues Dashboard",
@@ -387,6 +382,7 @@
"This adapter is used by": "Dieser Adapter wird verwendet von",
"pipeline": "Pipeline",
"pipelines": "Pipelines",
+ "Pipeline": "Pipeline",
"will be automatically migrated": "wird automatisch migriert",
"will be stopped and needs manual review": "wird gestoppt und muss manuell
überprüft werden",
"Please check and possibly modify existing dashboards and data views
afterwards.": "Bitte überprüfen Sie die bestehenden Dashboards und
Datenansichten und ändern Sie diese gegebenenfalls.",
@@ -713,6 +709,28 @@
"Test": "Test",
"Test export provider configuration": "Konfiguration des Exportanbieters
testen",
"no stored export providers": "keine gespeicherten Exportanbieter",
+ "Select All": "Alle auswählen",
+ "Deselect All": "Alle abwählen",
+ "Update links": "Links aktualisieren",
+ "Create link": "Link erstellen",
+ "Update link": "Link aktualisieren",
+ "Asset Name": "Asset Name",
+ "New asset": "Neues Asset",
+ "Manage links": "Verwalten von Links",
+ "Add link": "Link hinzufügen",
+ "A short name of the asset": "Ein kurzer Name des Assets",
+ "A longer description of this asset": "Eine längere Beschreibung dieses
Assets",
+ "A unique id for this asset in one word": "Eine eindeutige Kennung für
dieses Asset in einem Wort",
+ "Asset Type": "Asset-Typ",
+ "The ISA95 type of this asset": "Der ISA95-Typ dieser Anlage",
+ "Assign additional labels to better discover your assets": "Weisen Sie
zusätzliche Labels zu, um Ihre Assets besser zu finden",
+ "Sites": "Standorte",
+ "Assign a location (site and area) to this asset": "Weisen Sie diesem Asset
einen Standort (Standort und Gebiet) zu",
+ "Manage Sites": "Standorte verwalten",
+ "Add exact location": "Genauen Standort hinzufügen",
+ "No labels available - Click 'Manage Labels'": "Keine Labels vorhanden -
Klicken Sie auf 'Labels verwalten'.",
+ "Click to add label": "Klicken Sie, um ein Label hinzuzufügen",
+ "Manage Labels": "Labels verwalten",
"success": "Erfolg",
"error": "Fehler",
"waiting": "Warten",
@@ -802,7 +820,6 @@
"Mail": "E-Mail",
"Messaging": "Messaging",
"Security": "Sicherheit",
- "Sites": "Standorte",
"Manage site": "Standorte verwalten",
"Location configuration updated": "Standortkonfiguration aktualisiert",
"Ok": "Ok",
@@ -822,6 +839,9 @@
"Unknown error": "Unbekannter Fehler",
"Upload file": "Datei hochladen",
"Do you really want to delete this file?": "Wollen Sie diese Datei wirklich
löschen?",
+ "This cannot be undone.": "Dies kann nicht rückgängig gemacht werden.",
+ "No": "Nein",
+ "Yes": "Ja",
"Service details": "Service-Details",
"Certificate details": "Zertifikat-Details",
"Installation": "Installation",
@@ -843,12 +863,22 @@
"Connection could not be established.": "Die Verbindung konnte nicht
hergestellt werden.",
"Truncating data...": "Daten leeren...",
"Deleting data...": "Daten löschen...",
+ "Sync was successful.": "Die Synchronisierung war erfolgreich.",
+ "Sync was not successful": "Synchronisierung war nicht erfolgreich",
+ "Export Data": "Daten exportieren",
"New Export Provider": "Neuer Exportanbieter",
"Truncate data": "Daten leeren",
"Delete data": "Daten löschen",
"Delete Export Provider": "Exportanbieter löschen",
"Test Export Provider Connection": "Test der Export-Provider-Verbindung",
"Set Data Retention": "Speicherrichtlinie bearbeiten",
+ "Create asset": "Asset erstellen",
+ "Are you sure you want to delete this asset?": "Möchten Sie dieses Asset
wirklich löschen?",
+ "Delete Asset": "Lösche Asset",
+ "Manage permissions for asset ": "Berechtigungen für Assets verwalten",
+ "Manage asset links": "Verwalten von Asset-Verknüpfungen",
+ "Create asset links": "Asset-Links erstellen",
+ "Update asset links": "Asset-Links aktualisieren",
"Owner": "Eigentümer",
"Public Element": "Öffentliches Element",
"visible to registered users": "sichtbar für registrierte Benutzer",
@@ -862,8 +892,9 @@
"URL": "URL",
"Only admins and owners can manage permissions for this resource.": "Nur
Administratoren und Eigentümer können die Berechtigungen für diese Ressource
verwalten.",
"Select Data": "Daten auswählen",
- "Previous": "Zurück",
+ "Export Format": "Format exportieren",
"Download": "Download",
+ "Previous": "Zurück",
"Select Format": "Format auswählen",
"Excel template": "Excel Vorlage",
"Use uploaded file template": "Hochgeladene Vorlage verwenden",
@@ -933,6 +964,11 @@
"List": "Liste",
"Nested": "Verschachtelt",
"Preview": "Vorschau",
+ "Items per page": "Artikel pro Seite",
+ "Next page": "Nächste Seite",
+ "Previous page": "Vorherige Seite",
+ " of ": " von ",
+ " items ": " Artikel",
"Error Details": "Fehler-Details",
"All {{allResourcesAlias}}": "Alle {{allResourcesAlias}}",
"{{ widgetTitle }} Clone": "{{ widgetTitle }} Kopie"
diff --git a/ui/deployment/i18n/en.json b/ui/deployment/i18n/en.json
index 1d8603c6da..a3214ca25e 100644
--- a/ui/deployment/i18n/en.json
+++ b/ui/deployment/i18n/en.json
@@ -259,16 +259,12 @@
"New Data Source": null,
"Clone Data Source": null,
"Delete Data Source": null,
- "Data Source": null,
- "Expand Less": null,
- "Expand More": null,
+ "Dataset": null,
"No data available! Please connect an adapter or verify your pipeline is
running": null,
"Connect Adapter": null,
- "Pipeline": null,
- "Select this option if you want to use data from one of your pipelines.":
null,
- "Database Identifier": null,
- "Choose this option to work with individual measurements from a Data Lake.":
null,
"Query": null,
+ "Expand Less": null,
+ "Expand More": null,
"Raw": null,
"Show raw data from your data source.": null,
"Limit": null,
@@ -325,7 +321,6 @@
"Show time range selector": null,
"Hide time range selector": null,
"Delete dashboard": null,
- "Configure dashboard": null,
"No charts found - create a new chart first to add it to this dashboard.":
null,
"Create chart": null,
"New dashboard": null,
@@ -387,6 +382,7 @@
"This adapter is used by": null,
"pipeline": null,
"pipelines": null,
+ "Pipeline": null,
"will be automatically migrated": null,
"will be stopped and needs manual review": null,
"Please check and possibly modify existing dashboards and data views
afterwards.": null,
@@ -713,6 +709,28 @@
"Test": null,
"Test export provider configuration": null,
"no stored export providers": null,
+ "Select All": null,
+ "Deselect All": null,
+ "Update links": null,
+ "Create link": null,
+ "Update link": null,
+ "Asset Name": null,
+ "New asset": null,
+ "Manage links": null,
+ "Add link": null,
+ "A short name of the asset": null,
+ "A longer description of this asset": null,
+ "A unique id for this asset in one word": null,
+ "Asset Type": null,
+ "The ISA95 type of this asset": null,
+ "Assign additional labels to better discover your assets": null,
+ "Sites": null,
+ "Assign a location (site and area) to this asset": null,
+ "Manage Sites": null,
+ "Add exact location": null,
+ "No labels available - Click 'Manage Labels'": null,
+ "Click to add label": null,
+ "Manage Labels": null,
"success": null,
"error": null,
"waiting": null,
@@ -802,7 +820,6 @@
"Mail": null,
"Messaging": null,
"Security": null,
- "Sites": null,
"Manage site": null,
"Location configuration updated": null,
"Ok": null,
@@ -822,6 +839,9 @@
"Unknown error": null,
"Upload file": null,
"Do you really want to delete this file?": null,
+ "This cannot be undone.": null,
+ "No": null,
+ "Yes": null,
"Service details": null,
"Certificate details": null,
"Installation": null,
@@ -852,6 +872,13 @@
"Delete Export Provider": null,
"Test Export Provider Connection": null,
"Set Data Retention": null,
+ "Create asset": null,
+ "Are you sure you want to delete this asset?": null,
+ "Delete Asset": null,
+ "Manage permissions for asset ": null,
+ "Manage asset links": null,
+ "Create asset links": null,
+ "Update asset links": null,
"Owner": null,
"Public Element": null,
"visible to registered users": null,
@@ -865,8 +892,9 @@
"URL": null,
"Only admins and owners can manage permissions for this resource.": null,
"Select Data": null,
- "Previous": null,
+ "Export Format": null,
"Download": null,
+ "Previous": null,
"Select Format": null,
"Excel template": null,
"Use uploaded file template": null,
@@ -936,6 +964,11 @@
"List": null,
"Nested": null,
"Preview": null,
+ "Items per page": null,
+ "Next page": null,
+ "Previous page": null,
+ " of ": null,
+ " items ": null,
"Error Details": null,
"All {{allResourcesAlias}}": "All {{allResourcesAlias}}",
"{{ widgetTitle }} Clone": "{{ widgetTitle }} Clone"
diff --git
a/ui/projects/streampipes/shared-ui/src/lib/components/sp-table/sp-paginator/sp-paginator.component.ts
b/ui/projects/streampipes/shared-ui/src/lib/components/sp-table/sp-paginator/sp-paginator.component.ts
new file mode 100644
index 0000000000..290372ff15
--- /dev/null
+++
b/ui/projects/streampipes/shared-ui/src/lib/components/sp-table/sp-paginator/sp-paginator.component.ts
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+import { Injectable } from '@angular/core';
+import { MatPaginatorIntl } from '@angular/material/paginator';
+import { TranslateService } from '@ngx-translate/core';
+
+@Injectable()
+export class PaginatorService extends MatPaginatorIntl {
+ constructor(private translateService: TranslateService) {
+ super();
+ this.itemsPerPageLabel =
+ this.translateService.instant('Items per page');
+ this.nextPageLabel = this.translateService.instant('Next page');
+ this.previousPageLabel = this.translateService.instant('Previous
page');
+ this.getRangeLabel = (
+ page: number,
+ pageSize: number,
+ length: number,
+ ) => {
+ const start = page * pageSize + 1;
+ const end = Math.min((page + 1) * pageSize, length);
+ const total = length;
+ const rangeLabel =
+ start +
+ ' - ' +
+ end +
+ this.translateService.instant(' of ') +
+ total +
+ this.translateService.instant(' items ');
+ return rangeLabel;
+ };
+ }
+}
diff --git
a/ui/projects/streampipes/shared-ui/src/lib/components/sp-table/sp-table.component.html
b/ui/projects/streampipes/shared-ui/src/lib/components/sp-table/sp-table.component.html
index fc63ce414b..c5e8faac7e 100644
---
a/ui/projects/streampipes/shared-ui/src/lib/components/sp-table/sp-table.component.html
+++
b/ui/projects/streampipes/shared-ui/src/lib/components/sp-table/sp-table.component.html
@@ -85,6 +85,7 @@
[pageSizeOptions]="[5, 10, 20, 50]"
[hidePageSize]="false"
[showFirstLastButtons]="true"
- ></mat-paginator>
+ >
+ </mat-paginator>
</div>
</div>
diff --git
a/ui/projects/streampipes/shared-ui/src/lib/dialog/data-download-dialog/data-download-dialog.component.html
b/ui/projects/streampipes/shared-ui/src/lib/dialog/data-download-dialog/data-download-dialog.component.html
index 7baf2666d3..4df551f6a9 100644
---
a/ui/projects/streampipes/shared-ui/src/lib/dialog/data-download-dialog/data-download-dialog.component.html
+++
b/ui/projects/streampipes/shared-ui/src/lib/dialog/data-download-dialog/data-download-dialog.component.html
@@ -37,10 +37,16 @@
<sp-select-format
[formatExportConfig]="exportConfig.formatExportConfig"
></sp-select-format>
+ <ng-template matStepLabel>{{
+ 'Export Format' | translate
+ }}</ng-template>
</mat-step>
<mat-step>
<sp-download></sp-download>
+ <ng-template matStepLabel>{{
+ 'Download' | translate
+ }}</ng-template>
</mat-step>
</mat-horizontal-stepper>
</div>
diff --git a/ui/projects/streampipes/shared-ui/src/lib/shared-ui.module.ts
b/ui/projects/streampipes/shared-ui/src/lib/shared-ui.module.ts
index 68b7463f2d..45e349411f 100644
--- a/ui/projects/streampipes/shared-ui/src/lib/shared-ui.module.ts
+++ b/ui/projects/streampipes/shared-ui/src/lib/shared-ui.module.ts
@@ -46,7 +46,11 @@ import { SplitSectionComponent } from
'./components/split-section/split-section.
import { SpLabelComponent } from './components/sp-label/sp-label.component';
import { SpTableComponent } from './components/sp-table/sp-table.component';
import { MatTableModule } from '@angular/material/table';
-import { MatPaginator } from '@angular/material/paginator';
+import {
+ MatPaginator,
+ MatPaginatorIntl,
+ MatPaginatorModule,
+} from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { SpExceptionDetailsComponent } from
'./components/sp-exception-message/exception-details/exception-details.component';
import { SpWarningBoxComponent } from
'./components/warning-box/warning-box.component';
@@ -105,6 +109,7 @@ import { ObjectPermissionDialogComponent } from
'./dialog/object-permission-dial
import { MatChipsModule } from '@angular/material/chips';
import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { CdkCopyToClipboard } from '@angular/cdk/clipboard';
+import { PaginatorService } from
'./components/sp-table/sp-paginator/sp-paginator.component';
@NgModule({
declarations: [
@@ -196,11 +201,16 @@ import { CdkCopyToClipboard } from
'@angular/cdk/clipboard';
ReactiveFormsModule,
MatAutocompleteModule,
CdkCopyToClipboard,
+ MatPaginatorModule,
],
providers: [
DefaultMatCalendarRangeStrategy,
MatRangeDateSelectionModel,
SortByRuntimeNamePipe,
+ {
+ provide: MatPaginatorIntl,
+ useClass: PaginatorService, // Use the custom paginator service
+ },
],
exports: [
AssetBrowserComponent,
diff --git
a/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-basics.component.html
b/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-basics.component.html
index 07f6574559..4d2c60d817 100644
---
a/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-basics.component.html
+++
b/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-basics.component.html
@@ -18,15 +18,15 @@
<div class="page-container-padding-inner">
<sp-basic-header-title-component
- title="{{ 'Basics: ' + asset.assetName }}"
+ [title]="('Basics' | translate) + ': ' + asset.assetName"
></sp-basic-header-title-component>
<div class="p-10">
<div fxLayout="column" fxFlex="100">
<sp-basic-field-description
fxFlex="100"
descriptionPanelWidth="30"
- label="Name"
- description="A short name of the asset"
+ [label]="'Name' | translate"
+ [description]="'A short name of the asset' | translate"
>
<mat-form-field
color="accent"
@@ -44,8 +44,8 @@
<sp-basic-field-description
fxFlex="100"
descriptionPanelWidth="30"
- label="Description"
- description="A longer description of this asset"
+ [label]="'Description' | translate"
+ [description]="'A longer description of this asset' |
translate"
>
<mat-form-field
color="accent"
@@ -63,7 +63,9 @@
fxFlex="100"
descriptionPanelWidth="30"
label="Asset ID"
- description="A unique id for this asset in one word"
+ [description]="
+ 'A unique id for this asset in one word' | translate
+ "
>
<mat-form-field
color="accent"
@@ -80,15 +82,15 @@
<sp-basic-field-description
fxFlex="100"
descriptionPanelWidth="30"
- label="Asset Type"
- description="The ISA95 type of this asset"
+ [label]="'Asset Type' | translate"
+ [description]="'The ISA95 type of this asset' | translate"
>
<mat-form-field class="w-100">
<mat-select
data-cy="asset-type-select"
[disabled]="!editMode"
[(ngModel)]="asset.assetType.isa95AssetType"
- aria-label="Asset Type"
+ [aria-label]="'Asset Type' | translate"
>
@for (isaType of isa95Types; track isaType) {
<mat-option
@@ -103,8 +105,11 @@
<sp-basic-field-description
fxFlex="100"
descriptionPanelWidth="30"
- label="Labels"
- description="Assign additional labels to better discover your
assets"
+ [label]="'Labels' | translate"
+ [description]="
+ 'Assign additional labels to better discover your assets'
+ | translate
+ "
>
<sp-asset-details-labels
[asset]="asset"
@@ -117,8 +122,11 @@
<sp-basic-field-description
fxFlex="100"
descriptionPanelWidth="30"
- label="Sites"
- description="Assign a location (site and area) to this
asset"
+ [label]="'Sites' | translate"
+ [description]="
+ 'Assign a location (site and area) to this asset'
+ | translate
+ "
>
<sp-asset-details-site
class="w-100"
diff --git
a/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-labels/asset-details-labels.component.html
b/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-labels/asset-details-labels.component.html
index 04953ed65b..952e0fd46d 100644
---
a/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-labels/asset-details-labels.component.html
+++
b/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-labels/asset-details-labels.component.html
@@ -53,8 +53,9 @@
<input
[placeholder]="
allLabels.length === 0
- ? 'No labels available - Click \'Manage
Labels\''
- : 'Click to add label'
+ ? ('No labels available - Click \'Manage
Labels\''
+ | translate)
+ : ('Click to add label' | translate)
"
data-cy="asset-label-input"
#labelInput
@@ -89,7 +90,7 @@
color="accent"
[routerLink]="['/configuration/labels']"
>
- Manage Labels
+ {{ 'Manage Labels' | translate }}
</button>
</div>
</div>
diff --git
a/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.html
b/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.html
index dfd9be0f39..cbc811a93f 100644
---
a/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.html
+++
b/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.html
@@ -47,7 +47,7 @@
color="accent"
[routerLink]="['/configuration/sites']"
>
- Manage Sites
+ {{ 'Manage Sites' | translate }}
</button>
</div>
</div>
diff --git
a/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.html
b/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.html
index 277a628790..58b4dc8435 100644
---
a/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.html
+++
b/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.html
@@ -22,7 +22,7 @@
[disabled]="!editMode"
[(ngModel)]="asset.assetSite.hasExactLocation"
>
- Add exact location
+ {{ 'Add exact location' | translate }}
</mat-checkbox>
@if (asset.assetSite.hasExactLocation) {
<div>
diff --git
a/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-links/asset-details-links.component.html
b/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-links/asset-details-links.component.html
index 2e531ca0dd..3e958e20e3 100644
---
a/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-links/asset-details-links.component.html
+++
b/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-links/asset-details-links.component.html
@@ -37,7 +37,7 @@
data-cy="assets-manage-links-button"
>
<i class="material-icons">add</i
- ><span> Manage links</span>
+ ><span> {{ 'Manage links' | translate }}</span>
</button>
}
@if (editMode) {
@@ -47,7 +47,8 @@
color="accent"
(click)="openCreateAssetLinkDialog()"
>
- <i class="material-icons">add</i><span> Add
link</span>
+ <i class="material-icons">add</i
+ ><span> {{ 'Add link' | translate }}</span>
</button>
}
</div>
diff --git
a/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-links/asset-details-links.component.ts
b/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-links/asset-details-links.component.ts
index 896a852cbd..4add1d72bd 100644
---
a/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-links/asset-details-links.component.ts
+++
b/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-links/asset-details-links.component.ts
@@ -27,6 +27,7 @@ import {
import { SpManageAssetLinksDialogComponent } from
'../../../../../dialog/manage-asset-links/manage-asset-links-dialog.component';
import { DialogService, PanelType } from '@streampipes/shared-ui';
import { EditAssetLinkDialogComponent } from
'../../../../../dialog/edit-asset-link/edit-asset-link-dialog.component';
+import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'sp-asset-details-links',
@@ -49,6 +50,7 @@ export class AssetDetailsLinksComponent implements OnInit {
constructor(
private genericStorageService: GenericStorageService,
private dialogService: DialogService,
+ private translateService: TranslateService,
) {}
ngOnInit(): void {
@@ -67,7 +69,7 @@ export class AssetDetailsLinksComponent implements OnInit {
SpManageAssetLinksDialogComponent,
{
panelType: PanelType.SLIDE_IN_PANEL,
- title: 'Manage asset links',
+ title: this.translateService.instant('Manage asset links'),
width: '50vw',
data: {
assetLinks: this.asset.assetLinks,
@@ -91,7 +93,9 @@ export class AssetDetailsLinksComponent implements OnInit {
EditAssetLinkDialogComponent,
{
panelType: PanelType.SLIDE_IN_PANEL,
- title: createMode ? 'Create ' : 'Update ' + 'asset model',
+ title: createMode
+ ? this.translateService.instant('Create asset links')
+ : this.translateService.instant('Update asset links'),
width: '50vw',
data: {
assetLink: assetLink,
diff --git
a/ui/src/app/assets/components/asset-details/edit-asset/asset-details.component.html
b/ui/src/app/assets/components/asset-details/edit-asset/asset-details.component.html
index b0eac60d26..31fd5f8a93 100644
---
a/ui/src/app/assets/components/asset-details/edit-asset/asset-details.component.html
+++
b/ui/src/app/assets/components/asset-details/edit-asset/asset-details.component.html
@@ -45,7 +45,7 @@
(click)="saveAsset()"
>
<i class="material-icons">save</i
- ><span> Save</span>
+ ><span> {{ 'Save' | translate }}</span>
</button>
</div>
<div
@@ -59,7 +59,7 @@
data-cy="basic-tab"
[active]="activeTab === 'basic'"
(click)="activeTab = 'basic'"
- >Basics</a
+ >{{ 'Basics' | translate }}</a
>
<a
mat-tab-link
diff --git
a/ui/src/app/assets/components/asset-overview/asset-overview.component.html
b/ui/src/app/assets/components/asset-overview/asset-overview.component.html
index e335f02302..3fd8bb3d83 100644
--- a/ui/src/app/assets/components/asset-overview/asset-overview.component.html
+++ b/ui/src/app/assets/components/asset-overview/asset-overview.component.html
@@ -31,7 +31,8 @@
data-cy="create-new-asset-button"
(click)="createNewAsset()"
>
- <i class="material-icons">add</i> New asset
+ <i class="material-icons">add</i>
+ {{ 'New asset' | translate }}
</button>
}
<div fxFlex fxLayout="row" fxLayoutAlign="end center">
@@ -62,7 +63,7 @@
(rowClicked)="goToDetailsView($event)"
matSort
>
- <ng-container matColumnDef="name">
+ <ng-container matColumnDef="assetName">
<th mat-header-cell mat-sort-header *matHeaderCellDef>
Asset
</th>
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 11d25d3543..5e2a538ec7 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, inject, OnInit } from '@angular/core';
+import { Component, inject, OnInit, ViewChild } from '@angular/core';
import { MatTableDataSource } from '@angular/material/table';
import {
AssetManagementService,
@@ -38,6 +38,8 @@ import { IdGeneratorService } from
'../../../core-services/id-generator/id-gener
import { UserPrivilege } from '../../../_enums/user-privilege.enum';
import { MatDialog } from '@angular/material/dialog';
import { Subscription } from 'rxjs';
+import { TranslateService } from '@ngx-translate/core';
+import { MatSort } from '@angular/material/sort';
@Component({
selector: 'sp-asset-overview',
@@ -49,7 +51,10 @@ export class SpAssetOverviewComponent implements OnInit {
existingAssets: SpAssetModel[] = [];
filteredAssets: SpAssetModel[] = [];
- displayedColumns: string[] = ['name', 'actions'];
+ displayedColumns: string[] = ['assetName', 'actions'];
+
+ @ViewChild(MatSort)
+ sort: MatSort;
dataSource: MatTableDataSource<SpAssetModel> =
new MatTableDataSource<SpAssetModel>();
@@ -70,6 +75,7 @@ export class SpAssetOverviewComponent implements OnInit {
private assetBrowserService: SpAssetBrowserService,
private currentUserService: CurrentUserService,
private dialog: MatDialog,
+ private translateService: TranslateService,
) {}
ngOnInit(): void {
@@ -101,12 +107,14 @@ export class SpAssetOverviewComponent implements OnInit {
this.applyAssetFilters(this.currentFilterIds);
});
+
this.loadAssets();
}
loadAssets(): void {
this.assetService.getAllAssets().subscribe(result => {
this.existingAssets = result as SpAssetModel[];
+ this.dataSource.sort = this.sort;
this.dataSource.data = this.existingAssets;
});
}
@@ -121,6 +129,7 @@ export class SpAssetOverviewComponent implements OnInit {
elementIds.has(a.elementId),
);
}
+ this.dataSource.sort = this.sort;
this.dataSource.data = this.filteredAssets;
}
@@ -144,7 +153,7 @@ export class SpAssetOverviewComponent implements OnInit {
SpCreateAssetDialogComponent,
{
panelType: PanelType.SLIDE_IN_PANEL,
- title: 'Create asset',
+ title: this.translateService.instant('Create asset'),
width: '50vw',
data: {
assetModel: assetModel,
@@ -168,10 +177,14 @@ export class SpAssetOverviewComponent implements OnInit {
const dialogRef = this.dialog.open(ConfirmDialogComponent, {
width: '500px',
data: {
- title: 'Are you sure you want to delete this asset?',
- subtitle: 'This action cannot be reversed!',
- cancelTitle: 'Cancel',
- okTitle: 'Delete Asset',
+ title: this.translateService.instant(
+ 'Are you sure you want to delete this asset?',
+ ),
+ subtitle: this.translateService.instant(
+ 'This action cannot be reversed!',
+ ),
+ cancelTitle: this.translateService.instant('Cancel'),
+ okTitle: this.translateService.instant('Delete Asset'),
confirmAndCancel: true,
},
});
@@ -190,12 +203,14 @@ export class SpAssetOverviewComponent implements OnInit {
ObjectPermissionDialogComponent,
{
panelType: PanelType.SLIDE_IN_PANEL,
- title: 'Manage permissions',
+ title: this.translateService.instant('Manage permissions'),
width: '70vw',
data: {
objectInstanceId: asset.elementId,
headerTitle:
- 'Manage permissions for asset ' + asset.assetName,
+ this.translateService.instant(
+ 'Manage permissions for asset ',
+ ) + asset.assetName,
},
},
);
diff --git
a/ui/src/app/assets/dialog/create-asset/create-asset-dialog.component.html
b/ui/src/app/assets/dialog/create-asset/create-asset-dialog.component.html
index eb59282107..4fcb4101c6 100644
--- a/ui/src/app/assets/dialog/create-asset/create-asset-dialog.component.html
+++ b/ui/src/app/assets/dialog/create-asset/create-asset-dialog.component.html
@@ -25,7 +25,7 @@
style="margin: 5px; width: 100%"
>
<mat-form-field class="full-width" color="accent">
- <mat-label>Asset Name</mat-label>
+ <mat-label>{{ 'Asset Name' | translate }}</mat-label>
<input
matInput
data-cy="asset-name"
@@ -33,31 +33,32 @@
/>
</mat-form-field>
<mat-form-field class="full-width" color="accent">
- <mat-label>Description</mat-label>
+ <mat-label>{{ 'Description' | translate }}</mat-label>
<input matInput [(ngModel)]="assetModel.assetDescription"
/>
</mat-form-field>
</div>
</div>
</div>
<mat-divider></mat-divider>
- <div class="sp-dialog-actions actions-align-right">
+ <div class="sp-dialog-actions actions-align-left">
<button
mat-button
mat-flat-button
- class="mat-basic mr-10"
- (click)="onCancel()"
- style="margin-right: 10px"
+ color="accent"
+ data-cy="create-asset-panel"
+ (click)="onSave()"
>
- Close
+ {{ 'Create' | translate }}
</button>
+
<button
mat-button
mat-flat-button
- color="accent"
- data-cy="create-asset-panel"
- (click)="onSave()"
+ class="mat-basic mr-10"
+ (click)="onCancel()"
+ style="margin-right: 10px"
>
- Create
+ {{ 'Close' | translate }}
</button>
</div>
</div>
diff --git
a/ui/src/app/assets/dialog/edit-asset-link/edit-asset-link-dialog.component.html
b/ui/src/app/assets/dialog/edit-asset-link/edit-asset-link-dialog.component.html
index 520090df3f..4ac80a0474 100644
---
a/ui/src/app/assets/dialog/edit-asset-link/edit-asset-link-dialog.component.html
+++
b/ui/src/app/assets/dialog/edit-asset-link/edit-asset-link-dialog.component.html
@@ -257,7 +257,7 @@
style="margin-right: 10px"
[disabled]="!clonedAssetLink.resourceId"
>
- {{ createMode ? 'Create ' : 'Update' }} link
+ {{ (createMode ? 'Create link' : 'Update link') | translate }}
</button>
<button
mat-button
@@ -266,7 +266,7 @@
(click)="cancel()"
style="margin-right: 10px"
>
- Cancel
+ {{ 'Cancel' | translate }}
</button>
</div>
</div>
diff --git
a/ui/src/app/assets/dialog/manage-asset-links/manage-asset-links-dialog.component.html
b/ui/src/app/assets/dialog/manage-asset-links/manage-asset-links-dialog.component.html
index b5730d1ebd..93fd905c43 100644
---
a/ui/src/app/assets/dialog/manage-asset-links/manage-asset-links-dialog.component.html
+++
b/ui/src/app/assets/dialog/manage-asset-links/manage-asset-links-dialog.component.html
@@ -48,7 +48,7 @@
"
style="margin-right: 5px; margin-left: 15px"
>
- <span>Select All</span>
+ <span>{{ 'Select All' | translate }}</span>
</button>
<button
mat-button
@@ -59,7 +59,7 @@
"
style="margin-right: 10px; margin-left: 5px"
>
- <span>Deselect All</span>
+ <span>{{ 'Deselect All' | translate }}</span>
</button>
</div>
</div>
@@ -112,7 +112,7 @@
"
style="margin-right: 5px; margin-left: 15px"
>
- <span>Select All</span>
+ <span>{{ 'Select All' | translate }}</span>
</button>
<button
mat-button
@@ -121,7 +121,7 @@
(click)="deselectAll(charts,
elementIdFunction)"
style="margin-right: 10px; margin-left: 5px"
>
- <span>Deselect All</span>
+ <span>{{ 'Deselect All' | translate }}</span>
</button>
</div>
</div>
@@ -172,7 +172,7 @@
"
style="margin-right: 5px; margin-left: 15px"
>
- <span>Select All</span>
+ <span>{{ 'Select All' | translate }}</span>
</button>
<button
mat-button
@@ -183,7 +183,7 @@
"
style="margin-right: 10px; margin-left: 5px"
>
- <span>Deselect All</span>
+ <span>{{ 'Deselect All' | translate }}</span>
</button>
</div>
</div>
@@ -233,7 +233,7 @@
"
style="margin-right: 5px; margin-left: 15px"
>
- <span>Select All</span>
+ <span>{{ 'Select All' | translate }}</span>
</button>
<button
mat-button
@@ -247,7 +247,7 @@
"
style="margin-right: 10px; margin-left: 5px"
>
- <span>Deselect All</span>
+ <span>{{ 'Deselect All' | translate }}</span>
</button>
</div>
</div>
@@ -297,7 +297,7 @@
"
style="margin-right: 5px; margin-left: 15px"
>
- <span>Select All</span>
+ <span>{{ 'Select All' | translate }}</span>
</button>
<button
mat-button
@@ -308,7 +308,7 @@
"
style="margin-right: 10px; margin-left: 5px"
>
- <span>Deselect All</span>
+ <span>{{ 'Deselect All' | translate }}</span>
</button>
</div>
</div>
@@ -361,7 +361,7 @@
"
style="margin-right: 5px; margin-left: 15px"
>
- <span>Select All</span>
+ <span>{{ 'Select All' | translate }}</span>
</button>
<button
mat-button
@@ -370,7 +370,7 @@
(click)="deselectAll(files, fileIdFunction)"
style="margin-right: 10px; margin-left: 5px"
>
- <span>Deselect All</span>
+ <span>{{ 'Deselect All' | translate }}</span>
</button>
</div>
</div>
@@ -420,7 +420,7 @@
"
style="margin-right: 5px; margin-left: 15px"
>
- <span>Select All</span>
+ <span>{{ 'Select All' | translate }}</span>
</button>
<button
mat-button
@@ -431,7 +431,7 @@
"
style="margin-right: 10px; margin-left: 5px"
>
- <span>Deselect All</span>
+ <span>{{ 'Deselect All' | translate }}</span>
</button>
</div>
</div>
@@ -466,7 +466,7 @@
(click)="store()"
style="margin-right: 10px"
>
- Update links
+ {{ 'Update links' | translate }}
</button>
<button
mat-button
@@ -475,7 +475,7 @@
(click)="cancel()"
style="margin-right: 10px"
>
- Cancel
+ {{ 'Cancel' | translate }}
</button>
</div>
</div>
diff --git
a/ui/src/app/configuration/files/file-overview/file-overview.component.ts
b/ui/src/app/configuration/files/file-overview/file-overview.component.ts
index 806053cee8..cc876ca831 100644
--- a/ui/src/app/configuration/files/file-overview/file-overview.component.ts
+++ b/ui/src/app/configuration/files/file-overview/file-overview.component.ts
@@ -62,9 +62,11 @@ export class FileOverviewComponent implements OnInit {
title: this.translateService.instant(
'Do you really want to delete this file?',
),
- subtitle: 'This cannot be undone.',
- cancelTitle: 'No',
- okTitle: 'Yes',
+ subtitle: this.translateService.instant(
+ 'This cannot be undone.',
+ ),
+ cancelTitle: this.translateService.instant('No'),
+ okTitle: this.translateService.instant('Yes'),
confirmAndCancel: true,
},
});
diff --git
a/ui/src/app/connect/components/existing-adapters/existing-adapters.component.html
b/ui/src/app/connect/components/existing-adapters/existing-adapters.component.html
index f6c271e782..e3e8f13933 100644
---
a/ui/src/app/connect/components/existing-adapters/existing-adapters.component.html
+++
b/ui/src/app/connect/components/existing-adapters/existing-adapters.component.html
@@ -200,7 +200,7 @@
</td>
</ng-container>
<ng-container matColumnDef="lastModified">
- <th mat-header-cell *matHeaderCellDef>
+ <th mat-header-cell mat-sort-header *matHeaderCellDef>
{{ 'Created' | translate }}
</th>
<td mat-cell *matCellDef="let adapter">
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 5720d7cd47..92a808e860 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
@@ -118,6 +118,14 @@ export class ExistingAdaptersComponent implements OnInit,
OnDestroy {
this.tutorialActive = tutorialActive;
},
);
+ this.dataSource.sortingDataAccessor = (adapter, column) => {
+ if (column === 'status') {
+ return adapter.running;
+ } else if (column === 'lastModified') {
+ return adapter.createdAt;
+ }
+ return adapter[column];
+ };
}
startAdapter(adapter: AdapterDescription) {
diff --git
a/ui/src/app/dashboard/components/overview/dashboard-overview-table/dashboard-overview-table.component.html
b/ui/src/app/dashboard/components/overview/dashboard-overview-table/dashboard-overview-table.component.html
index f7f114bf28..9cd8b83351 100644
---
a/ui/src/app/dashboard/components/overview/dashboard-overview-table/dashboard-overview-table.component.html
+++
b/ui/src/app/dashboard/components/overview/dashboard-overview-table/dashboard-overview-table.component.html
@@ -28,9 +28,10 @@
[rowsClickable]="true"
[dataSource]="dataSource"
(rowClicked)="onRowClicked($event)"
+ matSort
>
<ng-container matColumnDef="name">
- <th mat-header-cell *matHeaderCellDef>
+ <th mat-header-cell mat-sort-header *matHeaderCellDef>
{{ 'Dashboards' | translate }}
</th>
<td
@@ -48,7 +49,7 @@
</ng-container>
<ng-container matColumnDef="lastModified">
- <th mat-header-cell *matHeaderCellDef>
+ <th mat-header-cell mat-sort-header *matHeaderCellDef>
{{ 'Last modified' | translate }}
</th>
<td mat-cell *matCellDef="let element">
@@ -68,7 +69,7 @@
</ng-container>
<ng-container matColumnDef="createdAt">
- <th mat-header-cell *matHeaderCellDef>
+ <th mat-header-cell mat-sort-header *matHeaderCellDef>
{{ 'Created' | translate }}
</th>
<td mat-cell *matCellDef="let element">
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 0f230b5045..54b57ad944 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
@@ -16,7 +16,14 @@
*
*/
-import { Component, inject, Input, OnDestroy, OnInit } from '@angular/core';
+import {
+ Component,
+ inject,
+ Input,
+ OnDestroy,
+ OnInit,
+ ViewChild,
+} from '@angular/core';
import { MatTableDataSource } from '@angular/material/table';
import { Dashboard, DashboardService } from '@streampipes/platform-services';
import {
@@ -34,6 +41,7 @@ import { Router } from '@angular/router';
import { CloneDashboardDialogComponent } from
'../../../dialogs/clone-dashboard/clone-dashboard-dialog.component';
import { Subscription } from 'rxjs';
import { ChartRoutingService } from
'../../../../data-explorer-shared/services/chart-routing.service';
+import { MatSort } from '@angular/material/sort';
@Component({
selector: 'sp-dashboard-overview-table',
@@ -48,6 +56,10 @@ export class DashboardOverviewTableComponent implements
OnInit, OnDestroy {
hasDashboardWritePrivileges: boolean;
dataSource = new MatTableDataSource<Dashboard>();
+
+ @ViewChild(MatSort)
+ sort: MatSort;
+
displayedColumns: string[] = [
'name',
'lastModified',
@@ -78,6 +90,16 @@ export class DashboardOverviewTableComponent implements
OnInit, OnDestroy {
this.currentFilterIds = filter?.activeElementIds;
this.applyDashboardFilters(this.currentFilterIds);
});
+
+ this.dataSource.sortingDataAccessor = (dashboard, column) => {
+ if (column === 'lastModified') {
+ return dashboard.metadata.lastModifiedEpochMs;
+ } else if (column === 'createdAt') {
+ return dashboard.metadata.createdAtEpochMs;
+ }
+ return dashboard[column];
+ };
+
this.getDashboards();
}
@@ -164,6 +186,7 @@ export class DashboardOverviewTableComponent implements
OnInit, OnDestroy {
elementIds.has(a.elementId),
);
}
+ this.dataSource.sort = this.sort;
this.dataSource.data = this.filteredDashboards;
}
diff --git
a/ui/src/app/data-explorer/components/overview/data-explorer-overview-table/data-explorer-overview-table.component.html
b/ui/src/app/data-explorer/components/overview/data-explorer-overview-table/data-explorer-overview-table.component.html
index 8d4048be29..a4bc291d55 100644
---
a/ui/src/app/data-explorer/components/overview/data-explorer-overview-table/data-explorer-overview-table.component.html
+++
b/ui/src/app/data-explorer/components/overview/data-explorer-overview-table/data-explorer-overview-table.component.html
@@ -28,9 +28,10 @@
[showActionsMenu]="true"
[rowsClickable]="true"
(rowClicked)="openDataView($event, true)"
+ matSort
>
<ng-container matColumnDef="name">
- <th mat-header-cell *matHeaderCellDef>
+ <th mat-header-cell mat-sort-header *matHeaderCellDef>
{{ 'Chart' | translate }}
</th>
<td
@@ -43,7 +44,7 @@
</ng-container>
<ng-container matColumnDef="lastModified">
- <th mat-header-cell *matHeaderCellDef>
+ <th mat-header-cell mat-sort-header *matHeaderCellDef>
{{ 'Last modified' | translate }}
</th>
<td mat-cell *matCellDef="let element">
@@ -63,7 +64,7 @@
</ng-container>
<ng-container matColumnDef="createdAt">
- <th mat-header-cell *matHeaderCellDef>
+ <th mat-header-cell mat-sort-header *matHeaderCellDef>
{{ 'Created' | translate }}
</th>
<td mat-cell *matCellDef="let element">
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 4fc974a78c..9206b8919d 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
@@ -16,7 +16,7 @@
*
*/
-import { Component, inject, Input, OnInit } from '@angular/core';
+import { Component, inject, Input, OnInit, ViewChild } from '@angular/core';
import { MatTableDataSource } from '@angular/material/table';
import {
ChartService,
@@ -32,6 +32,7 @@ import { MatDialog } from '@angular/material/dialog';
import { TranslateService } from '@ngx-translate/core';
import { ChartRoutingService } from
'../../../../data-explorer-shared/services/chart-routing.service';
import { Subscription } from 'rxjs';
+import { MatSort } from '@angular/material/sort';
@Component({
selector: 'sp-data-explorer-overview-table',
@@ -43,6 +44,9 @@ export class SpDataExplorerDataViewOverviewComponent
implements OnInit {
@Input()
hasDataExplorerWritePrivileges: boolean;
+ @ViewChild(MatSort)
+ sort: MatSort;
+
dataSource = new MatTableDataSource<DataExplorerWidgetModel>();
displayedColumns: string[] = [
'name',
@@ -71,6 +75,17 @@ export class SpDataExplorerDataViewOverviewComponent
implements OnInit {
this.currentFilterIds = filter?.activeElementIds;
this.applyChartFilters(this.currentFilterIds);
});
+
+ this.dataSource.sortingDataAccessor = (chart, column) => {
+ if (column === 'name') {
+ return chart.baseAppearanceConfig.widgetTitle;
+ } else if (column === 'lastModified') {
+ return chart.metadata.lastModifiedEpochMs;
+ } else if (column === 'createdAt') {
+ return chart.metadata.createdAtEpochMs;
+ }
+ return chart[column];
+ };
this.getDataViews();
}
@@ -153,6 +168,7 @@ export class SpDataExplorerDataViewOverviewComponent
implements OnInit {
elementIds.has(a.elementId),
);
}
+ this.dataSource.sort = this.sort;
this.dataSource.data = this.filteredCharts;
}
diff --git
a/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.html
b/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.html
index 91d2fccbd6..3cf79dcd1d 100644
---
a/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.html
+++
b/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.html
@@ -28,7 +28,9 @@
data-cy="all-pipelines-table"
>
<ng-container matColumnDef="status">
- <th mat-header-cell *matHeaderCellDef>{{ 'Status' | translate }}</th>
+ <th mat-header-cell mat-sort-header *matHeaderCellDef>
+ {{ 'Status' | translate }}
+ </th>
<td mat-cell *matCellDef="let pipeline">
<div>
<div fxLayout="row" fxLayoutAlign="start center"
fxFlex="150px">
diff --git
a/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.ts
b/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.ts
index c1731c7e63..6bcb5ea8b2 100644
---
a/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.ts
+++
b/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.ts
@@ -109,6 +109,14 @@ export class PipelineOverviewComponent implements OnInit,
OnDestroy {
addPipelinesToTable() {
this.dataSource = new MatTableDataSource<Pipeline>(this._pipelines);
+ this.dataSource.sortingDataAccessor = (pipeline, column) => {
+ if (column === 'status') {
+ return pipeline.running;
+ } else if (column === 'lastModified') {
+ return pipeline.createdAt;
+ }
+ return pipeline[column];
+ };
setTimeout(() => {
this.dataSource.sort = this.sort;
});