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

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Bill Filler
Approved revision: 781
Merged at revision: 782
Proposed branch: lp:~renatofilho/ubuntu-calendar-app/fix-edit-ocurrence
Merge into: lp:ubuntu-calendar-app
Diff against target: 139 lines (+35/-22)
4 files modified
EventDetails.qml (+22/-10)
EventRepetition.qml (+2/-4)
NewEvent.qml (+11/-7)
TimeLineBaseComponent.qml (+0/-1)
To merge this branch: bzr merge lp:~renatofilho/ubuntu-calendar-app/fix-edit-ocurrence
Reviewer Review Type Date Requested Status
Bill Filler Approve
Jenkins Bot continuous-integration Approve
Review via email: mp+288638@code.launchpad.net

Commit message

Fix edit occurrence.

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

Fix edit occurrence.

Block to change recurrence field of occurrence events.

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
779. By Renato Araujo Oliveira Filho

Remove call of 'setDetails' function.

This function is not necessary anymore.

780. By Renato Araujo Oliveira Filho

Use startDate as base date for recurrence rules.

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
781. By Renato Araujo Oliveira Filho

Fixed yearly recurrence events.

Revision history for this message
Bill Filler (bfiller) wrote :

tested with silo 56 and working

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'EventDetails.qml'
2--- EventDetails.qml 2016-03-02 19:55:52 +0000
3+++ EventDetails.qml 2016-03-14 22:26:03 +0000
4@@ -56,6 +56,23 @@
5 }
6 }
7
8+ Connections{
9+ target: model
10+ onItemsFetched: {
11+ if (internal.fetchParentRequestId === requestId) {
12+ if (fetchedItems.length > 0) {
13+ internal.parentEvent = fetchedItems[0];
14+ updateRecurrence(internal.parentEvent);
15+ updateContacts(internal.parentEvent);
16+ } else {
17+ console.warn("Fail to fetch pareten event")
18+ }
19+ internal.fetchParentRequestId = -1
20+ }
21+
22+ }
23+ }
24+
25 RemindersModel {
26 id: reminderModel
27 }
28@@ -176,17 +193,11 @@
29 }
30 }
31
32- if( e.itemType === Type.EventOccurrence ){
33- var requestId = -1;
34- model.onItemsFetched.connect( function(id,fetchedItems){
35- if(requestId === id && fetchedItems.length > 0) {
36- internal.parentEvent = fetchedItems[0];
37- updateRecurrence(internal.parentEvent);
38- updateContacts(internal.parentEvent);
39- }
40- });
41- requestId = model.fetchItems([e.parentId]);
42+ var isOcurrence = (e.itemType === Type.EventOccurrence) || (e.itemType === Type.TodoOccurrence)
43+ if (isOcurrence) {
44+ internal.fetchParentRequestId = model.fetchItems([e.parentId]);
45 }
46+
47 // This is the event title
48 if( e.displayLabel) {
49 titleLabel.text = e.displayLabel;
50@@ -261,6 +272,7 @@
51
52 QtObject{
53 id: internal
54+ property int fetchParentRequestId: -1;
55 property var parentEvent;
56 }
57
58
59=== modified file 'EventRepetition.qml'
60--- EventRepetition.qml 2016-03-07 17:57:04 +0000
61+++ EventRepetition.qml 2016-03-14 22:26:03 +0000
62@@ -114,11 +114,9 @@
63 rule.daysOfWeek = eventUtils.getDaysOfWeek(recurrenceOption.selectedIndex, weekDays );
64 break;
65 case 6: //monthly
66- rule.daysOfMonth = [eventRoot.date.getDate()];
67+ rule.daysOfMonth = [eventRoot.startDate.getDate()];
68 break;
69 case 7: //yearly
70- rule.monthsOfYear = [eventRoot.date.getMonth()];
71- rule.daysOfMonth = [eventRoot.date.getDate()];
72 break;
73 case 0: //once
74 default:
75@@ -207,7 +205,7 @@
76 (checked) ? weekDays.push(index) : weekDays.splice(weekDays.indexOf(index),1);
77 }
78 checked:{
79- (weekDays.length === 0 && eventRoot.date && (index === eventRoot.date.getDay()) && !isEdit) ? true : false;
80+ (weekDays.length === 0 && eventRoot.startDate && (index === eventRoot.startDate.getDay()) && !isEdit) ? true : false;
81 }
82
83 }
84
85=== modified file 'NewEvent.qml'
86--- NewEvent.qml 2016-03-07 17:57:04 +0000
87+++ NewEvent.qml 2016-03-14 22:26:03 +0000
88@@ -123,7 +123,8 @@
89 //Editing Event
90 function editEvent(e) {
91 //If there is a ReccruenceRule use that , else create fresh Recurrence Object.
92- if(e.itemType === Type.Event && e.recurrence.recurrenceRules[0] !== undefined
93+ var isOcurrence = ((event.itemType === Type.EventOccurrence) || (event.itemType === Type.TodoOccurrence))
94+ if(!isOcurrence && e.recurrence.recurrenceRules[0] !== undefined
95 && e.recurrence.recurrenceRules[0] !== null){
96 rule = e.recurrence.recurrenceRules[0];
97 }
98@@ -208,10 +209,13 @@
99 }
100
101 //Set the Rule object to an event
102- if(rule !== null && rule !== undefined) {
103- event.recurrence.recurrenceRules = [rule]
104- } else {
105- event.recurrence.recurrenceRules = [];
106+ var isOcurrence = ((event.itemType === Type.EventOccurrence) || (event.itemType === Type.TodoOccurrence))
107+ if (!isOcurrence) {
108+ if(rule !== null && rule !== undefined) {
109+ event.recurrence.recurrenceRules = [rule]
110+ } else {
111+ event.recurrence.recurrenceRules = [];
112+ }
113 }
114
115 //remove old reminder value
116@@ -684,9 +688,9 @@
117
118 showDivider: false
119 progression: true
120- visible: (event != undefined) && (event.itemType === Type.Event)
121+ visible: (event != undefined) && ((event.itemType === Type.Event) || (event.itemType === Type.Todo))
122 text: i18n.tr("Repeats")
123- subText: (event != undefined) && (event.itemType === Type.Event) ? rule === null ? Defines.recurrenceLabel[0] : eventUtils.getRecurrenceString(rule) : ""
124+ subText: visible ? rule === null ? Defines.recurrenceLabel[0] : eventUtils.getRecurrenceString(rule) : ""
125 onClicked: {
126 var stack = pageStack
127 if (!stack)
128
129=== modified file 'TimeLineBaseComponent.qml'
130--- TimeLineBaseComponent.qml 2016-03-07 20:35:24 +0000
131+++ TimeLineBaseComponent.qml 2016-03-14 22:26:03 +0000
132@@ -346,7 +346,6 @@
133 dropArea.modifyEventForDrag(drag)
134 var eventBubble = drag.source;
135 eventBubble.assingnBgColor();
136- eventBubble.setDetails();
137
138 if( eventBubble.y + eventBubble.height + units.gu(8) > timeLineView.contentY + timeLineView.height ) {
139 var diff = Math.abs((eventBubble.y + eventBubble.height + units.gu(8)) -

Subscribers

People subscribed via source and target branches

to status/vote changes: