diff --git a/src/components/OrgListCard/OrgListCard.spec.tsx b/src/components/OrgListCard/OrgListCard.spec.tsx index 1538d0f802..7e8c76f85b 100644 --- a/src/components/OrgListCard/OrgListCard.spec.tsx +++ b/src/components/OrgListCard/OrgListCard.spec.tsx @@ -54,12 +54,11 @@ const props: InterfaceOrgListCardPropsPG = { id: 'xyz', name: 'Dogs Care', avatarURL: 'https://api.dicebear.com/5.x/initials/svg?seed=John%20Doe', - description: "Dog care center", + description: 'Dog care center', members: { - edges: [ - ] + edges: [], }, - addressLine1: "Texas, USA" + addressLine1: 'Texas, USA', }, }; diff --git a/src/components/OrgListCard/OrgListCard.tsx b/src/components/OrgListCard/OrgListCard.tsx index d1e7e6e831..1903dce465 100644 --- a/src/components/OrgListCard/OrgListCard.tsx +++ b/src/components/OrgListCard/OrgListCard.tsx @@ -37,7 +37,8 @@ export interface InterfaceOrgListCardPropsPG { */ function orgListCard(props: InterfaceOrgListCardPropsPG): JSX.Element { // Destructure data from props - const { id, avatarURL, addressLine1, name, description, members } = props.data; + const { id, avatarURL, addressLine1, name, description, members } = + props.data; // Query to check if the organization is a sample organization const { data } = useQuery(IS_SAMPLE_ORGANIZATION_QUERY, { @@ -63,7 +64,6 @@ function orgListCard(props: InterfaceOrgListCardPropsPG): JSX.Element { // Handle click event to navigate to the organization dashboard function handleClick(): void { // const url = '/orgdash/' + id; - // Dont change the below two lines // navigate(url); } @@ -97,17 +97,13 @@ function orgListCard(props: InterfaceOrgListCardPropsPG): JSX.Element { {/* Description of the organization */}
- +
{/* Display the organization address if available */} {addressLine1 && (
- +
)} {/* Display the number of admins and members */} diff --git a/src/components/ProfileDropdown/ProfileDropdown.spec.tsx b/src/components/ProfileDropdown/ProfileDropdown.spec.tsx index f1b408e05e..06e3b4331a 100644 --- a/src/components/ProfileDropdown/ProfileDropdown.spec.tsx +++ b/src/components/ProfileDropdown/ProfileDropdown.spec.tsx @@ -99,7 +99,7 @@ describe('ProfileDropdown Component', () => { }); test('renders Super admin', () => { - setItem('role', "API Administrator"); + setItem('role', 'API Administrator'); render( @@ -110,7 +110,7 @@ describe('ProfileDropdown Component', () => { expect(screen.getByText('API Administrator')).toBeInTheDocument(); }); test('renders Admin', () => { - setItem('role', "administrator"); + setItem('role', 'administrator'); render( @@ -141,7 +141,7 @@ describe('ProfileDropdown Component', () => { describe('Member screen routing testing', () => { test('member screen', async () => { - setItem('role', "regular") + setItem('role', 'regular'); render( @@ -166,7 +166,7 @@ describe('ProfileDropdown Component', () => { }); test('navigates to /user/settings for a user', async () => { - setItem('role', "regular"); + setItem('role', 'regular'); render( diff --git a/src/screens/LoginPage/LoginPage.tsx b/src/screens/LoginPage/LoginPage.tsx index 3d858383d0..6b25c0376e 100644 --- a/src/screens/LoginPage/LoginPage.tsx +++ b/src/screens/LoginPage/LoginPage.tsx @@ -302,8 +302,8 @@ const loginPage = (): JSX.Element => { setItem('IsLoggedIn', 'TRUE'); setItem('name', user.name); setItem('email', user.emailAddress); - setItem('role', user.role) - setItem('UserImage', user.avatraURL|| "") + setItem('role', user.role); + setItem('UserImage', user.avatraURL || ''); // setItem('FirstName', user.firstName); // setItem('LastName', user.lastName); // setItem('UserImage', user.avatarURL); diff --git a/src/screens/OrgList/OrgList.spec.tsx b/src/screens/OrgList/OrgList.spec.tsx index 684d33b455..e9a764006c 100644 --- a/src/screens/OrgList/OrgList.spec.tsx +++ b/src/screens/OrgList/OrgList.spec.tsx @@ -145,7 +145,7 @@ describe('Organisations Page testing as SuperAdmin', () => { test('Should render no organisation warning alert when there are no organization', async () => { window.location.assign('/'); setItem('id', '123'); - setItem('role', "administrator"); + setItem('role', 'administrator'); render( @@ -168,7 +168,7 @@ describe('Organisations Page testing as SuperAdmin', () => { test('Testing Organization data is not present', async () => { setItem('id', '123'); - setItem('role', "administrator"); + setItem('role', 'administrator'); render( diff --git a/src/screens/OrgList/OrgList.tsx b/src/screens/OrgList/OrgList.tsx index c106703b96..fb00e27c1a 100644 --- a/src/screens/OrgList/OrgList.tsx +++ b/src/screens/OrgList/OrgList.tsx @@ -21,7 +21,7 @@ import { errorHandler } from 'utils/errorHandler'; import type { InterfaceCurrentUserTypePG, InterfaceOrgConnectionInfoType, - InterfaceOrgConnectionTypePG + InterfaceOrgConnectionTypePG, } from 'utils/interfaces'; import useLocalStorage from 'utils/useLocalstorage'; import styles from '../../style/app.module.css'; @@ -158,7 +158,6 @@ function orgList(): JSX.Element { notifyOnNetworkStatusChange: true, }); - const orgsData = UsersOrgsData?.user.organizationsWhereMember; // To clear the search field and form fields on unmount @@ -308,13 +307,19 @@ function orgList(): JSX.Element { skip: orgsData?.edges?.length || 0, }, updateQuery: ( - prev: { organizationsConnection: InterfaceOrgConnectionTypePG[] } | undefined, + prev: + | { organizationsConnection: InterfaceOrgConnectionTypePG[] } + | undefined, { fetchMoreResult, }: { - fetchMoreResult: { organizationsConnection: InterfaceOrgConnectionTypePG[] } | undefined; + fetchMoreResult: + | { organizationsConnection: InterfaceOrgConnectionTypePG[] } + | undefined; }, - ): { organizationsConnection: InterfaceOrgConnectionTypePG[] } | undefined => { + ): + | { organizationsConnection: InterfaceOrgConnectionTypePG[] } + | undefined => { setIsLoadingMore(false); if (!fetchMoreResult) return prev; if (fetchMoreResult.organizationsConnection.length < perPageResult) { diff --git a/src/screens/OrgList/OrgListMocks.ts b/src/screens/OrgList/OrgListMocks.ts index a2a5413631..84330dc295 100644 --- a/src/screens/OrgList/OrgListMocks.ts +++ b/src/screens/OrgList/OrgListMocks.ts @@ -34,49 +34,47 @@ const organizations: InterfaceOrgConnectionInfoTypePG[] = [ id: 'xyz', name: 'Dogs Care', avatarURL: 'https://api.dicebear.com/5.x/initials/svg?seed=John%20Doe', - description: "Dog care center", + description: 'Dog care center', members: { - edges: [ - - ] + edges: [], }, - addressLine1: "Texas, USA" + addressLine1: 'Texas, USA', }, ]; -for (let x = 0; x < 1; x++) { - organizations.push({ - _id: 'a' + x, - image: '', - name: 'name', - creator: { - _id: '123', - firstName: 'firstName', - lastName: 'lastName', - }, - admins: [ - { - _id: x + '1', - }, - ], - members: [ - { - _id: x + '2', - }, - ], - createdAt: new Date().toISOString(), - address: { - city: 'Kingston', - countryCode: 'JM', - dependentLocality: 'Sample Dependent Locality', - line1: '123 Jamaica Street', - line2: 'Apartment 456', - postalCode: 'JM12345', - sortingCode: 'ABC-123', - state: 'Kingston Parish', - }, - }); -} +// for (let x = 0; x < 1; x++) { +// organizations.push({ +// _id: 'a' + x, +// image: '', +// name: 'name', +// creator: { +// _id: '123', +// firstName: 'firstName', +// lastName: 'lastName', +// }, +// admins: [ +// { +// _id: x + '1', +// }, +// ], +// members: [ +// { +// _id: x + '2', +// }, +// ], +// createdAt: new Date().toISOString(), +// address: { +// city: 'Kingston', +// countryCode: 'JM', +// dependentLocality: 'Sample Dependent Locality', +// line1: '123 Jamaica Street', +// line2: 'Apartment 456', +// postalCode: 'JM12345', +// sortingCode: 'ABC-123', +// state: 'Kingston Parish', +// }, +// }); +// } // MOCKS FOR SUPERADMIN const MOCKS = [ diff --git a/src/screens/OrgList/OrganizationModal.tsx b/src/screens/OrgList/OrganizationModal.tsx index 860cf63ea7..888a835d6e 100644 --- a/src/screens/OrgList/OrganizationModal.tsx +++ b/src/screens/OrgList/OrganizationModal.tsx @@ -3,7 +3,10 @@ import { Modal, Form, Row, Col, Button } from 'react-bootstrap'; import convertToBase64 from 'utils/convertToBase64'; import type { ChangeEvent } from 'react'; import styles from '../../style/app.module.css'; -import type { InterfaceAddress, InterfaceCurrentUserTypePG } from 'utils/interfaces'; +import type { + InterfaceAddress, + InterfaceCurrentUserTypePG, +} from 'utils/interfaces'; import { countryOptions } from 'utils/formEnumFields'; import useLocalStorage from 'utils/useLocalstorage'; @@ -39,7 +42,6 @@ interface InterfaceFormStateType { image: string; } - /** * Represents the properties of the OrganizationModal component. */