From c86968e9f514fec04edd378b947ec181bbf1e803 Mon Sep 17 00:00:00 2001 From: Randy Weber Date: Mon, 26 Apr 2021 20:26:06 -0400 Subject: [PATCH] fix(content): update datasetToContent method to add isProxied property to result affects: @esri/hub-content ISSUES CLOSED: https://devtopia.esri.com/dc/hub/issues/71 --- packages/content/src/hub.ts | 4 +++- packages/content/test/hub.test.ts | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/content/src/hub.ts b/packages/content/src/hub.ts index f7979b5d87e..9db9f78115a 100644 --- a/packages/content/src/hub.ts +++ b/packages/content/src/hub.ts @@ -131,8 +131,9 @@ export function datasetToContent(dataset: DatasetResource): IHubContent { searchDescription, groupIds, structuredLicense, - layer + layer, // dataset enrichments + isProxied // recordCount // TODO: fields, geometryType, layer?, server?, as needed } = attributes; @@ -142,6 +143,7 @@ export function datasetToContent(dataset: DatasetResource): IHubContent { content.groupIds = groupIds; content.structuredLicense = structuredLicense; content.layer = layer; + content.isProxied = isProxied; // if (searchDescription) { // overwrite default summary (from snippet) w/ search description diff --git a/packages/content/test/hub.test.ts b/packages/content/test/hub.test.ts index 6eb57cec956..2a1f994d388 100644 --- a/packages/content/test/hub.test.ts +++ b/packages/content/test/hub.test.ts @@ -134,10 +134,12 @@ describe("hub", () => { const dataset = cloneObject(documentsJson.data) as DatasetResource; delete dataset.attributes.searchDescription; delete dataset.attributes.modifiedProvenance; + dataset.attributes.isProxied = false; const content = datasetToContent(dataset); expect(content.summary).toBe(dataset.attributes.snippet); expect(content.updatedDateSource).toBe("item.modified"); expect(content.extent).toBeUndefined(); + expect(content.isProxied).toBe(false); }); // NOTE: other use cases are covered by getContent() tests });