Global predefined hardcoded attributes

I think this is unsupported but wanted to verify. OnDemand version: 4.1.4

As of 4.1 predefined form attributes are supposed to be configurable as global_bc_form_items

This seems to work great with normally defined attributes but I’m getting errors when trying to use it with hardcoded values. It appears to only attempt to handle it as an array rather than a string or integer value. In this case, global_bc_vnc_idle causes an error.

global_bc_form_items:
  global_bc_vnc_idle: "0"
  global_bc_num_hours:
    label: "Number of hours"
    value: 4
    max: 336
dashboard/app/views/batch_connect/shared/_app_list_item.html.erb where line #1 raised:

undefined method `to_h' for an instance of String
Extracted source (around line #16):

      config = config.to_h.deep_merge(opts)

Maybe it’s more like this? I can create a ticket upstream to check for a string/other scalar and cast it to the value.

global_bc_form_items:
  global_bc_vnc_idle: 
    value: "0"
  global_bc_num_hours:
    label: "Number of hours"
    value: 4
    max: 336

There’s no errors when setting the value attribute or any others that I tried but that option only sets the default placeholder value rather than hardcoding it and hiding it on the form.

It’s not a big deal to configure it per-app, but for most of my apps it will be the only attribute listed in the form.yml because globals are working great for everything else.

Does adding fixed: true do anything?

global_bc_form_items:
  global_bc_vnc_idle: 
    value: "0"
    fixed: true
  global_bc_num_hours:
    label: "Number of hours"
    value: 4
    max: 336

Yes, that seems to work! I didn’t realize ‘fixed’ also hid the form element but that makes sense. Thanks!