IDEMSInternational / open-app-builder

PLH App Frontend
GNU General Public License v3.0
5 stars 24 forks source link

feat: make local context available in data-items loop #2304

Closed jfmcquade closed 1 month ago

jfmcquade commented 2 months ago

PR Checklist

Description

Allows rows within a data-items loop to reference local variables (#2303).

Dev notes

This feels like a hack, and adding another caveat to the template-variables service logic doesn't feel great, but it does seem to work.

NB: view the code changes for template-variables.service.ts with whitespace changes hidden in order to see meaningful diff.

Git Issues

Closes #2303

Screenshots/Videos

debug_data_items

Screenshot 2024-04-26 at 12 35 03 Screenshot 2024-04-26 at 12 30 11

debug_data_items_local

Screenshot 2024-04-26 at 12 36 07 Screenshot 2024-04-26 at 12 30 17
esmeetewinkel commented 2 months ago

I found this works in general, but there is a case where somehow the first iteration of a local variable in a data-items loop is found, but next iterations are not. I thought it had to do with the presence of a display group, but that doesn't seem to be the case since this template works.

debug_kids image image