Warren Buckley
03/14/2024, 10:01 PMthis.consumeContext
or this.getContext
when extending a class from UmbEntityActionBase<any>
?Jacob Overgaard
03/15/2024, 8:06 AMgetContext
is a one-off that you can await to get the latest context right away. consumeContext
keeps watching for new contexts (it's an observer with a callback).Jacob Overgaard
03/15/2024, 8:06 AMD_Inventor
03/15/2024, 8:54 AMWarren Buckley
03/15/2024, 9:12 AMJacob Overgaard
03/15/2024, 10:13 AMJacob Overgaard
03/15/2024, 10:14 AMJacob Overgaard
03/15/2024, 10:15 AM// If there are tracked references, we also want to check if we are allowed to unpublish the document:
if (this._hasTrackedReferences) {
const documentConfigurationContext = await this.getContext(UMB_DOCUMENT_CONFIGURATION_CONTEXT);
this._hasUnpublishPermission =
(await documentConfigurationContext.getDocumentConfiguration())?.disableUnpublishWhenReferenced === false ??
true;
}
Warren Buckley
03/15/2024, 10:40 AMWarren Buckley
03/15/2024, 10:41 AMWarren Buckley
03/15/2024, 10:41 AM