Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A veritable deluge of commas #35714

Merged
merged 20 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions corehq/apps/builds/static/builds/js/edit_builds.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use strict";

hqDefine('builds/js/edit_builds', [
'jquery',
'underscore',
Expand Down Expand Up @@ -34,7 +34,7 @@ hqDefine('builds/js/edit_builds', [

_.each(doc.menu, function (version) {
self.versions.push(versionModel(
version.build.version, version.label, version.superuser_only
version.build.version, version.label, version.superuser_only,
));
});
_.each(doc.defaults, function (versionDoc) {
Expand Down Expand Up @@ -98,7 +98,7 @@ hqDefine('builds/js/edit_builds', [
$('#menu-form .btn-primary').click(function () {
postGo(
$('#menu-form')[0].action,
{'doc': JSON.stringify(outputJSON(buildsMenu))}
{'doc': JSON.stringify(outputJSON(buildsMenu))},
);
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';


hqDefine('case_search/js/case_search', [
'jquery',
Expand All @@ -12,7 +12,7 @@ hqDefine('case_search/js/case_search', [
_,
ko,
alertUser,
initialPageData
initialPageData,
) {
var caseSearchModel = function (caseDataUrl) {
var self = {};
Expand Down Expand Up @@ -72,7 +72,7 @@ hqDefine('case_search/js/case_search', [
parameters: self.parameters(),
customQueryAddition: self.customQueryAddition(),
xpath_expressions: _.pluck(self.xpath_expressions(), 'xpath'),
}
},
)}),
success: function (data) {
self.results(data.values);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';


hqDefine('case_search/js/profile_case_search', [
'jquery',
Expand All @@ -10,7 +10,7 @@ hqDefine('case_search/js/profile_case_search', [
$,
_,
ko,
alertUser
alertUser,
) {
var caseSearchModel = function () {
var self = {};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use strict";

hqDefine("commtrack/js/base_list_view_model", [
'jquery',
'knockout',
Expand All @@ -8,10 +8,9 @@ hqDefine("commtrack/js/base_list_view_model", [
$,
ko,
_,
bootstrap
bootstrap,
) {
var BaseListViewModel = function (o) {
'use strict';
var self = {};

self.initialLoad = ko.observable(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use strict";

hqDefine('commtrack/js/products_and_programs_main', [
'jquery',
'knockout',
Expand All @@ -15,7 +15,7 @@
_,
initialPageData,
bootstrap,
models
models,
) {
var commtrackProductsProgramsViewModel = function (o) {
var self = models.BaseListViewModel(o);
Expand Down Expand Up @@ -62,7 +62,7 @@
alertContainer.text(message);
alertContainer.removeClass("d-none");
var $modal = $(button).closest(".modal"),
modal = bootstrap.Modal.getOrCreateInstance($modal);

Check failure on line 65 in corehq/apps/commtrack/static/commtrack/js/products_and_programs_main.js

View workflow job for this annotation

GitHub Actions / Lint Javascript

'modal' is assigned a value but never used
$modal.one('hidden.bs.modal', function () {
alertContainer.addClass("d-none");
});
Expand Down
3 changes: 1 addition & 2 deletions corehq/apps/commtrack/static/commtrack/js/sms.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ hqDefine('commtrack/js/sms', [
], function (
$,
ko,
initialPageData
initialPageData,
) {
'use strict';
function commtrackSettingsViewModel(otherSmsCodes) {
var self = {};
self.actions = ko.observableArray();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ hqDefine('custom_data_fields/js/custom_data_fields', [
_,
assertProperties,
initialPageData,
uiElementKeyValueList
uiElementKeyValueList,
) {
function Choice(choice) {
var self = {};
Expand All @@ -40,7 +40,7 @@ hqDefine('custom_data_fields/js/custom_data_fields', [
// Compare stringified arrays to match contents, not references.
// Direct assignment of the observable to options.required_for won't match requiredForOptions
const matchingOption = parent.requiredForOptions.find(option =>
JSON.stringify(option.value) === JSON.stringify(options.required_for || [])
JSON.stringify(option.value) === JSON.stringify(options.required_for || []),
);
const initialRequiredFor = matchingOption ? matchingOption.value :
((parent.requiredForOptions.find(option => option.isDefault) || {}).value || []);
Expand Down Expand Up @@ -147,7 +147,7 @@ hqDefine('custom_data_fields/js/custom_data_fields', [

self.fields = uiElementKeyValueList.new(
String(Math.random()).slice(2),
gettext("Edit Profile")
gettext("Edit Profile"),
);
self.fields.setEdit(self.isEditable());

Expand Down Expand Up @@ -263,10 +263,10 @@ hqDefine('custom_data_fields/js/custom_data_fields', [
if (options.current_profile_required_for_user_type) {
const currentProfileRequiredForList = options.current_profile_required_for_user_type;
let profileReqiredForMatch = self.profileRequiredForOptions.find(option =>
JSON.stringify(option.value) === JSON.stringify(currentProfileRequiredForList || [])
JSON.stringify(option.value) === JSON.stringify(currentProfileRequiredForList || []),
);
initialRequiredFor = _.has(profileReqiredForMatch, 'value') ? profileReqiredForMatch.value :
(self.profileRequiredForOptions.find(function (option) {return option && option.isDefault;}) || {}).value || [];
(self.profileRequiredForOptions.find(function (option) {return option && option.isDefault;}) || {}).value || [];
} else {
// If no user type already requires a profile selection set to default
initialRequiredFor = (self.profileRequiredForOptions.find(function (option) {return option && option.isDefault;}) || {}).value || [];
Expand Down Expand Up @@ -340,7 +340,7 @@ hqDefine('custom_data_fields/js/custom_data_fields', [
can_edit_linked_data: initialPageData.get('can_edit_linked_data'),
required_for_options: initialPageData.get('required_for_options'),
profile_required_for_options: initialPageData.get('profile_required_for_options'),
current_profile_required_for_user_type: initialPageData.get('profile_required_for_user_type')
current_profile_required_for_user_type: initialPageData.get('profile_required_for_user_type'),
});
customDataFieldsModel.data_fields.subscribe(function () {
$("#save-custom-fields").prop("disabled", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ hqDefine("data_interfaces/js/archive_forms", [
], function (
$,
ko,
googleAnalytics
googleAnalytics,
) {
var managementSelector = '#data-interfaces-archive-forms',
allFormsButtonSelector = managementSelector + ' input[name="select_all"]',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ hqDefine("data_interfaces/js/auto_update_rules", [
ko,
_,
initialPageData,
googleAnalytics
googleAnalytics,
) {

var RuleViewModel = function (data, parent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ hqDefine("data_interfaces/js/bootstrap3/case_dedupe_main", [
_,
initialPageData,
casePropertyInput,
CaseRuleCriteria
CaseRuleCriteria,
) {

/*
Expand Down Expand Up @@ -163,7 +163,7 @@ hqDefine("data_interfaces/js/bootstrap3/case_dedupe_main", [
initialCaseProperties,
initialIncludeClosed,
initialPropertiesToUpdate,
allCaseProperties
allCaseProperties,
) {
var self = {};
self.name = ko.observable(initialName);
Expand Down Expand Up @@ -248,7 +248,7 @@ hqDefine("data_interfaces/js/bootstrap3/case_dedupe_main", [
initialPageData.get('case_properties'),
initialPageData.get('include_closed'),
initialPageData.get('properties_to_update'),
initialPageData.get('all_case_properties')
initialPageData.get('all_case_properties'),
);
$("#case-dedupe-rule-definition").koApplyBindings(caseDedupe);

Expand All @@ -257,7 +257,7 @@ hqDefine("data_interfaces/js/bootstrap3/case_dedupe_main", [
$('#rule-criteria-panel').koApplyBindings(CaseRuleCriteria(
initialPageData.get('criteria_initial'),
initialPageData.get('criteria_constants'),
caseDedupe.caseType
caseDedupe.caseType,
));
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ hqDefine("data_interfaces/js/bootstrap3/case_management",[
var bulkReassignUrl = window.location.href.replace("data/edit", "data/edit/bulk");
$.postGo(
bulkReassignUrl,
paramsObject
paramsObject,
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ hqDefine("data_interfaces/js/bootstrap3/deduplication_rules", [
_,
initialPageData,
CRUDPaginatedList,
googleAnalytics
googleAnalytics,
) {
var showActionError = function (rule, error) {
var newItemData = _.extend({}, rule.itemData(), {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ hqDefine("data_interfaces/js/bootstrap3/manage_case_groups", [
], function (
$,
_,
initialPageData
initialPageData,
) {
$(function () {
var bulkUploadId = initialPageData.get("bulk_upload_id");
Expand Down Expand Up @@ -39,13 +39,13 @@ hqDefine("data_interfaces/js/bootstrap3/manage_case_groups", [
isPollingActive = true;
attempts = 0;
$('#upload-progress').html(
_.template($('#template-upload-progress').text())(data)
_.template($('#template-upload-progress').text())(data),
);
retry();
} else {
isPollingActive = false;
$('#upload-notice').html(
_.template($('#template-bulk-status').text())(data)
_.template($('#template-bulk-status').text())(data),
);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ hqDefine("data_interfaces/js/bootstrap5/case_dedupe_main", [
_,
initialPageData,
casePropertyInput,
CaseRuleCriteria
CaseRuleCriteria,
) {

/*
Expand Down Expand Up @@ -163,7 +163,7 @@ hqDefine("data_interfaces/js/bootstrap5/case_dedupe_main", [
initialCaseProperties,
initialIncludeClosed,
initialPropertiesToUpdate,
allCaseProperties
allCaseProperties,
) {
var self = {};
self.name = ko.observable(initialName);
Expand Down Expand Up @@ -248,7 +248,7 @@ hqDefine("data_interfaces/js/bootstrap5/case_dedupe_main", [
initialPageData.get('case_properties'),
initialPageData.get('include_closed'),
initialPageData.get('properties_to_update'),
initialPageData.get('all_case_properties')
initialPageData.get('all_case_properties'),
);
$("#case-dedupe-rule-definition").koApplyBindings(caseDedupe);

Expand All @@ -257,7 +257,7 @@ hqDefine("data_interfaces/js/bootstrap5/case_dedupe_main", [
$('#rule-criteria-panel').koApplyBindings(CaseRuleCriteria(
initialPageData.get('criteria_initial'),
initialPageData.get('criteria_constants'),
caseDedupe.caseType
caseDedupe.caseType,
));
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ hqDefine("data_interfaces/js/bootstrap5/case_management",[
var bulkReassignUrl = window.location.href.replace("data/edit", "data/edit/bulk");
$.postGo(
bulkReassignUrl,
paramsObject
paramsObject,
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ hqDefine("data_interfaces/js/bootstrap5/deduplication_rules", [
_,
initialPageData,
CRUDPaginatedList,
googleAnalytics
googleAnalytics,
) {
var showActionError = function (rule, error) {
var newItemData = _.extend({}, rule.itemData(), {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ hqDefine("data_interfaces/js/bootstrap5/manage_case_groups", [
], function (
$,
_,
initialPageData
initialPageData,
) {
$(function () {
var bulkUploadId = initialPageData.get("bulk_upload_id");
Expand Down Expand Up @@ -39,13 +39,13 @@ hqDefine("data_interfaces/js/bootstrap5/manage_case_groups", [
isPollingActive = true;
attempts = 0;
$('#upload-progress').html(
_.template($('#template-upload-progress').text())(data)
_.template($('#template-upload-progress').text())(data),
);
retry();
} else {
isPollingActive = false;
$('#upload-notice').html(
_.template($('#template-bulk-status').text())(data)
_.template($('#template-bulk-status').text())(data),
);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ hqDefine('data_interfaces/js/case_property_input', [
ko,
_,
initialPageData,
privileges
privileges,
) {
var component = {
viewModel: function (params) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ hqDefine("data_interfaces/js/case_rule_actions", [
], function (
$,
ko,
initialPageData
initialPageData,
) {
var CaseRuleActions = function (initial, caseTypeObservable) {
var self = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ hqDefine("data_interfaces/js/case_rule_main", [
initialPageData,
casePropertyInput,
CaseRuleCriteria,
CaseRuleActions
CaseRuleActions,
) {
$(function () {
casePropertyInput.register();

var criteriaModel = CaseRuleCriteria(
initialPageData.get('criteria_initial'),
initialPageData.get('criteria_constants')
initialPageData.get('criteria_constants'),
);
$('#rule-criteria-panel').koApplyBindings(criteriaModel);

$('#rule-actions').koApplyBindings(CaseRuleActions(
initialPageData.get('actions_initial'),
criteriaModel.caseType
criteriaModel.caseType,
));
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ hqDefine("data_interfaces/js/find_by_id", [
ko,
assertProperties,
initialPageData,
kissmetrics
kissmetrics,
) {
var findModel = function (options) {
assertProperties.assert(options, ['errorMessage', 'eventName', 'header', 'help', 'placeholder', 'successMessage']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ hqDefine("enterprise/js/enterprise_settings", [
ko,
_,
assertProperties,
initialPageData
initialPageData,
) {
var settingsFormModel = function (options) {
assertProperties.assert(options, ['accounts_email'], ['restrict_signup', 'restricted_domains']);
Expand Down
Loading