@esri/solutions-components 0.8.24 → 0.8.25
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/cjs/calcite-flow_6.cjs.entry.js +29 -15
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +4 -4
- package/dist/cjs/feature-list.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/create-feature/create-feature.js +9 -2
- package/dist/collection/components/create-related-feature/create-related-feature.js +9 -2
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +4 -4
- package/dist/collection/components/feature-details/feature-details.css +4 -4
- package/dist/collection/components/feature-details/feature-details.js +12 -11
- package/dist/collection/components/feature-list/feature-list.css +2 -0
- package/dist/components/create-feature2.js +9 -2
- package/dist/components/create-related-feature2.js +9 -2
- package/dist/components/crowdsource-reporter.js +4 -4
- package/dist/components/feature-details2.js +12 -11
- package/dist/components/feature-list2.js +1 -1
- package/dist/esm/calcite-flow_6.entry.js +29 -15
- package/dist/esm/crowdsource-reporter.entry.js +4 -4
- package/dist/esm/feature-list.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/{p-e78be59a.entry.js → p-5b817c98.entry.js} +1 -1
- package/dist/solutions-components/{p-1251dcc6.entry.js → p-686fa7ce.entry.js} +1 -1
- package/dist/solutions-components/p-c2ec0dcc.entry.js +17 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/types/components/create-feature/create-feature.d.ts +4 -0
- package/dist/types/components/create-related-feature/create-related-feature.d.ts +4 -0
- package/dist/types/components/feature-details/feature-details.d.ts +4 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-cbf0dada.entry.js +0 -17
@@ -23,6 +23,10 @@ import { loadModules } from "../../utils/loadModules";
|
|
23
23
|
import { getAllLayers, getLayerOrTable } from "../../utils/mapViewUtils";
|
24
24
|
export class CreateFeature {
|
25
25
|
constructor() {
|
26
|
+
/**
|
27
|
+
* boolean: Flag to maintain form submission using submit button
|
28
|
+
*/
|
29
|
+
this._isSubmitBtnClicked = false;
|
26
30
|
this.mapView = undefined;
|
27
31
|
this.selectedLayerId = undefined;
|
28
32
|
this.customizeSubmit = false;
|
@@ -62,6 +66,7 @@ export class CreateFeature {
|
|
62
66
|
*/
|
63
67
|
async submit() {
|
64
68
|
if (this._editor) {
|
69
|
+
this._isSubmitBtnClicked = true;
|
65
70
|
this._editor.viewModel.featureFormViewModel.submit();
|
66
71
|
}
|
67
72
|
}
|
@@ -88,7 +93,7 @@ export class CreateFeature {
|
|
88
93
|
*/
|
89
94
|
render() {
|
90
95
|
const showSearchWidget = this.showSearchWidget ? '' : 'display-none';
|
91
|
-
return (h(Fragment, { key: '
|
96
|
+
return (h(Fragment, { key: 'd11a16053bc5eb86a09fd3bc35c9a89cee6dd064' }, h("div", { key: '0320bb0ca9fc069306151078c66fbee11060fcab', id: "feature-form" }), h("div", { key: '8aaa13e87213a880382ca408d324beb79ba7a500', class: `search-widget ${showSearchWidget}`, id: "search-widget-ref" })));
|
92
97
|
}
|
93
98
|
//--------------------------------------------------------------------------
|
94
99
|
//
|
@@ -334,11 +339,13 @@ export class CreateFeature {
|
|
334
339
|
var _a;
|
335
340
|
//return if any attribute is invalid , focus will be shifted to the invalid attribute in feature form
|
336
341
|
if (evt.invalid.length) {
|
342
|
+
this._isSubmitBtnClicked = false;
|
337
343
|
return;
|
338
344
|
}
|
339
345
|
//Submit only when valid attributes
|
340
346
|
//emit success or fail based on the result
|
341
|
-
if (evt.valid.length) {
|
347
|
+
if (evt.valid.length && this._isSubmitBtnClicked) {
|
348
|
+
this._isSubmitBtnClicked = false;
|
342
349
|
try {
|
343
350
|
await this._editor.activeWorkflow.commit();
|
344
351
|
//throw errors if any failures
|
@@ -22,6 +22,10 @@ import { Host, h } from "@stencil/core";
|
|
22
22
|
import { loadModules } from "../../utils/loadModules";
|
23
23
|
export class CreateRelatedFeature {
|
24
24
|
constructor() {
|
25
|
+
/**
|
26
|
+
* boolean: Flag to maintain form submission using submit button
|
27
|
+
*/
|
28
|
+
this._isSubmitBtnClicked = false;
|
25
29
|
this.mapView = undefined;
|
26
30
|
this.table = undefined;
|
27
31
|
this.selectedFeature = undefined;
|
@@ -58,6 +62,7 @@ export class CreateRelatedFeature {
|
|
58
62
|
*/
|
59
63
|
async submit() {
|
60
64
|
if (this._editor) {
|
65
|
+
this._isSubmitBtnClicked = true;
|
61
66
|
this._editor.viewModel.featureFormViewModel.submit();
|
62
67
|
}
|
63
68
|
}
|
@@ -95,7 +100,7 @@ export class CreateRelatedFeature {
|
|
95
100
|
this.reactiveUtils = reactiveUtils;
|
96
101
|
}
|
97
102
|
render() {
|
98
|
-
return (h(Host, { key: '
|
103
|
+
return (h(Host, { key: '8c32e05707b6e5501759caaef5d89f8da40640e4' }));
|
99
104
|
}
|
100
105
|
/**
|
101
106
|
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
|
@@ -225,11 +230,13 @@ export class CreateRelatedFeature {
|
|
225
230
|
var _a;
|
226
231
|
//return if any attribute is invalid , focus will be shifted to the invalid attribute in feature form
|
227
232
|
if (evt.invalid.length) {
|
233
|
+
this._isSubmitBtnClicked = false;
|
228
234
|
return;
|
229
235
|
}
|
230
236
|
//Submit only when valid attributes
|
231
237
|
//emit success or fail based on the result
|
232
|
-
if (evt.valid.length) {
|
238
|
+
if (evt.valid.length && this._isSubmitBtnClicked) {
|
239
|
+
this._isSubmitBtnClicked = false;
|
233
240
|
try {
|
234
241
|
await this._editor.activeWorkflow.commit();
|
235
242
|
//throw errors if any failures
|
@@ -118,7 +118,7 @@ export class CrowdsourceReporter {
|
|
118
118
|
*/
|
119
119
|
render() {
|
120
120
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
121
|
-
return (h(Host, { key: '
|
121
|
+
return (h(Host, { key: '497227745f29c2afc434349e86da19b088b1eb78' }, this._reportSubmitted && h("calcite-alert", { key: 'd22cceb7124073ad390cd53d97214a2983e97ea0', "auto-close": true, class: themeClass + " report-submitted-msg", icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { key: '1f98f71fa79cf64e65fecfbceec3862714702609', slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { key: '381d3b5a3f5115782634833ad53b4494e888ea97', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { key: '34371959d1272e4bc465e5f5a432d450a156c20b', slot: "title" }, this._translations.error), h("div", { key: '09a55e3325edde43f660a2db1621a4ffd373e09f', slot: "message" }, this._featureCreationFailedErrorMsg)), this._commentSubmitted && h("calcite-alert", { key: '33d79a67575c9a2b14e602e60b702ca82025e20f', "auto-close": true, class: 'report-submitted ' + themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._commentSubmitted = false; }, open: true, placement: "top" }, h("div", { key: '91b9dcc26cf1f66a116a287a94e8df5c3d2f37bf', slot: "message" }, this._translations.commentSubmittedMsg)), this._addingCommentFailed && h("calcite-alert", { key: '758f1d465d4301fade8fd93a682bfe4b359be2ca', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._addingCommentFailed = false; }, open: true, placement: "top" }, h("div", { key: '982424caf90e309701c62c75065d7e7e15d327b4', slot: "title" }, this._translations.error), h("div", { key: '1c93f9f8e1b958ccf8553560c36a32273f16a3a6', slot: "message" }, this._translations.addingCommentFailedMsg)), h("div", { key: '612254cf38da92cf88b90ace8136a2e0859afcae' }, h("calcite-shell", { key: 'bb56100b4dfc355b93d580deee929aad7cfb3f7f', "content-behind": true }, this._getReporter())), this.filterModal()));
|
122
122
|
}
|
123
123
|
//--------------------------------------------------------------------------
|
124
124
|
//
|
@@ -788,8 +788,9 @@ export class CrowdsourceReporter {
|
|
788
788
|
*/
|
789
789
|
reduceToConfiguredLayers(hash) {
|
790
790
|
return Object.keys(hash).reduce((prev, cur) => {
|
791
|
+
var _a;
|
791
792
|
// check if reporting options exists consider the visible prop if else just check the supports Add
|
792
|
-
const showLayer = this.reportingOptions ? this._getLayersConfig(cur).visible
|
793
|
+
const showLayer = this.reportingOptions ? (_a = this._getLayersConfig(cur)) === null || _a === void 0 ? void 0 : _a.visible
|
793
794
|
: hash[cur].supportsAdd;
|
794
795
|
if (showLayer) {
|
795
796
|
prev.push(cur);
|
@@ -871,7 +872,7 @@ export class CrowdsourceReporter {
|
|
871
872
|
const featureSet = await queryFeaturesByID([Number(this.objectId)], layer, [], true, this.mapView.spatialReference);
|
872
873
|
if (featureSet.length) {
|
873
874
|
//update the selectedFeature
|
874
|
-
this.
|
875
|
+
await this.setSelectedFeatures(featureSet);
|
875
876
|
//if featureDetails not open then add it to the list else just reInit flowItems which will update details with newly selected features
|
876
877
|
// eslint-disable-next-line unicorn/prefer-ternary
|
877
878
|
if (this._flowItems.length && this._flowItems[this._flowItems.length - 1] !== "feature-details") {
|
@@ -880,7 +881,6 @@ export class CrowdsourceReporter {
|
|
880
881
|
else {
|
881
882
|
this._flowItems = [...this._flowItems];
|
882
883
|
}
|
883
|
-
await this.highlightOnMap(featureSet[0]);
|
884
884
|
}
|
885
885
|
}
|
886
886
|
}
|
@@ -5,7 +5,7 @@
|
|
5
5
|
.buttons-container{
|
6
6
|
align-items: center;
|
7
7
|
display: flex;
|
8
|
-
padding:
|
8
|
+
padding: 4px;
|
9
9
|
color: var(--calcite-color-text-1) !important;
|
10
10
|
background-color: var(--calcite-color-foreground-1) !important;
|
11
11
|
border-block-start: 1px solid var(--calcite-color-border-3);
|
@@ -14,8 +14,8 @@
|
|
14
14
|
|
15
15
|
.comment-btn{
|
16
16
|
display: flex;
|
17
|
-
gap:
|
18
|
-
font-size: var(--calcite-font-size--
|
17
|
+
gap: 10px;
|
18
|
+
font-size: var(--calcite-font-size--1);
|
19
19
|
align-items: center;
|
20
|
-
padding:
|
20
|
+
padding: 7px 0.75rem;
|
21
21
|
}
|
@@ -39,6 +39,7 @@ export class FeatureDetails {
|
|
39
39
|
this._isLikeBtnClicked = false;
|
40
40
|
this._isDislikeBtnClicked = false;
|
41
41
|
this._relatedFeaturesOIDs = undefined;
|
42
|
+
this._updating = false;
|
42
43
|
}
|
43
44
|
//--------------------------------------------------------------------------
|
44
45
|
//
|
@@ -110,12 +111,12 @@ export class FeatureDetails {
|
|
110
111
|
var _a, _b, _c, _d, _e;
|
111
112
|
//When related features found show comments list of only those features else comments list will be empty
|
112
113
|
const commentsListWhereClause = ((_a = this._relatedFeaturesOIDs) === null || _a === void 0 ? void 0 : _a.length) > 0 ? `objectId in(${this._relatedFeaturesOIDs})` : '1=0';
|
113
|
-
return (h("calcite-panel", { key: '
|
114
|
-
h("div", { key: '
|
115
|
-
h("div", { key: '
|
116
|
-
h("calcite-button", { key: '
|
117
|
-
h("calcite-button", { key: '
|
118
|
-
h("feature-list", { key: '
|
114
|
+
return (h("calcite-panel", { key: '8d7069fec0df2a6217c175df6171376b4412c548', "full-height": true }, h("info-card", { key: '3713b783371bcb36a9b844196033326941d833f5', allowEditing: false, graphics: this.graphics, highlightEnabled: false, isLoading: false, isMobile: false, mapView: this.mapView, onSelectionChanged: (e) => { this.featureSelectionChange.emit(e.detail); }, paginationEnabled: false, position: "relative", ref: el => this._infoCard = el }), (this._likeFieldAvailable || this._dislikeFieldAvailable || this._commentsAvailable) &&
|
115
|
+
h("div", { key: '8c84e82708fab0d6091050672b26e6fa2de59345', class: "buttons-container" }, this._commentsAvailable &&
|
116
|
+
h("div", { key: '22edb3f17ef6a2bdef67e5e94492966986d452b7', class: "comment-btn" }, h("span", { key: '03b7eb0aff4358aac3020b3d6d52a2d47b308a41' }, this._relatedFeaturesOIDs.length), h("calcite-icon", { key: '5225e156b45a15db0055a28ed21bc3511dedc706', icon: "speech-bubble", scale: 's' })), this._likeFieldAvailable &&
|
117
|
+
h("calcite-button", { key: '1a291524d46c6f826813c87f781e7d6bcf5bc097', appearance: "transparent", iconEnd: "thumbs-up", kind: this._isLikeBtnClicked ? "brand" : "neutral", loading: this._updating, onClick: this.onLikeButtonClick.bind(this), scale: 'm' }, (_c = (_b = this._likeCount) !== null && _b !== void 0 ? _b : this._selectedGraphic.attributes[this._likeField]) !== null && _c !== void 0 ? _c : 0), this._dislikeFieldAvailable &&
|
118
|
+
h("calcite-button", { key: 'da6bee2189565c1eb70564b340e742494bac35c9', appearance: "transparent", iconEnd: "thumbs-down", kind: this._isDislikeBtnClicked ? "brand" : "neutral", loading: this._updating, onClick: this.onDislikeButtonClick.bind(this), scale: 'm' }, (_e = (_d = this._disLikeCount) !== null && _d !== void 0 ? _d : this._selectedGraphic.attributes[this._dislikeField]) !== null && _e !== void 0 ? _e : 0)), this.relatedTableId && this._commentsAvailable &&
|
119
|
+
h("feature-list", { key: 'fd6faa9f3404a2dfadb102ca7c578ffb47207729', class: "height-full", mapView: this.mapView, onFeatureSelect: (e) => { this.commentSelect.emit(e.detail); }, pageSize: 5, ref: el => this._commentsList = el, selectedLayerId: this.relatedTableId, showErrorWhenNoFeatures: false, showInitialLoading: false, textSize: "small", whereClause: commentsListWhereClause })));
|
119
120
|
}
|
120
121
|
/**
|
121
122
|
* Load esri javascript api modules
|
@@ -272,7 +273,6 @@ export class FeatureDetails {
|
|
272
273
|
* @protected
|
273
274
|
*/
|
274
275
|
onLikeButtonClick() {
|
275
|
-
this.loadingStatus.emit(true);
|
276
276
|
if (this._isDislikeBtnClicked && this.reportingOptions[this._selectedGraphic.layer.id].dislike) {
|
277
277
|
this.onDislikeButtonClick();
|
278
278
|
}
|
@@ -290,7 +290,6 @@ export class FeatureDetails {
|
|
290
290
|
* @protected
|
291
291
|
*/
|
292
292
|
onDislikeButtonClick() {
|
293
|
-
this.loadingStatus.emit(true);
|
294
293
|
if (this._isLikeBtnClicked && this.reportingOptions[this._selectedGraphic.layer.id].like) {
|
295
294
|
this.onLikeButtonClick();
|
296
295
|
}
|
@@ -312,6 +311,7 @@ export class FeatureDetails {
|
|
312
311
|
async updateFeaturesLikeDislikeField(fieldName, buttonClicked) {
|
313
312
|
const attributesToUpdate = {};
|
314
313
|
const selectedLayer = this._selectedGraphic.layer;
|
314
|
+
this._updating = true;
|
315
315
|
//Increment the value if button is clicked or else decrement it
|
316
316
|
const selectFeatureAttr = this._selectedGraphic;
|
317
317
|
if (buttonClicked) {
|
@@ -335,9 +335,9 @@ export class FeatureDetails {
|
|
335
335
|
}
|
336
336
|
//store the like dislike value for the current selected graphic in local storage
|
337
337
|
this.setInLocalStorage();
|
338
|
-
this.
|
338
|
+
this._updating = false;
|
339
339
|
}, (err) => {
|
340
|
-
this.
|
340
|
+
this._updating = false;
|
341
341
|
console.log(err);
|
342
342
|
});
|
343
343
|
}
|
@@ -490,7 +490,8 @@ export class FeatureDetails {
|
|
490
490
|
"_commentsAvailable": {},
|
491
491
|
"_isLikeBtnClicked": {},
|
492
492
|
"_isDislikeBtnClicked": {},
|
493
|
-
"_relatedFeaturesOIDs": {}
|
493
|
+
"_relatedFeaturesOIDs": {},
|
494
|
+
"_updating": {}
|
494
495
|
};
|
495
496
|
}
|
496
497
|
static get events() {
|
@@ -19,6 +19,10 @@ const CreateFeature = /*@__PURE__*/ proxyCustomElement(class CreateFeature exten
|
|
19
19
|
this.drawComplete = createEvent(this, "drawComplete", 7);
|
20
20
|
this.editingAttachment = createEvent(this, "editingAttachment", 7);
|
21
21
|
this.progressStatus = createEvent(this, "progressStatus", 7);
|
22
|
+
/**
|
23
|
+
* boolean: Flag to maintain form submission using submit button
|
24
|
+
*/
|
25
|
+
this._isSubmitBtnClicked = false;
|
22
26
|
this.mapView = undefined;
|
23
27
|
this.selectedLayerId = undefined;
|
24
28
|
this.customizeSubmit = false;
|
@@ -58,6 +62,7 @@ const CreateFeature = /*@__PURE__*/ proxyCustomElement(class CreateFeature exten
|
|
58
62
|
*/
|
59
63
|
async submit() {
|
60
64
|
if (this._editor) {
|
65
|
+
this._isSubmitBtnClicked = true;
|
61
66
|
this._editor.viewModel.featureFormViewModel.submit();
|
62
67
|
}
|
63
68
|
}
|
@@ -84,7 +89,7 @@ const CreateFeature = /*@__PURE__*/ proxyCustomElement(class CreateFeature exten
|
|
84
89
|
*/
|
85
90
|
render() {
|
86
91
|
const showSearchWidget = this.showSearchWidget ? '' : 'display-none';
|
87
|
-
return (h(Fragment, { key: '
|
92
|
+
return (h(Fragment, { key: 'd11a16053bc5eb86a09fd3bc35c9a89cee6dd064' }, h("div", { key: '0320bb0ca9fc069306151078c66fbee11060fcab', id: "feature-form" }), h("div", { key: '8aaa13e87213a880382ca408d324beb79ba7a500', class: `search-widget ${showSearchWidget}`, id: "search-widget-ref" })));
|
88
93
|
}
|
89
94
|
//--------------------------------------------------------------------------
|
90
95
|
//
|
@@ -330,11 +335,13 @@ const CreateFeature = /*@__PURE__*/ proxyCustomElement(class CreateFeature exten
|
|
330
335
|
var _a;
|
331
336
|
//return if any attribute is invalid , focus will be shifted to the invalid attribute in feature form
|
332
337
|
if (evt.invalid.length) {
|
338
|
+
this._isSubmitBtnClicked = false;
|
333
339
|
return;
|
334
340
|
}
|
335
341
|
//Submit only when valid attributes
|
336
342
|
//emit success or fail based on the result
|
337
|
-
if (evt.valid.length) {
|
343
|
+
if (evt.valid.length && this._isSubmitBtnClicked) {
|
344
|
+
this._isSubmitBtnClicked = false;
|
338
345
|
try {
|
339
346
|
await this._editor.activeWorkflow.commit();
|
340
347
|
//throw errors if any failures
|
@@ -16,6 +16,10 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
|
|
16
16
|
this.success = createEvent(this, "success", 7);
|
17
17
|
this.fail = createEvent(this, "fail", 7);
|
18
18
|
this.isActionPending = createEvent(this, "isActionPending", 7);
|
19
|
+
/**
|
20
|
+
* boolean: Flag to maintain form submission using submit button
|
21
|
+
*/
|
22
|
+
this._isSubmitBtnClicked = false;
|
19
23
|
this.mapView = undefined;
|
20
24
|
this.table = undefined;
|
21
25
|
this.selectedFeature = undefined;
|
@@ -52,6 +56,7 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
|
|
52
56
|
*/
|
53
57
|
async submit() {
|
54
58
|
if (this._editor) {
|
59
|
+
this._isSubmitBtnClicked = true;
|
55
60
|
this._editor.viewModel.featureFormViewModel.submit();
|
56
61
|
}
|
57
62
|
}
|
@@ -89,7 +94,7 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
|
|
89
94
|
this.reactiveUtils = reactiveUtils;
|
90
95
|
}
|
91
96
|
render() {
|
92
|
-
return (h(Host, { key: '
|
97
|
+
return (h(Host, { key: '8c32e05707b6e5501759caaef5d89f8da40640e4' }));
|
93
98
|
}
|
94
99
|
/**
|
95
100
|
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
|
@@ -219,11 +224,13 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
|
|
219
224
|
var _a;
|
220
225
|
//return if any attribute is invalid , focus will be shifted to the invalid attribute in feature form
|
221
226
|
if (evt.invalid.length) {
|
227
|
+
this._isSubmitBtnClicked = false;
|
222
228
|
return;
|
223
229
|
}
|
224
230
|
//Submit only when valid attributes
|
225
231
|
//emit success or fail based on the result
|
226
|
-
if (evt.valid.length) {
|
232
|
+
if (evt.valid.length && this._isSubmitBtnClicked) {
|
233
|
+
this._isSubmitBtnClicked = false;
|
227
234
|
try {
|
228
235
|
await this._editor.activeWorkflow.commit();
|
229
236
|
//throw errors if any failures
|
@@ -156,7 +156,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
156
156
|
*/
|
157
157
|
render() {
|
158
158
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
159
|
-
return (h(Host, { key: '
|
159
|
+
return (h(Host, { key: '497227745f29c2afc434349e86da19b088b1eb78' }, this._reportSubmitted && h("calcite-alert", { key: 'd22cceb7124073ad390cd53d97214a2983e97ea0', "auto-close": true, class: themeClass + " report-submitted-msg", icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { key: '1f98f71fa79cf64e65fecfbceec3862714702609', slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { key: '381d3b5a3f5115782634833ad53b4494e888ea97', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { key: '34371959d1272e4bc465e5f5a432d450a156c20b', slot: "title" }, this._translations.error), h("div", { key: '09a55e3325edde43f660a2db1621a4ffd373e09f', slot: "message" }, this._featureCreationFailedErrorMsg)), this._commentSubmitted && h("calcite-alert", { key: '33d79a67575c9a2b14e602e60b702ca82025e20f', "auto-close": true, class: 'report-submitted ' + themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._commentSubmitted = false; }, open: true, placement: "top" }, h("div", { key: '91b9dcc26cf1f66a116a287a94e8df5c3d2f37bf', slot: "message" }, this._translations.commentSubmittedMsg)), this._addingCommentFailed && h("calcite-alert", { key: '758f1d465d4301fade8fd93a682bfe4b359be2ca', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._addingCommentFailed = false; }, open: true, placement: "top" }, h("div", { key: '982424caf90e309701c62c75065d7e7e15d327b4', slot: "title" }, this._translations.error), h("div", { key: '1c93f9f8e1b958ccf8553560c36a32273f16a3a6', slot: "message" }, this._translations.addingCommentFailedMsg)), h("div", { key: '612254cf38da92cf88b90ace8136a2e0859afcae' }, h("calcite-shell", { key: 'bb56100b4dfc355b93d580deee929aad7cfb3f7f', "content-behind": true }, this._getReporter())), this.filterModal()));
|
160
160
|
}
|
161
161
|
//--------------------------------------------------------------------------
|
162
162
|
//
|
@@ -826,8 +826,9 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
826
826
|
*/
|
827
827
|
reduceToConfiguredLayers(hash) {
|
828
828
|
return Object.keys(hash).reduce((prev, cur) => {
|
829
|
+
var _a;
|
829
830
|
// check if reporting options exists consider the visible prop if else just check the supports Add
|
830
|
-
const showLayer = this.reportingOptions ? this._getLayersConfig(cur).visible
|
831
|
+
const showLayer = this.reportingOptions ? (_a = this._getLayersConfig(cur)) === null || _a === void 0 ? void 0 : _a.visible
|
831
832
|
: hash[cur].supportsAdd;
|
832
833
|
if (showLayer) {
|
833
834
|
prev.push(cur);
|
@@ -909,7 +910,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
909
910
|
const featureSet = await queryFeaturesByID([Number(this.objectId)], layer, [], true, this.mapView.spatialReference);
|
910
911
|
if (featureSet.length) {
|
911
912
|
//update the selectedFeature
|
912
|
-
this.
|
913
|
+
await this.setSelectedFeatures(featureSet);
|
913
914
|
//if featureDetails not open then add it to the list else just reInit flowItems which will update details with newly selected features
|
914
915
|
// eslint-disable-next-line unicorn/prefer-ternary
|
915
916
|
if (this._flowItems.length && this._flowItems[this._flowItems.length - 1] !== "feature-details") {
|
@@ -918,7 +919,6 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
918
919
|
else {
|
919
920
|
this._flowItems = [...this._flowItems];
|
920
921
|
}
|
921
|
-
await this.highlightOnMap(featureSet[0]);
|
922
922
|
}
|
923
923
|
}
|
924
924
|
}
|
@@ -33,7 +33,7 @@ import { d as defineCustomElement$3 } from './edit-card2.js';
|
|
33
33
|
import { d as defineCustomElement$2 } from './feature-list2.js';
|
34
34
|
import { d as defineCustomElement$1 } from './info-card2.js';
|
35
35
|
|
36
|
-
const featureDetailsCss = ":host{display:block}.buttons-container{align-items:center;display:flex;padding:
|
36
|
+
const featureDetailsCss = ":host{display:block}.buttons-container{align-items:center;display:flex;padding:4px;color:var(--calcite-color-text-1) !important;background-color:var(--calcite-color-foreground-1) !important;border-block-start:1px solid var(--calcite-color-border-3);border-block-end:1px solid var(--calcite-color-border-3)}.comment-btn{display:flex;gap:10px;font-size:var(--calcite-font-size--1);align-items:center;padding:7px 0.75rem}";
|
37
37
|
const FeatureDetailsStyle0 = featureDetailsCss;
|
38
38
|
|
39
39
|
const FeatureDetails = /*@__PURE__*/ proxyCustomElement(class FeatureDetails extends HTMLElement {
|
@@ -59,6 +59,7 @@ const FeatureDetails = /*@__PURE__*/ proxyCustomElement(class FeatureDetails ext
|
|
59
59
|
this._isLikeBtnClicked = false;
|
60
60
|
this._isDislikeBtnClicked = false;
|
61
61
|
this._relatedFeaturesOIDs = undefined;
|
62
|
+
this._updating = false;
|
62
63
|
}
|
63
64
|
//--------------------------------------------------------------------------
|
64
65
|
//
|
@@ -130,12 +131,12 @@ const FeatureDetails = /*@__PURE__*/ proxyCustomElement(class FeatureDetails ext
|
|
130
131
|
var _a, _b, _c, _d, _e;
|
131
132
|
//When related features found show comments list of only those features else comments list will be empty
|
132
133
|
const commentsListWhereClause = ((_a = this._relatedFeaturesOIDs) === null || _a === void 0 ? void 0 : _a.length) > 0 ? `objectId in(${this._relatedFeaturesOIDs})` : '1=0';
|
133
|
-
return (h("calcite-panel", { key: '
|
134
|
-
h("div", { key: '
|
135
|
-
h("div", { key: '
|
136
|
-
h("calcite-button", { key: '
|
137
|
-
h("calcite-button", { key: '
|
138
|
-
h("feature-list", { key: '
|
134
|
+
return (h("calcite-panel", { key: '8d7069fec0df2a6217c175df6171376b4412c548', "full-height": true }, h("info-card", { key: '3713b783371bcb36a9b844196033326941d833f5', allowEditing: false, graphics: this.graphics, highlightEnabled: false, isLoading: false, isMobile: false, mapView: this.mapView, onSelectionChanged: (e) => { this.featureSelectionChange.emit(e.detail); }, paginationEnabled: false, position: "relative", ref: el => this._infoCard = el }), (this._likeFieldAvailable || this._dislikeFieldAvailable || this._commentsAvailable) &&
|
135
|
+
h("div", { key: '8c84e82708fab0d6091050672b26e6fa2de59345', class: "buttons-container" }, this._commentsAvailable &&
|
136
|
+
h("div", { key: '22edb3f17ef6a2bdef67e5e94492966986d452b7', class: "comment-btn" }, h("span", { key: '03b7eb0aff4358aac3020b3d6d52a2d47b308a41' }, this._relatedFeaturesOIDs.length), h("calcite-icon", { key: '5225e156b45a15db0055a28ed21bc3511dedc706', icon: "speech-bubble", scale: 's' })), this._likeFieldAvailable &&
|
137
|
+
h("calcite-button", { key: '1a291524d46c6f826813c87f781e7d6bcf5bc097', appearance: "transparent", iconEnd: "thumbs-up", kind: this._isLikeBtnClicked ? "brand" : "neutral", loading: this._updating, onClick: this.onLikeButtonClick.bind(this), scale: 'm' }, (_c = (_b = this._likeCount) !== null && _b !== void 0 ? _b : this._selectedGraphic.attributes[this._likeField]) !== null && _c !== void 0 ? _c : 0), this._dislikeFieldAvailable &&
|
138
|
+
h("calcite-button", { key: 'da6bee2189565c1eb70564b340e742494bac35c9', appearance: "transparent", iconEnd: "thumbs-down", kind: this._isDislikeBtnClicked ? "brand" : "neutral", loading: this._updating, onClick: this.onDislikeButtonClick.bind(this), scale: 'm' }, (_e = (_d = this._disLikeCount) !== null && _d !== void 0 ? _d : this._selectedGraphic.attributes[this._dislikeField]) !== null && _e !== void 0 ? _e : 0)), this.relatedTableId && this._commentsAvailable &&
|
139
|
+
h("feature-list", { key: 'fd6faa9f3404a2dfadb102ca7c578ffb47207729', class: "height-full", mapView: this.mapView, onFeatureSelect: (e) => { this.commentSelect.emit(e.detail); }, pageSize: 5, ref: el => this._commentsList = el, selectedLayerId: this.relatedTableId, showErrorWhenNoFeatures: false, showInitialLoading: false, textSize: "small", whereClause: commentsListWhereClause })));
|
139
140
|
}
|
140
141
|
/**
|
141
142
|
* Load esri javascript api modules
|
@@ -292,7 +293,6 @@ const FeatureDetails = /*@__PURE__*/ proxyCustomElement(class FeatureDetails ext
|
|
292
293
|
* @protected
|
293
294
|
*/
|
294
295
|
onLikeButtonClick() {
|
295
|
-
this.loadingStatus.emit(true);
|
296
296
|
if (this._isDislikeBtnClicked && this.reportingOptions[this._selectedGraphic.layer.id].dislike) {
|
297
297
|
this.onDislikeButtonClick();
|
298
298
|
}
|
@@ -310,7 +310,6 @@ const FeatureDetails = /*@__PURE__*/ proxyCustomElement(class FeatureDetails ext
|
|
310
310
|
* @protected
|
311
311
|
*/
|
312
312
|
onDislikeButtonClick() {
|
313
|
-
this.loadingStatus.emit(true);
|
314
313
|
if (this._isLikeBtnClicked && this.reportingOptions[this._selectedGraphic.layer.id].like) {
|
315
314
|
this.onLikeButtonClick();
|
316
315
|
}
|
@@ -332,6 +331,7 @@ const FeatureDetails = /*@__PURE__*/ proxyCustomElement(class FeatureDetails ext
|
|
332
331
|
async updateFeaturesLikeDislikeField(fieldName, buttonClicked) {
|
333
332
|
const attributesToUpdate = {};
|
334
333
|
const selectedLayer = this._selectedGraphic.layer;
|
334
|
+
this._updating = true;
|
335
335
|
//Increment the value if button is clicked or else decrement it
|
336
336
|
const selectFeatureAttr = this._selectedGraphic;
|
337
337
|
if (buttonClicked) {
|
@@ -355,9 +355,9 @@ const FeatureDetails = /*@__PURE__*/ proxyCustomElement(class FeatureDetails ext
|
|
355
355
|
}
|
356
356
|
//store the like dislike value for the current selected graphic in local storage
|
357
357
|
this.setInLocalStorage();
|
358
|
-
this.
|
358
|
+
this._updating = false;
|
359
359
|
}, (err) => {
|
360
|
-
this.
|
360
|
+
this._updating = false;
|
361
361
|
console.log(err);
|
362
362
|
});
|
363
363
|
}
|
@@ -422,6 +422,7 @@ const FeatureDetails = /*@__PURE__*/ proxyCustomElement(class FeatureDetails ext
|
|
422
422
|
"_isLikeBtnClicked": [32],
|
423
423
|
"_isDislikeBtnClicked": [32],
|
424
424
|
"_relatedFeaturesOIDs": [32],
|
425
|
+
"_updating": [32],
|
425
426
|
"refresh": [64],
|
426
427
|
"back": [64],
|
427
428
|
"next": [64],
|
@@ -25,7 +25,7 @@ import { d as defineCustomElement$3 } from './progress.js';
|
|
25
25
|
import { d as defineCustomElement$2 } from './scrim.js';
|
26
26
|
import { d as defineCustomElement$1 } from './stack.js';
|
27
27
|
|
28
|
-
const featureListCss = ":host{display:block}.width-full{width:100%}.pagination{display:flex;justify-content:center}.error-msg{padding:10px;width:calc(100% - 20px)}.feature-list-popup-title{font-weight:500;padding:10px 12px}.feature-list-popup-title-small{font-size:small;padding:10px 12px}";
|
28
|
+
const featureListCss = ":host{display:block}.width-full{width:100%}.pagination{display:flex;justify-content:center}.error-msg{padding:10px;width:calc(100% - 20px)}.feature-list-popup-title{font-weight:500;padding:10px 12px;white-space:pre-line}.feature-list-popup-title-small{font-size:small;padding:10px 12px;white-space:pre-line}";
|
29
29
|
const FeatureListStyle0 = featureListCss;
|
30
30
|
|
31
31
|
const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends HTMLElement {
|