Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor teams to organizations #1537

Merged
merged 3 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ export const HealthCareAddEdit = (props: HealthCareAddEditProps) => {
const initialValues = getHealthCareFormFields(healthCareService.data);

const pageTitle = healthCareService.data
? t('Edit team | {{name}}', { name: healthCareService.data.name ?? '' })
: t('Create team');
? t('Edit organization | {{name}}', { name: healthCareService.data.name ?? '' })
: t('Create organization');
const headerProps = {
pageHeaderProps: {
title: pageTitle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ const OrganizationForm = (props: OrganizationFormProps) => {
</FormItem>

<FormItem name={name} rules={validationRules.name} id="name" label={t('Name')}>
<Input placeholder={t('Enter team name')} />
<Input placeholder={t('Enter organization name')} />
</FormItem>

<FormItem name={alias} rules={validationRules.alias} id="alias" label={t('Alias')}>
<Input placeholder={t('Enter team alias')} />
<Input placeholder={t('Enter organization alias')} />
</FormItem>

<FormItem id="status" name={active} label="Status" rules={validationRules.status}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ export const AddEditOrganization = (props: AddEditOrganizationProps) => {
const initialValues = getOrgFormFields(organization.data, assignedPractitionerRoles);

const pageTitle = organization.data
? t('Edit team | {{teamName}}', { teamName: organization.data.name ?? '' })
: t('Create team');
? t('Edit organization | {{teamName}}', { teamName: organization.data.name ?? '' })
: t('Create organization');
const headerProps = {
pageHeaderProps: {
title: pageTitle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exports[`OrganizationForm renders correctly: alias field 1`] = `
onChange={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
placeholder="Enter team alias"
placeholder="Enter organization alias"
style={Object {}}
type="text"
value=""
Expand Down Expand Up @@ -135,7 +135,7 @@ exports[`OrganizationForm renders correctly: name field 1`] = `
onChange={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
placeholder="Enter team name"
placeholder="Enter organization name"
style={Object {}}
type="text"
value=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`renders correctly for edit locations: alias field 1`] = `
<input
class="ant-input css-dev-only-do-not-override-k7429z"
id="alias"
placeholder="Enter team alias"
placeholder="Enter organization alias"
type="text"
value=""
/>
Expand All @@ -15,7 +15,7 @@ exports[`renders correctly for edit locations: name field 1`] = `
aria-required="true"
class="ant-input css-dev-only-do-not-override-k7429z"
id="name"
placeholder="Enter team name"
placeholder="Enter organization name"
type="text"
value="OpenSRP web Test Organisation"
/>
Expand All @@ -25,7 +25,7 @@ exports[`renders correctly for new organizations: alias field 1`] = `
<input
class="ant-input css-dev-only-do-not-override-k7429z"
id="alias"
placeholder="Enter team alias"
placeholder="Enter organization alias"
type="text"
value=""
/>
Expand All @@ -36,7 +36,7 @@ exports[`renders correctly for new organizations: name field 1`] = `
aria-required="true"
class="ant-input css-dev-only-do-not-override-k7429z"
id="name"
placeholder="Enter team name"
placeholder="Enter organization name"
type="text"
value=""
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ test('renders correctly for edit locations', async () => {
expect(nock.pendingMocks()).toEqual([]);

await waitFor(() => {
expect(screen.getByText('Edit team | OpenSRP web Test Organisation')).toBeInTheDocument();
expect(
screen.getByText('Edit organization | OpenSRP web Test Organisation')
).toBeInTheDocument();
});

// some small but incoclusive proof that the form rendered and has some initial values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const AffiliationModal = (props: AffiliationModalProps) => {
{
onError: (err: Error) => sendErrorNotification(err.message),
onSuccess: () => {
sendSuccessNotification(t('Team assignments updated successfully'));
sendSuccessNotification(t('Organization assignments updated successfully'));
handleCancel();
queryClient.refetchQueries([organizationAffiliationResourceType]).catch(() => {
sendInfoNotification(
Expand All @@ -92,7 +92,7 @@ export const AffiliationModal = (props: AffiliationModalProps) => {
return (
<Modal
destroyOnClose={true}
title={t(`Assign/Unassign Teams | {{locationName}}`, { locationName })}
title={t(`Assign/Unassign Organizations | {{locationName}}`, { locationName })}
open={visible}
okText="Save"
onCancel={handleCancel}
Expand Down Expand Up @@ -126,7 +126,7 @@ export const AffiliationModal = (props: AffiliationModalProps) => {
mode="multiple"
allowClear
showSearch
placeholder={t('Select teams')}
placeholder={t('Select organizations')}
options={orgSelectOptions}
defaultValue={defaultOrgsValues as unknown as string[]}
filterOption={orgsFilterFunction}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ const AffiliationTable: React.FC<Props> = (props: Props) => {

if ((affiliationsError && !affiliationsData) || (orgsError && !orgsData)) {
return (
<BrokenPage errorMessage={t('Unable to load teams or teams assignments at the moment')} />
<BrokenPage
errorMessage={t('Unable to load organizations or their assignments at the moment')}
/>
);
}

Expand All @@ -107,7 +109,7 @@ const AffiliationTable: React.FC<Props> = (props: Props) => {
dataIndex: 'name',
},
{
title: t('Assigned teams'),
title: t('Assigned organizations'),
render: (_, record) => {
const { id } = record;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const AffiliationList: React.FC<LocationUnitListProps> = (props: Location
tableNodes = [selectedNode, ...sortedNodes];
}

const pageTitle = t('Team Assignment');
const pageTitle = t('Assign Organizations to Locations');
const headerProps = {
pageHeaderProps: {
title: pageTitle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ test('Edits organization affiliation correctly', async () => {
fireEvent.click(submitBtn);

await waitFor(() => {
expect(successMock).toHaveBeenCalledWith('Team assignments updated successfully');
expect(successMock).toHaveBeenCalledWith('Organization assignments updated successfully');
expect(screen.queryByText(/Assign\/Unassign Teams/i)).not.toBeInTheDocument();
});

Expand Down Expand Up @@ -272,7 +272,7 @@ test('Edits organization affiliation correctly', async () => {
expect(nock.isDone()).toBeTruthy();

await waitFor(() => {
expect(successMock).toHaveBeenCalledWith('Team assignments updated successfully');
expect(successMock).toHaveBeenCalledWith('Organization assignments updated successfully');
});

unmount();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const OrganizationList = (props: OrganizationListProps) => {

const columns = [
{
title: t('Team name'),
title: t('Organization name'),
dataIndex: 'name' as const,
key: 'name' as const,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ exports[`renders correctly when listing organizations: single key value pairs de
class="singleKeyValue-pair__default"
>
<dt>
Team id
Organization id
</dt>
<dd>
205
Expand All @@ -89,7 +89,7 @@ exports[`renders correctly when listing organizations: single key value pairs de
class="singleKeyValue-pair__default"
>
<dt>
Team identifier
Organization identifier
</dt>
<dd>
205
Expand All @@ -102,7 +102,7 @@ exports[`renders correctly when listing organizations: single key value pairs de
class="singleKeyValue-pair__default"
>
<dt>
Team status
Organization status
</dt>
<dd>
Active
Expand All @@ -115,7 +115,7 @@ exports[`renders correctly when listing organizations: single key value pairs de
class="singleKeyValue-pair__default"
>
<dt>
Team practitioners
Organization practitioners
</dt>
<dd>
<ul
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const ViewDetails = (props: ViewDetailsProps) => {
const assignedLocations = FindAssignedLocations(affiliationsData ?? [], id);

const practitionerKeyValues = {
[t('Team practitioners')]: (
[t('Organization practitioners')]: (
<ul id="practitioner-teams">
{(assignedPractitioners ?? []).map((practitioner) => {
const officialNames = getObjLike(practitioner.name, 'use', IdentifierUseCodes.OFFICIAL);
Expand All @@ -151,9 +151,9 @@ export const ViewDetails = (props: ViewDetailsProps) => {
};

const organizationKeyValues = {
[t('Team id')]: id,
[t('Team identifier')]: identifier,
[t('Team status')]: active ? t('Active') : t('Disabled'),
[t('Organization id')]: id,
[t('Organization identifier')]: identifier,
[t('Organization status')]: active ? t('Active') : t('Disabled'),
};

return (
Expand Down
38 changes: 12 additions & 26 deletions packages/i18n/locales/core/app/en.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,26 @@
{
"404!": "",
"Active": "",
"Add inventory via CSV": "",
"Administration": "",
"An error occurred": "",
"Card Support": "",
"All Locations": "",
"Care Teams Management": "",
"Complete": "",
"District report": "",
"Download Client Data": "",
"Draft": "",
"Draft Files": "",
"Form Configuration": "",
"Group management": "",
"Commodity Management": "",
"Data Imports": "",
"Group Management": "",
"Healthcare Services": "",
"Inventory": "",
"JSON Validators": "",
"Location Management": "",
"Location Unit Group": "",
"Hierarchy": "",
"Location Management": "",
"Login": "",
"Logout": "",
"Manage account": "",
"Manifest Releases": "",
"Missing the required permissions to view data on this page": "",
"OpenSRP Web": "",
"Organization Assignment": "",
"Organization Management": "",
"Organizations": "",
"Patients": "",
"Plans": "",
"Product Catalogue": "",
"Questionnaire": "",
"Reports": "",
"Retired": "",
"Server Settings": "",
"Service point inventory": "",
"Team Assignment": "",
"Team Management": "",
"Teams": "",
"Questionnaire Management": "",
"Service Points Inventory": "",
"There was a problem logging out. Please try again.": "",
"User Groups": "",
"User Management": "",
"User Roles": "",
Expand Down
24 changes: 18 additions & 6 deletions packages/i18n/locales/core/fhir-care-team/en.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
{
"Actions": "",
"Active": "",
"An error occurred": "",
"Are you sure you want to delete this Care Team?": "",
"Cancel": "",
"Care Team not found": "",
"CareTeam ID": "",
"Create Care Team": "",
"Delete": "",
"Edit": "",
"Edit Care Team | {{name}}": "",
"Fetching Care team": "",
"FHIR Care Team": "",
"ID": "",
"Identifier": "",
"Inactive": "",
"Managing organizations": "",
"Name": "",
"Name is Required": "",
"No": "",
"Participant": "",
"No managing organizations found": "",
"Participants": "",
"Practitioner Participant": "",
"Save": "",
"Saving": "",
"Select a managing Organization": "",
"Select one or more managing organizations": "",
"Select practitioners to assign to this Care Team": "",
"status": "",
"Status": "",
"Subject": "",
"Successfully Added Care Teams": "",
"Successfully added CareTeams": "",
"Successfully Deleted Care Team": "",
"Successfully Updated Care Teams": "",
"This is a required field": "",
"Successfully updated CareTeams": "",
"There was a problem creating the Care Team": "",
"There was a problem deleting the Care Team": "",
"There was a problem fetching the Care Team": "",
"There was a problem updating the Care Team": "",
"UUID": "",
"Yes": ""
}
Loading