Automattic / happychat-client

Happychat customer client code
13 stars 5 forks source link

Website Status Report field is not applicable for Sensei and Sensei extensions #277

Open donnapep opened 5 years ago

donnapep commented 5 years ago

Describe the bug When creating a ticket for Sensei or for any of Sensei's extensions on WooCommerce.com, a Website Status Report field is one of the fields that must be filled out before the ticket can be submitted. However, WooCommerce is not a Sensei dependency, so some of our users have no idea how to fill out that field.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://woocommerce.com/my-account/create-a-ticket/?primary=broken&select=152116&form=ticket
  2. Fill out all the fields except Website Status Report.
  3. Note that the Submit Request button is disabled.
  4. Enter "N/A" into the Website Status Report.
  5. The page now shows "System Status Report is invalid or unsupported".

Expected behavior The Website Status Report field should not be visible/required for Sensei or any of its extensions on WooCommerce.com.

Screenshots screen shot 2018-12-03 at 3 42 08 pm

Desktop (please complete the following information):

Additional context Reported by a user here - https://github.com/Automattic/sensei/issues/2353#issuecomment-443784138

oandregal commented 5 years ago

Some thoughts on this:

The openTextField and openTextArea fields have an isRequired option that it's a boolean, so it's required or not for the whole form. We'll need to iterate on this by making isRequired a contextual option.

One possibility would be to make isRequired an array that contains a list of all the primary, secondary options for which the field is required.

gedex commented 5 years ago

One possibility would be to make isRequired an array that contains a list of all the primary, secondary options for which the field is required.

That would be great.

The openTextField and openTextArea fields have an isRequired option that it's a boolean, so it's required or not for the whole form. We'll need to iterate on this by making isRequired a contextual option.

This is a workaround I thought too, but system report validation from our API only occurs when it fallbacks to ticket. With that users are able to skip system report when chat is available.