{ "id": "109152", "key": "ALOY-496", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "14872", "description": "2013 Sprint 03", "name": "2013 Sprint 03", "archived": true, "released": true, "releaseDate": "2013-02-11" } ], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2013-02-06T00:06:31.000+0000", "created": "2013-02-05T00:37:41.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "qe-sdk3.0.2" ], "versions": [ { "id": "14634", "description": "Alloy 1.0.0", "name": "Alloy 1.0.0", "archived": false, "released": true, "releaseDate": "2013-02-19" } ], "issuelinks": [], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-22T13:21:03.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12600", "name": "Samples & Templates" }, { "id": "12332", "name": "Titanium SDK", "description": "Any integration or issues with the TiSDK" } ], "description": "h6. Problem\r\nsetting 'formFactor' attribute, does not always generate the intended behavior\r\n\r\nh6. Steps to reproduce \r\n(code taken from \"advanced/device_query\", modifying formFactor attributes for the handheld devices)\r\n\r\n{code}\r\n\"#osLabel\": {\r\n\ttext: \"Generic\"\r\n},\r\n\"#osLabel[platform=ios]\": {\r\n\ttext: \"iOS device\\n(size unknown)\"\r\n},\r\n\"#osLabel[platform=ios formFactor=tablet]\": {\r\n\ttext: \"iPad\"\r\n},\r\n\"#osLabel[platform=ios formFactor=foo]\": {\r\n\ttext: \"iPhone\"\r\n},\r\n\"#osLabel[platform=android formFactor=bar]\": {\r\n\ttext: \"AndroidPhone\",\r\n\tcolor: \"#000\"\r\n},\r\n\"#osLabel[platform=android formFactor=tablet]\": {\r\n\ttext: \"AndroidTablet\",\r\n\tcolor: \"#000\"\r\n},\r\n{code}\r\n\r\nResults:\r\n. iPhone: always displaying 'iPhone' text, also when setting anything as 'formFactor' and different than 'tablet'\r\n\r\n. iPad: works fine, displaying 'iPad' text only when setting 'tablet' word as 'formFactor'\r\n\r\n. Android Phone and Tablets: Always displaying the text associated to the Conditional Code part if a 'formFactor' attribute is set with any value. However, if only 'formFactor=tablet' is specified (commenting out the 'formFactor=bar' part), the condition is not satisfied and the 'Generic' text is displayed, even on tablets.\r\ni.e. in the sample code, run on tablet devices, 'Android' text is always displayed instead of 'Android\\nTablet'", "attachment": [], "flagged": false, "summary": "Alloy: formFactor attribute wrong behaviors", "creator": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Alloy 1.0.0\r\nAndroid Phones and Tablets, any version\r\niPhone and iPad, any version", "comment": { "comments": [ { "id": "237215", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I don't think it's worth inspecting the unexpected behavior of misusing the formFactor attribute in device queries personally. Does it ever actually fail when used properly? Do we really need to dig into this one as it is documented?", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-05T14:36:51.000+0000", "updated": "2013-02-05T14:36:51.000+0000" }, { "id": "237249", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "When used properly (i.e. using the original 'advanced/device_query' Sample code), it fails for Android Tablets, always detected just as 'Android'.\r\nNot been able to correctly detect Android Tablet.\r\n\r\n{code}\r\n\"#osLabel[platform=android]\": {\r\n\ttext: \"Android\",\r\n\tcolor: \"#000\"\r\n},\r\n\"#osLabel[platform=android formFactor=tablet]\": {\r\n\ttext: \"Android\\nTablet\",\r\n\tcolor: \"#000\"\r\n},\r\n{code}", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-05T18:52:00.000+0000", "updated": "2013-02-05T18:57:17.000+0000" }, { "id": "237266", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I can't reproduce the issue with the advanced/device_query app. Just tested on emulator against 2 separate android tablets and they both show the styles for android tablet. Any more details on how you ran this or can i close the ticket?", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-05T19:35:03.000+0000", "updated": "2013-02-05T19:35:03.000+0000" }, { "id": "237319", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is caused by the same issue in ALOY-497", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-06T00:06:31.000+0000", "updated": "2013-02-06T00:06:31.000+0000" }, { "id": "237594", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified as fixed with the latest 1_0_X version\n(Git commit b97ead593b6e7c2b2a3beae4cb9a8720dd3931b6)\n\nAll JS files are regenerated on each build.", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-07T03:04:45.000+0000", "updated": "2013-02-07T03:04:45.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }