Can I import the same APIs, elements that Umbraco ...
# package-development
w
Q: Can I import the same APIs, elements that Umbraco uses for workspace actions? Why... I just want to update the built in Umbraco workspace actions with an additional custom condition and keep the existing functionality.
I know I can overwrite an extension with my own manifest but I am hoping to reuse the same API for the workspace action that Umbraco uses to avoid me duplicating all of their workspace action code myself & then ensuring its up to date in sync with any future updates Umbraco does. I just want to remove the save & publish button and some other actions if my condition is true. Be interested to know if I can import/reuse the same workspace action APIs classes in my own manifests just to extend it with my own condition. Again bit of a pain I need to set all of its manifest properties again such as the button color, label & existing conditions. Is is anyone using the overwrite stuff at all yet?
r
Have not used it Warren but can you maybe extend the class itself, add the functionalty you need and then replace the workspace action?
w
Yeh that’s perhaps one way to do it. Just seems a lot of overhead
Will experiment
m
I made a POC for this some time ago where I basically wanted a workspace view without these buttons. I fetched the extensions that I wanted to remove (save + save and publish), stored them in a local array, and then removed them from the extension store - when then added back when my view was disconnected. It's a hack for sure but it worked 😄 Not sure if this is what you are looking to do?
w
Yeh was trying to use conditions to do that. But yeh could use the extension API to remove other bits and add it like you say when the element is removed add them back
Appreciate the pointer @Markus Johansson
3 Views