-
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
[WIP] Redux controlled amazon dialog #4325
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
should be a 1:1 match to the existing miqButton component meant for new react form buttons
this is just a dumb presentation-only component it will be wrapped in another one that listens for messages from the form and updates it accordingly
reset form buttons to initial state ManageIQ.redux.store.dispatch({ type: 'FormButtons.init', payload: {} }) change the default Add/Save label ManageIQ.redux.store.dispatch({ type: 'FormButtons.customLabel', payload: __('Magic') }) set newRecord - if true, the Add button is shown (and addClicked called), else the Save and Reset buttons are shown (and saveClicked, resetClicked called) ManageIQ.redux.store.dispatch({ type: 'FormButtons.newRecord', payload: true }) set pristine - pristine form can't be reset (and shouldn't be saveable) ManageIQ.redux.store.dispatch({ type: 'FormButtons.pristine', payload: false }) set saveable - means no validation error, the submit button will be enabled based on this ManageIQ.redux.store.dispatch({ type: 'FormButtons.saveable', payload: false }) set callbacks - an object of functions - addClicked, saveClicked, resetClicked and cancelClicked are accepted ManageIQ.redux.store.dispatch({ type: 'FormButtons.callbacks', payload: { addClicked: () => console.log('add'), cancelClicked: () => console.log('cancel'), resetClicked: () => console.log('reset'), saveClicked: () => console.log('save'), }})
the idea here is, when using FormButtonRedux from a modal, you want to change the handlers to close the modal after so, you get to replace the handler, and get the original as an argument, to call from the replacement specifically in ProviderDialogs modal, we override save, add and cancel to close the window afterwards if the original handler returns a promise, closing will wait for that promise if the orignal handler returns anything else, closing is immediate
@miq-bot assign @martinpovolny |
Checked commits Hyperkid123/manageiq-ui-classic@a1fb3e4~...0923cb4 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a option to create amazon provider from modal.
Controls
In order to avoid any bugs in current version, component cannot be show from UI. You have to run a few commands from browser console.
Dependencies
This pr is dependent on #3509 and ManageIQ/react-ui-components#61. Also a new version of react-ui-components is required for this to work properly .
Some issues
Currently props cannot be passed to component inside modal. That can be fixed ni
modal.js
. @himdel knows about this. Therefore the providerId must be set in console first, before showing the modal.Also the API endpoint for creating is not available until ManageIQ/manageiq-providers-amazon#453 will be merged