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

Adding new widgets to existing Vue components is not made easy #1319

Closed
tylernathanreed opened this issue Feb 2, 2019 · 4 comments
Closed

Comments

@tylernathanreed
Copy link

Here's a number of examples:

1) Resource Table Row

If I wanted to create a package that added a new type of button to be placed on all resource rows, I would have to override the entire resource row component. If another package then wanted to add its own button to resource rows, these two packages would come into conflict.

This would require the developer to override their own resource row to provide the shared modification of each package. Doing so may force them to maintain changes from Nova and both packages.

2) Index Toolbar

The triage of Action Select, Lenses, Filters, and Delete menu are all part of the native Index Vue component. This means that if I wanted to create a package to add a new type of widget (for example, a custom "Create" action that doesn't accept any models as input), I would have to override the entire Index Vue component.

Doing so would immediately cause conflict with any other packages that modify the Index Vue component. It also means that the package developer would have to accommodate any changes made to the native Index Vue component within their own package.

3) Detail Toolbar

Again, adding a new type of widget (that intentionally would not be designed as a resource tool), would require overriding the entire Detail Vue component.

--

Am I totally off base here, or is adding entirely new concepts to Nova subject to a very high risk of compatibility and support issues?

A lot of what I've mentioned here seems solvable. I would think that having a dedicated Vue component to wrap around a lot of the widget-based content, such that one could append to the wrapper without having to modify it, would be extremely valuable.

@dillingham
Copy link
Contributor

Here is a button package https://github.com/dillingham/nova-button/ 🌮 👍

@tylernathanreed
Copy link
Author

tylernathanreed commented Feb 2, 2019

@dillingham

I see, so they implemented a button as a separate field, rather than having to override the resource row actions. That's definitely good to see, and alleviates some of my concerns around (1).

However, do you have any recommendations regarding (2) and (3)?

@dillingham
Copy link
Contributor

dillingham commented Feb 2, 2019

Make a tool for 2, use detail only actions for 3.

Step 4: remember this is an opinionated admin panel not a design framework. And ask questions on discord not on bug tracking :)

@davidhemphill
Copy link
Contributor

  1. We're working on proposals for this.
  2. We don't have plans to implement custom swapping/prepending/appending of components. Like @dillingham said, this is an opinionated admin system, and anything additional can be done in custom tools
  3. Look into resource tools and onlyOnDetail.

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

No branches or pull requests

3 participants