Skip to content

Commit

Permalink
Revert "feat(hub-common): add content settings schemas and derive pro…
Browse files Browse the repository at this point in the history
…ps from server definitions (#1209)"

This reverts commit 1721285.
  • Loading branch information
tomwayson authored Sep 15, 2023
1 parent e126a0a commit ea1d2cd
Show file tree
Hide file tree
Showing 22 changed files with 117 additions and 853 deletions.
85 changes: 24 additions & 61 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"@esri/arcgis-rest-feature-layer": "^3.4.3",
"@esri/arcgis-rest-portal": "^3.5.0",
"@esri/arcgis-rest-request": "^3.1.1",
"@esri/arcgis-rest-service-admin": "^3.6.0",
"@esri/arcgis-rest-types": "^3.1.1",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
Expand Down
1 change: 0 additions & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"@esri/arcgis-rest-feature-layer": "^3.2.0",
"@esri/arcgis-rest-portal": "^2.18.0 || 3",
"@esri/arcgis-rest-request": "^2.14.0 || 3",
"@esri/arcgis-rest-service-admin": "^3.6.0",
"@esri/arcgis-rest-types": "^2.15.0 || 3"
},
"devDependencies": {
Expand Down
11 changes: 1 addition & 10 deletions packages/common/src/content/_internal/ContentSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import { IConfigurationSchema } from "../../core";
import { HubItemEntitySchema } from "../../core/schemas/shared/HubItemEntitySchema";

export type ContentEditorType = (typeof ContentEditorTypes)[number];
export const ContentEditorTypes = [
"hub:content:edit",
"hub:content:settings",
] as const;
export const ContentEditorTypes = ["hub:content:edit"] as const;

/**
* defines the JSON schema for a Hub Content's editable fields
Expand All @@ -17,11 +14,5 @@ export const ContentSchema: IConfigurationSchema = {
licenseInfo: {
type: "string",
},
serverExtractCapability: {
type: "boolean",
},
hostedDownloads: {
type: "boolean",
},
},
} as IConfigurationSchema;
6 changes: 3 additions & 3 deletions packages/common/src/content/_internal/ContentUiSchemaEdit.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { IUiSchema } from "../../core";
import { IArcGISContext } from "../../ArcGISContext";
import { IHubContent } from "../../core/types";
import { getTagItems } from "../../core/schemas/internal/getTagItems";
import { getCategoryItems } from "../../core/schemas/internal/getCategoryItems";
import { getLocationExtent } from "../../core/schemas/internal/getLocationExtent";
import { getLocationOptions } from "../../core/schemas/internal/getLocationOptions";
import { IHubEditableContent } from "../../core/types/IHubEditableContent";
import { IUiSchema } from "../../core/schemas/types";

/**
* @private
Expand All @@ -14,7 +14,7 @@ import { IUiSchema } from "../../core/schemas/types";
*/
export const buildUiSchema = async (
i18nScope: string,
entity: IHubEditableContent,
entity: IHubContent,
context: IArcGISContext
): Promise<IUiSchema> => {
return {
Expand Down
65 changes: 0 additions & 65 deletions packages/common/src/content/_internal/ContentUiSchemaSettings.ts

This file was deleted.

15 changes: 1 addition & 14 deletions packages/common/src/content/_internal/computeProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ import { getHubRelativeUrl } from "./internalContentUtils";
import { IHubLocation } from "../../core/types/IHubLocation";
import { IHubEditableContent } from "../../core/types/IHubEditableContent";
import { getRelativeWorkspaceUrl } from "../../core/getRelativeWorkspaceUrl";
import {
hasServiceCapability,
ServiceCapabilities,
} from "../hostedServiceUtils";
import { IItemAndIServerEnrichments } from "../../items/_enrichments";

// if called and valid, set 3 things -- else just return type custom
export const getItemExtent = (itemExtent: number[][]): IExtent => {
Expand All @@ -41,8 +36,7 @@ export function deriveLocationFromItemExtent(itemExtent?: number[][]) {
export function computeProps(
model: IModel,
content: Partial<IHubEditableContent>,
requestOptions: IRequestOptions,
enrichments: IItemAndIServerEnrichments = {}
requestOptions: IRequestOptions
): IHubEditableContent {
let token: string;
if (requestOptions.authentication) {
Expand Down Expand Up @@ -76,12 +70,5 @@ export function computeProps(
: deriveLocationFromItemExtent(model.item.extent);
}

if (enrichments.server) {
content.serverExtractCapability = hasServiceCapability(
ServiceCapabilities.EXTRACT,
enrichments.server
);
}

return content as IHubEditableContent;
}
5 changes: 0 additions & 5 deletions packages/common/src/content/_internal/getPropertyMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ export function getPropertyMap(): IPropertyMap[] {
storeKey: "item.licenseInfo",
});

map.push({
entityKey: "hostedDownloads",
storeKey: "item.properties.downloads.hosted",
});

// features is intentionally left out

// TODO: look into composeContent() for what we can add here
Expand Down
Loading

0 comments on commit ea1d2cd

Please sign in to comment.