Sub-Apps that extend a base app

Using sub-apps, can attribute values be provided that don’t exist in the base app? And if not, any workarounds like setting hidden values?

https://osc.github.io/ood-documentation/latest/how-tos/app-development/interactive/sub-apps.html

The use-case for this would be to provide a specific user group with custom app settings that only pertain to them and to avoid confusing regular users or having to add excess complexity to the base form.

Also in testing this, the sub-apps would appear in the OOD menus but they also seemed to replace the base app entirely or caused it to be removed from the Pinned Apps? Is that expected? Or some kind of cache/browser issue? (Need to test this more.)

OnDemand version: 2.0.32

Hi and welcome!

I’d actually have to check to be sure but I think so. Though the script and submit files need to account for nil or empty values that would come in the base app.

If not, then yes hidden or fixed values in the base app would work.

A quick spot check shows that that appears to be the case. I suspect that this is expected (it was created before my time), but in your case, as a user and app developer myself, I would not expect it. I’ll file a ticket upstream to investigate how we may change this.

I made a ticket upstream about subapps replacing base apps. I think the workaround you’re going to have to do is re-create the base app as a sub app. symlinks could work here so you don’t actually have to recreate (and update when needed) the file.

@jeff.ohrstrom Thanks! I’ll have to test the workaround you suggested. But yes, it seems like there are valid use-cases here to both use sub-apps replace or to extend the base app.

In testing the attribute values, I’m still finding that in the sub-app I can’t specify any attribute values that aren’t listed as options in the base. For example:


# local/intr.yml
form:
  - rc_queue
attributes:
  rc_queue:
    value: "intr"
    
    
# ../form.yml.erb    
rc_queue:
    widget: select
    label: "partition"
    options:
      - ["open", "open"]
#      - ["Interactive", "intr"]

Well that’s what I get for not checking in depth!