Skip to content

Commit

Permalink
new changes before pulling 9813187
Browse files Browse the repository at this point in the history
  • Loading branch information
vedfordev committed Dec 11, 2024
2 parents 9813187 + 892d9ac commit 12cafb8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
11 changes: 3 additions & 8 deletions src/adminApp/IdentifierUserAssignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <AutocompleteInput {...props} choices={choices} optionText="name" />;
};

Expand All @@ -71,6 +69,7 @@ const IdentifierUserAssignmentForm = props => (
{({ formData, dispatch, ...rest }) => (
<Fragment>
<ReferenceInput
perPage={10}
source="userId"
reference="user"
label="Which user?"
Expand Down Expand Up @@ -104,11 +103,7 @@ const IdentifierUserAssignmentForm = props => (
</Fragment>
)}
</AvniFormDataConsumer>
<AvniTextInput
source="identifierStart"
required
toolTipKey={"ADMIN_IDENTIFIER_ASSIGNMENT_START"}
/>
<AvniTextInput source="identifierStart" required toolTipKey={"ADMIN_IDENTIFIER_ASSIGNMENT_START"} />
<AvniTextInput source="identifierEnd" required toolTipKey={"ADMIN_IDENTIFIER_ASSIGNMENT_END"} />
</SimpleForm>
);
Expand Down
18 changes: 13 additions & 5 deletions src/adminApp/Organisation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
};
Expand Down Expand Up @@ -381,7 +387,9 @@ export const OrganisationCreate = props => {
/>
{errors.statusId && <FormHelperText error>{errors.statusId}</FormHelperText>}
</Grid>

<Grid item xs={6}>
{errors.other && <FormHelperText error>{errors.other}</FormHelperText>}
</Grid>
<Grid container item sm={12}>
<Grid item sm={2}>
<SaveComponent name="save" onSubmit={handleSubmit} styleClass={{ marginTop: "10px" }} />
Expand Down
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 12cafb8

Please sign in to comment.