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

Updated the CRUD screens for organizations, for implementation of Address param from Location. #1490

Merged
merged 19 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
18 changes: 18 additions & 0 deletions public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,15 @@
"createSampleOrganization": "Create Sample Organization",
"description": "Description",
"location": "Location",
"address": "Address",
"city": "City",
"countryCode": "Country Code",
"dependentLocality": "Dependent Locality",
"line1": "Line 1",
"line2": "Line 2",
"postalCode": "Postal Code",
"sortingCode": "Sorting code",
"state": "State / Province",
"userRegistrationRequired": "User Registration Required",
"visibleInSearch": "Visible In Search",
"displayImage": "Display Image",
Expand Down Expand Up @@ -486,6 +495,15 @@
"name": "Name",
"description": "Description",
"location": "Location",
"address": "Address",
"city": "City",
"countryCode": "Country Code",
"line1": "Line 1",
"line2": "Line 2",
"postalCode": "Postal Code",
"dependentLocality": "Dependent Locality",
"sortingCode": "Sorting code",
"state": "State / Province",
"displayImage": "Display Image",
"userRegistrationRequired": "User Registration Required",
"isVisibleInSearch": "Visible in Search",
Expand Down
18 changes: 18 additions & 0 deletions public/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@
"createSampleOrganization": "Créer une organisation d'exemple",
"description": "La description",
"location": "Emplacement",
"address": "Adresse",
"city": "Ville",
"countryCode": "Code Pays",
"line1": "Ligne 1",
"line2": "Ligne 2",
"postalCode": "Code Postal",
"dependentLocality": "Localité Dépendante",
"sortingCode": "Code de Tri",
"state": "État / Province",
"userRegistrationRequired": "enregistrement requis",
"visibleInSearch": "Visible dans la recherche",
"displayImage": "Afficher l'image",
Expand Down Expand Up @@ -484,6 +493,15 @@
"name": "Nom",
"description": "La description",
"location": "emplacement",
"address": "Adresse",
"city": "Ville",
"countryCode": "Code Pays",
"line1": "Ligne 1",
"line2": "Ligne 2",
"postalCode": "Code Postal",
"dependentLocality": "Localité Dépendante",
"sortingCode": "Code de Tri",
"state": "État / Province",
"displayImage": "Afficher l'image",
"userRegistrationRequired": "enregistrement requis",
"isVisibleInSearch": "Visible dans la recherche",
Expand Down
18 changes: 18 additions & 0 deletions public/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@
"createSampleOrganization": " सैंपल संगठन बनाएं",
"description": "विवरण",
"location": "स्थान",
"address": "पता",
"city": "शहर",
"countryCode": "देश कोड",
"line1": "लाइन 1",
"line2": "लाइन 2",
"postalCode": "पोस्टल कोड",
"dependentLocality": "आश्रित स्थान",
"sortingCode": "क्रमबद्ध कोड",
"state": "राज्य / प्रांत",
"userRegistrationRequired": "उपयोगकर्ता पंजीकरण आवश्यक",
"visibleInSearch": "खोज में दृश्यमान",
"displayImage": "प्रदर्शन छवि",
Expand Down Expand Up @@ -483,6 +492,15 @@
"name": "नाम",
"description": "विवरण",
"location": "जगह",
"address": "पता",
"city": "शहर",
"countryCode": "देश कोड",
"line1": "लाइन 1",
"line2": "लाइन 2",
"postalCode": "पोस्टल कोड",
"dependentLocality": "आश्रित स्थान",
"sortingCode": "क्रमबद्ध कोड",
"state": "राज्य / प्रांत",
"displayImage": "प्रदर्शन छवि",
"userRegistrationRequired": "उपयोगकर्ता पंजीकरण आवश्यक",
"isVisibleInSearch": "खोज में दिखाए जा सकते हैं",
Expand Down
18 changes: 18 additions & 0 deletions public/locales/sp.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@
"createSampleOrganization": "Crear organización de muestra",
"description": "Descripción",
"location": "Ubicación",
"address": "Dirección",
"city": "Ciudad",
"countryCode": "Código de País",
"line1": "Línea 1",
"line2": "Línea 2",
"postalCode": "Código Postal",
"dependentLocality": "Localidad Dependiente",
"sortingCode": "Código de Ordenamiento",
"state": "Estado / Provincia",
"userRegistrationRequired": "Registro de usuario requerido",
"visibleInSearch": "Visible en la búsqueda",
"displayImage": "Mostrar imagen",
Expand Down Expand Up @@ -483,6 +492,15 @@
"name": "Nombre",
"description": "Descripción",
"location": "ubicación",
"address": "Dirección",
"city": "Ciudad",
"countryCode": "Código de País",
"line1": "Línea 1",
"line2": "Línea 2",
"postalCode": "Código Postal",
"dependentLocality": "Localidad Dependiente",
"sortingCode": "Código de Ordenamiento",
"state": "Estado / Provincia",
"displayImage": "Mostrar imagen",
"userRegistrationRequired": "Registro de usuario requerido",
"isVisibleInSearch": "Visible en la búsqueda",
Expand Down
18 changes: 18 additions & 0 deletions public/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@
"createSampleOrganization": "创建示范组织",
"description": "描述",
"location": "地點",
"address": "地址",
"city": "城市",
"countryCode": "国家代码",
"line1": "地址行 1",
"line2": "地址行 2",
"postalCode": "邮政编码",
"dependentLocality": "从属地区",
"sortingCode": "排序代码",
"state": "省 / 直辖市",
"isPubluserRegistrationRequiredic": "需要用户注册",
"visibleInSearch": "在搜索中可見",
"displayImage": "顯示圖像",
Expand Down Expand Up @@ -483,6 +492,15 @@
"name": "姓名",
"description": "描述",
"location": "地點",
"address": "地址",
"city": "城市",
"countryCode": "国家代码",
"line1": "地址行 1",
"line2": "地址行 2",
"postalCode": "邮政编码",
"dependentLocality": "从属地区",
"sortingCode": "排序代码",
"state": "省 / 直辖市",
"displayImage": "顯示圖像",
"userRegistrationRequired": "需要用户注册",
"isVisibleInSearch": "在搜索中可见",
Expand Down
22 changes: 18 additions & 4 deletions src/GraphQl/Mutations/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const UPDATE_ORGANIZATION_MUTATION = gql`
$id: ID!
$name: String
$description: String
$location: String
$address: AddressInput
$userRegistrationRequired: Boolean
$visibleInSearch: Boolean
$file: String
Expand All @@ -57,7 +57,7 @@ export const UPDATE_ORGANIZATION_MUTATION = gql`
description: $description
userRegistrationRequired: $userRegistrationRequired
visibleInSearch: $visibleInSearch
location: $location
address: $address
}
file: $file
) {
Expand All @@ -66,6 +66,20 @@ export const UPDATE_ORGANIZATION_MUTATION = gql`
}
`;

// fragment for defining the Address input type.
export const ADDRESS_DETAILS_FRAGMENT = gql`
fragment AddressDetails on AddressInput {
city: String
countryCode: String
dependentLocality: String
line1: String
line2: String
postalCode: String
sortingCode: String
state: String
}
`;

// to update the details of the user

export const UPDATE_USER_MUTATION = gql`
Expand Down Expand Up @@ -178,7 +192,7 @@ export const RECAPTCHA_MUTATION = gql`
export const CREATE_ORGANIZATION_MUTATION = gql`
mutation CreateOrganization(
$description: String!
$location: String!
$address: AddressInput!
$name: String!
$visibleInSearch: Boolean!
$userRegistrationRequired: Boolean!
Expand All @@ -187,7 +201,7 @@ export const CREATE_ORGANIZATION_MUTATION = gql`
createOrganization(
data: {
description: $description
location: $location
address: $address
name: $name
visibleInSearch: $visibleInSearch
userRegistrationRequired: $userRegistrationRequired
Expand Down
55 changes: 50 additions & 5 deletions src/GraphQl/Queries/Queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,16 @@ export const ORGANIZATION_LIST = gql`
_id
}
createdAt
location
address {
city
countryCode
dependentLocality
line1
line2
postalCode
sortingCode
state
}
}
}
`;
Expand Down Expand Up @@ -67,7 +76,16 @@ export const ORGANIZATION_CONNECTION_LIST = gql`
_id
}
createdAt
location
address {
city
countryCode
dependentLocality
line1
line2
postalCode
sortingCode
state
}
}
}
`;
Expand Down Expand Up @@ -103,7 +121,16 @@ export const USER_LIST = gql`
_id
name
image
location
address {
city
countryCode
dependentLocality
line1
line2
postalCode
sortingCode
state
}
createdAt
creator {
_id
Expand All @@ -118,7 +145,16 @@ export const USER_LIST = gql`
_id
name
image
location
address {
city
countryCode
dependentLocality
line1
line2
postalCode
sortingCode
state
}
createdAt
creator {
_id
Expand Down Expand Up @@ -252,7 +288,16 @@ export const ORGANIZATIONS_LIST = gql`
}
name
description
location
address {
city
countryCode
dependentLocality
line1
line2
postalCode
sortingCode
state
}
userRegistrationRequired
visibleInSearch
members {
Expand Down
11 changes: 10 additions & 1 deletion src/components/Advertisements/Advertisements.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,16 @@ const ORGANIZATIONS_LIST_MOCK = {
userRegistrationRequired: true,

visibleInSearch: true,
location: 'location',
address: {
city: 'Kingston',
countryCode: 'JM',
dependentLocality: 'Sample Dependent Locality',
line1: '123 Jamaica Street',
line2: 'Apartment 456',
postalCode: 'JM12345',
sortingCode: 'ABC-123',
state: 'Kingston Parish',
},
members: {
_id: 'id',
firstName: 'firstName',
Expand Down
22 changes: 20 additions & 2 deletions src/components/LeftDrawerOrg/LeftDrawerOrg.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,16 @@ const MOCKS = [
},
name: 'Test Organization',
description: 'Testing this organization',
location: 'Gotham, DC',
address: {
city: 'Delhi',
countryCode: 'IN',
dependentLocality: 'Some Dependent Locality',
line1: '123 Random Street',
line2: 'Apartment 456',
postalCode: '110001',
sortingCode: 'ABC-123',
state: 'Delhi',
},
userRegistrationRequired: true,
visibleInSearch: true,
members: [
Expand Down Expand Up @@ -142,7 +151,16 @@ const MOCKS_WITH_IMAGE = [
},
name: 'Test Organization',
description: 'Testing this organization',
location: 'Gotham, DC',
address: {
city: 'Delhi',
countryCode: 'IN',
dependentLocality: 'Some Dependent Locality',
line1: '123 Random Street',
line2: 'Apartment 456',
postalCode: '110001',
sortingCode: 'ABC-123',
state: 'Delhi',
},
userRegistrationRequired: true,
visibleInSearch: true,
members: [
Expand Down
5 changes: 4 additions & 1 deletion src/components/LeftDrawerOrg/LeftDrawerOrg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ const leftDrawerOrg = ({
<div className={styles.profileText}>
<span className={styles.primaryText}>{organization.name}</span>
<span className={styles.secondaryText}>
{organization.location}
{organization.address.city}, {organization.address.state}
<br />
{organization.address.postalCode},{' '}
{organization.address.countryCode}
</span>
</div>
</button>
Expand Down
13 changes: 11 additions & 2 deletions src/components/OrgListCard/OrgListCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ const props: InterfaceOrgListCardProps = {
_id: 'xyz',
name: 'Dogs Care',
image: 'https://api.dicebear.com/5.x/initials/svg?seed=John%20Doe',
location: 'India',
address: {
city: 'Sample City',
countryCode: 'US',
dependentLocality: 'Sample Dependent Locality',
line1: '123 Sample Street',
line2: 'Apartment 456',
postalCode: '12345',
sortingCode: 'ABC-123',
state: 'Sample State',
},
admins: [
{
_id: '123',
Expand Down Expand Up @@ -68,7 +77,7 @@ describe('Testing the Super Dash List', () => {
expect(screen.getByText('Admins:')).toBeInTheDocument();
expect(screen.getByText('Members:')).toBeInTheDocument();
expect(screen.getByText('Dogs Care')).toBeInTheDocument();
expect(screen.getByText('India')).toBeInTheDocument();
expect(screen.getByText(/Sample City/i)).toBeInTheDocument();
userEvent.click(screen.getByTestId(/manageBtn/i));
});

Expand Down
Loading
Loading