@esri/hub-common 13.22.1 → 13.24.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.
- package/dist/esm/capabilities/types.js +1 -0
- package/dist/esm/capabilities/types.js.map +1 -1
- package/dist/esm/core/EntityEditor.js +39 -0
- package/dist/esm/core/EntityEditor.js.map +1 -0
- package/dist/esm/core/HubItemEntity.js +14 -0
- package/dist/esm/core/HubItemEntity.js.map +1 -1
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/core/schemas/getEntityEditorSchemas.js +7 -1
- package/dist/esm/core/schemas/getEntityEditorSchemas.js.map +1 -1
- package/dist/esm/core/schemas/internal/getCategoryItems.js +34 -0
- package/dist/esm/core/schemas/internal/getCategoryItems.js.map +1 -0
- package/dist/esm/core/schemas/internal/getFeaturedContentCatalogs.js +21 -0
- package/dist/esm/core/schemas/internal/getFeaturedContentCatalogs.js.map +1 -0
- package/dist/esm/core/schemas/internal/getFeaturedImageUrl.js +9 -0
- package/dist/esm/core/schemas/internal/getFeaturedImageUrl.js.map +1 -0
- package/dist/esm/core/schemas/internal/getLocationExtent.js +11 -0
- package/dist/esm/core/schemas/internal/getLocationExtent.js.map +1 -0
- package/dist/esm/core/schemas/internal/getLocationOptions.js +56 -0
- package/dist/esm/core/schemas/internal/getLocationOptions.js.map +1 -0
- package/dist/esm/core/schemas/internal/getSharableGroupsComboBoxItems.js +27 -0
- package/dist/esm/core/schemas/internal/getSharableGroupsComboBoxItems.js.map +1 -0
- package/dist/esm/core/schemas/internal/getTagItems.js +37 -0
- package/dist/esm/core/schemas/internal/getTagItems.js.map +1 -0
- package/dist/esm/core/types/HubEntityEditor.js +1 -0
- package/dist/esm/core/types/HubEntityEditor.js.map +1 -0
- package/dist/esm/core/types/IHubProject.js.map +1 -1
- package/dist/esm/core/types/index.js +5 -4
- package/dist/esm/core/types/index.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/pages/_internal/PageBusinessRules.js +6 -0
- package/dist/esm/pages/_internal/PageBusinessRules.js.map +1 -1
- package/dist/esm/projects/HubProject.js +92 -13
- package/dist/esm/projects/HubProject.js.map +1 -1
- package/dist/esm/projects/_internal/ProjectBusinessRules.js +13 -0
- package/dist/esm/projects/_internal/ProjectBusinessRules.js.map +1 -1
- package/dist/esm/projects/_internal/ProjectSchema.js +3 -3
- package/dist/esm/projects/_internal/ProjectSchema.js.map +1 -1
- package/dist/esm/projects/_internal/ProjectUiSchemaCreate.js +1 -1
- package/dist/esm/projects/_internal/ProjectUiSchemaCreate.js.map +1 -1
- package/dist/esm/projects/_internal/getProjectEditorConfigOptions.js +63 -0
- package/dist/esm/projects/_internal/getProjectEditorConfigOptions.js.map +1 -0
- package/dist/esm/projects/edit.js +23 -7
- package/dist/esm/projects/edit.js.map +1 -1
- package/dist/esm/sites/HubSites.js +12 -26
- package/dist/esm/sites/HubSites.js.map +1 -1
- package/dist/esm/sites/_internal/SiteBusinessRules.js +6 -0
- package/dist/esm/sites/_internal/SiteBusinessRules.js.map +1 -1
- package/dist/esm/urls/cacheBustUrl.js +13 -0
- package/dist/esm/urls/cacheBustUrl.js.map +1 -0
- package/dist/esm/urls/index.js +1 -0
- package/dist/esm/urls/index.js.map +1 -1
- package/dist/node/capabilities/types.js +1 -0
- package/dist/node/capabilities/types.js.map +1 -1
- package/dist/node/core/EntityEditor.js +43 -0
- package/dist/node/core/EntityEditor.js.map +1 -0
- package/dist/node/core/HubItemEntity.js +14 -0
- package/dist/node/core/HubItemEntity.js.map +1 -1
- package/dist/node/core/index.js.map +1 -1
- package/dist/node/core/schemas/getEntityEditorSchemas.js +7 -1
- package/dist/node/core/schemas/getEntityEditorSchemas.js.map +1 -1
- package/dist/node/core/schemas/internal/getCategoryItems.js +38 -0
- package/dist/node/core/schemas/internal/getCategoryItems.js.map +1 -0
- package/dist/node/core/schemas/internal/getFeaturedContentCatalogs.js +25 -0
- package/dist/node/core/schemas/internal/getFeaturedContentCatalogs.js.map +1 -0
- package/dist/node/core/schemas/internal/getFeaturedImageUrl.js +13 -0
- package/dist/node/core/schemas/internal/getFeaturedImageUrl.js.map +1 -0
- package/dist/node/core/schemas/internal/getLocationExtent.js +15 -0
- package/dist/node/core/schemas/internal/getLocationExtent.js.map +1 -0
- package/dist/node/core/schemas/internal/getLocationOptions.js +60 -0
- package/dist/node/core/schemas/internal/getLocationOptions.js.map +1 -0
- package/dist/node/core/schemas/internal/getSharableGroupsComboBoxItems.js +31 -0
- package/dist/node/core/schemas/internal/getSharableGroupsComboBoxItems.js.map +1 -0
- package/dist/node/core/schemas/internal/getTagItems.js +41 -0
- package/dist/node/core/schemas/internal/getTagItems.js.map +1 -0
- package/dist/node/core/types/HubEntityEditor.js +3 -0
- package/dist/node/core/types/HubEntityEditor.js.map +1 -0
- package/dist/node/core/types/IHubProject.js.map +1 -1
- package/dist/node/core/types/index.js +5 -4
- package/dist/node/core/types/index.js.map +1 -1
- package/dist/node/index.js +1 -0
- package/dist/node/index.js.map +1 -1
- package/dist/node/pages/_internal/PageBusinessRules.js +6 -0
- package/dist/node/pages/_internal/PageBusinessRules.js.map +1 -1
- package/dist/node/projects/HubProject.js +93 -14
- package/dist/node/projects/HubProject.js.map +1 -1
- package/dist/node/projects/_internal/ProjectBusinessRules.js +13 -0
- package/dist/node/projects/_internal/ProjectBusinessRules.js.map +1 -1
- package/dist/node/projects/_internal/ProjectSchema.js +5 -5
- package/dist/node/projects/_internal/ProjectSchema.js.map +1 -1
- package/dist/node/projects/_internal/ProjectUiSchemaCreate.js +1 -1
- package/dist/node/projects/_internal/ProjectUiSchemaCreate.js.map +1 -1
- package/dist/node/projects/_internal/getProjectEditorConfigOptions.js +67 -0
- package/dist/node/projects/_internal/getProjectEditorConfigOptions.js.map +1 -0
- package/dist/node/projects/edit.js +24 -7
- package/dist/node/projects/edit.js.map +1 -1
- package/dist/node/sites/HubSites.js +12 -27
- package/dist/node/sites/HubSites.js.map +1 -1
- package/dist/node/sites/_internal/SiteBusinessRules.js +6 -0
- package/dist/node/sites/_internal/SiteBusinessRules.js.map +1 -1
- package/dist/node/urls/cacheBustUrl.js +16 -0
- package/dist/node/urls/cacheBustUrl.js.map +1 -0
- package/dist/node/urls/index.js +1 -0
- package/dist/node/urls/index.js.map +1 -1
- package/dist/types/capabilities/types.d.ts +1 -1
- package/dist/types/core/EntityEditor.d.ts +13 -0
- package/dist/types/core/behaviors/IWithEditorBehavior.d.ts +23 -9
- package/dist/types/core/schemas/internal/getCategoryItems.d.ts +11 -0
- package/dist/types/core/schemas/internal/getFeaturedContentCatalogs.d.ts +9 -0
- package/dist/types/core/schemas/internal/getFeaturedImageUrl.d.ts +3 -0
- package/dist/types/core/schemas/internal/getLocationExtent.d.ts +7 -0
- package/dist/types/core/schemas/internal/getLocationOptions.d.ts +16 -0
- package/dist/types/core/schemas/internal/getSharableGroupsComboBoxItems.d.ts +7 -0
- package/dist/types/core/schemas/internal/getTagItems.d.ts +12 -0
- package/dist/types/core/schemas/types.d.ts +6 -0
- package/dist/types/core/types/HubEntityEditor.d.ts +11 -0
- package/dist/types/core/types/IHubLocation.d.ts +12 -0
- package/dist/types/core/types/IHubProject.d.ts +10 -0
- package/dist/types/core/types/index.d.ts +5 -4
- package/dist/types/index.d.ts +1 -0
- package/dist/types/permissions/types/Permission.d.ts +1 -1
- package/dist/types/projects/HubProject.d.ts +21 -13
- package/dist/types/projects/_internal/ProjectBusinessRules.d.ts +1 -1
- package/dist/types/projects/_internal/ProjectSchema.d.ts +2 -2
- package/dist/types/projects/_internal/getProjectEditorConfigOptions.d.ts +10 -0
- package/dist/types/projects/edit.d.ts +12 -7
- package/dist/types/sites/HubSites.d.ts +0 -8
- package/dist/types/urls/cacheBustUrl.d.ts +5 -0
- package/dist/types/urls/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,67 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHubProjectEditorConfig = exports.deleteProject = exports.updateProject = exports.createProject = void 0;
|
|
3
|
+
exports.getHubProjectEditorConfig = exports.deleteProject = exports.updateProject = exports.editorToProject = exports.createProject = void 0;
|
|
4
4
|
// Note - we separate these imports so we can cleanly spy on things in tests
|
|
5
5
|
const models_1 = require("../models");
|
|
6
6
|
const slugs_1 = require("../items/slugs");
|
|
@@ -49,6 +49,26 @@ async function createProject(partialProject, requestOptions) {
|
|
|
49
49
|
return newProject;
|
|
50
50
|
}
|
|
51
51
|
exports.createProject = createProject;
|
|
52
|
+
/**
|
|
53
|
+
* Convert a IHubProjectEditor back to an IHubProject
|
|
54
|
+
* @param editor
|
|
55
|
+
* @param portal
|
|
56
|
+
* @returns
|
|
57
|
+
*/
|
|
58
|
+
function editorToProject(editor, portal) {
|
|
59
|
+
var _a;
|
|
60
|
+
// remove the ephemeral props we graft on for the editor
|
|
61
|
+
delete editor._groups;
|
|
62
|
+
// clone into a HubProject
|
|
63
|
+
const project = util_1.cloneObject(editor);
|
|
64
|
+
// ensure there's an org url key
|
|
65
|
+
project.orgUrlKey = editor.orgUrlKey ? editor.orgUrlKey : portal.urlKey;
|
|
66
|
+
// copy the location extent up one level
|
|
67
|
+
project.extent = (_a = editor.location) === null || _a === void 0 ? void 0 : _a.extent;
|
|
68
|
+
// return with a cast
|
|
69
|
+
return project;
|
|
70
|
+
}
|
|
71
|
+
exports.editorToProject = editorToProject;
|
|
52
72
|
/**
|
|
53
73
|
* @private
|
|
54
74
|
* Update a Hub Project
|
|
@@ -92,10 +112,6 @@ async function deleteProject(id, requestOptions) {
|
|
|
92
112
|
}
|
|
93
113
|
exports.deleteProject = deleteProject;
|
|
94
114
|
/**
|
|
95
|
-
* DEPRECATED: the following will be removed at next breaking version
|
|
96
|
-
* use the getEntityEditorSchemas function instead (which this function
|
|
97
|
-
* has already been refactored to consume)
|
|
98
|
-
*
|
|
99
115
|
* Get the editor config for for the HubProject entity.
|
|
100
116
|
* @param i18nScope translation scope to be interpolated into the uiSchema
|
|
101
117
|
* @param type editor type - corresonds to the returned uiSchema
|
|
@@ -103,8 +119,9 @@ exports.deleteProject = deleteProject;
|
|
|
103
119
|
*/
|
|
104
120
|
/* istanbul ignore next deprecated */
|
|
105
121
|
async function getHubProjectEditorConfig(i18nScope, type, options = []) {
|
|
106
|
-
|
|
107
|
-
|
|
122
|
+
// Still mulling if we should call out to this, or
|
|
123
|
+
// just pull that code in here...
|
|
124
|
+
return schemas_1.getEntityEditorSchemas(i18nScope, type, options);
|
|
108
125
|
}
|
|
109
126
|
exports.getHubProjectEditorConfig = getHubProjectEditorConfig;
|
|
110
127
|
//# sourceMappingURL=edit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../src/projects/edit.ts"],"names":[],"mappings":";;;AAEA,4EAA4E;AAC5E,sCAA+D;AAC/D,0CAA8E;AAC9E,
|
|
1
|
+
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../src/projects/edit.ts"],"names":[],"mappings":";;;AAEA,4EAA4E;AAC5E,sCAA+D;AAC/D,0CAA8E;AAC9E,iEAIkC;AAClC,qEAAkE;AAMlE,yCAAoE;AACpE,2DAAwD;AACxD,+DAA4D;AAE5D,mEAAgE;AAChE,kCAAsC;AACtC,6CAGyB;AAEzB,gDAAuD;AAGvD;;;;;;;;GAQG;AACI,KAAK,UAAU,aAAa,CACjC,cAAoC,EACpC,cAAmC;IAEnC,kCAAkC;IAClC,2CAA2C;IAC3C,MAAM,OAAO,mCAAQ,0BAAe,GAAK,cAAc,CAAE,CAAC;IAE1D,uDAAuD;IACvD,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;QACjB,OAAO,CAAC,IAAI,GAAG,qBAAa,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;KAC/D;IACD,yBAAyB;IACzB,OAAO,CAAC,IAAI,GAAG,MAAM,qBAAa,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,cAAc,CAAC,CAAC;IAC3E,kCAAkC;IAClC,OAAO,CA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GAAK,EAAE,EAAE,EAAE,CAAsB,CAAC;IAChE,MAAM,+BAAU,CAAC,EAAE,CAAC,CAAC;IACrB,OAAO;AACT,CAAC;AAPD,sCAOC;AAED;;;;;GAKG;AACH,qCAAqC;AAC9B,KAAK,UAAU,yBAAyB,CAC7C,SAAiB,EACjB,IAAuB,EACvB,UAAoC,EAAE;IAEtC,kDAAkD;IAClD,iCAAiC;IACjC,OAAO,gCAAsB,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC1D,CAAC;AARD,8DAQC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.enrichSiteSearchResult = exports.convertItemToSite = exports.
|
|
3
|
+
exports.enrichSiteSearchResult = exports.convertItemToSite = exports.convertModelToSite = exports.fetchSite = exports.deleteSite = exports.updateSite = exports.createSite = exports.ENTERPRISE_SITE_ITEM_TYPE = exports.HUB_SITE_ITEM_TYPE = void 0;
|
|
4
4
|
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
5
5
|
const get_family_1 = require("../content/get-family");
|
|
6
6
|
const fetchSiteModel_1 = require("./fetchSiteModel");
|
|
@@ -260,25 +260,26 @@ exports.createSite = createSite;
|
|
|
260
260
|
* @returns
|
|
261
261
|
*/
|
|
262
262
|
async function updateSite(site, requestOptions) {
|
|
263
|
+
// verify that the slug is unique, excluding the current site
|
|
264
|
+
site.slug = await slugs_1.getUniqueSlug({ slug: site.slug, existingId: site.id }, requestOptions);
|
|
263
265
|
site.typeKeywords = discussions_1.setDiscussableKeyword(site.typeKeywords, site.isDiscussable);
|
|
264
|
-
// convert IHubSite to model
|
|
265
|
-
const siteModel = convertSiteToModel(site, requestOptions);
|
|
266
266
|
// Fetch backing model from the portal
|
|
267
267
|
const currentModel = await models_1.getModel(site.id, requestOptions);
|
|
268
|
+
// Note: Although we are fetching the model, and applying changes onto it,
|
|
269
|
+
// we are not attempting to handle "concurrent edit" conflict resolution
|
|
270
|
+
// but this is where we would apply that sort of logic
|
|
271
|
+
const mapper = new PropertyMapper_1.PropertyMapper(getPropertyMap_1.getPropertyMap());
|
|
272
|
+
const modelToUpdate = mapper.entityToStore(site, currentModel);
|
|
268
273
|
// handle any domain changes
|
|
269
|
-
await _internal_1.handleDomainChanges(
|
|
270
|
-
if (siteModel.item.properties.slug !== currentModel.item.properties.slug) {
|
|
271
|
-
// ensure slug to keywords
|
|
272
|
-
siteModel.item.typeKeywords = slugs_1.setSlugKeyword(siteModel.item.typeKeywords, siteModel.item.properties.slug);
|
|
273
|
-
}
|
|
274
|
+
await _internal_1.handleDomainChanges(modelToUpdate, currentModel, requestOptions);
|
|
274
275
|
// The following props are currently affected by in-memory migrations,
|
|
275
276
|
// so we replace them with their canonical values so as to not overwrite
|
|
276
277
|
// them. Eventually these changes will be persisted in AGO.
|
|
277
|
-
|
|
278
|
-
|
|
278
|
+
modelToUpdate.data.catalog = currentModel.data.catalog;
|
|
279
|
+
modelToUpdate.data.values.searchCategories =
|
|
279
280
|
currentModel.data.values.searchCategories;
|
|
280
281
|
// send updates to the Portal API and get back the updated site model
|
|
281
|
-
const updatedSiteModel = await models_1.updateModel(
|
|
282
|
+
const updatedSiteModel = await models_1.updateModel(modelToUpdate, requestOptions);
|
|
282
283
|
// convert that back into a IHubSite and return it
|
|
283
284
|
const updatedSite = convertModelToSite(updatedSiteModel, requestOptions);
|
|
284
285
|
return updatedSite;
|
|
@@ -342,22 +343,6 @@ function convertModelToSite(model, requestOptions) {
|
|
|
342
343
|
return computeProps_1.computeProps(model, site, requestOptions);
|
|
343
344
|
}
|
|
344
345
|
exports.convertModelToSite = convertModelToSite;
|
|
345
|
-
/**
|
|
346
|
-
* @internal
|
|
347
|
-
* Convert an IHubSite into an IModel
|
|
348
|
-
* @param site
|
|
349
|
-
* @param requestOptions
|
|
350
|
-
* @returns
|
|
351
|
-
*/
|
|
352
|
-
function convertSiteToModel(site, _requestOptions) {
|
|
353
|
-
// create the mapper
|
|
354
|
-
const mapper = new PropertyMapper_1.PropertyMapper(getPropertyMap_1.getPropertyMap());
|
|
355
|
-
// applying the site onto the default model ensures that a minimum
|
|
356
|
-
// set of properties exist, regardless what may have been done to
|
|
357
|
-
// the IHubSite pojo
|
|
358
|
-
return mapper.entityToStore(site, util_1.cloneObject(DEFAULT_SITE_MODEL));
|
|
359
|
-
}
|
|
360
|
-
exports.convertSiteToModel = convertSiteToModel;
|
|
361
346
|
/**
|
|
362
347
|
* Convert a Hub Site Application item into a Hub Site, fetching any
|
|
363
348
|
* additional information that may be required
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HubSites.js","sourceRoot":"","sources":["../../../src/sites/HubSites.ts"],"names":[],"mappings":";;;AACA,iEAA+E;AAC/E,sDAAkD;AAClD,qDAAkD;AAClD,qEAAkE;AAClE,2CAAkD;AAElD,wDAA6D;AAC7D,mEAAgE;AAChE,oFAA8E;AAC9E,mFAAgF;AAChF,2DAAwD;AACxD,+DAA4D;AAE5D,
|
|
1
|
+
{"version":3,"file":"HubSites.js","sourceRoot":"","sources":["../../../src/sites/HubSites.ts"],"names":[],"mappings":";;;AACA,iEAA+E;AAC/E,sDAAkD;AAClD,qDAAkD;AAClD,qEAAkE;AAClE,2CAAkD;AAElD,wDAA6D;AAC7D,mEAAgE;AAChE,oFAA8E;AAC9E,mFAAgF;AAChF,2DAAwD;AACxD,+DAA4D;AAE5D,0CAA8E;AAC9E,8CAA2C;AAC3C,mFAA6E;AAC7E,2DAAuD;AACvD,gCAAsC;AACtC,qCAA8C;AAC9C,kCAA8C;AAC9C,sCAKmB;AACnB,6DAA0D;AAE1D,mFAA4E;AAE5E,oCAAiC;AACjC,wCAA8C;AAC9C,gFAA0E;AAC1E,+FAA4F;AAC5F,gDAAuD;AACvD,iGAA8F;AACjF,QAAA,kBAAkB,GAAG,sBAAsB,CAAC;AAC5C,QAAA,yBAAyB,GAAG,kBAAkB,CAAC;AA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KAAK,CAAC,SAAS,GAAG,4CAAmB,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IACnE,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC;IAC7B,MAAM,CAAC,KAAK,CAAC,YAAY,GAAG,wCAAiB,CAC3C,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,EAAE,EACT,IAAI,CAAC,YAAY,CAClB,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AA1DD,wDA0DC"}
|
|
@@ -12,6 +12,7 @@ exports.SiteDefaultCapabilities = {
|
|
|
12
12
|
details: true,
|
|
13
13
|
settings: true,
|
|
14
14
|
content: true,
|
|
15
|
+
dashboard: true,
|
|
15
16
|
};
|
|
16
17
|
/**
|
|
17
18
|
* List of all the Site Capability Permissions
|
|
@@ -39,6 +40,11 @@ exports.SiteCapabilityPermissions = [
|
|
|
39
40
|
capability: "content",
|
|
40
41
|
permissions: ["hub:site:edit"],
|
|
41
42
|
},
|
|
43
|
+
{
|
|
44
|
+
entity: "site",
|
|
45
|
+
capability: "dashboard",
|
|
46
|
+
permissions: ["hub:site:edit"],
|
|
47
|
+
},
|
|
42
48
|
];
|
|
43
49
|
/**
|
|
44
50
|
* Site Permissions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SiteBusinessRules.js","sourceRoot":"","sources":["../../../../src/sites/_internal/SiteBusinessRules.ts"],"names":[],"mappings":";;;AAGA;;;;;GAKG;AACU,QAAA,uBAAuB,GAAuB;IACzD,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;
|
|
1
|
+
{"version":3,"file":"SiteBusinessRules.js","sourceRoot":"","sources":["../../../../src/sites/_internal/SiteBusinessRules.ts"],"names":[],"mappings":";;;AAGA;;;;;GAKG;AACU,QAAA,uBAAuB,GAAuB;IACzD,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,I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WAAW,EAAE,aAAa,EAAE,kBAAkB,CAAC;QAC1D,WAAW,EAAE,IAAI;KAClB;IACD;QACE,UAAU,EAAE,eAAe;QAC3B,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE,CAAC,OAAO,CAAC;QACrB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,kBAAkB,CAAC;KAC3D;CACF,CAAC;AAEF;;GAEG;AACU,QAAA,sBAAsB,GAAG;IACpC,oBAAoB;IACpB,mBAAmB;IACnB,yBAAyB;CAC1B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cacheBustUrl = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* artifically update a query param associated with a url to force
|
|
6
|
+
* the browser to load it from file rather than from cache
|
|
7
|
+
*/
|
|
8
|
+
exports.cacheBustUrl = (url, param = "v") => {
|
|
9
|
+
if (!url) {
|
|
10
|
+
return url;
|
|
11
|
+
}
|
|
12
|
+
const delimiter = url.indexOf("?") > -1 ? "&" : "?";
|
|
13
|
+
url += `${delimiter}${param}=${new Date().getTime()}`;
|
|
14
|
+
return url;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=cacheBustUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cacheBustUrl.js","sourceRoot":"","sources":["../../../src/urls/cacheBustUrl.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACU,QAAA,YAAY,GAAG,CAAC,GAAW,EAAE,KAAK,GAAG,GAAG,EAAU,EAAE;IAC/D,IAAI,CAAC,GAAG,EAAE;QACR,OAAO,GAAG,CAAC;KACZ;IAED,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IACpD,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,IAAI,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;IAEtD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
|
package/dist/node/urls/index.js
CHANGED
|
@@ -24,6 +24,7 @@ tslib_1.__exportStar(require("./getGroupHomeUrl"), exports);
|
|
|
24
24
|
tslib_1.__exportStar(require("./getUserHomeUrl"), exports);
|
|
25
25
|
tslib_1.__exportStar(require("./get-campaign-url"), exports);
|
|
26
26
|
tslib_1.__exportStar(require("./is-safe-redirect-url"), exports);
|
|
27
|
+
tslib_1.__exportStar(require("./cacheBustUrl"), exports);
|
|
27
28
|
// For some reason, if this is exported here, random tests
|
|
28
29
|
// start failing. Resolved by moving to the root index
|
|
29
30
|
// export * from "./getCardModelUrl";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/urls/index.ts"],"names":[],"mappings":";;;;AAAA,kCAAqC;AACrC,sDAA4B;AAC5B,qEAA2C;AAC3C,+DAAqC;AACrC,2DAAiC;AACjC,2DAAiC;AACjC,6DAAmC;AACnC,2DAAiC;AACjC,qEAA2C;AAC3C,0DAAgC;AAChC,wEAA8C;AAC9C,oEAA0C;AAC1C,8DAAoC;AACpC,6DAAmC;AACnC,8DAAoC;AACpC,wEAA8C;AAC9C,mEAAyC;AACzC,oEAA0C;AAC1C,4DAAkC;AAClC,2DAAiC;AACjC,6DAAmC;AACnC,iEAAuC;AACvC,0DAA0D;AAC1D,sDAAsD;AACtD,qCAAqC;AAErC,MAAM,+BAA+B,GAAG,wBAAwB,CAAC;AAEjE;;;;GAIG;AACU,QAAA,uBAAuB,GAAG,CAAC,GAAW,EAAE,EAAE;IACrD,OAAO,+BAA+B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnD,CAAC,CAAC;AAEF;;;;;GAKG;AACU,QAAA,qBAAqB,GAAG,CAAC,GAAW,EAAE,EAAE;IACnD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACzD,MAAM,YAAY,GAAG,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;IACvC,OAAO,YAAY,IAAI,GAAG,iBAAU,CAAC,YAAY,CAAC,UAAU,CAAC;AAC/D,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/urls/index.ts"],"names":[],"mappings":";;;;AAAA,kCAAqC;AACrC,sDAA4B;AAC5B,qEAA2C;AAC3C,+DAAqC;AACrC,2DAAiC;AACjC,2DAAiC;AACjC,6DAAmC;AACnC,2DAAiC;AACjC,qEAA2C;AAC3C,0DAAgC;AAChC,wEAA8C;AAC9C,oEAA0C;AAC1C,8DAAoC;AACpC,6DAAmC;AACnC,8DAAoC;AACpC,wEAA8C;AAC9C,mEAAyC;AACzC,oEAA0C;AAC1C,4DAAkC;AAClC,2DAAiC;AACjC,6DAAmC;AACnC,iEAAuC;AACvC,yDAA+B;AAC/B,0DAA0D;AAC1D,sDAAsD;AACtD,qCAAqC;AAErC,MAAM,+BAA+B,GAAG,wBAAwB,CAAC;AAEjE;;;;GAIG;AACU,QAAA,uBAAuB,GAAG,CAAC,GAAW,EAAE,EAAE;IACrD,OAAO,+BAA+B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnD,CAAC,CAAC;AAEF;;;;;GAKG;AACU,QAAA,qBAAqB,GAAG,CAAC,GAAW,EAAE,EAAE;IACnD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACzD,MAAM,YAAY,GAAG,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;IACvC,OAAO,YAAY,IAAI,GAAG,iBAAU,CAAC,YAAY,CAAC,UAAU,CAAC;AAC/D,CAAC,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { IAccessResponse } from "../core/types/IAccessResponse";
|
|
|
3
3
|
/**
|
|
4
4
|
* Hub System Capabilities
|
|
5
5
|
*/
|
|
6
|
-
declare const validCapabilities: readonly ["collaboration", "details", "discussions", "events", "followers", "overview", "settings", "teams", "metrics", "content"];
|
|
6
|
+
declare const validCapabilities: readonly ["collaboration", "dashboard", "details", "discussions", "events", "followers", "overview", "settings", "teams", "metrics", "content"];
|
|
7
7
|
/**
|
|
8
8
|
* Defines the possible values for Capability
|
|
9
9
|
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IArcGISContext } from "../ArcGISContext";
|
|
2
|
+
import { IEditorConfig, IWithEditorBehavior } from "./behaviors";
|
|
3
|
+
import { EditorType } from "./schemas";
|
|
4
|
+
import { HubEntity } from "./types/HubEntity";
|
|
5
|
+
import { HubEntityEditor, IEntityEditorContext } from "./types/HubEntityEditor";
|
|
6
|
+
export declare class EntityEditor {
|
|
7
|
+
instance: IWithEditorBehavior;
|
|
8
|
+
private constructor();
|
|
9
|
+
static fromEntity(entity: HubEntity, context: IArcGISContext): EntityEditor;
|
|
10
|
+
getConfig(i18nScope: string, type: EditorType): Promise<IEditorConfig>;
|
|
11
|
+
toEditor(editorContext?: IEntityEditorContext): HubEntityEditor;
|
|
12
|
+
save(editor: HubEntityEditor): Promise<HubEntity>;
|
|
13
|
+
}
|
|
@@ -1,17 +1,31 @@
|
|
|
1
|
-
import { IConfigurationSchema, IUiSchema,
|
|
2
|
-
|
|
3
|
-
* DEPRECATED: the following will be removed at next breaking version
|
|
4
|
-
* we will be shifting towards the EditorType defined in the schemas
|
|
5
|
-
* directory
|
|
6
|
-
*/
|
|
7
|
-
export declare type EditorConfigType = "create" | "edit";
|
|
1
|
+
import { IConfigurationSchema, IUiSchema, EditorType } from "../schemas";
|
|
2
|
+
import { HubEntity, HubEntityEditor, IEntityEditorContext } from "../types";
|
|
8
3
|
export interface IEditorConfig {
|
|
9
4
|
schema: IConfigurationSchema;
|
|
10
5
|
uiSchema: IUiSchema;
|
|
11
6
|
}
|
|
12
7
|
/**
|
|
13
|
-
*
|
|
8
|
+
* Functions that are used by the arcgis-hub-entity-editor component
|
|
14
9
|
*/
|
|
15
10
|
export interface IWithEditorBehavior {
|
|
16
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Get the Entity's ui and schema for the editor
|
|
13
|
+
* @param i18nScope
|
|
14
|
+
* @param type
|
|
15
|
+
* @param options
|
|
16
|
+
*/
|
|
17
|
+
getEditorConfig(i18nScope: string, type: EditorType): Promise<IEditorConfig>;
|
|
18
|
+
/**
|
|
19
|
+
* Convert the entity into it's "Editor" structure.
|
|
20
|
+
* This should only be used by the arcgis-hub-entity-editor component.
|
|
21
|
+
* For general use, see the `toJson():<T>` method
|
|
22
|
+
*/
|
|
23
|
+
toEditor(editorContext: IEntityEditorContext): HubEntityEditor;
|
|
24
|
+
/**
|
|
25
|
+
* Update the internal Entity from the "Editor" structure.
|
|
26
|
+
* This should only be used by the arcgis-hub-entity-editor component.
|
|
27
|
+
* For general use, see the `update(Partial<T>)` method
|
|
28
|
+
* @param values
|
|
29
|
+
*/
|
|
30
|
+
fromEditor(editor: HubEntityEditor): Promise<HubEntity>;
|
|
17
31
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IHubRequestOptions } from "../../../types";
|
|
2
|
+
import { IUiSchemaComboboxItem } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Fetch the categorySchema for all the categories, including
|
|
5
|
+
* the ones with 0 count, then recursively collet all the child
|
|
6
|
+
* categories on the deepest level. Parse into a format that
|
|
7
|
+
* can be consumed by the combobox field
|
|
8
|
+
*
|
|
9
|
+
* TODO: render nested categories in combobox
|
|
10
|
+
*/
|
|
11
|
+
export declare function getCategoryItems(orgId: string, hubRequestOptions: IHubRequestOptions): Promise<IUiSchemaComboboxItem[]>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IUser } from "@esri/arcgis-rest-portal";
|
|
2
|
+
/**
|
|
3
|
+
* Return a catalog structured for picking featured content.
|
|
4
|
+
* @param user
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare function getFeaturedContentCatalogs(user: IUser): {
|
|
8
|
+
catalogs: import("../../..").IHubCatalog[];
|
|
9
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IHubRequestOptions } from "../../../types";
|
|
2
|
+
import { HubEntity } from "../../types/HubEntity";
|
|
3
|
+
/**
|
|
4
|
+
* Get the extent from the entity's location, if it has one.
|
|
5
|
+
* Otherwise, fall back to using the org extent.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getLocationExtent(entity: HubEntity, hubRequestOptions: IHubRequestOptions): Promise<import("@esri/arcgis-rest-types").IExtent>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IHubRequestOptions } from "../../../types";
|
|
2
|
+
import { HubEntity } from "../../types/HubEntity";
|
|
3
|
+
import { IHubLocationOption } from "../../types/IHubLocation";
|
|
4
|
+
/**
|
|
5
|
+
* Construct the dynamic location picker options with the entity's
|
|
6
|
+
* configured location using the following logic:
|
|
7
|
+
*
|
|
8
|
+
* 1. If there is no entity (e.g. we're creating an entity),
|
|
9
|
+
* select the "custom" option by default
|
|
10
|
+
* 2. Else if there is no location set on the entity, select the
|
|
11
|
+
* "none" option
|
|
12
|
+
* 3. Else if the entity has a location and it's the same as the
|
|
13
|
+
* current option, select it and update the option with the entity's
|
|
14
|
+
* location
|
|
15
|
+
*/
|
|
16
|
+
export declare function getLocationOptions(entity: HubEntity, portalName: string, hubRequestOptions: IHubRequestOptions): Promise<IHubLocationOption[]>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IGroup } from "@esri/arcgis-rest-portal";
|
|
2
|
+
import { IUiSchemaComboboxItem } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Filter an array of groups into the set the user has the rights to share content
|
|
5
|
+
* into, and then convert them to UiSchemaComboboxItem array for use in the Entity Editor component
|
|
6
|
+
*/
|
|
7
|
+
export declare function getSharableGroupsComboBoxItems(groups: IGroup[]): IUiSchemaComboboxItem[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IHubRequestOptions } from "../../../types";
|
|
2
|
+
import { HubEntity } from "../../types/HubEntity";
|
|
3
|
+
import { IUiSchemaComboboxItem } from "../types";
|
|
4
|
+
/**
|
|
5
|
+
* Fetch the entity's org tags (limited to the top 200),
|
|
6
|
+
* merge with any configured on the entity itself, and convert
|
|
7
|
+
* into a format that can be consumed by the combobox field
|
|
8
|
+
*
|
|
9
|
+
* TODO: the search portion of this util should probably
|
|
10
|
+
* be hoisted to hub.js
|
|
11
|
+
*/
|
|
12
|
+
export declare function getTagItems(entity: HubEntity, orgId: string, hubRequestOptions: IHubRequestOptions): Promise<IUiSchemaComboboxItem[]>;
|
|
@@ -59,3 +59,9 @@ export interface IUiSchema extends IUiSchemaElement {
|
|
|
59
59
|
* Run-time configuration for UiSchema Elements
|
|
60
60
|
*/
|
|
61
61
|
export declare type UiSchemaElementOptions = Pick<IUiSchemaElement, "scope" | "options">;
|
|
62
|
+
export interface IUiSchemaComboboxItem {
|
|
63
|
+
value: string;
|
|
64
|
+
label?: string;
|
|
65
|
+
icon?: string;
|
|
66
|
+
selected?: boolean;
|
|
67
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified type for all Hub entity editors
|
|
3
|
+
*/
|
|
4
|
+
export declare type HubEntityEditor = Record<string, any>;
|
|
5
|
+
/**
|
|
6
|
+
* Additional context that can be passed to `toEditor()` functions
|
|
7
|
+
*/
|
|
8
|
+
export interface IEntityEditorContext {
|
|
9
|
+
collaborationGroupId?: string;
|
|
10
|
+
contentGroupId?: string;
|
|
11
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="arcgis-js-api" />
|
|
2
2
|
import { ISpatialReference } from "@esri/arcgis-rest-types";
|
|
3
3
|
import { IHubLocationType } from "./types";
|
|
4
|
+
import { HubEntityType } from "./HubEntityType";
|
|
4
5
|
/**
|
|
5
6
|
* A location associated with an item and stored as a json resource.
|
|
6
7
|
*/
|
|
@@ -15,3 +16,14 @@ export interface IHubLocation {
|
|
|
15
16
|
graphic?: any;
|
|
16
17
|
geoJson?: any;
|
|
17
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Location options for the location picker
|
|
21
|
+
*/
|
|
22
|
+
export interface IHubLocationOption {
|
|
23
|
+
/** Whether or not this option is selected initially */
|
|
24
|
+
selected?: boolean;
|
|
25
|
+
label: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
location: IHubLocation;
|
|
28
|
+
entityType?: HubEntityType;
|
|
29
|
+
}
|
|
@@ -13,3 +13,13 @@ export declare enum PROJECT_STATUSES {
|
|
|
13
13
|
onHold = "onHold",
|
|
14
14
|
complete = "complete"
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* This type redefines the IHubProject interface in such a way
|
|
18
|
+
* that it can be consumed by the entity editor.
|
|
19
|
+
*/
|
|
20
|
+
export declare type IHubProjectEditor = Omit<IHubProject, "extent"> & {
|
|
21
|
+
view: {
|
|
22
|
+
featuredImage?: any;
|
|
23
|
+
};
|
|
24
|
+
_groups?: string[];
|
|
25
|
+
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export * from "./DynamicValues";
|
|
1
2
|
export * from "./HubEntity";
|
|
3
|
+
export * from "./HubEntityEditor";
|
|
2
4
|
export * from "./HubEntityType";
|
|
3
5
|
export * from "./IHubContent";
|
|
4
6
|
export * from "./IHubContentEnrichments";
|
|
@@ -17,11 +19,10 @@ export * from "./IHubSite";
|
|
|
17
19
|
export * from "./IHubSiteTheme";
|
|
18
20
|
export * from "./IHubTimeline";
|
|
19
21
|
export * from "./IItemEnrichments";
|
|
22
|
+
export * from "./IReference";
|
|
20
23
|
export * from "./IServerEnrichments";
|
|
21
24
|
export * from "./ISystemStatus";
|
|
22
|
-
export * from "./types";
|
|
23
|
-
export * from "./DynamicValues";
|
|
24
|
-
export * from "./IReference";
|
|
25
|
-
export * from "./Metrics";
|
|
26
25
|
export * from "./MaybeTranslate";
|
|
27
26
|
export * from "./IHubCardViewModel";
|
|
27
|
+
export * from "./Metrics";
|
|
28
|
+
export * from "./types";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export * from "./versioning";
|
|
|
34
34
|
export * from "./metrics";
|
|
35
35
|
export * from "./core/updateHubEntity";
|
|
36
36
|
export * from "./urls/getCardModelUrl";
|
|
37
|
+
export * from "./core/EntityEditor";
|
|
37
38
|
import OperationStack from "./OperationStack";
|
|
38
39
|
import OperationError from "./OperationError";
|
|
39
40
|
import HubError from "./HubError";
|
|
@@ -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: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: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: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:page:create", "hub:page:delete", "hub:page:edit", "hub:page:view"];
|
|
7
7
|
/**
|
|
8
8
|
* Defines the possible values for Permissions
|
|
9
9
|
*/
|