Skip to content

Conversation

@xuang7
Copy link
Contributor

@xuang7 xuang7 commented Jun 20, 2025

Purpose:

  • Introduce three independent site‐wide settings, logo, mini logo, and favicon, admin can customize the expanded sidebar logo, the collapsed sidebar icon, and the browser tab icon.
  • Provide a default fallback for each asset and support individual resets.
  • Eliminate the brief “flash” of default assets on page reload by applying both logo and mini logo before the main dashboard renders.

Changes

  • In admin-settings.service.ts: moved all logo-path and favicon-path retrieval into the service, with default fallbacks.
  • In admin-settings.component.ts/html: Split out three file inputs and previews for logo, mini logo, and favicon, update changes and reset methods.
  • In dashboard.component.ts/html: Simply subscribe to loadLogos()), ensuring the sidebar only displays once the final URLs are available.

Demonstration

Default logo, mini logo, and favicon.
logo1
mini1
favicon1

Admin update in Settings
change

Dashboard after Save
logo2
mini2
favicon2

Hard Refresh
https://github.com/user-attachments/assets/f0959dca-7ae9-4f7d-bd0a-12e09786a9ac

@xuang7 xuang7 added the fix label Jun 20, 2025
@xuang7 xuang7 requested a review from aglinxinyuan June 20, 2025 03:51
@xuang7 xuang7 self-assigned this Jun 20, 2025
@xuang7 xuang7 marked this pull request as ready for review June 20, 2025 04:24
@xuang7 xuang7 changed the title Enable Independent Configuration of Dashboard Logo, Collapsed Icon, and Favicon Enable Independent Configuration of Dashboard Logos and Fix Logo Loading Behavior Jun 20, 2025
Copy link
Contributor

@aglinxinyuan aglinxinyuan left a comment

Choose a reason for hiding this comment

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

LGTM!

@xuang7 xuang7 merged commit 6f4704a into master Jun 20, 2025
9 checks passed
@xuang7 xuang7 deleted the xuan-fix-logo-loading-behavior branch June 20, 2025 05:51
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 <xinyual3@uci.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants