tighten / nova-package-development

A forum for talking about the process of Nova Package Development
52 stars 2 forks source link

Nova Relationship Selector #54

Closed chescos closed 5 years ago

chescos commented 6 years ago

Instead of automatically loading all relationship tables on the details view, relationship names are added to a select menu that enables easy and fast navigation with loading on demand.

Relationships are not automatically loaded when the details view is loaded. Instead, a relationship is only loaded when it is selected through the select menu. Only the currently selected relationship table is displayed.

This package would have two main goals:

  1. Significantly improve the loading time of the details view when the resource has 10+ relationships
  2. Improve navigation through many relationships (avoid so much scrolling)

Example:

example-gif

dillingham commented 6 years ago

Nice idea! Would need to a table beneath the details as a separate field component

related

Related::make()->types([
    HasMany::make('Comments'),
    BelongsToMany::make('Accounts'),
    MorphMany::make('Activities'),
])

on dropdown change event change a dynamic component

<component :is="selectedComponent" :resourceName="selectedResource"></component>
chescos commented 6 years ago

@dillingham yes, that's exactly what I mean!

dillingham commented 5 years ago

https://github.com/eminiarts/nova-tabs

bajramemini commented 5 years ago

Hello

https://github.com/eminiarts/nova-relationship-selector

As discussed with @dillingham in our tabs-package, I extracted it to its own package.

Still needs a bit of styling, but the functionality is there.

Regards Bajram

chescos commented 5 years ago

@bajramemini thank you so much for putting that together, just tried it out and it works great! My User model has 27 relationships and finally, I can add them to my User Nova resource.

@dillingham thank you too for communicating with him to make this happen :)

dillingham commented 5 years ago

@bajramemini thanks again for contributing such a useful package!

@chescos no problem :)