@esri/hub-common 13.27.1 → 13.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/dist/esm/ArcGISContextManager.js +2 -0
  2. package/dist/esm/ArcGISContextManager.js.map +1 -1
  3. package/dist/esm/content/HubContent.js +65 -0
  4. package/dist/esm/content/HubContent.js.map +1 -1
  5. package/dist/esm/core/EntityEditor.js +20 -7
  6. package/dist/esm/core/EntityEditor.js.map +1 -1
  7. package/dist/esm/core/HubItemEntity.js +24 -8
  8. package/dist/esm/core/HubItemEntity.js.map +1 -1
  9. package/dist/esm/core/getTypeFromEntity.js.map +1 -1
  10. package/dist/esm/core/schemas/getEditorConfig.js +15 -0
  11. package/dist/esm/core/schemas/getEditorConfig.js.map +1 -0
  12. package/dist/esm/core/schemas/getEntityEditorSchemas.js +5 -14
  13. package/dist/esm/core/schemas/getEntityEditorSchemas.js.map +1 -1
  14. package/dist/esm/core/schemas/index.js +1 -0
  15. package/dist/esm/core/schemas/index.js.map +1 -1
  16. package/dist/esm/core/schemas/internal/ConfigurableEntity.js +1 -0
  17. package/dist/esm/core/schemas/internal/ConfigurableEntity.js.map +1 -0
  18. package/dist/esm/core/schemas/internal/configOptionHelpers.js +88 -0
  19. package/dist/esm/core/schemas/internal/configOptionHelpers.js.map +1 -0
  20. package/dist/esm/core/schemas/internal/getConfigOptions.js +15 -0
  21. package/dist/esm/core/schemas/internal/getConfigOptions.js.map +1 -0
  22. package/dist/esm/core/schemas/internal/getEditorConfigOptions.js +31 -0
  23. package/dist/esm/core/schemas/internal/getEditorConfigOptions.js.map +1 -0
  24. package/dist/esm/core/schemas/internal/getEntityEditorSchemas.js +87 -0
  25. package/dist/esm/core/schemas/internal/getEntityEditorSchemas.js.map +1 -0
  26. package/dist/esm/core/schemas/internal/getFeaturedImageUrl.js.map +1 -1
  27. package/dist/esm/core/schemas/internal/getLocationExtent.js.map +1 -1
  28. package/dist/esm/core/schemas/internal/getLocationOptions.js.map +1 -1
  29. package/dist/esm/core/schemas/internal/getTagItems.js +36 -12
  30. package/dist/esm/core/schemas/internal/getTagItems.js.map +1 -1
  31. package/dist/esm/core/schemas/types.js +23 -0
  32. package/dist/esm/core/schemas/types.js.map +1 -1
  33. package/dist/esm/core/types/ISystemStatus.js +1 -0
  34. package/dist/esm/core/types/ISystemStatus.js.map +1 -1
  35. package/dist/esm/discussions/HubDiscussion.js +64 -0
  36. package/dist/esm/discussions/HubDiscussion.js.map +1 -1
  37. package/dist/esm/discussions/_internal/DiscussionUiSchemaEdit.js +14 -0
  38. package/dist/esm/discussions/_internal/DiscussionUiSchemaEdit.js.map +1 -1
  39. package/dist/esm/initiatives/HubInitiative.js +64 -0
  40. package/dist/esm/initiatives/HubInitiative.js.map +1 -1
  41. package/dist/esm/initiatives/_internal/InitiativeSchema.js +4 -1
  42. package/dist/esm/initiatives/_internal/InitiativeSchema.js.map +1 -1
  43. package/dist/esm/initiatives/_internal/InitiativeUiSchemaCreate.js +119 -0
  44. package/dist/esm/initiatives/_internal/InitiativeUiSchemaCreate.js.map +1 -0
  45. package/dist/esm/initiatives/_internal/InitiativeUiSchemaEdit.js +14 -0
  46. package/dist/esm/initiatives/_internal/InitiativeUiSchemaEdit.js.map +1 -1
  47. package/dist/esm/items/deleteItemThumbnail.js +14 -0
  48. package/dist/esm/items/deleteItemThumbnail.js.map +1 -0
  49. package/dist/esm/items/index.js +1 -0
  50. package/dist/esm/items/index.js.map +1 -1
  51. package/dist/esm/pages/HubPage.js +64 -0
  52. package/dist/esm/pages/HubPage.js.map +1 -1
  53. package/dist/esm/pages/_internal/PageUiSchemaEdit.js +14 -0
  54. package/dist/esm/pages/_internal/PageUiSchemaEdit.js.map +1 -1
  55. package/dist/esm/permissions/HubPermissionPolicies.js +2 -0
  56. package/dist/esm/permissions/HubPermissionPolicies.js.map +1 -1
  57. package/dist/esm/permissions/PlatformPermissionPolicies.js +711 -0
  58. package/dist/esm/permissions/PlatformPermissionPolicies.js.map +1 -0
  59. package/dist/esm/permissions/types/Permission.js +2 -0
  60. package/dist/esm/permissions/types/Permission.js.map +1 -1
  61. package/dist/esm/projects/HubProject.js +24 -10
  62. package/dist/esm/projects/HubProject.js.map +1 -1
  63. package/dist/esm/projects/_internal/ProjectBusinessRules.js +0 -7
  64. package/dist/esm/projects/_internal/ProjectBusinessRules.js.map +1 -1
  65. package/dist/esm/projects/_internal/ProjectUiSchemaEdit.js +14 -0
  66. package/dist/esm/projects/_internal/ProjectUiSchemaEdit.js.map +1 -1
  67. package/dist/esm/sites/HubSite.js +65 -0
  68. package/dist/esm/sites/HubSite.js.map +1 -1
  69. package/dist/esm/sites/_internal/SiteUiSchemaEdit.js +14 -0
  70. package/dist/esm/sites/_internal/SiteUiSchemaEdit.js.map +1 -1
  71. package/dist/node/ArcGISContextManager.js +2 -0
  72. package/dist/node/ArcGISContextManager.js.map +1 -1
  73. package/dist/node/content/HubContent.js +65 -0
  74. package/dist/node/content/HubContent.js.map +1 -1
  75. package/dist/node/core/EntityEditor.js +20 -7
  76. package/dist/node/core/EntityEditor.js.map +1 -1
  77. package/dist/node/core/HubItemEntity.js +24 -8
  78. package/dist/node/core/HubItemEntity.js.map +1 -1
  79. package/dist/node/core/getTypeFromEntity.js.map +1 -1
  80. package/dist/node/core/schemas/getEditorConfig.js +19 -0
  81. package/dist/node/core/schemas/getEditorConfig.js.map +1 -0
  82. package/dist/node/core/schemas/getEntityEditorSchemas.js +6 -15
  83. package/dist/node/core/schemas/getEntityEditorSchemas.js.map +1 -1
  84. package/dist/node/core/schemas/index.js +1 -0
  85. package/dist/node/core/schemas/index.js.map +1 -1
  86. package/dist/node/core/schemas/internal/ConfigurableEntity.js +3 -0
  87. package/dist/node/core/schemas/internal/ConfigurableEntity.js.map +1 -0
  88. package/dist/node/core/schemas/internal/configOptionHelpers.js +91 -0
  89. package/dist/node/core/schemas/internal/configOptionHelpers.js.map +1 -0
  90. package/dist/node/core/schemas/internal/getConfigOptions.js +19 -0
  91. package/dist/node/core/schemas/internal/getConfigOptions.js.map +1 -0
  92. package/dist/node/core/schemas/internal/getEditorConfigOptions.js +35 -0
  93. package/dist/node/core/schemas/internal/getEditorConfigOptions.js.map +1 -0
  94. package/dist/node/core/schemas/internal/getEntityEditorSchemas.js +91 -0
  95. package/dist/node/core/schemas/internal/getEntityEditorSchemas.js.map +1 -0
  96. package/dist/node/core/schemas/internal/getFeaturedImageUrl.js.map +1 -1
  97. package/dist/node/core/schemas/internal/getLocationExtent.js.map +1 -1
  98. package/dist/node/core/schemas/internal/getLocationOptions.js.map +1 -1
  99. package/dist/node/core/schemas/internal/getTagItems.js +36 -12
  100. package/dist/node/core/schemas/internal/getTagItems.js.map +1 -1
  101. package/dist/node/core/schemas/types.js +24 -1
  102. package/dist/node/core/schemas/types.js.map +1 -1
  103. package/dist/node/core/types/ISystemStatus.js +1 -0
  104. package/dist/node/core/types/ISystemStatus.js.map +1 -1
  105. package/dist/node/discussions/HubDiscussion.js +64 -0
  106. package/dist/node/discussions/HubDiscussion.js.map +1 -1
  107. package/dist/node/discussions/_internal/DiscussionUiSchemaEdit.js +14 -0
  108. package/dist/node/discussions/_internal/DiscussionUiSchemaEdit.js.map +1 -1
  109. package/dist/node/initiatives/HubInitiative.js +64 -0
  110. package/dist/node/initiatives/HubInitiative.js.map +1 -1
  111. package/dist/node/initiatives/_internal/InitiativeSchema.js +4 -1
  112. package/dist/node/initiatives/_internal/InitiativeSchema.js.map +1 -1
  113. package/dist/node/initiatives/_internal/InitiativeUiSchemaCreate.js +122 -0
  114. package/dist/node/initiatives/_internal/InitiativeUiSchemaCreate.js.map +1 -0
  115. package/dist/node/initiatives/_internal/InitiativeUiSchemaEdit.js +14 -0
  116. package/dist/node/initiatives/_internal/InitiativeUiSchemaEdit.js.map +1 -1
  117. package/dist/node/items/deleteItemThumbnail.js +18 -0
  118. package/dist/node/items/deleteItemThumbnail.js.map +1 -0
  119. package/dist/node/items/index.js +1 -0
  120. package/dist/node/items/index.js.map +1 -1
  121. package/dist/node/pages/HubPage.js +64 -0
  122. package/dist/node/pages/HubPage.js.map +1 -1
  123. package/dist/node/pages/_internal/PageUiSchemaEdit.js +14 -0
  124. package/dist/node/pages/_internal/PageUiSchemaEdit.js.map +1 -1
  125. package/dist/node/permissions/HubPermissionPolicies.js +2 -0
  126. package/dist/node/permissions/HubPermissionPolicies.js.map +1 -1
  127. package/dist/node/permissions/PlatformPermissionPolicies.js +714 -0
  128. package/dist/node/permissions/PlatformPermissionPolicies.js.map +1 -0
  129. package/dist/node/permissions/types/Permission.js +2 -0
  130. package/dist/node/permissions/types/Permission.js.map +1 -1
  131. package/dist/node/projects/HubProject.js +24 -10
  132. package/dist/node/projects/HubProject.js.map +1 -1
  133. package/dist/node/projects/_internal/ProjectBusinessRules.js +0 -7
  134. package/dist/node/projects/_internal/ProjectBusinessRules.js.map +1 -1
  135. package/dist/node/projects/_internal/ProjectUiSchemaEdit.js +14 -0
  136. package/dist/node/projects/_internal/ProjectUiSchemaEdit.js.map +1 -1
  137. package/dist/node/sites/HubSite.js +65 -0
  138. package/dist/node/sites/HubSite.js.map +1 -1
  139. package/dist/node/sites/_internal/SiteUiSchemaEdit.js +14 -0
  140. package/dist/node/sites/_internal/SiteUiSchemaEdit.js.map +1 -1
  141. package/dist/types/content/HubContent.d.ts +19 -2
  142. package/dist/types/core/HubItemEntity.d.ts +7 -2
  143. package/dist/types/core/getTypeFromEntity.d.ts +2 -1
  144. package/dist/types/core/schemas/getEditorConfig.d.ts +13 -0
  145. package/dist/types/core/schemas/getEntityEditorSchemas.d.ts +2 -7
  146. package/dist/types/core/schemas/index.d.ts +1 -0
  147. package/dist/types/core/schemas/internal/ConfigurableEntity.d.ts +4 -0
  148. package/dist/types/core/schemas/internal/configOptionHelpers.d.ts +6 -0
  149. package/dist/types/core/schemas/internal/getConfigOptions.d.ts +12 -0
  150. package/dist/types/core/schemas/internal/getEditorConfigOptions.d.ts +11 -0
  151. package/dist/types/core/schemas/internal/getEntityEditorSchemas.d.ts +13 -0
  152. package/dist/types/core/schemas/internal/getFeaturedImageUrl.d.ts +2 -2
  153. package/dist/types/core/schemas/internal/getLocationExtent.d.ts +2 -2
  154. package/dist/types/core/schemas/internal/getLocationOptions.d.ts +2 -2
  155. package/dist/types/core/schemas/internal/getTagItems.d.ts +2 -2
  156. package/dist/types/core/schemas/types.d.ts +43 -3
  157. package/dist/types/core/types/IHubDiscussion.d.ts +7 -0
  158. package/dist/types/core/types/IHubEditableContent.d.ts +7 -0
  159. package/dist/types/core/types/IHubInitiative.d.ts +7 -0
  160. package/dist/types/core/types/IHubPage.d.ts +7 -0
  161. package/dist/types/core/types/IHubProject.d.ts +5 -0
  162. package/dist/types/core/types/IHubSite.d.ts +7 -0
  163. package/dist/types/core/types/ISystemStatus.d.ts +1 -1
  164. package/dist/types/discussions/HubDiscussion.d.ts +17 -2
  165. package/dist/types/initiatives/HubInitiative.d.ts +17 -2
  166. package/dist/types/initiatives/_internal/InitiativeSchema.d.ts +1 -1
  167. package/dist/types/initiatives/_internal/InitiativeUiSchemaCreate.d.ts +7 -0
  168. package/dist/types/items/deleteItemThumbnail.d.ts +9 -0
  169. package/dist/types/items/index.d.ts +1 -0
  170. package/dist/types/pages/HubPage.d.ts +17 -3
  171. package/dist/types/permissions/PlatformPermissionPolicies.d.ts +9 -0
  172. package/dist/types/permissions/types/Permission.d.ts +1 -1
  173. package/dist/types/permissions/types/PlatformPrivilege.d.ts +1 -1
  174. package/dist/types/projects/HubProject.d.ts +1 -1
  175. package/dist/types/projects/_internal/ProjectBusinessRules.d.ts +1 -1
  176. package/dist/types/sites/HubSite.d.ts +18 -1
  177. package/package.json +1 -1
  178. package/dist/esm/projects/_internal/getProjectEditorConfigOptions.js +0 -63
  179. package/dist/esm/projects/_internal/getProjectEditorConfigOptions.js.map +0 -1
  180. package/dist/node/projects/_internal/getProjectEditorConfigOptions.js +0 -67
  181. package/dist/node/projects/_internal/getProjectEditorConfigOptions.js.map +0 -1
  182. package/dist/types/projects/_internal/getProjectEditorConfigOptions.d.ts +0 -10
@@ -1,5 +1,11 @@
1
1
  import { JSONSchema } from "json-schema-typed";
2
2
  import Ajv from "ajv";
3
+ /**
4
+ * Defines the possible editor type values - these correspond
5
+ * to the supported/defined uiSchema configurations
6
+ */
7
+ export declare type EditorType = (typeof validEditorTypes)[number];
8
+ export declare const validEditorTypes: readonly ["hub:project:create", "hub:project:edit", "hub:content:edit", "hub:initiative:edit", "hub:initiative:create", "hub:site:edit", "hub:discussion:edit", "hub:discussion:create", "hub:page:edit"];
3
9
  export declare enum UiSchemaRuleEffects {
4
10
  SHOW = "SHOW",
5
11
  HIDE = "HIDE",
@@ -7,6 +13,7 @@ export declare enum UiSchemaRuleEffects {
7
13
  NONE = ""
8
14
  }
9
15
  export declare enum UiSchemaElementTypes {
16
+ accordionItem = "AccordionItem",
10
17
  section = "Section",
11
18
  step = "Step",
12
19
  control = "Control",
@@ -15,13 +22,20 @@ export declare enum UiSchemaElementTypes {
15
22
  }
16
23
  export declare enum UiSchemaSectionTypes {
17
24
  accordion = "accordion",
18
- stepper = "stepper"
25
+ block = "block",
26
+ stepper = "stepper",
27
+ subblock = "subblock"
28
+ }
29
+ export declare enum UiSchemaMessageTypes {
30
+ error = "ERROR",
31
+ success = "SUCCESS",
32
+ custom = "CUSTOM"
19
33
  }
20
34
  export interface IConfigurationSchema extends JSONSchema {
21
35
  type?: "object";
22
36
  }
23
37
  export interface IConfigurationValues {
24
- [key: string]: unknown;
38
+ [key: string]: any;
25
39
  }
26
40
  export interface IChangeEventDetail {
27
41
  valid: boolean;
@@ -53,7 +67,7 @@ export interface IUiSchemaElement {
53
67
  tooltip?: string;
54
68
  }
55
69
  export interface IUiSchema extends IUiSchemaElement {
56
- elements?: IUiSchema[] | IUiSchemaElement[];
70
+ elements?: IUiSchemaElement[];
57
71
  }
58
72
  /**
59
73
  * Run-time configuration for UiSchema Elements
@@ -65,3 +79,29 @@ export interface IUiSchemaComboboxItem {
65
79
  icon?: string;
66
80
  selected?: boolean;
67
81
  }
82
+ export interface IUiSchemaRule {
83
+ effect: UiSchemaRuleEffects;
84
+ condition: IUiSchemaCondition;
85
+ }
86
+ export interface IUiSchemaCondition {
87
+ scope?: string;
88
+ schema: IConfigurationSchema;
89
+ }
90
+ export interface IUiSchemaMessage {
91
+ type: UiSchemaMessageTypes;
92
+ keyword?: string;
93
+ label?: string;
94
+ labelKey?: string;
95
+ icon?: boolean | string;
96
+ hidden?: boolean;
97
+ condition?: IUiSchemaCondition;
98
+ allowShowBeforeInteract?: boolean;
99
+ }
100
+ export interface IUiSchemaRule {
101
+ effect: UiSchemaRuleEffects;
102
+ condition: IUiSchemaCondition;
103
+ }
104
+ export interface IUiSchemaCondition {
105
+ scope?: string;
106
+ schema: IConfigurationSchema;
107
+ }
@@ -6,3 +6,10 @@ import { IHubItemEntity } from "./IHubItemEntity";
6
6
  */
7
7
  export interface IHubDiscussion extends IHubItemEntity, IWithSlug, IWithPermissions {
8
8
  }
9
+ export declare type IHubDiscussionEditor = Omit<IHubDiscussion, "extent"> & {
10
+ /**
11
+ * Thumbnail image. This is only used on the Editor and is
12
+ * persisted in the fromEditor method on the Class
13
+ */
14
+ _thumbnail?: any;
15
+ };
@@ -5,3 +5,10 @@ import { IHubItemEntity } from "./IHubItemEntity";
5
5
  */
6
6
  export interface IHubEditableContent extends IHubItemEntity, IWithSlug, IWithPermissions {
7
7
  }
8
+ export declare type IHubContentEditor = Omit<IHubEditableContent, "extent"> & {
9
+ /**
10
+ * Thumbnail image. This is only used on the Editor and is
11
+ * persisted in the fromEditor method on the Class
12
+ */
13
+ _thumbnail?: any;
14
+ };
@@ -7,3 +7,10 @@ import { IHubItemEntity } from "./IHubItemEntity";
7
7
  */
8
8
  export interface IHubInitiative extends IHubItemEntity, IWithSlug, IWithCatalog, IWithMetrics, IWithPermissions {
9
9
  }
10
+ export declare type IHubInitiativeEditor = Omit<IHubInitiative, "extent"> & {
11
+ /**
12
+ * Thumbnail image. This is only used on the Editor and is
13
+ * persisted in the fromEditor method on the Class
14
+ */
15
+ _thumbnail?: any;
16
+ };
@@ -6,3 +6,10 @@ import { IWithLayout, IWithPermissions, IWithSlug } from "../traits";
6
6
  */
7
7
  export interface IHubPage extends IHubItemEntity, IWithLayout, IWithPermissions, IWithSlug {
8
8
  }
9
+ export declare type IHubPageEditor = Omit<IHubPage, "extent"> & {
10
+ /**
11
+ * Thumbnail image. This is only used on the Editor and is
12
+ * persisted in the fromEditor method on the Class
13
+ */
14
+ _thumbnail?: any;
15
+ };
@@ -18,6 +18,11 @@ export declare enum PROJECT_STATUSES {
18
18
  * that it can be consumed by the entity editor.
19
19
  */
20
20
  export declare type IHubProjectEditor = Omit<IHubProject, "extent"> & {
21
+ /**
22
+ * Thumbnail image. This is only used on the Editor and is
23
+ * persisted in the fromEditor method on the Class
24
+ */
25
+ _thumbnail?: any;
21
26
  view: {
22
27
  featuredImage?: any;
23
28
  };
@@ -67,3 +67,10 @@ export interface IHubSite extends IHubItemEntity, IWithSlug, IWithCatalog, IWith
67
67
  */
68
68
  legacyCapabilities: string[];
69
69
  }
70
+ export declare type IHubSiteEditor = Omit<IHubSite, "extent"> & {
71
+ /**
72
+ * Thumbnail image. This is only used on the Editor and is
73
+ * persisted in the fromEditor method on the Class
74
+ */
75
+ _thumbnail?: any;
76
+ };
@@ -8,7 +8,7 @@ export declare type SystemStatus = "online" | "offline" | "maintenance" | "not-a
8
8
  export declare type HubSystemStatus = {
9
9
  [key in HubSubsystem]: SystemStatus;
10
10
  };
11
- declare const validSubsystems: readonly ["content", "discussions", "events", "initiatives", "items", "metrics", "notifications", "pages", "projects", "search", "sites", "groups"];
11
+ declare const validSubsystems: readonly ["content", "discussions", "events", "initiatives", "items", "metrics", "notifications", "pages", "projects", "search", "sites", "groups", "platform"];
12
12
  /**
13
13
  * Defines values for HubSubsystem
14
14
  */
@@ -1,11 +1,13 @@
1
1
  import { IWithSharingBehavior, IWithStoreBehavior } from "../core/behaviors";
2
2
  import { IArcGISContext } from "../ArcGISContext";
3
- import { IHubDiscussion } from "../core/types";
3
+ import { IEntityEditorContext, IHubDiscussion, IHubDiscussionEditor } from "../core/types";
4
4
  import { HubItemEntity } from "../core/HubItemEntity";
5
+ import { EditorType } from "../core/schemas/types";
6
+ import { IEditorConfig, IWithEditorBehavior } from "../core/behaviors/IWithEditorBehavior";
5
7
  /**
6
8
  * Hub Discussion Class
7
9
  */
8
- export declare class HubDiscussion extends HubItemEntity<IHubDiscussion> implements IWithStoreBehavior<IHubDiscussion>, IWithSharingBehavior {
10
+ export declare class HubDiscussion extends HubItemEntity<IHubDiscussion> implements IWithStoreBehavior<IHubDiscussion>, IWithSharingBehavior, IWithEditorBehavior {
9
11
  /**
10
12
  * Create an instance from an IHubDiscussion object
11
13
  * @param json JSON object to create a HubDiscussion from
@@ -41,4 +43,17 @@ export declare class HubDiscussion extends HubItemEntity<IHubDiscussion> impleme
41
43
  * @returns a promise
42
44
  */
43
45
  delete(): Promise<void>;
46
+ getEditorConfig(i18nScope: string, type: EditorType): Promise<IEditorConfig>;
47
+ /**
48
+ * Return the project as an editor object
49
+ * @param editorContext
50
+ * @returns
51
+ */
52
+ toEditor(editorContext?: IEntityEditorContext): IHubDiscussionEditor;
53
+ /**
54
+ * Load the project from the editor object
55
+ * @param editor
56
+ * @returns
57
+ */
58
+ fromEditor(editor: IHubDiscussionEditor): Promise<IHubDiscussion>;
44
59
  }
@@ -1,14 +1,16 @@
1
- import { IHubInitiative, IWithCatalogBehavior, IWithStoreBehavior, IWithSharingBehavior, UiSchemaElementOptions, IEditorConfig, IResolvedMetric, IWithCardBehavior } from "../core";
1
+ import { EditorType } from "../core/schemas/types";
2
+ import { IEntityEditorContext } from "../core/types/HubEntityEditor";
2
3
  import { Catalog } from "../search";
3
4
  import { IArcGISContext } from "../ArcGISContext";
4
5
  import { HubItemEntity } from "../core/HubItemEntity";
5
6
  import { InitiativeEditorType } from "./_internal/InitiativeSchema";
6
7
  import { IWithMetricsBehavior } from "../core/behaviors/IWithMetricsBehavior";
7
8
  import { IConvertToCardModelOpts, IHubCardViewModel } from "../core/types/IHubCardViewModel";
9
+ import { IHubInitiative, IWithCatalogBehavior, IWithStoreBehavior, IWithSharingBehavior, UiSchemaElementOptions, IEditorConfig, IResolvedMetric, IWithCardBehavior, IWithEditorBehavior, IHubInitiativeEditor } from "../core";
8
10
  /**
9
11
  * Hub Initiative Class
10
12
  */
11
- export declare class HubInitiative extends HubItemEntity<IHubInitiative> implements IWithStoreBehavior<IHubInitiative>, IWithCatalogBehavior, IWithMetricsBehavior, IWithSharingBehavior, IWithCardBehavior {
13
+ export declare class HubInitiative extends HubItemEntity<IHubInitiative> implements IWithStoreBehavior<IHubInitiative>, IWithCatalogBehavior, IWithMetricsBehavior, IWithSharingBehavior, IWithCardBehavior, IWithEditorBehavior {
12
14
  private _catalog;
13
15
  /**
14
16
  * Private constructor so we don't have `new` all over the place. Allows for
@@ -85,4 +87,17 @@ export declare class HubInitiative extends HubItemEntity<IHubInitiative> impleme
85
87
  * @param opts view model options
86
88
  */
87
89
  convertToCardModel(opts?: IConvertToCardModelOpts): IHubCardViewModel;
90
+ getEditorConfig(i18nScope: string, type: EditorType): Promise<IEditorConfig>;
91
+ /**
92
+ * Return the project as an editor object
93
+ * @param editorContext
94
+ * @returns
95
+ */
96
+ toEditor(editorContext?: IEntityEditorContext): IHubInitiativeEditor;
97
+ /**
98
+ * Load the project from the editor object
99
+ * @param editor
100
+ * @returns
101
+ */
102
+ fromEditor(editor: IHubInitiativeEditor): Promise<IHubInitiative>;
88
103
  }
@@ -1,6 +1,6 @@
1
1
  import { IConfigurationSchema } from "../../core";
2
2
  export declare type InitiativeEditorType = (typeof InitiativeEditorTypes)[number];
3
- export declare const InitiativeEditorTypes: readonly ["hub:initiative:edit"];
3
+ export declare const InitiativeEditorTypes: readonly ["hub:initiative:edit", "hub:initiative:create"];
4
4
  /**
5
5
  * defines the JSON schema for a Hub Initiative's editable fields
6
6
  */
@@ -0,0 +1,7 @@
1
+ import { IUiSchema } from "../../core";
2
+ /**
3
+ * minimal create uiSchema for Hub Projects - this defines
4
+ * how the schema properties should be rendered in the
5
+ * project creation experience
6
+ */
7
+ export declare const uiSchema: IUiSchema;
@@ -0,0 +1,9 @@
1
+ import { IUserRequestOptions } from "@esri/arcgis-rest-auth";
2
+ /**
3
+ * Delete an item's thumbnail
4
+ * @param id
5
+ * @param owner
6
+ * @param requestOptions
7
+ * @returns
8
+ */
9
+ export declare function deleteItemThumbnail(id: string, owner: string, requestOptions: IUserRequestOptions): Promise<any>;
@@ -23,3 +23,4 @@ export * from "./create-item-from-url-or-file";
23
23
  export * from "./uploadImageResource";
24
24
  export * from "./is-services-directory-disabled";
25
25
  export * from "./getItemIdentifier";
26
+ export * from "./deleteItemThumbnail";
@@ -1,13 +1,14 @@
1
- import { IHubPage, IWithStoreBehavior, IWithSharingBehavior, UiSchemaElementOptions } from "../core";
1
+ import { EditorType } from "../core/schemas/types";
2
+ import { IHubPage, IWithStoreBehavior, IWithSharingBehavior, UiSchemaElementOptions, IHubPageEditor, IEntityEditorContext } from "../core";
2
3
  import { IArcGISContext } from "../ArcGISContext";
3
4
  import { HubItemEntity } from "../core/HubItemEntity";
4
- import { IEditorConfig } from "../core/behaviors/IWithEditorBehavior";
5
+ import { IEditorConfig, IWithEditorBehavior } from "../core/behaviors/IWithEditorBehavior";
5
6
  import { PageEditorType } from "./_internal/PageSchema";
6
7
  /**
7
8
  * Hub Page Class
8
9
  * NOTE: This is a minimal implementation.
9
10
  */
10
- export declare class HubPage extends HubItemEntity<IHubPage> implements IWithStoreBehavior<IHubPage>, IWithSharingBehavior {
11
+ export declare class HubPage extends HubItemEntity<IHubPage> implements IWithStoreBehavior<IHubPage>, IWithSharingBehavior, IWithEditorBehavior {
11
12
  /**
12
13
  * Private constructor so we don't have `new` all over the place. Allows for
13
14
  * more flexibility in how we create the HubPageManager over time.
@@ -56,4 +57,17 @@ export declare class HubPage extends HubItemEntity<IHubPage> implements IWithSto
56
57
  * @returns
57
58
  */
58
59
  delete(): Promise<void>;
60
+ getEditorConfig(i18nScope: string, type: EditorType): Promise<IEditorConfig>;
61
+ /**
62
+ * Return the project as an editor object
63
+ * @param editorContext
64
+ * @returns
65
+ */
66
+ toEditor(editorContext?: IEntityEditorContext): IHubPageEditor;
67
+ /**
68
+ * Load the project from the editor object
69
+ * @param editor
70
+ * @returns
71
+ */
72
+ fromEditor(editor: IHubPageEditor): Promise<IHubPage>;
59
73
  }
@@ -0,0 +1,9 @@
1
+ import { IPermissionPolicy } from "./types/IPermissionPolicy";
2
+ /**
3
+ * All the permission policies for the Hub
4
+ */
5
+ export declare const PlatformPermissions: string[];
6
+ /**
7
+ * Platform Permission policies which delegate to Platform Privileges
8
+ */
9
+ export declare const PlatformPermissionPolicies: IPermissionPolicy[];
@@ -3,7 +3,7 @@
3
3
  * It's critical that the arrays defined in the modules use `as const`
4
4
  * otherwise Permission devolves into just a string type
5
5
  */
6
- declare const validPermissions: readonly ["hub:site:create", "hub:site:delete", "hub:site:edit", "hub:site:view", "hub:project:create", "hub:project:delete", "hub:project:edit", "hub:project:view", "hub:project:owner", "hub:project:share", "hub:initiative:create", "hub:initiative:delete", "hub:initiative:edit", "hub:initiative:view", "hub:discussion:create", "hub:discussion:delete", "hub:discussion:edit", "hub:discussion:view", "hub:content:create", "hub:content:edit", "hub:content:view", "hub:group:create", "hub:group:delete", "hub:group:edit", "hub:group:view", "hub:group:owner", "hub:page:create", "hub:page:delete", "hub:page:edit", "hub:page:view"];
6
+ declare const validPermissions: readonly ["hub:site:create", "hub:site:delete", "hub:site:edit", "hub:site:view", "hub:project:create", "hub:project:delete", "hub:project:edit", "hub:project:view", "hub:project:owner", "hub:initiative:create", "hub:initiative:delete", "hub:initiative:edit", "hub:initiative:view", "hub:discussion:create", "hub:discussion:delete", "hub:discussion:edit", "hub:discussion:view", "hub:content:create", "hub:content:edit", "hub:content:view", "hub:group:create", "hub:group:delete", "hub:group:edit", "hub:group:view", "hub:group:owner", "hub:page:create", "hub:page:delete", "hub:page:edit", "hub:page:view", ...string[]];
7
7
  /**
8
8
  * Defines the possible values for Permissions
9
9
  */
@@ -2,4 +2,4 @@
2
2
  * Type that defines Platform Privileges
3
3
  * TODO: Ensure this is a complete list
4
4
  */
5
- export declare type PlatformPrivilege = "opendata:user:designateGroup" | "opendata:user:openDataAdmin" | "portal:admin:assignToGroups" | "portal:admin:categorizeItems" | "portal:admin:changeUserRoles" | "portal:admin:createGPWebhook" | "portal:admin:createUpdateCapableGroup" | "portal:admin:deleteGroups" | "portal:admin:deleteItems" | "portal:admin:deleteUsers" | "portal:admin:disableUsers" | "portal:admin:inviteUsers" | "portal:admin:manageCollaborations" | "portal:admin:manageCredits" | "portal:admin:manageEnterpriseGroups" | "portal:admin:manageLicenses" | "portal:admin:manageRoles" | "portal:admin:manageSecurity" | "portal:admin:manageServers" | "portal:admin:manageUtilityServices" | "portal:admin:manageWebhooks" | "portal:admin:manageWebsite" | "portal:admin:reassignGroups" | "portal:admin:reassignItems" | "portal:admin:reassignUsers" | "portal:admin:shareToGroup" | "portal:admin:shareToOrg" | "portal:admin:shareToPublic" | "portal:admin:updateGroups" | "portal:admin:updateItemCategorySchema" | "portal:admin:updateItems" | "portal:admin:updateMemberCategorySchema" | "portal:admin:updateUsers" | "portal:admin:viewGroups" | "portal:admin:viewItems" | "portal:admin:viewUsers" | "portal:publisher:bulkPublishFromDataStores" | "portal:publisher:createFeatureWebhook" | "portal:publisher:publishBigDataAnalytics" | "portal:publisher:publishDynamicImagery" | "portal:publisher:publishFeatures" | "portal:publisher:publishFeeds" | "portal:publisher:publishKnowledgeGraph" | "portal:publisher:publishRealTimeAnalytics" | "portal:publisher:publishScenes" | "portal:publisher:publishServerGPServices" | "portal:publisher:publishServerServices" | "portal:publisher:publishTiledImagery" | "portal:publisher:publishTiles" | "portal:publisher:registerDataStores" | "portal:user:addExternalMembersToGroup" | "portal:user:categorizeItems" | "portal:user:createGroup" | "portal:user:createItem" | "portal:user:invitePartneredCollaborationMembers" | "portal:user:joinGroup" | "portal:user:joinNonOrgGroup" | "portal:user:reassignItems" | "portal:user:receiveItems" | "portal:user:runWebTool" | "portal:user:shareGroupToOrg" | "portal:user:shareGroupToPublic" | "portal:user:shareToGroup" | "portal:user:shareToOrg" | "portal:user:shareToPublic" | "portal:user:viewHostedFeatureServices" | "portal:user:viewHostedTileServices" | "portal:user:viewOrgGroups" | "portal:user:viewOrgItems" | "portal:user:viewOrgUsers" | "portal:user:viewTracks";
5
+ export declare type PlatformPrivilege = "features:user:edit" | "features:user:fullEdit" | "features:user:manageVersions" | "marketplace:admin:manage" | "marketplace:admin:purchase" | "marketplace:admin:startTrial" | "opendata:user:designateGroup" | "opendata:user:openDataAdmin" | "portal:admin:assignToGroups" | "portal:admin:categorizeItems" | "portal:admin:changeUserRoles" | "portal:admin:createGPWebhook" | "portal:admin:createUpdateCapableGroup" | "portal:admin:deleteGroups" | "portal:admin:deleteItems" | "portal:admin:deleteUsers" | "portal:admin:disableUsers" | "portal:admin:inviteUsers" | "portal:admin:manageCollaborations" | "portal:admin:manageCredits" | "portal:admin:manageEnterpriseGroups" | "portal:admin:manageLicenses" | "portal:admin:manageRoles" | "portal:admin:manageSecurity" | "portal:admin:manageServers" | "portal:admin:manageUtilityServices" | "portal:admin:manageWebhooks" | "portal:admin:manageWebsite" | "portal:admin:reassignGroups" | "portal:admin:reassignItems" | "portal:admin:reassignUsers" | "portal:admin:shareToGroup" | "portal:admin:shareToOrg" | "portal:admin:shareToPublic" | "portal:admin:updateGroups" | "portal:admin:updateItemCategorySchema" | "portal:admin:updateItems" | "portal:admin:updateMemberCategorySchema" | "portal:admin:updateUsers" | "portal:admin:viewGroups" | "portal:admin:viewItems" | "portal:admin:viewUsers" | "portal:publisher:bulkPublishFromDataStores" | "portal:publisher:createDataPipelines" | "portal:publisher:createFeatureWebhook" | "portal:publisher:publishBigDataAnalytics" | "portal:publisher:publishDynamicImagery" | "portal:publisher:publishFeatures" | "portal:publisher:publishFeeds" | "portal:publisher:publishKnowledgeGraph" | "portal:publisher:publishRealTimeAnalytics" | "portal:publisher:publishScenes" | "portal:publisher:publishServerGPServices" | "portal:publisher:publishServerServices" | "portal:publisher:publishTiledImagery" | "portal:publisher:publishTiles" | "portal:publisher:registerDataStores" | "portal:user:addExternalMembersToGroup" | "portal:user:categorizeItems" | "portal:user:createGroup" | "portal:user:createItem" | "portal:user:invitePartneredCollaborationMembers" | "portal:user:joinGroup" | "portal:user:joinNonOrgGroup" | "portal:user:reassignItems" | "portal:user:receiveItems" | "portal:user:runWebTool" | "portal:user:shareGroupToOrg" | "portal:user:shareGroupToPublic" | "portal:user:shareToGroup" | "portal:user:shareToOrg" | "portal:user:shareToPublic" | "portal:user:viewHostedFeatureServices" | "portal:user:viewHostedTileServices" | "portal:user:viewOrgGroups" | "portal:user:viewOrgItems" | "portal:user:viewOrgUsers" | "portal:user:viewTracks" | "premium:publisher:createAdvancedNotebooks" | "premium:publisher:createNotebooks" | "premium:publisher:geoanalytics" | "premium:publisher:rasteranalysis" | "premium:publisher:scheduleNotebooks" | "premium:user:demographics" | "premium:user:elevation" | "premium:user:featurereport" | "premium:user:geocode:stored" | "premium:user:geocode:temporary" | "premium:user:geocode" | "premium:user:geoenrichment" | "premium:user:networkanalysis:closestfacility" | "premium:user:networkanalysis:locationallocation" | "premium:user:networkanalysis:optimizedrouting" | "premium:user:networkanalysis:origindestinationcostmatrix" | "premium:user:networkanalysis:routing" | "premium:user:networkanalysis:servicearea" | "premium:user:networkanalysis:vehiclerouting" | "premium:user:networkanalysis" | "premium:user:places" | "premium:user:spatialanalysis";
@@ -1,5 +1,5 @@
1
1
  import { IHubProject, IWithCatalogBehavior, IWithStoreBehavior, IWithSharingBehavior, IResolvedMetric, IWithCardBehavior, IHubProjectEditor, IEntityEditorContext } from "../core";
2
- import { EditorType } from "../core/schemas/getEntityEditorSchemas";
2
+ import { EditorType } from "../core/schemas/types";
3
3
  import { Catalog } from "../search";
4
4
  import { IArcGISContext } from "../ArcGISContext";
5
5
  import { HubItemEntity } from "../core/HubItemEntity";
@@ -19,7 +19,7 @@ export declare const ProjectCapabilityPermissions: ICapabilityPermission[];
19
19
  * These define the requirements any user must meet to perform related actions
20
20
  * @private
21
21
  */
22
- export declare const ProjectPermissions: readonly ["hub:project:create", "hub:project:delete", "hub:project:edit", "hub:project:view", "hub:project:owner", "hub:project:share"];
22
+ export declare const ProjectPermissions: readonly ["hub:project:create", "hub:project:delete", "hub:project:edit", "hub:project:view", "hub:project:owner"];
23
23
  /**
24
24
  * Project permission policies
25
25
  * @private
@@ -2,13 +2,17 @@ import { IHubSite, IWithPermissionBehavior, IWithCatalogBehavior, IWithStoreBeha
2
2
  import { Catalog } from "../search";
3
3
  import { IArcGISContext } from "../ArcGISContext";
4
4
  import { HubItemEntity } from "../core/HubItemEntity";
5
+ import { EditorType } from "../core/schemas/types";
6
+ import { IEditorConfig, IWithEditorBehavior } from "../core/behaviors/IWithEditorBehavior";
7
+ import { IEntityEditorContext } from "../core/types/HubEntityEditor";
5
8
  import { IContainsResponse, IDeepCatalogInfo } from "../search";
6
9
  import { ICreateVersionOptions, IVersion, IVersionMetadata } from "../versioning";
10
+ import { IHubSiteEditor } from "../index";
7
11
  /**
8
12
  * Hub Site Class
9
13
  * NOTE: This is a minimal implementation. Create operations are not supported at this time
10
14
  */
11
- export declare class HubSite extends HubItemEntity<IHubSite> implements IWithStoreBehavior<IHubSite>, IWithPermissionBehavior, IWithCatalogBehavior, IWithSharingBehavior, IWithVersioningBehavior {
15
+ export declare class HubSite extends HubItemEntity<IHubSite> implements IWithStoreBehavior<IHubSite>, IWithPermissionBehavior, IWithCatalogBehavior, IWithSharingBehavior, IWithVersioningBehavior, IWithEditorBehavior {
12
16
  private _catalog;
13
17
  private _catalogCache;
14
18
  /**
@@ -131,4 +135,17 @@ export declare class HubSite extends HubItemEntity<IHubSite> implements IWithSto
131
135
  deleteVersion(versionId: string): Promise<{
132
136
  success: boolean;
133
137
  }>;
138
+ getEditorConfig(i18nScope: string, type: EditorType): Promise<IEditorConfig>;
139
+ /**
140
+ * Return the project as an editor object
141
+ * @param editorContext
142
+ * @returns
143
+ */
144
+ toEditor(editorContext?: IEntityEditorContext): IHubSiteEditor;
145
+ /**
146
+ * Load the project from the editor object
147
+ * @param editor
148
+ * @returns
149
+ */
150
+ fromEditor(editor: IHubSiteEditor): Promise<IHubSite>;
134
151
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/hub-common",
3
- "version": "13.27.1",
3
+ "version": "13.28.0",
4
4
  "description": "Common TypeScript types and utility functions for @esri/hub.js.",
5
5
  "main": "dist/node/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,63 +0,0 @@
1
- import { getCategoryItems } from "../../core/schemas/internal/getCategoryItems";
2
- import { getFeaturedContentCatalogs } from "../../core/schemas/internal/getFeaturedContentCatalogs";
3
- import { getFeaturedImageUrl } from "../../core/schemas/internal/getFeaturedImageUrl";
4
- import { getLocationExtent } from "../../core/schemas/internal/getLocationExtent";
5
- import { getLocationOptions } from "../../core/schemas/internal/getLocationOptions";
6
- import { getTagItems } from "../../core/schemas/internal/getTagItems";
7
- import { getSharableGroupsComboBoxItems } from "../../core/schemas/internal/getSharableGroupsComboBoxItems";
8
- import { checkPermission } from "../../permissions/checkPermission";
9
- /**
10
- * Construct the Project Editor configuration options
11
- * @param entity
12
- * @param context
13
- * @returns
14
- */
15
- export async function getProjectEditorConfigOptions(entity, context) {
16
- var _a;
17
- const canShare = checkPermission("hub:project:share", context);
18
- return [
19
- {
20
- scope: "/properties/access",
21
- options: {
22
- orgName: context.portal.name,
23
- },
24
- },
25
- {
26
- scope: "/properties/location",
27
- options: {
28
- extent: await getLocationExtent(entity, context.hubRequestOptions),
29
- options: await getLocationOptions(entity, context.portal.name, context.hubRequestOptions),
30
- },
31
- },
32
- {
33
- scope: "/properties/tags",
34
- options: {
35
- items: await getTagItems(entity, context.portal.id, context.hubRequestOptions),
36
- },
37
- },
38
- {
39
- scope: "/properties/categories",
40
- options: {
41
- items: await getCategoryItems(context.portal.id, context.hubRequestOptions),
42
- },
43
- },
44
- {
45
- scope: "/properties/view/properties/featuredImage",
46
- options: {
47
- imgSrc: ((_a = entity.view) === null || _a === void 0 ? void 0 : _a.featuredImageUrl) && getFeaturedImageUrl(entity, context),
48
- },
49
- },
50
- {
51
- scope: "/properties/view/properties/featuredContentIds",
52
- options: getFeaturedContentCatalogs(context.currentUser),
53
- },
54
- {
55
- scope: "/properties/_groups",
56
- options: {
57
- items: getSharableGroupsComboBoxItems(context.currentUser.groups),
58
- disabled: !canShare,
59
- },
60
- },
61
- ];
62
- }
63
- //# sourceMappingURL=getProjectEditorConfigOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getProjectEditorConfigOptions.js","sourceRoot":"","sources":["../../../../src/projects/_internal/getProjectEditorConfigOptions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,0BAA0B,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,8BAA8B,EAAE,MAAM,4DAA4D,CAAC;AAG5G,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,MAAmB,EACnB,OAAuB;;IAEvB,MAAM,QAAQ,GAAG,eAAe,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAE/D,OAAO;QACL;YACE,KAAK,EAAE,oBAAoB;YAC3B,OAAO,EAAE;gBACP,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI;aAC7B;SACF;QACD;YACE,KAAK,EAAE,sBAAsB;YAC7B,OAAO,EAAE;gBACP,MAAM,EAAE,MAAM,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,iBAAiB,CAAC;gBAClE,OAAO,EAAE,MAAM,kBAAkB,CAC/B,MAAM,EACN,OAAO,CAAC,MAAM,CAAC,IAAI,EACnB,OAAO,CAAC,iBAAiB,CAC1B;aACF;SACF;QACD;YACE,KAAK,EAAE,kBAAkB;YACzB,OAAO,EAAE;gBACP,KAAK,EAAE,MAAM,WAAW,CACtB,MAAM,EACN,OAAO,CAAC,MAAM,CAAC,EAAE,EACjB,OAAO,CAAC,iBAAiB,CAC1B;aACF;SACF;QACD;YACE,KAAK,EAAE,wBAAwB;YAC/B,OAAO,EAAE;gBACP,KAAK,EAAE,MAAM,gBAAgB,CAC3B,OAAO,CAAC,MAAM,CAAC,EAAE,EACjB,OAAO,CAAC,iBAAiB,CAC1B;aACF;SACF;QACD;YACE,KAAK,EAAE,2CAA2C;YAClD,OAAO,EAAE;gBACP,MAAM,EACJ,OAAA,MAAM,CAAC,IAAI,0CAAE,gBAAgB,KAAI,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC;aACxE;SACF;QACD;YACE,KAAK,EAAE,gDAAgD;YACvD,OAAO,EAAE,0BAA0B,CAAC,OAAO,CAAC,WAAW,CAAC;SACzD;QACD;YACE,KAAK,EAAE,qBAAqB;YAC5B,OAAO,EAAE;gBACP,KAAK,EAAE,8BAA8B,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC;gBACjE,QAAQ,EAAE,CAAC,QAAQ;aACpB;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getProjectEditorConfigOptions = void 0;
4
- const getCategoryItems_1 = require("../../core/schemas/internal/getCategoryItems");
5
- const getFeaturedContentCatalogs_1 = require("../../core/schemas/internal/getFeaturedContentCatalogs");
6
- const getFeaturedImageUrl_1 = require("../../core/schemas/internal/getFeaturedImageUrl");
7
- const getLocationExtent_1 = require("../../core/schemas/internal/getLocationExtent");
8
- const getLocationOptions_1 = require("../../core/schemas/internal/getLocationOptions");
9
- const getTagItems_1 = require("../../core/schemas/internal/getTagItems");
10
- const getSharableGroupsComboBoxItems_1 = require("../../core/schemas/internal/getSharableGroupsComboBoxItems");
11
- const checkPermission_1 = require("../../permissions/checkPermission");
12
- /**
13
- * Construct the Project Editor configuration options
14
- * @param entity
15
- * @param context
16
- * @returns
17
- */
18
- async function getProjectEditorConfigOptions(entity, context) {
19
- var _a;
20
- const canShare = checkPermission_1.checkPermission("hub:project:share", context);
21
- return [
22
- {
23
- scope: "/properties/access",
24
- options: {
25
- orgName: context.portal.name,
26
- },
27
- },
28
- {
29
- scope: "/properties/location",
30
- options: {
31
- extent: await getLocationExtent_1.getLocationExtent(entity, context.hubRequestOptions),
32
- options: await getLocationOptions_1.getLocationOptions(entity, context.portal.name, context.hubRequestOptions),
33
- },
34
- },
35
- {
36
- scope: "/properties/tags",
37
- options: {
38
- items: await getTagItems_1.getTagItems(entity, context.portal.id, context.hubRequestOptions),
39
- },
40
- },
41
- {
42
- scope: "/properties/categories",
43
- options: {
44
- items: await getCategoryItems_1.getCategoryItems(context.portal.id, context.hubRequestOptions),
45
- },
46
- },
47
- {
48
- scope: "/properties/view/properties/featuredImage",
49
- options: {
50
- imgSrc: ((_a = entity.view) === null || _a === void 0 ? void 0 : _a.featuredImageUrl) && getFeaturedImageUrl_1.getFeaturedImageUrl(entity, context),
51
- },
52
- },
53
- {
54
- scope: "/properties/view/properties/featuredContentIds",
55
- options: getFeaturedContentCatalogs_1.getFeaturedContentCatalogs(context.currentUser),
56
- },
57
- {
58
- scope: "/properties/_groups",
59
- options: {
60
- items: getSharableGroupsComboBoxItems_1.getSharableGroupsComboBoxItems(context.currentUser.groups),
61
- disabled: !canShare,
62
- },
63
- },
64
- ];
65
- }
66
- exports.getProjectEditorConfigOptions = getProjectEditorConfigOptions;
67
- //# sourceMappingURL=getProjectEditorConfigOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getProjectEditorConfigOptions.js","sourceRoot":"","sources":["../../../../src/projects/_internal/getProjectEditorConfigOptions.ts"],"names":[],"mappings":";;;AAEA,mFAAgF;AAChF,uGAAoG;AACpG,yFAAsF;AACtF,qFAAkF;AAClF,uFAAoF;AACpF,yEAAsE;AACtE,+GAA4G;AAG5G,uEAAoE;AAEpE;;;;;GAKG;AACI,KAAK,UAAU,6BAA6B,CACjD,MAAmB,EACnB,OAAuB;;IAEvB,MAAM,QAAQ,GAAG,iCAAe,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAE/D,OAAO;QACL;YACE,KAAK,EAAE,oBAAoB;YAC3B,OAAO,EAAE;gBACP,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI;aAC7B;SACF;QACD;YACE,KAAK,EAAE,sBAAsB;YAC7B,OAAO,EAAE;gBACP,MAAM,EAAE,MAAM,qCAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,iBAAiB,CAAC;gBAClE,OAAO,EAAE,MAAM,uCAAkB,CAC/B,MAAM,EACN,OAAO,CAAC,MAAM,CAAC,IAAI,EACnB,OAAO,CAAC,iBAAiB,CAC1B;aACF;SACF;QACD;YACE,KAAK,EAAE,kBAAkB;YACzB,OAAO,EAAE;gBACP,KAAK,EAAE,MAAM,yBAAW,CACtB,MAAM,EACN,OAAO,CAAC,MAAM,CAAC,EAAE,EACjB,OAAO,CAAC,iBAAiB,CAC1B;aACF;SACF;QACD;YACE,KAAK,EAAE,wBAAwB;YAC/B,OAAO,EAAE;gBACP,KAAK,EAAE,MAAM,mCAAgB,CAC3B,OAAO,CAAC,MAAM,CAAC,EAAE,EACjB,OAAO,CAAC,iBAAiB,CAC1B;aACF;SACF;QACD;YACE,KAAK,EAAE,2CAA2C;YAClD,OAAO,EAAE;gBACP,MAAM,EACJ,OAAA,MAAM,CAAC,IAAI,0CAAE,gBAAgB,KAAI,yCAAmB,CAAC,MAAM,EAAE,OAAO,CAAC;aACxE;SACF;QACD;YACE,KAAK,EAAE,gDAAgD;YACvD,OAAO,EAAE,uDAA0B,CAAC,OAAO,CAAC,WAAW,CAAC;SACzD;QACD;YACE,KAAK,EAAE,qBAAqB;YAC5B,OAAO,EAAE;gBACP,KAAK,EAAE,+DAA8B,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC;gBACjE,QAAQ,EAAE,CAAC,QAAQ;aACpB;SACF;KACF,CAAC;AACJ,CAAC;AA9DD,sEA8DC"}
@@ -1,10 +0,0 @@
1
- import { IArcGISContext } from "../../ArcGISContext";
2
- import { UiSchemaElementOptions } from "../../core/schemas/types";
3
- import { IHubProject } from "../../core/types/IHubProject";
4
- /**
5
- * Construct the Project Editor configuration options
6
- * @param entity
7
- * @param context
8
- * @returns
9
- */
10
- export declare function getProjectEditorConfigOptions(entity: IHubProject, context: IArcGISContext): Promise<UiSchemaElementOptions[]>;