From 1fd4105bda3f43c68109ffcb507a794c13122a8a Mon Sep 17 00:00:00 2001 From: Aditya Agarwal <132701661+adi790uu@users.noreply.github.com> Date: Sun, 10 Dec 2023 22:18:32 +0530 Subject: [PATCH] [#1123] Changes position and text of "All Organizations" button (#1124) * Changes position and text of all organization button * Made changes to the routesReducer.test file * Made changes in IconComponent.test file * Fetched changes from main repo * Fixed unnecessary changes --------- Co-authored-by: Aditya Agarwal --- src/GraphQl/Queries/Queries.ts | 2 +- src/components/IconComponent/IconComponent.test.tsx | 8 ++++---- src/components/IconComponent/IconComponent.tsx | 2 +- src/state/reducers/routesReducer.test.ts | 12 ++++++------ src/state/reducers/routesReducer.ts | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/GraphQl/Queries/Queries.ts b/src/GraphQl/Queries/Queries.ts index 7bf99d48ee..0e3f20918e 100644 --- a/src/GraphQl/Queries/Queries.ts +++ b/src/GraphQl/Queries/Queries.ts @@ -1,6 +1,6 @@ import gql from 'graphql-tag'; -//Query List +// Query List // Check Auth diff --git a/src/components/IconComponent/IconComponent.test.tsx b/src/components/IconComponent/IconComponent.test.tsx index ff83ebe57c..dbcd477b5d 100644 --- a/src/components/IconComponent/IconComponent.test.tsx +++ b/src/components/IconComponent/IconComponent.test.tsx @@ -3,6 +3,10 @@ import { render, screen } from '@testing-library/react'; import IconComponent from './IconComponent'; const screenTestIdMap: Record> = { + AllOrganizations: { + name: 'My Organizations', + testId: 'Icon-Component-AllOrganizationsIcon', + }, Dashboard: { name: 'Dashboard', testId: 'Icon-Component-DashboardIcon', @@ -31,10 +35,6 @@ const screenTestIdMap: Record> = { name: 'Settings', testId: 'Icon-Component-SettingsIcon', }, - AllOrganizations: { - name: 'All Organizations', - testId: 'Icon-Component-AllOrganizationsIcon', - }, EventProject: { name: 'Add Event Project', testId: 'Icon-Component-Add-Event-Project', diff --git a/src/components/IconComponent/IconComponent.tsx b/src/components/IconComponent/IconComponent.tsx index 4c490c9c94..90a60244b5 100644 --- a/src/components/IconComponent/IconComponent.tsx +++ b/src/components/IconComponent/IconComponent.tsx @@ -53,7 +53,7 @@ const iconComponent = (props: InterfaceIconComponent): JSX.Element => { data-testid="Icon-Component-SettingsIcon" /> ); - case 'All Organizations': + case 'My Organizations': return ( { }) ).toEqual({ targets: [ + { name: 'My Organizations', url: '/orglist/id=undefined' }, { name: 'Dashboard', url: '/orgdash/id=undefined' }, { name: 'People', url: '/orgpeople/id=undefined' }, { name: 'Events', url: '/orgevents/id=undefined' }, @@ -30,10 +31,10 @@ describe('Testing Routes reducer', () => { ], }, { name: 'Settings', url: '/orgsetting/id=undefined' }, - { name: 'All Organizations', url: '/orglist/id=undefined' }, ], configUrl: 'undefined', components: [ + { name: 'My Organizations', comp_id: 'orglist', component: 'OrgList' }, { name: 'Dashboard', comp_id: 'orgdash', @@ -70,7 +71,6 @@ describe('Testing Routes reducer', () => { ], }, { name: 'Settings', comp_id: 'orgsetting', component: 'OrgSettings' }, - { name: 'All Organizations', comp_id: 'orglist', component: 'OrgList' }, { name: '', comp_id: 'member', component: 'MemberDetail' }, ], }); @@ -84,6 +84,7 @@ describe('Testing Routes reducer', () => { }) ).toEqual({ targets: [ + { name: 'My Organizations', url: '/orglist/id=undefined' }, { name: 'Dashboard', url: '/orgdash/id=undefined' }, { name: 'People', url: '/orgpeople/id=undefined' }, { name: 'Events', url: '/orgevents/id=undefined' }, @@ -101,11 +102,11 @@ describe('Testing Routes reducer', () => { ], }, { name: 'Settings', url: '/orgsetting/id=undefined' }, - { name: 'All Organizations', url: '/orglist/id=undefined' }, { test: 'testupdate' }, ], configUrl: 'undefined', components: [ + { name: 'My Organizations', comp_id: 'orglist', component: 'OrgList' }, { name: 'Dashboard', comp_id: 'orgdash', @@ -142,7 +143,6 @@ describe('Testing Routes reducer', () => { ], }, { name: 'Settings', comp_id: 'orgsetting', component: 'OrgSettings' }, - { name: 'All Organizations', comp_id: 'orglist', component: 'OrgList' }, { name: '', comp_id: 'member', component: 'MemberDetail' }, ], }); @@ -156,6 +156,7 @@ describe('Testing Routes reducer', () => { }) ).toEqual({ targets: [ + { name: 'My Organizations', url: '/orglist/id=undefined' }, { name: 'Dashboard', url: '/orgdash/id=undefined' }, { name: 'People', url: '/orgpeople/id=undefined' }, { name: 'Events', url: '/orgevents/id=undefined' }, @@ -166,7 +167,6 @@ describe('Testing Routes reducer', () => { }, { name: 'Advertisement', url: '/orgads/id=undefined' }, { name: 'Settings', url: '/orgsetting/id=undefined' }, - { name: 'All Organizations', url: '/orglist/id=undefined' }, { comp_id: null, component: null, @@ -183,6 +183,7 @@ describe('Testing Routes reducer', () => { ], configUrl: 'undefined', components: [ + { name: 'My Organizations', comp_id: 'orglist', component: 'OrgList' }, { name: 'Dashboard', comp_id: 'orgdash', @@ -220,7 +221,6 @@ describe('Testing Routes reducer', () => { ], }, { name: 'Settings', comp_id: 'orgsetting', component: 'OrgSettings' }, - { name: 'All Organizations', comp_id: 'orglist', component: 'OrgList' }, { name: '', comp_id: 'member', component: 'MemberDetail' }, ], }); diff --git a/src/state/reducers/routesReducer.ts b/src/state/reducers/routesReducer.ts index 4fafbd1ebb..7157feb23f 100644 --- a/src/state/reducers/routesReducer.ts +++ b/src/state/reducers/routesReducer.ts @@ -63,6 +63,7 @@ export type TargetsType = { // Note: Routes with names appear on NavBar const components: ComponentType[] = [ + { name: 'My Organizations', comp_id: 'orglist', component: 'OrgList' }, { name: 'Dashboard', comp_id: 'orgdash', component: 'OrganizationDashboard' }, { name: 'People', comp_id: 'orgpeople', component: 'OrganizationPeople' }, { name: 'Events', comp_id: 'orgevents', component: 'OrganizationEvents' }, @@ -84,7 +85,6 @@ const components: ComponentType[] = [ }, { name: 'Settings', comp_id: 'orgsetting', component: 'OrgSettings' }, - { name: 'All Organizations', comp_id: 'orglist', component: 'OrgList' }, { name: '', comp_id: 'member', component: 'MemberDetail' }, ];