Merge lp:~renatofilho/address-book-app/fix-1277091 into lp:address-book-app
- fix-1277091
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~renatofilho/address-book-app/fix-1277091 |
Merge into: | lp:address-book-app |
Diff against target: |
197 lines (+51/-33) 5 files modified
src/imports/ContactEdit/ContactEditor.qml (+27/-6) src/imports/ContactList/ContactListPage.qml (+17/-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 | Needs Fixing | |
Ubuntu Phablet Team | Pending | ||
Review via email: mp+216758@code.launchpad.net |
This proposal has been superseded by a proposal from 2014-04-29.
Commit message
Show contact view after create a new contact.
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
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: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: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: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: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: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: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: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: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: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://
- 168. By Renato Araujo Oliveira Filho
- 169. By Renato Araujo Oliveira Filho
-
Wait for contact save before pop the contact edit page.
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-03-26 14:27:36 +0000 |
3 | +++ src/imports/ContactEdit/ContactEditor.qml 2014-04-29 21:12:23 +0000 |
4 | @@ -27,6 +27,7 @@ |
5 | |
6 | property QtObject contact: null |
7 | property alias model: contactFetch.model |
8 | + readonly property bool isNewContact: contact && (contact.contactId === "qtcontacts:::") |
9 | |
10 | // this is used to add a phone number to a existing contact |
11 | property string contactId: "" |
12 | @@ -63,7 +64,7 @@ |
13 | |
14 | // new contact and there is only two details (name, avatar) |
15 | // name and avatar, are not removable details, because of that the contact will have at least 2 details |
16 | - if ((contact.contactId === "qtcontacts:::") && |
17 | + if (isNewContact && |
18 | (contact.contactDetails.length === 2)) { |
19 | |
20 | // if name is empty this means that the contact is empty |
21 | @@ -78,11 +79,13 @@ |
22 | } |
23 | |
24 | if (changed) { |
25 | + var newContact = isNewContact |
26 | // backend error will be handled by the root page (contact list) |
27 | - var newContact = (contact.model == null) |
28 | contactEditor.model.saveContact(contact) |
29 | if (newContact) { |
30 | - pageStack.contactCreated(contact) |
31 | + // wait for contact creation |
32 | + waitContactCreation.contact = contact |
33 | + return |
34 | } |
35 | } |
36 | pageStack.pop() |
37 | @@ -291,7 +294,10 @@ |
38 | acceptAction: Action { |
39 | text: i18n.tr("Save") |
40 | enabled: !nameEditor.isEmpty |
41 | - onTriggered: contactEditor.save() |
42 | + onTriggered: { |
43 | + toolbar.enabled = false |
44 | + contactEditor.save() |
45 | + } |
46 | } |
47 | rejectAction: Action { |
48 | text: i18n.tr("Cancel") |
49 | @@ -327,7 +333,22 @@ |
50 | Component.onCompleted: { |
51 | if (contactId !== "") { |
52 | contactFetch.fetchContact(contactId) |
53 | - } |
54 | - nameEditor.forceActiveFocus() |
55 | + } else if (isNewContact) { |
56 | + nameEditor.forceActiveFocus() |
57 | + } |
58 | + } |
59 | + |
60 | + Connections { |
61 | + id: waitContactCreation |
62 | + |
63 | + property var contact: null |
64 | + |
65 | + target: contact |
66 | + onContactChanged: { |
67 | + if (contact.contactId !== "qtcontacts:::") { |
68 | + pageStack.contactCreated(contact) |
69 | + pageStack.pop() |
70 | + } |
71 | + } |
72 | } |
73 | } |
74 | |
75 | === modified file 'src/imports/ContactList/ContactListPage.qml' |
76 | --- src/imports/ContactList/ContactListPage.qml 2014-04-08 20:33:44 +0000 |
77 | +++ src/imports/ContactList/ContactListPage.qml 2014-04-29 21:12:23 +0000 |
78 | @@ -29,9 +29,10 @@ |
79 | property bool pickMode: false |
80 | property bool pickMultipleContacts: false |
81 | property var onlineAccountsMessageDialog: null |
82 | - property QtObject contactIndex: null |
83 | property bool syncEnabled: application.syncEnabled |
84 | property var contactModel: contactList.listModel ? contactList.listModel : null |
85 | + property var createdContact: null |
86 | + property var contactViewPage: null |
87 | |
88 | function createEmptyContact(phoneNumber) { |
89 | var details = [ {detail: "PhoneNumber", field: "number", value: phoneNumber}, |
90 | @@ -200,10 +201,19 @@ |
91 | } |
92 | } |
93 | |
94 | - // WORKAROUND: Avoid the gap btw the header and the contact list when the list moves |
95 | - // see bug #1296764 |
96 | + |
97 | onActiveChanged: { |
98 | + // WORKAROUND: Avoid the gap btw the header and the contact list when the list moves |
99 | + // see bug #1296764 |
100 | contactList.returnToBounds() |
101 | + |
102 | + // if the createdContact is set we need to show the contact details |
103 | + if (createdContact) { |
104 | + contactViewPage = pageStack.push(Qt.resolvedUrl("../ContactView/ContactView.qml"), |
105 | + {model: contactList.listModel, |
106 | + contactId: createdContact.contactId}) |
107 | + createdContact = null |
108 | + } |
109 | } |
110 | |
111 | onSyncEnabledChanged: { |
112 | @@ -232,17 +242,10 @@ |
113 | {model: contactList.listModel, contactId: contactId, newPhoneNumber: phoneNumber }) |
114 | } |
115 | onContactCreated: { |
116 | - mainPage.contactIndex = contact |
117 | - } |
118 | - } |
119 | - |
120 | - Connections { |
121 | - target: mainPage.contactModel |
122 | - onContactsChanged: { |
123 | - if (contactIndex) { |
124 | - contactList.positionViewAtContact(mainPage.contactIndex) |
125 | - mainPage.contactIndex = null |
126 | - } |
127 | + // save contact to move the list as soon as the contact get created |
128 | + contactList.positionViewAtContact(contact) |
129 | + // save contact to be show when the paget get active |
130 | + mainPage.createdContact = contact |
131 | } |
132 | } |
133 | |
134 | |
135 | === modified file 'src/imports/ContactView/ContactDetailWithTypeView.qml' |
136 | --- src/imports/ContactView/ContactDetailWithTypeView.qml 2014-03-10 13:02:59 +0000 |
137 | +++ src/imports/ContactView/ContactDetailWithTypeView.qml 2014-04-29 21:12:23 +0000 |
138 | @@ -25,7 +25,7 @@ |
139 | id: root |
140 | |
141 | property alias typeLabel: view.typeLabel |
142 | - property string typeIcon: null |
143 | + property string typeIcon: "" |
144 | property alias lineHeight: view.lineHeight |
145 | readonly property bool isReady: (fields != null) && (detail != null) |
146 | |
147 | |
148 | === modified file 'tests/autopilot/address_book_app/tests/__init__.py' |
149 | --- tests/autopilot/address_book_app/tests/__init__.py 2014-04-06 19:50:31 +0000 |
150 | +++ tests/autopilot/address_book_app/tests/__init__.py 2014-04-29 21:12:23 +0000 |
151 | @@ -297,6 +297,6 @@ |
152 | objectName="accept") |
153 | self.pointing_device.click_object(accept_button) |
154 | |
155 | - # wait for contact list to be visible again |
156 | - list_page = self.main_window.get_contact_list_page() |
157 | - self.assertThat(list_page.visible, Eventually(Equals(True))) |
158 | + # wait for contact view to appear |
159 | + view_page = self.main_window.get_contact_view_page() |
160 | + self.assertThat(view_page.visible, Eventually(Equals(True))) |
161 | |
162 | === modified file 'tests/autopilot/address_book_app/tests/test_add_contact.py' |
163 | --- tests/autopilot/address_book_app/tests/test_add_contact.py 2014-02-28 15:36:09 +0000 |
164 | +++ tests/autopilot/address_book_app/tests/test_add_contact.py 2014-04-29 21:12:23 +0000 |
165 | @@ -124,9 +124,9 @@ |
166 | # Save contact |
167 | self.main_window.save() |
168 | |
169 | - # Check if the contact list is visible again |
170 | - list_page = self.main_window.get_contact_list_page() |
171 | - self.assertThat(list_page.visible, Eventually(Equals(True))) |
172 | + # Check if the contact view is visible |
173 | + view_page = self.main_window.get_contact_view_page() |
174 | + self.assertThat(view_page.visible, Eventually(Equals(True))) |
175 | |
176 | # Check if contact was added |
177 | list_view = self.main_window.get_contact_list_view() |
178 | @@ -280,9 +280,6 @@ |
179 | # Save contact |
180 | self.main_window.save() |
181 | |
182 | - contacts = self.main_window.select_many("ContactDelegate") |
183 | - self.pointing_device.click_object(contacts[0]) |
184 | - |
185 | # check if contacts was saved with the correct labels |
186 | view_page = self.main_window.get_contact_view_page() |
187 | self.assertThat(view_page.visible, Eventually(Equals(True))) |
188 | @@ -340,9 +337,6 @@ |
189 | # Save contact |
190 | self.main_window.save() |
191 | |
192 | - contacts = self.main_window.select_many("ContactDelegate") |
193 | - self.pointing_device.click_object(contacts[0]) |
194 | - |
195 | # check if contacts was saved with the correct labels |
196 | view_page = self.main_window.get_contact_view_page() |
197 | 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://