Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More Dashboard Widgets #2643

Closed
BKapelari opened this issue Dec 11, 2020 · 5 comments · Fixed by #2658
Closed

More Dashboard Widgets #2643

BKapelari opened this issue Dec 11, 2020 · 5 comments · Fixed by #2658

Comments

@BKapelari
Copy link
Contributor

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)?

@juliusknorr
Copy link
Member

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

@BKapelari
Copy link
Contributor Author

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?

@juliusknorr
Copy link
Member

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

@BKapelari
Copy link
Contributor Author

Shure, I did here

@BKapelari
Copy link
Contributor Author

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

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

Successfully merging a pull request may close this issue.

2 participants