Skip to content

Commit

Permalink
Fixed postion of 'All Organizations' button and changed its name (Pal…
Browse files Browse the repository at this point in the history
…isadoesFoundation#1208)

* Fixed postion of 'All Organizations' button and changed its name

* Changed 'Organizations' to 'My Organizations' and added translations

* fixed 'My Organizations' icon

---------

Co-authored-by: Aditya Agarwal <[email protected]>
  • Loading branch information
2 people authored and aialok committed Dec 25, 2023
1 parent 683556f commit 1d6d856
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 34 deletions.
4 changes: 2 additions & 2 deletions public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"leftDrawer": {
"talawaAdminPortal": "Talawa Admin Portal",
"menu": "Menu",
"organizations": "Organizations",
"my organizations": "My Organizations",
"requests": "Requests",
"users": "Users",
"logout": "Logout"
Expand Down Expand Up @@ -84,7 +84,7 @@
"designation": "Designation",
"email": "Email",
"searchByName": "Search By Name",
"organizations": "Organizations",
"my organizations": "My Organizations",
"createOrganization": "Create Organization",
"createSampleOrganization": "Create Sample Organization",
"description": "Description",
Expand Down
4 changes: 2 additions & 2 deletions public/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"leftDrawer": {
"talawaAdminPortal": "Portail d'administration Talawa",
"menu": "Menu",
"organizations": "Organisations",
"my organizations": "Mes Organisations",
"requests": "Demandes",
"users": "Utilisateurs",
"logout": "Déconnexion"
Expand Down Expand Up @@ -78,7 +78,7 @@
"designation": "La désignation",
"email": "E-mail",
"searchByName": "Rechercher par nom",
"organizations": "Organisations",
"my organizations": "Mes Organisations",
"createOrganization": "Créer une organisation",
"createSampleOrganization": "Créer une organisation d'exemple",
"description": "La description",
Expand Down
4 changes: 2 additions & 2 deletions public/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"leftDrawer": {
"talawaAdminPortal": "तलावा व्यवस्थापक पोर्टल",
"menu": "मेन्यू",
"organizations": "संगठन",
"my organizations": "मेरे संगठन",
"requests": "अनुरोध",
"users": "उपयोगकर्ता",
"logout": "लॉग आउट"
Expand Down Expand Up @@ -78,7 +78,7 @@
"designation": "पद",
"email": "ईमेल",
"searchByName": "नाम से खोजें",
"organizations": "संगठन",
"my organizations": "मेरे संगठन",
"createOrganization": "संगठन बनाएं",
"createSampleOrganization": " सैंपल संगठन बनाएं",
"description": "विवरण",
Expand Down
4 changes: 2 additions & 2 deletions public/locales/sp.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"leftDrawer": {
"talawaAdminPortal": "Portal de administración de Talawa",
"menu": "Menú",
"organizations": "Organizaciones",
"my organizations": "Mis Organizaciones",
"requests": "Solicitudes",
"users": "Usuarios",
"logout": "Cerrar sesión"
Expand Down Expand Up @@ -78,7 +78,7 @@
"designation": "Designacion",
"email": "Correo electrónico",
"searchByName": "Buscar por nombre",
"organizations": "Organizaciones",
"my organizations": "Mis Organizaciones.",
"createOrganization": "Crear organización",
"createSampleOrganization": "Crear organización de muestra",
"description": "Descripción",
Expand Down
4 changes: 2 additions & 2 deletions public/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"leftDrawer": {
"talawaAdminPortal": "塔拉瓦管理门户",
"menu": "菜单",
"organizations": "组织",
"my organizations": "我的组织",
"requests": "请求",
"users": "用户",
"logout": "退出登录"
Expand Down Expand Up @@ -78,7 +78,7 @@
"designation": "指定",
"email": "電子郵件",
"searchByName": "按名稱搜索",
"organizations": "组织",
"my organizations": "我的组织",
"createOrganization": "創建組織",
"createSampleOrganization": "创建示范组织",
"description": "描述",
Expand Down
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':
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
6 changes: 3 additions & 3 deletions src/components/LeftDrawer/LeftDrawer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const props = {

const propsOrg: InterfaceLeftDrawerProps = {
...props,
screenName: 'Organizations',
screenName: 'My Organizations',
};
const propsReq: InterfaceLeftDrawerProps = {
...props,
Expand Down Expand Up @@ -79,7 +79,7 @@ describe('Testing Left Drawer component for SUPERADMIN', () => {
</MockedProvider>
);

expect(screen.getByText('Organizations')).toBeInTheDocument();
expect(screen.getByText('My Organizations')).toBeInTheDocument();
expect(screen.getByText('Requests')).toBeInTheDocument();
expect(screen.getByText('Users')).toBeInTheDocument();
expect(screen.getByText('Talawa Admin Portal')).toBeInTheDocument();
Expand Down Expand Up @@ -231,7 +231,7 @@ describe('Testing Left Drawer component for ADMIN', () => {
</MockedProvider>
);

expect(screen.getByText('Organizations')).toBeInTheDocument();
expect(screen.getByText('My Organizations')).toBeInTheDocument();
expect(screen.getByText('Talawa Admin Portal')).toBeInTheDocument();

expect(screen.getByText(/John Doe/i)).toBeInTheDocument();
Expand Down
10 changes: 6 additions & 4 deletions src/components/LeftDrawer/LeftDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ const leftDrawer = ({
<h5 className={styles.titleHeader}>{t('menu')}</h5>
<div className={styles.optionList}>
<Button
variant={screenName === 'Organizations' ? 'success' : 'light'}
variant={screenName === 'My Organizations' ? 'success' : 'light'}
className={`${
screenName === 'Organizations' ? 'text-white' : 'text-secondary'
screenName === 'My Organizations'
? 'text-white'
: 'text-secondary'
}`}
data-testid="orgsBtn"
onClick={(): void => {
Expand All @@ -79,13 +81,13 @@ const leftDrawer = ({
<div className={styles.iconWrapper}>
<OrganizationsIcon
stroke={`${
screenName === 'Organizations'
screenName === 'My Organizations'
? 'var(--bs-white)'
: 'var(--bs-secondary)'
}`}
/>
</div>
{t('organizations')}
{t('my organizations')}
</Button>
{userType === 'SUPERADMIN' && (
<Button
Expand Down
5 changes: 4 additions & 1 deletion src/screens/OrgList/OrgList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,10 @@ function orgList(): JSX.Element {

return (
<>
<SuperAdminScreen title={t('organizations')} screenName="Organizations">
<SuperAdminScreen
title={t('my organizations')}
screenName="My Organizations"
>
{/* Buttons Container */}
<div className={styles.btnsContainer}>
<div className={styles.input}>
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

0 comments on commit 1d6d856

Please sign in to comment.