-
Notifications
You must be signed in to change notification settings - Fork 991
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
Fixes #25618 - Use PF3-React Delete Confirmation Dialog #6301
Conversation
Issues: #25618 |
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.
Thanks @boaz1337 !
where do you think to use this component beside storybook?
webpack/assets/javascripts/react_app/components/DeleteMessageDialog/index.js
Outdated
Show resolved
Hide resolved
webpack/assets/javascripts/react_app/components/DeleteMessageDialog/index.js
Show resolved
Hide resolved
webpack/assets/javascripts/react_app/components/DeleteMessageDialog/index.js
Outdated
Show resolved
Hide resolved
Hi @amirfefer |
I guess we started working on the same issue together :) I'll leave it to you, here is my WIP if it can help |
...ck/assets/javascripts/react_app/components/DeleteMessageDialog/deleteConfirmationDialog.scss
Show resolved
Hide resolved
...ck/assets/javascripts/react_app/components/DeleteMessageDialog/deleteConfirmationDialog.scss
Show resolved
Hide resolved
@glekner can you review please? thanks |
webpack/assets/javascripts/react_app/components/DeleteMessageDialog/DeleteConfirmationDialog.js
Outdated
Show resolved
Hide resolved
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.
Thanks @boaz1337! Looks great
dispatch({ type: DELETE_MESSAGE_DIALOG_REQUEST }); | ||
API.delete(`/api/${controller}/${id}`) | ||
.then(resp => { | ||
window.Turbolinks.visit(`/${controller}`); |
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.
Can we use something like onDeleteSucceed, onDeleteError
as props for this action?
webpack/assets/javascripts/react_app/components/DeleteMessageDialog/DeleteConfirmationDialog.js
Show resolved
Hide resolved
@glekner can you have another round of review? what would it take to implement it across all tables? |
webpack/assets/javascripts/react_app/components/DeleteMessageDialog/DeleteConfirmationDialog.js
Outdated
Show resolved
Hide resolved
webpack/assets/javascripts/react_app/components/DeleteMessageDialog/DeleteConfirmationDialog.js
Show resolved
Hide resolved
href={`/${controller}/${id}-${name}`} | ||
data-method="delete" | ||
> | ||
<Spinner loading={processing} inline size="xs" /> |
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.
when would processing be set to true?
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.
from the moment clicking on the delete it is set to true and till the page is refreshed.
webpack/assets/javascripts/react_app/components/DeleteMessageDialog/DeleteConfirmationDialog.js
Outdated
Show resolved
Hide resolved
webpack/assets/javascripts/react_app/components/DeleteMessageDialog/DeleteConfirmationDialog.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com> Co-authored-by: Gilad Lekner <gilad215@gmail.com>
@boaz0 can you have a quick look on the test failures? |
@glekner any chance you can follow up this work? since the hw model page already is a table in react, perhaps we can start with a simple follow up to add that there, and then use the rails helpers etc in this PR to make it available to other pages too? |
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.
Thanks @boaz0 👍
Didn't test it yet but it looks good !
Left some inline comments :)
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
<%= will_paginate_with_info @models %> | ||
<div id="delete-modal"></div> |
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.
could you create the div in the helper instead?
for example:
container_class_name = "continaer-#{props[:id]}"
content_tag(:div, nil, :class => container_class_name) +
mount_react_component(
'ComponentWrapper',
".#{container_class_name}",
 {
 component: 'DeleteMessageDialog',
 componentProps: props
 }.to_json
 )
}); | ||
case DELETE_MESSAGE_DIALOG_OPEN: | ||
return state.merge({ | ||
...action.payload, |
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.
can you destruct it so we will see here what is inside the payload: name, url
import reducer from './DeleteMessageDialogReducer'; | ||
|
||
const mapStateToProps = state => ({ | ||
show: state.deleteDialog.show, |
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.
can you use selectors ? :)
@boaz0, could you rebase please? |
@boaz0, this pull request is currently not mergeable. Please rebase against the develop branch and push again. If you have a remote called 'upstream' that points to this repository, you can do this by running:
This message was auto-generated by Foreman's prprocessor |
Thanks @boaz0 ! This PR has been inactive for a very long time and is not currently mergeable. I'll go ahead and close it for now, feel free to reopen if you wish to get back to it. |
Yeah, I was trying to find a free time to work on it but I guess this is not going to happen soon. Anyone who wishes to take this is welcome. 😀 //cc @amirfefer @sharvit @theforeman/ui-ux Sorry |
No description provided.