ryangjchandler / filament-navigation Goto Github PK
View Code? Open in Web Editor NEWBuild structured navigation menus in Filament.
License: MIT License
Build structured navigation menus in Filament.
License: MIT License
I am unable to install this package in latest Filament 3.X. Error says it needs Filament 2.X version .
I can create a navigation fine, but when trying to add an item, there's a livewire error:
Livewire Entangle Error: Livewire property ['mountedActionsData.0.type'] cannot be found on component: ['app.filament.resources.navigation-resource.pages.edit-navigation']
Versions:
NB: It also happens even when anything Translatable
related is absent
version 0.5.0 for filament V2 does not have the Spanish translation
Searchable is working now... until you have more than item type. It will display and load the link options for the first resource you choose, but say you clicked the wrong one and go back into the Type select and choose a different resource, it's link options are now empty. You need to close the modal and re-add a menu item (and pick the resource you want first) for it's links to show up.
Hopefully that made sense, here is a quick screen recording:
Hey friend,
Can you reduce the minimal PHP version to 8.0?
Please support v3 filament.
Hey,
Love this package, super useful and extendable! Thanks for your work on it.
I've noticed that when setting a Name for a navigation, the Handle is set automatically, which is slick. But if a user was coming back and updating the name of a navigation, the Handle is still updated again even if it has been specifically set to something.
Example use case: Footer menus
A common footer layout is 3 or 4 columns with a menu in each column. The handles could be named something to be looked up like footer_menu_1, footer_menu_2, footer_menu_3, footer_menu_4.
However, the Names for the fields might be something like Support, About us, etc. If an unsuspecting admin were to want to change the Name of a footer menu, they would quite likely also accidentally update the Handle which would stop the menu showing entirely.
Possible solutions include making the Handle field readonly when editing the menu, or not doing the auto update of the Handle if the Handle already has a value. Similar examples to this are on the Filament website when dealing with slugs here https://v2.filamentphp.com/tricks/generate-slugs-without-overriding
Interested to know your thoughts.
Cheers!
Ralph
Originally posted by yammycode June 8, 2022
Please add the ability for localization!
Updrade it with filament v3
Hello, @ryangjchandler
Registering new types "FilamentNavigation::addItemType()" does not work through AppServiceProvider when using "laravel/octane" and roadrunner
Not sure if this is an issue just on my machine or not, but when saving a menu it appears that the UUID is causing the JSON column to default sort the menu items in ascending order (for indexing purposes, I believe). This prevents the menu item order from being preserved.
This can be seen by saving a menu then just refreshing the page.
When the schema changes between different item types the data of the previous item type is still persisted.
Give the following item types:
FilamentNavigation::addItemType('TypeA', [
Select::make('url'),
TextInput::make('label'),
]);
FilamentNavigation::addItemType('Type B', [
Select::make('url'),
]);
Type A
Type B
You will see the saved JSON contains a label
property even though Type B
doesn't have this field.
I believe the offending code is this block:
I think it fills the previous state into the new form even though there are aren't fields to contain some of the state.
When creating a navigation item with a searchable item type, selecting the type throws an Alpine error, and displays an empty, unstyled select element. If saved without selecting a target, the select element works correctly upon reopening the modal. Changing the item type after that point doesn't cause a problem either.
module.esm.js:416 Alpine Expression Error: Cannot read properties of null (reading 'target')
Expression: "selectFormComponent({
getOptionLabelUsing: async () => {
return await $wire.getSelectOptionLabel('mountedActionData.data.target')
},
getOptionLabelsUsing: async () => {
return await $wire.getSelectOptionLabels('mountedActionData.data.target')
},
getOptionsUsing: async () => {
return await $wire.getSelectOptions('mountedActionData.data.target')
},
getSearchResultsUsing: async (search) => {
return await $wire.getSelectSearchResults('mountedActionData.data.target', search)
},
isAutofocused: false,
isMultiple: false,
hasDynamicOptions: true,
hasDynamicSearchResults: false,
loadingMessage: 'Loading...',
maxItems: null,
noSearchResultsMessage: 'No options match your search.',
options: JSON.parse(atob('eyJhYm91dCI6IkFib3V0IiwiYm9va2luZ3MiOiJCb29raW5ncyIsImNvbnRhY3QiOiJDb250YWN0IiwiZWR1Y2F0aW9uIjoiRWR1Y2F0aW9uIiwiaG9tZSI6IkhvbWUgUGFnZSIsInBvcGVyYSI6IlBvcGVyYSIsInNob3dzIjoiU2hvd3MiLCJzb2NpYWwtcHJlc2NyaWJpbmciOiJTb2NpYWwgUHJlc2NyaWJpbmcifQ==')),
placeholder: 'Select an option',
searchingMessage: 'Searching...',
searchPrompt: 'Start typing to search...',
state: $wire.entangle('mountedActionData.data.target').defer,
})"
Originally posted by titantwentyone June 11, 2022
Thanks for the package! I was wanting to integrate this with a Post
model however I am little unclear on how this is achieved, I've assumed that FilamentNavigation::addItemType
is to be used in the boot
method of my AppServiceProvider
. This gets me so far but I get console errors using the example in the docs:
Alpine Expression Error: Cannot read properties of null (reading 'post_id')
I'm unsure what post_id
refers to here in terms of my model (if anything - I assume this used to populate the filed name within data
), which, for simplicity's sake, just has id
, title
and content
. (I tried id
as well with the same result.). Is there another step needed?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.