diff --git a/src/adminApp/IdentifierUserAssignment.js b/src/adminApp/IdentifierUserAssignment.js
index 7affa5eec..ed58a110f 100644
--- a/src/adminApp/IdentifierUserAssignment.js
+++ b/src/adminApp/IdentifierUserAssignment.js
@@ -59,9 +59,7 @@ export const IdentifierUserAssignmentDetail = props => {
};
export const UserSelectInput = props => {
- const choices = props.choices.filter(
- choice => choice.name != null && choice.organisationId != null
- );
+ const choices = props.choices.filter(choice => choice.name != null && choice.organisationId != null);
return ;
};
@@ -71,6 +69,7 @@ const IdentifierUserAssignmentForm = props => (
{({ formData, dispatch, ...rest }) => (
(
)}
-
+
);
diff --git a/src/adminApp/Organisation.js b/src/adminApp/Organisation.js
index 893bbf14f..8a1abf7c4 100644
--- a/src/adminApp/Organisation.js
+++ b/src/adminApp/Organisation.js
@@ -253,10 +253,16 @@ export const OrganisationCreate = props => {
if (errorData.includes("organisation_db_user_key")) {
backendError["dbUser"] = `${data.dbUser} is already exist please use other name`;
}
- }
- if (Object.keys(backendError).length !== 0) {
- setErrors(backendError);
- return;
+ if (errorData.includes("organisation_media_directory_key")) {
+ backendError["mediaDirectory"] = `${data.mediaDirectory} is already exist please use other name`;
+ }
+ if (Object.keys(backendError).length !== 0) {
+ setErrors(backendError);
+ return;
+ } else {
+ backendError["other"] = errorData;
+ setErrors(backendError);
+ }
}
}
};
@@ -381,7 +387,9 @@ export const OrganisationCreate = props => {
/>
{errors.statusId && {errors.statusId}}
-
+
+ {errors.other && {errors.other}}
+
diff --git a/src/adminApp/SubjectType/AdvancedSettings.js b/src/adminApp/SubjectType/AdvancedSettings.js
index e580c70ee..42fc8146a 100644
--- a/src/adminApp/SubjectType/AdvancedSettings.js
+++ b/src/adminApp/SubjectType/AdvancedSettings.js
@@ -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)) {
@@ -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);
});
}