@esri/hub-common 17.1.1 → 17.2.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/internal/getThumbnailUiSchemaElement.js +9 -28
- package/dist/esm/core/schemas/internal/getThumbnailUiSchemaElement.js.map +1 -1
- package/dist/node/core/schemas/internal/getThumbnailUiSchemaElement.js +9 -28
- package/dist/node/core/schemas/internal/getThumbnailUiSchemaElement.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getCdnAssetUrl } from "../../../urls";
|
|
2
|
-
import { UiSchemaRuleEffects } from "../types";
|
|
3
2
|
const DEFAULT_ENTITY_THUMBNAILS = {
|
|
4
3
|
discussion: "/ember-arcgis-opendata-components/assets/images/placeholders/discussion.png",
|
|
5
4
|
group: "/ember-arcgis-opendata-components/assets/images/placeholders/group.png",
|
|
@@ -44,6 +43,11 @@ export function getThumbnailUiSchemaElement(i18nScope, thumbnail, thumbnailUrl,
|
|
|
44
43
|
},
|
|
45
44
|
};
|
|
46
45
|
}
|
|
46
|
+
// We want the notice to appear in the image picker rather than below it
|
|
47
|
+
// this is a design requirement for proper element indexing
|
|
48
|
+
const notice = !thumbnail || thumbnail === "thumbnail/ago_downloaded.png"
|
|
49
|
+
? "20250425-image-picker-notice"
|
|
50
|
+
: null;
|
|
47
51
|
return [
|
|
48
52
|
{
|
|
49
53
|
labelKey: entityType === "group"
|
|
@@ -54,33 +58,10 @@ export function getThumbnailUiSchemaElement(i18nScope, thumbnail, thumbnailUrl,
|
|
|
54
58
|
options: Object.assign({ control: "hub-field-input-image-picker", imgSrc: thumbnailUrl, defaultImgUrl, maxWidth: 727, maxHeight: 484, helperText: {
|
|
55
59
|
// helper text varies between entity types
|
|
56
60
|
labelKey: `${i18nScope}.fields._thumbnail.helperText`,
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
type: "Notice",
|
|
62
|
-
options: {
|
|
63
|
-
notice: {
|
|
64
|
-
configuration: {
|
|
65
|
-
id: "no-thumbnail-or-png-notice",
|
|
66
|
-
noticeType: "notice",
|
|
67
|
-
closable: false,
|
|
68
|
-
icon: "lightbulb",
|
|
69
|
-
kind: "info",
|
|
70
|
-
scale: "m",
|
|
71
|
-
},
|
|
72
|
-
message: "{{shared.fields._thumbnail.defaultThumbnailNotice:translate}}",
|
|
73
|
-
autoShow: true,
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
rules: [
|
|
77
|
-
{
|
|
78
|
-
effect: UiSchemaRuleEffects.SHOW,
|
|
79
|
-
conditions: [
|
|
80
|
-
!thumbnail || thumbnail === "thumbnail/ago_downloaded.png",
|
|
81
|
-
],
|
|
82
|
-
},
|
|
83
|
-
],
|
|
61
|
+
},
|
|
62
|
+
// Advise the user if the entity's thumbnail is either of the default values,
|
|
63
|
+
// and this notice will appear above the image picker but below the helper text
|
|
64
|
+
notice }, options),
|
|
84
65
|
},
|
|
85
66
|
];
|
|
86
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getThumbnailUiSchemaElement.js","sourceRoot":"","sources":["../../../../../src/core/schemas/internal/getThumbnailUiSchemaElement.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"getThumbnailUiSchemaElement.js","sourceRoot":"","sources":["../../../../../src/core/schemas/internal/getThumbnailUiSchemaElement.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAI/C,MAAM,yBAAyB,GAA2C;IACxE,UAAU,EACR,6EAA6E;IAC/E,KAAK,EACH,wEAAwE;IAC1E,KAAK,EACH,wEAAwE;IAC1E,OAAO,EACL,0EAA0E;CAC7E,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,2BAA2B,CACzC,SAAiB,EACjB,SAAiB,EACjB,YAAoB,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OAAO,CACX;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getThumbnailUiSchemaElement = void 0;
|
|
4
4
|
const urls_1 = require("../../../urls");
|
|
5
|
-
const types_1 = require("../types");
|
|
6
5
|
const DEFAULT_ENTITY_THUMBNAILS = {
|
|
7
6
|
discussion: "/ember-arcgis-opendata-components/assets/images/placeholders/discussion.png",
|
|
8
7
|
group: "/ember-arcgis-opendata-components/assets/images/placeholders/group.png",
|
|
@@ -47,6 +46,11 @@ function getThumbnailUiSchemaElement(i18nScope, thumbnail, thumbnailUrl, entityT
|
|
|
47
46
|
},
|
|
48
47
|
};
|
|
49
48
|
}
|
|
49
|
+
// We want the notice to appear in the image picker rather than below it
|
|
50
|
+
// this is a design requirement for proper element indexing
|
|
51
|
+
const notice = !thumbnail || thumbnail === "thumbnail/ago_downloaded.png"
|
|
52
|
+
? "20250425-image-picker-notice"
|
|
53
|
+
: null;
|
|
50
54
|
return [
|
|
51
55
|
{
|
|
52
56
|
labelKey: entityType === "group"
|
|
@@ -57,33 +61,10 @@ function getThumbnailUiSchemaElement(i18nScope, thumbnail, thumbnailUrl, entityT
|
|
|
57
61
|
options: Object.assign({ control: "hub-field-input-image-picker", imgSrc: thumbnailUrl, defaultImgUrl, maxWidth: 727, maxHeight: 484, helperText: {
|
|
58
62
|
// helper text varies between entity types
|
|
59
63
|
labelKey: `${i18nScope}.fields._thumbnail.helperText`,
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
type: "Notice",
|
|
65
|
-
options: {
|
|
66
|
-
notice: {
|
|
67
|
-
configuration: {
|
|
68
|
-
id: "no-thumbnail-or-png-notice",
|
|
69
|
-
noticeType: "notice",
|
|
70
|
-
closable: false,
|
|
71
|
-
icon: "lightbulb",
|
|
72
|
-
kind: "info",
|
|
73
|
-
scale: "m",
|
|
74
|
-
},
|
|
75
|
-
message: "{{shared.fields._thumbnail.defaultThumbnailNotice:translate}}",
|
|
76
|
-
autoShow: true,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
rules: [
|
|
80
|
-
{
|
|
81
|
-
effect: types_1.UiSchemaRuleEffects.SHOW,
|
|
82
|
-
conditions: [
|
|
83
|
-
!thumbnail || thumbnail === "thumbnail/ago_downloaded.png",
|
|
84
|
-
],
|
|
85
|
-
},
|
|
86
|
-
],
|
|
64
|
+
},
|
|
65
|
+
// Advise the user if the entity's thumbnail is either of the default values,
|
|
66
|
+
// and this notice will appear above the image picker but below the helper text
|
|
67
|
+
notice }, options),
|
|
87
68
|
},
|
|
88
69
|
];
|
|
89
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getThumbnailUiSchemaElement.js","sourceRoot":"","sources":["../../../../../src/core/schemas/internal/getThumbnailUiSchemaElement.ts"],"names":[],"mappings":";;;AACA,wCAA+C;
|
|
1
|
+
{"version":3,"file":"getThumbnailUiSchemaElement.js","sourceRoot":"","sources":["../../../../../src/core/schemas/internal/getThumbnailUiSchemaElement.ts"],"names":[],"mappings":";;;AACA,wCAA+C;AAI/C,MAAM,yBAAyB,GAA2C;IACxE,UAAU,EACR,6EAA6E;IAC/E,KAAK,EACH,wEAAwE;IAC1E,KAAK,EACH,wEAAwE;IAC1E,OAAO,EACL,0EAA0E;CAC7E,CAAC;AAEF;;;;;;;GAOG;AACH,SAAgB,2BAA2B,CACzC,SAAiB,EACjB,SAAiB,EACjB,YAAoB,EACpB,UAAyB,EACzB,cAA+B;;IAE/B,MAAM,sBAAsB,SAC1B,yBAAyB,CAAC,UAAU,CAAC,mCAAI,yBAAyB,CAAC,OAAO,CAAC;IAC7E,MAAM,aAAa,GAAG,qBAAc,CAAC,sBAAsB,EAAE,cAAc,CAAC,CAAC;IAE7E,IAAI,OAAO,CAAC;IACZ,IAAI,UAAU,KAAK,OAAO,EAAE;QAC1B,OAAO,GAAG;YACR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