This is an automated email from the ASF dual-hosted git repository.
tenthe 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 e722854732 fix(#4614): restore dashboard public link option (#4615)
e722854732 is described below
commit e722854732a8dae125f278fec022a0033cb4aa79
Author: Philipp Zehnder <[email protected]>
AuthorDate: Tue Jun 23 14:57:02 2026 +0200
fix(#4614): restore dashboard public link option (#4615)
---
ui/cypress/support/utils/dashboard/Inspector.ts | 60 ++++++++++++++++++++++
ui/cypress/support/utils/user/PermissionUtils.ts | 19 +++++++
ui/cypress/tests/chart/publicDashboardLink.spec.ts | 49 ++++++++++++++++++
.../no-data/no-data-in-date-range.component.html | 1 +
.../dashboard-overview-table.component.ts | 4 ++
.../components/panel/dashboard-panel.component.ts | 6 +++
6 files changed, 139 insertions(+)
diff --git a/ui/cypress/support/utils/dashboard/Inspector.ts
b/ui/cypress/support/utils/dashboard/Inspector.ts
new file mode 100644
index 0000000000..8f862fb981
--- /dev/null
+++ b/ui/cypress/support/utils/dashboard/Inspector.ts
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ *
+ */
+
+export class Inspector {
+ public static getDashboardIdByName(name: string) {
+ return cy
+ .request({
+ method: 'GET',
+ url: '/streampipes-backend/api/v3/datalake/dashboard/summary',
+ auth: {
+ bearer: window.localStorage.getItem('auth-token'),
+ },
+ })
+ .then(response => {
+ const dashboard = response.body.resources.find(
+ resource => resource.name === name,
+ );
+
+ expect(dashboard, `dashboard ${name}`).to.not.equal(undefined);
+ return dashboard.elementId;
+ });
+ }
+
+ public static openDashboardKioskAsAnonymous(dashboardId: string) {
+ cy.clearLocalStorage();
+ cy.clearCookies();
+ cy.visit(`#/dashboard-kiosk/${dashboardId}`);
+ }
+
+ public static validateDashboardKioskWithTableChart(dashboardName: string) {
+ cy.contains('.dashboard-title', dashboardName, {
+ timeout: 10000,
+ }).should('be.visible');
+ cy.dataCy('login-button').should('not.exist');
+ cy.get('sp-data-explorer-table-widget', { timeout: 10000 }).should(
+ 'be.visible',
+ );
+ cy.get(
+ '[data-cy="data-explorer-table"],
[data-cy="data-explorer-no-data-in-date-range"]',
+ { timeout: 10000 },
+ )
+ .filter(':visible')
+ .should('have.length.at.least', 1);
+ }
+}
diff --git a/ui/cypress/support/utils/user/PermissionUtils.ts
b/ui/cypress/support/utils/user/PermissionUtils.ts
index 9af95f7877..23e7b6f685 100644
--- a/ui/cypress/support/utils/user/PermissionUtils.ts
+++ b/ui/cypress/support/utils/user/PermissionUtils.ts
@@ -58,6 +58,13 @@ export class PermissionUtils {
PermissionUtils.save();
}
+ public static markElementAsAnonymousPublic(resourceName: string) {
+ PermissionUtils.openManagePermissions(resourceName);
+ PermissionUtils.validateAnonymousPublicLinkOption();
+ StaticPropertyUtils.clickCheckbox('permission-anonymous-read');
+ PermissionUtils.save();
+ }
+
public static markElementAsPublicInManageDialog() {
StaticPropertyUtils.clickCheckbox('permission-public-element');
PermissionUtils.saveManageDialog();
@@ -158,6 +165,14 @@ export class PermissionUtils {
PermissionUtils.cancel();
}
+ public static validateAnonymousPublicLinkIsEnabled(resourceName: string) {
+ PermissionUtils.openManagePermissions(resourceName);
+ PermissionUtils.validateAnonymousPublicLinkOption()
+ .find('input[type="checkbox"]')
+ .should('be.checked');
+ PermissionUtils.cancel();
+ }
+
public static validateUserCanChangePermissionsInManageDialog() {
cy.dataCy('permission-public-element').should('exist');
PermissionUtils.cancelManageDialog();
@@ -167,4 +182,8 @@ export class PermissionUtils {
cy.dataCy('warning-permissions-managed-by-owner').should('exist');
PermissionUtils.cancelManageDialog();
}
+
+ private static validateAnonymousPublicLinkOption() {
+ return cy.dataCy('permission-anonymous-read').should('exist');
+ }
}
diff --git a/ui/cypress/tests/chart/publicDashboardLink.spec.ts
b/ui/cypress/tests/chart/publicDashboardLink.spec.ts
new file mode 100644
index 0000000000..e88dceaea9
--- /dev/null
+++ b/ui/cypress/tests/chart/publicDashboardLink.spec.ts
@@ -0,0 +1,49 @@
+/*
+ * 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 { ChartUtils } from '../../support/utils/chart/ChartUtils';
+import { Inspector } from '../../support/utils/dashboard/Inspector';
+import { PermissionUtils } from '../../support/utils/user/PermissionUtils';
+
+describe('Public dashboard links', () => {
+ const dashboardName = 'public-dashboard';
+ const chartName = 'public-dashboard-chart';
+
+ beforeEach('Setup Test', () => {
+ cy.initStreamPipesTest();
+ ChartUtils.loadDataIntoDataLake('datalake/sample.csv');
+ });
+
+ it('allows anonymous users to view a dashboard with a chart', () => {
+ ChartUtils.addDataViewAndTableWidget(ChartUtils.ADAPTER_NAME);
+ ChartUtils.saveDataViewConfiguration(false, false, chartName);
+
+ ChartUtils.goToDashboard();
+ ChartUtils.createAndEditDashboard(dashboardName);
+ ChartUtils.addDataViewToDashboard(chartName, true);
+ ChartUtils.saveDashboardConfiguration();
+
+ PermissionUtils.markElementAsAnonymousPublic(dashboardName);
+ PermissionUtils.validateAnonymousPublicLinkIsEnabled(dashboardName);
+
+ Inspector.getDashboardIdByName(dashboardName).then(dashboardId => {
+ Inspector.openDashboardKioskAsAnonymous(dashboardId);
+ Inspector.validateDashboardKioskWithTableChart(dashboardName);
+ });
+ });
+});
diff --git
a/ui/src/app/chart-shared/components/charts/base/no-data/no-data-in-date-range.component.html
b/ui/src/app/chart-shared/components/charts/base/no-data/no-data-in-date-range.component.html
index ca6ab876d6..f5aa441630 100644
---
a/ui/src/app/chart-shared/components/charts/base/no-data/no-data-in-date-range.component.html
+++
b/ui/src/app/chart-shared/components/charts/base/no-data/no-data-in-date-range.component.html
@@ -17,6 +17,7 @@
-->
<div
+ data-cy="data-explorer-no-data-in-date-range"
fxLayout="column"
fxLayoutAlign="center center"
fxFlex="100"
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 e1061d8447..fb39b48aed 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
@@ -176,6 +176,10 @@ export class DashboardOverviewTableComponent implements
OnInit, OnDestroy {
resource: { ...resource },
saveMode: 'immediate',
resourceConfig,
+ anonymousReadSupported: true,
+ publicLink: this.makeDashboardKioskUrl(
+ resource.elementId,
+ ),
headerTitle:
this.translateService.instant('Manage Dashboard ')
+
resource.name,
diff --git a/ui/src/app/dashboard/components/panel/dashboard-panel.component.ts
b/ui/src/app/dashboard/components/panel/dashboard-panel.component.ts
index 4f1ce4a9f9..81cf9629de 100644
--- a/ui/src/app/dashboard/components/panel/dashboard-panel.component.ts
+++ b/ui/src/app/dashboard/components/panel/dashboard-panel.component.ts
@@ -415,6 +415,8 @@ export class DashboardPanelComponent
resource,
saveMode: 'deferred',
resourceConfig,
+ anonymousReadSupported: true,
+ publicLink: this.makeDashboardKioskUrl(resource.elementId),
headerTitle:
this.translateService.instant('Manage Dashboard ') +
resource.name,
@@ -434,6 +436,10 @@ export class DashboardPanelComponent
});
}
+ private makeDashboardKioskUrl(dashboardId: string): string {
+ return
`${window.location.protocol}//${window.location.host}/#/dashboard-kiosk/${dashboardId}`;
+ }
+
startEditMode(widgetModel: DataExplorerWidgetModel) {
this.routingService.navigateToChart(true, widgetModel.elementId, true);
}