Skip to content

Commit

Permalink
Merge pull request #525 from Esri/develop
Browse files Browse the repository at this point in the history
Sync master with develop
  • Loading branch information
azizaparveen authored Dec 17, 2021
2 parents cfceed4 + 75ad435 commit fe7a879
Show file tree
Hide file tree
Showing 10 changed files with 557 additions and 34 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" : ""
});
99 changes: 90 additions & 9 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ define([
'dijit/layout/ContentPane',
"esri/dijit/BasemapGallery",
"esri/dijit/Legend",
"esri/request",
"dojo/domReady!"
], function (
declare,
Expand Down Expand Up @@ -123,7 +124,8 @@ define([
MapSearch,
ContentPane,
BasemapGallery,
Legend
Legend,
esriRequest
) {
return declare(null, {
config: {},
Expand Down Expand Up @@ -522,6 +524,78 @@ define([
this.boilerPlateTemplate.queryGroupItems(queryParams).then(lang.hitch(this, this._groupItemsLoaded));
},

/**
* This function is used to read configured csv file for custom cascading selects
*/
_readCsv: function () {
var deferred = new Deferred();
if (this.config.csvUrlForCascadingSelect) {
esriRequest({
url: this.config.csvUrlForCascadingSelect,
handleAs: "text",
callbackParamName: "callback"
}).then(lang.hitch(this, function (response) {
var obj = {};
var fieldKeyName;
var csvDataRows = response.split(/\r\n/);
array.forEach(csvDataRows, lang.hitch(this, function (data, index) {
if (index !== 0 && data !== "") {
var rowDataArray = data.includes(',') ? data.split(",") : data.split(/\t/);
//trim values so that any trailing spaces should not create issues
rowDataArray = array.map(rowDataArray, function(item){
return lang.trim(item);
});
if (rowDataArray[3] === "") {
if (!obj.hasOwnProperty(rowDataArray[0]) && obj[rowDataArray[0]] !== "") {
obj[rowDataArray[0]] = {
"codedValues": []
};
fieldKeyName = rowDataArray[0];
}
if (rowDataArray[1] !== "" && rowDataArray[2] !== "") {
obj[fieldKeyName].codedValues.push(
{
code: rowDataArray[1],
name: rowDataArray[2]
});
}
} else {
array.some(obj[fieldKeyName].codedValues, function(domainValue){
if (domainValue.code === rowDataArray[3]) {
if (!domainValue.hasOwnProperty("subDomains")) {
domainValue.subDomains = {};
}
if (!domainValue.subDomains.hasOwnProperty([rowDataArray[0]])) {
domainValue.subDomains[rowDataArray[0]] = {};
}
if (!domainValue.subDomains[rowDataArray[0]].hasOwnProperty("codedValues")) {
domainValue.subDomains[rowDataArray[0]].codedValues = [];
}
if (rowDataArray[1] !== "" && rowDataArray[2] !== "") {
domainValue.subDomains[rowDataArray[0]].codedValues.push({
code: rowDataArray[1],
name: rowDataArray[2]
});
}
return true;
}
}, this);
}
}
}));
deferred.resolve(obj);
}), function (error) {
//if any error in fetching csv log the error and return null
console.error(error);
deferred.resolve(null);
});
} else {
//If CSV url not configured return null
deferred.resolve(null);
}
return deferred.promise;
},

/**
* Callback handler called on group items loaded, which will have group items as response.
* @param{object} response
Expand All @@ -534,7 +608,10 @@ define([
this.config.groupItems = {};
}
this.config.groupItems.results = this._groupItems;
this._loadApplication();
this._readCsv().then(lang.hitch(this, function (csvData) {
this.customCodedValues = csvData;
this._loadApplication();
}));
} else {
this._loadGroupItems(response.groupItems.nextQueryParams);
}
Expand Down Expand Up @@ -591,7 +668,8 @@ define([
// Item details
this._itemDetails = new ItemDetails({
"appConfig": this.config,
"appUtils": this.appUtils
"appUtils": this.appUtils,
"loggedInUser": this._loggedInUser
}).placeAt("sidebarContent"); // placeAt triggers a startup call to _itemDetails
this._itemDetails.hide();
this._sidebarCnt.addPanel("itemDetails", this._itemDetails);
Expand Down Expand Up @@ -658,7 +736,9 @@ define([
appUtils: this.appUtils,
isEdit: true,
item: this._itemDetails.item,
isMapRequired: true
isMapRequired: true,
customCodedValues: this.customCodedValues,
loggedInUser: this._loggedInUser
}, domConstruct.create("div", {}, parentDiv));
this.geoformEditInstance.startup();

Expand Down Expand Up @@ -1739,8 +1819,9 @@ define([
appUtils: this.appUtils,
isMapRequired: true,
isEdit: false,
selectedLayer: this.selectedLayer

selectedLayer: this.selectedLayer,
customCodedValues: this.customCodedValues,
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.
this.geoformInstance.geoformSubmitted = lang.hitch(this, function (objectId) {
Expand All @@ -1759,9 +1840,9 @@ define([
}
}));
//clear graphics drawn on layer after feature has been submmited
if (this.featureGraphicLayer) {
this.featureGraphicLayer.clear();
}
if (this.featureGraphicLayer) {
this.featureGraphicLayer.clear();
}
} catch (ex) {
this.appUtils.showError(ex.message);
}
Expand Down
192 changes: 192 additions & 0 deletions js/nls/bg/resources.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
/*global define */
/*
| Copyright 2014 Esri
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
*/
define({
"map": {
"error": "Impossible de créer la carte",
"licenseError": {
"message": "La licence de votre compte ne permet pas d’utiliser des applications configurables non publiques. Demandez à l’administrateur de votre organisation de vous attribuer un type d’utilisateur qui inclut une licence Essential Apps ou une licence Essential Apps additionnelle.",
"title": "Pas de licence"
},
"warningMessageTitle": "Prise en charge limitée du navigateur",
"warningMessageAGOL": "Vous utilisez un navigateur obsolète. Certaines parties de cette application risquent de ne pas fonctionner de manière optimale ou de ne pas fonctionner du tout dans ce navigateur. Ce navigateur ne sera plus pris en charge à l’avenir.</br></br>Utilisez les dernières versions de <chrome-link>Google Chrome</chrome-link>, <firefox-link>Mozilla Firefox</firefox-link>, <safari-link>Apple Safari</safari-link> ou <edge-link>Microsoft Edge</edge-link>.</br></br>Pour plus d’informations sur les navigateurs pris en charge, consultez la documentation. Envoyez vos commentaires via <feedback-link>GeoNet, la communauté Esri</feedback-link>.",
"warningMessageEnterprise": "Vous utilisez un navigateur qui n’est plus pris en charge. Certaines parties de cette application risquent de ne pas fonctionner de manière optimale ou de ne pas fonctionner du tout dans ce navigateur.</br></br>Utilisez les dernières versions de <chrome-link>Google Chrome</chrome-link>, <firefox-link>Mozilla Firefox</firefox-link>, <safari-link>Apple Safari</safari-link> ou <edge-link>Microsoft Edge</edge-link>.",
"zoomInTooltip": "Zoom avant",
"zoomOutTooltip": "Zoom arrière",
"geolocationTooltip": "Position actuelle"
},
"main": {
"noGroup": "Aucun groupe configuré",
"submitReportButtonText": "Envoyer un rapport",
"gotoListViewTooltip": "Vue Liste",
"noFeatureGeomtery": "Impossible d'afficher l'entité",
"featureOutsideAOIMessage": "Impossible d’ajouter l'entité hors de la zone d'étude",
"noEditingPermissionsMessage": "Vous n’êtes pas autorisé à effectuer cette action.",
"basemapGalleryText": "Bibliothèque de fonds de carte",
"basemapThumbnailAltText": "Cliquez pour charger ${basemapTitle} ${index} sur ${totalBasemaps}",
"legendText": "Légende",
"featureNotFoundMessage": "Entité demandée introuvable",
"backButton": "retour",
"panelCloseButton": "Fermer"
},
"signin": {
"guestSigninText": "Continuer comme invité",
"signInOrText": "Ou",
"signinOptionsText": "Se connecter avec :",
"noGroupNameText": "Connectez-vous",
"guestLoginTooltip": "Se connecter comme invité",
"facebookLoginTooltip": "Se connecter avec Facebook",
"twitterLoginTooltip": "Se connecter avec Twitter",
"googlePlusLoginTooltip": "Se connecter avec Google+",
"agolLoginTooltip": "Se connecter avec ArcGIS"
},
"webMapList": {
"owner": "Propriétaire",
"created": "Date de création",
"modified": "Date de modification",
"description": "Description",
"snippet": "Résumé",
"licenseInfo": "Restrictions d'accès et d'utilisation",
"accessInformation": "Crédits",
"tags": "Balises",
"numViews": "Nombre de vues",
"avgRating": "Evaluation",
"noWebMapInGroup": "Le groupe configuré n'est pas valide ou aucun élément n'a encore été partagé avec ce groupe.",
"infoBtnToolTip": "Informations sur la carte"
},
"issueWall": {
"noResultsFound": "Aucune entité trouvée",
"noResultsFoundInCurrentBuffer": "Aucune entité trouvée à proximité de votre position",
"unableToFetchFeatureError": "Impossible d'exécuter l'opération",
"gotoWebmapListTooltip": "Accéder à la liste principale",
"gotoMapViewTooltip": "Vue cartographique"
},
"appHeader": {
"help": "Aide",
"myReport": "Mes envois",
"signIn": "Se connecter",
"signOut": "Se déconnecter",
"signInTooltip": "Connexion",
"signOutTooltip": "Déconnexion",
"myReportTooltip": "Consulter mes envois",
"share": "Partager",
"shareDialogTitle": "Boîte de dialogue Partager",
"shareDialogAppURLLabel": "URL de l’application",
"mobileHamburger": "Hamburger"
},
"geoform": {
"enterInformation": "Détails",
"selectAttachments": "Pièces jointes",
"selectFileText": "Parcourir",
"enterLocation": "Localisation",
"reportItButton": "Signaler",
"editReportButton": "Mettre à jour",
"cancelButton": "Annuler",
"requiredField": "(requis)",
"selectDefaultText": "Sélectionner&hellip;",
"invalidInputValue": "Entrez une valeur valide.",
"noFieldsConfiguredMessage": "Les champs de couche ne sont pas configurés pour capturer les données",
"invalidSmallNumber": "Entrez un entier",
"invalidNumber": "Entrez un entier",
"invalidFloat": "Entrez un nombre",
"invalidDouble": "Entrez un nombre",
"requiredFields": "Indiquez des valeurs pour tous les champs requis",
"selectLocation": "Sélectionnez l'emplacement de votre rapport",
"numericRangeHintMessage": "${openStrong}Astuce :${closeStrong} valeur minimale ${minValue} et valeur maximale ${maxValue}",
"dateRangeHintMessage": "${openStrong}Astuce :${closeStrong} date minimum ${minValue} et date maximum ${maxValue}",
"errorsInApplyEdits": "Impossible d’envoyer les valeurs.",
"attachmentSelectedMsg": "pièce(s) jointe(s) sélectionnée(s)",
"attachmentUploadStatus": "Echec du chargement de ${failed} sur ${total} pièce(s) jointe(s)",
"geoLocationError": "Localisant actuel non disponible",
"geoLocationOutOfExtent": "L'étendue courante est en dehors de l'étendue du fond de carte",
"submitButtonTooltip": "Envoyer",
"cancelButtonTooltip": "Annuler",
"geoformBackButtonTooltip": "Retourner à la liste",
"locationSelectionHintForPointLayer": "Touchez la carte pour tracer l’emplacement.",
"locationSelectionHintForPolygonLayer": "Touchez la carte pour tracer l’emplacement. Touchez deux fois pour terminer le dessin.",
"locationSelectionHintForPointLayerDesktop": "Cliquez sur la carte pour tracer l’emplacement.",
"locationSelectionHintForPolygonLayerDesktop": "Cliquez sur la carte pour tracer l’emplacement. Doublez-cliquez pour terminer le dessin.",
"locationDialogTitle": "Sélectionner l’emplacement du rapport",
"locationDialogContent": "Voulez-vous vraiment utiliser l’emplacement de l’image ?",
"errorMessageText": "${message} pour le champ ${fieldName}",
"deleteAttachmentBtnText": "Supprimer une pièce jointe"
},
"locator": {
"addressText": "Adresse :",
"usngText": "USNG",
"mgrsText": "MGRS",
"latLongText": "Latitude/Longitude",
"invalidSearch": "Aucun résultat trouvé",
"locatorPlaceholder": "Entrer une adresse à rechercher",
"locationOutOfExtent": "L’emplacement est situé en dehors de la zone d’envoi",
"searchButtonTooltip": "Rechercher",
"clearButtonTooltip": "Effacer la valeur de recherche"
},
"myIssues": {
"title": "Mes envois",
"myIssuesTooltip": "Mes envois",
"noResultsFound": "Aucun envoi trouvé"
},
"itemDetails": {
"likeButtonLabel": "",
"likeButtonTooltip": "J'accepte",
"commentButtonLabel": "",
"commentButtonTooltip": "Laisser une réponse",
"galleryButtonLabel": "",
"galleryButtonTooltip": "Voir les documents joints",
"mapButtonLabel": "Afficher sur la carte",
"mapButtonTooltip": "Visualiser l’emplacement de cet envoi",
"commentsListHeading": "Commentaires",
"unableToUpdateVoteField": "Il est actuellement impossible de comptabiliser votre vote.",
"gotoIssueListTooltip": "Visualiser la liste des envois",
"deleteMessage": "Etes-vous sûr de vouloir le supprimer ?"
},
"itemList": {
"likesForThisItemTooltip": "Nombre de votes",
"loadMoreButtonText": "Charger plus..."
},
"comment": {
"commentsFormHeading": "Commentaire",
"commentsFormSubmitButton": "Envoyer un commentaire",
"commentsFormEditButton": "Mettre à jour un commentaire",
"commentsFormCancelButton": "Annuler",
"errorInSubmittingComment": "Impossible d'envoyer le commentaire.",
"commentSubmittedMessage": "Merci de vos commentaires.",
"emptyCommentMessage": "Saisissez un commentaire.",
"placeHolderText": "Saisir un commentaire",
"noCommentsAvailableText": "Aucun commentaire disponible",
"remainingTextCount": "${0} caractère(s) restant(s)",
"showNoText": "Non",
"selectAttachments": "Pièces jointes",
"selectFileText": "Parcourir",
"attachmentSelectedMsg": "pièce(s) jointe(s) sélectionnée(s)",
"attachmentHeaderText": "Pièces jointes",
"unknownCommentAttachment": "FICHIER",
"editRecordText": "Modifie",
"deleteRecordText": "Effacer",
"deleteCommentFailedMessage": "Impossible de supprimer le commentaire"
},
"gallery": {
"galleryHeaderText": "Bibliothèque",
"noAttachmentsAvailableText": "Aucune pièce jointe trouvée"
},
"dialog": {
"okButton": "OK",
"cancelButton": "Annuler",
"yesButton": "Oui",
"noButton": "Non"
}
});
1 change: 1 addition & 0 deletions js/nls/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ define({
}
}),
"ar": 1,
"bg": 1,
"bs": 1,
"ca": 1,
"cs": 1,
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
Loading

0 comments on commit fe7a879

Please sign in to comment.