Skip to content

Commit

Permalink
fix(content): update datasetToContent method to add isProxied propert…
Browse files Browse the repository at this point in the history
…y to result

affects: @esri/hub-content

ISSUES CLOSED: https://devtopia.esri.com/dc/hub/issues/71
  • Loading branch information
rweber-esri authored and dbouwman committed Apr 27, 2021
1 parent 8737c69 commit c86968e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/content/src/hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions packages/content/test/hub.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
Expand Down

0 comments on commit c86968e

Please sign in to comment.