Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
peterMuriuki committed Jun 30, 2023
1 parent 4cbc2ca commit ff6f257
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
validationRulesFactory,
} from './utils';
import { formItemLayout, tailLayout } from '@opensrp/react-utils';
import { PractToOrgAssignmentStratey } from '@opensrp/pkg-config';
import { PractToOrgAssignmentStrategy } from '@opensrp/pkg-config';

const { Item: FormItem } = Form;
interface OrganizationFormProps {
Expand All @@ -47,7 +47,7 @@ interface OrganizationFormProps {
practitioners: IPractitioner[];
existingPractitionerRoles: IPractitionerRole[];
allPractitionerRoles: IPractitionerRole[];
configuredPractAssignmentStrategy?: PractToOrgAssignmentStratey;
configuredPractAssignmentStrategy?: PractToOrgAssignmentStrategy;
}

const defaultProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { IPractitionerRole } from '@smile-cdr/fhirts/dist/FHIR-R4/interfaces/IPr
import { getOrgFormFields } from '../utils';
import * as notifications from '@opensrp/notifications';
import userEvents from '@testing-library/user-event';
import { PractToOrgAssignmentStratey } from '@opensrp/pkg-config';
import { PractToOrgAssignmentStrategy } from '@opensrp/pkg-config';

jest.mock('@opensrp/notifications', () => ({
__esModule: true,
Expand Down Expand Up @@ -418,7 +418,7 @@ describe('OrganizationForm', () => {

const props = {
...formProps,
configuredPractAssignmentStrategy: PractToOrgAssignmentStratey.ONE_TO_ONE,
configuredPractAssignmentStrategy: PractToOrgAssignmentStrategy.ONE_TO_ONE,
allPractitionerRoles: getResourcesFromBundle(org105Practitioners),
existingPractitionerRoles: [],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Rule } from 'rc-field-form/lib/interface';
import { v4 } from 'uuid';
import { IPractitioner } from '@smile-cdr/fhirts/dist/FHIR-R4/interfaces/IPractitioner';
import type { TFunction } from '@opensrp/i18n';
import { PractToOrgAssignmentStratey } from '@opensrp/pkg-config';
import { PractToOrgAssignmentStrategy } from '@opensrp/pkg-config';

export interface OrganizationFormFields {
id?: string;
Expand Down Expand Up @@ -181,7 +181,7 @@ export const getPractitionerOptions = (
practitioners: IPractitioner[],
existingPractitionerRoles: IPractitionerRole[],
allPractitionerRoles: IPractitionerRole[],
assignmentStrategy?: PractToOrgAssignmentStratey
assignmentStrategy?: PractToOrgAssignmentStrategy
) => {
let allowedPractitioners = practitioners;
const rolesWithOrganizations = allPractitionerRoles.filter(
Expand All @@ -190,7 +190,7 @@ export const getPractitionerOptions = (
// group allPractitionerRoles by practitioner references
const rolesByPractReference = groupBy(rolesWithOrganizations, 'practitioner.reference');

if (assignmentStrategy && assignmentStrategy === PractToOrgAssignmentStratey.ONE_TO_ONE) {
if (assignmentStrategy && assignmentStrategy === PractToOrgAssignmentStrategy.ONE_TO_ONE) {
allowedPractitioners = allowedPractitioners.filter((pract) => {
const practReference = `${pract.resourceType}/${pract.id}`;
return !rolesByPractReference[practReference] as boolean;
Expand Down
6 changes: 3 additions & 3 deletions packages/pkg-config/src/configStore/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface ConfigState {
opensrpBaseURL?: string;
fhirBaseURL?: string;
defaultTablesPageSize?: number; // static value of the default number of rows per page
practToOrgAssignmentStrategy?: PractToOrgAssignmentStratey;
practToOrgAssignmentStrategy?: PractToOrgAssignmentStrategy;
}

export interface UserPreference {
Expand All @@ -37,7 +37,7 @@ export interface UserPreference {
* It does not imply any relations in the opposite direction i.e. from organization
* to practitioner.
*/
export enum PractToOrgAssignmentStratey {
export enum PractToOrgAssignmentStrategy {
ONE_TO_ONE = 'ONE_TO_ONE', // one practitioner assignable to one organization
ONE_TO_MANY = 'ONE_TO_MANY', // one practitioner assignable to multiple organizations
}
Expand All @@ -51,7 +51,7 @@ const defaultConfigs: GlobalState = {
tablespref: undefined,
defaultTablesPageSize: 5,
projectCode: 'core',
practToOrgAssignmentStrategy: PractToOrgAssignmentStratey.ONE_TO_MANY,
practToOrgAssignmentStrategy: PractToOrgAssignmentStrategy.ONE_TO_MANY,
};

let localstorage: UserPreference = localStorage.getItem(USER_PREFERENCE_KEY)
Expand Down

0 comments on commit ff6f257

Please sign in to comment.