Comments (7)
Hi, see this issue: #15 (comment)
from collapsible-resource-manager.
The solution works but I notice that I have to set the params for the sidebar link to appear. So, if my tool doesn't use params, I have to set an empty array for the link to display.
from collapsible-resource-manager.
I can;t handle to display custom tool inside RawResource, where i should put in my example
" new \Czemu\NovaCalendarTool\NovaCalendarTool " ?
RawResource::make([
'badge' => null,
'icon' => null,
'target' => '_self',
'path' => null,
'params' => [ new \Czemu\NovaCalendarTool\NovaCalendarTool ],
'query' => [ 'foo' => 'bar' ],
'label' => 'NovaCalendarTool',
'name' => 'NovaCalendarTool',
])
or
RawResource::make([
'badge' => null,
'icon' => null,
'target' => '_self',
'path' => new \Czemu\NovaCalendarTool\NovaCalendarTool,
'params' => [],
'query' => [],
'label' => 'NovaCalendarTool',
'name' => 'NovaCalendarTool',
]),
not working
from collapsible-resource-manager.
You shouldn't be putting new \Czemu\NovaCalendarTool\NovaCalendarTool
on the path.. you need to manually set that path your custom tool has registered on the .vue files.. for example:
'path' => /resources/my-custom-tool
from collapsible-resource-manager.
I found the way it works so i will share it here.
In file below i found proper name and path
\vendor\czemu\nova-calendar-tool\resources\js\tool.js
Nova.booting((Vue, router, store) => {
router.addRoutes([
{
name: 'nova-calendar-tool',
path: '/nova-calendar-tool',
component: require('./components/Tool'),
},
]);
})
Then i adapt code like this:
TopLevelResource::make([
'resources' => [
RawResource::make([
'badge' => null,
'icon' => null,
'target' => '_self',
'path' => '/nova-calendar-tool', // from tool.js
'params' => [],
'query' => [],
'label' => 'Any label',
'name' => 'nova-calendar-tool', // from tool.js
]),
],
]),
And it works :-)
from collapsible-resource-manager.
This is fine if the tool is instantiated, but then $tool->renderNavigation() is still called in views/layout.blade.php, so there are double links. But if I don't instantiate the tool then the routing isn't added by the .vue file, so it doesn't work.
So if I want to move a tool into a specific resource group but leave the others, then I could just disable the renderNavigation method. But that means overriding the default template so the whole menu needs to be created via tools().
Did you find a way around this?
from collapsible-resource-manager.
Got the answer from this thread.
Override the renderNavigation method in the tool by extending the class:
return [
new class extends YourTool1 { public function renderNavigation(): string { return ''; } },
]
from collapsible-resource-manager.
Related Issues (20)
- Vertical menu? HOT 4
- Can you add icon support to MenuGroup? HOT 1
- Append HTML to the top of the collapsible block? HOT 2
- Link to a resource on root section click HOT 3
- Incorrect path MenuSection HOT 6
- Fix design issue
- Feature request: Ability to keep default notification & logout & theme
- Dashboards link doesn't works HOT 3
- There is an extra space between resources and menu not sure why? HOT 1
- Resource label type confusion HOT 3
- Group nested resources under another resource
- Error with 1.4 HOT 2
- Syntax error with Group (v1.4.0 & v1.4.1) HOT 2
- Change expand and shrink icons HOT 2
- better understanding of how to use the new badge features to set number from resource? HOT 5
- How can set external link on the top level HOT 1
- Nova 4 compatibility HOT 13
- Nova 4 Support HOT 1
- Class 'App\Providers\Group' not found HOT 2
- Do you support ltr rtl HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from collapsible-resource-manager.