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

Fix Reset button for tag page in Services #2680

Merged
merged 3 commits into from
Jan 8, 2018

Conversation

hstastna
Copy link

@hstastna hstastna commented Nov 9, 2017

fixing:
(1) https://bugzilla.redhat.com/show_bug.cgi?id=1445313
(2) https://bugzilla.redhat.com/show_bug.cgi?id=1445303

Fix Reset button for tag page opened from Service item detail page in Services -> My Services.

The problem was that Reset button did nothing but produced an error after choosing Edit Tags under Policy , making a change and resetting the change, in Service item detail page in Services -> My Services. The action was not set properly for Services which lead to unwanted behavior.

Before: (1)
r1
r3

After: (1)
r2

Before: (2)
rr1

After: (2)
rr2

@hstastna
Copy link
Author

hstastna commented Nov 9, 2017

@miq-bot add_label bug

@hstastna
Copy link
Author

@miq-bot add_label gaprindashvili/yes

@@ -111,7 +111,8 @@ def tagging_edit_tags_reset
@title = _('Tag Assignment')
if tagging_explorer_controller?
@refresh_partial = "layouts/tagging"
replace_right_cell(:action => @sb[:action]) if params[:button]
action = x_active_tree == :svcs_tree && params[:button] == "reset" ? "tag" : @sb[:action]
Copy link
Contributor

Choose a reason for hiding this comment

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

So the problem here was that @sb[:action] in this particular case was not set properly? Or was not set at all? Do I understand the problem correctly?

If so, shouldn't we rather fix @sb[:action] so that it's set correctly? The above fix would just introduce special behavior for one specific tree into a code, which otherwise is written in a generic fashion (more or less).

Copy link
Author

@hstastna hstastna Dec 18, 2017

Choose a reason for hiding this comment

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

@sb[:action] was not set at all here. But maybe since I opened this PR, "things" may have changed. I will check it now again and will update this PR. Thank you for good questions! :)

Just for explanation, as I remember, fixing @sb[:action] was ...hell for me. And it looks like you understand it much more than I. So another hints/ideas, how to fix the bug in a better way, are appreciated 👼

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not saying I necessarily have better understanding of the code. I'd just like to avoid creating special if (or condition if you will) for one specific invocation of the tagging code.

What I'd do is look at tagging of different type of objects, where the reset works correctly and see what's different and where the @sb[:action] is being set in there.

@hstastna hstastna changed the title Fix Reset button for tag page in Services [WIP] Fix Reset button for tag page in Services Dec 20, 2017
@miq-bot miq-bot added the wip label Dec 20, 2017
@hstastna hstastna force-pushed the Tag_reset_button_Service_item branch from b7e198d to 1457687 Compare December 20, 2017 13:32
@hstastna
Copy link
Author

hstastna commented Dec 20, 2017

The PR changes code in services controller to use common x_button method in explorer so @sb[:action] is now set properly and it looks like this change does not affect other functionality in My Services page

@hstastna hstastna force-pushed the Tag_reset_button_Service_item branch from 1457687 to ee91ba7 Compare December 21, 2017 10:28
@hstastna hstastna force-pushed the Tag_reset_button_Service_item branch 2 times, most recently from b10e10d to a680c9c Compare January 2, 2018 14:48
Hilda Stastna added 2 commits January 3, 2018 11:14
fixing https://bugzilla.redhat.com/show_bug.cgi?id=1445313

Fix Reset button for tag page opened from Service item detail page
in Services -> My Services.
@hstastna hstastna force-pushed the Tag_reset_button_Service_item branch from a680c9c to e7eef4d Compare January 3, 2018 10:29
@hstastna hstastna changed the title [WIP] Fix Reset button for tag page in Services Fix Reset button for tag page in Services Jan 3, 2018
@miq-bot
Copy link
Member

miq-bot commented Jan 3, 2018

Checked commits hstastna/manageiq-ui-classic@63f214f~...cee2b70 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0
4 files checked, 0 offenses detected
Everything looks fine. 🍪

@miq-bot miq-bot removed the wip label Jan 3, 2018
@mzazrivec mzazrivec self-assigned this Jan 8, 2018
@mzazrivec mzazrivec added this to the Sprint 77 Ending Jan 15, 2018 milestone Jan 8, 2018
@mzazrivec mzazrivec merged commit 1ad41f8 into ManageIQ:master Jan 8, 2018
simaishi pushed a commit that referenced this pull request Jan 8, 2018
@simaishi
Copy link
Contributor

simaishi commented Jan 8, 2018

Gaprindashvili backport details:

$ git log -1
commit e005f49367e85a4709fd00776191745fb43639bc
Author: Milan Zázrivec <mzazrivec@redhat.com>
Date:   Mon Jan 8 12:02:42 2018 +0100

    Merge pull request #2680 from hstastna/Tag_reset_button_Service_item
    
    Fix Reset button for tag page in Services
    (cherry picked from commit 1ad41f881043e257fee339a2a7046f6ac12c8242)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1532354
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1532355

@martinpovolny
Copy link
Member

I am going to revert this most likely.

It breaks stuff from #2636

And the use of the common (messy) x_button is a step back.

@hstastna
Copy link
Author

I agree with @martinpovolny to revert this PR. We need to fix tagging the other way. I will create a new PR for it once I will have some solution and we can discuss it :)

@simaishi
Copy link
Contributor

@hstastna Since this was reverted in #3217 and that PR is fine/no, cay you create a PR for Fine branch?

@hstastna
Copy link
Author

@simaishi yes, I can. It looks like the bug is still present in Fine.

@hstastna
Copy link
Author

@simaishi here it is: #3804

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.

5 participants