Description
Which Umbraco version are you using?
16.0.0-rc5
Bug summary
This might not be a "bug", but more of an issue when it comes to re-use.
Specifics
No response
Steps to reproduce
I'm using Tiptap (umb-input-tiptap
) in a custom section. It's been working fine on v15 but I've noticed that in v16 a new thing called UmbDocumentUrlsDataResolver
has been introduced in the link-picker-modal
element. It has a dependency on UmbPropertyDatasetContext
to get the current culture.
Expected result / actual result
As a package developer it would not really make sense for me to provide a implementation of a full blown UmbPropertyDatasetContext
to provide a culture context, I'm sure I hack "hack my way" around it but I'm wondering if there is something missing here, I can see great value for re-use when it comes to the link-picker-modal
so I would love to see something that is easier for us to provide like a "Variant Context" or something like that.
Also, this breaking change was never publicly announced in any way.
Edit:
Can to think about this again. I know I've mentioned this somewhere before but. A current limitation with the link picker is that you cannot link to a page in another culture. Say I want to link from my Swedish website to a legal document on the English version of the site. It would make more sense for the link picker modal to default to the current variant id and then allow the user to change if they want to. Still, this does not solve my issue with the full blown UmbPropertyDatasetContext but I've created a work around for now.
I'll share it here if someone needs the same thing.
export const FAKE_UMB_PROPERTY_DATASET_CONTEXT = new UmbContextToken<FakeUmbPropertyDatasetContext>('UmbPropertyDatasetContext');
export interface FakeUmbPropertyDatasetContext extends UmbContext {
getVariantId() : UmbVariantId;
}
export class FakeUmbPropertyDatasetContext extends UmbContextBase implements FakeUmbPropertyDatasetContext {
getVariantId(): UmbVariantId {
return UmbVariantId.CreateInvariant();
}
}
this.provideContext(FAKE_UMB_PROPERTY_DATASET_CONTEXT,new FakeUmbPropertyDatasetContext(this,FAKE_UMB_PROPERTY_DATASET_CONTEXT));