Skip to content

Site Branding - Theme colors and logo config #486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 39 commits into
base: main
Choose a base branch
from

Conversation

milospp
Copy link
Contributor

@milospp milospp commented Jan 20, 2025

VIVO GitHub issue
Linked Vivo PR

What does this pull request do?

This pull request allows administrators to customize institutional branding by defining institutional colors and updating the key color scheme of the current theme.

What's new?

  1. Theme Color Customization
    Administrators can now change the following theme colors:
    • Primary Color
    • Secondary Color
    • Accent Color
  2. Advanced Color Options
    Additional options for detailed customization:
    • Primary Lighter Color
    • Primary Darker Color
    • Link Color
    • Text Color
  3. Logo Management
    • Option to upload a custom logo (max aspect ration 1:7).
    • Option to upload a smaller logo that is visible when screen is smaller (max aspect ration 1:3).

Additional Notes

This PR introduces ReferrerHelper.java
This util class easily retrieves the previous page from the request and uses it for the back button.
The traditional approach for handling the back button was to always navigate to the document.referrer or previously visited page. However, this strategy breaks when dealing with nested navigation flows.
Home -> Page 2 -> Page 3
when the user is on Page 3 and clicks the back button, they are correctly taken back to Page 2. But at that point, the referrer becomes Page 3 again. So if the user clicks back on Page 2, they are taken to Page 3—creating an infinite loop between Page 2 and Page 3.

Screenshoots

Regular Color Settings

image

Advanced Color Settings

image

Reset Color Option

image

How should this be tested?

General Testing

Ensure testing is conducted for every available theme.

Test 1: Theme Colors

  1. Select a theme
  2. Customize colors (Primary, Secondary, Accent)
  3. Verify that the updated colors are applied across the site

Test 2: Logo Upload

  1. Click Change LOGO
  2. Upload a logo image
  3. Crop and save the logo
    • Ensure cropping is restricted to a 1:1 or wider aspect ratio.
  4. Verify that the new logo is displayed correctly.

Test 3: Logo Small Upload

  1. Click Change Small LOGO
  2. Upload a logo image
  3. Crop and save the logo
    • Ensure cropping is restricted to a 1:1 or wider aspect ratio up to 1:3.
  4. Verify that the new logo is displayed correctly only when screen is smaller (unless Regular logo is not uplated).

Test 4: Only one logo uploaded

  1. If only a regular logo or only a smaller logo is uploaded, that logo will be applied to both wide and mobile views (test this by resizing the screen or zooming in).

Test 5: Logo Removal

  1. Click Change LOGO
  2. Click Remove Logo
  3. Confirm that the default logo reappears.

@milospp milospp changed the title Feature/site branding Site Branding - Theme colors and logo config Jan 23, 2025
@chenejac chenejac requested review from litvinovg and balmas January 28, 2025 10:54
Copy link

@balmas balmas left a comment

Choose a reason for hiding this comment

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

@chenejac chenejac linked an issue Feb 14, 2025 that may be closed by this pull request
@litvinovg
Copy link
Member

Why should the logo be cropped? Couldn't it just be uploaded as a file?



const defaultColorPalete = {
"themes/wilma/": {
Copy link
Member

Choose a reason for hiding this comment

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

Hardcoding theme names/paths is not an option. It will be broken once theme is renamed for customization.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This part is removed when the theme's default color pallete is moved inside the theme folder

@milospp milospp force-pushed the feature/site-branding branch from 117ef24 to acc9ea0 Compare May 2, 2025 21:52
@milospp milospp requested a review from balmas May 15, 2025 11:27
Copy link

@balmas balmas left a comment

Choose a reason for hiding this comment

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

Please conversation history in vivo-project/VIVO#4040 for the details of my testing and subsequent changes.

@milospp milospp force-pushed the feature/site-branding branch from ea22a1e to e3533cb Compare June 11, 2025 08:25
@milospp milospp requested a review from litvinovg June 18, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Branding VIVO via UI
3 participants