Merge lp:~stolowski/unity-scope-click/local-departments-store-link into lp:unity-scope-click/devel

Proposed by Paweł Stołowski
Status: Merged
Approved by: Alejandro J. Cura
Approved revision: 329
Merged at revision: 353
Proposed branch: lp:~stolowski/unity-scope-click/local-departments-store-link
Merge into: lp:unity-scope-click/devel
Prerequisite: lp:~stolowski/unity-scope-click/use-local-departments
Diff against target: 52 lines (+26/-1)
2 files modified
scope/clickapps/apps-query.cpp (+5/-1)
scope/tests/test_apps_query.cpp (+21/-0)
To merge this branch: bzr merge lp:~stolowski/unity-scope-click/local-departments-store-link
Reviewer Review Type Date Requested Status
Alejandro J. Cura (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+226987@code.launchpad.net

Commit message

Make "Ubuntu store'" orange card carry current department id when browsing Apps by department and change its category title to "Get more apps like this from the Store".

Description of the change

Make "Ubuntu store'" orange card carry current department id when browsing Apps by department and change its category title to "Get more apps like this from the Store". Clicking the card will open store scope in the target department.
This change has been discussed with design this morning.

Note: there is a shell plugin bug that breaks the expected behavior atm: https://bugs.launchpad.net/unity-scopes-shell/+bug/1343242

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
327. By Paweł Stołowski

Merged devel.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alejandro J. Cura (alecu) wrote :

Please put the test for this new feature in a separate test case. Otherwise the branch looks goood.

review: Needs Fixing
328. By Paweł Stołowski

Merged devel

329. By Paweł Stołowski

Moved test for new functionality into a separate test case

Revision history for this message
Paweł Stołowski (stolowski) wrote :

> Please put the test for this new feature in a separate test case. Otherwise
> the branch looks goood.

Done

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alejandro J. Cura (alecu) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scope/clickapps/apps-query.cpp'
2--- scope/clickapps/apps-query.cpp 2014-07-17 20:05:57 +0000
3+++ scope/clickapps/apps-query.cpp 2014-07-22 09:41:46 +0000
4@@ -267,11 +267,15 @@
5 cat_title = tmp;
6 }
7 }
8+ else if (!query().department_id().empty())
9+ {
10+ cat_title = _("Get more apps like this from the Store");
11+ }
12
13 scopes::CategoryRenderer rdr(CATEGORY_STORE);
14 auto cat = searchReply->register_category("store", cat_title, "", rdr);
15
16- const unity::scopes::CannedQuery store_scope("com.canonical.scopes.clickstore", querystr, "");
17+ const unity::scopes::CannedQuery store_scope("com.canonical.scopes.clickstore", querystr, querystr.empty() ? query().department_id() : "");
18
19 scopes::CategorisedResult res(cat);
20 res.set_title(title);
21
22=== modified file 'scope/tests/test_apps_query.cpp'
23--- scope/tests/test_apps_query.cpp 2014-07-18 15:01:41 +0000
24+++ scope/tests/test_apps_query.cpp 2014-07-22 09:41:46 +0000
25@@ -151,6 +151,27 @@
26 q2.add_fake_store_app(reply2);
27 }
28
29+TEST(Query, testUbuntuStoreFakeResultWithDepartment)
30+{
31+ const scopes::SearchMetadata metadata("en_EN", "phone");
32+ const unity::scopes::CannedQuery query("foo.scope", "", "music-department");
33+
34+ click::apps::Query q(query, nullptr, metadata);
35+
36+ scopes::CategoryRenderer renderer("{}");
37+ auto ptrCat = std::make_shared<FakeCategory>("id", "", "", renderer);
38+
39+ scopes::testing::MockSearchReply mock_reply;
40+ scopes::SearchReplyProxy reply(&mock_reply, [](unity::scopes::SearchReply*){});
41+
42+ const unity::scopes::CannedQuery target_query("com.canonical.scopes.clickstore", "", "music-department");
43+
44+ EXPECT_CALL(mock_reply, register_category("store", _, _, _)).WillOnce(Return(ptrCat));
45+ EXPECT_CALL(mock_reply, push(Matcher<const unity::scopes::CategorisedResult&>(ResultUriMatchesCannedQuery(target_query))));
46+
47+ q.add_fake_store_app(reply);
48+}
49+
50 // this matcher expects a list of department ids in depts:
51 // first on the list is the root, followed by children ids.
52 // the arg of the matcher is unity::scopes::Department ptr.

Subscribers

People subscribed via source and target branches

to all changes: