From 2a116fe739c9d6eb658c455befdb568a83ead7af Mon Sep 17 00:00:00 2001 From: ADAM M SANADI Date: Thu, 5 Dec 2024 16:44:40 +0530 Subject: [PATCH 1/3] #892 | Included decision concepts and alert message in sync attribute dropdown on subject settings --- src/adminApp/SubjectType/AdvancedSettings.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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); }); } From 0781cb748324d0bcf64a7d23526ba511f3f3b5de Mon Sep 17 00:00:00 2001 From: vedfordev Date: Thu, 5 Dec 2024 18:06:10 +0530 Subject: [PATCH 2/3] avniproject/avni-webapp#1289 | fix: handling mediaDirectory error --- src/adminApp/Organisation.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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}} + From 892d9ac4b47b89f89df9a22aef8f71a4b26b62c4 Mon Sep 17 00:00:00 2001 From: Joy A Date: Wed, 11 Dec 2024 11:24:44 +0530 Subject: [PATCH 3/3] #0 | Quick fix to IdentifierUserAssginment user list to unblock testing of other cards --- src/adminApp/IdentifierUserAssignment.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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 }) => ( ( )} - + );