Skip to content

Commit 6e9d316

Browse files
Merge pull request #90 from Esri/develop
December Release 2017
2 parents eee9d95 + e8b0d20 commit 6e9d316

File tree

171 files changed

+481
-675
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+481
-675
lines changed

.idea/workspace.xml

Lines changed: 126 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PhotoSurvey.tbx

-580 KB
Binary file not shown.

PhotoSurvey103.tbx

23.5 KB
Binary file not shown.

Survey Configurations/DamageAssessmentSurvey.ini

Lines changed: 0 additions & 67 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Survey Configurations/GeneralPropertyCondition.ini

Lines changed: 0 additions & 67 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Survey Configurations/WildlifeSurvey.ini

Lines changed: 0 additions & 68 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

js/app/dataAccess.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ define(['diag'], function (diag) {
168168
url = dataAccess.featureServiceUrl + "query?where=" + dataAccess.validCandidateCondition
169169
+ "&objectIds=&returnIdsOnly=true&returnCountOnly=false&outFields=" + dataAccess.fixedQueryParams
170170
+ "&callback=?";
171-
$.getJSON(url, function handleCandidatesClosure(results) {
171+
$.post(url, function handleCandidatesClosure(results) {
172172
dataAccess.handleCandidates(results, randomizeSelection, deferred);
173-
});
173+
},'json');
174174

175175
return deferred;
176176
},

js/app/fetchConfigInfo.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,25 +164,32 @@ define(['parseConfigInfo'], function (parseConfigInfo) {
164164
$.getJSON(arcgisUrl + webmapId + "/data?f=json&callback=?", function (data) {
165165
var featureSvcData = {};
166166

167-
if (data && data.operationalLayers && data.operationalLayers.length > 0) {
167+
if (data && data.operationalLayers && data.operationalLayers.length > 0 && data.tables && data.tables.length > 0) {
168168
featureSvcData.opLayerParams = data.operationalLayers[0];
169+
featureSvcData.formUIParams = data.tables[0];
169170

170-
// Get the app's webmap's feature service's data
171-
fetchConfigInfo.getFeatureSvcData(featureSvcData.opLayerParams.url).done(function (data) {
172-
if (!data || data.error) {
171+
// Get the app's webmap's feature service's data and the survey questions table data
172+
$.when(fetchConfigInfo.getFeatureSvcData(featureSvcData.opLayerParams.url),
173+
fetchConfigInfo.getFeatureSvcData(featureSvcData.formUIParams.url))
174+
.done(function (svcdata, uidata) {
175+
if (!svcdata || svcdata.error || !uidata || uidata.error) {
173176
deferred.reject();
174177
}
175-
featureSvcData.featureSvcParams = data;
178+
featureSvcData.featureSvcParams = svcdata;
179+
featureSvcData.formUISvcParams = uidata;
176180
deferred.resolve(featureSvcData);
181+
})
182+
.fail(function(){
183+
deferred.resolve({});
177184
});
185+
178186
} else {
179187
deferred.resolve({});
180188
}
181189
});
182190
} else {
183191
deferred.resolve({});
184192
}
185-
186193
return deferred;
187194
},
188195

@@ -199,7 +206,6 @@ define(['parseConfigInfo'], function (parseConfigInfo) {
199206
if (!deferred) {
200207
deferred = $.Deferred();
201208
}
202-
203209
if (parseConfigInfo.isUsableString(featureSvcUrl)) {
204210
$.getJSON(featureSvcUrl + "?f=json&callback=?", function (data) {
205211
data.canBeUpdated = data.capabilities && data.capabilities.indexOf("Update") >= 0;

js/app/main.js

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,20 @@ define(['lib/i18n.min!nls/resources.js', 'prepareAppConfigInfo', 'handleUserSign
148148

149149
// When the feature service and survey are ready, we can set up the module that reads from and writes to the service
150150
prepareAppConfigInfo.surveyReady.done(function () {
151+
152+
//Test if the user has set a filter on the candidates feature service layer and update the validCondition parameter to query candidates accordingly
153+
var validCondition;
154+
if (prepareAppConfigInfo.filterDefinition){
155+
validCondition = "(" + prepareAppConfigInfo.appParams.surveyorNameField + "+is+null+or+"
156+
+ prepareAppConfigInfo.appParams.surveyorNameField + "='') " + "and " + prepareAppConfigInfo.filterDefinition;
157+
}
158+
else{
159+
validCondition = prepareAppConfigInfo.appParams.surveyorNameField + "+is+null+or+"
160+
+ prepareAppConfigInfo.appParams.surveyorNameField + "=''";
161+
}
162+
151163
dataAccess.init(prepareAppConfigInfo.featureSvcParams.url, prepareAppConfigInfo.featureSvcParams.id,
152-
prepareAppConfigInfo.featureSvcParams.objectIdField,
153-
prepareAppConfigInfo.appParams.surveyorNameField + "+is+null+or+"
154-
+ prepareAppConfigInfo.appParams.surveyorNameField + "=''", prepareAppConfigInfo.appParams.proxyProgram);
164+
prepareAppConfigInfo.featureSvcParams.objectIdField, validCondition, prepareAppConfigInfo.appParams.proxyProgram);
155165

156166
// Test if there are any surveys remaining to be done
157167
dataAccess.getObjectCount().done(function (countRemaining) {
@@ -230,11 +240,26 @@ define(['lib/i18n.min!nls/resources.js', 'prepareAppConfigInfo', 'handleUserSign
230240
});
231241
}
232242

243+
// Create skip button if specified in config
244+
if(prepareAppConfigInfo.appParams.showSkip){
245+
246+
// Check if config file skipButtonText is not empty or null
247+
if(prepareAppConfigInfo.appParams.skipButtonText){
248+
$("#skipBtn")[0].innerHTML = prepareAppConfigInfo.appParams.skipButtonText;
249+
}
250+
else{
251+
$("#skipBtn")[0].innerHTML = i18n.tooltips.button_skip;
252+
}
253+
}
254+
else{
255+
$("#skipBtn").css("visibility", "hidden");
256+
}
257+
258+
233259
// i18n updates
234260
$("#previousImageBtn")[0].title = i18n.tooltips.button_previous_image;
235261
$("#nextImageBtn")[0].title = i18n.tooltips.button_next_image;
236262

237-
$("#skipBtn")[0].innerHTML = i18n.tooltips.button_skip;
238263
$("#submitBtn")[0].innerHTML = i18n.tooltips.button_submit;
239264

240265
$("#userProfileSelectionText")[0].innerHTML = i18n.labels.menuItem_profile;
@@ -412,6 +437,9 @@ define(['lib/i18n.min!nls/resources.js', 'prepareAppConfigInfo', 'handleUserSign
412437

413438
// Provide the i18n strings to the survey
414439
survey.flag_important_question = i18n.tooltips.flag_important_question;
440+
survey.error_text = i18n.messages.error_text;
441+
442+
415443

416444
//------------------------------------------------------------------------------------------------------------------------//
417445
// Wire up app events
@@ -471,6 +499,7 @@ define(['lib/i18n.min!nls/resources.js', 'prepareAppConfigInfo', 'handleUserSign
471499

472500
// Provide some visual feedback for the switch to a new survey
473501
$("#submitBtn").fadeTo(100, 0.0).blur();
502+
$("#skipBtn").fadeTo(100, 0.0).blur();
474503
$("#surveyContainer").fadeTo(100, 0.0);
475504

476505
// Get candidate property
@@ -533,6 +562,7 @@ define(['lib/i18n.min!nls/resources.js', 'prepareAppConfigInfo', 'handleUserSign
533562
: 1.0));
534563
if (!isReadOnly) {
535564
$("#submitBtn").fadeTo(1000, 1.0);
565+
$("#skipBtn").fadeTo(1000, 1.0);
536566
}
537567

538568
}, function () {
@@ -557,6 +587,14 @@ define(['lib/i18n.min!nls/resources.js', 'prepareAppConfigInfo', 'handleUserSign
557587
});
558588
});
559589

590+
$(document).on("click", ".prime", function(){
591+
survey.updateForm($(this).val(), $(this).data("id"), prepareAppConfigInfo.survey);
592+
});
593+
594+
$(document).on("change", ".primeD", function(){
595+
survey.updateForm($(this).val(), $(this).data("id"), prepareAppConfigInfo.survey);
596+
});
597+
560598
$("#userSignoutSelection").on('click', function () {
561599
$(document).triggerHandler('signedOut:user');
562600
});

0 commit comments

Comments
 (0)