Bug 1431692 - service dialog dynamic code works in admin portal but not in self-service portal
Summary: service dialog dynamic code works in admin portal but not in self-service portal
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - Service
Version: 5.7.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.9.0
Assignee: Chris Hale
QA Contact: Dave Johnson
URL:
Whiteboard: ssui
Depends On:
Blocks: 1447391 1450421
TreeView+ depends on / blocked
 
Reported: 2017-03-13 15:50 UTC by Saif Ali
Modified: 2020-09-10 10:19 UTC (History)
17 users (show)

Fixed In Version: 5.9.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1447391 1450421 (view as bug list)
Environment:
Last Closed: 2018-03-06 15:00:41 UTC
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Saif Ali 2017-03-13 15:50:18 UTC
Description of problem:
We have code that calls a web service to validate if the value of another field on the service dialog is a valid Active Directory ID. If it is not then when the service dialog is submitted an error dialog box will be created stating that it is an invalid ID. This works in the admin (Ruby on Rails portal). However, in the self-service portal even when ID is invalid the service is added to the cart.


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

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 3 Chris Kacerguis 2017-03-13 18:19:15 UTC
Watched the video, basically it when the fill out the data in the SUI, and it is INVALID, it will allow them to add it to the cart.  We should change it so that if the data is INVALID, it should not allow you to add it to the cart.

Comment 28 Greg McCullough 2017-04-27 17:32:02 UTC
This bug exposes two issues the first which is easier to resolve:

1) Dynamic dialog fields still get their default values from the database, but the UI hides many of the Options once the "Dynamic" checkbox is selected.

2) We are losing the context for validation logic (like required or the validation_rule) through the API if the values are changed by automate.


I suggest we use this ticket to address the first of these issues.

I am proposing that we expose the Options that a user can modify for a dynamic dialog to allow them to set the Default Options.  This means options like "Read-Only" or "Visible" should still be configurable when editing a dynamic field to allow the default values to be set.

If they decide within the Automate method to change that value then the automate method would specify the new value.  Otherwise the field would continue to use the default.

Also for clarity it would make sense to group the options two ways:
  "Options" - Things that **cannot** be set from the dynamic automate script
  "Overridable Options" - Things that **can** be set from the dynamic automate script

There are a number of different field types but most have common properties.

Here are two examples of the fields when the "Dynamic" flag is checked.

Text Box Field:
Options:
  Entry Point (NS/CIs/Inst)
  Show Refresh Button
  Auto refresh
  Auto Refresh other fields when modified

  Protected
  Required
  Value Type
  Validation Type
  Validation Rule

Overridable Options:
  Read only
  Visible
  Default Value



Drop-down Field:
Options:
  Entry Point (NS/CIs/Inst)
  Show Refresh Button
  Auto refresh
  Auto Refresh other fields when modified
  Value Type
  Multiselect

Overridable Options:
  Read only
  Visible
  Sort By
  Sort Order

Hidden:
  Default Value (Since it is based on "Entries" that come from automate method.)


I am sure this will require further discussion so please contact ErikC or myself.

Comment 31 CFME Bot 2017-05-02 15:13:40 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:
https://github.com/ManageIQ/manageiq-ui-classic/commit/eafd24e9917f11e2e0d2a19a87562fd7567f442f

commit eafd24e9917f11e2e0d2a19a87562fd7567f442f
Author:     Harpreet Kataria <hkataria>
AuthorDate: Fri Apr 28 13:38:12 2017 -0400
Commit:     Harpreet Kataria <hkataria>
CommitDate: Mon May 1 17:11:28 2017 -0400

    Show additional fields for dynamic fields
    
    Made changes to show additional fields for dynamic fields. Additional  field sunder Options box are displayed as well as new box with label "Overridable Options" appears for dynamic fields. More details on these fields are in BZ comment#28(https://bugzilla.redhat.com/show_bug.cgi?id=1431692#c28)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1431692

 .../_dialog_field_form.html.haml                   | 24 +++---
 .../_dialog_field_form_dynamic_options.html.haml   | 87 ++++++++++++++++++++++
 ...ield_form_overridable_dynamic_options.html.haml | 59 +++++++++++++++
 3 files changed, 161 insertions(+), 9 deletions(-)
 create mode 100644 app/views/miq_ae_customization/_dialog_field_form_overridable_dynamic_options.html.haml

Comment 34 Greg McCullough 2017-05-03 15:48:29 UTC
Clearing needinfo flag. Ticket is already in POST status so I am leaving the flags unmodified.

Comment 36 Shveta 2017-11-03 01:15:37 UTC
Not fixed in 5.9.0.4.20171024163837_ef71ea6.
Appliance : https://10.8.198.241/ui/service
Service :rhev_item .
Resource Group field is not refreshed.

Comment 39 Chris Hale 2017-11-07 21:15:37 UTC
Shveta, can you specify for me which field should be the one that triggers the refresh for this field on the appliance you had specified above.  I am working on trying to reproduce this issue

Comment 40 Shveta 2017-11-08 00:54:04 UTC
In OPS UI , filling the 
Stack Manager (UP ID)
Stack Prefix (5 chars)  fields refresh the Resource group .

In SUI , it doesn't .

Comment 41 Chris Hale 2017-11-08 20:35:43 UTC
I just tested this against that appliance specified above https://10.8.196.147 and watched it refresh the resource group as expected.  Can you retest and verify?

Comment 42 Shveta 2017-11-08 20:51:29 UTC
It's working now . Moving it to verified .


Note You need to log in before you can comment on or make changes to this bug.