08-05-2024 03:02 AM
Hello, I want to customize the nuxeo-object-diff component. So I create a new component and I copy the code from https://github.com/nuxeo/nuxeo-web-ui/blob/maintenance-3.1.x/elements/diff/nuxeo-object-diff.js . However, when I deployed the code, I encountered this error: (Uncaught TypeError: Failed to resolve module specifier “@polymer/polymer/lib/legacy/polymer-fn.js”. Relative references must start with either “/“, “./“, or “../“)
Any idea?
3 weeks ago - last edited 3 weeks ago
In Polymer you cannot override an element that has been vulcanized (similar to minification). In Nuxeo Web UI a few elements are left un-vulcanized, but most are not. Anyway, overriding is not the way to do it. What you should do is disable the OOTB contribution for the diff button and add your own contribution with you custom element.
In Studio Designer locate the diff button and disable it. Then create a new button with the functionality you want; if you choose "Custom Button" you can then get the UX to create/upload your custom element.
And just in case you run into a button or action that is not available in Studio Designer, you can still find the OOTB contribs in source code. For example the Web UI bundle (e.g. https://github.com/nuxeo/nuxeo-web-ui/blob/maintenance-3.1.x/elements/nuxeo-web-ui-bundle.html but make sure to choose the release that corresponds to the version of Web UI that you have deployed). If it's a button from an add-on, look at the source code from that add-on and locate the bundle the contributes the button. Copy the contrib, paste it in your custom bundle (in Studio) and add the "disabled" attribute.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.