-
Notifications
You must be signed in to change notification settings - Fork 356
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
Menu item adding through settings #5617
Conversation
72bcd55
to
b606834
Compare
ecba2b4
to
123ebb7
Compare
include Singleton | ||
|
||
def self.load | ||
instance.load_from_settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is effectively a cache, what happens when someone changes the settings? Are we expecting it to show the new menus or do we expect them to bounce the workers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's a cache and I planned to document that a worker restart is needed for this to take effect. Do you have a better idea? Do you think it is better to load the settings each time? Or is there some invalidation mechanism (on Settings.save) that I could utilize?
def load_from_settings | ||
begin | ||
settings = ::Settings.ui.custom_menu | ||
items = (settings || []).map { |i| create_custom_item(HashWithIndifferentAccess.new(i)) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if there is bad configuration? Will it blow up? I'm not sure what create_custom_menu_item does under the covers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is that if there's a bad configuration something would get logged and the settings will be ignored.
Do you see any problem with this approach?
If we decide to go forward with this, can you also create a PR to add an empty |
d2a5d7c
to
5738c6b
Compare
de675a0
to
e5b75bb
Compare
e5b75bb
to
2f2cb65
Compare
@Fryguy : I see no further comments from you in the last 18 days (since I addressed your previous feedback). I rebased now. Pinging @mzazrivec and @himdel to finish the review. Thx! |
Re failing tests... should the tree node be looking at |
https://github.com/ManageIQ/guides/blob/master/ui/menus.md says:
Honestly I do not remember details, but the Looking at the tests. |
Checked commits martinpovolny/manageiq-ui-classic@590486d~...99d5cb8 with ruby 2.3.3, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
https://bugzilla.redhat.com/show_bug.cgi?id=1678151
Requirements:
Example (under Server settings, Advanced settings):
list of supported icons:
based on the source of the icon the specification is either
fa fa-bug
(where fa-bug is the font awesome icon) ofpf pficon-help
(where pficon-help is the patternfly icon) orff fa-whatever
(where ff-whatever is the font fabulous icon).icons also can be seen in the font-picker when adding new custom buttons
rbac
is an existing RBAC feature indentifier that must exist in the product or be added via the extension mechanism added inManageIQ/manageiq#18806
Added menu item does not appear as the top-level item in the RBAC tree (under Settings --> Access controll --> Roles).