Skip to content

Commit

Permalink
#892 | Included decision concepts and alert message in sync attribute…
Browse files Browse the repository at this point in the history
… dropdown on subject settings
  • Loading branch information
adamsanadi6 committed Dec 5, 2024
1 parent 995e0ec commit 2a116fe
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/adminApp/SubjectType/AdvancedSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export const AdvancedSettings = ({ subjectType, dispatch, locationTypes, formMap
const onSyncConceptChange = (name, value) => {
const syncAttributeChangeMessage =
"Changing sync attributes will ask the users to reset their sync. This might take time depending on the data.";
const decisionConceptSyncAttributeAlert =
"Make sure to set the value of the selected decision concept to sync the subject to mobile app.";
if (includes(syncAttributes.filter(concept => concept.isDecisionConcept).map(concept => concept.value), value)) {
window.confirm(decisionConceptSyncAttributeAlert);
}
if (!isEdit) {
changeSyncAttribute(name, value);
} else if (window.confirm(syncAttributeChangeMessage)) {
Expand All @@ -64,6 +69,11 @@ export const AdvancedSettings = ({ subjectType, dispatch, locationTypes, formMap
}
});
});
forEach(form.decisionConcepts, concept => {
if (includes(syncAttributeDataTypes, concept.dataType)) {
syncAttributes.push({ label: concept.name, value: concept.uuid, isDecisionConcept: true });
}
});
setSyncAttributes(syncAttributes);
});
}
Expand Down

0 comments on commit 2a116fe

Please sign in to comment.