Merge lp:~dobey/unity-scope-click/no-pay-accounts into lp:unity-scope-click

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 453
Merged at revision: 458
Proposed branch: lp:~dobey/unity-scope-click/no-pay-accounts
Merge into: lp:unity-scope-click
Diff against target: 60 lines (+19/-4)
3 files modified
libclickscope/click/preview.cpp (+0/-3)
libclickscope/click/preview.h (+2/-1)
libclickscope/tests/test_preview.cpp (+17/-0)
To merge this branch: bzr merge lp:~dobey/unity-scope-click/no-pay-accounts
Reviewer Review Type Date Requested Status
Antti Kaijanmäki (community) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+295512@code.launchpad.net

Commit message

Don't add the accounts attributes to the payments button.

To post a comment you must log in.
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libclickscope/click/preview.cpp'
2--- libclickscope/click/preview.cpp 2016-05-25 16:20:04 +0000
3+++ libclickscope/click/preview.cpp 2016-05-31 14:29:24 +0000
4@@ -1291,9 +1291,6 @@
5 tuple["download_url"] = details.download_url;
6 tuple["download_sha512"] = details.download_sha512;
7 payments.add_attribute_value("source", scopes::Variant(tuple));
8- oa_client.register_account_login_item(payments,
9- scopes::OnlineAccountClient::PostLoginAction::ContinueActivation,
10- scopes::OnlineAccountClient::PostLoginAction::DoNothing);
11 widgets.push_back(payments);
12 } else {
13 scopes::PreviewWidget buttons("buttons", "actions");
14
15=== modified file 'libclickscope/click/preview.h'
16--- libclickscope/click/preview.h 2016-05-25 16:20:04 +0000
17+++ libclickscope/click/preview.h 2016-05-31 14:29:24 +0000
18@@ -329,12 +329,13 @@
19 virtual ~UninstalledPreview();
20
21 void run(unity::scopes::PreviewReplyProxy const& reply) override;
22+ virtual scopes::PreviewWidgetList uninstalledActionButtonWidgets(const PackageDetails &details);
23+
24 protected:
25 scopes::ActionMetadata metadata;
26 PackageDetails found_details;
27 CachedPreviewWidgets cachedWidgets;
28 std::string found_object_path;
29- virtual scopes::PreviewWidgetList uninstalledActionButtonWidgets(const PackageDetails &details);
30
31 QSharedPointer<click::DownloadManager> dm;
32 };
33
34=== modified file 'libclickscope/tests/test_preview.cpp'
35--- libclickscope/tests/test_preview.cpp 2016-04-27 14:06:29 +0000
36+++ libclickscope/tests/test_preview.cpp 2016-05-31 14:29:24 +0000
37@@ -494,6 +494,23 @@
38 return selected_action["id"].get_string();
39 }
40
41+TEST_F(UninstalledPreviewTest, testPaymentsButtonNoAccountsData) {
42+ result["name"] = "fake_app_name";
43+ result["price"] = 2.99;
44+ result["purchased"] = false;
45+ result["currency_symbol"] = "USD";
46+ unity::scopes::ActionMetadata metadata("en_EN", "desktop");
47+ FakeBaseUninstalledPreview preview("", result, metadata, client, depts, sdm, pay_package);
48+ click::PackageDetails pkgdetails;
49+ pkgdetails.package = click::Package(result["name"].get_string(), "0.1");
50+ pkgdetails.download_url = "https://localhost/example/fake_app_name.click";
51+ pkgdetails.download_sha512 = "download_sha512";
52+ auto widgets = preview.uninstalledActionButtonWidgets(pkgdetails);
53+ auto button = *std::next(widgets.begin(), 0);
54+ std::cerr << button.data() << std::endl;
55+ ASSERT_EQ(button.attribute_values().count("online_account_details"), 0);
56+}
57+
58 TEST_F(UninstalledPreviewTest, testIsRefundableButtonShown) {
59 result["name"] = "fake_app_name";
60 result["price"] = 2.99;

Subscribers

People subscribed via source and target branches

to all changes: