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

Refactor flash message text for consistency across all actions (Add/Edit/Delete/Cancel) #2568

Merged

Conversation

GregP
Copy link
Contributor

@GregP GregP commented Oct 30, 2017

Refactor flash message ext construction to be consistent for all user actions. Previously code displayed Custom template name when adding or editing one and description when deleting. Code now calls same common to return consistent text, template description when available and name when description is not available.

https://bugzilla.redhat.com/show_bug.cgi?id=1486615

Screen shots prior to code fix, all showing hard coded template name:

custom template add flash msg prior to code fix

custom template edit flash msg prior to code fix

custom template cancel flash msg prior to code fix

Screen shots post code fix, showing common method returning template description for display:

custom template add flash msg post code fix

custom template edit flash msg post code fix

custom template cancel flash msg post code fix

custom template delete flash msg post code fix

@GregP GregP changed the title Fix flash message to display Record Name instead of Description for D… [WIP] Fix flash message to display Record Name instead of Description for D… Oct 30, 2017
@miq-bot miq-bot added the wip label Oct 30, 2017
@chessbyte chessbyte closed this Oct 31, 2017
@chessbyte chessbyte reopened this Oct 31, 2017
@h-kataria
Copy link
Contributor

@GregP this method is used to display name/description of selected record when performing certain tasks. Also this fix will defeat purpose of having following lines https://github.com/ManageIQ/manageiq-ui-classic/blob/master/app/controllers/application_controller.rb#L2257-L2259 because with your change it will always return name of record as name is usually a required field for most of CIs

@h-kataria
Copy link
Contributor

@GregP i think the correct fix here is to make sure that methods call https://github.com/ManageIQ/manageiq-ui-classic/blob/master/app/controllers/application_controller.rb#L2255 method while performing any tasks so flash messages are consistent when add/editing or deleting objects.

@GregP GregP force-pushed the confirm_delete_flash_msg_record_name branch from 9f62792 to e222770 Compare November 8, 2017 19:58
@miq-bot
Copy link
Member

miq-bot commented Nov 8, 2017

Checked commit GregP@e222770 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks fine. 🏆

@GregP GregP changed the title [WIP] Fix flash message to display Record Name instead of Description for D… Refactor flash message display for consistency when Adding/Editing/Deleting custom templates Nov 8, 2017
@GregP GregP changed the title Refactor flash message display for consistency when Adding/Editing/Deleting custom templates Refactor flash message text for consistency across all actions (Add/Edit/Delete/Cancel) Nov 8, 2017
@GregP
Copy link
Contributor Author

GregP commented Nov 8, 2017

@h-kataria Ready for review.

@h-kataria
Copy link
Contributor

looks good

@h-kataria h-kataria added this to the Sprint 74 Ending Nov 27, 2017 milestone Nov 14, 2017
@h-kataria h-kataria merged commit 5aee298 into ManageIQ:master Nov 14, 2017
simaishi pushed a commit that referenced this pull request Nov 15, 2017
Refactor flash message text for consistency across all actions (Add/Edit/Delete/Cancel)
(cherry picked from commit 5aee298)

https://bugzilla.redhat.com/show_bug.cgi?id=1513607
@simaishi
Copy link
Contributor

Gaprindashvili backport details:

$ git log -1
commit d483865dc4f6479ee6da3033f942d006b4cf1d75
Author: Harpreet Kataria <hkataria@redhat.com>
Date:   Tue Nov 14 17:42:00 2017 -0500

    Merge pull request #2568 from GregP/confirm_delete_flash_msg_record_name
    
    Refactor flash message text for consistency across all actions (Add/Edit/Delete/Cancel)
    (cherry picked from commit 5aee298e3231525627fa3a2f51db07f58a15d874)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1513607

simaishi pushed a commit that referenced this pull request Nov 20, 2017
Refactor flash message text for consistency across all actions (Add/Edit/Delete/Cancel)
(cherry picked from commit 5aee298)

https://bugzilla.redhat.com/show_bug.cgi?id=1515407
@simaishi
Copy link
Contributor

Fine backport details:

$ git log -1
commit a23542630852ce472f040a4046cb7d6905232287
Author: Harpreet Kataria <hkataria@redhat.com>
Date:   Tue Nov 14 17:42:00 2017 -0500

    Merge pull request #2568 from GregP/confirm_delete_flash_msg_record_name
    
    Refactor flash message text for consistency across all actions (Add/Edit/Delete/Cancel)
    (cherry picked from commit 5aee298e3231525627fa3a2f51db07f58a15d874)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1515407

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.

6 participants