-
Notifications
You must be signed in to change notification settings - Fork 357
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
Fix inconstancy of flash messages for Analysis Profiles and Schedules #3800
Fix inconstancy of flash messages for Analysis Profiles and Schedules #3800
Conversation
@miq-bot add_label bug, gaprindashvili/yes |
f4eb46f
to
c19be19
Compare
@miq-bot remove_label wip |
I think that the above behavior is pretty much intentional. Am I correct @dclarizio ? |
@mzazrivec @hstastna I'm gonna WIP this until I can discuss with @h-kataria as we've been working on getting these more consistent and I don't recall exactly what we decided on for strategy. |
@dclarizio @h-kataria Any update about this? Thank you! ❇️ |
@hstastna with the proposed change in this PR you are forcing code to use "Description" only when name is blank, we want to be consistent and use Description when record responds to description and has description populated regardless of whether name is present or not. |
Thank you, @h-kataria , for your update ❇️ I was following the BZ. Anyway, I can try this change you suggest. Will update this PR with the change. |
@h-kataria I cannot use the common method in add/edit method (in |
af26122
to
e4d0031
Compare
@hstastna can't you pass in |
@h-kataria yes, I can but I was worried about using |
e4d0031
to
fa323b9
Compare
@h-kataria now the fix should be ok :D |
@hstastna can you add a spec test to verify changes in the fix |
fa323b9
to
4b48b72
Compare
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1516895 Fix inconstancy of flash messages between addition vs. deletion of Analysis Profiles and Schedules, under Configuration -> Settings accordion.
4b48b72
to
a099473
Compare
@h-kataria @skateman I've added spec test for my change :) |
Checked commits hstastna/manageiq-ui-classic@a099473~...c23cc00 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Fixes BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1516895
Fix inconstancy of flash messages between addition vs. deletion of Analysis Profiles and Schedules, under Configuration -> Settings accordion.
Adding the profile named "Name1" with description "Desc1":
Before: (Name in the flash message):
After: " (Description in the flash message, the same as for deleting the profile):
Deleting the profile named "Name1" with description "Desc1" (we see Description in the flash message):
Details:
The problem with inconstancy is related to all of the records which have name AND also description. The inconstancy was caused in
get_record_display_name
method where description of the record is checked first (before name is checked) and returned, no chance to check also the name of the record. This happens when deleting the profile. When adding/editing the profile, there is a different way of adding flash message. We don't call any of the methods likeget_record_display_name
or so, we just simply add it and use the name, not description of profile. But I was told that we "use Description when record responds to description and has description populated regardless of whether name is present or not" so I made the change here (inap_edit
method), as I was suggested, to show description also when adding/editing the profile, not only when deleting it.