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

Custom BackOffice Icons - Improvements #7

Open
TRexStark opened this issue Oct 23, 2024 · 6 comments
Open

Custom BackOffice Icons - Improvements #7

TRexStark opened this issue Oct 23, 2024 · 6 comments
Assignees

Comments

@TRexStark
Copy link

Hi there

Is it possible to make some modifications to the Custom BackOffice Icons Package please?

I would've submitted a Pull Request but the Repo doesn't contain the code.

  1. Provide a way or update the icon of the action button itself, instead of a heart, maybe something more symbolic of an icon.
    A heart always reflects something like "Add to wishlist or to favourites" maybe "icon-glasses" or "icon-eye"?
  2. Is it possible to somehow provide an option to limit this to certain User Groups or Users ? In some cases this could be required to be changed only by Administrators and keep the BackOffice consistent across all other users.

Thank you.

@markadrake
Copy link
Contributor

Sorry I'm so late getting back to you @TRexStark.

Would configuration values in appsettings.json work? (or any other method you normally use to load environment variables)

I could easily see adding a configuration value to control the icon used.

As for the security settings, we could either try to add configuration to the user group or we can just identify the group aliases that should have permission. Thoughts?

@TRexStark
Copy link
Author

Hi @markadrake

Thanks for responding. I think setting those options in the appSettings.json would be most appropriate and easier to setup.

@markadrake
Copy link
Contributor

@TRexStark, I have a new version that I am uploading to Nuget right now.

https://www.nuget.org/packages/Humble.Umbraco.CustomBackofficeIcons/13.0.0.3

Here are the default values you can set/unset in AppSettings.json:

{
    "Humble": {
        "Umbraco": {
            "CustomBackofficeIcons": {
                "IconForSetAction": "favorite",
                "IconForUnsetAction": "wrong",
                "AllowedUserGroups": [
                    "admin"
                ]
            }
        }
    }
}

Please let me know when you can test the new version and if you have any other feedback on these icons or user group permissions!

@markadrake markadrake self-assigned this Nov 5, 2024
@TRexStark
Copy link
Author

Thanks @markadrake that's awesome. I will give it a test in the next few hours and will let you know.

@TRexStark
Copy link
Author

Hi @markadrake

Thank you again for making these improvements so promptly, very generous and humble ;) of you.

I just want to confirm that this works perfectly as intended.

  1. Custom icons render accordingly in both the context menu in actions menu successfully (even with custom icons if they are added to the backoffice properly)
  2. AllowedUserGroups tested with a single and multiple user groups and it works accordingly.

Just a couple of observations but they're probably minor and maybe could be done later when you have some spare time if you agree with my recommendations (most are more UX and UI).

  1. I'm not sure if it is possible to control the order as to where the "Set Icon" and "Unset Icon" are placed? It will be probably better to have them above the "Reload" button.
  2. If the above is possible, maybe you can add a separator between the "Set Icon" button and the "Reload" button? See how other action groups and how they have a border to separate them from other groups. The way this is set in Umbraco is by having a class of 'sep' in the 'li'. The 'sep' class will only need to be applied to the 'li' wrapping the 'Set Icon' button.
  3. If inserting the buttons above the 'Reload' button is not possible, then adding the 'sep' class may be enough.
  4. In my opinion, I think by default, the 'Unset Icon' should be hidden and when you set a custom icon, hide 'Set Icon' and show 'Unset Icon'.
  5. in the AppSettings, I don't think you need "Umbraco" as another level. Maybe you're just following your namespace? But other packages just add the settings under their main object. So instead of
    Humble:Umbraco:BackofficeIcons: ... you can just have Humble:CustomBackofficeIcons: ...

Again, these are maybe minor changes and are not interfering with what the package is supposed to do.

Thank you again.

@markadrake
Copy link
Contributor

Hey mate! Thanks so much for the kind words and coming here to contribute. Means a lot!

I will revisit your suggestions on Friday and try to offer some solutions. I may create these as additional issues / tickets.

Again, appreciate all the feedback you gave! I'm happy to hear from somebody who is using it :)

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

2 participants