Merge lp:~renatofilho/address-book-app/fix-share into lp:address-book-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 450
Merged at revision: 447
Proposed branch: lp:~renatofilho/address-book-app/fix-share
Merge into: lp:address-book-app
Diff against target: 122 lines (+57/-3)
5 files modified
src/imports/ABContactListPage.qml (+12/-2)
src/imports/CMakeLists.txt (+1/-0)
src/imports/Ubuntu/AddressBook/Base/ContactExporter.qml (+8/-1)
tests/autopilot/address_book_app/__init__.py (+4/-0)
tests/autopilot/address_book_app/tests/test_export_contact.py (+32/-0)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/fix-share
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+261651@code.launchpad.net

Commit message

Fixed contact export from multi selection.

To post a comment you must log in.
447. By Renato Araujo Oliveira Filho

Revert changes on helpers.py

448. By Renato Araujo Oliveira Filho

Added missing test file.

449. By Renato Araujo Oliveira Filho

Fixed flake8 problems.

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)
450. By Renato Araujo Oliveira Filho

Added missing file into install list.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Are there any related MPs required for this MP to build/function as expected?
NO

Is your branch in sync with latest trunk?
YES

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
YES

Did you successfully run all tests found in your component's Test Plan on device or emulator?
YES

If you changed the UI, was the change specified/approved by design?
NO UI CHANGE

If you changed UI labels, did you update the pot file?
NO PACKAGE CHANGE

Revision history for this message
Gustavo Pichorim Boiko (boiko) 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 'src/imports/ABContactListPage.qml'
2--- src/imports/ABContactListPage.qml 2015-05-27 22:49:00 +0000
3+++ src/imports/ABContactListPage.qml 2015-06-11 14:00:42 +0000
4@@ -24,6 +24,7 @@
5 import Ubuntu.Content 1.1 as ContentHub
6
7 import Ubuntu.AddressBook.Base 0.1
8+import Ubuntu.AddressBook.ContactShare 0.1
9
10 ContactsUI.PageWithBottomEdge {
11 id: mainPage
12@@ -474,8 +475,9 @@
13 // Share contacts to an application chosen by the user
14 if (!mainPage.pickMode) {
15 contactExporter.dismissBusyDialog()
16- pageStack.push(Qt.resolvedUrl("../ContactShare/ContactSharePage.qml"),
17- { contactModel: contactExporter.contactModel, contacts: contacts })
18+ pageStack.push(contactShareComponent,
19+ { contactModel: contactExporter.contactModel,
20+ contacts: contacts })
21 }
22 }
23 }
24@@ -497,6 +499,14 @@
25 }
26 }
27
28+ Component {
29+ id: contactShareComponent
30+
31+ ContactSharePage {
32+ objectName: "contactSharePage"
33+ }
34+ }
35+
36 Component.onCompleted: {
37 application.elapsed()
38 if ((typeof(TEST_DATA) !== "undefined") && (TEST_DATA !== "")) {
39
40=== modified file 'src/imports/CMakeLists.txt'
41--- src/imports/CMakeLists.txt 2015-04-29 18:39:01 +0000
42+++ src/imports/CMakeLists.txt 2015-06-11 14:00:42 +0000
43@@ -6,6 +6,7 @@
44 ABContactViewPage.qml
45 ContentHubProxy.qml
46 MainWindow.qml
47+ VCardImportDialog.qml
48 )
49
50 install(FILES ${ADDRESS_BOOK_APP_QMLS}
51
52=== modified file 'src/imports/Ubuntu/AddressBook/Base/ContactExporter.qml'
53--- src/imports/Ubuntu/AddressBook/Base/ContactExporter.qml 2015-05-07 17:27:16 +0000
54+++ src/imports/Ubuntu/AddressBook/Base/ContactExporter.qml 2015-06-11 14:00:42 +0000
55@@ -55,7 +55,14 @@
56 console.debug("The contact list is empty")
57 done("")
58 } else {
59- priv.currentQueryId = contactModel.fetchContacts(ids)
60+ if (root.contactModel.manager === "memory") {
61+ // memory backend emit contact fetched before return from "fetchContacts" we will use operation = "-2"
62+ // to say that we are wainting for a operation from memory manager
63+ priv.currentQueryId = -2
64+ contactModel.fetchContacts(ids)
65+ } else {
66+ priv.currentQueryId = contactModel.fetchContacts(ids)
67+ }
68 }
69 }
70
71
72=== modified file 'tests/autopilot/address_book_app/__init__.py'
73--- tests/autopilot/address_book_app/__init__.py 2015-05-12 15:43:25 +0000
74+++ tests/autopilot/address_book_app/__init__.py 2015-06-11 14:00:42 +0000
75@@ -98,6 +98,10 @@
76 return p
77 return None
78
79+ def get_share_page(self):
80+ return self.wait_select_single("ContactSharePage",
81+ objectName="contactSharePage")
82+
83 def start_import_contacts(self):
84 self.open_header()
85 view = self.get_contact_list_view()
86
87=== added file 'tests/autopilot/address_book_app/tests/test_export_contact.py'
88--- tests/autopilot/address_book_app/tests/test_export_contact.py 1970-01-01 00:00:00 +0000
89+++ tests/autopilot/address_book_app/tests/test_export_contact.py 2015-06-11 14:00:42 +0000
90@@ -0,0 +1,32 @@
91+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
92+# Copyright 2013 Canonical
93+#
94+# This program is free software: you can redistribute it and/or modify it
95+# under the terms of the GNU General Public License version 3, as published
96+# by the Free Software Foundation.
97+
98+"""Tests for the AddressBook App"""
99+
100+from autopilot.matchers import Eventually
101+from testtools.matchers import Equals
102+
103+from address_book_app.tests import AddressBookAppTestCase
104+
105+
106+class TestExportContact(AddressBookAppTestCase):
107+ """Tests the erxport contact features"""
108+
109+ PRELOAD_VCARD = True
110+
111+ def test_export_contacts(self):
112+ contact_list = self.app.main_window.get_contact_list_page()
113+
114+ # select one contact
115+ contact_list.select_contacts([1])
116+
117+ # click on export header action
118+ self.app.main_window.click_action_button('share')
119+
120+ # expect that the share page appears
121+ share_page = self.app.main_window.get_share_page()
122+ self.assertThat(share_page.active, Eventually(Equals(True)))

Subscribers

People subscribed via source and target branches