@esri/hub-common 12.14.0 → 12.15.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/core/schemas/getEntityEditorSchemas.js +52 -0
- package/dist/esm/core/schemas/getEntityEditorSchemas.js.map +1 -0
- package/dist/esm/core/schemas/index.js +1 -1
- package/dist/esm/core/schemas/index.js.map +1 -1
- package/dist/esm/core/schemas/shared/index.js +2 -0
- package/dist/esm/core/schemas/shared/index.js.map +1 -0
- package/dist/esm/core/schemas/shared/subschemas.js +20 -0
- package/dist/esm/core/schemas/shared/subschemas.js.map +1 -0
- package/dist/esm/core/types/IHubProject.js.map +1 -1
- package/dist/esm/initiatives/HubInitiative.js +12 -12
- package/dist/esm/initiatives/HubInitiative.js.map +1 -1
- package/dist/esm/initiatives/_internal/InitiativeSchema.js +13 -0
- package/dist/esm/initiatives/_internal/InitiativeSchema.js.map +1 -0
- package/dist/esm/initiatives/_internal/InitiativeUiSchemaEdit.js +20 -0
- package/dist/esm/initiatives/_internal/InitiativeUiSchemaEdit.js.map +1 -0
- package/dist/esm/projects/HubProject.js +7 -7
- package/dist/esm/projects/HubProject.js.map +1 -1
- package/dist/esm/projects/_internal/ProjectSchema.js +52 -0
- package/dist/esm/projects/_internal/ProjectSchema.js.map +1 -0
- package/dist/esm/projects/_internal/ProjectUiSchemaCreate.js +128 -0
- package/dist/esm/projects/_internal/ProjectUiSchemaCreate.js.map +1 -0
- package/dist/esm/projects/_internal/ProjectUiSchemaEdit.js +130 -0
- package/dist/esm/projects/_internal/ProjectUiSchemaEdit.js.map +1 -0
- package/dist/esm/projects/edit.js +11 -32
- package/dist/esm/projects/edit.js.map +1 -1
- package/dist/node/core/schemas/getEntityEditorSchemas.js +55 -0
- package/dist/node/core/schemas/getEntityEditorSchemas.js.map +1 -0
- package/dist/node/core/schemas/index.js +1 -1
- package/dist/node/core/schemas/index.js.map +1 -1
- package/dist/node/core/schemas/shared/index.js +5 -0
- package/dist/node/core/schemas/shared/index.js.map +1 -0
- package/dist/node/core/schemas/shared/subschemas.js +23 -0
- package/dist/node/core/schemas/shared/subschemas.js.map +1 -0
- package/dist/node/core/types/IHubProject.js.map +1 -1
- package/dist/node/initiatives/HubInitiative.js +12 -12
- package/dist/node/initiatives/HubInitiative.js.map +1 -1
- package/dist/node/initiatives/_internal/InitiativeSchema.js +16 -0
- package/dist/node/initiatives/_internal/InitiativeSchema.js.map +1 -0
- package/dist/node/initiatives/_internal/InitiativeUiSchemaEdit.js +23 -0
- package/dist/node/initiatives/_internal/InitiativeUiSchemaEdit.js.map +1 -0
- package/dist/node/projects/HubProject.js +7 -7
- package/dist/node/projects/HubProject.js.map +1 -1
- package/dist/node/projects/_internal/ProjectSchema.js +55 -0
- package/dist/node/projects/_internal/ProjectSchema.js.map +1 -0
- package/dist/node/projects/_internal/ProjectUiSchemaCreate.js +131 -0
- package/dist/node/projects/_internal/ProjectUiSchemaCreate.js.map +1 -0
- package/dist/node/projects/_internal/ProjectUiSchemaEdit.js +133 -0
- package/dist/node/projects/_internal/ProjectUiSchemaEdit.js.map +1 -0
- package/dist/node/projects/edit.js +11 -32
- package/dist/node/projects/edit.js.map +1 -1
- package/dist/types/core/behaviors/IWithEditorBehavior.d.ts +7 -2
- package/dist/types/core/schemas/getEntityEditorSchemas.d.ts +19 -0
- package/dist/types/core/schemas/index.d.ts +1 -1
- package/dist/types/core/schemas/shared/index.d.ts +1 -0
- package/dist/types/core/schemas/shared/subschemas.d.ts +29 -0
- package/dist/types/core/types/IHubProject.d.ts +0 -8
- package/dist/types/initiatives/HubInitiative.d.ts +11 -5
- package/dist/types/initiatives/_internal/InitiativeSchema.d.ts +7 -0
- package/dist/types/initiatives/_internal/InitiativeUiSchemaEdit.d.ts +5 -0
- package/dist/types/projects/HubProject.d.ts +8 -6
- package/dist/types/projects/_internal/ProjectSchema.d.ts +7 -0
- package/dist/types/projects/_internal/ProjectUiSchemaCreate.d.ts +7 -0
- package/dist/types/projects/_internal/ProjectUiSchemaEdit.d.ts +7 -0
- package/dist/types/projects/edit.d.ts +7 -4
- package/package.json +1 -1
- package/dist/esm/core/schemas/hubproject.js +0 -300
- package/dist/esm/core/schemas/hubproject.js.map +0 -1
- package/dist/node/core/schemas/hubproject.js +0 -303
- package/dist/node/core/schemas/hubproject.js.map +0 -1
- package/dist/types/core/schemas/hubproject.d.ts +0 -10
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uiSchema = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* complete edit uiSchema for Hub Projects - this defines
|
|
6
|
+
* how the schema properties should be rendered in the
|
|
7
|
+
* project editing experience
|
|
8
|
+
*/
|
|
9
|
+
exports.uiSchema = {
|
|
10
|
+
type: "Layout",
|
|
11
|
+
elements: [
|
|
12
|
+
{
|
|
13
|
+
type: "Section",
|
|
14
|
+
labelKey: "{{i18nScope}}.sections.basicInfo.label",
|
|
15
|
+
elements: [
|
|
16
|
+
{
|
|
17
|
+
labelKey: "{{i18nScope}}.fields.name.label",
|
|
18
|
+
scope: "/properties/name",
|
|
19
|
+
type: "Control",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
labelKey: "{{i18nScope}}.fields.summary.label",
|
|
23
|
+
scope: "/properties/summary",
|
|
24
|
+
type: "Control",
|
|
25
|
+
options: {
|
|
26
|
+
control: "hub-field-input-input",
|
|
27
|
+
type: "textarea",
|
|
28
|
+
helperText: {
|
|
29
|
+
labelKey: "{{i18nScope}}.fields.summary.helperText",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
labelKey: "{{i18nScope}}.fields.description.label",
|
|
35
|
+
scope: "/properties/description",
|
|
36
|
+
type: "Control",
|
|
37
|
+
options: {
|
|
38
|
+
control: "hub-field-input-input",
|
|
39
|
+
type: "textarea",
|
|
40
|
+
helperText: {
|
|
41
|
+
labelKey: "{{i18nScope}}.fields.description.helperText",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
labelKey: "{{i18nScope}}.fields.featuredImage.label",
|
|
47
|
+
scope: "/properties/view/properties/featuredImage",
|
|
48
|
+
type: "Control",
|
|
49
|
+
options: {
|
|
50
|
+
control: "hub-field-input-image-picker",
|
|
51
|
+
maxWidth: 727,
|
|
52
|
+
maxHeight: 484,
|
|
53
|
+
aspectRatio: 1.5,
|
|
54
|
+
helperText: {
|
|
55
|
+
labelKey: "{{i18nScope}}.fields.featuredImage.helperText",
|
|
56
|
+
},
|
|
57
|
+
sizeDescription: {
|
|
58
|
+
labelKey: "{{i18nScope}}.fields.featuredImage.sizeDescription",
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
type: "Section",
|
|
66
|
+
labelKey: "{{i18nScope}}.sections.location.label",
|
|
67
|
+
elements: [
|
|
68
|
+
{
|
|
69
|
+
scope: "/properties/extent",
|
|
70
|
+
type: "Control",
|
|
71
|
+
options: {
|
|
72
|
+
control: "hub-field-input-boundary-picker",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
labelKey: "{{i18nScope}}.fields.showMap.label",
|
|
77
|
+
scope: "/properties/view/properties/showMap",
|
|
78
|
+
type: "Control",
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
type: "Section",
|
|
84
|
+
labelKey: "{{i18nScope}}.sections.status.label",
|
|
85
|
+
elements: [
|
|
86
|
+
{
|
|
87
|
+
scope: "/properties/status",
|
|
88
|
+
type: "Control",
|
|
89
|
+
labelKey: "{{i18nScope}}.fields.status.label",
|
|
90
|
+
options: {
|
|
91
|
+
control: "hub-field-input-select",
|
|
92
|
+
enum: {
|
|
93
|
+
i18nScope: "{{i18nScope}}.fields.status.enum",
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
type: "Section",
|
|
101
|
+
labelKey: "{{i18nScope}}.sections.timeline.label",
|
|
102
|
+
elements: [
|
|
103
|
+
{
|
|
104
|
+
scope: "/properties/view/properties/timeline",
|
|
105
|
+
type: "Control",
|
|
106
|
+
options: {
|
|
107
|
+
control: "arcgis-hub-timeline-editor",
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: "Section",
|
|
114
|
+
labelKey: "{{i18nScope}}.sections.featuredContent.label",
|
|
115
|
+
options: {
|
|
116
|
+
helperText: {
|
|
117
|
+
labelKey: "{{i18nScope}}.sections.featuredContent.helperText",
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
elements: [
|
|
121
|
+
{
|
|
122
|
+
scope: "/properties/view/properties/featuredContentIds",
|
|
123
|
+
type: "Control",
|
|
124
|
+
options: {
|
|
125
|
+
control: "hub-field-input-gallery-picker",
|
|
126
|
+
targetEntity: "item",
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
};
|
|
133
|
+
//# sourceMappingURL=ProjectUiSchemaEdit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectUiSchemaEdit.js","sourceRoot":"","sources":["../../../../src/projects/_internal/ProjectUiSchemaEdit.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACU,QAAA,QAAQ,GAAc;IACjC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,wCAAwC;YAClD,QAAQ,EAAE;gBACR;oBACE,QAAQ,EAAE,iCAAiC;oBAC3C,KAAK,EAAE,kBAAkB;oBACzB,IAAI,EAAE,SAAS;iBAChB;gBAC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CAAmC;oBAC7C,OAAO,EAAE;wBACP,OAAO,EAAE,wBAAwB;wBACjC,IAAI,EAAE;4BACJ,SAAS,EAAE,kCAAkC;yBAC9C;qBACF;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,uCAAuC;YACjD,QAAQ,EAAE;gBACR;oBACE,KAAK,EAAE,sCAAsC;oBAC7C,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,OAAO,EAAE,4BAA4B;qBACtC;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,8CAA8C;YACxD,OAAO,EAAE;gBACP,UAAU,EAAE;oBACV,QAAQ,EAAE,mDAAmD;iBAC9D;aACF;YACD,QAAQ,EAAE;gBACR;oBACE,KAAK,EAAE,gDAAgD;oBACvD,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,OAAO,EAAE,gCAAgC;wBACzC,YAAY,EAAE,MAAM;qBACrB;iBACF;aACF;SACF;KACF;CACF,CAAC"}
|
|
@@ -8,14 +8,11 @@ const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
|
8
8
|
const PropertyMapper_1 = require("../core/_internal/PropertyMapper");
|
|
9
9
|
const types_1 = require("../core/types");
|
|
10
10
|
const defaults_1 = require("./defaults");
|
|
11
|
-
const schemas_1 = require("../core/schemas");
|
|
12
|
-
const internal_1 = require("../core/schemas/internal");
|
|
13
|
-
const applyUiSchemaElementOptions_1 = require("../core/schemas/internal/applyUiSchemaElementOptions");
|
|
14
11
|
const computeProps_1 = require("./_internal/computeProps");
|
|
15
12
|
const getPropertyMap_1 = require("./_internal/getPropertyMap");
|
|
16
13
|
const util_1 = require("../util");
|
|
17
|
-
const interpolate_1 = require("../items/interpolate");
|
|
18
14
|
const configureBaseResources_1 = require("../core/_internal/configureBaseResources");
|
|
15
|
+
const schemas_1 = require("../core/schemas");
|
|
19
16
|
/**
|
|
20
17
|
* @private
|
|
21
18
|
* Create a new Hub Project item
|
|
@@ -110,37 +107,19 @@ async function deleteProject(id, requestOptions) {
|
|
|
110
107
|
}
|
|
111
108
|
exports.deleteProject = deleteProject;
|
|
112
109
|
/**
|
|
110
|
+
* DEPRECATED: the following will be removed at next breaking version
|
|
111
|
+
* use the getEntityEditorSchemas function instead (which this function
|
|
112
|
+
* has already been refactored to consume)
|
|
113
|
+
*
|
|
113
114
|
* Get the editor config for for the HubProject entity.
|
|
114
|
-
* @param i18nScope
|
|
115
|
-
* @param type
|
|
116
|
-
* @param options
|
|
117
|
-
* @returns
|
|
115
|
+
* @param i18nScope translation scope to be interpolated into the uiSchema
|
|
116
|
+
* @param type editor type - corresonds to the returned uiSchema
|
|
117
|
+
* @param options optional hash of dynamic uiSchema element options
|
|
118
118
|
*/
|
|
119
|
+
/* istanbul ignore next deprecated */
|
|
119
120
|
async function getHubProjectEditorConfig(i18nScope, type, options = []) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
// uiSchema is the complete (edit) schema, unless otherwise specified
|
|
123
|
-
let uiSchema = util_1.cloneObject(schemas_1.HubProjectEditUiSchema);
|
|
124
|
-
// by default we don't need to filter the schema b/c it's the entire schema
|
|
125
|
-
let filterSchema = false;
|
|
126
|
-
// if another schema is requested, we need to use that UI schema
|
|
127
|
-
// and the subset the overall schema down to just the properties
|
|
128
|
-
// used in the UI schema
|
|
129
|
-
switch (type) {
|
|
130
|
-
case "create":
|
|
131
|
-
uiSchema = util_1.cloneObject(schemas_1.HubProjectCreateUiSchema);
|
|
132
|
-
filterSchema = true;
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
if (filterSchema) {
|
|
136
|
-
// filter out properties not used in the UI schema
|
|
137
|
-
schema = internal_1.filterSchemaToUiSchema(schema, uiSchema);
|
|
138
|
-
}
|
|
139
|
-
// apply the options
|
|
140
|
-
uiSchema = applyUiSchemaElementOptions_1.applyUiSchemaElementOptions(uiSchema, options);
|
|
141
|
-
// interpolate the i18n scope into the uiSchema
|
|
142
|
-
uiSchema = interpolate_1.interpolate(uiSchema, { i18nScope });
|
|
143
|
-
return Promise.resolve({ schema, uiSchema });
|
|
121
|
+
const editorType = `hub:project:${type}`;
|
|
122
|
+
return schemas_1.getEntityEditorSchemas(i18nScope, editorType, options);
|
|
144
123
|
}
|
|
145
124
|
exports.getHubProjectEditorConfig = getHubProjectEditorConfig;
|
|
146
125
|
//# sourceMappingURL=edit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../src/projects/edit.ts"],"names":[],"mappings":";;;AAEA,4EAA4E;AAC5E,sCAKmB;AACnB,0CAA8E;
|
|
1
|
+
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../src/projects/edit.ts"],"names":[],"mappings":";;;AAEA,4EAA4E;AAC5E,sCAKmB;AACnB,0CAA8E;AAC9E,iEAAwE;AACxE,qEAAkE;AAClE,yCAA+D;AAC/D,yCAAoE;AACpE,2DAAwD;AACxD,+DAA4D;AAE5D,kCAAsC;AACtC,qFAAkF;AAClF,6CAGyB;AAMzB;;;;;;;;GAQG;AACI,KAAK,UAAU,aAAa,CACjC,cAAoC,EACpC,cAAmC;IAEnC,IAAI,SAAS,CAAC;IACd,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,uBAAuB;IACvB,OAAO,CAAC,YAAY,GAAG,sBAAc,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,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CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;AAChE,CAAC;AARD,8DAQC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import { IConfigurationSchema, IUiSchema, UiSchemaElementOptions } from "../schemas";
|
|
1
|
+
import { IConfigurationSchema, IUiSchema, UiSchemaElementOptions, EditorType } from "../schemas";
|
|
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
|
+
*/
|
|
2
7
|
export declare type EditorConfigType = "create" | "edit";
|
|
3
8
|
export interface IEditorConfig {
|
|
4
9
|
schema: IConfigurationSchema;
|
|
@@ -8,5 +13,5 @@ export interface IEditorConfig {
|
|
|
8
13
|
*
|
|
9
14
|
*/
|
|
10
15
|
export interface IWithEditorBehavior {
|
|
11
|
-
getEditorConfig(i18nScope: string, type:
|
|
16
|
+
getEditorConfig(i18nScope: string, type: EditorType, options: UiSchemaElementOptions[]): Promise<IEditorConfig>;
|
|
12
17
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IEditorConfig } from "../behaviors";
|
|
2
|
+
import { UiSchemaElementOptions } from "./types";
|
|
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:initiative:edit"];
|
|
9
|
+
/**
|
|
10
|
+
* get the editor schema and uiSchema defined for an entity.
|
|
11
|
+
* The schema and uiSchema that are returned can be used to
|
|
12
|
+
* render a form UI (using the configuration editor)
|
|
13
|
+
*
|
|
14
|
+
* @param i18nScope translation scope to be interpolated into the uiSchema
|
|
15
|
+
* @param type editor type - corresonds to the returned uiSchema
|
|
16
|
+
* @param options optional hash of dynamic uiSchema element options
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
export declare const getEntityEditorSchemas: (i18nScope: string, type: EditorType, options?: UiSchemaElementOptions[]) => Promise<IEditorConfig>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./types";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./getEntityEditorSchemas";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./subschemas";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For consistency and validation purposes, leverage these commonly
|
|
3
|
+
* re-used subschemas in your schema definitions
|
|
4
|
+
*/
|
|
5
|
+
export declare const ENTITY_NAME_SCHEMA: {
|
|
6
|
+
type: string;
|
|
7
|
+
minLength: number;
|
|
8
|
+
maxLength: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const ENTITY_EXTENT_SCHEMA: {
|
|
11
|
+
type: string;
|
|
12
|
+
properties: {
|
|
13
|
+
spatialReference: {
|
|
14
|
+
type: string;
|
|
15
|
+
};
|
|
16
|
+
xmax: {
|
|
17
|
+
type: string[];
|
|
18
|
+
};
|
|
19
|
+
xmin: {
|
|
20
|
+
type: string[];
|
|
21
|
+
};
|
|
22
|
+
ymax: {
|
|
23
|
+
type: string[];
|
|
24
|
+
};
|
|
25
|
+
ymin: {
|
|
26
|
+
type: string[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import { IWithLayout, IWithPermissions, IWithSlug, IWithCatalog } from "../traits/index";
|
|
2
2
|
import { IHubItemEntity } from "./IHubItemEntity";
|
|
3
|
-
import { IHubTimeline } from "./IHubTimeline";
|
|
4
3
|
/**
|
|
5
4
|
* Defines the properties of a Hub Project object
|
|
6
5
|
*/
|
|
7
6
|
export interface IHubProject extends IHubItemEntity, IWithSlug, IWithCatalog, IWithLayout, IWithPermissions {
|
|
8
|
-
/**
|
|
9
|
-
* Timeline for the project
|
|
10
|
-
*/
|
|
11
|
-
timeline?: IHubTimeline;
|
|
12
|
-
/**
|
|
13
|
-
* Project Status
|
|
14
|
-
*/
|
|
15
7
|
status: PROJECT_STATUSES;
|
|
16
8
|
}
|
|
17
9
|
export declare enum PROJECT_STATUSES {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { IHubInitiative, IWithCatalogBehavior, IWithStoreBehavior, IWithSharingBehavior } from "../core";
|
|
1
|
+
import { IHubInitiative, IWithCatalogBehavior, IWithStoreBehavior, IWithSharingBehavior, UiSchemaElementOptions, IEditorConfig } from "../core";
|
|
2
2
|
import { Catalog } from "../search";
|
|
3
3
|
import { IArcGISContext } from "../ArcGISContext";
|
|
4
4
|
import { HubItemEntity } from "../core/HubItemEntity";
|
|
5
|
+
import { InitiativeEditorType } from "./_internal/InitiativeSchema";
|
|
5
6
|
/**
|
|
6
7
|
* Hub Initiative Class
|
|
7
8
|
*/
|
|
@@ -41,11 +42,16 @@ export declare class HubInitiative extends HubItemEntity<IHubInitiative> impleme
|
|
|
41
42
|
*/
|
|
42
43
|
static fetch(identifier: string, context: IArcGISContext): Promise<HubInitiative>;
|
|
43
44
|
/**
|
|
44
|
-
* Static method to get the editor config for
|
|
45
|
-
* @param i18nScope
|
|
46
|
-
* @param type
|
|
47
|
-
* @param options
|
|
45
|
+
* Static method to get the editor config for the HubInitiative entity.
|
|
46
|
+
* @param i18nScope translation scope to be interpolated into the uiSchema
|
|
47
|
+
* @param type editor type - corresonds to the returned uiSchema
|
|
48
|
+
* @param options optional hash of dynamic uiSchema element options
|
|
49
|
+
*
|
|
50
|
+
* Note: typescript does not have a means to specify static methods in interfaces
|
|
51
|
+
* so while this is the implementation of IWithEditorBehavior, it is not enforced
|
|
52
|
+
* by the compiler.
|
|
48
53
|
*/
|
|
54
|
+
static getEditorConfig(i18nScope: string, type: InitiativeEditorType, options?: UiSchemaElementOptions[]): Promise<IEditorConfig>;
|
|
49
55
|
private static applyDefaults;
|
|
50
56
|
/**
|
|
51
57
|
* Apply a new state to the instance
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IConfigurationSchema } from "../../core";
|
|
2
|
+
export declare type InitiativeEditorType = (typeof InitiativeEditorTypes)[number];
|
|
3
|
+
export declare const InitiativeEditorTypes: readonly ["hub:initiative:edit"];
|
|
4
|
+
/**
|
|
5
|
+
* defines the JSON schema for a Hub Initiative's editable fields
|
|
6
|
+
*/
|
|
7
|
+
export declare const InitiativeSchema: IConfigurationSchema;
|
|
@@ -2,7 +2,8 @@ import { IHubProject, IWithCatalogBehavior, IWithStoreBehavior, IWithSharingBeha
|
|
|
2
2
|
import { Catalog } from "../search";
|
|
3
3
|
import { IArcGISContext } from "../ArcGISContext";
|
|
4
4
|
import { HubItemEntity } from "../core/HubItemEntity";
|
|
5
|
-
import {
|
|
5
|
+
import { IEditorConfig } from "../core/behaviors/IWithEditorBehavior";
|
|
6
|
+
import { ProjectEditorType } from "./_internal/ProjectSchema";
|
|
6
7
|
/**
|
|
7
8
|
* Hub Project Class
|
|
8
9
|
*/
|
|
@@ -42,15 +43,16 @@ export declare class HubProject extends HubItemEntity<IHubProject> implements IW
|
|
|
42
43
|
*/
|
|
43
44
|
static fetch(identifier: string, context: IArcGISContext): Promise<HubProject>;
|
|
44
45
|
/**
|
|
45
|
-
* Static method to get the editor config for
|
|
46
|
-
* @param i18nScope
|
|
47
|
-
* @param type
|
|
48
|
-
* @param options
|
|
46
|
+
* Static method to get the editor config for the HubProject entity.
|
|
47
|
+
* @param i18nScope translation scope to be interpolated into the uiSchema
|
|
48
|
+
* @param type editor type - corresonds to the returned uiSchema
|
|
49
|
+
* @param options optional hash of dynamic uiSchema element options
|
|
50
|
+
*
|
|
49
51
|
* Note: typescript does not have a means to specify static methods in interfaces
|
|
50
52
|
* so while this is the implementation of IWithEditorBehavior, it is not enforced
|
|
51
53
|
* by the compiler.
|
|
52
54
|
*/
|
|
53
|
-
static getEditorConfig(i18nScope: string, type:
|
|
55
|
+
static getEditorConfig(i18nScope: string, type: ProjectEditorType, options?: UiSchemaElementOptions[]): Promise<IEditorConfig>;
|
|
54
56
|
private static applyDefaults;
|
|
55
57
|
/**
|
|
56
58
|
* Apply a new state to the instance
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IConfigurationSchema } from "../../core";
|
|
2
|
+
export declare type ProjectEditorType = (typeof ProjectEditorTypes)[number];
|
|
3
|
+
export declare const ProjectEditorTypes: readonly ["hub:project:create", "hub:project:edit"];
|
|
4
|
+
/**
|
|
5
|
+
* defines the JSON schema for a Hub Project's editable fields
|
|
6
|
+
*/
|
|
7
|
+
export declare const ProjectSchema: IConfigurationSchema;
|
|
@@ -27,10 +27,13 @@ export declare function updateProject(project: IHubProject, requestOptions: IUse
|
|
|
27
27
|
*/
|
|
28
28
|
export declare function deleteProject(id: string, requestOptions: IUserRequestOptions): Promise<void>;
|
|
29
29
|
/**
|
|
30
|
+
* DEPRECATED: the following will be removed at next breaking version
|
|
31
|
+
* use the getEntityEditorSchemas function instead (which this function
|
|
32
|
+
* has already been refactored to consume)
|
|
33
|
+
*
|
|
30
34
|
* Get the editor config for for the HubProject entity.
|
|
31
|
-
* @param i18nScope
|
|
32
|
-
* @param type
|
|
33
|
-
* @param options
|
|
34
|
-
* @returns
|
|
35
|
+
* @param i18nScope translation scope to be interpolated into the uiSchema
|
|
36
|
+
* @param type editor type - corresonds to the returned uiSchema
|
|
37
|
+
* @param options optional hash of dynamic uiSchema element options
|
|
35
38
|
*/
|
|
36
39
|
export declare function getHubProjectEditorConfig(i18nScope: string, type: EditorConfigType, options?: UiSchemaElementOptions[]): Promise<IEditorConfig>;
|