Merge lp:~aacid/unity8/noTemplateInGeneratedCardCreatorCode into lp:unity8
- noTemplateInGeneratedCardCreatorCode
- Merge into trunk
| Status: | Merged |
|---|---|
| Approved by: | Andrea Cimitan on 2015-05-20 |
| Approved revision: | 1779 |
| Merged at revision: | 1815 |
| Proposed branch: | lp:~aacid/unity8/noTemplateInGeneratedCardCreatorCode |
| Merge into: | lp:unity8 |
| Diff against target: |
484 lines (+75/-72) 18 files modified
plugins/Dash/CardCreator.js (+22/-10) qml/Dash/CardCarousel.qml (+0/-1) qml/Dash/CardGrid.qml (+0/-1) qml/Dash/CardHorizontalList.qml (+0/-1) qml/Dash/CardTool.qml (+16/-15) qml/Dash/CardVerticalJournal.qml (+0/-1) tests/plugins/Dash/cardcreator/1.res (+1/-2) tests/plugins/Dash/cardcreator/2.res (+3/-8) tests/plugins/Dash/cardcreator/3.res (+1/-2) tests/plugins/Dash/cardcreator/4.res (+1/-2) tests/plugins/Dash/cardcreator/5.res (+1/-2) tests/plugins/Dash/cardcreator/5.tst (+1/-1) tests/plugins/Dash/cardcreator/6.res (+3/-8) tests/plugins/Dash/cardcreator/6.tst (+1/-1) tests/plugins/Dash/cardcreator/7.res (+3/-8) tests/plugins/Dash/cardcreator/7.tst (+1/-1) tests/qmltests/Dash/tst_Card.qml (+0/-1) tests/qmltests/Dash/tst_GenericScopeView.qml (+21/-7) |
| To merge this branch: | bzr merge lp:~aacid/unity8/noTemplateInGeneratedCardCreatorCode |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Andrea Cimitan (community) | 2015-05-13 | Approve on 2015-05-20 | |
| PS Jenkins bot | continuous-integration | 2015-05-13 | Needs Fixing on 2015-05-13 |
|
Review via email:
|
|||
Commit Message
Do not use template in generated card creator code
We can resolve it while doing the code generation
Description of the Change
* Are there any related MPs required for this MP to build/function as expected? Please list.
The prerequisite
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
* Did you make sure that your branch does not contain spurious tags?
Yes
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A
* If you changed the UI, has there been a design review?
N/A
- 1779. By Albert Astals Cid on 2015-05-20
-
Style fixes
| Andrea Cimitan (cimi) wrote : | # |
* Did you perform an exploratory manual test run of the code change and any related functionality?
Yes
* Did CI run pass? If not, please explain why.
AP
* Did you make sure that the branch does not contain spurious tags?
yes
Preview Diff
| 1 | === modified file 'plugins/Dash/CardCreator.js' |
| 2 | --- plugins/Dash/CardCreator.js 2015-04-28 08:45:15 +0000 |
| 3 | +++ plugins/Dash/CardCreator.js 2015-05-20 14:40:37 +0000 |
| 4 | @@ -16,6 +16,9 @@ |
| 5 | |
| 6 | .pragma library |
| 7 | |
| 8 | +// %1 is the template["card-background"] string |
| 9 | +// %2 is the template["card-background"]["elements"][0] |
| 10 | +// %3 is the template["card-background"]["elements"][1] |
| 11 | var kBackgroundLoaderCode = 'Loader {\n\ |
| 12 | id: backgroundLoader; \n\ |
| 13 | objectName: "backgroundLoader"; \n\ |
| 14 | @@ -34,18 +37,14 @@ |
| 15 | objectName: "backgroundImage"; \n\ |
| 16 | source: { \n\ |
| 17 | if (cardData && typeof cardData["background"] === "string") return cardData["background"]; \n\ |
| 18 | - else if (template && typeof template["card-background"] === "string") return template["card-background"]; \n\ |
| 19 | - else return ""; \n\ |
| 20 | + else return "%1"; \n\ |
| 21 | } \n\ |
| 22 | } \n\ |
| 23 | function getColor(index) { \n\ |
| 24 | if (cardData && typeof cardData["background"] === "object" \n\ |
| 25 | && (cardData["background"]["type"] === "color" || cardData["background"]["type"] === "gradient")) { \n\ |
| 26 | return cardData["background"]["elements"][index]; \n\ |
| 27 | - } else if (template && typeof template["card-background"] === "object" \n\ |
| 28 | - && (template["card-background"]["type"] === "color" || template["card-background"]["type"] === "gradient")) { \n\ |
| 29 | - return template["card-background"]["elements"][index]; \n\ |
| 30 | - } else return undefined; \n\ |
| 31 | + } else return index === 0 ? %2 : %3; \n\ |
| 32 | } \n\ |
| 33 | } \n\ |
| 34 | }\n'; |
| 35 | @@ -315,9 +314,11 @@ |
| 36 | |
| 37 | function cardString(template, components) { |
| 38 | var code; |
| 39 | + |
| 40 | + var templateInteractive = (template == null ? true : (template["non-interactive"] !== undefined ? !template["non-interactive"] : true)) ? "true" : "false"; |
| 41 | + |
| 42 | code = 'AbstractButton { \n\ |
| 43 | id: root; \n\ |
| 44 | - property var template; \n\ |
| 45 | property var components; \n\ |
| 46 | property var cardData; \n\ |
| 47 | property var artShapeBorderSource: undefined; \n\ |
| 48 | @@ -330,8 +331,8 @@ |
| 49 | property bool asynchronous: true; \n\ |
| 50 | property bool showHeader: true; \n\ |
| 51 | implicitWidth: childrenRect.width; \n\ |
| 52 | - enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true); \n\ |
| 53 | - \n'; |
| 54 | + enabled: %1; \n\ |
| 55 | + \n'.arg(templateInteractive); |
| 56 | |
| 57 | var hasArt = components["art"] && components["art"]["field"] || false; |
| 58 | var hasSummary = components["summary"] || false; |
| 59 | @@ -348,7 +349,18 @@ |
| 60 | var hasAttributes = hasTitle && components["attributes"]["field"] || false; |
| 61 | |
| 62 | if (hasBackground) { |
| 63 | - code += kBackgroundLoaderCode; |
| 64 | + var templateCardBackground = (template && typeof template["card-background"] === "string") ? template["card-background"] : ""; |
| 65 | + var backgroundElements0; |
| 66 | + var backgroundElements1; |
| 67 | + if (template && typeof template["card-background"] === "object" && (template["card-background"]["type"] === "color" || template["card-background"]["type"] === "gradient")) { |
| 68 | + if (template["card-background"]["elements"][0] !== undefined) { |
| 69 | + backgroundElements0 = '"%1"'.arg(template["card-background"]["elements"][0]); |
| 70 | + } |
| 71 | + if (template["card-background"]["elements"][1] !== undefined) { |
| 72 | + backgroundElements1 = '"%1"'.arg(template["card-background"]["elements"][1]); |
| 73 | + } |
| 74 | + } |
| 75 | + code += kBackgroundLoaderCode.arg(templateCardBackground).arg(backgroundElements0).arg(backgroundElements1); |
| 76 | } |
| 77 | |
| 78 | if (hasArt) { |
| 79 | |
| 80 | === modified file 'qml/Dash/CardCarousel.qml' |
| 81 | --- qml/Dash/CardCarousel.qml 2015-01-14 09:51:39 +0000 |
| 82 | +++ qml/Dash/CardCarousel.qml 2015-05-20 14:40:37 +0000 |
| 83 | @@ -61,7 +61,6 @@ |
| 84 | item.fixedHeaderHeight = Qt.binding(function() { return carousel.headerHeight; }); |
| 85 | item.height = Qt.binding(function() { return cardTool.cardHeight; }); |
| 86 | item.cardData = Qt.binding(function() { return model; }); |
| 87 | - item.template = Qt.binding(function() { return cardTool.template; }); |
| 88 | item.components = Qt.binding(function() { return cardTool.components; }); |
| 89 | item.fontScale = Qt.binding(function() { return carousel.fontScale; }); |
| 90 | item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; }); |
| 91 | |
| 92 | === modified file 'qml/Dash/CardGrid.qml' |
| 93 | --- qml/Dash/CardGrid.qml 2014-11-12 09:41:26 +0000 |
| 94 | +++ qml/Dash/CardGrid.qml 2015-05-20 14:40:37 +0000 |
| 95 | @@ -66,7 +66,6 @@ |
| 96 | item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; }); |
| 97 | item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; }); |
| 98 | item.cardData = Qt.binding(function() { return model; }); |
| 99 | - item.template = Qt.binding(function() { return cardTool.template; }); |
| 100 | item.components = Qt.binding(function() { return cardTool.components; }); |
| 101 | item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; }); |
| 102 | item.scopeStyle = root.scopeStyle; |
| 103 | |
| 104 | === modified file 'qml/Dash/CardHorizontalList.qml' |
| 105 | --- qml/Dash/CardHorizontalList.qml 2015-01-14 09:51:39 +0000 |
| 106 | +++ qml/Dash/CardHorizontalList.qml 2015-05-20 14:40:37 +0000 |
| 107 | @@ -53,7 +53,6 @@ |
| 108 | item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; }); |
| 109 | item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; }); |
| 110 | item.cardData = Qt.binding(function() { return model; }); |
| 111 | - item.template = Qt.binding(function() { return cardTool.template; }); |
| 112 | item.components = Qt.binding(function() { return cardTool.components; }); |
| 113 | item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; }); |
| 114 | item.scopeStyle = root.scopeStyle; |
| 115 | |
| 116 | === modified file 'qml/Dash/CardTool.qml' |
| 117 | --- qml/Dash/CardTool.qml 2014-11-18 12:07:36 +0000 |
| 118 | +++ qml/Dash/CardTool.qml 2015-05-20 14:40:37 +0000 |
| 119 | @@ -198,8 +198,8 @@ |
| 120 | |
| 121 | Loader { |
| 122 | id: cardLoader |
| 123 | - property var fields: ["art", "mascot", "title", "subtitle", "summary", "attributes"] |
| 124 | - property var maxData: { |
| 125 | + readonly property var fields: ["art", "mascot", "title", "subtitle", "summary", "attributes"] |
| 126 | + readonly property var maxData: { |
| 127 | "art": Qt.resolvedUrl("graphics/pixel.png"), |
| 128 | "mascot": Qt.resolvedUrl("graphics/pixel.png"), |
| 129 | "title": "ā\nā", |
| 130 | @@ -211,26 +211,27 @@ |
| 131 | onLoaded: { |
| 132 | item.objectName = "cardToolCard"; |
| 133 | item.asynchronous = false; |
| 134 | - item.template = Qt.binding(function() { return cardTool.template; }); |
| 135 | item.components = Qt.binding(function() { return cardTool.components; }); |
| 136 | item.width = Qt.binding(function() { return cardTool.cardWidth || item.implicitWidth; }); |
| 137 | item.height = Qt.binding(function() { return cardTool.cardHeight || item.implicitHeight; }); |
| 138 | } |
| 139 | Connections { |
| 140 | - target: cardLoader.item |
| 141 | - onComponentsChanged: { |
| 142 | - var data = {}; |
| 143 | - for (var k in cardLoader.fields) { |
| 144 | - var component = cardLoader.item.components[cardLoader.fields[k]]; |
| 145 | - var key = cardLoader.fields[k]; |
| 146 | - if ((typeof component === "string" && component.length > 0) || |
| 147 | - (typeof component === "object" && component !== null |
| 148 | - && typeof component["field"] === "string" && component["field"].length > 0)) { |
| 149 | - data[key] = cardLoader.maxData[key]; |
| 150 | - } |
| 151 | + target: cardTool |
| 152 | + onTemplateChanged: cardLoader.updateCardData(); |
| 153 | + onComponentsChanged: cardLoader.updateCardData(); |
| 154 | + } |
| 155 | + function updateCardData() { |
| 156 | + var data = {}; |
| 157 | + for (var k in fields) { |
| 158 | + var component = cardTool.components[fields[k]]; |
| 159 | + var key = fields[k]; |
| 160 | + if ((typeof component === "string" && component.length > 0) || |
| 161 | + (typeof component === "object" && component !== null |
| 162 | + && typeof component["field"] === "string" && component["field"].length > 0)) { |
| 163 | + data[key] = maxData[key]; |
| 164 | } |
| 165 | - cardLoader.item.cardData = data; |
| 166 | } |
| 167 | + item.cardData = data; |
| 168 | } |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | === modified file 'qml/Dash/CardVerticalJournal.qml' |
| 173 | --- qml/Dash/CardVerticalJournal.qml 2014-11-07 16:16:12 +0000 |
| 174 | +++ qml/Dash/CardVerticalJournal.qml 2015-05-20 14:40:37 +0000 |
| 175 | @@ -72,7 +72,6 @@ |
| 176 | item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; }); |
| 177 | item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; }); |
| 178 | item.cardData = Qt.binding(function() { return model; }); |
| 179 | - item.template = Qt.binding(function() { return cardTool.template; }); |
| 180 | item.components = Qt.binding(function() { return cardTool.components; }); |
| 181 | item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; }); |
| 182 | item.scopeStyle = root.scopeStyle; |
| 183 | |
| 184 | === modified file 'tests/plugins/Dash/cardcreator/1.res' |
| 185 | --- tests/plugins/Dash/cardcreator/1.res 2015-04-28 08:45:15 +0000 |
| 186 | +++ tests/plugins/Dash/cardcreator/1.res 2015-05-20 14:40:37 +0000 |
| 187 | @@ -1,6 +1,5 @@ |
| 188 | AbstractButton { |
| 189 | id: root; |
| 190 | - property var template; |
| 191 | property var components; |
| 192 | property var cardData; |
| 193 | property var artShapeBorderSource: undefined; |
| 194 | @@ -13,7 +12,7 @@ |
| 195 | property bool asynchronous: true; |
| 196 | property bool showHeader: true; |
| 197 | implicitWidth: childrenRect.width; |
| 198 | - enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true); |
| 199 | + enabled: true; |
| 200 | |
| 201 | onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; } |
| 202 | readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1); |
| 203 | |
| 204 | === modified file 'tests/plugins/Dash/cardcreator/2.res' |
| 205 | --- tests/plugins/Dash/cardcreator/2.res 2015-02-17 11:42:03 +0000 |
| 206 | +++ tests/plugins/Dash/cardcreator/2.res 2015-05-20 14:40:37 +0000 |
| 207 | @@ -1,6 +1,5 @@ |
| 208 | AbstractButton { |
| 209 | id: root; |
| 210 | - property var template; |
| 211 | property var components; |
| 212 | property var cardData; |
| 213 | property var artShapeBorderSource: undefined; |
| 214 | @@ -13,7 +12,7 @@ |
| 215 | property bool asynchronous: true; |
| 216 | property bool showHeader: true; |
| 217 | implicitWidth: childrenRect.width; |
| 218 | - enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true); |
| 219 | + enabled: true; |
| 220 | |
| 221 | Loader { |
| 222 | id: backgroundLoader; |
| 223 | @@ -33,18 +32,14 @@ |
| 224 | objectName: "backgroundImage"; |
| 225 | source: { |
| 226 | if (cardData && typeof cardData["background"] === "string") return cardData["background"]; |
| 227 | - else if (template && typeof template["card-background"] === "string") return template["card-background"]; |
| 228 | - else return ""; |
| 229 | + else return ""; |
| 230 | } |
| 231 | } |
| 232 | function getColor(index) { |
| 233 | if (cardData && typeof cardData["background"] === "object" |
| 234 | && (cardData["background"]["type"] === "color" || cardData["background"]["type"] === "gradient")) { |
| 235 | return cardData["background"]["elements"][index]; |
| 236 | - } else if (template && typeof template["card-background"] === "object" |
| 237 | - && (template["card-background"]["type"] === "color" || template["card-background"]["type"] === "gradient")) { |
| 238 | - return template["card-background"]["elements"][index]; |
| 239 | - } else return undefined; |
| 240 | + } else return index === 0 ? "#E9E9E9" : undefined; |
| 241 | } |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | === modified file 'tests/plugins/Dash/cardcreator/3.res' |
| 246 | --- tests/plugins/Dash/cardcreator/3.res 2015-04-28 08:45:15 +0000 |
| 247 | +++ tests/plugins/Dash/cardcreator/3.res 2015-05-20 14:40:37 +0000 |
| 248 | @@ -1,6 +1,5 @@ |
| 249 | AbstractButton { |
| 250 | id: root; |
| 251 | - property var template; |
| 252 | property var components; |
| 253 | property var cardData; |
| 254 | property var artShapeBorderSource: undefined; |
| 255 | @@ -13,7 +12,7 @@ |
| 256 | property bool asynchronous: true; |
| 257 | property bool showHeader: true; |
| 258 | implicitWidth: childrenRect.width; |
| 259 | - enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true); |
| 260 | + enabled: true; |
| 261 | |
| 262 | onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; } |
| 263 | readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1); |
| 264 | |
| 265 | === modified file 'tests/plugins/Dash/cardcreator/4.res' |
| 266 | --- tests/plugins/Dash/cardcreator/4.res 2015-02-17 11:42:03 +0000 |
| 267 | +++ tests/plugins/Dash/cardcreator/4.res 2015-05-20 14:40:37 +0000 |
| 268 | @@ -1,6 +1,5 @@ |
| 269 | AbstractButton { |
| 270 | id: root; |
| 271 | - property var template; |
| 272 | property var components; |
| 273 | property var cardData; |
| 274 | property var artShapeBorderSource: undefined; |
| 275 | @@ -13,7 +12,7 @@ |
| 276 | property bool asynchronous: true; |
| 277 | property bool showHeader: true; |
| 278 | implicitWidth: childrenRect.width; |
| 279 | - enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true); |
| 280 | + enabled: true; |
| 281 | |
| 282 | readonly property size artShapeSize: Qt.size(-1, -1); |
| 283 | readonly property int headerHeight: row.height; |
| 284 | |
| 285 | === modified file 'tests/plugins/Dash/cardcreator/5.res' |
| 286 | --- tests/plugins/Dash/cardcreator/5.res 2015-04-28 08:45:15 +0000 |
| 287 | +++ tests/plugins/Dash/cardcreator/5.res 2015-05-20 14:40:37 +0000 |
| 288 | @@ -1,6 +1,5 @@ |
| 289 | AbstractButton { |
| 290 | id: root; |
| 291 | - property var template; |
| 292 | property var components; |
| 293 | property var cardData; |
| 294 | property var artShapeBorderSource: undefined; |
| 295 | @@ -13,7 +12,7 @@ |
| 296 | property bool asynchronous: true; |
| 297 | property bool showHeader: true; |
| 298 | implicitWidth: childrenRect.width; |
| 299 | - enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true); |
| 300 | + enabled: false; |
| 301 | |
| 302 | onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; } |
| 303 | readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1); |
| 304 | |
| 305 | === modified file 'tests/plugins/Dash/cardcreator/5.tst' |
| 306 | --- tests/plugins/Dash/cardcreator/5.tst 2014-08-08 08:54:12 +0000 |
| 307 | +++ tests/plugins/Dash/cardcreator/5.tst 2015-05-20 14:40:37 +0000 |
| 308 | @@ -1,3 +1,3 @@ |
| 309 | -template: {"card-layout":"vertical","card-size":"medium","category-layout":"carousel","collapsed-rows":2,"overlay":true} |
| 310 | +template: {"non-interactive":true,"card-layout":"vertical","card-size":"medium","category-layout":"carousel","collapsed-rows":2,"overlay":true} |
| 311 | components: {"art":{"aspect-ratio":1,"field":"art"},"subtitle":{"field":"artist"},"title":{"field":"title"},"attributes":{}} |
| 312 | result: 5.res |
| 313 | |
| 314 | === modified file 'tests/plugins/Dash/cardcreator/6.res' |
| 315 | --- tests/plugins/Dash/cardcreator/6.res 2015-02-24 10:16:09 +0000 |
| 316 | +++ tests/plugins/Dash/cardcreator/6.res 2015-05-20 14:40:37 +0000 |
| 317 | @@ -1,6 +1,5 @@ |
| 318 | AbstractButton { |
| 319 | id: root; |
| 320 | - property var template; |
| 321 | property var components; |
| 322 | property var cardData; |
| 323 | property var artShapeBorderSource: undefined; |
| 324 | @@ -13,7 +12,7 @@ |
| 325 | property bool asynchronous: true; |
| 326 | property bool showHeader: true; |
| 327 | implicitWidth: childrenRect.width; |
| 328 | - enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true); |
| 329 | + enabled: true; |
| 330 | |
| 331 | Loader { |
| 332 | id: backgroundLoader; |
| 333 | @@ -33,18 +32,14 @@ |
| 334 | objectName: "backgroundImage"; |
| 335 | source: { |
| 336 | if (cardData && typeof cardData["background"] === "string") return cardData["background"]; |
| 337 | - else if (template && typeof template["card-background"] === "string") return template["card-background"]; |
| 338 | - else return ""; |
| 339 | + else return "http://assets.ubuntu.com/sites/ubuntu/latest/u/img/logos/logo-ubuntu-grey.png"; |
| 340 | } |
| 341 | } |
| 342 | function getColor(index) { |
| 343 | if (cardData && typeof cardData["background"] === "object" |
| 344 | && (cardData["background"]["type"] === "color" || cardData["background"]["type"] === "gradient")) { |
| 345 | return cardData["background"]["elements"][index]; |
| 346 | - } else if (template && typeof template["card-background"] === "object" |
| 347 | - && (template["card-background"]["type"] === "color" || template["card-background"]["type"] === "gradient")) { |
| 348 | - return template["card-background"]["elements"][index]; |
| 349 | - } else return undefined; |
| 350 | + } else return index === 0 ? undefined : undefined; |
| 351 | } |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | === modified file 'tests/plugins/Dash/cardcreator/6.tst' |
| 356 | --- tests/plugins/Dash/cardcreator/6.tst 2014-08-08 08:54:12 +0000 |
| 357 | +++ tests/plugins/Dash/cardcreator/6.tst 2015-05-20 14:40:37 +0000 |
| 358 | @@ -1,3 +1,3 @@ |
| 359 | -template: {"card-background":{"elements":["#E9E9E9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2} |
| 360 | +template: {"card-background":"http://assets.ubuntu.com/sites/ubuntu/latest/u/img/logos/logo-ubuntu-grey.png","card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2} |
| 361 | components: {"art":{"aspect-ratio":1},"background":{"field":"background"},"subtitle":{"field":"author"},"title":{"field":"title"},"emblem":{"field":"source"},"attributes":{}} |
| 362 | result: 6.res |
| 363 | |
| 364 | === modified file 'tests/plugins/Dash/cardcreator/7.res' |
| 365 | --- tests/plugins/Dash/cardcreator/7.res 2015-02-17 11:42:03 +0000 |
| 366 | +++ tests/plugins/Dash/cardcreator/7.res 2015-05-20 14:40:37 +0000 |
| 367 | @@ -1,6 +1,5 @@ |
| 368 | AbstractButton { |
| 369 | id: root; |
| 370 | - property var template; |
| 371 | property var components; |
| 372 | property var cardData; |
| 373 | property var artShapeBorderSource: undefined; |
| 374 | @@ -13,7 +12,7 @@ |
| 375 | property bool asynchronous: true; |
| 376 | property bool showHeader: true; |
| 377 | implicitWidth: childrenRect.width; |
| 378 | - enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true); |
| 379 | + enabled: true; |
| 380 | |
| 381 | Loader { |
| 382 | id: backgroundLoader; |
| 383 | @@ -33,18 +32,14 @@ |
| 384 | objectName: "backgroundImage"; |
| 385 | source: { |
| 386 | if (cardData && typeof cardData["background"] === "string") return cardData["background"]; |
| 387 | - else if (template && typeof template["card-background"] === "string") return template["card-background"]; |
| 388 | - else return ""; |
| 389 | + else return ""; |
| 390 | } |
| 391 | } |
| 392 | function getColor(index) { |
| 393 | if (cardData && typeof cardData["background"] === "object" |
| 394 | && (cardData["background"]["type"] === "color" || cardData["background"]["type"] === "gradient")) { |
| 395 | return cardData["background"]["elements"][index]; |
| 396 | - } else if (template && typeof template["card-background"] === "object" |
| 397 | - && (template["card-background"]["type"] === "color" || template["card-background"]["type"] === "gradient")) { |
| 398 | - return template["card-background"]["elements"][index]; |
| 399 | - } else return undefined; |
| 400 | + } else return index === 0 ? "#E9E9E9" : "#E9AAE9"; |
| 401 | } |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | === modified file 'tests/plugins/Dash/cardcreator/7.tst' |
| 406 | --- tests/plugins/Dash/cardcreator/7.tst 2014-08-01 07:31:07 +0000 |
| 407 | +++ tests/plugins/Dash/cardcreator/7.tst 2015-05-20 14:40:37 +0000 |
| 408 | @@ -1,3 +1,3 @@ |
| 409 | -template: {"card-background":{"elements":["#E9E9E9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2} |
| 410 | +template: {"card-background":{"elements":["#E9E9E9","#E9AAE9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2} |
| 411 | components: {"art":{"aspect-ratio":1},"background":{"field":"background"},"mascot":{"field":"icon"},"subtitle":{"field":"author"},"title":{"field":"title"},"attributes":{"field":"attributes","max-count":2}} |
| 412 | result: 7.res |
| 413 | |
| 414 | === modified file 'tests/qmltests/Dash/tst_Card.qml' |
| 415 | --- tests/qmltests/Dash/tst_Card.qml 2015-01-22 14:53:43 +0000 |
| 416 | +++ tests/qmltests/Dash/tst_Card.qml 2015-05-20 14:40:37 +0000 |
| 417 | @@ -124,7 +124,6 @@ |
| 418 | sourceComponent: cardTool.cardComponent |
| 419 | clip: true |
| 420 | onLoaded: { |
| 421 | - item.template = Qt.binding(function() { return cardTool.template; }); |
| 422 | item.components = Qt.binding(function() { return cardTool.components; }); |
| 423 | item.cardData = Qt.binding(function() { return Helpers.mapData(dataArea.text, cardTool.components, dataError); }); |
| 424 | item.width = Qt.binding(function() { return cardTool.cardWidth || item.implicitWidth; }); |
| 425 | |
| 426 | === modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml' |
| 427 | --- tests/qmltests/Dash/tst_GenericScopeView.qml 2015-03-27 12:30:24 +0000 |
| 428 | +++ tests/qmltests/Dash/tst_GenericScopeView.qml 2015-05-20 14:40:37 +0000 |
| 429 | @@ -302,6 +302,7 @@ |
| 430 | } |
| 431 | |
| 432 | function closePreview() { |
| 433 | + tryCompare(testCase.subPageLoader, "x", 0); |
| 434 | var closePreviewMouseArea = findChild(subPageLoader.item, "pageHeader"); |
| 435 | mouseClick(closePreviewMouseArea, units.gu(2), units.gu(2)); |
| 436 | |
| 437 | @@ -616,27 +617,40 @@ |
| 438 | waitForRendering(category0); |
| 439 | |
| 440 | var cardTool = findChild(category0, "cardTool"); |
| 441 | + cardTool.template["non-interactive"] = true; |
| 442 | + cardTool.templateChanged(); |
| 443 | + |
| 444 | + var category0 = findChild(categoryListView, "dashCategory0"); |
| 445 | + waitForRendering(category0); |
| 446 | + |
| 447 | var cardGrid = category0.item; |
| 448 | - |
| 449 | - cardTool.template["non-interactive"] = true; |
| 450 | compare(cardGrid.cardTool.template["non-interactive"], true); |
| 451 | |
| 452 | var item0 = findChild(cardGrid, "delegate0"); |
| 453 | waitForRendering(item0); |
| 454 | - item0.template = cardTool.template; |
| 455 | - compare(item0.template["non-interactive"], true); |
| 456 | compare(item0.enabled, false); |
| 457 | var touchdown = findChild(item0, "touchdown"); |
| 458 | |
| 459 | compare(touchdown.visible, false); |
| 460 | - mouseClick(item0); |
| 461 | + mousePress(item0); |
| 462 | compare(touchdown.visible, false); |
| 463 | + mouseRelease(item0); |
| 464 | |
| 465 | cardTool.template["non-interactive"] = false; |
| 466 | + cardTool.templateChanged(); |
| 467 | compare(cardGrid.cardTool.template["non-interactive"], false); |
| 468 | - item0.template = cardTool.template; |
| 469 | - compare(item0.template["non-interactive"], false); |
| 470 | + |
| 471 | + waitForRendering(category0); |
| 472 | + item0 = findChild(cardGrid, "delegate0"); |
| 473 | compare(item0.enabled, true); |
| 474 | + var touchdown = findChild(item0, "touchdown"); |
| 475 | + |
| 476 | + compare(touchdown.visible, false); |
| 477 | + mousePress(item0); |
| 478 | + compare(touchdown.visible, true); |
| 479 | + mouseRelease(item0); |
| 480 | + compare(touchdown.visible, false); |
| 481 | + closePreview(); |
| 482 | } |
| 483 | } |
| 484 | } |

FAILED: Continuous integration, rev:1778 jenkins. qa.ubuntu. com/job/ unity8- ci/5719/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- vivid-touch/ 2773 jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- vivid/885 jenkins. qa.ubuntu. com/job/ unity8- vivid-amd64- ci/884 jenkins. qa.ubuntu. com/job/ unity8- vivid-i386- ci/885 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- vivid-mako/ 2389 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 2771 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 2771/artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 20454
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity8- ci/5719/ rebuild
http://