Skip to content

Commit

Permalink
Merge pull request #384 from suvarnakale/release-1.0.0
Browse files Browse the repository at this point in the history
Issue #PS-1699 bug: Error When Attempting to Create Duplicate Center- fixed
  • Loading branch information
itsvick authored Nov 11, 2024
2 parents 209355f + 80a4794 commit 7626c6d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 27 deletions.
48 changes: 23 additions & 25 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@
"AND_COUNT_MORE": "and {{count}} more",
"RETURN_TO_LOGIN": "Return to Login",
"NO_CENTER_FOUND": "No Center found",
"FILTER_BY":"Filter By",
"ALL":"All"
"FILTER_BY": "Filter By",
"ALL": "All"
},
"LOGIN_PAGE": {
"USERNAME": "Username",
Expand Down Expand Up @@ -359,6 +359,7 @@
"UNIT_NAME": "Unit Name",
"NOTE": "Note: This will be the center name",
"CENTER_CREATED": "Center created successfully!",
"DUPLICATE_CENTER": "Cohort already exists",
"RENAME_CENTER": "Rename Center",
"REQUEST_TO_DELETE": "Request to Delete",
"RENAME": "Rename",
Expand Down Expand Up @@ -590,27 +591,24 @@
},
"OBSERVATION": {
"OBSERVATION_START": "Start Observation",
"OBSERVATION_DETAILS":"Observation Details",
"ADD_ENTITY":"Add {{entityType}} in observation list",
"SEARCH_ENTITY":"Search {{entityType}} name",
"OBSERVATIONS":"{{name}} Observations",
"SEARCH_OBSERVATIONS":"Search Observations",
"CONTINUE":"Continue",
"SUBMITTED":"Submitted",
"FORM_SAVED_SUCCESSFULLY":"Form changes saved successfully",
"FORM_SUBMIT_SUCCESSFULLY":"Form submitted successfully",
"NOT_STARTED":"Not Started",
"COMPLETED":"Completed",
"INPROGRESS":"In-Progress",
"NO_DATA_FOUND":"No {{entity}} found",
"NO_RESULT_FOUND":"No Observations found for {{entity}}",
"NO_OBSERVATION_EXPIRED":"No observation expired for {{entity}}",
"DAYS_LEFT":"Days left",
"THIS_OBSERVATION_EXPIRED":"This observation is expired",
"DUE_DATE":"Due date",
"SURVEY_FORMS":"Survey forms"


}

"OBSERVATION_DETAILS": "Observation Details",
"ADD_ENTITY": "Add {{entityType}} in observation list",
"SEARCH_ENTITY": "Search {{entityType}} name",
"OBSERVATIONS": "{{name}} Observations",
"SEARCH_OBSERVATIONS": "Search Observations",
"CONTINUE": "Continue",
"SUBMITTED": "Submitted",
"FORM_SAVED_SUCCESSFULLY": "Form changes saved successfully",
"FORM_SUBMIT_SUCCESSFULLY": "Form submitted successfully",
"NOT_STARTED": "Not Started",
"COMPLETED": "Completed",
"INPROGRESS": "In-Progress",
"NO_DATA_FOUND": "No {{entity}} found",
"NO_RESULT_FOUND": "No Observations found for {{entity}}",
"NO_OBSERVATION_EXPIRED": "No observation expired for {{entity}}",
"DAYS_LEFT": "Days left",
"THIS_OBSERVATION_EXPIRED": "This observation is expired",
"DUE_DATE": "Due date",
"SURVEY_FORMS": "Survey Forms"
}
}
7 changes: 5 additions & 2 deletions src/components/center/CreateCenterModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ const CreateCenterModal: React.FC<CreateBlockModalProps> = ({
).values()
);
const cohortData = await createCohort(cohortDetails);
if (cohortData) {
if (cohortData.hasOwnProperty('cohortId')) {
showToastMessage(t('CENTERS.CENTER_CREATED'), 'success');
const telemetryInteract = {
context: {
env: 'teaching-center',
cdata: [],
},
edata: {
id:'create-center-successfully',
id: 'create-center-successfully',
type: Telemetry.CLICK,
subtype: '',
pageid: 'centers',
Expand All @@ -168,6 +168,9 @@ const CreateCenterModal: React.FC<CreateBlockModalProps> = ({
onCenterAdded();
handleClose();
localStorage.removeItem('BMGSData');
} else {
showToastMessage(t('CENTERS.DUPLICATE_CENTER'), 'error');
handleClose();
}
}
};
Expand Down

0 comments on commit 7626c6d

Please sign in to comment.