Merge lp:~ubuntu-calendar-dev/ubuntu-calendar-app/NewEvent-Contact into lp:ubuntu-calendar-app
- NewEvent-Contact
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Nicholas Skaggs |
Approved revision: | 321 |
Merged at revision: | 375 |
Proposed branch: | lp:~ubuntu-calendar-dev/ubuntu-calendar-app/NewEvent-Contact |
Merge into: | lp:ubuntu-calendar-app |
Diff against target: |
819 lines (+581/-29) 18 files modified
ContactChoicePopup.qml (+96/-0) NewEvent.qml (+62/-14) click/apparmor.json (+1/-1) click/manifest.json.in (+1/-1) debian/calendar-app-autopilot.install (+1/-0) debian/control (+5/-1) search.svg (+153/-0) tests/autopilot/CMakeLists.txt (+5/-0) tests/autopilot/address_book_service_testability/__init__.py (+18/-0) tests/autopilot/address_book_service_testability/data/backend-store-key-file-data.ini (+12/-0) tests/autopilot/address_book_service_testability/data/vcard.vcf (+7/-0) tests/autopilot/address_book_service_testability/fixture_setup.py (+133/-0) tests/autopilot/address_book_service_testability/helpers.py (+42/-0) tests/autopilot/calendar_app/data.py (+1/-1) tests/autopilot/calendar_app/emulators.py (+25/-10) tests/autopilot/calendar_app/tests/test_custom_proxy_objects.py (+9/-0) tests/autopilot/calendar_app/tests/test_data.py (+1/-1) tests/autopilot/calendar_app/tests/test_new_event.py (+9/-0) |
To merge this branch: | bzr merge lp:~ubuntu-calendar-dev/ubuntu-calendar-app/NewEvent-Contact |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Nicholas Skaggs (community) | Needs Fixing | ||
Kunal Parmar | Pending | ||
Alan Pope πΊπ§π± π¦ | Pending | ||
Mihir Soni | Pending | ||
Review via email:
|
This proposal supersedes a proposal from 2014-06-18.
Commit message
Bug #1295941
User can only add one guest to the Guests input box for a New Event
Now we are showing contact picker to add guest.
Description of the change
Bug #1295941
User can only add one guest to the Guests input box for a New Event
Now we are showing contact picker to add guest.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Mihir Soni (mihirsoni) wrote : Posted in a previous version of this proposal | # |
When i try to click on Add Guest it gives me following output in konsole.
file://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Mihir Soni (mihirsoni) wrote : Posted in a previous version of this proposal | # |
I feel , because of i am testing on desktop it is showing me this error, it should be tested on device.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alan Pope πΊπ§π± π¦ (popey) wrote : Posted in a previous version of this proposal | # |
Tested on nexus 7 2013 and it works fine.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kunal Parmar (pkunal-parmar) wrote : Posted in a previous version of this proposal | # |
looks like i forgot to add dependency, and on desktop we need to install those.
libqt5contacts5
qtdeclarative5-
qtcontact5-galera
i think above is required, can you please check and confirm issue is resolved after adding those/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:290
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alan Pope πΊπ§π± π¦ (popey) wrote : Posted in a previous version of this proposal | # |
After adding those dependencies it works fine on the desktop here too.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:290
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:291
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:292
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:293
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:294
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:295
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Mihir Soni (mihirsoni) wrote : Posted in a previous version of this proposal | # |
I guess this required merge from trunk.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alan Pope πΊπ§π± π¦ (popey) wrote : Posted in a previous version of this proposal | # |
Can we get this merged, tested and landed. With the beta freeze in a few weeks, we need to get it landed for wider testing.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kunal Parmar (pkunal-parmar) wrote : Posted in a previous version of this proposal | # |
> Can we get this merged, tested and landed. With the beta freeze in a few
> weeks, we need to get it landed for wider testing.
There is case for new event which handles test case for guest field.
Now that test case needs to be modified as we are using popup now and also some setup so that popup can be populated from contact db.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:296
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:296
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nicholas Skaggs (nskaggs) wrote : Posted in a previous version of this proposal | # |
Hmm, I'll have a look at this. The new event test needs to support the new contact picker.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nicholas Skaggs (nskaggs) wrote : Posted in a previous version of this proposal | # |
A few questions on the implementation.
Should I be able to add a guest that is not in the list? I currently cannot
Should I be able to add the same guest twice? I can add the guest to the list several times, and it appears duplicated
Should I be able to remove a guest? I currently cannot
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nicholas Skaggs (nskaggs) wrote : Posted in a previous version of this proposal | # |
Also, I cannot add an event without adding a guest:
NewEvent.qml:679: ReferenceError: personEdit is not defined
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nicholas Skaggs (nskaggs) wrote : Posted in a previous version of this proposal | # |
Scratch that; I can't add a guest no matter what it seems...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nicholas Skaggs (nskaggs) wrote : Posted in a previous version of this proposal | # |
Sorry, I meant save an event. I can't save an event with or without a guest.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kunal Parmar (pkunal-parmar) wrote : Posted in a previous version of this proposal | # |
Thanks for feedback.
> A few questions on the implementation.
>
> Should I be able to add a guest that is not in the list? I currently cannot
No, we decided against it, if needed we will add support latter
> Should I be able to add the same guest twice? I can add the guest to the list
> several times, and it appears duplicated
I can add check to avoid duplication
> Should I be able to remove a guest? I currently cannot
We have not thought about it. I will try if it can be easily added
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:297
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kunal Parmar (pkunal-parmar) wrote : Posted in a previous version of this proposal | # |
> Also, I cannot add an event without adding a guest:
>
> NewEvent.qml:679: ReferenceError: personEdit is not defined
looks like some merge conflict or something, I dont see my code there. But I will modify code to resolve it.
Thansk for review
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:298
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:299
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:300
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:302
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:304
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:304
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:305
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nicholas Skaggs (nskaggs) wrote : | # |
I don't seem to be able to add multiple guests at all now/.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:307
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nicholas Skaggs (nskaggs) wrote : | # |
The qml needs correct so more than one guest can be added, then the tests can be updated to select more than one contact.
In addition, I have some concerns about how we display and store the contact. I'm getting back strings with trailing whitespace, and I'm unable to search for a contact properly by first name and last name (I've tried adding a space, a comma, etc).
This is in addition to the fact we cannot add more than one contact at the moment. The tests should work as-is once these details are working.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:308
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:309
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kunal Parmar (pkunal-parmar) wrote : | # |
> The qml needs correct so more than one guest can be added, then the tests can
> be updated to select more than one contact.
i changed a logic a bit, for me now i am abble to add multiple guest and also see those added in event details
>
> In addition, I have some concerns about how we display and store the contact.
> I'm getting back strings with trailing whitespace, and I'm unable to search
> for a contact properly by first name and last name (I've tried adding a space,
> a comma, etc).
i am not sure what you mean, can you elaborate ?
we are storing contact in event attendee structure
attendee.name = contact.
like below, if you have some other suggestion, i will change it.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:311
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nicholas Skaggs (nskaggs) wrote : | # |
Kunal, so the last step is to add contacts so the tests can find and use them. I'll do so and this MP should be good to go. The qml changes all work for me.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nicholas Skaggs (nskaggs) wrote : | # |
Kunal, sorry I was incorrect that it was complete. One more thing to fix.
Try selecting a contact by there full name doesn't work. For instance, imagine a contact called "Ubuntu, User". If I try and select this by typing "Ubuntu", the contact will be displayed. However if I type "User Ubuntu", "Ubuntu User", "Ubuntu, User", etc, the contact disappears. This shouldn't be happening. The comma separation is a bit confusing as well.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:313
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kunal Parmar (pkunal-parmar) wrote : | # |
> Kunal, sorry I was incorrect that it was complete. One more thing to fix.
>
> Try selecting a contact by there full name doesn't work. For instance, imagine
> a contact called "Ubuntu, User". If I try and select this by typing "Ubuntu",
> the contact will be displayed. However if I type "User Ubuntu", "Ubuntu User",
> "Ubuntu, User", etc, the contact disappears. This shouldn't be happening.
yes, this is correct, current filter is searching text with text of name or surname, but not both, so full name search is not working.
it does not looks simple, can you register bug and we handle this issue separalty ?
>The comma separation is a bit confusing as well.
Name String is formatted like this, I am not sure how to display name, may be we need to handle translation as well, please suggest...
text: item ? item.name.firstName + ", " + item.name.lastName : ""
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
I was able to add a couple of guests by picking them from the list, but when I tried adding a third, by searching for a name, the app (qmlscene) crashed.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nicholas Skaggs (nskaggs) wrote : | # |
I fixed the full name searching, which should make the tests pass properly as well as we can search for a user properly :-)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nicholas Skaggs (nskaggs) wrote : | # |
Kunal, I see you did something with the display label; I didn't try it, but my small modification to your original work seems fine to me so I reverted the display label change. Full name searching seems to work just fine now.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:315
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nicholas Skaggs (nskaggs) wrote : | # |
Scratch that Kunal, I like your change better and things still work :-)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:317
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:318
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:319
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nicholas Skaggs (nskaggs) wrote : | # |
Ok, so jenkins fails to see the contact now and I don't see it loading the vcard contact either :-(
- 320. By Nicholas Skaggs
-
rebase to trunk
- 321. By Nicholas Skaggs
-
add more logging to fixture_setup, fix typo to return proper location
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:321
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:321
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) : | # |
Preview Diff
1 | === added file 'ContactChoicePopup.qml' |
2 | --- ContactChoicePopup.qml 1970-01-01 00:00:00 +0000 |
3 | +++ ContactChoicePopup.qml 2014-07-31 19:53:49 +0000 |
4 | @@ -0,0 +1,96 @@ |
5 | +import QtQuick 2.0 |
6 | +import Ubuntu.Components 0.1 |
7 | +import Ubuntu.Components.Popups 0.1 |
8 | +import Ubuntu.Components.ListItems 0.1 |
9 | +import Ubuntu.Components.Themes.Ambiance 0.1 |
10 | +import QtOrganizer 5.0 |
11 | +import QtContacts 5.0 |
12 | + |
13 | +import "Defines.js" as Defines |
14 | + |
15 | +Popover { |
16 | + id: root |
17 | + objectName: "contactPopover" |
18 | + |
19 | + signal contactSelected(var contact); |
20 | + |
21 | + Label { |
22 | + id: noContact |
23 | + anchors.centerIn: parent |
24 | + text: i18n.tr("No contact") |
25 | + visible: contactModel.contacts.length === 0 |
26 | + } |
27 | + |
28 | + UnionFilter { |
29 | + id: filter |
30 | + filters: [ |
31 | + DetailFilter{ |
32 | + detail: ContactDetail.Name |
33 | + field: Name.FirstName |
34 | + matchFlags: Filter.MatchContains |
35 | + value: searchBox.text |
36 | + }, |
37 | + DetailFilter{ |
38 | + detail: ContactDetail.Name |
39 | + field: Name.LastName |
40 | + matchFlags: Filter.MatchContains |
41 | + value: searchBox.text |
42 | + }, |
43 | + DetailFilter{ |
44 | + detail: ContactDetail.DisplayLabel |
45 | + field: DisplayLabel.Label |
46 | + matchFlags: Filter.MatchContains |
47 | + value: searchBox.text |
48 | + } |
49 | + ] |
50 | + } |
51 | + |
52 | + ContactModel { |
53 | + id: contactModel |
54 | + manager: "galera" |
55 | + filter: filter |
56 | + autoUpdate: true |
57 | + } |
58 | + |
59 | + Column { |
60 | + anchors.top: parent.top |
61 | + anchors.left: parent.left |
62 | + anchors.right: parent.right |
63 | + anchors.margins: units.gu(1) |
64 | + |
65 | + NewEventEntryField{ |
66 | + id: searchBox |
67 | + objectName: "contactPopoverInput" |
68 | + focus: true |
69 | + width: parent.width |
70 | + placeholderText: i18n.tr("Search contact") |
71 | + primaryItem: Image { |
72 | + height: parent.height*0.5 |
73 | + width: parent.height*0.5 |
74 | + anchors.verticalCenter: parent.verticalCenter |
75 | + anchors.verticalCenterOffset: -units.gu(0.2) |
76 | + source: Qt.resolvedUrl("search.svg") |
77 | + } |
78 | + } |
79 | + |
80 | + ListView { |
81 | + id: contactList |
82 | + objectName: "contactPopoverList" |
83 | + width: parent.width |
84 | + model: contactModel |
85 | + height: units.gu(30) |
86 | + clip: true |
87 | + delegate: Standard{ |
88 | + objectName: "contactPopoverList%1".arg(index) |
89 | + property var item: contactModel.contacts[index] |
90 | + height: units.gu(4) |
91 | + text: item ? item.displayLabel.label : "" |
92 | + |
93 | + onClicked: { |
94 | + root.contactSelected(item); |
95 | + onClicked: PopupUtils.close(root) |
96 | + } |
97 | + } |
98 | + } |
99 | + } |
100 | +} |
101 | |
102 | === modified file 'NewEvent.qml' |
103 | --- NewEvent.qml 2014-07-24 20:41:24 +0000 |
104 | +++ NewEvent.qml 2014-07-31 19:53:49 +0000 |
105 | @@ -95,9 +95,8 @@ |
106 | if( e.itemType === Type.Event ) { |
107 | if(e.attendees){ |
108 | for( var j = 0 ; j < e.attendees.length ; ++j ) { |
109 | - personEdit.text += e.attendees[j].name; |
110 | - if(j!== e.attendees.length-1) |
111 | - personEdit.text += ","; |
112 | + contactList.array.push(e.attendees[j]); |
113 | + contactModel.append(e.attendees[j]); |
114 | } |
115 | } |
116 | |
117 | @@ -189,14 +188,14 @@ |
118 | |
119 | event.allDay = allDayEventCheckbox.checked; |
120 | |
121 | - |
122 | if( event.itemType === Type.Event ) { |
123 | event.attendees = []; // if Edit remove all attendes & add them again if any |
124 | - if( personEdit.text != "") { |
125 | - var attendee = Qt.createQmlObject("import QtOrganizer 5.0; EventAttendee{}", event, "NewEvent.qml"); |
126 | - attendee.name = personEdit.text; |
127 | - event.setDetail(attendee); |
128 | + var contacts = []; |
129 | + for(var i=0; i < contactList.array.length ; ++i) { |
130 | + var contact = contactList.array[i] |
131 | + contacts.push(contact); |
132 | } |
133 | + event.attendees = contacts; |
134 | |
135 | var recurrenceRule = Defines.recurrenceValue[ recurrenceOption.selectedIndex ]; |
136 | var rule = Qt.createQmlObject("import QtOrganizer 5.0; RecurrenceRule {}", event.recurrence,"NewEvent.qml"); |
137 | @@ -539,12 +538,44 @@ |
138 | objectName: "eventLocationInput" |
139 | } |
140 | |
141 | - NewEventEntryField{ |
142 | - id: personEdit |
143 | + UbuntuShape { |
144 | width: parent.width |
145 | - title: i18n.tr("Guests") |
146 | - objectName: "eventPeopleInput" |
147 | - visible: event.itemType === Type.Event |
148 | + height: contactList.height |
149 | + Column{ |
150 | + id: contactList |
151 | + objectName: "guestList" |
152 | + spacing: units.gu(1) |
153 | + width: parent.width |
154 | + clip: true |
155 | + property var array: [] |
156 | + ListModel{ |
157 | + id: contactModel |
158 | + } |
159 | + Button{ |
160 | + text: i18n.tr("Add Guest") |
161 | + objectName: "addGuestButton" |
162 | + width: parent.width |
163 | + onClicked: { |
164 | + var popup = PopupUtils.open(Qt.resolvedUrl("ContactChoicePopup.qml"), contactList); |
165 | + popup.contactSelected.connect( function(contact) { |
166 | + var t = internal.contactToAttendee(contact); |
167 | + if( !internal.isContactAlreadyAdded(contact) ) { |
168 | + contactModel.append(t); |
169 | + contactList.array.push(t); |
170 | + } |
171 | + }); |
172 | + } |
173 | + } |
174 | + |
175 | + Repeater{ |
176 | + model: contactModel |
177 | + delegate: Standard { |
178 | + objectName: "eventGuest%1".arg(index) |
179 | + height: units.gu(4) |
180 | + text: name |
181 | + } |
182 | + } |
183 | + } |
184 | } |
185 | |
186 | Item { |
187 | @@ -702,12 +733,29 @@ |
188 | Qt.inputMethod.hide() |
189 | titleEdit.focus = false |
190 | locationEdit.focus = false |
191 | - personEdit.focus = false |
192 | startDateInput.focus = false |
193 | startTimeInput.focus = false |
194 | endDateInput.focus = false |
195 | endTimeInput.focus = false |
196 | messageEdit.focus = false |
197 | } |
198 | + |
199 | + function isContactAlreadyAdded(contact) { |
200 | + for(var i=0; i < contactList.array.length ; ++i) { |
201 | + var attendee = contactList.array[i]; |
202 | + if( attendee.attendeeId === contact.contactId) { |
203 | + return true; |
204 | + } |
205 | + } |
206 | + return false; |
207 | + } |
208 | + |
209 | + function contactToAttendee(contact) { |
210 | + var attendee = Qt.createQmlObject("import QtOrganizer 5.0; EventAttendee{}", event, "NewEvent.qml"); |
211 | + attendee.name = contact.displayLabel.label |
212 | + attendee.emailAddress = contact.email.emailAddress; |
213 | + attendee.attendeeId = contact.contactId; |
214 | + return attendee; |
215 | + } |
216 | } |
217 | } |
218 | |
219 | === modified file 'click/apparmor.json' |
220 | --- click/apparmor.json 2014-07-02 12:25:58 +0000 |
221 | +++ click/apparmor.json 2014-07-31 19:53:49 +0000 |
222 | @@ -1,4 +1,4 @@ |
223 | { |
224 | - "policy_groups": ["calendar", "networking"], |
225 | + "policy_groups": ["calendar", "networking", "contacts"], |
226 | "policy_version": 1.2 |
227 | } |
228 | |
229 | === modified file 'click/manifest.json.in' |
230 | --- click/manifest.json.in 2014-07-08 14:08:43 +0000 |
231 | +++ click/manifest.json.in 2014-07-31 19:53:49 +0000 |
232 | @@ -20,7 +20,7 @@ |
233 | "x-test": { |
234 | "autopilot": { |
235 | "autopilot_module": "@AUTOPILOT_DIR@", |
236 | - "depends": ["python3-dateutil"] |
237 | + "depends": ["python3-dateutil", "address-book-service-dummy"] |
238 | } |
239 | } |
240 | } |
241 | |
242 | === modified file 'debian/calendar-app-autopilot.install' |
243 | --- debian/calendar-app-autopilot.install 2014-01-18 23:29:11 +0000 |
244 | +++ debian/calendar-app-autopilot.install 2014-07-31 19:53:49 +0000 |
245 | @@ -1,2 +1,3 @@ |
246 | usr/lib/*/dist-packages/calendar_app/* |
247 | +usr/lib/*/dist-packages/address_book_service_testability/* |
248 | |
249 | |
250 | === modified file 'debian/control' |
251 | --- debian/control 2014-06-11 16:22:57 +0000 |
252 | +++ debian/control 2014-07-31 19:53:49 +0000 |
253 | @@ -22,11 +22,14 @@ |
254 | qtdeclarative5-qtquick2-plugin, |
255 | qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu, |
256 | ${misc:Depends}, |
257 | - libqtorganizer1, |
258 | + libqt5organizer5, |
259 | qtdeclarative5-qtorganizer-plugin, |
260 | qtorganizer5-eds, |
261 | qtdeclarative5-ubuntu-syncmonitor0.1, |
262 | ubuntu-mobile-icons | suru-icon-theme, |
263 | + libqt5contacts5, |
264 | + qtdeclarative5-qtcontacts-plugin, |
265 | + qtcontact5-galera, |
266 | Description: Calendar application for Ubuntu devices |
267 | The Calendar application for Ubuntu devices lets you organise your life your |
268 | way by month, week or daily diary. |
269 | @@ -42,6 +45,7 @@ |
270 | calendar-app (= ${source:Version}), |
271 | python-dateutil, |
272 | ubuntu-ui-toolkit-autopilot, |
273 | + address-book-service-dummy |
274 | Description: Autopilot tests for Ubuntu Calendar Application |
275 | This package contains autopilot tests for the Ubuntu Calendar application. |
276 | |
277 | |
278 | === added file 'search.svg' |
279 | --- search.svg 1970-01-01 00:00:00 +0000 |
280 | +++ search.svg 2014-07-31 19:53:49 +0000 |
281 | @@ -0,0 +1,153 @@ |
282 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
283 | +<!-- Created with Inkscape (http://www.inkscape.org/) --> |
284 | + |
285 | +<svg |
286 | + xmlns:dc="http://purl.org/dc/elements/1.1/" |
287 | + xmlns:cc="http://creativecommons.org/ns#" |
288 | + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
289 | + xmlns:svg="http://www.w3.org/2000/svg" |
290 | + xmlns="http://www.w3.org/2000/svg" |
291 | + xmlns:xlink="http://www.w3.org/1999/xlink" |
292 | + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" |
293 | + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" |
294 | + width="90" |
295 | + height="90.000015" |
296 | + id="svg3133" |
297 | + version="1.1" |
298 | + inkscape:version="0.48+devel r12262" |
299 | + sodipodi:docname="search.svg"> |
300 | + <defs |
301 | + id="defs3135"> |
302 | + <linearGradient |
303 | + inkscape:collect="always" |
304 | + id="linearGradient3803"> |
305 | + <stop |
306 | + style="stop-color:#e7e5e5;stop-opacity:1;" |
307 | + offset="0" |
308 | + id="stop3805" /> |
309 | + <stop |
310 | + style="stop-color:#e2dfdf;stop-opacity:1" |
311 | + offset="1" |
312 | + id="stop3807" /> |
313 | + </linearGradient> |
314 | + <linearGradient |
315 | + inkscape:collect="always" |
316 | + xlink:href="#linearGradient3803" |
317 | + id="linearGradient3809" |
318 | + x1="53.012165" |
319 | + y1="-102.79017" |
320 | + x2="53.012165" |
321 | + y2="-66.661224" |
322 | + gradientUnits="userSpaceOnUse" /> |
323 | + <linearGradient |
324 | + inkscape:collect="always" |
325 | + xlink:href="#linearGradient3803" |
326 | + id="linearGradient3813" |
327 | + gradientUnits="userSpaceOnUse" |
328 | + x1="53.012165" |
329 | + y1="-102.79017" |
330 | + x2="53.012165" |
331 | + y2="-66.661224" |
332 | + gradientTransform="translate(-625,0)" /> |
333 | + </defs> |
334 | + <sodipodi:namedview |
335 | + id="base" |
336 | + pagecolor="#ffffff" |
337 | + bordercolor="#666666" |
338 | + borderopacity="1.0" |
339 | + inkscape:pageopacity="0.0" |
340 | + inkscape:pageshadow="2" |
341 | + inkscape:zoom="7.9580781" |
342 | + inkscape:cx="47.57328" |
343 | + inkscape:cy="40.531144" |
344 | + inkscape:document-units="px" |
345 | + inkscape:current-layer="g3842" |
346 | + showgrid="true" |
347 | + inkscape:window-width="1920" |
348 | + inkscape:window-height="1029" |
349 | + inkscape:window-x="0" |
350 | + inkscape:window-y="24" |
351 | + inkscape:window-maximized="1" |
352 | + inkscape:snap-grids="true" |
353 | + inkscape:snap-global="true" |
354 | + fit-margin-top="0" |
355 | + fit-margin-left="0" |
356 | + fit-margin-right="0" |
357 | + fit-margin-bottom="0" |
358 | + inkscape:snap-bbox="true" |
359 | + inkscape:bbox-paths="true" |
360 | + inkscape:bbox-nodes="true" |
361 | + inkscape:snap-bbox-edge-midpoints="true" |
362 | + inkscape:snap-bbox-midpoints="true" |
363 | + inkscape:object-paths="true" |
364 | + inkscape:snap-intersection-paths="true" |
365 | + inkscape:snap-midpoints="true" |
366 | + inkscape:snap-smooth-nodes="true" |
367 | + inkscape:object-nodes="true" |
368 | + inkscape:snap-object-midpoints="true" |
369 | + inkscape:snap-center="true"> |
370 | + <inkscape:grid |
371 | + type="xygrid" |
372 | + id="grid3016" |
373 | + empspacing="6" |
374 | + visible="true" |
375 | + enabled="true" |
376 | + snapvisiblegridlinesonly="true" |
377 | + originx="-2.98e-06px" |
378 | + originy="2.6171874e-06px" /> |
379 | + </sodipodi:namedview> |
380 | + <metadata |
381 | + id="metadata3138"> |
382 | + <rdf:RDF> |
383 | + <cc:Work |
384 | + rdf:about=""> |
385 | + <dc:format>image/svg+xml</dc:format> |
386 | + <dc:type |
387 | + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> |
388 | + <dc:title /> |
389 | + </cc:Work> |
390 | + </rdf:RDF> |
391 | + </metadata> |
392 | + <g |
393 | + inkscape:label="Layer 1" |
394 | + inkscape:groupmode="layer" |
395 | + id="layer1" |
396 | + transform="translate(-2.98e-6,-962.36219)" |
397 | + style="display:inline"> |
398 | + <g |
399 | + transform="matrix(0.99934414,0,0,1,-106.92982,549.00002)" |
400 | + id="g3842" |
401 | + style="display:inline"> |
402 | + <rect |
403 | + style="opacity:0.05;color:#000000;fill:none;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
404 | + id="rect3844" |
405 | + width="90.059067" |
406 | + height="90.000015" |
407 | + x="107" |
408 | + y="-503.36218" |
409 | + transform="scale(1,-1)" /> |
410 | + <path |
411 | + sodipodi:type="arc" |
412 | + style="color:#000000;fill:none;stroke:#808080;stroke-width:10.49972248;stroke-miterlimit:4;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
413 | + id="path2995" |
414 | + sodipodi:cx="35.999996" |
415 | + sodipodi:cy="36.500011" |
416 | + sodipodi:rx="33" |
417 | + sodipodi:ry="33.5" |
418 | + d="m 68.999996,36.500011 a 33,33.5 0 1 1 -65.9999998,0 A 33,33.5 0 1 1 68.999996,36.500011 Z" |
419 | + transform="matrix(0.86331274,0,0,0.85161915,120.95028,427.27807)" /> |
420 | + <path |
421 | + style="font-size:xx-small;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#808080;fill-opacity:1;stroke:none;stroke-width:6;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" |
422 | + d="m 175.1697,477.23717 -4.25279,4.25 12.00787,12 L 187.17757,489.23717 Z" |
423 | + id="path3765" |
424 | + inkscape:connector-curvature="0" |
425 | + sodipodi:nodetypes="ccccc" /> |
426 | + <path |
427 | + style="font-size:xx-small;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#808080;fill-opacity:1;stroke:none;stroke-width:11.80387211;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" |
428 | + d="m 180.97203,481.40625 c -2.32437,0.012 -4.57033,1.53501 -5.44162,3.68994 -0.87128,2.15492 -0.31496,4.81092 1.34787,6.43506 l 8.79632,8.79991 c 4.02735,4.27401 4.89575,3.69726 8.46955,0.1258 3.57381,-3.57146 4.15747,-4.18909 -0.1258,-8.46955 l -8.79632,-8.79991 C 184.12024,482.05781 182.55003,481.39971 180.97203,481.40625 Z" |
429 | + id="path3767" |
430 | + inkscape:connector-curvature="0" |
431 | + sodipodi:nodetypes="cscczccc" /> |
432 | + </g> |
433 | + </g> |
434 | +</svg> |
435 | |
436 | === modified file 'tests/autopilot/CMakeLists.txt' |
437 | --- tests/autopilot/CMakeLists.txt 2014-01-18 23:29:11 +0000 |
438 | +++ tests/autopilot/CMakeLists.txt 2014-07-31 19:53:49 +0000 |
439 | @@ -5,4 +5,9 @@ |
440 | install(DIRECTORY ${AUTOPILOT_DIR} |
441 | DESTINATION ${PYTHON_PACKAGE_DIR} |
442 | ) |
443 | + |
444 | +#add depends |
445 | +install(DIRECTORY address_book_service_testability |
446 | + DESTINATION ${PYTHON_PACKAGE_DIR} |
447 | + ) |
448 | endif(INSTALL_TESTS) |
449 | |
450 | === added directory 'tests/autopilot/address_book_service_testability' |
451 | === added file 'tests/autopilot/address_book_service_testability/__init__.py' |
452 | --- tests/autopilot/address_book_service_testability/__init__.py 1970-01-01 00:00:00 +0000 |
453 | +++ tests/autopilot/address_book_service_testability/__init__.py 2014-07-31 19:53:49 +0000 |
454 | @@ -0,0 +1,18 @@ |
455 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
456 | +# |
457 | +# Copyright (C) 2014 Canonical |
458 | +# Author: Omer Akram <omer.akram@canonical.com> |
459 | +# |
460 | +# This program is free software: you can redistribute it and/or modify |
461 | +# it under the terms of the GNU General Public License as published by |
462 | +# the Free Software Foundation, either version 3 of the License, or |
463 | +# (at your option) any later version. |
464 | +# |
465 | +# This program is distributed in the hope that it will be useful, |
466 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
467 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
468 | +# GNU General Public License for more details. |
469 | +# |
470 | +# You should have received a copy of the GNU General Public License |
471 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
472 | +# |
473 | |
474 | === added directory 'tests/autopilot/address_book_service_testability/data' |
475 | === added file 'tests/autopilot/address_book_service_testability/data/backend-store-key-file-data.ini' |
476 | --- tests/autopilot/address_book_service_testability/data/backend-store-key-file-data.ini 1970-01-01 00:00:00 +0000 |
477 | +++ tests/autopilot/address_book_service_testability/data/backend-store-key-file-data.ini 2014-07-31 19:53:49 +0000 |
478 | @@ -0,0 +1,12 @@ |
479 | +#export FOLKS_BACKEND_KEY_FILE_PATH |
480 | +[0] |
481 | +__alias=Renato Araujo |
482 | +msn=renato@msn.com |
483 | + |
484 | +[1] |
485 | +__alias=Rodrigo Almeida |
486 | +msn=kiko@msn.com |
487 | + |
488 | +[2] |
489 | +__alias=Raphael Almeida |
490 | +msn=rafa@msn.com |
491 | |
492 | === added file 'tests/autopilot/address_book_service_testability/data/vcard.vcf' |
493 | --- tests/autopilot/address_book_service_testability/data/vcard.vcf 1970-01-01 00:00:00 +0000 |
494 | +++ tests/autopilot/address_book_service_testability/data/vcard.vcf 2014-07-31 19:53:49 +0000 |
495 | @@ -0,0 +1,7 @@ |
496 | +BEGIN:VCARD |
497 | +VERSION:3.0 |
498 | +N:User;UX; |
499 | +FN:UX User |
500 | +TEL:3333333 |
501 | +END:VCARD |
502 | + |
503 | |
504 | === added file 'tests/autopilot/address_book_service_testability/fixture_setup.py' |
505 | --- tests/autopilot/address_book_service_testability/fixture_setup.py 1970-01-01 00:00:00 +0000 |
506 | +++ tests/autopilot/address_book_service_testability/fixture_setup.py 2014-07-31 19:53:49 +0000 |
507 | @@ -0,0 +1,133 @@ |
508 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
509 | +# |
510 | +# Copyright (C) 2014 Canonical |
511 | +# Author: Omer Akram <omer.akram@canonical.com> |
512 | +# |
513 | +# This program is free software: you can redistribute it and/or modify |
514 | +# it under the terms of the GNU General Public License as published by |
515 | +# the Free Software Foundation, either version 3 of the License, or |
516 | +# (at your option) any later version. |
517 | +# |
518 | +# This program is distributed in the hope that it will be useful, |
519 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
520 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
521 | +# GNU General Public License for more details. |
522 | +# |
523 | +# You should have received a copy of the GNU General Public License |
524 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
525 | +# |
526 | + |
527 | +import os |
528 | +import subprocess |
529 | +import sysconfig |
530 | +import time |
531 | + |
532 | +from fixtures import EnvironmentVariable, Fixture |
533 | + |
534 | + |
535 | +def get_service_library_path(): |
536 | + """Return path of address-book-service binary directory.""" |
537 | + architecture = sysconfig.get_config_var('MULTIARCH') |
538 | + |
539 | + return os.path.join( |
540 | + '/usr/lib/', |
541 | + architecture, |
542 | + 'address-book-service/') |
543 | + |
544 | + |
545 | +class AddressBookServiceDummyBackend(Fixture): |
546 | + """Fixture to load test vcard for client applications |
547 | + |
548 | + Call the fixture without any paramter to load a default vcard |
549 | + |
550 | + :parameter vcard: call the fixture with a vcard to be used by |
551 | + test application. |
552 | + |
553 | + """ |
554 | + def __init__(self, vcard=None): |
555 | + self.contact_data = vcard |
556 | + |
557 | + def setUp(self): |
558 | + super(AddressBookServiceDummyBackend, self).setUp() |
559 | + self.useFixture(SetupEnvironmentVariables(self.contact_data)) |
560 | + self.useFixture(RestartService()) |
561 | + |
562 | + |
563 | +class SetupEnvironmentVariables(Fixture): |
564 | + |
565 | + def __init__(self, vcard): |
566 | + self.vcard = vcard |
567 | + |
568 | + def setUp(self): |
569 | + super(SetupEnvironmentVariables, self).setUp() |
570 | + self._setup_environment() |
571 | + |
572 | + def _setup_environment(self): |
573 | + self.useFixture(EnvironmentVariable( |
574 | + 'ALTERNATIVE_CPIM_SERVICE_NAME', 'com.canonical.test.pim')) |
575 | + self.useFixture(EnvironmentVariable( |
576 | + 'FOLKS_BACKEND_PATH', |
577 | + os.path.join(get_service_library_path(), 'dummy.so'))) |
578 | + self.useFixture(EnvironmentVariable('FOLKS_BACKENDS_ALLOWED', 'dummy')) |
579 | + self.useFixture(EnvironmentVariable('FOLKS_PRIMARY_STORE', 'dummy')) |
580 | + self.useFixture(EnvironmentVariable( |
581 | + 'ADDRESS_BOOK_SERVICE_DEMO_DATA', |
582 | + self._get_vcard_location())) |
583 | + |
584 | + def _get_vcard_location(self): |
585 | + if self.vcard: |
586 | + return self.vcard |
587 | + |
588 | + local_location = os.path.dirname(os.path.dirname(os.getcwd())) |
589 | + local_location = os.path.join( |
590 | + local_location, |
591 | + 'tests/autopilot/address_book_service_testability/data/vcard.vcf') |
592 | + phablet_location = 'address_book_service_testability/data/vcard.vcf' |
593 | + bin_location = '/usr/share/address-book-service/data/vcard.vcf' |
594 | + cal_location = os.path.join('/usr/lib/python2.7/dist-packages/', |
595 | + 'address_book_service_testability/data/', |
596 | + 'vcard.vcf') |
597 | + if os.path.exists(local_location): |
598 | + print('Using %s for vcard' % local_location) |
599 | + return local_location |
600 | + elif os.path.exists(phablet_location): |
601 | + print('Using %s for vcard' % phablet_location) |
602 | + return phablet_location |
603 | + elif os.path.exists(cal_location): |
604 | + print('Using %s for vcard' % cal_location) |
605 | + return cal_location |
606 | + elif os.path.exists(bin_location): |
607 | + print('Using %s for vcard' % bin_location) |
608 | + return bin_location |
609 | + else: |
610 | + raise RuntimeError('No VCARD found in %s or %s or %s or %s' % |
611 | + (local_location, bin_location, |
612 | + cal_location, phablet_location)) |
613 | + |
614 | + |
615 | +class RestartService(Fixture): |
616 | + |
617 | + def setUp(self): |
618 | + super(RestartService, self).setUp() |
619 | + self.addCleanup(self._kill_address_book_service) |
620 | + self._restart_address_book_service() |
621 | + |
622 | + def _kill_address_book_service(self): |
623 | + try: |
624 | + pid = subprocess.check_output( |
625 | + ['pidof', 'address-book-service']).strip() |
626 | + subprocess.call(['kill', '-3', pid]) |
627 | + except subprocess.CalledProcessError: |
628 | + # Service not running, so do nothing. |
629 | + pass |
630 | + |
631 | + def _restart_address_book_service(self): |
632 | + self._kill_address_book_service() |
633 | + path = os.path.join( |
634 | + get_service_library_path(), 'address-book-service') |
635 | + |
636 | + subprocess.Popen([path]) |
637 | + # FIXME: Wait for 5 seconds before proceeding so that the |
638 | + # service starts,doing this because the dbus interface is |
639 | + # not reliable enough it seems. --om26er 23-07-2014 |
640 | + time.sleep(5) |
641 | |
642 | === added file 'tests/autopilot/address_book_service_testability/helpers.py' |
643 | --- tests/autopilot/address_book_service_testability/helpers.py 1970-01-01 00:00:00 +0000 |
644 | +++ tests/autopilot/address_book_service_testability/helpers.py 2014-07-31 19:53:49 +0000 |
645 | @@ -0,0 +1,42 @@ |
646 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
647 | +# |
648 | +# Copyright 2014 Canonical Ltd. |
649 | +# |
650 | +# This file is part of address-book-service tests. |
651 | +# |
652 | +# This program is free software; you can redistribute it and/or modify |
653 | +# it under the terms of the GNU General Public License version 3, as published |
654 | +# by the Free Software Foundation. |
655 | +# |
656 | +# This program is distributed in the hope that it will be useful, |
657 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
658 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
659 | +# GNU General Public License for more details. |
660 | +# |
661 | +# You should have received a copy of the GNU General Public License |
662 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
663 | + |
664 | +import dbus |
665 | + |
666 | +DBUS_IFACE_ADD_BOOK = 'com.canonical.pim.AddressBook' |
667 | +DBUS_IFACE_ADD_BOOKVIEW = 'com.canonical.pim.AddressBookView' |
668 | + |
669 | +bus = dbus.SessionBus() |
670 | + |
671 | + |
672 | +def query_contacts(fields='', query='', sources=[]): |
673 | + iface = _get_contacts_dbus_service_iface() |
674 | + view_path = iface.query(fields, query, []) |
675 | + view = bus.get_object( |
676 | + 'com.canonical.pim', view_path) |
677 | + view_iface = dbus.Interface( |
678 | + view, dbus_interface=DBUS_IFACE_ADD_BOOKVIEW) |
679 | + contacts = view_iface.contactsDetails([], 0, -1) |
680 | + view.close() |
681 | + return contacts |
682 | + |
683 | + |
684 | +def _get_contacts_dbus_service_iface(): |
685 | + proxy = bus.get_object( |
686 | + 'com.canonical.pim', '/com/canonical/pim/AddressBook') |
687 | + return dbus.Interface(proxy, 'com.canonical.pim.AddressBook') |
688 | |
689 | === modified file 'tests/autopilot/calendar_app/data.py' |
690 | --- tests/autopilot/calendar_app/data.py 2014-07-23 18:17:21 +0000 |
691 | +++ tests/autopilot/calendar_app/data.py 2014-07-31 19:53:49 +0000 |
692 | @@ -55,5 +55,5 @@ |
693 | name = 'Test event {}'.format(unique_id) |
694 | description = 'Test description {}.'.format(unique_id) |
695 | location = 'Test location {}'.format(unique_id) |
696 | - guests = ['Test guest {} 1'.format(unique_id)] |
697 | + guests = ['UX User'] |
698 | return cls(calendar, name, description, location, guests) |
699 | |
700 | === modified file 'tests/autopilot/calendar_app/emulators.py' |
701 | --- tests/autopilot/calendar_app/emulators.py 2014-07-30 23:35:10 +0000 |
702 | +++ tests/autopilot/calendar_app/emulators.py 2014-07-31 19:53:49 +0000 |
703 | @@ -483,13 +483,22 @@ |
704 | def _fill_location(self, value): |
705 | self._ensure_entry_field_visible_and_write('eventLocationInput', value) |
706 | |
707 | - def _fill_guests(self, value): |
708 | - if len(value) > 1: |
709 | - # See bug http://pad.lv/1295941 |
710 | - raise CalendarException( |
711 | - 'It is not yet possible to add more than one guest.') |
712 | - self._ensure_entry_field_visible_and_write( |
713 | - 'eventPeopleInput', value[0]) |
714 | + def _fill_guests(self, guests): |
715 | + guests_btn = self.select_single('Button', objectName='addGuestButton') |
716 | + main_view = self.get_root_instance().select_single(MainView) |
717 | + |
718 | + for guest in guests: |
719 | + self.pointing_device.click_object(guests_btn) |
720 | + guest_input = main_view.select_single( |
721 | + NewEventEntryField, objectName='contactPopoverInput') |
722 | + contacts = main_view.select_single(ubuntuuitoolkit.QQuickListView, |
723 | + objectName='contactPopoverList') |
724 | + guest_input.write(guest) |
725 | + |
726 | + try: |
727 | + contacts.click_element('contactPopoverList0') |
728 | + except ubuntuuitoolkit.ToolkitException: |
729 | + raise CalendarException('No guest found with name %s' % guest) |
730 | |
731 | def _select_calendar(self, calendar): |
732 | self._get_calendar().select_option('Label', text=calendar) |
733 | @@ -498,6 +507,14 @@ |
734 | return self.select_single(ubuntuuitoolkit.OptionSelector, |
735 | objectName="calendarsOption") |
736 | |
737 | + def _get_guests(self): |
738 | + guestlist = self.select_single('QQuickColumn', objectName='guestList') |
739 | + guests = guestlist.select_many('Standard') |
740 | + guest_names = [] |
741 | + for guest in guests: |
742 | + guest_names.append(guest.text) |
743 | + return guest_names |
744 | + |
745 | def _get_form_values(self): |
746 | # TODO get start date and end date, is all day event, recurrence and |
747 | # reminders. --elopio - 2014-06-26 |
748 | @@ -505,9 +522,7 @@ |
749 | name = self._get_new_event_entry_field('newEventName').text |
750 | description = self._get_description_text_area().text |
751 | location = self._get_new_event_entry_field('eventLocationInput').text |
752 | - # TODO once bug http://pad.lv/1295941 is fixed, we will have to build |
753 | - # the list of guests. --elopio - 2014-06-26 |
754 | - guests = [self._get_new_event_entry_field('eventPeopleInput').text] |
755 | + guests = self._get_guests() |
756 | return data.Event(calendar, name, description, location, guests) |
757 | |
758 | @autopilot.logging.log_action(logger.info) |
759 | |
760 | === modified file 'tests/autopilot/calendar_app/tests/test_custom_proxy_objects.py' |
761 | --- tests/autopilot/calendar_app/tests/test_custom_proxy_objects.py 2014-06-26 23:35:22 +0000 |
762 | +++ tests/autopilot/calendar_app/tests/test_custom_proxy_objects.py 2014-07-31 19:53:49 +0000 |
763 | @@ -15,10 +15,19 @@ |
764 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
765 | |
766 | from calendar_app import data, tests |
767 | +from address_book_service_testability import fixture_setup |
768 | |
769 | |
770 | class NewEventFormTestCase(tests.CalendarTestCase): |
771 | |
772 | + # TODO once address_book_service_testability is packaged, remove |
773 | + # packing the modules as part of testcase |
774 | + |
775 | + def setUp(self): |
776 | + contacts_backend = fixture_setup.AddressBookServiceDummyBackend() |
777 | + self.useFixture(contacts_backend) |
778 | + super(NewEventFormTestCase, self).setUp() |
779 | + |
780 | def test_fill_form(self): |
781 | """Test that the form can be filled with event information.""" |
782 | test_event = data.Event.make_unique(unique_id='test uuid') |
783 | |
784 | === modified file 'tests/autopilot/calendar_app/tests/test_data.py' |
785 | --- tests/autopilot/calendar_app/tests/test_data.py 2014-07-23 18:17:21 +0000 |
786 | +++ tests/autopilot/calendar_app/tests/test_data.py 2014-07-31 19:53:49 +0000 |
787 | @@ -28,4 +28,4 @@ |
788 | self.assertEqual(event.name, 'Test event test uuid') |
789 | self.assertEqual(event.description, 'Test description test uuid.') |
790 | self.assertEqual(event.location, 'Test location test uuid') |
791 | - self.assertEqual(event.guests, ['Test guest test uuid 1']) |
792 | + self.assertEqual(event.guests, ['UX User']) |
793 | |
794 | === modified file 'tests/autopilot/calendar_app/tests/test_new_event.py' |
795 | --- tests/autopilot/calendar_app/tests/test_new_event.py 2014-07-31 17:11:18 +0000 |
796 | +++ tests/autopilot/calendar_app/tests/test_new_event.py 2014-07-31 19:53:49 +0000 |
797 | @@ -25,6 +25,7 @@ |
798 | |
799 | from calendar_app import data |
800 | from calendar_app.tests import CalendarTestCase |
801 | +from address_book_service_testability import fixture_setup |
802 | |
803 | |
804 | logger = logging.getLogger(__name__) |
805 | @@ -32,6 +33,14 @@ |
806 | |
807 | class NewEventTestCase(CalendarTestCase): |
808 | |
809 | + # TODO once address_book_service_testability is packaged, remove |
810 | + # packing the modules as part of testcase |
811 | + |
812 | + def setUp(self): |
813 | + contacts_backend = fixture_setup.AddressBookServiceDummyBackend() |
814 | + self.useFixture(contacts_backend) |
815 | + super(NewEventTestCase, self).setUp() |
816 | + |
817 | # TODO add tests for events in the future and in the past, all day event, |
818 | # event with recurrence and event with reminders. |
819 | # also add tests for saving to different calendars |
FAILED: Continuous integration, rev:289 91.189. 93.70:8080/ job/ubuntu- calendar- app-ci/ 557/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 559 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 559/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/ubuntu- calendar- app-utopic- amd64-ci/ 115
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- calendar- app-ci/ 557/rebuild
http://