Some time ago I created an unpublished app that allows a user to use a simple form to write a specific file to a folder by using the sidebar. Simplified hereās what it does:
Registers a new tab view in the sidebar if selected item is a directory
Shows a form to enter some information in the tab view
Sends the information to a Nextcloud REST endpoint
Backend saves a specific file to the folder with the user input properly formatted for an external script
However, Iāve been adapting a lot of code from the versions app back then.
Now Iād like to update the app, because some JS APIs broke over time. But Iād like to do so in a future-proof way. Actually, Iād like to mount a Vue component into a tab view. Is that even possible? Is there any app that does that already?
For example registerTabView is now deprecated. But no-where it says how to register your tab view instead. Core apps still seem to be using it on master. Howās the way forward? Where do I find references to the future of interacting with the filelist?
Hey! This was such a helpful pointer, thanks a lot!
The tricky part was to set up webpack, because the structure is a bit different in the server repository than it would be for a simple app, but itās do-able.
It feels like a lot less code to interface with the sidebar component than it used to beā¦
One more question that came up just now: How do I implement the previous canDisplay method?
It seems like thereās a isEnabled method that is being called on the component, but if I pass it as a prop to the component for me itās not being executed. How does this work?
@skjnldsv Cool, thanks, I wasnāt realizing that this would be done through the constructor. Iāll check it out. My issue is more that it requires async operations for this app (to load app settings). So Iāll probably stick with the current solution: Having the tab be always enabled and then show a helpful message when the app is not active in that folder.
Quick question at the end: Will this change be breaking? So I need to refactor the Vue component again?
Btw we have a public channel for community on our company instance, are you in?
If not, you can and ask us questions if you have any for this sidebar migration