mail icon indicating copy to clipboard operation
mail copied to clipboard

"create task from email" option should not be there when Tasks app is not installed

Open alexanderdd opened this issue 1 year ago • 7 comments

Steps to reproduce

  1. have mail app installed but not tasks
  2. in a received email, click the ... menu > more actions > create task
  3. modal shows, you enter details
  4. error: could not create task

Expected behavior

the option "create task" should only be there when Tasks app is installed

Actual behavior

  1. error: could not create task

Mail app version

3.7.5

Mailserver or service

No response

Operating system

No response

PHP engine version

None

Web server

None

Database

None

Additional info

NC 29.0.1

alexanderdd avatar Jul 18 '24 14:07 alexanderdd

This is debatable. I don't use the Tasks app at all, I don't have it installed. But I use jtxboard on my Android phone with tasks. So for me it still makes sense to have Create task in Mail.

ChristophWurst avatar Jul 18 '24 17:07 ChristophWurst

This is debatable. I don't use the Tasks app at all, I don't have it installed. But I use jtxboard on my Android phone with tasks. So for me it still makes sense to have Create task in Mail.

Hm, but that seems like quite a corner case. AFAIK Nextcloud tries to use sane defaults for 90% or 99% of users. And my take would be that 99% of users only need this button if Tasks is installed, otherwise it clutters the interface.

In your setup, if my proposal is implemented, you could just install Tasks and never use it in the browser, and continue with jtxboard like before.

An alternative could be to leave the button, but to show a warning "Tasks App is not installed. Ask your Administrator. Continue anyway? YES/NO". But I still believe my original proposal is the best way to go.

alexanderdd avatar Jul 23 '24 14:07 alexanderdd

@jancborchardt what shall be done?

ChristophWurst avatar Jul 24 '24 11:07 ChristophWurst

Why is the "error: could not create task" shown? Since the DAV backend is there, the task could just be created, right?

I agree with @ChristophWurst that this functionality is nice to keep even if the Tasks app is not enabled, also because other apps like Deck or mobile/desktop clients as Christoph said use the same backend.

jancborchardt avatar Jul 24 '24 13:07 jancborchardt

Why is the "error: could not create task" shown? Since the DAV backend is there, the task could just be created, right?

Good question. @alexanderdd could you check the browser console for details?

Possible reasons are

  • Lack of permission (calendar shared by someone and Mail didn't check ACLs)
  • Lack of component type support (calendar does not support VTODO and Mail didn't check)
  • Network error
  • Maintenance mode/upgrade

ChristophWurst avatar Jul 24 '24 14:07 ChristophWurst

Browser console output after clicking "create task" in an email:

14:14:44.612 [ERROR] mail: Creating event from message failed 
Object { app: "mail", uid: "admin", level: 2, error: TypeError }
​
app: "mail"
​
error: TypeError: e.calendar.dav is undefined
​
level: 2
​
uid: "admin"
​
<prototype>: Object { … }
​​
__defineGetter__: function __defineGetter__()
​​
__defineSetter__: function __defineSetter__()
​​
__lookupGetter__: function __lookupGetter__()
​​
__lookupSetter__: function __lookupSetter__()
​​
__proto__: 
​​
constructor: function Object()
​​
hasOwnProperty: function hasOwnProperty()
​​
isPrototypeOf: function isPrototypeOf()
​​
propertyIsEnumerable: function propertyIsEnumerable()
​​
toLocaleString: function toLocaleString()
​​
toString: function toString()
​​
valueOf: function valueOf()
​​
<get __proto__()>: function __proto__()
​​
<set __proto__()>: function __proto__()
ConsoleLogger.js:74:18
    value ConsoleLogger.js:74
    value ConsoleLogger.js:100
    onSave TaskModal.vue:201
    VueJS 33

alexanderdd avatar Aug 01 '24 12:08 alexanderdd

Can reproduce with stable3.7.

Seems fixed with main.

kesselb avatar Oct 16 '24 15:10 kesselb