[
https://issues.apache.org/jira/browse/SLING-5053?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Radu Cotescu closed SLING-5053.
-------------------------------
> Add support for Enum comparison in Sightly scripts
> --------------------------------------------------
>
> Key: SLING-5053
> URL: https://issues.apache.org/jira/browse/SLING-5053
> Project: Sling
> Issue Type: Improvement
> Components: Scripting
> Affects Versions: Scripting Sightly Engine 1.0.4
> Reporter: Radu Cotescu
> Assignee: Radu Cotescu
> Priority: Minor
> Fix For: Scripting Sightly Engine 1.0.6
>
>
> Currently, in order to perform comparisons with enum values one needs to
> write code similar to:
> {code:html}
> <div data-sly-test="${member.inviteStatus.toString == 'PENDING'}"
> data-sly-unwrap>${'Pending' @ i18n, locale=request.locale}</div>
> {code}
> This could be further simplified to:
> {code:html}
> <div data-sly-test="${member.inviteStatus == 'PENDING'}"
> data-sly-unwrap>${'Pending' @ i18n, locale=request.locale}</div>
> {code}
> for the cases when {{member.inviteStatus}} evaluates to an Enum constant.
> Enum comparison support has also been added to version 1.2 draft of the
> Sightly Specification:
> https://github.com/Adobe-Marketing-Cloud/sightly-spec/blob/1.2/SPECIFICATION.md#1142-comparison-operators
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)