-
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
Replace angular-based fonticon picker with a react component #6985
Conversation
As #6910 has too many unresolved dependencies, I'm marking this as ready, so we can at least get rid of one dependency from react-ui-components. |
onClick={onModalApply} | ||
disabled={selectedIcon === activeIcon || activeIcon === undefined} | ||
> | ||
Apply |
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.
__('Apply')
Apply | ||
</Button> | ||
<Button id="cancel-icon-picker-modal" bsStyle="default" className="btn-cancel" onClick={hideModal}> | ||
Cancel |
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.
__('Cancel')
599807f
to
fea914e
Compare
89a5ac1
to
98b3b38
Compare
Ah, one more thing..
those are no longer needed. EDIT: Oh, and both also have an onchange handler on the same element.. quite obsolete too .. except it suggest we may want to use |
@himdel I'm worried that we don't use this EDIT: there's nothing relevant, at least in JSX files |
98b3b38
to
b43c312
Compare
I'm fine with either, this can only really affect automated testing or poor network condition (submit may not wait for the onchange event, to be processed). |
Checked commits skateman/manageiq-ui-classic@9b329b3~...b43c312 with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.28.0, and yamllint app/views/shared/buttons/_ab_options_form.html.haml
app/views/shared/buttons/_group_form.html.haml |
2 bugs: Clicking the select doesn't do anything, only the chevron expands the dialog now. The first 4 Font Awesome icons are:
I'd say a parser bug, but |
I probably don't understand what you are describing here, because for me everything works.
It was a parser bug, fixing it. |
There were some wrongly implemented stuff in the original component: * no way to preselect an icon * icons rendered as component -> ff doesn't support that * icons organized in a table * no scrollbar when too many icons * modal was too narrow * icon fetch from CSS was building a table * kinda complicated iconTypes specification schema All these have been fixed in this single commit, most of the changes have been inspired by the original angular component.
b43c312
to
e37e69c
Compare
EDIT: fixing in #7001 |
Oh, this is standard behavior, same happens on upstream. |
OK, sounds like this works :). It does not replace the angular icon picker yet ( |
My original plan was to just copy-paste the component from react-ui-components to be compliant with #6716, but there were some missing and broken parts:
So I addressed these problems, mostly by just moving some stuff from my original angular component.
The custom buttons that require this component are being used in Automate Customization and also in Generic Objects/Catalogs. The solution for the first one was trivial, but the latter is fully implemented in angular 🦛 and it either has to be converted to react or some kind of hack is necessary to get rid of the angular-based fonticon picker. Anyway, the first part is totally ready for review 😉
Resolves #5758
@miq-bot add_reviewer @ZitaNemeckova
@miq-bot assign @himdel