Merge lp:~cimi/unity8/card-social into lp:unity8

Proposed by Andrea Cimitan
Status: Merged
Approved by: Josh Arenson
Approved revision: 2134
Merged at revision: 2383
Proposed branch: lp:~cimi/unity8/card-social
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/valueslider_filter
Diff against target: 1064 lines (+530/-41)
38 files modified
plugins/Dash/CardCreator.js (+44/-1)
plugins/Dash/CardSocialActions.qml (+94/-0)
plugins/Dash/qmldir (+1/-0)
qml/Dash/CardGrid.qml (+1/-0)
qml/Dash/CardHorizontalList.qml (+1/-0)
qml/Dash/CardTool.qml (+23/-7)
qml/Dash/CardVerticalJournal.qml (+1/-0)
qml/Dash/DashRenderer.qml (+6/-0)
qml/Dash/GenericScopeView.qml (+4/-0)
tests/mocks/Unity/fake_categories.cpp (+4/-1)
tests/mocks/Unity/fake_resultsmodel.cpp (+2/-0)
tests/plugins/Dash/cardcreator/1.res (+1/-1)
tests/plugins/Dash/cardcreator/1.res.cardcreator (+1/-1)
tests/plugins/Dash/cardcreator/10.res (+1/-1)
tests/plugins/Dash/cardcreator/10.res.cardcreator (+1/-1)
tests/plugins/Dash/cardcreator/11.res (+1/-1)
tests/plugins/Dash/cardcreator/11.res.cardcreator (+1/-1)
tests/plugins/Dash/cardcreator/12.res (+139/-0)
tests/plugins/Dash/cardcreator/12.res.cardcreator (+138/-0)
tests/plugins/Dash/cardcreator/12.tst (+3/-0)
tests/plugins/Dash/cardcreator/2.res (+1/-1)
tests/plugins/Dash/cardcreator/2.res.cardcreator (+1/-1)
tests/plugins/Dash/cardcreator/3.res (+1/-1)
tests/plugins/Dash/cardcreator/3.res.cardcreator (+1/-1)
tests/plugins/Dash/cardcreator/4.res (+1/-1)
tests/plugins/Dash/cardcreator/4.res.cardcreator (+1/-1)
tests/plugins/Dash/cardcreator/5.res (+1/-1)
tests/plugins/Dash/cardcreator/5.res.cardcreator (+1/-1)
tests/plugins/Dash/cardcreator/6.res (+1/-1)
tests/plugins/Dash/cardcreator/6.res.cardcreator (+1/-1)
tests/plugins/Dash/cardcreator/7.res (+1/-1)
tests/plugins/Dash/cardcreator/7.res.cardcreator (+1/-1)
tests/plugins/Dash/cardcreator/8.res (+1/-1)
tests/plugins/Dash/cardcreator/8.res.cardcreator (+1/-1)
tests/plugins/Dash/cardcreator/9.res (+1/-1)
tests/plugins/Dash/cardcreator/9.res.cardcreator (+1/-1)
tests/qmltests/Dash/CardHelpers.js (+9/-7)
tests/qmltests/Dash/tst_Card.qml (+38/-3)
To merge this branch: bzr merge lp:~cimi/unity8/card-social
Reviewer Review Type Date Requested Status
Josh Arenson Approve
Unity8 CI Bot continuous-integration Needs Fixing
Albert Astals Cid Pending
PS Jenkins bot continuous-integration Pending
Review via email: mp+289663@code.launchpad.net

This proposal supersedes a proposal from 2016-03-07.

Commit message

Add social actions to cards

Description of the change

* Are there any related MPs required for this MP to build/function as expected? Please list.
yes
https://code.launchpad.net/~stolowski/unity-scopes-shell/social-attributes/+merge/289164
https://code.launchpad.net/~stolowski/unity-api/social-attributes-role/+merge/289165
 * Did you perform an exploratory manual test run of your code change and any related functionality?
will with silo, locally tested with mocks
 * Did you make sure that your branch does not contain spurious tags?
y
 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
ye
 * If you changed the UI, has there been a design review?
y

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

columns: width > units.gu(12) ? 4 : 2

where does this units.gu(12) come from?

review: Needs Information
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2115
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~cimi/unity8/card-social/+merge/285769/+edit-commit-message

https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/332/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/454/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/477
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/495
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/495
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/491
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/491/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/491/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/491
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/491/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/491/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/491
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/491/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/491/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/332/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote : Posted in a previous version of this proposal

14 gu is a small card in CardTool, minus the 1gu*2 per side.... we want
just small cards to have 4 columns
> Review: Needs Information
>
> columns: width > units.gu(12) ? 4 : 2
>
> where does this units.gu(12) come from?

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2115
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~cimi/unity8/card-social/+merge/285769/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/unity8-ci/7267/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6429
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/682/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1972
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/675
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1867
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1867
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/674
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/673
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4921
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6440
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6440/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27505
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/351/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/680
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/680/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27506

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/7267/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2116
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~cimi/unity8/card-social/+merge/285769/+edit-commit-message

https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/364/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/497
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay/149
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial/149
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/520
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/538
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/538
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/534
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/534/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/534
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/534/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/534
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/534/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/534
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/534/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/534
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/534/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/534
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/534/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/364/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2116
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~cimi/unity8/card-social/+merge/285769/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/unity8-ci/7302/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6492
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/717/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/2007
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/710
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1902
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1902
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/709
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/708
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4957
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6503
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6503/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27619
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/367/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/715
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/715/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27618

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/7302/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2118
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~cimi/unity8/card-social/+merge/285769/+edit-commit-message

https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/365/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/498
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay/150
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial/150
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/521
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/539
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/539
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/535
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/535/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/535
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/535/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/535
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/535/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/535
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/535/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/535
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/535/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/535
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/535/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/365/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2118
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~cimi/unity8/card-social/+merge/285769/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/unity8-ci/7308/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6499
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/723/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/2013
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/716
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1908
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1908
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/715
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/714
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4963
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6510
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6510/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27631
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/372/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/721
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/721/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27630

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/7308/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

Need commit message and description

review: Needs Fixing
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2119
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~cimi/unity8/card-social/+merge/285769/+edit-commit-message

https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/562/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/753
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/771
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/771
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/767
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/767/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/767
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/767/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/767
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/767/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/767
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/767/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/767
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/767/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/767
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/767/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/562/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2120
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~cimi/unity8/card-social/+merge/285769/+edit-commit-message

https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/589/
Executed test runs:
    None: https://unity8-jenkins.ubuntu.com/job/lp-generic-update-mp/686/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/782
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/798
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/798

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/589/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2120
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~cimi/unity8/card-social/+merge/285769/+edit-commit-message

https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/591/
Executed test runs:
    None: https://unity8-jenkins.ubuntu.com/job/lp-generic-update-mp/688/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/784
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/800/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/800/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/798/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/798/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/798/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/798/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/798/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/798/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/591/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2123
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/602/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/338
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial,testname=qmluitests.sh/338
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/338
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/793
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/806
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/806
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/808
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/808/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/808
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/808/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/808
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/808/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/808
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/808/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/808
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/808/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/808
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/808/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/602/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

The social actions won't work in a CardCarousel.

Are we OK with that?

review: Needs Information
Revision history for this message
Paweł Stołowski (stolowski) wrote : Posted in a previous version of this proposal

> The social actions won't work in a CardCarousel.
>
> Are we OK with that?

Should be checked with Patricia I think.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

The socialActions contents of 12.tst don't look correct, note that that is components and for components the only thing we care about is whether it exists or not and max-count (i.e. CardTool.qml) so it needs fixing to as not to confuse people of what we expect there.

review: Needs Fixing
Revision history for this message
Andrea Cimitan (cimi) wrote : Posted in a previous version of this proposal

> The socialActions contents of 12.tst don't look correct, note that that is
> components and for components the only thing we care about is whether it
> exists or not and max-count (i.e. CardTool.qml) so it needs fixing to as not
> to confuse people of what we expect there.
oops fixed

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

> > The socialActions contents of 12.tst don't look correct, note that that is
> > components and for components the only thing we care about is whether it
> > exists or not and max-count (i.e. CardTool.qml) so it needs fixing to as not
> > to confuse people of what we expect there.
> oops fixed

I think there's actually the same issue in tests/mocks/Unity/fake_categories.cpp

Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

> > The social actions won't work in a CardCarousel.
> >
> > Are we OK with that?
>
> Should be checked with Patricia I think.

Seems they don't want them on Carousel, so let's filter them out on the CardTool level and write a console.log if we do the filtering so that scope authors can try to figure out why it doesn't work

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

var hasSocialActions = hasTitle && components["socialActions"] || false;

needs to be social-actions

actions["max-count"] needs to die as we discussed some days ago

The cardLoader in CardTool needs to be like http://paste.ubuntu.com/15348262/ since now we can't reuse fields for components and cardDAta keys

You can not use

import "../../../qml/Components/ListItems" as ListItems

in CardSocialActions.qml since you get

file:///usr/lib/arm-linux-gnueabihf/unity8/qml/Dash/CardCreator.js:943: Error: Qt.createQmlObject(): failed to create object:
    :149:1: Type CardSocialActions unavailable
    file:///usr/lib/arm-linux-gnueabihf/unity8/qml/Dash/CardSocialActions.qml:20:1: "../../../qml/Components/ListItems": no such directory

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

Text conflict in debian/control
Text conflict in qml/Dash/GenericScopeView.qml
Text conflict in tests/plugins/Dash/cardcreator/9.res.cardcreator
3 conflicts encountered.

review: Needs Fixing
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Josh Arenson (josharenson) wrote :

1 comment in-line for now. Not 100% done as I can't actually run this yet.

review: Needs Fixing
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :
lp:~cimi/unity8/card-social updated
2133. By Andrea Cimitan

Fix for review

Revision history for this message
Andrea Cimitan (cimi) wrote :

> 1 comment in-line for now. Not 100% done as I can't actually run this yet.

fixed thanks

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Josh Arenson (josharenson) wrote :

1 inline comment

review: Needs Information
lp:~cimi/unity8/card-social updated
2134. By Andrea Cimitan

as review

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

> 1 inline comment
seems to be fixed now

Revision history for this message
Josh Arenson (josharenson) wrote :

* Did you perform an exploratory manual test run of the code change and any related functionality?
I still can't get it to build locally, but I tested it yesterday (when it worked) with almost the exact same change. Since the change is very small, I'm confident it works.

 * Did CI run pass?
No, usual.

 * Did you make sure that the branch does not contain spurious tags?
Yes, clean

review: Approve
lp:~cimi/unity8/card-social updated
2135. By Andrea Cimitan

merged trunk

2136. By Andrea Cimitan

fixed card creator test

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Dash/CardCreator.js'
2--- plugins/Dash/CardCreator.js 2016-03-14 08:41:03 +0000
3+++ plugins/Dash/CardCreator.js 2016-05-04 14:25:47 +0000
4@@ -351,6 +351,17 @@
5 model: cardData && cardData["attributes"]; \n\
6 }\n';
7
8+// %1 is used as anchors of socialActionsRow
9+// %2 is used as color of socialActionsRow
10+var kSocialActionsRowCode = 'CardSocialActions { \n\
11+ id: socialActionsRow; \n\
12+ objectName: "socialActionsRow"; \n\
13+ anchors { %1 } \n\
14+ color: %2; \n\
15+ model: cardData && cardData["socialActions"]; \n\
16+ onClicked: root.action(actionId); \n\
17+ }\n';
18+
19 // %1 is used as top anchor of summary
20 // %2 is used as topMargin anchor of summary
21 // %3 is used as color of summary
22@@ -437,9 +448,11 @@
23 var hasSubtitle = hasTitle && components["subtitle"] || false;
24 var hasHeaderRow = hasMascot && hasTitle;
25 var hasAttributes = hasTitle && components["attributes"] && components["attributes"]["field"] || false;
26+ var hasSocialActions = hasTitle && components["social-actions"] || false;
27 var isAudio = template["quick-preview-type"] === "audio";
28 var asynchronous = isCardTool ? "false" : "true";
29
30+ code += 'signal action(var actionId);\n';
31 if (isAudio) {
32 // For now we only support audio cards with [optional] art, title, subtitle
33 // in horizontal mode
34@@ -841,6 +854,34 @@
35 code += kSummaryLabelCode.arg(summaryTopAnchor).arg(summaryTopMargin).arg(summaryColor);
36 }
37
38+ if (hasSocialActions) {
39+ var socialAnchors;
40+ var socialTopAnchor;
41+
42+ if (hasSummary) socialTopAnchor = 'summary.bottom;';
43+ else if (isHorizontal && hasArt) socialTopAnchor = 'artShapeHolder.bottom;';
44+ else if (headerAsOverlay && hasArt) socialTopAnchor = 'artShapeHolder.bottom;';
45+ else if (hasHeaderRow) socialTopAnchor = 'row.bottom;';
46+ else if (hasTitleContainer) socialTopAnchor = 'headerTitleContainer.bottom;';
47+ else if (hasMascot) socialTopAnchor = 'mascotImage.bottom;';
48+ else if (hasAttributes) socialTopAnchor = 'attributesRow.bottom;';
49+ else if (hasSubtitle) socialTopAnchor = 'subtitleLabel.bottom;';
50+ else if (hasTitle) socialTopAnchor = 'titleLabel.bottom;';
51+ else if (hasArt) socialTopAnchor = 'artShapeHolder.bottom;';
52+ else socialTopAnchor = 'parent.top';
53+
54+ socialAnchors = 'top: ' + socialTopAnchor + ' left: parent.left; right: parent.right; topMargin: units.gu(1);'
55+
56+ var socialColor;
57+ if (hasBackground) {
58+ socialColor = summaryColorWithBackground;
59+ } else {
60+ socialColor = 'root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText';
61+ }
62+
63+ code += kSocialActionsRowCode.arg(socialAnchors).arg(socialColor);
64+ }
65+
66 var touchdownAnchors;
67 if (hasBackground) {
68 touchdownAnchors = 'fill: backgroundLoader';
69@@ -852,7 +893,9 @@
70 code += kTouchdownCode.arg(touchdownAnchors);
71
72 var implicitHeight = 'implicitHeight: ';
73- if (hasSummary) {
74+ if (hasSocialActions) {
75+ implicitHeight += 'socialActionsRow.y + socialActionsRow.height + units.gu(1);\n';
76+ } else if (hasSummary) {
77 implicitHeight += 'summary.y + summary.height + units.gu(1);\n';
78 } else if (isAudio) {
79 implicitHeight += 'audioButton.height;\n';
80
81=== added file 'plugins/Dash/CardSocialActions.qml'
82--- plugins/Dash/CardSocialActions.qml 1970-01-01 00:00:00 +0000
83+++ plugins/Dash/CardSocialActions.qml 2016-05-04 14:25:47 +0000
84@@ -0,0 +1,94 @@
85+/*
86+ * Copyright 2016 Canonical Ltd.
87+ *
88+ * This program is free software; you can redistribute it and/or modify
89+ * it under the terms of the GNU General Public License as published by
90+ * the Free Software Foundation; version 3.
91+ *
92+ * This program is distributed in the hope that it will be useful,
93+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
94+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
95+ * GNU General Public License for more details.
96+ *
97+ * You should have received a copy of the GNU General Public License
98+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
99+ */
100+
101+import QtQuick 2.4
102+import QtQuick.Layouts 1.1
103+import Ubuntu.Components 1.3
104+
105+Column {
106+ id: socialActions
107+ spacing: units.gu(0.5)
108+
109+ property alias model: repeater.model
110+ property color color: theme.palette.normal.baseText
111+
112+ signal clicked(var actionId)
113+
114+ Rectangle {
115+ id: divider
116+ visible: repeater.count > 0
117+ anchors {
118+ left: parent.left;
119+ right: parent.right;
120+ leftMargin:units.dp(1);
121+ rightMargin: units.dp(1);
122+ }
123+ color: Qt.darker(theme.palette.normal.background, 1.12)
124+ height: visible ? units.dp(1) : 0
125+ }
126+
127+ Row {
128+ id: row
129+ anchors {
130+ left: parent.left
131+ right: parent.right
132+ leftMargin: units.gu(1)
133+ rightMargin: units.gu(1)
134+ }
135+ spacing: units.gu(2)
136+ readonly property int visibleItems: {
137+ if (width <= units.gu(12)) // small card
138+ return 2;
139+ else if (width <= units.gu(21)) // medium card
140+ return 3;
141+ else // large or horizontal card
142+ return 4;
143+ }
144+
145+ Repeater {
146+ id: repeater
147+ delegate: Loader {
148+ height: units.gu(2)
149+ active: index < row.visibleItems
150+ sourceComponent: AbstractButton {
151+ objectName: "delegate" + index
152+ height: units.gu(2)
153+ width: icon.width
154+ Icon {
155+ id: icon
156+ objectName: "icon"
157+
158+ readonly property url urlIcon: modelData && modelData["icon"] || ""
159+ readonly property url urlTemporaryIcon: "temporaryIcon" in modelData && modelData["temporaryIcon"] || ""
160+
161+ height: units.gu(2)
162+ // FIXME Workaround for bug https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1421293
163+ width: implicitWidth > 0 && implicitHeight > 0 ? (implicitWidth / implicitHeight * height) : implicitWidth
164+ source: urlIcon
165+ color: socialActions.color
166+
167+ onUrlIconChanged: {
168+ if (urlIcon) source = urlIcon
169+ }
170+ }
171+
172+ onClicked: socialActions.clicked(modelData["id"]);
173+ onPressedChanged: if (pressed && icon.urlTemporaryIcon != "") icon.source = icon.urlTemporaryIcon
174+ }
175+ }
176+ }
177+ }
178+}
179
180=== modified file 'plugins/Dash/qmldir'
181--- plugins/Dash/qmldir 2015-05-18 22:17:21 +0000
182+++ plugins/Dash/qmldir 2016-05-04 14:25:47 +0000
183@@ -5,6 +5,7 @@
184 singleton DashAudioPlayer 0.1 DashAudioPlayer.qml
185 ScopeStyle 0.1 ScopeStyle.qml
186 CardAttributes 0.1 CardAttributes.qml
187+CardSocialActions 0.1 CardSocialActions.qml
188 CroppedImageMinimumSourceSize 0.1 CroppedImageMinimumSourceSize.qml
189 AudioProgressBar 0.1 AudioProgressBar.qml
190 CardAudioProgress 0.1 CardAudioProgress.qml
191
192=== modified file 'qml/Dash/CardGrid.qml'
193--- qml/Dash/CardGrid.qml 2016-02-16 15:09:55 +0000
194+++ qml/Dash/CardGrid.qml 2016-05-04 14:25:47 +0000
195@@ -78,6 +78,7 @@
196 target: loader.item
197 onClicked: root.clicked(index, result, loader.item, model)
198 onPressAndHold: root.pressAndHold(index, result, model)
199+ onAction: root.action(index, result, actionId)
200 }
201 }
202 }
203
204=== modified file 'qml/Dash/CardHorizontalList.qml'
205--- qml/Dash/CardHorizontalList.qml 2016-02-16 15:09:55 +0000
206+++ qml/Dash/CardHorizontalList.qml 2016-05-04 14:25:47 +0000
207@@ -59,6 +59,7 @@
208 target: loader.item
209 onClicked: root.clicked(index, result, loader.item, model)
210 onPressAndHold: root.pressAndHold(index, result, model)
211+ onAction: root.action(index, result, actionId)
212 }
213 }
214 }
215
216=== modified file 'qml/Dash/CardTool.qml'
217--- qml/Dash/CardTool.qml 2016-02-17 10:51:17 +0000
218+++ qml/Dash/CardTool.qml 2016-05-04 14:25:47 +0000
219@@ -162,7 +162,7 @@
220 id: attributesModel
221 property int numOfAttributes: 0
222 property var model: []
223- property bool hasAttributes: {
224+ readonly property bool hasAttributes: {
225 var attributes = components["attributes"];
226 var hasAttributesFlag = (attributes != undefined) && (attributes["field"] != undefined);
227
228@@ -182,16 +182,31 @@
229 }
230 }
231
232+ Item {
233+ id: socialActionsModel
234+ property var model: []
235+ readonly property bool hasActions: components["social-actions"] != undefined
236+
237+ onHasActionsChanged: {
238+ model = []
239+ if (hasActions) {
240+ model.push( {"id":"text", "icon":"image://theme/ok" } );
241+ }
242+ }
243+ }
244+
245 Loader {
246 id: cardLoader
247- readonly property var fields: ["art", "mascot", "title", "subtitle", "summary", "attributes"]
248+ readonly property var cfields: ["art", "mascot", "title", "subtitle", "summary", "attributes", "social-actions"]
249+ readonly property var dfields: ["art", "mascot", "title", "subtitle", "summary", "attributes", "socialActions"]
250 readonly property var maxData: {
251 "art": Qt.resolvedUrl("graphics/pixel.png"),
252 "mascot": Qt.resolvedUrl("graphics/pixel.png"),
253 "title": "—\n—",
254 "subtitle": "—",
255 "summary": "—\n—\n—\n—\n—",
256- "attributes": attributesModel.model
257+ "attributes": attributesModel.model,
258+ "socialActions": socialActionsModel.model
259 }
260 sourceComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, true);
261 onLoaded: {
262@@ -206,13 +221,14 @@
263 }
264 function updateCardData() {
265 var data = {};
266- for (var k in fields) {
267- var component = cardTool.components[fields[k]];
268- var key = fields[k];
269+ for (var k in cfields) {
270+ var ckey = cfields[k];
271+ var component = cardTool.components[ckey];
272 if ((typeof component === "string" && component.length > 0) ||
273 (typeof component === "object" && component !== null
274 && typeof component["field"] === "string" && component["field"].length > 0)) {
275- data[key] = maxData[key];
276+ var dkey = dfields[k];
277+ data[dkey] = maxData[dkey];
278 }
279 }
280 item.cardData = data;
281
282=== modified file 'qml/Dash/CardVerticalJournal.qml'
283--- qml/Dash/CardVerticalJournal.qml 2016-02-16 15:09:55 +0000
284+++ qml/Dash/CardVerticalJournal.qml 2016-05-04 14:25:47 +0000
285@@ -78,6 +78,7 @@
286 target: loader.item
287 onClicked: root.clicked(index, result, loader.item, model)
288 onPressAndHold: root.pressAndHold(index, result, model)
289+ onAction: root.action(index, result, actionId)
290 }
291 }
292 }
293
294=== modified file 'qml/Dash/DashRenderer.qml'
295--- qml/Dash/DashRenderer.qml 2015-07-15 15:07:19 +0000
296+++ qml/Dash/DashRenderer.qml 2016-05-04 14:25:47 +0000
297@@ -57,4 +57,10 @@
298 /// @param result result model of the clicked item, used for activation
299 /// @param itemModel model of the item
300 signal pressAndHold(int index, var result, var itemModel)
301+
302+ /// Emitted when the user clicked on an item action
303+ /// @param index is the index of the clicked item
304+ /// @param result result model of the clicked item, used for activation
305+ /// @param actionId id of the clicked action
306+ signal action(int index, var result, var actionId)
307 }
308
309=== modified file 'qml/Dash/GenericScopeView.qml'
310--- qml/Dash/GenericScopeView.qml 2016-04-27 15:01:10 +0000
311+++ qml/Dash/GenericScopeView.qml 2016-05-04 14:25:47 +0000
312@@ -390,6 +390,10 @@
313 scopeView.itemPressedAndHeld(result, baseItem.category);
314 }
315
316+ onAction: { // (int index, var result, var actionId)
317+ scope.activateAction(result, baseItem.categoryId, actionId);
318+ }
319+
320 function categoryItemCount() {
321 var categoryItemCount = -1;
322 if (!rendererLoader.expanded && !seeAllLabel.visible && target.collapsedItemCount > 0) {
323
324=== modified file 'tests/mocks/Unity/fake_categories.cpp'
325--- tests/mocks/Unity/fake_categories.cpp 2016-01-14 09:26:28 +0000
326+++ tests/mocks/Unity/fake_categories.cpp 2016-05-04 14:25:47 +0000
327@@ -88,7 +88,7 @@
328 }
329 case RoleComponents:
330 {
331- QVariantMap map, artMap, attributeMap;
332+ QVariantMap map, artMap, attributeMap, socialActionMap;
333 if (index.row() % 2 != 0) {
334 artMap["aspect-ratio"] = QString("1.%1").arg(index.row());
335 } else {
336@@ -99,6 +99,9 @@
337 map["title"] = "HOLA";
338 map["subtitle"] = "HOLA";
339 attributeMap["field"] = "attribute";
340+ socialActionMap["icon"] = "icon";
341+ socialActionMap["id"] = "socialHola";
342+ map["socialActions"] = socialActionMap;
343 map["attributes"] = attributeMap;
344 return map;
345 }
346
347=== modified file 'tests/mocks/Unity/fake_resultsmodel.cpp'
348--- tests/mocks/Unity/fake_resultsmodel.cpp 2015-11-23 15:41:34 +0000
349+++ tests/mocks/Unity/fake_resultsmodel.cpp 2016-05-04 14:25:47 +0000
350@@ -72,6 +72,8 @@
351 case RoleUri:
352 case RoleCategoryId:
353 case RoleDndUri:
354+ case RoleAttributes:
355+ case RoleSocialActions:
356 return QString();
357 case RoleResult:
358 return QString("Result.%1.%2").arg(m_categoryId).arg(index.row());
359
360=== modified file 'tests/plugins/Dash/cardcreator/1.res'
361--- tests/plugins/Dash/cardcreator/1.res 2016-03-03 12:03:37 +0000
362+++ tests/plugins/Dash/cardcreator/1.res 2016-05-04 14:25:47 +0000
363@@ -11,7 +11,7 @@
364 property bool showHeader: true;
365 implicitWidth: childrenRect.width;
366 enabled: true;
367-
368+signal action(var actionId);
369 readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
370 Item {
371 id: artShapeHolder;
372
373=== modified file 'tests/plugins/Dash/cardcreator/1.res.cardcreator'
374--- tests/plugins/Dash/cardcreator/1.res.cardcreator 2016-03-03 12:03:37 +0000
375+++ tests/plugins/Dash/cardcreator/1.res.cardcreator 2016-05-04 14:25:47 +0000
376@@ -10,7 +10,7 @@
377 property bool showHeader: true;
378 implicitWidth: childrenRect.width;
379 enabled: true;
380-
381+signal action(var actionId);
382 readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
383 Item {
384 id: artShapeHolder;
385
386=== modified file 'tests/plugins/Dash/cardcreator/10.res'
387--- tests/plugins/Dash/cardcreator/10.res 2016-02-17 10:51:17 +0000
388+++ tests/plugins/Dash/cardcreator/10.res 2016-05-04 14:25:47 +0000
389@@ -11,7 +11,7 @@
390 property bool showHeader: true;
391 implicitWidth: childrenRect.width;
392 enabled: true;
393-
394+signal action(var actionId);
395 Loader {
396 id: backgroundLoader;
397 objectName: "backgroundLoader";
398
399=== modified file 'tests/plugins/Dash/cardcreator/10.res.cardcreator'
400--- tests/plugins/Dash/cardcreator/10.res.cardcreator 2016-02-17 10:51:17 +0000
401+++ tests/plugins/Dash/cardcreator/10.res.cardcreator 2016-05-04 14:25:47 +0000
402@@ -10,7 +10,7 @@
403 property bool showHeader: true;
404 implicitWidth: childrenRect.width;
405 enabled: true;
406-
407+signal action(var actionId);
408 Loader {
409 id: backgroundLoader;
410 objectName: "backgroundLoader";
411
412=== modified file 'tests/plugins/Dash/cardcreator/11.res'
413--- tests/plugins/Dash/cardcreator/11.res 2016-03-03 12:03:37 +0000
414+++ tests/plugins/Dash/cardcreator/11.res 2016-05-04 14:25:47 +0000
415@@ -11,7 +11,7 @@
416 property bool showHeader: true;
417 implicitWidth: childrenRect.width;
418 enabled: true;
419-
420+signal action(var actionId);
421 Loader {
422 id: backgroundLoader;
423 objectName: "backgroundLoader";
424
425=== modified file 'tests/plugins/Dash/cardcreator/11.res.cardcreator'
426--- tests/plugins/Dash/cardcreator/11.res.cardcreator 2016-03-03 12:03:37 +0000
427+++ tests/plugins/Dash/cardcreator/11.res.cardcreator 2016-05-04 14:25:47 +0000
428@@ -10,7 +10,7 @@
429 property bool showHeader: true;
430 implicitWidth: childrenRect.width;
431 enabled: true;
432-
433+signal action(var actionId);
434 Loader {
435 id: backgroundLoader;
436 objectName: "backgroundLoader";
437
438=== added file 'tests/plugins/Dash/cardcreator/12.res'
439--- tests/plugins/Dash/cardcreator/12.res 1970-01-01 00:00:00 +0000
440+++ tests/plugins/Dash/cardcreator/12.res 2016-05-04 14:25:47 +0000
441@@ -0,0 +1,139 @@
442+AbstractButton {
443+ id: root;
444+ property var cardData;
445+ property string artShapeStyle: "inset";
446+ property string backgroundShapeStyle: "inset";
447+ property real fontScale: 1.0;
448+ property var scopeStyle: null;
449+ property int fixedHeaderHeight: -1;
450+ property size fixedArtShapeSize: Qt.size(-1, -1);
451+ readonly property string title: cardData && cardData["title"] || "";
452+ property bool showHeader: true;
453+ implicitWidth: childrenRect.width;
454+ enabled: true;
455+signal action(var actionId);
456+readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
457+Item {
458+ id: artShapeHolder;
459+ height: root.fixedArtShapeSize.height > 0 ? root.fixedArtShapeSize.height : artShapeLoader.height;
460+ width: root.fixedArtShapeSize.width > 0 ? root.fixedArtShapeSize.width : artShapeLoader.width;
461+ anchors { horizontalCenter: parent.horizontalCenter; }
462+ Loader {
463+ id: artShapeLoader;
464+ objectName: "artShapeLoader";
465+ readonly property string cardArt: cardData && cardData["art"] || "";
466+ active: cardArt != "";
467+ asynchronous: true;
468+ visible: status == Loader.Ready;
469+ sourceComponent: Item {
470+ id: artShape;
471+ objectName: "artShape";
472+ visible: image.status == Image.Ready;
473+ readonly property alias image: artImage;
474+ Loader {
475+ anchors.fill: parent;
476+ visible: true;
477+ sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
478+ Component {
479+ id: artShapeShapeComponent;
480+ UbuntuShape {
481+ source: artImage;
482+ sourceFillMode: UbuntuShape.PreserveAspectCrop;
483+ radius: "medium";
484+ aspect: {
485+ switch (root.artShapeStyle) {
486+ case "inset": return UbuntuShape.Inset;
487+ case "shadow": return UbuntuShape.DropShadow;
488+ default:
489+ case "flat": return UbuntuShape.Flat;
490+ }
491+ }
492+ }
493+ }
494+ Component {
495+ id: artShapeIconComponent;
496+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
497+ }
498+ }
499+ readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
500+ readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 0.75;
501+ Component.onCompleted: { updateWidthHeightBindings(); }
502+ Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
503+ function updateWidthHeightBindings() {
504+ if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
505+ width = root.fixedArtShapeSize.width;
506+ height = root.fixedArtShapeSize.height;
507+ } else {
508+ width = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.width });
509+ height = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.height });
510+ }
511+ }
512+ CroppedImageMinimumSourceSize {
513+ id: artImage;
514+ objectName: "artImage";
515+ source: artShapeLoader.cardArt;
516+ asynchronous: true;
517+ visible: !true;
518+ width: root.width;
519+ height: width / artShape.aspect;
520+ }
521+ }
522+ }
523+ }
524+readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;
525+Label {
526+ id: titleLabel;
527+ objectName: "titleLabel";
528+ anchors { right: parent.right;
529+ left: parent.left;
530+ top: artShapeHolder.bottom;
531+ topMargin: units.gu(1);
532+ }
533+ elide: Text.ElideRight;
534+ fontSize: "small";
535+ wrapMode: Text.Wrap;
536+ maximumLineCount: 2;
537+ font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
538+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText;
539+ visible: showHeader ;
540+ width: undefined;
541+ text: root.title;
542+ font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
543+ horizontalAlignment: Text.AlignLeft;
544+ }
545+Label {
546+ id: subtitleLabel;
547+ objectName: "subtitleLabel";
548+ anchors { left: titleLabel.left;
549+ leftMargin: titleLabel.leftMargin;
550+ right: titleLabel.right;
551+ top: titleLabel.bottom;
552+ }
553+ anchors.topMargin: units.dp(2);
554+ elide: Text.ElideRight;
555+ maximumLineCount: 1;
556+ fontSize: "x-small";
557+ font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
558+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText;
559+ visible: titleLabel.visible && titleLabel.text;
560+ text: cardData && cardData["subtitle"] || "";
561+ font.weight: Font.Light;
562+ }
563+CardSocialActions {
564+ id: socialActionsRow;
565+ objectName: "socialActionsRow";
566+ anchors { top: subtitleLabel.bottom; left: parent.left; right: parent.right; topMargin: units.gu(1); }
567+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText;
568+ model: cardData && cardData["socialActions"];
569+ onClicked: root.action(actionId);
570+}
571+UbuntuShape {
572+ id: touchdown;
573+ objectName: "touchdown";
574+ anchors { fill: artShapeHolder }
575+ visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
576+ radius: "medium";
577+ borderSource: "radius_pressed.sci"
578+}
579+implicitHeight: socialActionsRow.y + socialActionsRow.height + units.gu(1);
580+}
581
582=== added file 'tests/plugins/Dash/cardcreator/12.res.cardcreator'
583--- tests/plugins/Dash/cardcreator/12.res.cardcreator 1970-01-01 00:00:00 +0000
584+++ tests/plugins/Dash/cardcreator/12.res.cardcreator 2016-05-04 14:25:47 +0000
585@@ -0,0 +1,138 @@
586+AbstractButton {
587+ id: root;
588+ property var cardData;
589+ property string artShapeStyle: "inset";
590+ property string backgroundShapeStyle: "inset";
591+ property real fontScale: 1.0;
592+ property var scopeStyle: null;
593+ property size fixedArtShapeSize: Qt.size(-1, -1);
594+ readonly property string title: cardData && cardData["title"] || "";
595+ property bool showHeader: true;
596+ implicitWidth: childrenRect.width;
597+ enabled: true;
598+signal action(var actionId);
599+readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
600+Item {
601+ id: artShapeHolder;
602+ height: root.fixedArtShapeSize.height > 0 ? root.fixedArtShapeSize.height : artShapeLoader.height;
603+ width: root.fixedArtShapeSize.width > 0 ? root.fixedArtShapeSize.width : artShapeLoader.width;
604+ anchors { horizontalCenter: parent.horizontalCenter; }
605+ Loader {
606+ id: artShapeLoader;
607+ objectName: "artShapeLoader";
608+ readonly property string cardArt: cardData && cardData["art"] || "";
609+ active: cardArt != "";
610+ asynchronous: false;
611+ visible: status == Loader.Ready;
612+ sourceComponent: Item {
613+ id: artShape;
614+ objectName: "artShape";
615+ visible: image.status == Image.Ready;
616+ readonly property alias image: artImage;
617+ Loader {
618+ anchors.fill: parent;
619+ visible: true;
620+ sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
621+ Component {
622+ id: artShapeShapeComponent;
623+ UbuntuShape {
624+ source: artImage;
625+ sourceFillMode: UbuntuShape.PreserveAspectCrop;
626+ radius: "medium";
627+ aspect: {
628+ switch (root.artShapeStyle) {
629+ case "inset": return UbuntuShape.Inset;
630+ case "shadow": return UbuntuShape.DropShadow;
631+ default:
632+ case "flat": return UbuntuShape.Flat;
633+ }
634+ }
635+ }
636+ }
637+ Component {
638+ id: artShapeIconComponent;
639+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
640+ }
641+ }
642+ readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
643+ readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 0.75;
644+ Component.onCompleted: { updateWidthHeightBindings(); }
645+ Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
646+ function updateWidthHeightBindings() {
647+ if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
648+ width = root.fixedArtShapeSize.width;
649+ height = root.fixedArtShapeSize.height;
650+ } else {
651+ width = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.width });
652+ height = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.height });
653+ }
654+ }
655+ CroppedImageMinimumSourceSize {
656+ id: artImage;
657+ objectName: "artImage";
658+ source: artShapeLoader.cardArt;
659+ asynchronous: false;
660+ visible: !true;
661+ width: root.width;
662+ height: width / artShape.aspect;
663+ }
664+ }
665+ }
666+ }
667+readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;
668+Label {
669+ id: titleLabel;
670+ objectName: "titleLabel";
671+ anchors { right: parent.right;
672+ left: parent.left;
673+ top: artShapeHolder.bottom;
674+ topMargin: units.gu(1);
675+ }
676+ elide: Text.ElideRight;
677+ fontSize: "small";
678+ wrapMode: Text.Wrap;
679+ maximumLineCount: 2;
680+ font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
681+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText;
682+ visible: showHeader ;
683+ width: undefined;
684+ text: root.title;
685+ font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
686+ horizontalAlignment: Text.AlignLeft;
687+ }
688+Label {
689+ id: subtitleLabel;
690+ objectName: "subtitleLabel";
691+ anchors { left: titleLabel.left;
692+ leftMargin: titleLabel.leftMargin;
693+ right: titleLabel.right;
694+ top: titleLabel.bottom;
695+ }
696+ anchors.topMargin: units.dp(2);
697+ elide: Text.ElideRight;
698+ maximumLineCount: 1;
699+ fontSize: "x-small";
700+ font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
701+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText;
702+ visible: titleLabel.visible && titleLabel.text;
703+ text: cardData && cardData["subtitle"] || "";
704+ font.weight: Font.Light;
705+ }
706+CardSocialActions {
707+ id: socialActionsRow;
708+ objectName: "socialActionsRow";
709+ anchors { top: subtitleLabel.bottom; left: parent.left; right: parent.right; topMargin: units.gu(1); }
710+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText;
711+ model: cardData && cardData["socialActions"];
712+ onClicked: root.action(actionId);
713+}
714+UbuntuShape {
715+ id: touchdown;
716+ objectName: "touchdown";
717+ anchors { fill: artShapeHolder }
718+ visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
719+ radius: "medium";
720+ borderSource: "radius_pressed.sci"
721+}
722+implicitHeight: socialActionsRow.y + socialActionsRow.height + units.gu(1);
723+}
724
725=== added file 'tests/plugins/Dash/cardcreator/12.tst'
726--- tests/plugins/Dash/cardcreator/12.tst 1970-01-01 00:00:00 +0000
727+++ tests/plugins/Dash/cardcreator/12.tst 2016-05-04 14:25:47 +0000
728@@ -0,0 +1,3 @@
729+template: {"card-layout":"vertical","card-size":"small","category-layout":"grid","collapsed-rows":2}
730+components: {"art":{"aspect-ratio":0.75,"field":"art"},"subtitle":{"field":"price"},"title":{"field":"title"},"attributes":{},"social-actions":{}}
731+result: 12.res
732
733=== modified file 'tests/plugins/Dash/cardcreator/2.res'
734--- tests/plugins/Dash/cardcreator/2.res 2016-02-17 10:51:17 +0000
735+++ tests/plugins/Dash/cardcreator/2.res 2016-05-04 14:25:47 +0000
736@@ -11,7 +11,7 @@
737 property bool showHeader: true;
738 implicitWidth: childrenRect.width;
739 enabled: true;
740-
741+signal action(var actionId);
742 Loader {
743 id: backgroundLoader;
744 objectName: "backgroundLoader";
745
746=== modified file 'tests/plugins/Dash/cardcreator/2.res.cardcreator'
747--- tests/plugins/Dash/cardcreator/2.res.cardcreator 2016-02-17 10:51:17 +0000
748+++ tests/plugins/Dash/cardcreator/2.res.cardcreator 2016-05-04 14:25:47 +0000
749@@ -10,7 +10,7 @@
750 property bool showHeader: true;
751 implicitWidth: childrenRect.width;
752 enabled: true;
753-
754+signal action(var actionId);
755 Loader {
756 id: backgroundLoader;
757 objectName: "backgroundLoader";
758
759=== modified file 'tests/plugins/Dash/cardcreator/3.res'
760--- tests/plugins/Dash/cardcreator/3.res 2016-03-03 12:03:37 +0000
761+++ tests/plugins/Dash/cardcreator/3.res 2016-05-04 14:25:47 +0000
762@@ -11,7 +11,7 @@
763 property bool showHeader: true;
764 implicitWidth: childrenRect.width;
765 enabled: true;
766-
767+signal action(var actionId);
768 readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
769 Item {
770 id: artShapeHolder;
771
772=== modified file 'tests/plugins/Dash/cardcreator/3.res.cardcreator'
773--- tests/plugins/Dash/cardcreator/3.res.cardcreator 2016-03-03 12:03:37 +0000
774+++ tests/plugins/Dash/cardcreator/3.res.cardcreator 2016-05-04 14:25:47 +0000
775@@ -10,7 +10,7 @@
776 property bool showHeader: true;
777 implicitWidth: childrenRect.width;
778 enabled: true;
779-
780+signal action(var actionId);
781 readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
782 Item {
783 id: artShapeHolder;
784
785=== modified file 'tests/plugins/Dash/cardcreator/4.res'
786--- tests/plugins/Dash/cardcreator/4.res 2016-02-17 10:51:17 +0000
787+++ tests/plugins/Dash/cardcreator/4.res 2016-05-04 14:25:47 +0000
788@@ -11,7 +11,7 @@
789 property bool showHeader: true;
790 implicitWidth: childrenRect.width;
791 enabled: true;
792-
793+signal action(var actionId);
794 readonly property size artShapeSize: Qt.size(-1, -1);
795 readonly property int headerHeight: row.height;
796 Row {
797
798=== modified file 'tests/plugins/Dash/cardcreator/4.res.cardcreator'
799--- tests/plugins/Dash/cardcreator/4.res.cardcreator 2016-02-17 10:51:17 +0000
800+++ tests/plugins/Dash/cardcreator/4.res.cardcreator 2016-05-04 14:25:47 +0000
801@@ -10,7 +10,7 @@
802 property bool showHeader: true;
803 implicitWidth: childrenRect.width;
804 enabled: true;
805-
806+signal action(var actionId);
807 readonly property size artShapeSize: Qt.size(-1, -1);
808 readonly property int headerHeight: row.height;
809 Row {
810
811=== modified file 'tests/plugins/Dash/cardcreator/5.res'
812--- tests/plugins/Dash/cardcreator/5.res 2016-03-03 12:03:37 +0000
813+++ tests/plugins/Dash/cardcreator/5.res 2016-05-04 14:25:47 +0000
814@@ -11,7 +11,7 @@
815 property bool showHeader: true;
816 implicitWidth: childrenRect.width;
817 enabled: false;
818-
819+signal action(var actionId);
820 readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
821 Item {
822 id: artShapeHolder;
823
824=== modified file 'tests/plugins/Dash/cardcreator/5.res.cardcreator'
825--- tests/plugins/Dash/cardcreator/5.res.cardcreator 2016-03-03 12:03:37 +0000
826+++ tests/plugins/Dash/cardcreator/5.res.cardcreator 2016-05-04 14:25:47 +0000
827@@ -10,7 +10,7 @@
828 property bool showHeader: true;
829 implicitWidth: childrenRect.width;
830 enabled: false;
831-
832+signal action(var actionId);
833 readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
834 Item {
835 id: artShapeHolder;
836
837=== modified file 'tests/plugins/Dash/cardcreator/6.res'
838--- tests/plugins/Dash/cardcreator/6.res 2016-02-17 10:51:17 +0000
839+++ tests/plugins/Dash/cardcreator/6.res 2016-05-04 14:25:47 +0000
840@@ -11,7 +11,7 @@
841 property bool showHeader: true;
842 implicitWidth: childrenRect.width;
843 enabled: true;
844-
845+signal action(var actionId);
846 Loader {
847 id: backgroundLoader;
848 objectName: "backgroundLoader";
849
850=== modified file 'tests/plugins/Dash/cardcreator/6.res.cardcreator'
851--- tests/plugins/Dash/cardcreator/6.res.cardcreator 2016-02-17 10:51:17 +0000
852+++ tests/plugins/Dash/cardcreator/6.res.cardcreator 2016-05-04 14:25:47 +0000
853@@ -10,7 +10,7 @@
854 property bool showHeader: true;
855 implicitWidth: childrenRect.width;
856 enabled: true;
857-
858+signal action(var actionId);
859 Loader {
860 id: backgroundLoader;
861 objectName: "backgroundLoader";
862
863=== modified file 'tests/plugins/Dash/cardcreator/7.res'
864--- tests/plugins/Dash/cardcreator/7.res 2016-02-17 10:51:17 +0000
865+++ tests/plugins/Dash/cardcreator/7.res 2016-05-04 14:25:47 +0000
866@@ -11,7 +11,7 @@
867 property bool showHeader: true;
868 implicitWidth: childrenRect.width;
869 enabled: true;
870-
871+signal action(var actionId);
872 Loader {
873 id: backgroundLoader;
874 objectName: "backgroundLoader";
875
876=== modified file 'tests/plugins/Dash/cardcreator/7.res.cardcreator'
877--- tests/plugins/Dash/cardcreator/7.res.cardcreator 2016-02-17 10:51:17 +0000
878+++ tests/plugins/Dash/cardcreator/7.res.cardcreator 2016-05-04 14:25:47 +0000
879@@ -10,7 +10,7 @@
880 property bool showHeader: true;
881 implicitWidth: childrenRect.width;
882 enabled: true;
883-
884+signal action(var actionId);
885 Loader {
886 id: backgroundLoader;
887 objectName: "backgroundLoader";
888
889=== modified file 'tests/plugins/Dash/cardcreator/8.res'
890--- tests/plugins/Dash/cardcreator/8.res 2016-02-17 10:51:17 +0000
891+++ tests/plugins/Dash/cardcreator/8.res 2016-05-04 14:25:47 +0000
892@@ -11,7 +11,7 @@
893 property bool showHeader: true;
894 implicitWidth: childrenRect.width;
895 enabled: true;
896-
897+signal action(var actionId);
898 Loader {
899 id: backgroundLoader;
900 objectName: "backgroundLoader";
901
902=== modified file 'tests/plugins/Dash/cardcreator/8.res.cardcreator'
903--- tests/plugins/Dash/cardcreator/8.res.cardcreator 2016-02-17 10:51:17 +0000
904+++ tests/plugins/Dash/cardcreator/8.res.cardcreator 2016-05-04 14:25:47 +0000
905@@ -10,7 +10,7 @@
906 property bool showHeader: true;
907 implicitWidth: childrenRect.width;
908 enabled: true;
909-
910+signal action(var actionId);
911 Loader {
912 id: backgroundLoader;
913 objectName: "backgroundLoader";
914
915=== modified file 'tests/plugins/Dash/cardcreator/9.res'
916--- tests/plugins/Dash/cardcreator/9.res 2016-03-10 16:53:04 +0000
917+++ tests/plugins/Dash/cardcreator/9.res 2016-05-04 14:25:47 +0000
918@@ -11,7 +11,7 @@
919 property bool showHeader: true;
920 implicitWidth: childrenRect.width;
921 enabled: true;
922-
923+signal action(var actionId);
924 readonly property size artShapeSize: Qt.size(-1, -1);
925 readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin + audioProgressBar.height + audioProgressBar.anchors.topMargin;
926 Label {
927
928=== modified file 'tests/plugins/Dash/cardcreator/9.res.cardcreator'
929--- tests/plugins/Dash/cardcreator/9.res.cardcreator 2016-03-10 16:53:04 +0000
930+++ tests/plugins/Dash/cardcreator/9.res.cardcreator 2016-05-04 14:25:47 +0000
931@@ -10,7 +10,7 @@
932 property bool showHeader: true;
933 implicitWidth: childrenRect.width;
934 enabled: true;
935-
936+signal action(var actionId);
937 readonly property size artShapeSize: Qt.size(-1, -1);
938 readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin + audioProgressBar.height + audioProgressBar.anchors.topMargin;
939 Label {
940
941=== modified file 'tests/qmltests/Dash/CardHelpers.js'
942--- tests/qmltests/Dash/CardHelpers.js 2015-05-15 12:57:48 +0000
943+++ tests/qmltests/Dash/CardHelpers.js 2016-05-04 14:25:47 +0000
944@@ -16,7 +16,8 @@
945
946 .pragma library
947
948-var components = ["title", "art", "subtitle", "mascot", "emblem", "summary", "attributes", "overlayColor", "quickPreviewData"]
949+var components = ["title", "art", "subtitle", "mascot", "emblem", "summary", "attributes", "social-actions", "overlayColor", "quickPreviewData"]
950+var dataKeys = ["title", "art", "subtitle", "mascot", "emblem", "summary", "attributes", "socialActions", "overlayColor", "quickPreviewData"]
951
952 var defaultLayout = ' \
953 { \
954@@ -38,7 +39,8 @@
955 "mascot": null, \
956 "emblem": null, \
957 "summary": null, \
958- "attributes": { "max-count": 2 } \
959+ "attributes": { "max-count": 2 }, \
960+ "social-actions": null \
961 }, \
962 "resources": {} \
963 }'
964@@ -52,10 +54,10 @@
965 "emblem": "emblem", \
966 "overlayColor": "overlayColor", \
967 "summary": "summary", \
968- "attributes": "attributes" \
969+ "attributes": "attributes", \
970+ "social-actions": "socialActions" \
971 }'
972
973-
974 function tryParse(json, errorLabel) {
975 var o = undefined;
976 if (errorLabel !== undefined) {
977@@ -82,12 +84,12 @@
978 for (var k in components) {
979 try {
980 if (typeof layout[components[k]] == "object") {
981- d[components[k]] = o[layout[components[k]]['field']];
982+ d[dataKeys[k]] = o[layout[components[k]]['field']];
983 } else {
984- d[components[k]] = o[layout[components[k]]];
985+ d[dataKeys[k]] = o[layout[components[k]]];
986 }
987 } catch(err) {
988- d[components[k]] = undefined;
989+ d[dataKeys[k]] = undefined;
990 }
991 }
992 }
993
994=== modified file 'tests/qmltests/Dash/tst_Card.qml'
995--- tests/qmltests/Dash/tst_Card.qml 2016-04-13 08:16:05 +0000
996+++ tests/qmltests/Dash/tst_Card.qml 2016-05-04 14:25:47 +0000
997@@ -36,6 +36,10 @@
998 "subtitle": "bar",
999 "summary": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
1000 "attributes": [{"value":"text1","icon":"image://theme/ok"},{"value":"text2","icon":"image://theme/cancel"}],
1001+ "socialActions": [{"id":"like","icon":"image://theme/ok","temporaryIcon":"image://theme/undo"},
1002+ {"id":"share","icon":"image://theme/cancel"},
1003+ {"id":"like","icon":"image://theme/ok","temporaryIcon":"image://theme/undo"},
1004+ {"id":"share","icon":"image://theme/cancel"}],
1005 "quickPreviewData": {"uri": "/some/file", "duration": "14"}
1006 }'
1007
1008@@ -211,6 +215,11 @@
1009 }
1010 }
1011
1012+ SignalSpy {
1013+ id: signalSpy
1014+ signalName: "action"
1015+ }
1016+
1017 UT.UnityTestCase {
1018 id: testCase
1019 name: "Card"
1020@@ -274,9 +283,11 @@
1021 { tag: "Wide", width: units.gu(18), index: 0 },
1022 { tag: "Horizontal", width: units.gu(38), index: 5 },
1023 // Make sure card ends with header when there's no summary
1024- { tag: "NoSummary", height: function() { var cardToolRow = findChild(cardTool, "outerRow");
1025- return cardToolRow.y + cardToolRow.height + units.gu(1) }, index: 6 },
1026- { tag: "HorizontalNoSummary", height: function() { return headerRow.height + units.gu(2) }, card_layout: "horizontal", index: 6 },
1027+ { tag: "NoSummary", height: function() { var socialActionsRow = findChild(cardTool, "socialActionsRow");
1028+ return socialActionsRow.y + socialActionsRow.height + units.gu(1) }, index: 6 },
1029+ { tag: "HorizontalNoSummary", height: function() { var socialActionsRow = findChild(cardTool, "socialActionsRow");
1030+ return socialActionsRow.y + socialActionsRow.height + units.gu(1) },
1031+ card_layout: "horizontal", index: 6 },
1032 ]
1033 }
1034
1035@@ -641,5 +652,29 @@
1036 verify((card.width - titleToCard.x - titleToCard.width) === units.gu(1));
1037 }
1038 }
1039+
1040+ function test_action() {
1041+ selector.selectedIndex = 0;
1042+ waitForRendering(card);
1043+
1044+ signalSpy.target = card;
1045+ var socialActionsRow = findChild(card, "socialActionsRow");
1046+ var delegate0 = findChild(socialActionsRow, "delegate0");
1047+ var icon0 = findChild(delegate0, "icon");
1048+ var delegate1 = findChild(socialActionsRow, "delegate1");
1049+ var icon1 = findChild(delegate1, "icon");
1050+
1051+ compare(icon0.source, "image://theme/ok");
1052+ mouseClick(delegate0, delegate0.height / 2, delegate0.height / 2);
1053+ tryCompare(signalSpy, "count", 1);
1054+ compare(signalSpy.signalArguments[0][0], "like");
1055+ compare(icon0.source, "image://theme/undo");
1056+
1057+ compare(icon1.source, "image://theme/cancel");
1058+ mouseClick(delegate1, delegate1.height / 2, delegate1.height / 2);
1059+ tryCompare(signalSpy, "count", 2);
1060+ compare(signalSpy.signalArguments[1][0], "share");
1061+ compare(icon1.source, "image://theme/cancel");
1062+ }
1063 }
1064 }

Subscribers

People subscribed via source and target branches