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

Fixed postion of 'All Organizations' button and changed its name #1208

Merged
merged 3 commits into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions src/components/IconComponent/IconComponent.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const screenTestIdMap: Record<string, Record<string, string>> = {
testId: 'Icon-Component-SettingsIcon',
},
AllOrganizations: {
name: 'All Organizations',
testId: 'Icon-Component-AllOrganizationsIcon',
name: 'My Organizations',
testId: 'Icon-Component-MyOrganizationsIcon',
},
EventProject: {
name: 'Add Event Project',
Expand Down
14 changes: 7 additions & 7 deletions src/components/IconComponent/IconComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ export interface InterfaceIconComponent {

const iconComponent = (props: InterfaceIconComponent): JSX.Element => {
switch (props.name) {
case 'My Organizations':
palisadoes marked this conversation as resolved.
Show resolved Hide resolved
return (
<OrganizationsIcon
stroke={props.fill}
data-testid="Icon-Component-MyOrganizationsIcon"
/>
);
case 'Dashboard':
return (
<DashboardIcon {...props} data-testid="Icon-Component-DashboardIcon" />
Expand Down Expand Up @@ -53,13 +60,6 @@ const iconComponent = (props: InterfaceIconComponent): JSX.Element => {
data-testid="Icon-Component-SettingsIcon"
/>
);
case 'All Organizations':
return (
<OrganizationsIcon
stroke={props.fill}
data-testid="Icon-Component-AllOrganizationsIcon"
/>
);
case 'Add Event Project':
return (
<AddEventProjectIcon
Expand Down
12 changes: 6 additions & 6 deletions src/state/reducers/routesReducer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,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' },
Expand All @@ -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',
Expand Down Expand Up @@ -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' },
],
});
Expand All @@ -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' },
Expand All @@ -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',
Expand Down Expand Up @@ -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' },
],
});
Expand All @@ -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' },
Expand All @@ -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,
Expand All @@ -183,6 +183,7 @@ describe('Testing Routes reducer', () => {
],
configUrl: 'undefined',
components: [
{ name: 'My Organizations', comp_id: 'orglist', component: 'OrgList' },
{
name: 'Dashboard',
comp_id: 'orgdash',
Expand Down Expand Up @@ -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' },
],
});
Expand Down
2 changes: 1 addition & 1 deletion src/state/reducers/routesReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand All @@ -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' },
];

Expand Down