best practice to overwrite labels when overwriting omni lwc with custom lwc #5284
Unanswered
heapallocation
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I am attempting to extend and overwrite the omniscriptSaveForLaterAcknowledge LWC as documented here I'd like to change the label used for OmniSaved.
I see from the template that the labels are stored in the _SflLabels property. I was hoping to use a getter to substitute a in a new value for OmniSaved as follows:
This approach only returns the OmniSaved label. It looks like the getter I have created overrides the setting of the _bSflLabels. When I remove the getter, I am able to access the labels with super._bSflLabels at the connectedCalback stage, but not constructor stage. I've tried accessing the prototype of the parent to see it had a get I could call with:
but it doesn't have a get. I tried to update the label in the property directly with:
But the property is read-only. Given this I see two options available:
Option 1 means that any new labels added to the standard component won't be supported and option 2 means that we would need to maintain the template code going forward, adding any new changes.
Can anyone recommend a different solution/best practice that minimises customisation of the standard LWC.
Any help is greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions