nextcloud/deck

More Dashboard Widgets

Closed this issue · 5 comments

I would like to add more widgets to the Nextcloud Dashboard.
For exaple: Today, Tomorow, this week. Today for user XYZ (Only if I'm Admin and he is not), and so on.

Ist there a easy way to do this? Were can I find the responsible classes and functions (beside lib/Dashboard/DeckWidget.php)?

I think that would be nice to have (cc @Clementine46 @jancborchardt for design/UX input)

Just a general note, curently we don't have a way to register a generic widget type (today for user x) that can be added to the board multiple times. So the only way i would see for this would be to have one widget for the "today by user" and add a user selector to the widget itself, which we would need to talk about how this could be designed first.

The widget class in https://github.com/nextcloud/deck/blob/c87c37f385253829402c6f01b1081e405bc531f1/lib/Dashboard/DeckWidget.php need additional registration in

$context->registerEventListener(BeforeTemplateRenderedEvent::class, BeforeTemplateRenderedListener::class);

The frontend is handled in

OCA.Dashboard.register('deck', (el) => {
const View = Vue.extend(Dashboard)
const vm = new View({
propsData: {},
store,
}).$mount(el)
return vm
})
and the Dashboard Vue component in https://github.com/nextcloud/deck/blob/a9d00f226def7dbbec2a5549431395b34dde595f/src/views/Dashboard.vue

Thank you for the quick respond!

Just a general note, curently we don't have a way to register a generic widget type (today for user x) that can be added to the board multiple times. So the only way i would see for this would be to have one widget for the "today by user" and add a user selector to the widget itself, which we would need to talk about how this could be designed first.

indeed, that was exactly what I had in mind. Is it posible to add the same widget multible times in Nextcloud?

You can only have one instance per widget class. For any extension of that we'd need to think about how we can enhance the server API in that regard. From a general perspective that would make sense I'd say (e.g. for social media widgets you maybe want one widget for each account you have)

Would you mind to open a separate issue for that in https://github.com/nextcloud/server/ so we can discuss this there?

FYI @eneiluj

Shure, I did here

@juliushaertl is there still something to do for me or can we leave it like it is?