Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

add ability to import ics attachments into the calendar #1473

Merged
merged 7 commits into from
May 10, 2016

Conversation

ChristophWurst
Copy link
Contributor

@ChristophWurst ChristophWurst commented May 4, 2016

fixes: https://github.com/owncloud/mail/issues/79

TODO:

  • show import button
  • download attachment file
  • select calendar
  • push ics content to the dav endpoint
  • show import button only if caldav is enabled/available
  • add ES6 promise poly fill
  • list only writable calendars

BUGS:

  • fix attachment text width if the import button is shown
  • popover position
  • some .ics file imports fail HTTP/1.1 400 Every VEVENT in this object must have identical UIDs

FUTURE IDEAS

  • Show a preview of the calendar data

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @jakobsack, @DeepDiver1975 and @jancborchardt to be potential reviewers

@ChristophWurst
Copy link
Contributor Author

bildschirmfoto von 2016-05-04 11-32-26
bildschirmfoto von 2016-05-04 11-30-27
bildschirmfoto von 2016-05-04 11-30-19

}
});
var props = [
'{' + dav.NS_DAV + '}displayname',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChristophWurst I assume dav.NS_* are all undefined

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChristophWurst ChristophWurst force-pushed the import-ics-attachments branch 2 times, most recently from 1b6dc31 to f0a470d Compare May 4, 2016 13:50
@ChristophWurst
Copy link
Contributor Author

bildschirmfoto von 2016-05-04 15-52-17

@jancborchardt
Copy link
Contributor

Ooooh that's awesome! :)

I would now even (maybe) for the ics files consolidate the download and save to Files action into a 3-dot menu cause they are leaa important now.

@ChristophWurst
Copy link
Contributor Author

I would now even (maybe) for the ics files consolidate the download and save to Files action into a 3-dot menu cause they are leaa important now.

That's my plan, but I'd rather do that in a follow up PR

@ChristophWurst
Copy link
Contributor Author

@DeepDiver1975 when PUTing the file to the selected calendar, I get the following error:

{"reqId":"dnA7v9MDCVi6pPDB+eeu","remoteAddr":"::1","app":"webdav","message":"Exception: {\"Message\":\"HTTP\\\/1.1 400 Namespace prefix c on calendar-description is not defined\\n on line 5, column 28\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\BadRequest\",\"Code\":0,\"Trace\":\"#0 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpPropFind(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#1 \\\/home\\\/christoph\\\/workspace\\\/owncloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#2 \\\/home\\\/christoph\\\/workspace\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(459): Sabre\\\\Event\\\\EventEmitter->emit('method:PROPFIND', Array)\\n#3 \\\/home\\\/christoph\\\/workspace\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(248): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#4 \\\/home\\\/christoph\\\/workspace\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/server.php(162): Sabre\\\\DAV\\\\Server->exec()\\n#5 \\\/home\\\/christoph\\\/workspace\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(29): OCA\\\\DAV\\\\Server->exec()\\n#6 \\\/home\\\/christoph\\\/workspace\\\/owncloud\\\/remote.php(164): require_once('\\\/home\\\/christoph...')\\n#7 {main}\",\"File\":\"\\\/home\\\/christoph\\\/workspace\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php\",\"Line\":322,\"User\":\"user\"}","level":4,"time":"2016-05-04T10:10:09+00:00","method":"PROPFIND","url":"\/remote.php\/dav\/calendars\/user","user":"user"}

Any idea what I'm doing wrong?

@ChristophWurst ChristophWurst force-pushed the import-ics-attachments branch 2 times, most recently from 3a145ed to 77a944a Compare May 4, 2016 20:57
@ChristophWurst
Copy link
Contributor Author

I'd like to refactor the code a little bit to allow registering different attachment preview generators so we can preview other file types too in the future. To keep this PR reviewable, I will do that in a follow-up PR.

@ChristophWurst ChristophWurst force-pushed the import-ics-attachments branch 2 times, most recently from 3f9d13c to ae0bc70 Compare May 6, 2016 08:43
@ChristophWurst
Copy link
Contributor Author

ChristophWurst commented May 6, 2016

  • TODO: update changelog

@ChristophWurst ChristophWurst force-pushed the import-ics-attachments branch 2 times, most recently from 4b0163b to 6d08fa4 Compare May 6, 2016 09:43
@ChristophWurst
Copy link
Contributor Author

@jyaworski @jancborchardt @Gomez @tahaalibra @DeepDiver1975 this is ready to review :-)

exports: 'dav'
},
ical: {
exports: 'ICAL'
Copy link
Contributor Author

@ChristophWurst ChristophWurst May 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • rebase destroyed the json structure

@ChristophWurst ChristophWurst force-pushed the import-ics-attachments branch 2 times, most recently from f67b033 to 9bc8021 Compare May 6, 2016 10:12
@tahaalibra
Copy link
Contributor

selection_002
it is working great here, it shows the + button

selection_003
but here it doesn't show + button for the same file ( here the difference is that the email was a forwarded email, but in the first case where it is showing + button, it was a new email)

@ChristophWurst
Copy link
Contributor Author

@tahaalibra the + Button is only shown for the MIME type 'text/calendar'. Could you please check the MIME type of that file? I assume it's a different type as the calendar icon is also not shown.

@tahaalibra
Copy link
Contributor

i am talking about file meetup.ics, its the same file on both email (ignore contact_birt..)

@ChristophWurst
Copy link
Contributor Author

Me too. Check the icon, it's not the same ;-) Could you please debug this so we know what exact MIME type the second file has? Thanks

@ChristophWurst ChristophWurst force-pushed the import-ics-attachments branch from d6fa70c to 1876bb9 Compare May 9, 2016 06:52
@Gomez
Copy link
Contributor

Gomez commented May 10, 2016

Works perfect for me. Lets get it in and solve following problems on the way...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants