Skip to content

Commit

Permalink
feat:Removed requests screen from superadmin panel (#1399)
Browse files Browse the repository at this point in the history
  • Loading branch information
KshitijTodkar48 authored Jan 10, 2024
1 parent da239fe commit e6a9c14
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 1,322 deletions.
23 changes: 0 additions & 23 deletions public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
"talawaAdminPortal": "Talawa Admin Portal",
"menu": "Menu",
"my organizations": "My Organizations",
"requests": "Requests",
"users": "Users",
"logout": "Logout"
},
Expand Down Expand Up @@ -192,28 +191,6 @@
"talawaApiUnavailable": "Talawa-API service is unavailable. Is it running? Check your network connectivity too.",
"cancel": "Cancel"
},
"requests": {
"title": "Talawa Requests",
"searchByName": "Search By Name",
"requests": "Requests",
"name": "Name",
"email": "Email",
"accept": "Accept",
"reject": "Reject",
"enterName": "Enter Name",
"endOfResults": "End of results",
"loadingRequests": "Loading Requests...",
"noRequestFound": "No Request Found",
"sort": "Sort",
"filter": "Filter",
"Oldest": "Oldest First",
"Latest": "Latest First",
"noOrgError": "Organizations not found, please create an organization through dashboard",
"userApproved": "User Approved",
"userRejected": "User Rejected",
"noResultsFoundFor": "No results found for ",
"talawaApiUnavailable": "Talawa-API service is unavailable. Is it running? Check your network connectivity too."
},
"dashboard": {
"title": "Dashboard",
"location": "Location",
Expand Down
22 changes: 0 additions & 22 deletions public/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
"talawaAdminPortal": "Portail d'administration Talawa",
"menu": "Menu",
"my organizations": "Mes Organisations",
"requests": "Demandes",
"users": "Utilisateurs",
"logout": "Déconnexion"
},
Expand Down Expand Up @@ -187,27 +186,6 @@
"talawaApiUnavailable": "Le service Talawa-API n'est pas disponible. Est-il en cours d'exécution ? Vérifiez également votre connectivité réseau.",
"cancel": "Annuler"
},
"requests": {
"title": "Demandes Talawa",
"searchByName": "Recherche par nom",
"requests": "Demandes",
"name": "Nom",
"email": "E-mail",
"accept": "Accepter",
"reject": "Rejeter",
"enterName": "Entrez le nom",
"endOfResults": "Fin des résultats",
"loadingRequests": "Chargement des demandes...",
"noRequestFound": "Aucune demande trouvée",
"sort": "Trier",
"filter": "Filtre",
"Oldest": "Les plus anciennes d'abord",
"Latest": "Les plus récentes d'abord",
"userApproved": "Approuvé par l'utilisateur",
"userRejected": "Utilisateur rejeté",
"noResultsFoundFor": "Aucun résultat trouvé pour ",
"talawaApiUnavailable": "Le service Talawa-API n'est pas disponible. Est-il en cours d'exécution ? Vérifiez également votre connectivité réseau."
},
"dashboard": {
"title": "Tableau de bord",
"location": "Emplacement",
Expand Down
22 changes: 0 additions & 22 deletions public/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
"talawaAdminPortal": "तलावा व्यवस्थापक पोर्टल",
"menu": "मेन्यू",
"my organizations": "मेरे संगठन",
"requests": "अनुरोध",
"users": "उपयोगकर्ता",
"logout": "लॉग आउट"
},
Expand Down Expand Up @@ -186,27 +185,6 @@
"talawaApiUnavailable": "तलवा-एपीआई सेवा उपलब्ध नहीं है। क्या यह चल रहा है? अपनी नेटवर्क कनेक्टिविटी भी जांचें।",
"cancel": "रद्द करें"
},
"requests": {
"title": "तलवा अनुरोध",
"searchByName": "नाम से खोजें",
"requests": "अनुरोध",
"name": "नाम",
"email": "ईमेल",
"accept": "स्वीकार करना",
"reject": "अस्वीकार",
"enterName": "नाम दर्ज करें",
"endOfResults": "परिणामों का अंत",
"loadingRequests": "अनुरोध लोड हो रहा है ...",
"noRequestFound": "कोई अनुरोध नहीं मिला।",
"sort": "छांटें",
"filter": "फ़िल्टर",
"Oldest": "सबसे पुराना पहले",
"Latest": "सबसे नवीनतम पहले",
"userApproved": "उपयोगकर्ता स्वीकृत",
"userRejected": "उपयोगकर्ता अस्वीकृत",
"noResultsFoundFor": "के लिए कोई परिणाम नहीं मिला ",
"talawaApiUnavailable": "तलवा-एपीआई सेवा उपलब्ध नहीं है। क्या यह चल रहा है? अपनी नेटवर्क कनेक्टिविटी भी जांचें।"
},
"dashboard": {
"title": "डैशबोर्ड",
"location": "स्थान",
Expand Down
22 changes: 0 additions & 22 deletions public/locales/sp.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
"talawaAdminPortal": "Portal de administración de Talawa",
"menu": "Menú",
"my organizations": "Mis Organizaciones",
"requests": "Solicitudes",
"users": "Usuarios",
"logout": "Cerrar sesión"
},
Expand Down Expand Up @@ -186,27 +185,6 @@
"talawaApiUnavailable": "El servicio Talawa-API no está disponible. ¿Está funcionando? Compruebe también la conectividad de su red.",
"cancel": "Cancelar"
},
"requests": {
"title": "Solicitudes Talawa",
"searchByName": "Buscar por nombre",
"requests": "Peticiones",
"name": "Nombre",
"email": "Correo electrónico",
"accept": "Aceptar",
"reject": "Rechazar",
"enterName": "Ingrese su nombre",
"endOfResults": "Fin de los resultados",
"loadingRequests": "Cargando solicitudes ...",
"noRequestFound": "No se encontró ninguna solicitud.",
"sort": "Ordenar",
"filter": "Filtrar",
"Oldest": "Más Antiguas Primero",
"Latest": "Más Recientes Primero",
"userApproved": "Aprobado por el usuario",
"userRejected": "Usuario rechazado",
"noResultsFoundFor": "No se encontraron resultados para ",
"talawaApiUnavailable": "El servicio Talawa-API no está disponible. ¿Está funcionando? Compruebe también la conectividad de su red."
},
"dashboard": {
"title": "Panel de",
"location": "Ubicación",
Expand Down
22 changes: 0 additions & 22 deletions public/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
"talawaAdminPortal": "塔拉瓦管理门户",
"menu": "菜单",
"my organizations": "我的组织",
"requests": "请求",
"users": "用户",
"logout": "退出登录"
},
Expand Down Expand Up @@ -186,27 +185,6 @@
"talawaApiUnavailable": "服務不可用。它在運行嗎?還要檢查您的網絡連接。",
"cancel": "取消"
},
"requests": {
"title": "塔拉瓦請求",
"searchByName": "按名稱搜索",
"requests": "要求",
"name": "姓名",
"email": "電子郵件",
"accept": "接受",
"reject": "拒絕",
"enterName": "输入名字",
"endOfResults": "結果結束",
"loadingRequests": "正在加載請求...",
"noRequestFound": "找不到請求。",
"sort": "排序",
"filter": "過濾",
"Oldest": "最旧的优先",
"Latest": "最新的优先",
"userApproved": "用戶批准",
"userRejected": "用戶被拒絕",
"noResultsFoundFor": "未找到结果 ",
"talawaApiUnavailable": "服務不可用。它在運行嗎?還要檢查您的網絡連接。"
},
"dashboard": {
"title": "儀表板",
"location": "地點",
Expand Down
2 changes: 0 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import PageNotFound from 'screens/PageNotFound/PageNotFound';
import AddOnStore from 'components/AddOn/core/AddOnStore/AddOnStore';
import ForgotPassword from 'screens/ForgotPassword/ForgotPassword';
import Users from 'screens/Users/Users';
import Requests from 'screens/Requests/Requests';
import BlockUser from 'screens/BlockUser/BlockUser';
import EventDashboard from 'screens/EventDashboard/EventDashboard';
import MemberDetail from 'screens/MemberDetail/MemberDetail';
Expand Down Expand Up @@ -111,7 +110,6 @@ function app(): JSX.Element {
<SecuredRoute path="/orgstore" component={AddOnStore} />
<SecuredRoute path="/orgads" component={Advertisements} />
<SecuredRoute path="/users" component={Users} />
<SecuredRoute path="/requests" component={Requests} />
<SecuredRoute path="/blockuser" component={BlockUser} />
<SecuredRoute path="/event/:eventId" component={EventDashboard} />
{extraRoutes}
Expand Down
10 changes: 0 additions & 10 deletions src/assets/svgs/requests.svg

This file was deleted.

51 changes: 0 additions & 51 deletions src/components/LeftDrawer/LeftDrawer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ const propsOrg: InterfaceLeftDrawerProps = {
...props,
screenName: 'My Organizations',
};
const propsReq: InterfaceLeftDrawerProps = {
...props,
hideDrawer: false,
screenName: 'Requests',
};
const propsUsers: InterfaceLeftDrawerProps = {
...props,
hideDrawer: null,
Expand Down Expand Up @@ -80,7 +75,6 @@ describe('Testing Left Drawer component for SUPERADMIN', () => {
);

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

Expand All @@ -89,15 +83,11 @@ describe('Testing Left Drawer component for SUPERADMIN', () => {
expect(screen.getByAltText(/dummy picture/i)).toBeInTheDocument();

const orgsBtn = screen.getByTestId(/orgsBtn/i);
const requestsBtn = screen.getByTestId(/requestsBtn/i);
const rolesBtn = screen.getByTestId(/rolesBtn/i);

expect(
orgsBtn.className.includes('text-white btn btn-success')
).toBeTruthy();
expect(
requestsBtn.className.includes('text-secondary btn btn-light')
).toBeTruthy();
expect(
rolesBtn.className.includes('text-secondary btn btn-light')
).toBeTruthy();
Expand All @@ -110,25 +100,6 @@ describe('Testing Left Drawer component for SUPERADMIN', () => {
expect(global.window.location.pathname).toContain('/users');
});

test('Testing in requests screen', () => {
localStorage.setItem('UserType', 'SUPERADMIN');
render(
<MockedProvider addTypename={false} link={link}>
<BrowserRouter>
<I18nextProvider i18n={i18nForTest}>
<LeftDrawer {...propsOrg} />
</I18nextProvider>
</BrowserRouter>
</MockedProvider>
);

const orgsBtn = screen.getByTestId(/orgsBtn/i);

// Send to organizations screen
userEvent.click(orgsBtn);
expect(global.window.location.pathname).toContain('/orglist');
});

test('Testing in roles screen', () => {
localStorage.setItem('UserType', 'SUPERADMIN');
render(
Expand All @@ -142,22 +113,14 @@ describe('Testing Left Drawer component for SUPERADMIN', () => {
);

const orgsBtn = screen.getByTestId(/orgsBtn/i);
const requestsBtn = screen.getByTestId(/requestsBtn/i);
const rolesBtn = screen.getByTestId(/rolesBtn/i);

expect(
orgsBtn.className.includes('text-secondary btn btn-light')
).toBeTruthy();
expect(
requestsBtn.className.includes('text-secondary btn btn-light')
).toBeTruthy();
expect(
rolesBtn.className.includes('text-white btn btn-success')
).toBeTruthy();

// Send to requests screen
userEvent.click(requestsBtn);
expect(global.window.location.pathname).toContain('/requests');
});

test('Testing Drawer open close functionality', () => {
Expand Down Expand Up @@ -188,19 +151,6 @@ describe('Testing Left Drawer component for SUPERADMIN', () => {
);
});

test('Testing Drawer when hideDrawer is true', () => {
localStorage.setItem('UserType', 'SUPERADMIN');
render(
<MockedProvider addTypename={false} link={link}>
<BrowserRouter>
<I18nextProvider i18n={i18nForTest}>
<LeftDrawer {...propsReq} />
</I18nextProvider>
</BrowserRouter>
</MockedProvider>
);
});

test('Testing logout functionality', async () => {
localStorage.setItem('UserType', 'SUPERADMIN');
render(
Expand Down Expand Up @@ -246,7 +196,6 @@ describe('Testing Left Drawer component for ADMIN', () => {

// These screens arent meant for admins so they should not be present
expect(screen.queryByTestId(/rolesBtn/i)).toBeNull();
expect(screen.queryByTestId(/requestsBtn/i)).toBeNull();

// Coming soon
userEvent.click(screen.getByTestId(/profileBtn/i));
Expand Down
24 changes: 0 additions & 24 deletions src/components/LeftDrawer/LeftDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { useHistory } from 'react-router-dom';
import { ReactComponent as AngleRightIcon } from 'assets/svgs/angleRight.svg';
import { ReactComponent as LogoutIcon } from 'assets/svgs/logout.svg';
import { ReactComponent as OrganizationsIcon } from 'assets/svgs/organizations.svg';
import { ReactComponent as RequestsIcon } from 'assets/svgs/requests.svg';
import { ReactComponent as RolesIcon } from 'assets/svgs/roles.svg';
import { ReactComponent as TalawaLogo } from 'assets/svgs/talawa.svg';
import styles from './LeftDrawer.module.css';
Expand Down Expand Up @@ -89,29 +88,6 @@ const leftDrawer = ({
</div>
{t('my organizations')}
</Button>
{userType === 'SUPERADMIN' && (
<Button
variant={screenName === 'Requests' ? 'success' : 'light'}
className={`${
screenName === 'Requests' ? 'text-white' : 'text-secondary'
}`}
onClick={(): void => {
history.push('/requests');
}}
data-testid="requestsBtn"
>
<div className={styles.iconWrapper}>
<RequestsIcon
fill={`${
screenName === 'Requests'
? 'var(--bs-white)'
: 'var(--bs-secondary)'
}`}
/>
</div>
{t('requests')}
</Button>
)}
{userType === 'SUPERADMIN' && (
<Button
variant={screenName === 'Users' ? 'success' : 'light'}
Expand Down
Loading

0 comments on commit e6a9c14

Please sign in to comment.