@esri/hub-common 14.47.0 → 14.48.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/EntityEditor.js +2 -2
- package/dist/esm/core/EntityEditor.js.map +1 -1
- package/dist/esm/core/schemas/internal/getCardEditorSchemas.js +2 -2
- package/dist/esm/core/schemas/internal/getCardEditorSchemas.js.map +1 -1
- package/dist/esm/core/schemas/internal/getEditorSchemas.js +1 -0
- package/dist/esm/core/schemas/internal/getEditorSchemas.js.map +1 -1
- package/dist/esm/core/schemas/internal/metrics/MetricSchema.js +1 -1
- package/dist/esm/core/schemas/internal/metrics/MetricSchema.js.map +1 -1
- package/dist/esm/core/schemas/internal/metrics/ProjectUiSchemaMetrics.js +31 -0
- package/dist/esm/core/schemas/internal/metrics/ProjectUiSchemaMetrics.js.map +1 -0
- package/dist/esm/core/schemas/internal/metrics/editorToMetric.js +121 -0
- package/dist/esm/core/schemas/internal/metrics/editorToMetric.js.map +1 -0
- package/dist/esm/core/schemas/internal/metrics/metricToEditor.js +22 -0
- package/dist/esm/core/schemas/internal/metrics/metricToEditor.js.map +1 -0
- package/dist/esm/core/schemas/internal/metrics/setMetricAndDisplay.js +29 -0
- package/dist/esm/core/schemas/internal/metrics/setMetricAndDisplay.js.map +1 -0
- package/dist/esm/core/schemas/shared/enums.js +34 -0
- package/dist/esm/core/schemas/shared/enums.js.map +1 -0
- package/dist/esm/core/schemas/types.js +0 -18
- package/dist/esm/core/schemas/types.js.map +1 -1
- package/dist/esm/core/types/Metrics.js +12 -0
- package/dist/esm/core/types/Metrics.js.map +1 -1
- package/dist/esm/projects/HubProject.js +24 -2
- package/dist/esm/projects/HubProject.js.map +1 -1
- package/dist/esm/projects/_internal/ProjectSchema.js +3 -1
- package/dist/esm/projects/_internal/ProjectSchema.js.map +1 -1
- package/dist/node/core/EntityEditor.js +2 -2
- package/dist/node/core/EntityEditor.js.map +1 -1
- package/dist/node/core/schemas/internal/getCardEditorSchemas.js +2 -2
- package/dist/node/core/schemas/internal/getCardEditorSchemas.js.map +1 -1
- package/dist/node/core/schemas/internal/getEditorSchemas.js +1 -0
- package/dist/node/core/schemas/internal/getEditorSchemas.js.map +1 -1
- package/dist/node/core/schemas/internal/metrics/MetricSchema.js +4 -4
- package/dist/node/core/schemas/internal/metrics/MetricSchema.js.map +1 -1
- package/dist/node/core/schemas/internal/metrics/ProjectUiSchemaMetrics.js +34 -0
- package/dist/node/core/schemas/internal/metrics/ProjectUiSchemaMetrics.js.map +1 -0
- package/dist/node/core/schemas/internal/metrics/editorToMetric.js +126 -0
- package/dist/node/core/schemas/internal/metrics/editorToMetric.js.map +1 -0
- package/dist/node/core/schemas/internal/metrics/metricToEditor.js +26 -0
- package/dist/node/core/schemas/internal/metrics/metricToEditor.js.map +1 -0
- package/dist/node/core/schemas/internal/metrics/setMetricAndDisplay.js +33 -0
- package/dist/node/core/schemas/internal/metrics/setMetricAndDisplay.js.map +1 -0
- package/dist/node/core/schemas/shared/enums.js +37 -0
- package/dist/node/core/schemas/shared/enums.js.map +1 -0
- package/dist/node/core/schemas/types.js +1 -19
- package/dist/node/core/schemas/types.js.map +1 -1
- package/dist/node/core/types/Metrics.js +13 -0
- package/dist/node/core/types/Metrics.js.map +1 -1
- package/dist/node/projects/HubProject.js +23 -1
- package/dist/node/projects/HubProject.js.map +1 -1
- package/dist/node/projects/_internal/ProjectSchema.js +3 -1
- package/dist/node/projects/_internal/ProjectSchema.js.map +1 -1
- package/dist/types/core/EntityEditor.d.ts +1 -1
- package/dist/types/core/behaviors/IWithEditorBehavior.d.ts +3 -2
- package/dist/types/core/schemas/internal/metrics/ProjectUiSchemaMetrics.d.ts +12 -0
- package/dist/types/core/schemas/internal/metrics/editorToMetric.d.ts +26 -0
- package/dist/types/core/schemas/internal/metrics/metricToEditor.d.ts +8 -0
- package/dist/types/core/schemas/internal/metrics/setMetricAndDisplay.d.ts +13 -0
- package/dist/types/core/schemas/shared/enums.d.ts +30 -0
- package/dist/types/core/schemas/types.d.ts +2 -17
- package/dist/types/core/types/HubEntityEditor.d.ts +1 -0
- package/dist/types/core/types/IHubItemEntity.d.ts +2 -0
- package/dist/types/core/types/Metrics.d.ts +55 -2
- package/dist/types/projects/HubProject.d.ts +1 -1
- package/dist/types/projects/_internal/ProjectSchema.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Alignment values allowed for a display
|
|
3
|
+
*
|
|
4
|
+
* values = start | center | end
|
|
5
|
+
*/
|
|
6
|
+
export declare enum ALIGNMENTS {
|
|
7
|
+
start = "start",
|
|
8
|
+
center = "center",
|
|
9
|
+
end = "end"
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Corner values allowed for a display
|
|
13
|
+
*
|
|
14
|
+
* values = square | round
|
|
15
|
+
*/
|
|
16
|
+
export declare enum CORNERS {
|
|
17
|
+
square = "square",
|
|
18
|
+
round = "round"
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Drop shadow values allowed for a display
|
|
22
|
+
*
|
|
23
|
+
* values = none | low | medium | heavy
|
|
24
|
+
*/
|
|
25
|
+
export declare enum DROP_SHADOWS {
|
|
26
|
+
none = "none",
|
|
27
|
+
low = "low",
|
|
28
|
+
medium = "medium",
|
|
29
|
+
heavy = "heavy"
|
|
30
|
+
}
|
|
@@ -9,7 +9,7 @@ export interface IEditorConfig {
|
|
|
9
9
|
* to the supported/defined uiSchema configurations
|
|
10
10
|
*/
|
|
11
11
|
export declare type EntityEditorType = (typeof validEntityEditorTypes)[number];
|
|
12
|
-
export declare const validEntityEditorTypes: readonly ["hub:project:create", "hub:project:edit", "hub:content:edit", "hub:content:settings", "hub:content:discussions", "hub:initiative:edit", "hub:initiative:create", "hub:site:edit", "hub:site:create", "hub:site:followers", "hub:site:discussions", "hub:site:settings", "hub:discussion:edit", "hub:discussion:create", "hub:discussion:settings", "hub:page:edit", "hub:template:edit", "hub:group:edit", "hub:group:settings", "hub:group:discussions", "hub:initiativeTemplate:edit"];
|
|
12
|
+
export declare const validEntityEditorTypes: readonly ["hub:project:create", "hub:project:edit", "hub:project:metrics", "hub:content:edit", "hub:content:settings", "hub:content:discussions", "hub:initiative:edit", "hub:initiative:create", "hub:site:edit", "hub:site:create", "hub:site:followers", "hub:site:discussions", "hub:site:settings", "hub:discussion:edit", "hub:discussion:create", "hub:discussion:settings", "hub:page:edit", "hub:template:edit", "hub:group:edit", "hub:group:settings", "hub:group:discussions", "hub:initiativeTemplate:edit"];
|
|
13
13
|
/** Defines the possible editor type values for a stat card. These
|
|
14
14
|
* correspond to the supported/defined uiSchema configurations. This should
|
|
15
15
|
* have its own signature in the getEditorConfig function.
|
|
@@ -27,7 +27,7 @@ export declare const validCardEditorTypes: readonly ["hub:card:stat"];
|
|
|
27
27
|
* to defined schema/uiSchema configurations
|
|
28
28
|
*/
|
|
29
29
|
export declare type EditorType = (typeof validEditorTypes)[number];
|
|
30
|
-
export declare const validEditorTypes: readonly ["hub:project:create", "hub:project:edit", "hub:content:edit", "hub:content:settings", "hub:content:discussions", "hub:initiative:edit", "hub:initiative:create", "hub:site:edit", "hub:site:create", "hub:site:followers", "hub:site:discussions", "hub:site:settings", "hub:discussion:edit", "hub:discussion:create", "hub:discussion:settings", "hub:page:edit", "hub:template:edit", "hub:group:edit", "hub:group:settings", "hub:group:discussions", "hub:initiativeTemplate:edit", "hub:card:stat"];
|
|
30
|
+
export declare const validEditorTypes: readonly ["hub:project:create", "hub:project:edit", "hub:project:metrics", "hub:content:edit", "hub:content:settings", "hub:content:discussions", "hub:initiative:edit", "hub:initiative:create", "hub:site:edit", "hub:site:create", "hub:site:followers", "hub:site:discussions", "hub:site:settings", "hub:discussion:edit", "hub:discussion:create", "hub:discussion:settings", "hub:page:edit", "hub:template:edit", "hub:group:edit", "hub:group:settings", "hub:group:discussions", "hub:initiativeTemplate:edit", "hub:card:stat"];
|
|
31
31
|
export declare enum UiSchemaRuleEffects {
|
|
32
32
|
SHOW = "SHOW",
|
|
33
33
|
HIDE = "HIDE",
|
|
@@ -131,18 +131,3 @@ export interface IUiSchemaCondition {
|
|
|
131
131
|
scope?: string;
|
|
132
132
|
schema: IConfigurationSchema;
|
|
133
133
|
}
|
|
134
|
-
export declare enum ALIGNMENTS {
|
|
135
|
-
start = "start",
|
|
136
|
-
center = "center",
|
|
137
|
-
end = "end"
|
|
138
|
-
}
|
|
139
|
-
export declare enum CORNERS {
|
|
140
|
-
square = "square",
|
|
141
|
-
round = "round"
|
|
142
|
-
}
|
|
143
|
-
export declare enum DROP_SHADOWS {
|
|
144
|
-
none = "none",
|
|
145
|
-
low = "low",
|
|
146
|
-
medium = "medium",
|
|
147
|
-
heavy = "heavy"
|
|
148
|
-
}
|
|
@@ -5,6 +5,7 @@ import { IWithPermissions, IWithViewSettings, IWithDiscussions } from "../traits
|
|
|
5
5
|
import { IHubLocation } from "./IHubLocation";
|
|
6
6
|
import { IWithFollowers } from "../traits/IWithFollowers";
|
|
7
7
|
import { IWithAssociations } from "../traits/IWithAssociations";
|
|
8
|
+
import { IMetricEditorValues } from "./Metrics";
|
|
8
9
|
/**
|
|
9
10
|
* Properties exposed by Entities that are backed by Items
|
|
10
11
|
*/
|
|
@@ -122,4 +123,5 @@ export declare type IHubItemEntityEditor<T> = Omit<T, "extent"> & {
|
|
|
122
123
|
showFollowAction?: boolean;
|
|
123
124
|
isDiscussable?: boolean;
|
|
124
125
|
};
|
|
126
|
+
_metric?: IMetricEditorValues;
|
|
125
127
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="arcgis-js-api" />
|
|
2
2
|
import { IQuery } from "../../search/types/IHubCatalog";
|
|
3
|
-
import { IField } from "@esri/arcgis-rest-types";
|
|
4
|
-
import { ServiceAggregation } from "./DynamicValues";
|
|
3
|
+
import { FieldType, IField } from "@esri/arcgis-rest-types";
|
|
5
4
|
import { IReference } from "./IReference";
|
|
5
|
+
import { ServiceAggregation } from "../../core/types/DynamicValues";
|
|
6
6
|
/**
|
|
7
7
|
* Defines the information required from a Metric
|
|
8
8
|
*/
|
|
@@ -182,6 +182,20 @@ export interface IExpression {
|
|
|
182
182
|
* A special identifier given to the expression when it is created
|
|
183
183
|
*/
|
|
184
184
|
key?: string;
|
|
185
|
+
/**
|
|
186
|
+
* Relation between the values in an expression
|
|
187
|
+
*/
|
|
188
|
+
relationship?: ExpressionRelationships;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Possible relationships for an expression
|
|
192
|
+
* BETWEEN -- used to show between two values, i.e. 7 < x < 10
|
|
193
|
+
* IS_EXACTLY -- for exact matching, i.e. two same strings
|
|
194
|
+
*/
|
|
195
|
+
export declare enum ExpressionRelationships {
|
|
196
|
+
BETWEEN = "between",
|
|
197
|
+
IS_EXACTLY = "isExactly",
|
|
198
|
+
LIKE = "like"
|
|
185
199
|
}
|
|
186
200
|
/**
|
|
187
201
|
* Configuration for how to show a metric in the ui
|
|
@@ -191,3 +205,42 @@ export interface IMetricDisplayConfig {
|
|
|
191
205
|
displayType: string;
|
|
192
206
|
[key: string]: any;
|
|
193
207
|
}
|
|
208
|
+
/**
|
|
209
|
+
* Editor values expected when editing a metric
|
|
210
|
+
*/
|
|
211
|
+
export interface IMetricEditorValues extends IMetricDisplayConfig {
|
|
212
|
+
/** the main value of the metric */
|
|
213
|
+
value?: string | number;
|
|
214
|
+
/** all values related to constructing a service-query metric */
|
|
215
|
+
dynamicMetric?: IDynamicMetricValues;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Editor values associated with editing a dynamic metric
|
|
219
|
+
*/
|
|
220
|
+
export interface IDynamicMetricValues {
|
|
221
|
+
/** id of the item being queried */
|
|
222
|
+
itemId?: string;
|
|
223
|
+
/** id of the layer of the item being queried */
|
|
224
|
+
layerId?: number;
|
|
225
|
+
/** field of the layer of the item being queried to run the aggregation on */
|
|
226
|
+
field?: string;
|
|
227
|
+
/** the method of service aggregation -- count, min, max, etc. */
|
|
228
|
+
statistic?: string;
|
|
229
|
+
/** the feature service url of the item being queried */
|
|
230
|
+
serviceUrl?: string;
|
|
231
|
+
/** the esri-dictated field type of the field being queried */
|
|
232
|
+
fieldType?: FieldType;
|
|
233
|
+
/** a clause to filter the query by -- ex: field BETWEEN 0 AND 2 */
|
|
234
|
+
where?: string;
|
|
235
|
+
/** the ui navigational link to the item source */
|
|
236
|
+
sourceLink?: string;
|
|
237
|
+
/** the text displayed in the ui for the sourceLink */
|
|
238
|
+
sourceTitle?: string;
|
|
239
|
+
/** whether attribute filtering should be enabled */
|
|
240
|
+
allowExpressionSet?: boolean;
|
|
241
|
+
/** a list of expressions with which to construct a where clause */
|
|
242
|
+
expressionSet?: IExpression[];
|
|
243
|
+
/** the old where clause, utilized during the migration of the old summary stat card */
|
|
244
|
+
legacyWhere?: string;
|
|
245
|
+
[key: string]: any;
|
|
246
|
+
}
|
|
@@ -71,7 +71,7 @@ export declare class HubProject extends HubItemEntity<IHubProject> implements IW
|
|
|
71
71
|
* @param editor
|
|
72
72
|
* @returns
|
|
73
73
|
*/
|
|
74
|
-
fromEditor(editor: IHubProjectEditor): Promise<IHubProject>;
|
|
74
|
+
fromEditor(editor: IHubProjectEditor, editorContext?: IEntityEditorContext): Promise<IHubProject>;
|
|
75
75
|
/**
|
|
76
76
|
* Apply a new state to the instance
|
|
77
77
|
* @param changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IConfigurationSchema } from "../../core/schemas/types";
|
|
2
2
|
export declare type ProjectEditorType = (typeof ProjectEditorTypes)[number];
|
|
3
|
-
export declare const ProjectEditorTypes: readonly ["hub:project:create", "hub:project:edit"];
|
|
3
|
+
export declare const ProjectEditorTypes: readonly ["hub:project:create", "hub:project:edit", "hub:project:metrics"];
|
|
4
4
|
/**
|
|
5
5
|
* Defines the JSON schema for a Hub Project's editable fields
|
|
6
6
|
*/
|