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

Make Add button respond properly on changes while adding Catalog Item #5472

Merged

Conversation

hstastna
Copy link

@hstastna hstastna commented Apr 18, 2019

Fixes BZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1728774

Issue:
#5469

What:
Add button is already (always) enabled while adding a new Service Catalog Item, even when there is nothing to add, because we haven't filled in anything. This behavior is not consistent with other screens. We want Add button to properly response on changes, as in other screens.

How:
When user fills in some form, the text for the appropriate form is stored in @edit[:new] where the original values are usually set to nil. The same values are copied to @edit[:current] in the beginning. If the user deletes the text from the form, the variable is set to "" which is different to the original value, so the changed variable stilll 'detects' the change even when there is no change according to the original value (nil). So I am adding new common method copy_params_if_present which deals with "" vs nil values.

Note:
This PR fixes response of Add button on changes (bot adding and editing Catalog Item), except Long Description. This is more complicated and requires different fix (Also not sure how this should work - issue: #5853).


Before: (when first time in for adding new Catalog Item, Add button already enabled!)
add_issue

After: (when first time in for adding new Catalog Item, Add button disabled, there is nothing to add)
catitem_after

@hstastna
Copy link
Author

@miq-bot add_label bug

@hstastna hstastna force-pushed the Add_button_enabled_Service_Catalog_Item branch from 7774f13 to c24ab09 Compare May 7, 2019 12:00
@hstastna hstastna changed the title [WIP] Fix always enabled Add button while adding/editing Catalog Item [WIP] Fix always enabled Add button while adding Catalog Item May 28, 2019
@hstastna hstastna force-pushed the Add_button_enabled_Service_Catalog_Item branch from c24ab09 to 6db1e07 Compare June 3, 2019 08:51
@hstastna hstastna force-pushed the Add_button_enabled_Service_Catalog_Item branch 2 times, most recently from 85f984e to 2ac5861 Compare July 9, 2019 08:44
@hstastna hstastna force-pushed the Add_button_enabled_Service_Catalog_Item branch 7 times, most recently from 79c28cc to 59a4b8a Compare July 16, 2019 11:44
@hstastna hstastna changed the title [WIP] Fix always enabled Add button while adding Catalog Item Fix always enabled Add button while adding Catalog Item Jul 16, 2019
@hstastna hstastna force-pushed the Add_button_enabled_Service_Catalog_Item branch from 59a4b8a to 60ea017 Compare July 16, 2019 11:59
@miq-bot miq-bot removed the wip label Jul 16, 2019
@hstastna hstastna force-pushed the Add_button_enabled_Service_Catalog_Item branch 5 times, most recently from 6cfbded to ce1971c Compare July 17, 2019 13:44
@hstastna hstastna changed the title Fix always enabled Add button while adding Catalog Item Make Add button respond properly on changes while adding Catalog Item Jul 18, 2019
@hstastna hstastna force-pushed the Add_button_enabled_Service_Catalog_Item branch 3 times, most recently from 4331525 to 42fbd1e Compare July 18, 2019 09:46
@hstastna hstastna force-pushed the Add_button_enabled_Service_Catalog_Item branch 2 times, most recently from f1ad645 to 7f94d26 Compare July 22, 2019 08:26
@hstastna hstastna changed the title [WIP] Make Add button respond properly on changes while adding Catalog Item Make Add button respond properly on changes while adding Catalog Item Jul 22, 2019
@miq-bot miq-bot removed the wip label Jul 22, 2019
@hstastna hstastna force-pushed the Add_button_enabled_Service_Catalog_Item branch 3 times, most recently from 784ddce to 5941db2 Compare July 29, 2019 09:00
@hstastna
Copy link
Author

@miq-bot add_label ivanchuk/yes

Hilda Stastna added 2 commits July 29, 2019 17:26
Add specs for setting initialized values for entry points, dialog id,
@edit when saving Catalog Item or choosing Catalog Item type.
@hstastna hstastna force-pushed the Add_button_enabled_Service_Catalog_Item branch from 5941db2 to d77e21c Compare July 29, 2019 15:26
@miq-bot
Copy link
Member

miq-bot commented Jul 29, 2019

Checked commits hstastna/manageiq-ui-classic@d3c3878~...d77e21c with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
3 files checked, 0 offenses detected
Everything looks fine. 🍪

@romanblanco
Copy link
Member

@miq-bot add_reviewer @romanblanco

@miq-bot miq-bot requested a review from romanblanco July 30, 2019 10:45
@h-kataria
Copy link
Contributor

verified fix, looks good.

@h-kataria h-kataria self-assigned this Jul 30, 2019
@h-kataria h-kataria added this to the Sprint 117 Ending Aug 5, 2019 milestone Jul 30, 2019
@h-kataria h-kataria merged commit 9ecceb4 into ManageIQ:master Jul 30, 2019
simaishi pushed a commit that referenced this pull request Jul 30, 2019
…alog_Item

Make Add button respond properly on changes while adding Catalog Item

(cherry picked from commit 9ecceb4)

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

Ivanchuk backport details:

$ git log -1
commit 1dd59484fdb52806e3c0a0319a028f780c4d2cf2
Author: Harpreet Kataria <hkataria@redhat.com>
Date:   Tue Jul 30 09:19:31 2019 -0400

    Merge pull request #5472 from hstastna/Add_button_enabled_Service_Catalog_Item
    
    Make Add button respond properly on changes while adding Catalog Item
    
    (cherry picked from commit 9ecceb4ef4c14278f35adb11e1c2c032ce05bb71)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1728774

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