Esri / Esri/solution.js

Updated approach to searching for fields within items during templating

Open
#109 0 comments 0 reactions 1 assignee Claimed by @jmhauck View on GitHub
A - enhancement
Dominant language
TypeScript
Stars
48
Forks
16
PR merge metrics
No merged PRs in 30d

Description

For some items, Web Maps, Feature Layers, We can rely on the consistency and availability of a spec to do a targeted search of field references to replace with appropriate variable during templating.

For other items, the variability of the spec and inconsistency means we need to rely on our best effort search via a regular expression. This may mean in some cases we might swap out with a variable that is not actually a field reference, but I think it is the best we can do and it is certainly better than doing nothing.

In these cases we can try to do a more focused search in specific objects of the item that will contain field references, like the widgets collection in WAB.

Also when possible if we know the datasource of a particular object we should try to limit the search to fields from that datasource.

Related to this I would like to investigate changing the field variable reference from:
{{33298a2612ba4899adc41180c435425.fieldInfos.layer1.fields.ABC}}

To this format:
{{33298a2612ba4899adc41180c435425.layer1.fields.ABC.name}}

The field is now an object with the following properties available

33298a2612ba4899adc41180c435425.layer1.fields.ABC.name - Name of the field
33298a2612ba4899adc41180c435425.layer1.fields.ABC.alias - Alias of the field
33298a2612ba4899adc41180c435425.layer1.fields.ABC.type - Type of the field

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.