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
=== modified file 'scope/clickapps/apps-query.cpp'
--- scope/clickapps/apps-query.cpp 2014-07-17 20:05:57 +0000
+++ scope/clickapps/apps-query.cpp 2014-07-22 09:41:46 +0000
@@ -267,11 +267,15 @@
267 cat_title = tmp;267 cat_title = tmp;
268 }268 }
269 }269 }
270 else if (!query().department_id().empty())
271 {
272 cat_title = _("Get more apps like this from the Store");
273 }
270274
271 scopes::CategoryRenderer rdr(CATEGORY_STORE);275 scopes::CategoryRenderer rdr(CATEGORY_STORE);
272 auto cat = searchReply->register_category("store", cat_title, "", rdr);276 auto cat = searchReply->register_category("store", cat_title, "", rdr);
273277
274 const unity::scopes::CannedQuery store_scope("com.canonical.scopes.clickstore", querystr, "");278 const unity::scopes::CannedQuery store_scope("com.canonical.scopes.clickstore", querystr, querystr.empty() ? query().department_id() : "");
275279
276 scopes::CategorisedResult res(cat);280 scopes::CategorisedResult res(cat);
277 res.set_title(title);281 res.set_title(title);
278282
=== modified file 'scope/tests/test_apps_query.cpp'
--- scope/tests/test_apps_query.cpp 2014-07-18 15:01:41 +0000
+++ scope/tests/test_apps_query.cpp 2014-07-22 09:41:46 +0000
@@ -151,6 +151,27 @@
151 q2.add_fake_store_app(reply2);151 q2.add_fake_store_app(reply2);
152}152}
153153
154TEST(Query, testUbuntuStoreFakeResultWithDepartment)
155{
156 const scopes::SearchMetadata metadata("en_EN", "phone");
157 const unity::scopes::CannedQuery query("foo.scope", "", "music-department");
158
159 click::apps::Query q(query, nullptr, metadata);
160
161 scopes::CategoryRenderer renderer("{}");
162 auto ptrCat = std::make_shared<FakeCategory>("id", "", "", renderer);
163
164 scopes::testing::MockSearchReply mock_reply;
165 scopes::SearchReplyProxy reply(&mock_reply, [](unity::scopes::SearchReply*){});
166
167 const unity::scopes::CannedQuery target_query("com.canonical.scopes.clickstore", "", "music-department");
168
169 EXPECT_CALL(mock_reply, register_category("store", _, _, _)).WillOnce(Return(ptrCat));
170 EXPECT_CALL(mock_reply, push(Matcher<const unity::scopes::CategorisedResult&>(ResultUriMatchesCannedQuery(target_query))));
171
172 q.add_fake_store_app(reply);
173}
174
154// this matcher expects a list of department ids in depts:175// this matcher expects a list of department ids in depts:
155// first on the list is the root, followed by children ids.176// first on the list is the root, followed by children ids.
156// the arg of the matcher is unity::scopes::Department ptr.177// the arg of the matcher is unity::scopes::Department ptr.

Subscribers

People subscribed via source and target branches

to all changes: