{ "id": "121850", "key": "ALOY-871", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "15758", "description": "Alloy 1.4.0", "name": "Alloy 1.4.0", "archived": false, "released": true, "releaseDate": "2014-07-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-05-07T15:57:07.000+0000", "created": "2013-10-30T22:47:45.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "notable", "qe-testadded" ], "versions": [], "issuelinks": [ { "id": "36987", "type": { "id": "10000", "name": "Blocks", "inward": "is blocked by", "outward": "blocks" }, "inwardIssue": { "id": "129529", "key": "ALOY-989", "fields": { "summary": "Custom TSS: issue when using more than one conditional", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "36975", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "129529", "key": "ALOY-989", "fields": { "summary": "Custom TSS: issue when using more than one conditional", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "36092", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "128206", "key": "TIDOC-1603", "fields": { "summary": "Alloy support for custom TSS queries", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } }, { "id": "36494", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "128734", "key": "TIDOC-1614", "fields": { "summary": "Guides: Alloy: Add description and examples of custom TSS queries", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "updated": "2014-05-29T05:02:20.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" } ], "description": "Currently alloy supports the tablet and handheld platform types. It would be nice if users could define custom platform types. For example a user could define in the alloy.js file\r\n\r\n{code}\r\nexports.isSmalltablet = function() {\r\n return OS_ANDROID &&Ti.Platform.Android.physicalSizeCategory === Ti.Platform.Android.PHYSICAL_SIZE_CATEGORY_LARGE\r\n}\r\n{code}\r\n\r\nand then use {code}platform=smalltablet{code} in the xml and tss files.", "attachment": [], "flagged": false, "summary": "Custom TSS device queries", "creator": { "name": "dbankier", "key": "dbankier", "displayName": "David Bankier", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dbankier", "key": "dbankier", "displayName": "David Bankier", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 50, "state": "closed", "name": "2014 Sprint 09 Tooling", "startDate": "2014-04-28T15:43:24.381Z", "endDate": "2014-05-10T03:44:00.000Z", "completeDate": "2014-05-12T13:36:16.254Z", "originBoardId": 113 } ], "comment": { "comments": [ { "id": "277423", "author": { "name": "dbankier", "key": "dbankier", "displayName": "David Bankier", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tony, I'm happy to work on it if you back the idea.", "updateAuthor": { "name": "dbankier", "key": "dbankier", "displayName": "David Bankier", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-30T22:48:29.000+0000", "updated": "2013-10-30T22:48:29.000+0000" }, { "id": "277483", "author": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "body": "Vote from me.", "updateAuthor": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "created": "2013-10-31T10:04:54.000+0000", "updated": "2013-10-31T10:04:54.000+0000" }, { "id": "277484", "author": { "name": "dbankier", "key": "dbankier", "displayName": "David Bankier", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Only just saw this: https://github.com/appcelerator/alloy/pull/263\r\nGuess I'm a day late...", "updateAuthor": { "name": "dbankier", "key": "dbankier", "displayName": "David Bankier", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-31T10:55:44.000+0000", "updated": "2013-10-31T11:10:19.000+0000" }, { "id": "277677", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~mrahman] who is the original reporter of this issue? Can you please note that in situations where you don't preserve it?\n\n[~dbankier] and [~core13] since the conversation already started in that PR, please continue any more feedback there. \n\nMy opinion is that I like the idea of opening up conditionals in the TSS/XML, but definitely not with the {{platform}} keyword. {{platform}} has a specific meaning, and is unique in that unlike {{formFactor}}, {{platform}} is processed at compile time. As I stated in the github PR, I suggested a new field, like {{condition}}. We'll continue the conversation there.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-01T14:57:25.000+0000", "updated": "2013-11-01T14:57:25.000+0000" }, { "id": "277679", "author": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "body": "@Tony - I really like the idea of the new {{condition}} field, will say the same thing in the PR.", "updateAuthor": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "created": "2013-11-01T15:02:55.000+0000", "updated": "2013-11-01T15:02:55.000+0000" }, { "id": "277834", "author": { "name": "dbankier", "key": "dbankier", "displayName": "David Bankier", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Sorry Tony, my original suggestion was meant to be on form factor but I like the if property on a Alloy.Global constant like you suggested in the PR.", "updateAuthor": { "name": "dbankier", "key": "dbankier", "displayName": "David Bankier", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-02T11:25:50.000+0000", "updated": "2013-11-02T11:25:50.000+0000" }, { "id": "299210", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "PR: https://github.com/appcelerator/alloy/pull/355\n\nFunctional test:\n\n# Build the associated app for the iOS simulator. \n# Compare the styles applied to the label to the rules defined in styles/index.tss\n# From the simulator's Hardware menu, choose Device, then a different device to emulate. \n# Once the simulator restarts, open the app again. Again, compare the styles applied to those defined.\n\nThe if rules take precedence over other rules.\n", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-03-28T20:23:21.000+0000", "updated": "2014-03-28T20:23:21.000+0000" }, { "id": "299259", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Thx [~skypanther]! Some questions/ideas though:\r\n\r\n*-if=-*\r\nLooking at the code I understand why, but from the user/dev/syntax perspective I find the {{if=}} prefix confusing and unneeded. I mean, all conditionals *are* essentially {{if}}'s: *if*{{[platform=ios]}}, so when combining them you get: *if*{{[platform=ios,if=Alloy.Globals.ios7]}}. Why not just accept {{[platform=ios,Alloy.globals.ios7]}}. For the compiler, finding no {{=}} simply means assuming what is now done as {{if=}}.\r\n\r\n*XML*\r\nI don't see an implementation for supporting these custom conditionals in the XML. Is that coming as well?\r\n\r\n*CONSTANT_IOS7*\r\nSame for the controllers. I know this is more challenging. What about the following idea for both the TSS, XML and JS: Instead of {{Alloy.Globals.\\*}} introduce a specific namespace like {{Alloy.Constants.\\*}}. In the TSS and XML skip the {{if=}} and just accept {{Alloy.Constants.*}}. In the JS accept {{CONSTANT_IOS7}} for {{Alloy.Constants.iOS7}}.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-03-29T13:01:15.000+0000", "updated": "2014-03-29T13:01:15.000+0000" }, { "id": "299327", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "I need a key/name to hook into in the styler.js script. Discussion on the original PR identified \"if\" as the preferred choice. There's an appeal to something like [ios,Alloy.globals.ios7] or [tablet,ios]. But we'd still need an attribute name in XML. Feel free to file a separate feature request. \n\nXML - I'll amend my PR to accept the conditionals in the XML as well.\n\nCONSTANT_IOS7 - Since we already have one global object (Alloy.Globals), I don't see an advantage to adding another (Alloy.Constants) plus a varying set of aliases (CONSTANT_IOS7).", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-03-31T16:51:16.000+0000", "updated": "2014-03-31T16:51:16.000+0000" }, { "id": "299479", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "You got me on the attribute name for XML.\r\n\r\nYou are also right that in the controller you could just use {{Alloy.Globals.myCondition}} and since these are variables only known at run-time the compiler could not strip the code anyway, so forget about that too ;)\r\n\r\nJust the XML plz :)", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-04-01T13:22:16.000+0000", "updated": "2014-04-01T13:22:16.000+0000" }, { "id": "299513", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "PR updated to handle XML now. The functional test app included in the PR now has an XML element demonstrating the new if attribute. ", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-04-01T17:15:49.000+0000", "updated": "2014-04-01T17:15:49.000+0000" }, { "id": "303829", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "PR for ALOY-1004 updates the sample apps for this ticket along with the advanced/custom_tss_queries sample. That PR has been merged, resolving this ticket.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-05-07T15:57:07.000+0000", "updated": "2014-05-07T15:57:07.000+0000" }, { "id": "303925", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-07T22:30:30.000+0000", "updated": "2014-05-07T22:30:30.000+0000" } ], "maxResults": 17, "total": 17, "startAt": 0 } } }