Skip to content

Commit

Permalink
Merge pull request #535 from sandhyakurumanale-ct/AGOL-10.2
Browse files Browse the repository at this point in the history
Delivery for Crowdsource Reporter AGOL10.2 - #532
  • Loading branch information
azizaparveen committed May 12, 2022
2 parents 18a7601 + 93e11c3 commit 8a562af
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions js/widgets/comment-form/comment-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -1021,23 +1021,26 @@ define([

//if loggedInUser info is available and fields are configured then populate it with the user info
if (this.loggedInUser !== null) {
if (this.config.firstNameField && this.config.firstNameField !== "" && currentField.type === "esriFieldTypeString" &&
if (this.config.firstNameField && this.config.firstNameField !== "" &&
currentField.type === "esriFieldTypeString" && this.loggedInUser.firstName &&
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 && this.config.lastNameField !== "" && currentField.type === "esriFieldTypeString" &&
if (this.config.lastNameField && this.config.lastNameField !== "" &&
currentField.type === "esriFieldTypeString" && this.loggedInUser.lastName &&
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 && this.config.emailField !== "" && currentField.type === "esriFieldTypeString" &&
if (this.config.emailField && this.config.emailField !== "" &&
currentField.type === "esriFieldTypeString" && this.loggedInUser.email &&
fieldname.toLowerCase() === this.config.emailField.toLowerCase()) {
if (this.loggedInUser.email.length > currentField.length) {
currentField.defaultValue = this.loggedInUser.email.slice(0, currentField.length);
Expand Down
9 changes: 6 additions & 3 deletions js/widgets/geo-form/geo-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -1135,23 +1135,26 @@ define([
}
//if loggedInUser info is available and fields are configured then populate it with the user info
if (this.loggedInUser !== null) {
if (this.config.firstNameField && this.config.firstNameField !== "" && currentField.type === "esriFieldTypeString" &&
if (this.config.firstNameField && this.config.firstNameField !== "" &&
currentField.type === "esriFieldTypeString" && this.loggedInUser.firstName &&
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 && this.config.lastNameField !== "" && currentField.type === "esriFieldTypeString" &&
if (this.config.lastNameField && this.config.lastNameField !== "" &&
currentField.type === "esriFieldTypeString" && this.loggedInUser.lastName &&
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 && this.config.emailField !== "" && currentField.type === "esriFieldTypeString" &&
if (this.config.emailField && this.config.emailField !== "" &&
currentField.type === "esriFieldTypeString" && this.loggedInUser.email &&
fieldname.toLowerCase() === this.config.emailField.toLowerCase()) {
if (this.loggedInUser.email.length > currentField.length) {
currentField.defaultValue = this.loggedInUser.email.slice(0, currentField.length);
Expand Down

0 comments on commit 8a562af

Please sign in to comment.