Merge lp:~nskaggs/ubuntu-calendar-app/fix-1335512 into lp:ubuntu-calendar-app

Proposed by Nicholas Skaggs
Status: Merged
Approved by: Nicholas Skaggs
Approved revision: 344
Merged at revision: 344
Proposed branch: lp:~nskaggs/ubuntu-calendar-app/fix-1335512
Merge into: lp:ubuntu-calendar-app
Diff against target: 109 lines (+57/-2)
4 files modified
DayView.qml (+10/-0)
TimeLineHeaderComponent.qml (+1/-1)
tests/autopilot/calendar_app/emulators.py (+23/-0)
tests/autopilot/calendar_app/tests/test_dayview.py (+23/-1)
To merge this branch: bzr merge lp:~nskaggs/ubuntu-calendar-app/fix-1335512
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Mihir Soni Approve
Review via email: mp+225373@code.launchpad.net

This proposal supersedes a proposal from 2014-07-01.

Commit message

Resolved bug #1335512, add test for it, and fix display issue in timeline header (not displaying full name on current date)

Description of the change

Resolved bug #1335512, add test for it, and fix display issue in timeline header (not displaying full name on current date)

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote : Posted in a previous version of this proposal

This fails due to https://bugs.launchpad.net/ubuntu-calendar-app/+bug/1335241, which affects trunk. Once a fix is released to trunk, I will rebuild this.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote : Posted in a previous version of this proposal

I'd also like to see a test added for this :-)

Revision history for this message
Mihir Soni (mihirsoni) wrote : Posted in a previous version of this proposal

This MR got merged automatically, without any reviews.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote : Posted in a previous version of this proposal

Mihir, this is not in trunk.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote : Posted in a previous version of this proposal
Revision history for this message
Mihir Soni (mihirsoni) wrote :

Looks good to me Nicholas, Thanks a lot.

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

FAILED: Continuous integration, rev:344
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://code.launchpad.net/~nskaggs/ubuntu-calendar-app/fix-1335512/+merge/225373/+edit-commit-message

http://91.189.93.70:8080/job/ubuntu-calendar-app-ci/602/
Executed test runs:
    SUCCESS: http://91.189.93.70:8080/job/generic-mediumtests-utopic/792
        deb: http://91.189.93.70:8080/job/generic-mediumtests-utopic/792/artifact/work/output/*zip*/output.zip
    SUCCESS: http://91.189.93.70:8080/job/ubuntu-calendar-app-utopic-amd64-ci/160

Click here to trigger a rebuild:
http://91.189.93.70:8080/job/ubuntu-calendar-app-ci/602/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'DayView.qml'
2--- DayView.qml 2014-07-02 10:12:09 +0000
3+++ DayView.qml 2014-07-02 18:02:49 +0000
4@@ -38,6 +38,16 @@
5 startX: -(dayHeader.width/7); startY: dayHeader.height/2
6 PathLine { x: (dayHeader.width/7) * 8 ; relativeY: 0; }
7 }
8+ onDateSelected: {
9+ if(date < currentDay){
10+ currentDay = currentDay.addDays(-1);
11+ dayHeader.decrementCurrentIndex()
12+ }
13+ else if( date > currentDay){
14+ currentDay = currentDay.addDays(1);
15+ dayHeader.incrementCurrentIndex();
16+ }
17+ }
18 }
19
20 PathViewBase{
21
22=== modified file 'TimeLineHeaderComponent.qml'
23--- TimeLineHeaderComponent.qml 2014-05-22 13:27:52 +0000
24+++ TimeLineHeaderComponent.qml 2014-07-02 18:02:49 +0000
25@@ -23,7 +23,7 @@
26 delegate: HeaderDateComponent{
27 date: startDay.addDays(index);
28 dayFormat: {
29- if( type == ViewType.ViewTypeWeek || (type == ViewType.ViewTypeDay && !root.isCurrentItem) ) {
30+ if( type == ViewType.ViewTypeWeek || (type == ViewType.ViewTypeDay && !header.isCurrentItem) ) {
31 Locale.ShortFormat
32 } else {
33 Locale.LongFormat
34
35=== modified file 'tests/autopilot/calendar_app/emulators.py'
36--- tests/autopilot/calendar_app/emulators.py 2014-07-01 23:05:14 +0000
37+++ tests/autopilot/calendar_app/emulators.py 2014-07-02 18:02:49 +0000
38@@ -319,6 +319,29 @@
39 event_details_page = self.open_event(name, filter_duplicates)
40 return event_details_page.delete()
41
42+ @autopilot.logging.log_action(logger.info)
43+ def get_day_header(self, day=None):
44+ """Return the dayheader for a given day. If no day is given,
45+ return the current day.
46+
47+ :param day: A datetime object matching the header
48+ :return: The day header object
49+ """
50+ if day:
51+ headers = self.select_many('TimeLineHeaderComponent')
52+ for header in headers:
53+ if header.startDay.datetime == day:
54+ day_header = header
55+ break
56+ else:
57+ # just grab the current day
58+ day_header = self.wait_select_single(
59+ 'TimeLineHeaderComponent', isCurrentItem=True)
60+
61+ if not(day_header):
62+ raise CalendarException('Day Header not found for %s' % day)
63+ return day_header
64+
65
66 class EventBubble(toolkit_emulators.UbuntuUIToolkitEmulatorBase):
67
68
69=== modified file 'tests/autopilot/calendar_app/tests/test_dayview.py'
70--- tests/autopilot/calendar_app/tests/test_dayview.py 2014-07-01 17:28:32 +0000
71+++ tests/autopilot/calendar_app/tests/test_dayview.py 2014-07-02 18:02:49 +0000
72@@ -61,7 +61,7 @@
73
74 """
75
76- days = self.day_view.select_many(objectName="dateLabel")
77+ days = self.day_view.select_many(objectName='dateLabel')
78 days = [int(day.text) for day in days]
79
80 now = datetime.datetime.now()
81@@ -74,6 +74,28 @@
82 self.assertIn(tomorrow, days)
83 self.assertIn(yesterday, days)
84
85+ def test_switch_day_by_tapping(self):
86+ """Selecting a day by touching the screen should also switch the day"""
87+ today = self.day_view.get_day_header().startDay.datetime
88+
89+ # click yesterday
90+ yesterday = (today - datetime.timedelta(days=1))
91+ yesterday_header = self.day_view.get_day_header(yesterday)
92+
93+ self.assertThat(yesterday_header.isCurrentItem, Equals(False))
94+ self.pointing_device.click_object(yesterday_header)
95+ self.assertThat(yesterday_header.isCurrentItem,
96+ Eventually(Equals(True)))
97+
98+ # click tomorrow
99+ tomorrow = (yesterday + datetime.timedelta(days=1))
100+ tomorrow_header = self.day_view.get_day_header(tomorrow)
101+
102+ self.assertThat(tomorrow_header.isCurrentItem, Equals(False))
103+ self.pointing_device.click_object(tomorrow_header)
104+ self.assertThat(tomorrow_header.isCurrentItem,
105+ Eventually(Equals(True)))
106+
107 def test_show_next_days(self):
108 """It must be possible to show next days by swiping the view."""
109 self._change_days(1)

Subscribers

People subscribed via source and target branches

to status/vote changes: