@esri/hub-common 13.45.0 → 13.46.1

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.
@@ -17,9 +17,9 @@ export const uiSchema = {
17
17
  options: {
18
18
  control: "hub-field-input-radio",
19
19
  labels: [
20
- "{{i18nScope}}.fields.membershipAccess.org.label",
21
- "{{i18nScope}}.fields.membershipAccess.collab.label",
22
- "{{i18nScope}}.fields.membershipAccess.any.label",
20
+ "{{{{i18nScope}}.fields.membershipAccess.org:translate}}",
21
+ "{{{{i18nScope}}.fields.membershipAccess.collab:translate}}",
22
+ "{{{{i18nScope}}.fields.membershipAccess.any:translate}}",
23
23
  ],
24
24
  },
25
25
  },
@@ -30,8 +30,8 @@ export const uiSchema = {
30
30
  options: {
31
31
  control: "hub-field-input-radio",
32
32
  labels: [
33
- "{{i18nScope}}.fields.contributeContent.all.label",
34
- "{{i18nScope}}.fields.contributeContent.admins.label",
33
+ "{{{{i18nScope}}.fields.contributeContent.all:translate}}",
34
+ "{{{{i18nScope}}.fields.contributeContent.admins:translate}}",
35
35
  ],
36
36
  },
37
37
  },
@@ -1 +1 @@
1
- {"version":3,"file":"GroupUiSchemaSettings.js","sourceRoot":"","sources":["../../../../src/groups/_internal/GroupUiSchemaSettings.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAc;IACjC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,+CAA+C;YACzD,QAAQ,EAAE;gBACR;oBACE,QAAQ,EAAE,6CAA6C;oBACvD,KAAK,EAAE,8BAA8B;oBACrC,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,OAAO,EAAE,uBAAuB;wBAChC,MAAM,EAAE;4BACN,iDAAiD;4BACjD,oDAAoD;4BACpD,iDAAiD;yBAClD;qBACF;iBACF;gBACD;oBACE,QAAQ,EAAE,8CAA8C;oBACxD,KAAK,EAAE,wBAAwB;oBAC/B,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,OAAO,EAAE,uBAAuB;wBAChC,MAAM,EAAE;4BACN,kDAAkD;4BAClD,qDAAqD;yBACtD;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC"}
1
+ {"version":3,"file":"GroupUiSchemaSettings.js","sourceRoot":"","sources":["../../../../src/groups/_internal/GroupUiSchemaSettings.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAc;IACjC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,+CAA+C;YACzD,QAAQ,EAAE;gBACR;oBACE,QAAQ,EAAE,6CAA6C;oBACvD,KAAK,EAAE,8BAA8B;oBACrC,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,OAAO,EAAE,uBAAuB;wBAChC,MAAM,EAAE;4BACN,yDAAyD;4BACzD,4DAA4D;4BAC5D,yDAAyD;yBAC1D;qBACF;iBACF;gBACD;oBACE,QAAQ,EAAE,8CAA8C;oBACxD,KAAK,EAAE,wBAAwB;oBAC/B,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,OAAO,EAAE,uBAAuB;wBAChC,MAAM,EAAE;4BACN,0DAA0D;4BAC1D,6DAA6D;yBAC9D;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC"}
@@ -0,0 +1,188 @@
1
+ import { setProp, getProp } from "../../objects";
2
+ import { cloneObject, createId } from "../../util";
3
+ /**
4
+ * Reconfigure summary stat card properties to align with the
5
+ * new web component card.
6
+ * @private
7
+ * @param {Object} model Site Model
8
+ * @returns {Object}
9
+ */
10
+ export function _migrateSummaryStatCardConfigs(model) {
11
+ // attempt migration for 1.7 schema version
12
+ const migratedModel = _migrateSummaryStatSchemaVersion1_7(model);
13
+ return migratedModel;
14
+ }
15
+ function _migrateSummaryStatSchemaVersion1_7(model) {
16
+ // do nothing if migration already applied
17
+ if (getProp(model, "item.properties.schemaVersion") >= 1.7)
18
+ return model;
19
+ // apply migration
20
+ const clone = cloneObject(model);
21
+ clone.data.values.layout.sections.map((section) => (Object.assign(Object.assign({}, section), { rows: (section.rows || []).map((row) => (Object.assign(Object.assign({}, row), { cards: (row.cards || []).map((card) => {
22
+ var _a;
23
+ if (card.component.name === "summary-statistic-card") {
24
+ const values = card.component.settings;
25
+ const expressionSet = whereToExpressionSet(values.where);
26
+ card.component.settings = {
27
+ type: "dynamic",
28
+ cardTitle: values.title,
29
+ dynamicMetric: {
30
+ itemId: [values.itemId],
31
+ layerId: (_a = values.layerId) === null || _a === void 0 ? void 0 : _a.toString(),
32
+ field: values.statFieldName,
33
+ fieldType: values.statFieldType,
34
+ statistic: values.statType,
35
+ serviceUrl: getServiceUrl(values.url),
36
+ expressionSet,
37
+ allowExpressionSet: !!expressionSet.length,
38
+ },
39
+ serverTimeout: values.timeout,
40
+ textAlign: migrateTextAlign(values.statValueAlign),
41
+ valueColor: values.statValueColor === null
42
+ ? undefined
43
+ : values.statValueColor,
44
+ trailingText: values.trailingText,
45
+ cardId: values.cardId || createId(),
46
+ // did not exist on old stat card
47
+ allowUnitFormatting: false,
48
+ allowLink: false,
49
+ };
50
+ }
51
+ return card;
52
+ }) }))) })));
53
+ setProp("item.properties.schemaVersion", 1.7, clone);
54
+ return clone;
55
+ }
56
+ function getServiceUrl(url) {
57
+ let serviceUrl = url;
58
+ // url has layer id at end
59
+ if ((url === null || url === void 0 ? void 0 : url.lastIndexOf("FeatureServer")) > -1) {
60
+ serviceUrl = url.slice(0, url.lastIndexOf("FeatureServer") + 13);
61
+ // url has layer id at end
62
+ }
63
+ else if ((url === null || url === void 0 ? void 0 : url.lastIndexOf("MapServer")) > -1) {
64
+ serviceUrl = url.slice(0, url.lastIndexOf("MapServer") + 9);
65
+ }
66
+ return serviceUrl;
67
+ }
68
+ function migrateTextAlign(align) {
69
+ switch (align) {
70
+ case "center":
71
+ return "center";
72
+ case "right":
73
+ return "end";
74
+ case "left":
75
+ default:
76
+ return "start";
77
+ }
78
+ }
79
+ /**
80
+ * Takes a where clause from a summary statistic card and transforms it into
81
+ * the new expression set array for usage in the new summary stat card.
82
+ *
83
+ * This is a brittle function to be used just for the migration of the <=1.6 of the summary stat card into
84
+ * the 1.7 version of the summary stat card.
85
+ * @param where A where clause as a string. Ex: "Category = 'abc' AND date <= TIMESTAMP '2023-01-01 00:00:00"
86
+ * @returns IExpression[] expression set of the where clause, broken down into individual expressions
87
+ */
88
+ function whereToExpressionSet(where) {
89
+ let expressionSet = [];
90
+ if (where) {
91
+ const whereClauses = where.split("AND"); // what happens if a user puts "AND" as the matching value?
92
+ expressionSet = whereClauses
93
+ .map((clause) => {
94
+ let expression;
95
+ // could be number or date
96
+ if (clause.includes(">=")) {
97
+ const { fieldName, value } = handleClauseSplit(clause, ">=");
98
+ let finalValue = value;
99
+ let fieldType;
100
+ // handle date
101
+ if (value.includes("TIMESTAMP")) {
102
+ finalValue = handleDateInClause(value);
103
+ fieldType = "esriFieldTypeDate";
104
+ }
105
+ expression = makeExpression(fieldName, fieldType, [finalValue]);
106
+ }
107
+ // could be number or date AND value is second in values array
108
+ else if (clause.includes("<=")) {
109
+ const { fieldName, value } = handleClauseSplit(clause, "<=");
110
+ let finalValue = value;
111
+ let fieldType;
112
+ // handle date
113
+ if (value.includes("TIMESTAMP")) {
114
+ finalValue = handleDateInClause(value);
115
+ fieldType = "esriFieldTypeDate";
116
+ }
117
+ expression = makeExpression(fieldName, fieldType, [
118
+ undefined,
119
+ finalValue,
120
+ ]);
121
+ }
122
+ // string match
123
+ else if (clause.includes("=") && clause !== "1=1") {
124
+ const { fieldName, value } = handleClauseSplit(clause, "=");
125
+ const cleanedValue = removeQuotesAroundValue(value);
126
+ expression = makeExpression(fieldName, "esriFieldTypeString", [
127
+ cleanedValue,
128
+ ]);
129
+ }
130
+ return expression;
131
+ })
132
+ .filter((ex) => !!ex);
133
+ }
134
+ return expressionSet;
135
+ }
136
+ /**
137
+ * Splits a clause by a given parameter.
138
+ * @param clause String to split into pieces
139
+ * @param splitBy How to split the string
140
+ * @returns The field name and value from the clause, split
141
+ */
142
+ function handleClauseSplit(clause, splitBy) {
143
+ const pieces = clause.split(splitBy);
144
+ const fieldName = pieces[0].trim();
145
+ const value = pieces[1].trim();
146
+ return { fieldName, value };
147
+ }
148
+ /**
149
+ * Takes a piece of a where clause with a date in it, and extracts just the YYYY-MM-DD.
150
+ * @param value - where clause piece with value
151
+ * @returns YYYY-MM-DD as string
152
+ */
153
+ function handleDateInClause(value) {
154
+ const dateAndTimePieces = value.split("'");
155
+ const dateAndTime = dateAndTimePieces[1].trim();
156
+ const date = dateAndTime.split(" ")[0].trim();
157
+ return date;
158
+ }
159
+ /**
160
+ * Makes an expression for the expression set.
161
+ * @param fieldName Name of IField
162
+ * @param fieldType Type of IField
163
+ * @param values Values in clause
164
+ * @returns IExpression to be used in an expression set.
165
+ */
166
+ function makeExpression(fieldName, fieldType, values) {
167
+ const field = {
168
+ name: fieldName,
169
+ };
170
+ if (fieldType) {
171
+ field.type = fieldType;
172
+ }
173
+ const expression = {
174
+ field,
175
+ values,
176
+ };
177
+ return expression;
178
+ }
179
+ /**
180
+ * Removes single quotes around a value. Used to remove the leading and trailing
181
+ * single quotes around a string value for a where clause.
182
+ * @param value string value with single quotes around it
183
+ * @returns string value without leading or trailing single quotes
184
+ */
185
+ function removeQuotesAroundValue(value) {
186
+ return value.replace(/^\'+|\'+$/g, "");
187
+ }
188
+ //# sourceMappingURL=_migrate-summary-stat-card-configs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_migrate-summary-stat-card-configs.js","sourceRoot":"","sources":["../../../../src/sites/_internal/_migrate-summary-stat-card-configs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,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GAAG,CAAC,CAAC;IAC3C,MAAM,WAAW,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAChD,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9C,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,SAAS,cAAc,CACrB,SAAiB,EACjB,SAAgC,EAChC,MAAqC;IAErC,MAAM,KAAK,GAAG;QACZ,IAAI,EAAE,SAAS;KACN,CAAC;IACZ,IAAI,SAAS,EAAE;QACb,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC;KACxB;IACD,MAAM,UAAU,GAAG;QACjB,KAAK;QACL,MAAM;KACP,CAAC;IACF,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;GAKG;AACH,SAAS,uBAAuB,CAAC,KAAa;IAC5C,OAAO,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AACzC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  export * from "./_internal/_ensure-telemetry";
2
2
  export * from "./_internal/_migrate-feed-config";
3
3
  export * from "./_internal/_migrate-event-list-card-configs";
4
+ export * from "./_internal/_migrate-summary-stat-card-configs";
4
5
  export * from "./domains";
5
6
  export * from "./drafts";
6
7
  export * from "./fetchSiteModel";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sites/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,8DAA8D;AAC9D,uEAAuE;AACvE,+CAA+C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sites/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,8DAA8D;AAC9D,uEAAuE;AACvE,+CAA+C"}
@@ -1,2 +1,2 @@
1
- export const SITE_SCHEMA_VERSION = 1.6;
1
+ export const SITE_SCHEMA_VERSION = 1.7;
2
2
  //# sourceMappingURL=site-schema-version.js.map
@@ -7,6 +7,7 @@ import { _purgeNonGuidsFromCatalog } from "./_internal/_purge-non-guids-from-cat
7
7
  import { _ensureTelemetry } from "./_internal/_ensure-telemetry";
8
8
  import { _migrateFeedConfig } from "./_internal/_migrate-feed-config";
9
9
  import { _migrateEventListCardConfigs } from "./_internal/_migrate-event-list-card-configs";
10
+ import { _migrateSummaryStatCardConfigs } from "./_internal/_migrate-summary-stat-card-configs";
10
11
  /**
11
12
  * Upgrades the schema upgrades
12
13
  * @param model IModel
@@ -24,6 +25,7 @@ export function upgradeSiteSchema(model) {
24
25
  model = _ensureTelemetry(model);
25
26
  model = _migrateFeedConfig(model);
26
27
  model = _migrateEventListCardConfigs(model);
28
+ model = _migrateSummaryStatCardConfigs(model);
27
29
  // WARNING - If you are writing a site schema migration,
28
30
  // you probably need to apply it to site drafts as well!
29
31
  // See https://github.com/Esri/hub.js/issues/498 for more details.
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade-site-schema.js","sourceRoot":"","sources":["../../../src/sites/upgrade-site-schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAE5F;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,IAAI,OAAO,CAAC,KAAK,EAAE,+BAA+B,CAAC,KAAK,mBAAmB,EAAE;QAC3E,OAAO,KAAK,CAAC;KACd;SAAM;QACL,sCAAsC;QACtC,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAChC,KAAK,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;QACxC,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;QAC9B,KAAK,GAAG,yBAAyB,CAAC,KAAK,CAAC,CAAC;QACzC,KAAK,GAAG,gBAAgB,CAAS,KAAK,CAAC,CAAC;QACxC,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAClC,KAAK,GAAG,4BAA4B,CAAC,KAAK,CAAC,CAAC;QAC5C,wDAAwD;QACxD,wDAAwD;QACxD,kEAAkE;QAClE,OAAO,KAAK,CAAC;KACd;AACH,CAAC"}
1
+ {"version":3,"file":"upgrade-site-schema.js","sourceRoot":"","sources":["../../../src/sites/upgrade-site-schema.ts"],"names":[],"mapp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options: {
21
21
  control: "hub-field-input-radio",
22
22
  labels: [
23
- "{{i18nScope}}.fields.membershipAccess.org.label",
24
- "{{i18nScope}}.fields.membershipAccess.collab.label",
25
- "{{i18nScope}}.fields.membershipAccess.any.label",
23
+ "{{{{i18nScope}}.fields.membershipAccess.org:translate}}",
24
+ "{{{{i18nScope}}.fields.membershipAccess.collab:translate}}",
25
+ "{{{{i18nScope}}.fields.membershipAccess.any:translate}}",
26
26
  ],
27
27
  },
28
28
  },
@@ -33,8 +33,8 @@ exports.uiSchema = {
33
33
  options: {
34
34
  control: "hub-field-input-radio",
35
35
  labels: [
36
- "{{i18nScope}}.fields.contributeContent.all.label",
37
- "{{i18nScope}}.fields.contributeContent.admins.label",
36
+ "{{{{i18nScope}}.fields.contributeContent.all:translate}}",
37
+ "{{{{i18nScope}}.fields.contributeContent.admins:translate}}",
38
38
  ],
39
39
  },
40
40
  },
@@ -1 +1 @@
1
- {"version":3,"file":"GroupUiSchemaSettings.js","sourceRoot":"","sources":["../../../../src/groups/_internal/GroupUiSchemaSettings.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACU,QAAA,QAAQ,GAAc;IACjC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,+CAA+C;YACzD,QAAQ,EAAE;gBACR;oBACE,QAAQ,EAAE,6CAA6C;oBACvD,KAAK,EAAE,8BAA8B;oBACrC,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,OAAO,EAAE,uBAAuB;wBAChC,MAAM,EAAE;4BACN,iDAAiD;4BACjD,oDAAoD;4BACpD,iDAAiD;yBAClD;qBACF;iBACF;gBACD;oBACE,QAAQ,EAAE,8CAA8C;oBACxD,KAAK,EAAE,wBAAwB;oBAC/B,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,OAAO,EAAE,uBAAuB;wBAChC,MAAM,EAAE;4BACN,kDAAkD;4BAClD,qDAAqD;yBACtD;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC"}
1
+ {"version":3,"file":"GroupUiSchemaSettings.js","sourceRoot":"","sources":["../../../../src/groups/_internal/GroupUiSchemaSettings.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACU,QAAA,QAAQ,GAAc;IACjC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,+CAA+C;YACzD,QAAQ,EAAE;gBACR;oBACE,QAAQ,EAAE,6CAA6C;oBACvD,KAAK,EAAE,8BAA8B;oBACrC,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,OAAO,EAAE,uBAAuB;wBAChC,MAAM,EAAE;4BACN,yDAAyD;4BACzD,4DAA4D;4BAC5D,yDAAyD;yBAC1D;qBACF;iBACF;gBACD;oBACE,QAAQ,EAAE,8CAA8C;oBACxD,KAAK,EAAE,wBAAwB;oBAC/B,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,OAAO,EAAE,uBAAuB;wBAChC,MAAM,EAAE;4BACN,0DAA0D;4BAC1D,6DAA6D;yBAC9D;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC"}
@@ -0,0 +1,192 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports._migrateSummaryStatCardConfigs = void 0;
4
+ const objects_1 = require("../../objects");
5
+ const util_1 = require("../../util");
6
+ /**
7
+ * Reconfigure summary stat card properties to align with the
8
+ * new web component card.
9
+ * @private
10
+ * @param {Object} model Site Model
11
+ * @returns {Object}
12
+ */
13
+ function _migrateSummaryStatCardConfigs(model) {
14
+ // attempt migration for 1.7 schema version
15
+ const migratedModel = _migrateSummaryStatSchemaVersion1_7(model);
16
+ return migratedModel;
17
+ }
18
+ exports._migrateSummaryStatCardConfigs = _migrateSummaryStatCardConfigs;
19
+ function _migrateSummaryStatSchemaVersion1_7(model) {
20
+ // do nothing if migration already applied
21
+ if (objects_1.getProp(model, "item.properties.schemaVersion") >= 1.7)
22
+ return model;
23
+ // apply migration
24
+ const clone = util_1.cloneObject(model);
25
+ clone.data.values.layout.sections.map((section) => (Object.assign(Object.assign({}, section), { rows: (section.rows || []).map((row) => (Object.assign(Object.assign({}, row), { cards: (row.cards || []).map((card) => {
26
+ var _a;
27
+ if (card.component.name === "summary-statistic-card") {
28
+ const values = card.component.settings;
29
+ const expressionSet = whereToExpressionSet(values.where);
30
+ card.component.settings = {
31
+ type: "dynamic",
32
+ cardTitle: values.title,
33
+ dynamicMetric: {
34
+ itemId: [values.itemId],
35
+ layerId: (_a = values.layerId) === null || _a === void 0 ? void 0 : _a.toString(),
36
+ field: values.statFieldName,
37
+ fieldType: values.statFieldType,
38
+ statistic: values.statType,
39
+ serviceUrl: getServiceUrl(values.url),
40
+ expressionSet,
41
+ allowExpressionSet: !!expressionSet.length,
42
+ },
43
+ serverTimeout: values.timeout,
44
+ textAlign: migrateTextAlign(values.statValueAlign),
45
+ valueColor: values.statValueColor === null
46
+ ? undefined
47
+ : values.statValueColor,
48
+ trailingText: values.trailingText,
49
+ cardId: values.cardId || util_1.createId(),
50
+ // did not exist on old stat card
51
+ allowUnitFormatting: false,
52
+ allowLink: false,
53
+ };
54
+ }
55
+ return card;
56
+ }) }))) })));
57
+ objects_1.setProp("item.properties.schemaVersion", 1.7, clone);
58
+ return clone;
59
+ }
60
+ function getServiceUrl(url) {
61
+ let serviceUrl = url;
62
+ // url has layer id at end
63
+ if ((url === null || url === void 0 ? void 0 : url.lastIndexOf("FeatureServer")) > -1) {
64
+ serviceUrl = url.slice(0, url.lastIndexOf("FeatureServer") + 13);
65
+ // url has layer id at end
66
+ }
67
+ else if ((url === null || url === void 0 ? void 0 : url.lastIndexOf("MapServer")) > -1) {
68
+ serviceUrl = url.slice(0, url.lastIndexOf("MapServer") + 9);
69
+ }
70
+ return serviceUrl;
71
+ }
72
+ function migrateTextAlign(align) {
73
+ switch (align) {
74
+ case "center":
75
+ return "center";
76
+ case "right":
77
+ return "end";
78
+ case "left":
79
+ default:
80
+ return "start";
81
+ }
82
+ }
83
+ /**
84
+ * Takes a where clause from a summary statistic card and transforms it into
85
+ * the new expression set array for usage in the new summary stat card.
86
+ *
87
+ * This is a brittle function to be used just for the migration of the <=1.6 of the summary stat card into
88
+ * the 1.7 version of the summary stat card.
89
+ * @param where A where clause as a string. Ex: "Category = 'abc' AND date <= TIMESTAMP '2023-01-01 00:00:00"
90
+ * @returns IExpression[] expression set of the where clause, broken down into individual expressions
91
+ */
92
+ function whereToExpressionSet(where) {
93
+ let expressionSet = [];
94
+ if (where) {
95
+ const whereClauses = where.split("AND"); // what happens if a user puts "AND" as the matching value?
96
+ expressionSet = whereClauses
97
+ .map((clause) => {
98
+ let expression;
99
+ // could be number or date
100
+ if (clause.includes(">=")) {
101
+ const { fieldName, value } = handleClauseSplit(clause, ">=");
102
+ let finalValue = value;
103
+ let fieldType;
104
+ // handle date
105
+ if (value.includes("TIMESTAMP")) {
106
+ finalValue = handleDateInClause(value);
107
+ fieldType = "esriFieldTypeDate";
108
+ }
109
+ expression = makeExpression(fieldName, fieldType, [finalValue]);
110
+ }
111
+ // could be number or date AND value is second in values array
112
+ else if (clause.includes("<=")) {
113
+ const { fieldName, value } = handleClauseSplit(clause, "<=");
114
+ let finalValue = value;
115
+ let fieldType;
116
+ // handle date
117
+ if (value.includes("TIMESTAMP")) {
118
+ finalValue = handleDateInClause(value);
119
+ fieldType = "esriFieldTypeDate";
120
+ }
121
+ expression = makeExpression(fieldName, fieldType, [
122
+ undefined,
123
+ finalValue,
124
+ ]);
125
+ }
126
+ // string match
127
+ else if (clause.includes("=") && clause !== "1=1") {
128
+ const { fieldName, value } = handleClauseSplit(clause, "=");
129
+ const cleanedValue = removeQuotesAroundValue(value);
130
+ expression = makeExpression(fieldName, "esriFieldTypeString", [
131
+ cleanedValue,
132
+ ]);
133
+ }
134
+ return expression;
135
+ })
136
+ .filter((ex) => !!ex);
137
+ }
138
+ return expressionSet;
139
+ }
140
+ /**
141
+ * Splits a clause by a given parameter.
142
+ * @param clause String to split into pieces
143
+ * @param splitBy How to split the string
144
+ * @returns The field name and value from the clause, split
145
+ */
146
+ function handleClauseSplit(clause, splitBy) {
147
+ const pieces = clause.split(splitBy);
148
+ const fieldName = pieces[0].trim();
149
+ const value = pieces[1].trim();
150
+ return { fieldName, value };
151
+ }
152
+ /**
153
+ * Takes a piece of a where clause with a date in it, and extracts just the YYYY-MM-DD.
154
+ * @param value - where clause piece with value
155
+ * @returns YYYY-MM-DD as string
156
+ */
157
+ function handleDateInClause(value) {
158
+ const dateAndTimePieces = value.split("'");
159
+ const dateAndTime = dateAndTimePieces[1].trim();
160
+ const date = dateAndTime.split(" ")[0].trim();
161
+ return date;
162
+ }
163
+ /**
164
+ * Makes an expression for the expression set.
165
+ * @param fieldName Name of IField
166
+ * @param fieldType Type of IField
167
+ * @param values Values in clause
168
+ * @returns IExpression to be used in an expression set.
169
+ */
170
+ function makeExpression(fieldName, fieldType, values) {
171
+ const field = {
172
+ name: fieldName,
173
+ };
174
+ if (fieldType) {
175
+ field.type = fieldType;
176
+ }
177
+ const expression = {
178
+ field,
179
+ values,
180
+ };
181
+ return expression;
182
+ }
183
+ /**
184
+ * Removes single quotes around a value. Used to remove the leading and trailing
185
+ * single quotes around a string value for a where clause.
186
+ * @param value string value with single quotes around it
187
+ * @returns string value without leading or trailing single quotes
188
+ */
189
+ function removeQuotesAroundValue(value) {
190
+ return value.replace(/^\'+|\'+$/g, "");
191
+ }
192
+ //# sourceMappingURL=_migrate-summary-stat-card-configs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_migrate-summary-stat-card-configs.js","sourceRoot":"","sources":["../../../../src/sites/_internal/_migrate-summary-stat-card-configs.ts"],"names":[],"mappings":";;;AAAA,2CAAiD;AAEjD,qCAAmD;AAKnD;;;;;;GAMG;AACH,SAAgB,8BAA8B,CAC5C,KAAQ;IAER,2CAA2C;IAC3C,MAAM,aAAa,GAAG,mCAAmC,CAA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IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9C,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,SAAS,cAAc,CACrB,SAAiB,EACjB,SAAgC,EAChC,MAAqC;IAErC,MAAM,KAAK,GAAG;QACZ,IAAI,EAAE,SAAS;KACN,CAAC;IACZ,IAAI,SAAS,EAAE;QACb,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC;KACxB;IACD,MAAM,UAAU,GAAG;QACjB,KAAK;QACL,MAAM;KACP,CAAC;IACF,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;GAKG;AACH,SAAS,uBAAuB,CAAC,KAAa;IAC5C,OAAO,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AACzC,CAAC"}
@@ -4,6 +4,7 @@ const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./_internal/_ensure-telemetry"), exports);
5
5
  tslib_1.__exportStar(require("./_internal/_migrate-feed-config"), exports);
6
6
  tslib_1.__exportStar(require("./_internal/_migrate-event-list-card-configs"), exports);
7
+ tslib_1.__exportStar(require("./_internal/_migrate-summary-stat-card-configs"), exports);
7
8
  tslib_1.__exportStar(require("./domains"), exports);
8
9
  tslib_1.__exportStar(require("./drafts"), exports);
9
10
  tslib_1.__exportStar(require("./fetchSiteModel"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sites/index.ts"],"names":[],"mappings":";;;AAAA,wEAA8C;AAC9C,2EAAiD;AACjD,uFAA6D;AAC7D,oDAA0B;AAC1B,mDAAyB;AACzB,2DAAiC;AACjC,2DAAiC;AACjC,oDAA0B;AAC1B,qDAA2B;AAC3B,gEAAsC;AACtC,mDAAyB;AACzB,gEAAsC;AACtC,8DAA8D;AAC9D,uEAAuE;AACvE,+CAA+C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sites/index.ts"],"names":[],"mappings":";;;AAAA,wEAA8C;AAC9C,2EAAiD;AACjD,uFAA6D;AAC7D,yFAA+D;AAC/D,oDAA0B;AAC1B,mDAAyB;AACzB,2DAAiC;AACjC,2DAAiC;AACjC,oDAA0B;AAC1B,qDAA2B;AAC3B,gEAAsC;AACtC,mDAAyB;AACzB,gEAAsC;AACtC,8DAA8D;AAC9D,uEAAuE;AACvE,+CAA+C"}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SITE_SCHEMA_VERSION = void 0;
4
- exports.SITE_SCHEMA_VERSION = 1.6;
4
+ exports.SITE_SCHEMA_VERSION = 1.7;
5
5
  //# sourceMappingURL=site-schema-version.js.map
@@ -10,6 +10,7 @@ const _purge_non_guids_from_catalog_1 = require("./_internal/_purge-non-guids-fr
10
10
  const _ensure_telemetry_1 = require("./_internal/_ensure-telemetry");
11
11
  const _migrate_feed_config_1 = require("./_internal/_migrate-feed-config");
12
12
  const _migrate_event_list_card_configs_1 = require("./_internal/_migrate-event-list-card-configs");
13
+ const _migrate_summary_stat_card_configs_1 = require("./_internal/_migrate-summary-stat-card-configs");
13
14
  /**
14
15
  * Upgrades the schema upgrades
15
16
  * @param model IModel
@@ -27,6 +28,7 @@ function upgradeSiteSchema(model) {
27
28
  model = _ensure_telemetry_1._ensureTelemetry(model);
28
29
  model = _migrate_feed_config_1._migrateFeedConfig(model);
29
30
  model = _migrate_event_list_card_configs_1._migrateEventListCardConfigs(model);
31
+ model = _migrate_summary_stat_card_configs_1._migrateSummaryStatCardConfigs(model);
30
32
  // WARNING - If you are writing a site schema migration,
31
33
  // you probably need to apply it to site drafts as well!
32
34
  // See https://github.com/Esri/hub.js/issues/498 for more details.
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade-site-schema.js","sourceRoot":"","sources":["../../../src/sites/upgrade-site-schema.ts"],"names":[],"mappings":";;;AACA,wCAAqC;AACrC,+DAA4D;AAC5D,uEAAkE;AAClE,uFAAkF;AAClF,iEAA6D;AAC7D,6FAAsF;AACtF,qEAAiE;AACjE,2EAAsE;AACtE,mGAA4F;AAE5F;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,KAAa;IAC7C,IAAI,iBAAO,CAAC,KAAK,EAAE,+BAA+B,CAAC,KAAK,yCAAmB,EAAE;QAC3E,OAAO,KAAK,CAAC;KACd;SAAM;QACL,sCAAsC;QACtC,KAAK,GAAG,qCAAgB,CAAC,KAAK,CAAC,CAAC;QAChC,KAAK,GAAG,qDAAwB,CAAC,KAAK,CAAC,CAAC;QACxC,KAAK,GAAG,gCAAc,CAAC,KAAK,CAAC,CAAC;QAC9B,KAAK,GAAG,yDAAyB,CAAC,KAAK,CAAC,CAAC;QACzC,KAAK,GAAG,oCAAgB,CAAS,KAAK,CAAC,CAAC;QACxC,KAAK,GAAG,yCAAkB,CAAC,KAAK,CAAC,CAAC;QAClC,KAAK,GAAG,+DAA4B,CAAC,KAAK,CAAC,CAAC;QAC5C,wDAAwD;QACxD,wDAAwD;QACxD,kEAAkE;QAClE,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAjBD,8CAiBC"}
1
+ {"version":3,"file":"upgrade-site-schema.js","sourceRoot":"","sources":["../../../src/sites/upgrade-site-schema.ts"],"names":[],"mappings":";;;AACA,wCAAqC;AACrC,+DAA4D;AAC5D,uEAAkE;AAClE,uFAAkF;AAClF,iEAA6D;AAC7D,6FAAsF;AACtF,qEAAiE;AACjE,2EAAsE;AACtE,mGAA4F;AAC5F,uGAAgG;AAEhG;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,KAAa;IAC7C,IAAI,iBAAO,CAAC,KAAK,EAAE,+BAA+B,CAAC,KAAK,yCAAmB,EAAE;QAC3E,OAAO,KAAK,CAAC;KACd;SAAM;QACL,sCAAsC;QACtC,KAAK,GAAG,qCAAgB,CAAC,KAAK,CAAC,CAAC;QAChC,KAAK,GAAG,qDAAwB,CAAC,KAAK,CAAC,CAAC;QACxC,KAAK,GAAG,gCAAc,CAAC,KAAK,CAAC,CAAC;QAC9B,KAAK,GAAG,yDAAyB,CAAC,KAAK,CAAC,CAAC;QACzC,KAAK,GAAG,oCAAgB,CAAS,KAAK,CAAC,CAAC;QACxC,KAAK,GAAG,yCAAkB,CAAC,KAAK,CAAC,CAAC;QAClC,KAAK,GAAG,+DAA4B,CAAC,KAAK,CAAC,CAAC;QAC5C,KAAK,GAAG,mEAA8B,CAAC,KAAK,CAAC,CAAC;QAC9C,wDAAwD;QACxD,wDAAwD;QACxD,kEAAkE;QAClE,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAlBD,8CAkBC"}
@@ -1,5 +1,6 @@
1
1
  /// <reference types="arcgis-js-api" />
2
2
  import { IQuery } from "../../search/types/IHubCatalog";
3
+ import { IField } from "@esri/arcgis-rest-types";
3
4
  import { ServiceAggregation } from "./DynamicValues";
4
5
  import { IReference } from "./IReference";
5
6
  /**
@@ -164,3 +165,21 @@ export interface IResolvedMetric {
164
165
  features: IMetricFeature[];
165
166
  generatedAt: number;
166
167
  }
168
+ /**
169
+ * Expression by which a metric can be filtered before aggregation, i.e. a clause of a where statement
170
+ */
171
+ export interface IExpression {
172
+ /**
173
+ * Field that the expression filters on
174
+ */
175
+ field?: IField;
176
+ /**
177
+ * The values that the where clause will be using on the right-hand side of the statement: this can be an array of strings, numbers, or dates.
178
+ * These values will be used in conjunction with the field to construct a where clause.
179
+ */
180
+ values?: Array<string | number | Date>;
181
+ /**
182
+ * A special identifier given to the expression when it is created
183
+ */
184
+ key?: string;
185
+ }
@@ -0,0 +1,9 @@
1
+ import { IModel, IDraft } from "../../types";
2
+ /**
3
+ * Reconfigure summary stat card properties to align with the
4
+ * new web component card.
5
+ * @private
6
+ * @param {Object} model Site Model
7
+ * @returns {Object}
8
+ */
9
+ export declare function _migrateSummaryStatCardConfigs<T extends IModel | IDraft>(model: T): T;
@@ -1,6 +1,7 @@
1
1
  export * from "./_internal/_ensure-telemetry";
2
2
  export * from "./_internal/_migrate-feed-config";
3
3
  export * from "./_internal/_migrate-event-list-card-configs";
4
+ export * from "./_internal/_migrate-summary-stat-card-configs";
4
5
  export * from "./domains";
5
6
  export * from "./drafts";
6
7
  export * from "./fetchSiteModel";
@@ -1 +1 @@
1
- export declare const SITE_SCHEMA_VERSION = 1.6;
1
+ export declare const SITE_SCHEMA_VERSION = 1.7;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/hub-common",
3
- "version": "13.45.0",
3
+ "version": "13.46.1",
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",