Merge lp:~renatofilho/address-book-app/fix-1277091 into lp:address-book-app
- fix-1277091
- Merge into trunk
Status: | Work in progress |
---|---|
Proposed branch: | lp:~renatofilho/address-book-app/fix-1277091 |
Merge into: | lp:address-book-app |
Prerequisite: | lp:~renatofilho/address-book-app/fix-1268042 |
Diff against target: |
220 lines (+86/-31) 5 files modified
src/imports/ContactEdit/ContactEditor.qml (+74/-4) src/imports/ContactList/ContactListPage.qml (+5/-14) src/imports/ContactView/ContactDetailWithTypeView.qml (+1/-1) tests/autopilot/address_book_app/tests/__init__.py (+3/-3) tests/autopilot/address_book_app/tests/test_add_contact.py (+3/-9) |
To merge this branch: | bzr merge lp:~renatofilho/address-book-app/fix-1277091 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Ubuntu Phablet Team | Pending | ||
Review via email: mp+217687@code.launchpad.net |
This proposal supersedes a proposal from 2014-04-22.
Commit message
Show contact view after create a new contact.
Description of the change
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:167
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:167
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:167
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:167
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:167
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:167
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:167
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:167
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:167
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:167
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:168
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 169. By Renato Araujo Oliveira Filho
-
Wait for contact save before pop the contact edit page.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:169
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:169
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Unmerged revisions
- 169. By Renato Araujo Oliveira Filho
-
Wait for contact save before pop the contact edit page.
- 168. By Renato Araujo Oliveira Filho
- 167. By Renato Araujo Oliveira Filho
-
Updated test to expect the contact view paga after adding a new contact.
Preview Diff
1 | === modified file 'src/imports/ContactEdit/ContactEditor.qml' |
2 | --- src/imports/ContactEdit/ContactEditor.qml 2014-04-30 20:11:39 +0000 |
3 | +++ src/imports/ContactEdit/ContactEditor.qml 2014-04-30 20:11:39 +0000 |
4 | @@ -27,7 +27,7 @@ |
5 | |
6 | property QtObject contact: null |
7 | property alias model: contactFetch.model |
8 | - readonly property bool isNewContact: contact && (contact.contactId === "qtcontacts:::") |
9 | + readonly property bool isNewContact: contact && (contact.contactId === "qtcontacts:::") |
10 | |
11 | // this is used to add a phone number to a existing contact |
12 | property string contactId: "" |
13 | @@ -78,12 +78,20 @@ |
14 | } |
15 | } |
16 | |
17 | + |
18 | if (changed) { |
19 | + var newContact = isNewContact |
20 | // backend error will be handled by the root page (contact list) |
21 | - var newContact = (contact.model == null) |
22 | + if (newContact) { |
23 | + // We need to wait the save contact operation finish, to retrieve the contact Id |
24 | + waitContactCreation.contact = contact |
25 | + } |
26 | + |
27 | contactEditor.model.saveContact(contact) |
28 | + |
29 | + // do not pop the page yet |
30 | if (newContact) { |
31 | - pageStack.contactCreated(contact) |
32 | + return; |
33 | } |
34 | } |
35 | pageStack.pop() |
36 | @@ -292,7 +300,10 @@ |
37 | acceptAction: Action { |
38 | text: i18n.tr("Save") |
39 | enabled: !nameEditor.isEmpty |
40 | - onTriggered: contactEditor.save() |
41 | + onTriggered: { |
42 | + toolbar.enabled = false |
43 | + contactEditor.save() |
44 | + } |
45 | } |
46 | rejectAction: Action { |
47 | text: i18n.tr("Cancel") |
48 | @@ -332,4 +343,63 @@ |
49 | nameEditor.forceActiveFocus() |
50 | } |
51 | } |
52 | + |
53 | + // disable interaction while save operation is in progress |
54 | + enabled: !waitScreen.visible |
55 | + Rectangle { |
56 | + id: waitScreen |
57 | + |
58 | + anchors.fill: parent |
59 | + opacity: 0.5 |
60 | + color: "black" |
61 | + visible: (waitContactCreation.contact != null) |
62 | + |
63 | + |
64 | + ActivityIndicator { |
65 | + id: busyIndicator |
66 | + |
67 | + running: waitScreen.visible |
68 | + visible: waitScreen.visible |
69 | + anchors.centerIn: parent |
70 | + } |
71 | + } |
72 | + |
73 | + Connections { |
74 | + id: waitContactCreation |
75 | + |
76 | + property var contact: null |
77 | + |
78 | + target: contact |
79 | + onContactChanged: { |
80 | + var contactId = contact.contactId |
81 | + |
82 | + // WORKAROUND: memory backend does not fill contactId after creation |
83 | + // this is not necessary only during the tests |
84 | + if (contactId === "qtcontacts:::") { |
85 | + var firstName = contact.name.firstName |
86 | + var middleName = contact.name.middleName |
87 | + var lastName = contact.name.lastName |
88 | + |
89 | + for (var i = 0, count = contacts.length; i < count; i++) { |
90 | + var c = contacts[i] |
91 | + if ((c.name.firstName === firstName) && |
92 | + (c.name.middleName === middleName) && |
93 | + (c.name.lastName === lastName)) { |
94 | + contactId = c.contactId |
95 | + break; |
96 | + } |
97 | + } |
98 | + } |
99 | + |
100 | + if (contactId !== "qtcontacts:::") { |
101 | + pageStack.contactCreated(contact) |
102 | + pageStack.pop() |
103 | + pageStack.push(Qt.resolvedUrl("../ContactView/ContactView.qml"), |
104 | + { model: contactEditor.model, |
105 | + contactId: contact.contactId }) |
106 | + } else { |
107 | + pageStack.pop() |
108 | + } |
109 | + } |
110 | + } |
111 | } |
112 | |
113 | === modified file 'src/imports/ContactList/ContactListPage.qml' |
114 | --- src/imports/ContactList/ContactListPage.qml 2014-04-08 20:33:44 +0000 |
115 | +++ src/imports/ContactList/ContactListPage.qml 2014-04-30 20:11:39 +0000 |
116 | @@ -29,7 +29,6 @@ |
117 | property bool pickMode: false |
118 | property bool pickMultipleContacts: false |
119 | property var onlineAccountsMessageDialog: null |
120 | - property QtObject contactIndex: null |
121 | property bool syncEnabled: application.syncEnabled |
122 | property var contactModel: contactList.listModel ? contactList.listModel : null |
123 | |
124 | @@ -200,9 +199,10 @@ |
125 | } |
126 | } |
127 | |
128 | - // WORKAROUND: Avoid the gap btw the header and the contact list when the list moves |
129 | - // see bug #1296764 |
130 | + |
131 | onActiveChanged: { |
132 | + // WORKAROUND: Avoid the gap btw the header and the contact list when the list moves |
133 | + // see bug #1296764 |
134 | contactList.returnToBounds() |
135 | } |
136 | |
137 | @@ -232,17 +232,8 @@ |
138 | {model: contactList.listModel, contactId: contactId, newPhoneNumber: phoneNumber }) |
139 | } |
140 | onContactCreated: { |
141 | - mainPage.contactIndex = contact |
142 | - } |
143 | - } |
144 | - |
145 | - Connections { |
146 | - target: mainPage.contactModel |
147 | - onContactsChanged: { |
148 | - if (contactIndex) { |
149 | - contactList.positionViewAtContact(mainPage.contactIndex) |
150 | - mainPage.contactIndex = null |
151 | - } |
152 | + // save contact to move the list as soon as the contact get created |
153 | + contactList.positionViewAtContact(contact) |
154 | } |
155 | } |
156 | |
157 | |
158 | === modified file 'src/imports/ContactView/ContactDetailWithTypeView.qml' |
159 | --- src/imports/ContactView/ContactDetailWithTypeView.qml 2014-03-10 13:02:59 +0000 |
160 | +++ src/imports/ContactView/ContactDetailWithTypeView.qml 2014-04-30 20:11:39 +0000 |
161 | @@ -25,7 +25,7 @@ |
162 | id: root |
163 | |
164 | property alias typeLabel: view.typeLabel |
165 | - property string typeIcon: null |
166 | + property string typeIcon: "" |
167 | property alias lineHeight: view.lineHeight |
168 | readonly property bool isReady: (fields != null) && (detail != null) |
169 | |
170 | |
171 | === modified file 'tests/autopilot/address_book_app/tests/__init__.py' |
172 | --- tests/autopilot/address_book_app/tests/__init__.py 2014-04-06 19:50:31 +0000 |
173 | +++ tests/autopilot/address_book_app/tests/__init__.py 2014-04-30 20:11:39 +0000 |
174 | @@ -297,6 +297,6 @@ |
175 | objectName="accept") |
176 | self.pointing_device.click_object(accept_button) |
177 | |
178 | - # wait for contact list to be visible again |
179 | - list_page = self.main_window.get_contact_list_page() |
180 | - self.assertThat(list_page.visible, Eventually(Equals(True))) |
181 | + # wait for contact view to appear |
182 | + view_page = self.main_window.get_contact_view_page() |
183 | + self.assertThat(view_page.visible, Eventually(Equals(True))) |
184 | |
185 | === modified file 'tests/autopilot/address_book_app/tests/test_add_contact.py' |
186 | --- tests/autopilot/address_book_app/tests/test_add_contact.py 2014-02-28 15:36:09 +0000 |
187 | +++ tests/autopilot/address_book_app/tests/test_add_contact.py 2014-04-30 20:11:39 +0000 |
188 | @@ -124,9 +124,9 @@ |
189 | # Save contact |
190 | self.main_window.save() |
191 | |
192 | - # Check if the contact list is visible again |
193 | - list_page = self.main_window.get_contact_list_page() |
194 | - self.assertThat(list_page.visible, Eventually(Equals(True))) |
195 | + # Check if the contact view is visible |
196 | + view_page = self.main_window.get_contact_view_page() |
197 | + self.assertThat(view_page.visible, Eventually(Equals(True))) |
198 | |
199 | # Check if contact was added |
200 | list_view = self.main_window.get_contact_list_view() |
201 | @@ -280,9 +280,6 @@ |
202 | # Save contact |
203 | self.main_window.save() |
204 | |
205 | - contacts = self.main_window.select_many("ContactDelegate") |
206 | - self.pointing_device.click_object(contacts[0]) |
207 | - |
208 | # check if contacts was saved with the correct labels |
209 | view_page = self.main_window.get_contact_view_page() |
210 | self.assertThat(view_page.visible, Eventually(Equals(True))) |
211 | @@ -340,9 +337,6 @@ |
212 | # Save contact |
213 | self.main_window.save() |
214 | |
215 | - contacts = self.main_window.select_many("ContactDelegate") |
216 | - self.pointing_device.click_object(contacts[0]) |
217 | - |
218 | # check if contacts was saved with the correct labels |
219 | view_page = self.main_window.get_contact_view_page() |
220 | self.assertThat(view_page.visible, Eventually(Equals(True))) |
FAILED: Continuous integration, rev:167 jenkins. qa.ubuntu. com/job/ address- book-app- ci/512/ jenkins. qa.ubuntu. com/job/ address- book-app- trusty- amd64-ci/ 222 jenkins. qa.ubuntu. com/job/ address- book-app- trusty- armhf-ci/ 222 jenkins. qa.ubuntu. com/job/ address- book-app- trusty- armhf-ci/ 222/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ address- book-app- trusty- i386-ci/ 222 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- trusty- touch/345 jenkins. qa.ubuntu. com/job/ generic- mediumtests- trusty/ 4966 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- mako/317 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- armhf/4570 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- armhf/4570/ artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 6250 jenkins. qa.ubuntu. com/job/ autopilot- testrunner- otto-trusty/ 4284 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- amd64/5140 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- amd64/5140/ artifact/ work/output/ *zip*/output. zip
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/address- book-app- ci/512/ rebuild
http://