{ "id": "133434", "key": "ALOY-1092", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "16692", "name": "Alloy 1.7.0", "archived": false, "released": true, "releaseDate": "2015-07-22" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-10-07T04:17:24.000+0000", "created": "2014-07-21T01:24:29.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "15909", "description": "Alloy 1.5.0", "name": "Alloy 1.5.0", "archived": false, "released": true, "releaseDate": "2014-09-29" }, { "id": "16389", "name": "Alloy 1.4.1", "archived": false, "released": true, "releaseDate": "2014-07-28" } ], "issuelinks": [ { "id": "41936", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "131185", "key": "ALOY-1037", "fields": { "summary": "Expose instantiation arguments of createController", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "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": "41949", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "137719", "key": "TIDOC-1913", "fields": { "summary": "Guides: Custom TSS queries: Can now set styles based on controller arguments", "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-10-23T19:47:52.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "13603", "name": "Styling", "description": "TSS, dynamic styling, styling API" } ], "description": "The docs state that you have to use Alloy.Globals.* in a .tss query. You can actually use a local function in a controller too, i.e. `\"#window[if=myFunc()]\"` and that will work too.\r\n\r\nWhat won't work however is basing a query off of params passed to the controller instance. It would work, but the Alloy compiler doesn't allow it - `\"#window[if=arguments[0].someProp]\"`\r\n\r\nThis would be a very powerful addition to the new queries available. It technically already works in the runtime code (I hardcoded it and tried it)...but it just won't compile right now because we're not allowed to put those characters in the tss query.", "attachment": [ { "id": "51794", "filename": "Screen Shot 2014-10-03 at 3.34.28 PM.png", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-10-03T19:58:58.000+0000", "size": 252219, "mimeType": "image/png" } ], "flagged": false, "summary": "Allow more query options / scope in .tss", "creator": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "subtasks": [], "reporter": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "environment": null, "closedSprints": [ { "id": 228, "state": "closed", "name": "2014 Sprint 20 Alloy", "startDate": "2014-09-29T13:30:47.322Z", "endDate": "2014-10-13T13:30:00.000Z", "completeDate": "2014-10-13T18:08:16.541Z", "originBoardId": 124 } ], "comment": { "comments": [ { "id": "315042", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~rblalock] Which characters is it complaining about? The brackets? Could you escape them?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-07-21T16:30:55.000+0000", "updated": "2014-07-21T16:30:55.000+0000" }, { "id": "326922", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "See the attached screen. Even if the {{arguments\\[0\\]}} syntax worked, it would be pointing to the wrong arguments object. Your components are defined inside self-calling functions so {{arguments}} correspond to that function's args.\r\n\r\nMy couple of attempts to work around this by using a local function didn't work either.\r\n\r\n{code}\r\nfunction isSomePropertyTrue() {\r\n return args.someProperty;\r\n // fails because args has no value when this is run\r\n // because of hoisting (args exists, but has no value yet)\r\n}\r\n\r\nfunction isSomePropertyTrue() {\r\n return Array.prototype.slice.call(arguments)[0].someProperty;\r\n // fails because it runs in the context of the nested\r\n // IIFE and thus points to the wrong arguments object\r\n}\r\n{code}\r\n\r\nAnd of course this wouldn't work either, as again it refers to the wrong arguments object\r\n\r\n{code}\r\n\"#argLabel[if=Array.prototype.slice.call(arguments).pop().someProperty]\": {\r\n text: 'args.someProperty is truthy'\r\n}\r\n{code}", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-10-03T19:58:58.000+0000", "updated": "2014-10-03T19:58:58.000+0000" }, { "id": "326924", "author": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "body": "I wouldn't focus on my \"arguments[0]\" as what should be the solution - the goal of this ticket is not to try to tell you how to provide the solution. The ticket is a request for more query options for TSS...the use case isn't \"arguments[0]\" but rather providing a scope from which the styles can be dynamic.\r\n\r\nAs an idea for the problem you point out above.., instead of arguments[0] ... what if there was a `var __arguments = arguments[0];` put as the first line in the function? That would be assessable inside the closure then. \r\n\r\nWhatever the implementation is...the request is to allow arguments passed in a controller to determine tss styles.", "updateAuthor": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "created": "2014-10-03T20:07:03.000+0000", "updated": "2014-10-03T20:07:03.000+0000" }, { "id": "327022", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "Reopening. I might be able to satisfy both this and ALOY-1037 with the same additions to the Controller() definition.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-10-06T16:03:06.000+0000", "updated": "2014-10-06T16:03:06.000+0000" }, { "id": "327051", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "PR https://github.com/appcelerator/alloy/pull/584 \r\n\r\nFunctional test: run the included ALOY\\-1092 test app. Click the \"Tap for new window\" label. In the resulting window should be two labels, one saying the passed property was truthy and the other is present. Edit index.js and change the someProperty argument value to false and rebuild. This time, the child window will have just the first label saying the parameter was falsey.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-10-06T19:20:52.000+0000", "updated": "2014-10-06T19:20:52.000+0000" }, { "id": "327109", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "PR merged.", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2014-10-07T04:17:24.000+0000", "updated": "2014-10-07T04:17:24.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }