Skip to content

Commit

Permalink
Interim Code Drop For Crowd Source Reporter AGOL-9.4 Release
Browse files Browse the repository at this point in the history
### Implemented following gitHub tickets:

 - Esri#510 (Configuration changes)
 - Esri#512
 - Esri#513
  • Loading branch information
sandhyakurumanale-ct committed Nov 9, 2021
1 parent ec041ec commit 6494bb4
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 6 deletions.
6 changes: 5 additions & 1 deletion config/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,9 @@ define({
"commentsSuccessMessage": "Comments Submitted Successfully.",
"commentSortingOrder": "DESC", // To sort comment in ascending(ASC) or descending(DESC) order.
"commentSortingField": "comments", // Field on which ascending or descending sorting needs to be applied
"maxImageSize": "actualSize"
"maxImageSize": "actualSize",
"firstNameField" : "",
"lastNameField" : "",
"emailField" : "",
"csvUrlForCascadingSelect" : ""
});
6 changes: 4 additions & 2 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,8 @@ define([
appUtils: this.appUtils,
isEdit: true,
item: this._itemDetails.item,
isMapRequired: true
isMapRequired: true,
loggedInUser: this._loggedInUser
}, domConstruct.create("div", {}, parentDiv));
this.geoformEditInstance.startup();

Expand Down Expand Up @@ -1739,7 +1740,8 @@ define([
appUtils: this.appUtils,
isMapRequired: true,
isEdit: false,
selectedLayer: this.selectedLayer
selectedLayer: this.selectedLayer,
loggedInUser: this._loggedInUser

}, domConstruct.create("div", {}, dom.byId("geoformContainer")));
//on submitting issues in geoform update issue wall and main map to show newly updated issue.
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/app-header/app-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ define([
domAttr.set(this.helpButton, "aria-label", this.appConfig.helpLinkText);
//Load help screen on load based on configuration settings
setTimeout(lang.hitch(this, function () {
if (this.appConfig.showHelpOnLoad) {
if (this.appConfig.showHelpOnLoad && this.appConfig.enableHelp) {
this._helpClicked();
}
}), 500);
Expand Down
26 changes: 26 additions & 0 deletions js/widgets/geo-form/geo-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,32 @@ define([
}
}
}
if (this.loggedInUser !== null) {
if (this.config.firstNameField !== "" && currentField.type === "esriFieldTypeString" &&
fieldname.toLowerCase() === this.config.firstNameField.toLowerCase()) {
if (this.loggedInUser.firstName.length > currentField.length) {
currentField.defaultValue = this.loggedInUser.firstName.slice(0, currentField.length);
} else {
currentField.defaultValue = this.loggedInUser.firstName;
}
}
if (this.config.lastNameField !== "" && currentField.type === "esriFieldTypeString" &&
fieldname.toLowerCase() === this.config.lastNameField.toLowerCase()) {
if (this.loggedInUser.lastName.length > currentField.length) {
currentField.defaultValue = this.loggedInUser.lastName.slice(0, currentField.length);
} else {
currentField.defaultValue = this.loggedInUser.lastName;
}
}
if (this.config.emailField !== "" && currentField.type === "esriFieldTypeString" &&
fieldname.toLowerCase() === this.config.emailField.toLowerCase()) {
if (this.loggedInUser.email.length > currentField.length) {
currentField.defaultValue = this.loggedInUser.email.slice(0, currentField.length);
} else {
currentField.defaultValue = this.loggedInUser.email;
}
}
}
// Set hint text for range domain Value
this._createRangeText(currentField, formContent, fieldname);
// If field has coded domain value and typeField set to true then create form elements for domain fields
Expand Down
37 changes: 35 additions & 2 deletions resources/configuration-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@
"commentEndDate" :"",
"commentEndTime": "",
"commentSortingOrder": "DESC",
"maxImageSize": "actualSize"
"maxImageSize": "actualSize",
"firstNameField" : "",
"lastNameField" : "",
"emailField" : "",
"csvUrlForCascadingSelect" : ""
},
"configurationSettings": [{
"category": "<b>General</b>",
Expand Down Expand Up @@ -605,7 +609,36 @@
"type": "string",
"stringFieldOption": "richtext",
"fieldName": "submitMessage"
}]
}, {
"type": "subcategory",
"label": "Import choice list for cascading select"
}, {
"label": "Specify the URL of the CSV for the field values",
"tooltip": "CSV data will be used to create value list for the layer fields",
"type": "string",
"fieldName": "csvUrlForCascadingSelect"
}, {
"type": "subcategory",
"label": "Autofill field information"
}, {
"type": "paragraph",
"value": "Enter field names to autofill first name, last name and email of the logged in user."
}, {
"label": "First name",
"tooltip": "Autofill value in the configured field",
"type": "string",
"fieldName": "firstNameField"
}, {
"label": "Last name",
"tooltip": "Autofill value in the configured field",
"type": "string",
"fieldName": "lastNameField"
}, {
"label": "Email",
"tooltip": "Autofill value in the configured field",
"type": "string",
"fieldName": "emailField"
}]
}, {
"category": "<b>Reports</b>",
"fields": [{
Expand Down

0 comments on commit 6494bb4

Please sign in to comment.