keycloak / keycloak

Open Source Identity and Access Management For Modern Applications and Services
https://www.keycloak.org
Apache License 2.0
22.69k stars 6.66k forks source link

Admin UI doesn't allow to un-select a theme in the realm #24119

Open ahus1 opened 11 months ago

ahus1 commented 11 months ago

Before reporting an issue

Area

admin/ui

Describe the bug

When I open the themes tab of a new realm, no themes are selected. I assume Keycloak then uses a default theme.

Once I've chosen a theme, I can't unselect it any more. I

Version

999-SNAPSHOT

Expected behavior

The open "Select..." or "Choose..." should be available even if I have previously selected a theme.

Actual behavior

The open "Select..:" or "Choose..." is not available after I've chosen a theme

How to Reproduce?

Anything else?

Allowing to select no theme allows users to always use the default theme. If they can't unselect a previously selected theme, there is no way for them to go back to the default.

osorionicolas commented 11 months ago

If I'm not wrong the "keycloak" theme is the default for login and email theme and the "keycloak.v2" is the default theme for account and admin ui theme. Maybe it would be better to preselect the default theme instead of leaving the "Select a theme" option. What do you think @jonkoops?

ssilvert commented 11 months ago

@osorionicolas is correct. Of course, you can select the default theme as it is always one of the choices in the dropdown.

I do see this as a minor usability issue as it is not clear which one is the default.

ahus1 commented 11 months ago

There is also a difference when I choose the login theme of a client: There I can always go back to "blank", there is always the "Choose..." option. Maybe the one who wants to pick up this issue this can serve as an example.

jonkoops commented 11 months ago

I think we should add a separate 'Default' option that clears the configured value of the theme.

ssilvert commented 11 months ago

There is also a difference when I choose the login theme of a client: There I can always go back to "blank", there is always the "Choose..." option. Maybe the one who wants to pick up this issue this can serve as an example.

If somebody wants to fix this, they should choose the simplest fix. Additionally, theme selection should be consistent between the Theme tab and what we see in the client section. So I favor this suggestion from @ahus1.

DiamondMyK commented 11 months ago

Hi, I'm new to open source and want to try to solve some simple problems. Can you assign this issue to me? I would appreciate it!

ahus1 commented 11 months ago

@DiamondMyK - done. Please drop a note in this issue once there is a PR, so that the people watching this issue know it has arrived. Looking forward to the pull request!

jonkoops commented 11 months ago

@DiamondMyK thanks for taking this on. If you are looking to get started with contributing to Keycloak, I would recommend to read our contribution guide, also the Administration Console documentation might be of interest for this particular issue.

If you require any assistance, let us know, and we will try to help you out. Good luck!

DiamondMyK commented 11 months ago

Thank you for your assignment, I will try my best to solve this issue!

sebhoss commented 1 month ago

Can we re-open this? If the default changed from keycloak.v2 to keycloak.v3 the old value still remains once selected and there is no way to de-select it to let keycloak pick the current default. This can be changed manually but that's highly annoying when you are maintaining multiple keycloak instances.

ahus1 commented 1 month ago

Re-opening it. We're still waiting for more up-votes from the community and/or someone to pick this up and create a PR.

keycloak-github-bot[bot] commented 1 month ago

Due to the amount of issues reported by the community we are not able to prioritise resolving this issue at the moment.

If you are affected by this issue, upvote it by adding a :thumbsup: to the description. We would also welcome a contribution to fix the issue.

vikasrajputin commented 1 month ago

Hello @ahus1 Can i pick this up?

ahus1 commented 1 month ago

@vikasrajputin - sure, please go ahead.

hookom commented 2 weeks ago

Though it does not address the issue of unsetting these themes from the UI, it is possible to unset them by passing empty string as the value for each to the API. For example, via the @keycloak/keycloak-admin-client npm package:

client.realms.update(
  {realm: 'master'},
  {
    loginTheme: '',
    accountTheme: '',
    adminTheme: '',
    emailTheme: '',
  }
})
jonkoops commented 2 weeks ago

@vikasrajputin are you still interested in landing this? If not let us know so we can assign it to someone else.

vikasrajputin commented 2 weeks ago

Yes, I'm almost done in 1-2 days will be raising the PR.

jonkoops commented 2 weeks ago

Sounds good, let me know if you need any help :+1:

vikasrajputin commented 2 weeks ago

Sure thanks @jonkoops !!

There's one issue I'm stuck with, is there any place where past issues are being discussed? Like any online forum or slack channel, where we can discuss any issues being faced by contributors?

Currently on executing: \mvnw clean install

Facing the below issue (on my Windows machine): [ERROR] Errors: [ERROR] TrustedHostClientRegistrationPolicyTest.testLocalhostDomain:67 » ClientRegistrationPolicy Host not trusted. [INFO] [ERROR] Tests run: 230, Failures: 0, Errors: 1, Skipped: 2

jonkoops commented 1 week ago

There's one issue I'm stuck with, is there any place where past issues are being discussed? Like any online forum or slack channel, where we can discuss any issues being faced by contributors?

Yes, we use GitHub Discussions as a forum, and there are various places where such discussions can be had. But for your convenience we can discuss this here as well.

Try skipping the tests by adding -DskipTests at the end of the command. Alternatively, you don't need to build the Keycloak server to work on the admin console. You can also run a nightly Keycloak server, and run it in dev mode against the admin console.

To run the development environment of the admin console install the latest version of Node.js, preferably using a package manager as outlined by the Node.js download page. Then make sure to enable Corepack by running:

corepack enable

Then, from the project root install the dependencies using PNPM by running:

pnpm install

You can then start a nightly version of the Keycloak server using our scripts:

pnpm --filter keycloak-server start --admin-dev

Keep this proccess running in the background and start the Vite development server for the admin console in a different terminal session by running:

pnpm --filter @keycloak/keycloak-admin-ui dev

Once this is running you can navigate to http://localhost:8080 and start making changes to the code.

vikasrajputin commented 1 week ago

Hello @jonkoops I'm ready with PR and looking forward to your feedback!

jonkoops commented 1 week ago

Currently a bit swamped, but I am sure that someone from @keycloak/ui could review this :)