Skip to content

Commit

Permalink
Reset save button on loading case properties
Browse files Browse the repository at this point in the history
  • Loading branch information
kaapstorm committed Jun 28, 2024
1 parent b3ce042 commit 042bf8c
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ hqDefine("data_dictionary/js/data_dictionary", [
geoCaseProp,
isSafeToDelete,
changeSaveButton,
resetSaveButton,
dataUrl
) {
var self = {};
Expand All @@ -44,6 +45,7 @@ hqDefine("data_dictionary/js/data_dictionary", [
self.geoCaseProp = geoCaseProp;
self.canDelete = isSafeToDelete;
self.changeSaveButton = changeSaveButton;
self.resetSaveButton = resetSaveButton;
self.dataUrl = dataUrl;

self.fetchCaseProperties = function () {
Expand All @@ -56,6 +58,7 @@ hqDefine("data_dictionary/js/data_dictionary", [
const recurseChunks = function (nextUrl) {
$.getJSON(nextUrl, function (data) {
setCaseProperties(data.groups);
self.resetSaveButton();
nextUrl = data._links.next;
if (nextUrl) {
recurseChunks(nextUrl);
Expand Down Expand Up @@ -369,6 +372,10 @@ hqDefine("data_dictionary/js/data_dictionary", [
self.saveButton.fire('change');
};

const resetSaveButton = function () {
self.saveButton.setState('saved');
}

Check failure on line 377 in corehq/apps/data_dictionary/static/data_dictionary/js/data_dictionary.js

View workflow job for this annotation

GitHub Actions / Lint Javascript

Missing semicolon

self.init = function (callback) {
// Get list of case types
$.getJSON(dataUrl, {load_deprecated_case_types: self.showDeprecatedCaseTypes()})
Expand All @@ -382,6 +389,7 @@ hqDefine("data_dictionary/js/data_dictionary", [
data.geo_case_property,
caseTypeData.is_safe_to_delete,
changeSaveButton,
resetSaveButton,
dataUrl
);
self.caseTypes.push(caseTypeObj);
Expand Down

0 comments on commit 042bf8c

Please sign in to comment.