You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Radu Cotescu (JIRA)" <ji...@apache.org> on 2015/10/12 15:26:05 UTC
[jira] [Closed] (SLING-5053) Add support for Enum comparison in
Sightly scripts
[ 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)