Merge lp:~renatofilho/ubuntu-calendar-app/fix-1616029 into lp:ubuntu-calendar-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Arthur Mello
Approved revision: 873
Merged at revision: 872
Proposed branch: lp:~renatofilho/ubuntu-calendar-app/fix-1616029
Merge into: lp:ubuntu-calendar-app
Diff against target: 119 lines (+66/-15)
2 files modified
EventRepetition.qml (+6/-1)
NewEvent.qml (+60/-14)
To merge this branch: bzr merge lp:~renatofilho/ubuntu-calendar-app/fix-1616029
Reviewer Review Type Date Requested Status
Jenkins Bot continuous-integration Approve
Arthur Mello (community) Approve
system-apps-ci-bot continuous-integration Approve
Review via email: mp+303836@code.launchpad.net

Commit message

Fix event save with attendee, and recurrence limit

Make sure that Attendee get save after edit an event.
Use UTC date in the event recurrence limit.

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

Fix event save with attendee.

Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

PASSED: Continuous integration, rev:871
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-calendar-app-ci/29/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/1292
    SUCCESS: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/287
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1292
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/1158
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial+overlay/1158
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=yakkety/1158
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1141
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1141/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1141
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1141/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1141
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1141/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1141
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1141/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1141
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1141/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1141
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1141/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1141
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1141/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1141
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1141/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1141
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1141/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-calendar-app-ci/29/rebuild

review: Approve (continuous-integration)
872. By Renato Araujo Oliveira Filho

Use UTC date in the event recurrence limit.

873. By Renato Araujo Oliveira Filho

Fixed remove attendee from a event.

Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

PASSED: Continuous integration, rev:872
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-calendar-app-ci/31/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/1340
    SUCCESS: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/305
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1340
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/1203
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial+overlay/1203
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=yakkety/1203
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1183
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1183/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1183
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1183/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1183
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1183/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1183
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1183/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1183
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1183/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1183
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1183/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1183
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1183/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1183
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1183/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1183
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1183/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-calendar-app-ci/31/rebuild

review: Approve (continuous-integration)
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

PASSED: Continuous integration, rev:873
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-calendar-app-ci/32/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/1342
    SUCCESS: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/306
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1342
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/1205
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial+overlay/1205
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=yakkety/1205
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1185
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1185/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1185
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1185/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1185
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1185/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1185
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1185/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1185
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1185/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1185
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1185/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1185
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1185/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1185
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1185/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1185
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1185/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-calendar-app-ci/32/rebuild

review: Approve (continuous-integration)
Revision history for this message
Arthur Mello (artmello) wrote :

lgtm

review: Approve
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'EventRepetition.qml'
--- EventRepetition.qml 2016-08-05 14:23:25 +0000
+++ EventRepetition.qml 2016-08-26 19:28:25 +0000
@@ -129,7 +129,12 @@
129 rule.limit = parseInt(limitCount.text);129 rule.limit = parseInt(limitCount.text);
130 }130 }
131 else if (limitOptions.selectedIndex === 2 && recurrenceOption.selectedIndex > 0) {131 else if (limitOptions.selectedIndex === 2 && recurrenceOption.selectedIndex > 0) {
132 rule.limit = datePick.date;132 // WORKAROUND: Use UTC format because QML module will convert the date to UTC internally and this
133 // can cause problems if the date is in different TZ.
134 // Use this until this get merged: https://codereview.qt-project.org/#/c/154461/
135 rule.limit = new Date(Date.UTC(datePick.date.getFullYear(),
136 datePick.date.getMonth(),
137 datePick.date.getDate()))
133 }138 }
134 else {139 else {
135 rule.limit = undefined;140 rule.limit = undefined;
136141
=== modified file 'NewEvent.qml'
--- NewEvent.qml 2016-08-05 14:23:25 +0000
+++ NewEvent.qml 2016-08-26 19:28:25 +0000
@@ -159,14 +159,12 @@
159159
160 var index = 0;160 var index = 0;
161161
162 if( e.itemType === Type.Event ) {162 // Use details method to get attendees list instead of "attendees" property
163 // Use details method to get attendees list instead of "attendees" property163 // since a binding issue was returning an empty attendees list for some use cases
164 // since a binding issue was returning an empty attendees list for some use cases164 var attendees = e.details(Detail.EventAttendee);
165 var attendees = e.details(Detail.EventAttendee);165 if (attendees){
166 if(attendees){166 for( var j = 0 ; j < attendees.length ; ++j ) {
167 for( var j = 0 ; j < attendees.length ; ++j ) {167 contactModel.append({"contact": attendees[j]});
168 contactModel.append({"contact": attendees[j]});
169 }
170 }168 }
171 }169 }
172170
@@ -183,6 +181,17 @@
183 selectCalendar(e.collectionId);181 selectCalendar(e.collectionId);
184 }182 }
185183
184 function createAttendee(contact)
185 {
186 var attendee = Qt.createQmlObject("import QtOrganizer 5.0; EventAttendee { }", Qt.application,"NewEvent.qml")
187 attendee.attendeeId = contact.attendeeId
188 attendee.emailAddress = contact.emailAddress
189 attendee.name = contact.name
190 attendee.participationRole = EventAttendee.RoleOptionalParticipant
191 attendee.participationStatus = EventAttendee.StatusUnknown
192 return attendee
193 }
194
186 //Save the new or Existing event195 //Save the new or Existing event
187 function saveToQtPim() {196 function saveToQtPim() {
188 internal.clearFocus()197 internal.clearFocus()
@@ -212,15 +221,52 @@
212 event.description = messageEdit.text;221 event.description = messageEdit.text;
213 event.location = locationEdit.text222 event.location = locationEdit.text
214223
215 if( event.itemType === Type.Event ) {224 if ([Type.Event, Type.EventOccurrence].indexOf(event.itemType) != -1) {
216 var newContacts = []225 var oldAttendee = event.details(Detail.EventAttendee)
226 var newAttendee = []
217 for(var i=0; i < contactModel.count ; ++i) {227 for(var i=0; i < contactModel.count ; ++i) {
218 var contact = contactModel.get(i).contact228 var contact = contactModel.get(i).contact
219 if (contact) {229 if (contact) {
220 newContacts.push(internal.attendeeFromData(contact.attendeeId, contact.name, contact.emailAddress));230 newAttendee.push(contact)
221 }231 }
222 }232 }
223 event.attendees = newContacts;233
234 // look for removed contacts
235 for(var o=0; o < oldAttendee.length; ++o) {
236 var found = false
237 var old = oldAttendee[o]
238 for (var n=0; n < newAttendee.length; ++n) {
239 var new_ = newAttendee[n]
240 if (old.attendeeId == new_.attendeeId) {
241 found = true
242 break
243 }
244 }
245 if (!found) {
246 event.removeDetail(old)
247 }
248 }
249
250 // update list
251 oldAttendee = event.details(Detail.EventAttendee)
252
253 // look for new contacts
254 for(var n=0; n < newAttendee.length; ++n) {
255 var found = false
256 var new_ = newAttendee[n]
257 for(var o=0; o < oldAttendee.length; ++o) {
258 var old = oldAttendee[o]
259 if (old.attendeeId == new_.attendeeId) {
260 found = true
261 break;
262 }
263 }
264
265 if (!found) {
266 var attendee = createAttendee(contact)
267 event.setDetail(attendee)
268 }
269 }
224 }270 }
225271
226 //Set the Rule object to an event272 //Set the Rule object to an event

Subscribers

People subscribed via source and target branches

to status/vote changes: