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

Hide Authentication method "Microsoft Active Directory" #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ const INJECTED_HTML = `
/* hide everything having the BE Feature banner */
.be-indicator-container, .limited-be {display: none !important;}

/* hide Authentication method "Microsoft Active Directory" */
.app-react-components-BoxSelector-BoxSelectorItem-module__business {display: none !important;}
Copy link
Owner

@ngxson ngxson May 10, 2024

Choose a reason for hiding this comment

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

Thanks for the contribution. However, I'm a bit doubt that this is an auto-generated class name, so I'm not sure if it will changed soon in one of the next versions.

I'm wondering if we can find a better selector here. Maybe based on nth-child, or ideally just a simple name like all other selectors?

Copy link
Author

Choose a reason for hiding this comment

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

I don't see a problem. But I must admit I do not know Portainer's HTML+CSS so well. I installed the software a couple of times and used it (before the whole BE stuff).
I would not recommend nth-child or something positional, because this can break easily. Also I noticed after creating the PR, that my rule not only eliminates the one box I show in the screenshot, but also a couple more further at the bottom, depending what authentication method you select.

Do you think the BoxSelector-BoxSelectorItem is auto-generated because of uppercase letters? Does look like a legitimate name (ok a stupid name because of mixing snake and camel cases 🙈 ), but not special/auto-generated/about to change soon.

Copy link
Owner

Choose a reason for hiding this comment

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

Since portainer is open source, you can have a look at the source code to see where the class name comes from:

https://github.com/portainer/portainer/blob/6a51b6b41e9ecd79293a5ed8553f54d2c2286058/app/react/components/BoxSelector/BoxSelectorItem.module.css#L42-L49

https://github.com/portainer/portainer/blob/6a51b6b41e9ecd79293a5ed8553f54d2c2286058/app/react/components/BoxSelector/BoxSelectorItem.tsx#L46-L50

The class name is indeed transformed (rather than generated), so I assume that it won't change in near future.

If we want a bit more future-proof, I'd suggest matching all classes [class*="BoxSelectorItem-module__business"], what do you think?


/* FIXME: hot fix to show OAuth save button #10 */
.oauth-save-settings-button {display: inline-block !important;}

Expand Down