Bug 1298645

Summary: UI: Advanced Search - Delete button remains enabled after deleting the filter
Product: Red Hat CloudForms Management Engine Reporter: Harpreet Kataria <hkataria>
Component: UI - OPSAssignee: Harpreet Kataria <hkataria>
Status: CLOSED ERRATA QA Contact: Matouš Mojžíš <mmojzis>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 5.6.0CC: cpelland, dajohnso, dclarizi, hkataria, jhardy, jprause, mfeifer, mpovolny, nachandr, obarenbo, psavage
Target Milestone: GAKeywords: ZStream
Target Release: 5.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: ui:search:filter
Fixed In Version: 5.6.0.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1314434 (view as bug list) Environment:
Last Closed: 2016-06-29 15:29:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1314434, 1320244    
Attachments:
Description Flags
Delete button still enabled
none
AdvancedSearch_delete_works none

Description Harpreet Kataria 2016-01-14 15:57:32 UTC
Created attachment 1114876 [details]
Delete button still enabled

Description of problem: Delete button remains enabled after deleting the filter


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Go VM explorer, advanced search
2. Add a filter, then load the filter that was added.
3. Press Delete button to delete the filter, after filter is deleted, "Delete" button is still enabled and if i press it again i see an error on the background screen.

Actual results: Delete button remains enabled after filter is deleted, clicking on it again throws an error

[----] I, [2016-01-14T10:55:24.586152 #8813:baf98c]  INFO -- : Completed 200 OK in 59ms (Views: 8.6ms | ActiveRecord: 15.8ms)
[----] I, [2016-01-14T10:55:37.132679 #8813:baf98c]  INFO -- : Started POST "/vm_infra/adv_search_button?button=delete" for 127.0.0.1 at 2016-01-14 10:55:37 -0500
[----] I, [2016-01-14T10:55:37.160629 #8813:baf98c]  INFO -- : Processing by VmInfraController#adv_search_button as JS
[----] I, [2016-01-14T10:55:37.160719 #8813:baf98c]  INFO -- :   Parameters: {"button"=>"delete"}
[----] F, [2016-01-14T10:55:37.182169 #8813:baf98c] FATAL -- : Error caught: [ActiveRecord::RecordNotFound] Couldn't find MiqSearch with 'id'=1000000000140
/home/hkataria/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.5/lib/active_record/core.rb:155:in `find'
/home/hkataria/dev/manageiq/app/controllers/application_controller/filter.rb:686:in `adv_search_button'


Expected results: Delete button should become disabled/grayed until another filter is loaded


Additional info:

Comment 2 Harpreet Kataria 2016-03-03 15:19:59 UTC
https://github.com/ManageIQ/manageiq/pull/7083

Comment 3 CFME Bot 2016-03-15 22:01:10 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/06c215b9c0be6d40d2a0ad82f245bae5b7c6c4eb

commit 06c215b9c0be6d40d2a0ad82f245bae5b7c6c4eb
Author:     Harpreet Kataria <hkataria>
AuthorDate: Thu Mar 3 09:53:14 2016 -0500
Commit:     Harpreet Kataria <hkataria>
CommitDate: Thu Mar 3 10:23:59 2016 -0500

    Clear selected filter after it is deleted or reset button is pressed.
    
    Not clearing the filter after filter is deleted is causing to show "Delete" as enabled after filter is deleted and pressing it again throws an error.
    This also removes empty parenthesis in the title on Advanced search modal when Delete/Reset is pressed.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1298645
    https://bugzilla.redhat.com/show_bug.cgi?id=1314434

 app/controllers/application_controller/filter.rb | 1 +
 1 file changed, 1 insertion(+)

Comment 4 CFME Bot 2016-03-16 16:47:04 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=e20afea6815416161690843ba7b4b53d6fea3cff

commit e20afea6815416161690843ba7b4b53d6fea3cff
Author:     Harpreet Kataria <hkataria>
AuthorDate: Thu Mar 3 09:53:14 2016 -0500
Commit:     Harpreet Kataria <hkataria>
CommitDate: Wed Mar 16 09:15:51 2016 -0400

    Clear selected filter after it is deleted or reset button is pressed.
    
    Not clearing the filter after filter is deleted is causing to show "Delete" as enabled after filter is deleted and pressing it again throws an error.
    This also removes empty parenthesis in the title on Advanced search modal when Delete/Reset is pressed.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1298645
    https://bugzilla.redhat.com/show_bug.cgi?id=1314434
    (cherry picked from commit 06c215b)

 app/controllers/application_controller/filter.rb | 1 +
 1 file changed, 1 insertion(+)

Comment 5 CFME Bot 2016-03-16 16:47:12 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=cc8887037b1d3ac2a15acfe9d6217ff7c1fdb555

commit cc8887037b1d3ac2a15acfe9d6217ff7c1fdb555
Merge: 4e7fc09 e20afea
Author:     Dan Clarizio <dclarizi>
AuthorDate: Wed Mar 16 12:23:46 2016 -0400
Commit:     Dan Clarizio <dclarizi>
CommitDate: Wed Mar 16 12:23:46 2016 -0400

    Merge branch '55z_pr_7083' into '5.5.z'
    
    Clear selected filter after it is deleted or reset button is pressed.
    
    Not clearing the filter after filter is deleted is causing to show "Delete" as enabled after filter is deleted and pressing it again throws an error.
    This also removes empty parenthesis in the title on Advanced search modal when Delete/Reset is pressed.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1298645
    https://bugzilla.redhat.com/show_bug.cgi?id=1314434
    (cherry picked from commit 06c215b)
    
    @dclarizi please review, clean cherry-pick from https://github.com/ManageIQ/manageiq/pull/7083
    
    See merge request !855

 app/controllers/application_controller/filter.rb | 1 +
 1 file changed, 1 insertion(+)

Comment 7 Harpreet Kataria 2016-03-21 14:42:02 UTC
*** Bug 1302450 has been marked as a duplicate of this bug. ***

Comment 8 Harpreet Kataria 2016-03-22 18:02:02 UTC
*** Bug 1283554 has been marked as a duplicate of this bug. ***

Comment 9 amogh 2016-04-25 17:08:20 UTC
Created attachment 1150559 [details]
AdvancedSearch_delete_works

Comment 10 amogh 2016-04-25 17:09:28 UTC
verified this bug in 5.6.0.4-beta2.3.20160421172650_719e256 and it is not reproducible. refer the screenshot "AdvancedSearch_delete_works"

Comment 12 errata-xmlrpc 2016-06-29 15:29:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1348