From 0ad9f86b09e7ec1e8eb92b4c89cd3d2c431b15b0 Mon Sep 17 00:00:00 2001 From: Peter van Gulik Date: Thu, 11 Apr 2024 15:20:20 +0200 Subject: [PATCH] fix: document templates are not shared with all users after deployment --- .../src/deploymentSpecs/contentVersion.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/vlocity-deploy/src/deploymentSpecs/contentVersion.ts b/packages/vlocity-deploy/src/deploymentSpecs/contentVersion.ts index 50633aad6..ec425b5b8 100644 --- a/packages/vlocity-deploy/src/deploymentSpecs/contentVersion.ts +++ b/packages/vlocity-deploy/src/deploymentSpecs/contentVersion.ts @@ -16,7 +16,7 @@ export class ContentVersion implements DatapackDeploymentSpec { private readonly logger: Logger) { } - public afterDeploy(event: DatapackDeploymentEvent) { + public afterDeploy(event: DatapackDeploymentEvent) { return this.createContentDocumentLinks(event); } @@ -39,10 +39,10 @@ export class ContentVersion implements DatapackDeploymentSpec { // Add ContentDocumentLink creation into deployment event.deployment.add(DatapackDeploymentRecord.fromValues( - 'ContentDocumentLink', + 'ContentDocumentLink', documentLinkValues, - { - upsertFields: [ 'ContentDocumentId', 'LinkedEntityId' ], + { + upsertFields: [ 'ContentDocumentId', 'LinkedEntityId' ], recordKey: `ContentDocumentLink/${record.datapackKey}` } )); @@ -66,7 +66,7 @@ export class ContentVersion implements DatapackDeploymentSpec { // Calculate the md5 hash from the records VersionData; if the same skip updating it const recordChecksum = this.calculateVersionDataChecksum(record); - + if (recordChecksum === currentContentVersion.Checksum) { this.logger.verbose(`Skip update of "${record.datapackKey}" -- content checksum matches: ${recordChecksum}`) record.setAction(DeploymentAction.Skip); @@ -91,7 +91,7 @@ export class ContentVersion implements DatapackDeploymentSpec { } private async getContentDocumentLinkValues(record: DatapackDeploymentRecord) { - if (!record.isSkipped || !record.recordId) { + if (record.isSkipped || !record.recordId) { return; }