[
https://issues.apache.org/jira/browse/AMBARI-15515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Oleg Nechiporenko updated AMBARI-15515:
---------------------------------------
Status: Patch Available (was: Open)
Patch added
> Improve Em.computed.getByKey
> ----------------------------
>
> Key: AMBARI-15515
> URL: https://issues.apache.org/jira/browse/AMBARI-15515
> Project: Ambari
> Issue Type: Task
> Components: ambari-web
> Affects Versions: 2.4.0
> Reporter: Oleg Nechiporenko
> Assignee: Oleg Nechiporenko
> Fix For: 2.4.0
>
> Attachments: AMBARI-15515.patch
>
>
> * Should handle default value when there is no key in the object
> {noformat}
> var o = Em.Object.create({
> p1: {a: 1, b: 2, c: 3},
> p2: 'd',
> p3: Em.computed.getByKey('p1', 'p2', 100500)
> });
> console.log(o.get('p3')); // 100500 - default value is returned, because
> there is no key `d` in the `p1`
> {noformat}
> * {{App.TestAliases.testAsComputedGetByKey}} should supports checking default
> value and should be able to process provided map instead of traversing throw
> tested object
> * {{App.TestAliases.testAsComputedGetByKey}} should use `to.be.eql` instead
> of `to.be.equal` (`equal` doesn't work for objects, arrays etc)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)