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

Fixes #25618 - Use PF3-React Delete Confirmation Dialog #6301

Closed
wants to merge 1 commit into from
Closed

Fixes #25618 - Use PF3-React Delete Confirmation Dialog #6301

wants to merge 1 commit into from

Conversation

boaz0
Copy link
Member

@boaz0 boaz0 commented Dec 4, 2018

No description provided.

@theforeman-bot
Copy link
Member

Issues: #25618

Copy link
Member

@amirfefer amirfefer left a 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?

@boaz0
Copy link
Member Author

boaz0 commented Dec 5, 2018

Hi @amirfefer
Thanks for the review although this is still work in progress.
This will be used in the Hardware Models page replacing the old alert message when you delete a model.

@glekner
Copy link
Contributor

glekner commented Dec 6, 2018

I guess we started working on the same issue together :)

I'll leave it to you, here is my WIP if it can help

@boaz0 boaz0 changed the title [WIP] Fixes #25618 - Use PF3-React Delete Confirmation Dialog Fixes #25618 - Use PF3-React Delete Confirmation Dialog Dec 27, 2018
@ohadlevy
Copy link
Member

@glekner can you review please? thanks

Copy link
Contributor

@glekner glekner left a 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}`);
Copy link
Contributor

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?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 69.413% when pulling 1e46819 on boaz1337:fixes_25618 into 71ae1b6 on theforeman:develop.

@coveralls
Copy link

coveralls commented Jan 3, 2019

Coverage Status

Coverage decreased (-0.2%) to 69.401% when pulling 69ad1c8 on boaz1337:fixes_25618 into 71ae1b6 on theforeman:develop.

@ohadlevy
Copy link
Member

@glekner can you have another round of review? what would it take to implement it across all tables?

app/helpers/delete_message_dialog_helper.rb Outdated Show resolved Hide resolved
app/views/models/index.html.erb Outdated Show resolved Hide resolved
href={`/${controller}/${id}-${name}`}
data-method="delete"
>
<Spinner loading={processing} inline size="xs" />
Copy link
Member

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?

Copy link
Member Author

@boaz0 boaz0 Jan 27, 2019

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.

Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
Co-authored-by: Gilad Lekner <gilad215@gmail.com>
@ohadlevy
Copy link
Member

@boaz0 can you have a quick look on the test failures?

@ohadlevy
Copy link
Member

ohadlevy commented Apr 7, 2019

@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?

Copy link
Member

@Ron-Lavi Ron-Lavi left a 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>
Copy link
Member

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,
Copy link
Member

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use selectors ? :)

@xprazak2
Copy link
Contributor

xprazak2 commented Aug 2, 2019

@boaz0, could you rebase please?

@theforeman-bot
Copy link
Member

@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:

    $ git pull --rebase upstream develop

This message was auto-generated by Foreman's prprocessor

@tbrisker
Copy link
Member

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.

@tbrisker tbrisker closed this Aug 28, 2019
@boaz0
Copy link
Member Author

boaz0 commented Aug 28, 2019

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

@boaz0 boaz0 deleted the fixes_25618 branch August 28, 2019 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants