This is an automated email from the ASF dual-hosted git repository.
aicam pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/texera.git
The following commit(s) were added to refs/heads/main by this push:
new 70a594db41 feat(gui): add a toggle for Texera attribution (#5039)
70a594db41 is described below
commit 70a594db4179c24fda1afc37933b518367fc8f7c
Author: Xuan Gu <[email protected]>
AuthorDate: Sun May 17 18:11:08 2026 -0700
feat(gui): add a toggle for Texera attribution (#5039)
<!--
Thanks for sending a pull request (PR)! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
[Contributing to
Texera](https://github.com/apache/texera/blob/main/CONTRIBUTING.md)
2. Ensure you have added or run the appropriate tests for your PR
3. If the PR is work in progress, mark it a draft on GitHub.
4. Please write your PR title to summarize what this PR proposes, we
are following Conventional Commits style for PR titles as well.
5. Be sure to keep the PR description updated to reflect all changes.
-->
### What changes were proposed in this PR?
<!--
Please clarify what changes you are proposing. The purpose of this
section
is to outline the changes. Here are some tips for you:
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
3. If it is a refactoring, clarify what has been changed.
3. It would be helpful to include a before-and-after comparison using
screenshots or GIFs.
4. Please consider writing useful notes for better and faster reviews.
-->
This PR adds an attribution toggle for downstream projects to display a
"Powered by Texera" link in the sidebar.
Changes:
- Controlled by `gui.attribution-enabled` (env:
`GUI_ATTRIBUTION_ENABLED`), default `false`.
- Hidden automatically when the sidebar is collapsed.
- Links to https://texera.io.
Demo:
<img width="1807" height="868" alt="attribution"
src="https://github.com/user-attachments/assets/545dd69f-b2d1-4870-bbb2-fec3f93d233f"
/>
### Any related issues, documentation, discussions?
<!--
Please use this section to link other resources if not mentioned
already.
1. If this PR fixes an issue, please include `Fixes #1234`, `Resolves
#1234`
or `Closes #1234`. If it is only related, simply mention the issue
number.
2. If there is design documentation, please add the link.
3. If there is a discussion in the mailing list, please add the link.
-->
Closes #5038
### How was this PR tested?
<!--
If tests were added, say they were added here. Or simply mention that if
the PR
is tested with existing test cases. Make sure to include/update test
cases that
check the changes thoroughly including negative and positive cases if
possible.
If it was tested in a way different from regular unit tests, please
clarify how
you tested step by step, ideally copy and paste-able, so that other
reviewers can
test and check, and descendants can verify in the future. If tests were
not added,
please describe why they were not added and/or why it was difficult to
add.
-->
Existing automated tests pass and manually tested.
### Was this PR authored or co-authored using generative AI tooling?
<!--
If generative AI tooling has been used in the process of authoring this
PR,
please include the phrase: 'Generated-by: ' followed by the name of the
tool
and its version. If no, write 'No'.
Please refer to the [ASF Generative Tooling
Guidance](https://www.apache.org/legal/generative-tooling.html) for
details.
-->
Generated-by: Claude Opus 4.7
---
common/config/src/main/resources/gui.conf | 4 ++++
.../scala/org/apache/texera/config/GuiConfig.scala | 2 ++
.../texera/service/resource/ConfigResource.scala | 1 +
.../app/common/service/gui-config.service.mock.ts | 1 +
frontend/src/app/common/type/gui-config.ts | 1 +
.../dashboard/component/dashboard.component.html | 11 +++++++++++
.../dashboard/component/dashboard.component.scss | 21 +++++++++++++++++++++
.../dashboard/component/dashboard.component.spec.ts | 8 ++++++++
8 files changed, 49 insertions(+)
diff --git a/common/config/src/main/resources/gui.conf
b/common/config/src/main/resources/gui.conf
index d58d94ac7b..302c9f77c0 100644
--- a/common/config/src/main/resources/gui.conf
+++ b/common/config/src/main/resources/gui.conf
@@ -116,4 +116,8 @@ gui {
limit-columns = 15
limit-columns = ${?GUI_WORKFLOW_WORKSPACE_LIMIT_COLUMNS}
}
+
+ # whether to show the "Powered by Texera" attribution link in the sidebar
+ attribution-enabled = false
+ attribution-enabled = ${?GUI_ATTRIBUTION_ENABLED}
}
\ No newline at end of file
diff --git
a/common/config/src/main/scala/org/apache/texera/config/GuiConfig.scala
b/common/config/src/main/scala/org/apache/texera/config/GuiConfig.scala
index adc789c984..32ce7ea7af 100644
--- a/common/config/src/main/scala/org/apache/texera/config/GuiConfig.scala
+++ b/common/config/src/main/scala/org/apache/texera/config/GuiConfig.scala
@@ -73,4 +73,6 @@ object GuiConfig {
conf.getBoolean("gui.workflow-workspace.copilot-enabled")
val guiWorkflowWorkspaceLimitColumns: Int =
conf.getInt("gui.workflow-workspace.limit-columns")
+ val guiAttributionEnabled: Boolean =
+ conf.getBoolean("gui.attribution-enabled")
}
diff --git
a/config-service/src/main/scala/org/apache/texera/service/resource/ConfigResource.scala
b/config-service/src/main/scala/org/apache/texera/service/resource/ConfigResource.scala
index b7517d81eb..2614719040 100644
---
a/config-service/src/main/scala/org/apache/texera/service/resource/ConfigResource.scala
+++
b/config-service/src/main/scala/org/apache/texera/service/resource/ConfigResource.scala
@@ -58,6 +58,7 @@ class ConfigResource {
"activeTimeInMinutes" ->
GuiConfig.guiWorkflowWorkspaceActiveTimeInMinutes,
"copilotEnabled" -> GuiConfig.guiWorkflowWorkspaceCopilotEnabled,
"limitColumns" -> GuiConfig.guiWorkflowWorkspaceLimitColumns,
+ "attributionEnabled" -> GuiConfig.guiAttributionEnabled,
// flags from the auth.conf if needed
"expirationTimeInMinutes" -> AuthConfig.jwtExpirationMinutes
)
diff --git a/frontend/src/app/common/service/gui-config.service.mock.ts
b/frontend/src/app/common/service/gui-config.service.mock.ts
index 179259c5a9..0e20da8024 100644
--- a/frontend/src/app/common/service/gui-config.service.mock.ts
+++ b/frontend/src/app/common/service/gui-config.service.mock.ts
@@ -52,6 +52,7 @@ export class MockGuiConfigService {
activeTimeInMinutes: 15,
copilotEnabled: false,
limitColumns: 15,
+ attributionEnabled: false,
};
get env(): GuiConfig {
diff --git a/frontend/src/app/common/type/gui-config.ts
b/frontend/src/app/common/type/gui-config.ts
index 3b7554e8d4..63531ee91b 100644
--- a/frontend/src/app/common/type/gui-config.ts
+++ b/frontend/src/app/common/type/gui-config.ts
@@ -43,6 +43,7 @@ export interface GuiConfig {
activeTimeInMinutes: number;
copilotEnabled: boolean;
limitColumns: number;
+ attributionEnabled: boolean;
}
export interface SidebarTabs {
diff --git a/frontend/src/app/dashboard/component/dashboard.component.html
b/frontend/src/app/dashboard/component/dashboard.component.html
index b04eafb310..9edea62915 100644
--- a/frontend/src/app/dashboard/component/dashboard.component.html
+++ b/frontend/src/app/dashboard/component/dashboard.component.html
@@ -202,6 +202,17 @@
</li>
</ul>
<span id="git-commit-id">Git hash: {{ gitCommitHash }}</span>
+ <span
+ *ngIf="!isCollapsed && config.env.attributionEnabled"
+ id="powered-by">
+ Powered by
+ <a
+ href="https://texera.io"
+ target="_blank"
+ rel="noopener noreferrer"
+ >Texera</a
+ >
+ </span>
</nz-sider>
<div class="page-container">
diff --git a/frontend/src/app/dashboard/component/dashboard.component.scss
b/frontend/src/app/dashboard/component/dashboard.component.scss
index e327718ca1..edbe88658f 100644
--- a/frontend/src/app/dashboard/component/dashboard.component.scss
+++ b/frontend/src/app/dashboard/component/dashboard.component.scss
@@ -110,6 +110,27 @@ nz-content {
pointer-events: none;
}
+#powered-by {
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 56px;
+ text-align: center;
+ font-size: 11px;
+ color: gray;
+ z-index: 5;
+
+ a {
+ color: gray;
+ text-decoration: none;
+
+ &:hover {
+ color: #1890ff;
+ text-decoration: underline;
+ }
+ }
+}
+
.hidden {
display: none;
}
diff --git a/frontend/src/app/dashboard/component/dashboard.component.spec.ts
b/frontend/src/app/dashboard/component/dashboard.component.spec.ts
index ca6cf086b6..6f508ca136 100644
--- a/frontend/src/app/dashboard/component/dashboard.component.spec.ts
+++ b/frontend/src/app/dashboard/component/dashboard.component.spec.ts
@@ -40,6 +40,7 @@ import {
import type { Mock } from "vitest";
import { HttpClientTestingModule } from "@angular/common/http/testing";
import { commonTestProviders } from "../../common/testing/test-utils";
+import { GuiConfigService } from "../../common/service/gui-config.service";
describe("DashboardComponent", () => {
let component: DashboardComponent;
@@ -154,4 +155,11 @@ describe("DashboardComponent", () => {
const googleSignInBtn =
fixture.debugElement.query(By.css("asl-google-signin-button"));
expect(googleSignInBtn).toBeTruthy();
});
+
+ it("should render the powered-by attribution when attributionEnabled is
true", () => {
+ TestBed.inject(GuiConfigService).env.attributionEnabled = true;
+ fixture.detectChanges();
+
+ expect(fixture.debugElement.query(By.css("#powered-by"))).toBeTruthy();
+ });
});