Skip to content
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

Improved new provider button integration #165

Open
Gaetanbrl opened this issue Dec 24, 2024 · 1 comment
Open

Improved new provider button integration #165

Gaetanbrl opened this issue Dec 24, 2024 · 1 comment

Comments

@Gaetanbrl
Copy link

Context

Currently, georchestra gateway use limited icons to display one icon by provider (e.g google) :

https://github.com/georchestra/georchestra-gateway/tree/main/gateway/src/main/resources/static/login/img

These buttons have similar dimensions props (square) and needs to be PNG :

String providerPath = Paths.get("login/img/", k + ".png").toString();

Next, the default template will just integrate PNG icon without CSS or custom design :

<div class="bg-light border p-2 rounded" th:each="oauth2Client : ${oauth2LoginLinks}">
<a th:href="${oauth2Client.key}" th:title="${oauth2Client.value.left}">
<img th:src="${oauth2Client.value.right}" th:alt="${oauth2Client.value.left}" width="24" height="24">
</a>
</div>

Observation

The default template and code don't ease other icons provider integration.

For example, the ProConnect button is really ugly with this current system :

image

To be better, we needs to use the recommended CSS.

Possible solutions

Several ideas :

  • Use current name config as button title (enought for some people)

  • Use name provider prop inside button instead of default button icon

  • improve template with more CSS class (e.g create one class by provider key)

  • others options ?

@Gaetanbrl Gaetanbrl changed the title Improved provider button integration Improved new provider button integration Dec 24, 2024
@Gaetanbrl
Copy link
Author

Gaetanbrl commented Dec 24, 2024

improve template with more CSS class

This is a first possible option (tested #157 ).

Change template to :

  • use a img class from oauth2client.value.left
  • use a new btn-oauth2 class from parent <div>
    <div class="bg-light border p-2 rounded btn-oauth2" th:each="oauth2Client : ${oauth2LoginLinks}">
        <a th:href="${oauth2Client.key}" th:title="${oauth2Client.value.left}">
            <img th:src="${oauth2Client.value.right}" th:alt="${oauth2Client.value.left}" width="24" height="24" th:class="${oauth2Client.value.left}">
        </a>
    </div>

Use a CSS according to provider name :

.proconnect {
  width: 214px;
  height: 56px;
  border: none;
}

.btn-oauth2:has(.proconnect) {
  background-color: white !important;
}

Result :

image

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

No branches or pull requests

1 participant