Skip to content

Add Admin Site Settings Page with Logo and Favicon Customization - #3453

Merged
xuang7 merged 18 commits into
masterfrom
xuan-add-site-settings-page
Jun 17, 2025
Merged

xuang7 merged 18 commits into
masterfrom
xuan-add-site-settings-page

Conversation

@xuang7

@xuang7 xuang7 commented May 30, 2025 •

Copy link
Copy Markdown
Contributor

Purpose:

This PR introduces a General Settings page to the admin dashboard, providing a foundation for flexible, site-wide configuration and branding. It includes backend REST API, Angular frontend service/component, and a supporting SQL migration. The page currently supports global logo and favicon management and lays the groundwork for future features.

Note:

Please apply the SQL migration (core/scripts/sql/updates/08.sql) to create the site_settings table before using this feature.

Changes:

Backend (new):

  • AdminSettingsResource.scala: Implements REST endpoints for getting, updating, and deleting site settings.
  • core/scripts/sql/updates/08.sql: Creates a new site_settings table for storing key-value configuration.

Backend (updated):

  • TexeraWebApplication.scala: Registers the new AdminSettingsResource

Frontend (new):

  • admin-settings.service.ts: Service for interacting with backend site settings API.
  • admin-settings.component.ts/.html/.scss/.spec.ts: Angular component, template, and styling for the Admin Settings page, supporting logo upload, preview, and reset.

Frontend (updated):

  • dashboard.component.html: Adds link to the new Admin Settings page in the admin menu.
  • dashboard.component.ts/scss: Loads and applies the global logo
  • app.module.ts / app-routing.module.ts: Declares/imports the new service/component and routing.

Demonstration:

Accessible from the admin menu.
admin_page

Upload both logo and favicon:
logo+favicon

After saving, the site header shows the new logo and favicon:
new_main1
favicon
tab icon

Upload only one (logo or favicon) and leave the other unchanged
logo-only

After (The newly uploaded logo takes effect immediately; the favicon remains unchanged):
new_main2
favicon
tab icon

Changes take effect site-wide immediately after update or reset.
user_page

@xuang7 xuang7 self-assigned this May 30, 2025
@xuang7 xuang7 added the ddl-change Changes to the TexeraDB DDL label May 30, 2025
@xuang7 xuang7 added feature config Pull requests that update configuration labels May 30, 2025
@xuang7
xuang7 marked this pull request as ready for review May 30, 2025 22:51
@xuang7
xuang7 requested a review from aglinxinyuan May 30, 2025 22:51
@xuang7 xuang7 changed the title Add Admin Site Settings Page and Support Sidebar Logo Customization Add Site Settings Page for Admins May 30, 2025
@xuang7
xuang7 marked this pull request as draft May 31, 2025 00:05

@aglinxinyuan aglinxinyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had offline discussion regarding the design. We don't want to add an empty page without any functionality.

@xuang7
xuang7 marked this pull request as ready for review June 2, 2025 00:34
@xuang7
xuang7 requested a review from aglinxinyuan June 2, 2025 00:34

@aglinxinyuan aglinxinyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Design Feedback

  • There's no need to preview the current logo separately — it's already visible on every page.
  • A two-level page layout is unnecessary; you can display the upload page directly.
  • On the upload page, avoid showing the new logo preview twice — it's already displayed next to the Choose File button.
  • A third-level layout specifically for the mini logo is not needed. Instead, include two sets of Choose File and Submit buttons, each on its own line.
  • The label "mini logo" is incorrect. Please update it to "favicon" in the codebase. On the frontend, display it as:
    favicon (mini logo)

Comment thread core/scripts/sql/updates/08.sql Resolved
Comment thread core/scripts/sql/updates/08.sql Resolved
@xuang7
xuang7 requested a review from aglinxinyuan June 4, 2025 01:38

@aglinxinyuan aglinxinyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much better, left mirror comments.

@xuang7
xuang7 requested a review from aglinxinyuan June 6, 2025 18:21

@aglinxinyuan aglinxinyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left mirror comments.

@xuang7
xuang7 requested a review from aglinxinyuan June 9, 2025 20:11

@aglinxinyuan aglinxinyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@xuang7
xuang7 requested a review from aglinxinyuan June 16, 2025 02:37
@xuang7 xuang7 changed the title Add Site Settings Page for Admins Add Admin Site Settings Page with Logo and Favicon Customization Jun 17, 2025
@xuang7
xuang7 merged commit 5b36925 into master Jun 17, 2025
@xuang7
xuang7 deleted the xuan-add-site-settings-page branch June 17, 2025 02:04
@aglinxinyuan

Copy link
Copy Markdown
Contributor

Please also update texera_ddl.sql.

xuang7 added a commit that referenced this pull request Jul 4, 2025
### **Purpose:**
This PR migrates the configuration storage of UI elements, starting with
logos, from static files to the database while preserving the existing
logo‐customization feature. Future updates will extend this approach to
additional elements.

### **Design Proposal:**
Design #3528

**Related PRs:**
#3453 - Logos customization UI (default values were defined in separate
files and loaded directly; the database only stored updated logos)
#3480 - site_settings table schema
#3489 - Updated logos customization UI

### **Changes (updated):**
- gui/../admin/settings/admin-setting.component.ts/html/scss: add the
“Branding” card for logo upload/reset.
- gui/..component/dashboard.component.ts: integrate dynamic logo
rendering.
- gui/../service/admin/settings/admin-settings.service.ts:CRUD API for
settings
- config-service/../ConfigService.scala: database connection and
defaults preload on startup
- amber/../dashboard/admin/settings/AdminSettingsResource.scala: REST
endpoints for config CRUD

### **Changes (new)**
- config/../resource/default.conf: defined logo defaults (and
placeholders for future settings) and added config-service section with
**always-reset-configurations-to-default-values** = false flag to
control database reset behavior
- config/../scala/DefaultsConfig.scala: loads defaults from default.conf

### **Demonstration:**
The settings page retains its familiar upload interface, now organized
under a Branding card:
<img width="1555" alt="admin_setting"
src="https://github.com/user-attachments/assets/60264dab-356a-413f-8f05-9a2fd1c8c541"
/>

---------

Co-authored-by: Xinyuan Lin <[email protected]>
SarahAsad23 pushed a commit to madisonmlin/texera that referenced this pull request May 20, 2026
…che#3453)

### **Purpose:**
This PR introduces a General Settings page to the admin dashboard,
providing a foundation for flexible, site-wide configuration and
branding. It includes backend REST API, Angular frontend
service/component, and a supporting SQL migration. The page currently
supports global logo and favicon management and lays the groundwork for
future features.

### **Note:**
Please apply the SQL migration **(core/scripts/sql/updates/08.sql)** to
create the **site_settings** table before using this feature.

### **Changes:**
**Backend (new):**
- AdminSettingsResource.scala: Implements REST endpoints for getting,
updating, and deleting site settings.
- core/scripts/sql/updates/08.sql: Creates a new site_settings table for
storing key-value configuration.

**Backend (updated):** 
- TexeraWebApplication.scala: Registers the new AdminSettingsResource

**Frontend (new):**
- admin-settings.service.ts: Service for interacting with backend site
settings API.
- admin-settings.component.ts/.html/.scss/.spec.ts: Angular component,
template, and styling for the Admin Settings page, supporting logo
upload, preview, and reset.

**Frontend (updated):**
- dashboard.component.html: Adds link to the new Admin Settings page in
the admin menu.
- dashboard.component.ts/scss: Loads and applies the global logo
- app.module.ts / app-routing.module.ts: Declares/imports the new
service/component and routing.

### **Demonstration:**
Accessible from the admin menu.
<img width="1411" alt="admin_page"
src="https://github.com/user-attachments/assets/4b6fc8e9-858a-4ffe-b947-b096f2c87afa"
/>

Upload both logo and favicon:
<img width="1209" alt="logo+favicon"
src="https://github.com/user-attachments/assets/4815b46f-1b6b-4881-b595-9e9007cebb49"
/>

After saving, the site header shows the new logo and favicon:
<img width="1396" alt="new_main1"
src="https://github.com/user-attachments/assets/d69d8b80-9bc3-4216-88fc-68f58ce27063"
/>
<img width="41" alt="favicon"
src="https://github.com/user-attachments/assets/6069f613-6a24-4e6e-bab9-99bcc54efc07"
/>
<img width="241" alt="tab icon"
src="https://github.com/user-attachments/assets/92cea215-e69d-402e-95cf-89a11bc074d4"
/>


Upload only one (logo or favicon) and leave the other unchanged
<img width="1205" alt="logo-only"
src="https://github.com/user-attachments/assets/bc3a5552-0a10-4fe0-8523-e7c78c956001"
/>

After (The newly uploaded logo takes effect immediately; the favicon
remains unchanged):
<img width="1403" alt="new_main2"
src="https://github.com/user-attachments/assets/8c92ca5d-7ae7-4f63-9fa8-18596f5009d6"
/>
<img width="41" alt="favicon"
src="https://github.com/user-attachments/assets/922f3c82-c771-4bc4-bf46-a64c4cf82098"
/>
<img width="241" alt="tab icon"
src="https://github.com/user-attachments/assets/7f8c23be-d064-4001-bc76-fbc639e74f0a"
/>


Changes take effect site-wide immediately after update or reset.
<img width="1403" alt="user_page"
src="https://github.com/user-attachments/assets/ebcef905-c74e-423a-9dea-ffbcf4815941"
/>

---------

Co-authored-by: Xinyuan Lin <[email protected]>
SarahAsad23 pushed a commit to madisonmlin/texera that referenced this pull request May 20, 2026
### **Purpose:**
This PR migrates the configuration storage of UI elements, starting with
logos, from static files to the database while preserving the existing
logo‐customization feature. Future updates will extend this approach to
additional elements.

### **Design Proposal:**
Design apache#3528

**Related PRs:**
apache#3453 - Logos customization UI (default values were defined in separate
files and loaded directly; the database only stored updated logos)
apache#3480 - site_settings table schema
apache#3489 - Updated logos customization UI

### **Changes (updated):**
- gui/../admin/settings/admin-setting.component.ts/html/scss: add the
“Branding” card for logo upload/reset.
- gui/..component/dashboard.component.ts: integrate dynamic logo
rendering.
- gui/../service/admin/settings/admin-settings.service.ts:CRUD API for
settings
- config-service/../ConfigService.scala: database connection and
defaults preload on startup
- amber/../dashboard/admin/settings/AdminSettingsResource.scala: REST
endpoints for config CRUD

### **Changes (new)**
- config/../resource/default.conf: defined logo defaults (and
placeholders for future settings) and added config-service section with
**always-reset-configurations-to-default-values** = false flag to
control database reset behavior
- config/../scala/DefaultsConfig.scala: loads defaults from default.conf

### **Demonstration:**
The settings page retains its familiar upload interface, now organized
under a Branding card:
<img width="1555" alt="admin_setting"
src="https://github.com/user-attachments/assets/60264dab-356a-413f-8f05-9a2fd1c8c541"
/>

---------

Co-authored-by: Xinyuan Lin <[email protected]>
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
…che#3453)

### **Purpose:**
This PR introduces a General Settings page to the admin dashboard,
providing a foundation for flexible, site-wide configuration and
branding. It includes backend REST API, Angular frontend
service/component, and a supporting SQL migration. The page currently
supports global logo and favicon management and lays the groundwork for
future features.

### **Note:**
Please apply the SQL migration **(core/scripts/sql/updates/08.sql)** to
create the **site_settings** table before using this feature.

### **Changes:**
**Backend (new):**
- AdminSettingsResource.scala: Implements REST endpoints for getting,
updating, and deleting site settings.
- core/scripts/sql/updates/08.sql: Creates a new site_settings table for
storing key-value configuration.

**Backend (updated):** 
- TexeraWebApplication.scala: Registers the new AdminSettingsResource

**Frontend (new):**
- admin-settings.service.ts: Service for interacting with backend site
settings API.
- admin-settings.component.ts/.html/.scss/.spec.ts: Angular component,
template, and styling for the Admin Settings page, supporting logo
upload, preview, and reset.

**Frontend (updated):**
- dashboard.component.html: Adds link to the new Admin Settings page in
the admin menu.
- dashboard.component.ts/scss: Loads and applies the global logo
- app.module.ts / app-routing.module.ts: Declares/imports the new
service/component and routing.

### **Demonstration:**
Accessible from the admin menu.
<img width="1411" alt="admin_page"
src="https://github.com/user-attachments/assets/4b6fc8e9-858a-4ffe-b947-b096f2c87afa"
/>

Upload both logo and favicon:
<img width="1209" alt="logo+favicon"
src="https://github.com/user-attachments/assets/4815b46f-1b6b-4881-b595-9e9007cebb49"
/>

After saving, the site header shows the new logo and favicon:
<img width="1396" alt="new_main1"
src="https://github.com/user-attachments/assets/d69d8b80-9bc3-4216-88fc-68f58ce27063"
/>
<img width="41" alt="favicon"
src="https://github.com/user-attachments/assets/6069f613-6a24-4e6e-bab9-99bcc54efc07"
/>
<img width="241" alt="tab icon"
src="https://github.com/user-attachments/assets/92cea215-e69d-402e-95cf-89a11bc074d4"
/>


Upload only one (logo or favicon) and leave the other unchanged
<img width="1205" alt="logo-only"
src="https://github.com/user-attachments/assets/bc3a5552-0a10-4fe0-8523-e7c78c956001"
/>

After (The newly uploaded logo takes effect immediately; the favicon
remains unchanged):
<img width="1403" alt="new_main2"
src="https://github.com/user-attachments/assets/8c92ca5d-7ae7-4f63-9fa8-18596f5009d6"
/>
<img width="41" alt="favicon"
src="https://github.com/user-attachments/assets/922f3c82-c771-4bc4-bf46-a64c4cf82098"
/>
<img width="241" alt="tab icon"
src="https://github.com/user-attachments/assets/7f8c23be-d064-4001-bc76-fbc639e74f0a"
/>


Changes take effect site-wide immediately after update or reset.
<img width="1403" alt="user_page"
src="https://github.com/user-attachments/assets/ebcef905-c74e-423a-9dea-ffbcf4815941"
/>

---------

Co-authored-by: Xinyuan Lin <[email protected]>
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
### **Purpose:**
This PR migrates the configuration storage of UI elements, starting with
logos, from static files to the database while preserving the existing
logo‐customization feature. Future updates will extend this approach to
additional elements.

### **Design Proposal:**
Design apache#3528

**Related PRs:**
apache#3453 - Logos customization UI (default values were defined in separate
files and loaded directly; the database only stored updated logos)
apache#3480 - site_settings table schema
apache#3489 - Updated logos customization UI

### **Changes (updated):**
- gui/../admin/settings/admin-setting.component.ts/html/scss: add the
“Branding” card for logo upload/reset.
- gui/..component/dashboard.component.ts: integrate dynamic logo
rendering.
- gui/../service/admin/settings/admin-settings.service.ts:CRUD API for
settings
- config-service/../ConfigService.scala: database connection and
defaults preload on startup
- amber/../dashboard/admin/settings/AdminSettingsResource.scala: REST
endpoints for config CRUD

### **Changes (new)**
- config/../resource/default.conf: defined logo defaults (and
placeholders for future settings) and added config-service section with
**always-reset-configurations-to-default-values** = false flag to
control database reset behavior
- config/../scala/DefaultsConfig.scala: loads defaults from default.conf

### **Demonstration:**
The settings page retains its familiar upload interface, now organized
under a Branding card:
<img width="1555" alt="admin_setting"
src="https://github.com/user-attachments/assets/60264dab-356a-413f-8f05-9a2fd1c8c541"
/>

---------

Co-authored-by: Xinyuan Lin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Pull requests that update configuration ddl-change Changes to the TexeraDB DDL feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants