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

Conversation

theHacker
Copy link

Hey, thanks for your work 😄
Just stumbled over portainer/portainer#8452 (comment) and found your project. Tried it out, but I still found something BE-related. This PR should fix that.

Before:
image

After:
image

Have a look, I just tried the CSS rule live in the browser without building the whole Docker image.

@@ -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?

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