{ "id": "136987", "key": "ALOY-1146", "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": "15909", "description": "Alloy 1.5.0", "name": "Alloy 1.5.0", "archived": false, "released": true, "releaseDate": "2014-09-29" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-09-26T20:22:24.000+0000", "created": "2014-09-23T00:48:47.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "qe-3.4.0", "qe-manualtest", "regression" ], "versions": [ { "id": "15909", "description": "Alloy 1.5.0", "name": "Alloy 1.5.0", "archived": false, "released": true, "releaseDate": "2014-09-29" } ], "issuelinks": [ { "id": "41467", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "136876", "key": "ALOY-1144", "fields": { "summary": "Alloy: createStyle turns proxy objects into JS objects", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "41466", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "131639", "key": "ALOY-1051", "fields": { "summary": "Font properties not properly merged when using dynamic styles", "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-11-20T22:16:06.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": [], "description": "h5. Problem description\r\nUsing Dynamic Styles classes, some properties of Picker objects are not returned correctly. \r\nIt might be related to the fix introduced for ALOY-1051 (and eventually in PR501 for ALOY-1144), as is not reproducible using Alloy 1.4.1 and 1.5.0-rc3, but is reproducible using Alloy versions 1.5.0-rc4 and 1.5.0-rc (or 1.5.0-dev). \r\n\r\nh5. Steps to reproduce\r\n1. Run the attached sample code\r\n2. Click on the 'Hello World' label and check console log\r\n\r\nResult: \r\n{code}\r\nTi.API.info(JSON.stringify($.createStyle({\r\n\t\tclasses:['test', \"pickerClass\"]\r\n\t})));\r\n{code}\r\n\r\nshould return:{code}\r\n{\"type\":1,\"minDate\":\"2012-01-01T00:00:00.000Z\",\"maxDate\":\"2014-05-01T19:00:00.000Z\",\"value\":\"2014-04-15T19:00:00.000Z\",\"classes\":[\"test\",\"pickerClass\"]}\r\n{code}\r\n(and that is what is being returned using 1.4.1 and 1.5.0-rc3)\r\n\r\ninstead, using Alloy 1.5.0-rc or 1.5.0-rc4, it returns:\r\n{code}\r\n{\"type\":1,\"minDate\":{},\"maxDate\":{},\"value\":{},\"classes\":[\"test\",\"pickerClass\"]}\r\n{code}", "attachment": [ { "id": "51501", "filename": "PickerProperties_dynamicStyles.zip", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-23T00:48:47.000+0000", "size": 10393171, "mimeType": "application/zip" } ], "flagged": false, "summary": "Picker values are not correctly returned using Dynamic Styles", "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": "TiSDK 3.4.0.v20140922070914 \r\nAppcelerator Studio 3.4.0.201409161950\r\nCLI 3.4.0-rc4\r\nAlloy 1.5.0-rc4 & 1.5.0-rc\r\nXcode6", "closedSprints": [ { "id": 217, "state": "closed", "name": "2014 Sprint 19 Alloy", "startDate": "2014-09-15T12:45:43.956Z", "endDate": "2014-09-29T12:45:00.000Z", "completeDate": "2014-09-29T13:30:39.342Z", "originBoardId": 124 } ], "comment": { "comments": [ { "id": "325123", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "..", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-09-23T11:48:35.000+0000", "updated": "2014-09-23T11:49:14.000+0000" }, { "id": "325125", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "With RC4 the alert/info statements show:\r\n\r\n* the properly merged properties for the dynamic style based on the family & size classes\r\n* incompletely merged properties for the dynamic style based on the test & pickerClass classes\r\n* the properly merged properties for the dynamic style based on the test2 & viewClass classes\r\n\r\n{code}\r\n[INFO] {\"font\":{\"fontFamily\":\"AmericanTypewriter\",\"fontSize\":50},\"duration\":1000,\"classes\":[\"family\",\"size\"]}\r\n[INFO] {\"type\":1,\"minDate\":{},\"maxDate\":{},\"value\":{},\"classes\":[\"test\",\"pickerClass\"]}\r\n[INFO] {\"type\":1,\"id\":\"pickerTest\",\"value\":\"2014-04-15T16:00:00.000Z\",\"horizontalWrap\":true,\"minDate\":\"2012-01-01T00:00:00.000Z\",\"columns\":[],\"maxDate\":\"2014-05-01T16:00:00.000Z\"}\r\n[INFO] {\"backgroundColor\":\"blue\",\"width\":\"90%\",\"height\":50,\"bottom\":0,\"pippo\":\"tanto pippo test, 22343\",\"classes\":[\"test2\",\"viewClass\"]}\r\n{code}\r\n\r\nWith RC3, the alert/info statements show:\r\n\r\n* incompletely merged properties for the dynamic style based on the family & size classes\r\n* the properly merged properties for the dynamic style based on the test & pickerClass classes\r\n* the properly merged properties for the dynamic style based on the test2 & viewClass classes\r\n\r\n{code}\r\n[INFO] {\"font\":{\"fontSize\":50},\"duration\":1000,\"classes\":[\"family\",\"size\"]}\r\n[INFO] {\"type\":1,\"minDate\":\"2012-01-01T00:00:00.000Z\",\"maxDate\":\"2014-05-01T16:00:00.000Z\",\"value\":\"2014-04-15T16:00:00.000Z\",\"classes\":[\"test\",\"pickerClass\"]}\r\n[INFO] {\"type\":1,\"id\":\"pickerTest\",\"value\":\"2014-04-15T16:00:00.000Z\",\"horizontalWrap\":true,\"minDate\":\"2012-01-01T00:00:00.000Z\",\"columns\":[],\"maxDate\":\"2014-05-01T16:00:00.000Z\"}\r\n[INFO] {\"backgroundColor\":\"blue\",\"width\":\"90%\",\"height\":50,\"bottom\":0,\"pippo\":\"tanto pippo test, 22343\",\"classes\":[\"test2\",\"viewClass\"]}\r\n{code}\r\n\r\nThe pickerClass class would generate JavaScript Date objects, which would be evaluated when the info/alert methods are run. The {{JSON.stringify()}} method returns {{null}} for objects with methods, which would include those Date objects. This is most likely the reason for the different output. \r\n", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-09-23T12:16:07.000+0000", "updated": "2014-09-23T12:16:07.000+0000" }, { "id": "325127", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "I think there *is* an issue with Date objects, which can be fixed by:\r\n\r\n{code}\r\n..\r\n if (_.isDate(copy)) {\r\n clone = new Date(copy.valueOf());\r\n\r\n // Recurse if we're merging plain objects or arrays\r\n } else if (deep && copy && ((_.isObject(copy) && typeof copy.apiName !== 'string') || (copy_is_array = _.isArray(copy)))) {\r\n..\r\n{code}", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-09-23T12:35:59.000+0000", "updated": "2014-09-23T12:35:59.000+0000" }, { "id": "325153", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Which can be fixed by my comment above yours.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-09-23T15:26:59.000+0000", "updated": "2014-09-23T15:26:59.000+0000" }, { "id": "325162", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "PRs:\r\n\r\n1_5_X -- https://github.com/appcelerator/alloy/pull/572\r\nmaster -- https://github.com/appcelerator/alloy/pull/573\r\n\r\nFunctional tests:\r\n\r\n* Run the attached app & follow steps to reproduce. The app should output the expected values\r\n* Run the ALOY\\-1051 test app. Clicking the label should alert the properly merged style values\r\n* Run the advanced/complex_styling app and all font styles should be properly merged and displayed", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-09-23T15:49:49.000+0000", "updated": "2014-09-23T15:49:49.000+0000" }, { "id": "325217", "author": { "name": "pinnamuri", "key": "pinnamuri", "displayName": "Praveen Innamuri", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Merged PRs.", "updateAuthor": { "name": "pinnamuri", "key": "pinnamuri", "displayName": "Praveen Innamuri", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-09-23T18:26:32.000+0000", "updated": "2014-09-23T18:26:32.000+0000" }, { "id": "325345", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "Merged PRs: \r\nMaster: https://github.com/appcelerator/alloy/pull/575 \r\n1_5_X: https://github.com/appcelerator/alloy/pull/576", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2014-09-24T02:48:16.000+0000", "updated": "2014-09-24T02:48:16.000+0000" }, { "id": "325413", "author": { "name": "vchidambaram", "key": "vchidambaram", "displayName": "Visalakshi Chidambaram", "active": true, "timeZone": "Asia/Shanghai" }, "body": "When I run the attached project now with alloy 1.5.0 -rc4 taken from : git://github.com/appcelerator/alloy.git#1_5_X \r\nI am able to see the following result:\r\n{code}\r\n\r\n[INFO] : {\"font\":{\"fontFamily\":\"AmericanTypewriter\",\"fontSize\":50},\"duration\":1000,\"classes\":[\"family\",\"size\"]}\r\n[INFO] : {\"type\":1,\"minDate\":\"2012-01-01T00:00:00.000Z\",\"maxDate\":\"2014-05-01T04:00:00.000Z\",\"value\":\"2014-04-15T04:00:00.000Z\",\"classes\":[\"test\",\"pickerClass\"]}\r\n[INFO] : {\"type\":1,\"id\":\"pickerTest\",\"value\":\"2014-04-15T04:00:00.000Z\",\"horizontalWrap\":true,\"minDate\":\"2012-01-01T00:00:00.000Z\",\"columns\":[],\"maxDate\":\"2014-05-01T04:00:00.000Z\"}\r\n[INFO] : {\"backgroundColor\":\"blue\",\"width\":\"90%\",\"height\":50,\"bottom\":0,\"pippo\":\"tanto pippo test, 22343\",\"classes\":[\"test2\",\"viewClass\"]}\r\n\r\n{code}\r\n\r\nHence, able to see the expected results.", "updateAuthor": { "name": "vchidambaram", "key": "vchidambaram", "displayName": "Visalakshi Chidambaram", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2014-09-24T10:51:19.000+0000", "updated": "2014-09-24T10:51:19.000+0000" }, { "id": "325566", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed. \r\n\r\nTiSDK 3.4.0.v20140924140915 \r\nAppcelerator Studio 3.4.0.201409231834\r\nCLI 3.4.0-rc4\r\nAlloy 1.5.0-rc4\r\nXcode6\r\n\r\niPad mini & iPhone 5 (iOS 8) and Android Galaxy Nexus 4.3\r\n\r\nClosing.", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-25T01:43:16.000+0000", "updated": "2014-09-25T01:44:34.000+0000" }, { "id": "325900", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "Added story points", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-09-26T20:22:24.000+0000", "updated": "2014-09-26T20:22:24.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }