Skip to content

#426 gateway - Add UI customization part#468

Open
Gaetanbrl wants to merge 2 commits intogeorchestra:masterfrom
jdev-org:gateway-426
Open

#426 gateway - Add UI customization part#468
Gaetanbrl wants to merge 2 commits intogeorchestra:masterfrom
jdev-org:gateway-426

Conversation

@Gaetanbrl
Copy link
Contributor

@Gaetanbrl Gaetanbrl commented Nov 6, 2025

ref #426

This PR :

  • adds the Gateway UI customization resources and configuration.
  • change default .css to use georchestra's main color (# georchestraStylesheet=/public/stylesheet.css)

See the documentation for details:
https://docs.georchestra.org/gateway/en/latest/user_guide/ui_customization/?h=thy#main-principles

The files originate from:
https://github.com/georchestra/georchestra-gateway/tree/main/gateway/src/main/resources

Complete comment about static changes

use georchestra-primay css
Copy link
Contributor

@f-necas f-necas left a comment

Choose a reason for hiding this comment

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

I don't think we need to import /static/ from the upstream repo. We can let them inside and provide a good documentation of how to use spring.web.resources.static-locations.
We can point to upstream repo in order to show what's already in the classpath.

I may also rename html files in login.html.example to avoid confusion about where are files fetched.

# prefix: file:${georchestra.datadir}/gateway/templates/
# web:
# resources:
# static-locations: file:${georchestra.datadir}/gateway/templates/static/
Copy link
Contributor

Choose a reason for hiding this comment

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

As the comment I wrote in : georchestra/georchestra-gateway#235 (review)

You can set up static-locations: file:/etc/georchestra/gateway/static/, classpath:/static/. With this line, resources willl be fetched from datadir first and then fallback into classpath:/static/

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# static-locations: file:${georchestra.datadir}/gateway/templates/static/
# In order to import your resources, create a folder /etc/georchestra/gateway/static/ and put them inside. e.g. If you create /etc/georchestra/gateway/static/img/myimg.png, your resource will be available on <your domain>/img/myimg.png
# static-locations: file:/etc/georchestra/gateway/static/, classpath:/static/

# resources:
# static-locations: file:${georchestra.datadir}/gateway/templates/static/
# webflux:
# static-path-pattern: /static/**
Copy link
Contributor

Choose a reason for hiding this comment

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

Not mandatory by default it's /.

It just change the path in url with prefixing it, but folder hierarchy may resolve this. By now, resources are fetched only from classpath:/static/ and the folder hirearchy inside is everything under /login.

So by default, we can resolve static resources with the url /login/error.css or /login/img/default.png

If you set # static-path-pattern: /static/**, urls will be /static/login/error.css or /static/login/img/default.png.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# static-path-pattern: /static/**
# Change this line if you want to set a "base path" to your static resources
# static-path-pattern: /static/** # <- your resource will be available with a /static/ prefix

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.

2 participants