Hiding a form field with dynamic form widgets

I am noticing an incorrect hiding behavior when using the “bc_email_on_started” pre-defined form widget. We want to hide it for some “clusters” (in reality the Linux Host Adapters), and show for others (the SLURM clusters through which the e-mails about jobs works).

I do modify the bc_email_on_started by adding a “help” section, and the help section does not hide. I tried to modify the bc_email_on_started definition in the form.yml to add the type of the widget (check_box), and a few other things, but, the help always shows. For another default widget for which I use “help”, bc_num_hours, the help hides correctly.

So, I am wondering if there’s something special about bc_email_on_started that makes the help not hide.

In form.yml, I have something like this (in a condensed form showing only the relevant pieces):

  cluster:
    widget: select
    options:
      - kingspeak
      - [
          'frisco1',
          data-hide-bc-email-on-started: true,
          data-hide-bc-num-hours: true
        ]
  bc_num_hours:
    value: 1
    min: 1
    step: 1
    help: "Maximum wall time on notchpeak-shared-short is 8 hours, general nodes 72 hours, owner nodes 14 days."
  bc_email_on_started:
    help: "If you do not receive the email, check your [Profile](https://www.chpc.utah.edu/role/user/edit_profile.php) for correct address."

form:
  - cluster
  - bc_num_hours
  - bc_email_on_started

When I choose kingspeak, the bc_email_on_started shows correctly as

[ ] I would like to receive an email when the session starts
If you do not receive the email, check your Profile for correct address.

But, when I choose frisco1, instead of removing the whole widget, it only removes the checkbox and leaves the help:

If you do not receive the email, check your Profile for correct address.

Any thoughts on this?

Thanks,
Martin

Yea that seems to be a bug because the help text is a sibling of the checkbox and not a child.

Thanks Jeff. Anything I can do to fix it, or you’ll have to do it in OOD?

No, it’s a bug on our side. I opened this ticket for the same.

Great, thanks, that’ll be a good incentive for us to do an update once you fix this.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.