Staff Slips (UXPROD-19)

[UXPROD-3198] Add logic flow to templates for staff slips Created: 29/Jul/21  Updated: 23/Feb/23

Status: Draft
Project: UX Product
Components: None
Affects versions: None
Fix versions: None
Parent: Staff Slips

Type: New Feature Priority: TBD
Reporter: Darcy Branchini Assignee: julie.bickle
Resolution: Unresolved Votes: 0
Labels: staff_slips, staff_slips_tokens
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Epic Link: Staff Slips
Development Team: Vega
PO Rank: 0
Rank: Cornell (Full Sum 2021): R3

 Description   

From RA SIG meeting notes on 7/19: What would be ideal is if we could make it possible to add flow logic to templates via an extension on Mustache called Handlebars. This feature, along with UXPROD-3199 Draft , is a longer-term more sustainable path for tokens and templates. For example, instead of adding am effective name token defined as if preferred name, use that, if no preferred name, use first name. Another example would be if a field value is not empty, then print line with a label and field value; otherwise, leave empty and move to next line. This gives libraries infinitely more flexibility in how they define the text of their templates. It also requires no further development in terms of adding new tokens ( UXPROD-3199 Draft ) or singularly defined conditional tokens, such as preferred name.

Specific example for what this would like on a template:
{{#if (isdefined user.preferredName)}}
{{user.preferredName}}
{{else}}
{{user.firstName}}
{{/if}}

Questions

  • For developers - are we already using Handlebars for looping? {{#loans}} {{loan.dueDate}} {{/loans}}.

Generated at Fri Feb 09 00:30:07 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.