From 8b1a1284f83f3be494ad85755ac0832c4562dfda Mon Sep 17 00:00:00 2001 From: Mahendra Dani <116940083+MahendraDani@users.noreply.github.com> Date: Sat, 25 Nov 2023 20:55:28 +0530 Subject: [PATCH 1/8] fix: user profile page details responsive for mobile screen (#1087) --- .../MemberDetail/MemberDetail.module.css | 17 +++++++++++++---- src/screens/MemberDetail/MemberDetail.tsx | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/screens/MemberDetail/MemberDetail.module.css b/src/screens/MemberDetail/MemberDetail.module.css index 3d2ec749e3..101dcb64e3 100644 --- a/src/screens/MemberDetail/MemberDetail.module.css +++ b/src/screens/MemberDetail/MemberDetail.module.css @@ -109,7 +109,10 @@ .justifysp { display: flex; + flex-direction: row; justify-content: space-between; + align-items: flex-start; + /* gap : 2px; */ } .flexclm { @@ -126,8 +129,7 @@ .justifysp { padding-left: 55px; display: flex; - justify-content: space-between; - width: 100%; + justify-content: space-evenly; } .mainpageright { @@ -355,12 +357,19 @@ } .userImage { - width: 200px; - height: 200px; + width: 180px; + height: 180px; object-fit: cover; border-radius: 8px; } +@media only screen and (max-width: 1200px) { + .userImage { + width: 100px; + height: 100px; + } +} + .activeBtn { width: 100%; display: flex; diff --git a/src/screens/MemberDetail/MemberDetail.tsx b/src/screens/MemberDetail/MemberDetail.tsx index b243dfae98..22510a62e5 100644 --- a/src/screens/MemberDetail/MemberDetail.tsx +++ b/src/screens/MemberDetail/MemberDetail.tsx @@ -136,7 +136,7 @@ const MemberDetail: React.FC = ({ id }): JSX.Element => { {/* User section */}
-

+

{userData?.user?.firstName} {userData?.user?.lastName} From b71586353f55b6261ee5fed017d470119977e1c8 Mon Sep 17 00:00:00 2001 From: Shekhar Patel <90516956+duplixx@users.noreply.github.com> Date: Sat, 25 Nov 2023 21:56:49 +0530 Subject: [PATCH 2/8] MVP Talawa Admin : Hiding Chat Feature from Talawa Web App (#1078) * chat changes * test case --- src/App.tsx | 6 +++--- .../OrganizationNavbar/OrganizationNavbar.test.tsx | 4 ++-- .../OrganizationNavbar/OrganizationNavbar.tsx | 14 +++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 1c69256c32..02f28b9212 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -32,9 +32,9 @@ import Settings from 'screens/UserPortal/Settings/Settings'; import Donate from 'screens/UserPortal/Donate/Donate'; import Events from 'screens/UserPortal/Events/Events'; import Tasks from 'screens/UserPortal/Tasks/Tasks'; +// import Chat from 'screens/UserPortal/Chat/Chat'; import Advertisements from 'components/Advertisements/Advertisements'; -import Chat from 'screens/UserPortal/Chat/Chat'; - + function app(): JSX.Element { /*const { updatePluginLinks, updateInstalled } = bindActionCreators( actionCreators, @@ -130,7 +130,7 @@ function app(): JSX.Element { - + {/* */} diff --git a/src/components/UserPortal/OrganizationNavbar/OrganizationNavbar.test.tsx b/src/components/UserPortal/OrganizationNavbar/OrganizationNavbar.test.tsx index 941b76f4af..a5c1859ccd 100644 --- a/src/components/UserPortal/OrganizationNavbar/OrganizationNavbar.test.tsx +++ b/src/components/UserPortal/OrganizationNavbar/OrganizationNavbar.test.tsx @@ -105,7 +105,7 @@ describe('Testing OrganizationNavbar Component [User Portal]', () => { expect(screen.getByText('People')).toBeInTheDocument(); expect(screen.getByText('Events')).toBeInTheDocument(); expect(screen.getByText('Donate')).toBeInTheDocument(); - expect(screen.getByText('Chat')).toBeInTheDocument(); + // expect(screen.getByText('Chat')).toBeInTheDocument(); }); test('The language is switched to English', async () => { @@ -135,7 +135,7 @@ describe('Testing OrganizationNavbar Component [User Portal]', () => { expect(screen.getByText('People')).toBeInTheDocument(); expect(screen.getByText('Events')).toBeInTheDocument(); expect(screen.getByText('Donate')).toBeInTheDocument(); - expect(screen.getByText('Chat')).toBeInTheDocument(); + // expect(screen.getByText('Chat')).toBeInTheDocument(); }); test('The language is switched to fr', async () => { diff --git a/src/components/UserPortal/OrganizationNavbar/OrganizationNavbar.tsx b/src/components/UserPortal/OrganizationNavbar/OrganizationNavbar.tsx index 72e73783da..4bcaca4a8e 100644 --- a/src/components/UserPortal/OrganizationNavbar/OrganizationNavbar.tsx +++ b/src/components/UserPortal/OrganizationNavbar/OrganizationNavbar.tsx @@ -84,13 +84,13 @@ function organizationNavbar(props: InterfaceNavbarProps): JSX.Element { translated: t('donate'), view: true, }, - { - pluginName: 'Chats', - alias: 'chat', - link: `/user/chat/id=${organizationId}`, - translated: t('chat'), - view: true, - }, + // { + // pluginName: 'Chats', + // alias: 'chat', + // link: `/user/chat/id=${organizationId}`, + // translated: t('chat'), + // view: true, + // }, ]; if (localStorage.getItem('talawaPlugins')) { const talawaPlugins: string = localStorage.getItem('talawaPlugins') || '{}'; From c9087d9bf476e6cd28c90c4013df3edf6658d5a3 Mon Sep 17 00:00:00 2001 From: Peter Harrison <16875803+palisadoes@users.noreply.github.com> Date: Sat, 25 Nov 2023 18:54:10 -0500 Subject: [PATCH 3/8] Update CONTRIBUTING.md --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a0f6b96927..033ed1335e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,11 +55,11 @@ Make sure you are following [issue report guidelines](ISSUE_GUIDELINES.md) avail #### Branching Strategy -For Talawa Admin, we had employed the following branching strategy to simplify the development process and to ensure that only stable code is pushed to the `master` branch: +For Talawa Admin, we had employed the following branching strategy to simplify the development process and to ensure that only stable code is pushed to the `main` branch: - `develop`: For unstable code and bug fixing - `alpha-x.x.x`: for stability teesting -- `master`: Where the stable production ready code lies +- `main`: Where the stable production ready code lies #### Conflict Resolution From 4cbd14bfee6aff10871d8bd7a97c7b0e2cf4be93 Mon Sep 17 00:00:00 2001 From: Aarish Shah Mohsin <49566965+aarishshahmohsin@users.noreply.github.com> Date: Sun, 26 Nov 2023 10:18:28 +0530 Subject: [PATCH 4/8] Added Test for PromotedPost.tsx (#1093) --- src/App.tsx | 2 +- .../PromotedPost/PromotedPost.test.tsx | 127 ++++++++++++++++++ 2 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 src/components/UserPortal/PromotedPost/PromotedPost.test.tsx diff --git a/src/App.tsx b/src/App.tsx index 02f28b9212..1c01f93ae2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -34,7 +34,7 @@ import Events from 'screens/UserPortal/Events/Events'; import Tasks from 'screens/UserPortal/Tasks/Tasks'; // import Chat from 'screens/UserPortal/Chat/Chat'; import Advertisements from 'components/Advertisements/Advertisements'; - + function app(): JSX.Element { /*const { updatePluginLinks, updateInstalled } = bindActionCreators( actionCreators, diff --git a/src/components/UserPortal/PromotedPost/PromotedPost.test.tsx b/src/components/UserPortal/PromotedPost/PromotedPost.test.tsx new file mode 100644 index 0000000000..6b68509a51 --- /dev/null +++ b/src/components/UserPortal/PromotedPost/PromotedPost.test.tsx @@ -0,0 +1,127 @@ +import React from 'react'; +import { act, render, waitFor } from '@testing-library/react'; +import { MockedProvider } from '@apollo/react-testing'; +import { I18nextProvider } from 'react-i18next'; + +import { BrowserRouter } from 'react-router-dom'; +import { Provider } from 'react-redux'; +import { store } from 'state/store'; +import i18nForTest from 'utils/i18nForTest'; +import { StaticMockLink } from 'utils/StaticMockLink'; +import PromotedPost from './PromotedPost'; + +const link = new StaticMockLink([], true); + +async function wait(ms = 100): Promise { + await act(() => { + return new Promise((resolve) => { + setTimeout(resolve, ms); + }); + }); +} + +let props = { + id: '1', + image: '', + title: 'Test Post', +}; + +describe('Testing PromotedPost Test', () => { + test('Component should be rendered properly', async () => { + render( + + + + + + + + + + ); + + await wait(); + }); + + test('Component should be rendered properly if prop image is not undefined', async () => { + props = { + ...props, + image: 'promotedPostImage', + }; + + render( + + + + + + + + + + ); + + await wait(); + }); +}); + +test('Component should display the icon correctly', async () => { + const { queryByTestId } = render( + + + + + + + + + + ); + + await waitFor(() => { + const icon = queryByTestId('StarPurple500Icon'); + expect(icon).toBeInTheDocument(); + }); +}); + +test('Component should display the text correctly', async () => { + const { queryAllByText } = render( + + + + + + + + + + ); + + await waitFor(() => { + const title = queryAllByText('Test Post') as HTMLElement[]; + expect(title[0]).toBeInTheDocument(); + }); +}); + +test('Component should display the image correctly', async () => { + props = { + ...props, + image: 'promotedPostImage', + }; + const { queryByRole } = render( + + + + + + + + + + ); + + await waitFor(() => { + const image = queryByRole('img'); + expect(image).toHaveAttribute('src', 'promotedPostImage'); + }); +}); From 58b729a2afd3c2056f0549f8e063e47a33e45149 Mon Sep 17 00:00:00 2001 From: Peter Harrison <16875803+palisadoes@users.noreply.github.com> Date: Sun, 26 Nov 2023 11:41:28 -0500 Subject: [PATCH 5/8] Update CONTRIBUTING.md --- CONTRIBUTING.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 033ed1335e..fd22174634 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,8 +58,7 @@ Make sure you are following [issue report guidelines](ISSUE_GUIDELINES.md) avail For Talawa Admin, we had employed the following branching strategy to simplify the development process and to ensure that only stable code is pushed to the `main` branch: - `develop`: For unstable code and bug fixing -- `alpha-x.x.x`: for stability teesting -- `main`: Where the stable production ready code lies +- `main`: Where the stable production ready code lies. This is our default branch. #### Conflict Resolution From 0657d75dd5243acbddd9de22cdbc124e37b0fc5c Mon Sep 17 00:00:00 2001 From: Peter Harrison <16875803+palisadoes@users.noreply.github.com> Date: Sun, 26 Nov 2023 11:49:28 -0500 Subject: [PATCH 6/8] Update PR_GUIDELINES.md --- PR_GUIDELINES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PR_GUIDELINES.md b/PR_GUIDELINES.md index 2e4fab698f..ed979f0530 100644 --- a/PR_GUIDELINES.md +++ b/PR_GUIDELINES.md @@ -35,7 +35,11 @@ npm run format:check 1. Please read our [CONTRIBUTING.md](CONTRIBUTING.md) document for details on our testing policy. ## Pull Request Processing +These are key guidelines for the procedure: +### Only submit PRs against our `develop` branch, not the default `main` branch + +1. Only submit PRs against our `develop` branch. The default is `main`, so you will have to modify this before submitting your PR for review. 1. We do not accept draft Pull Requests. They will be closed if submitted. We focus on work that is ready for immediate review. 1. Removing assigned reviewers from your Pull Request will cause it to be closed. The quality of our code is very important to us. Therefore we make experienced maintainers of our code base review your code. Removing these assigned persons is not in the best interest of this goal. 1. If you have not done so already, please read the `Pull Requests and Issues` and `Testing` sections above. From 6244afe2554c7eb0ae3829a70c1bb48a8726c164 Mon Sep 17 00:00:00 2001 From: Peter Harrison <16875803+palisadoes@users.noreply.github.com> Date: Sun, 26 Nov 2023 11:55:31 -0500 Subject: [PATCH 7/8] Update PR_GUIDELINES.md --- PR_GUIDELINES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PR_GUIDELINES.md b/PR_GUIDELINES.md index ed979f0530..d1c2a0b2d9 100644 --- a/PR_GUIDELINES.md +++ b/PR_GUIDELINES.md @@ -39,7 +39,7 @@ These are key guidelines for the procedure: ### Only submit PRs against our `develop` branch, not the default `main` branch -1. Only submit PRs against our `develop` branch. The default is `main`, so you will have to modify this before submitting your PR for review. +1. Only submit PRs against our `develop` branch. The default is `main`, so you will have to modify this before submitting your PR for review. PRs made against `main` will be closed. 1. We do not accept draft Pull Requests. They will be closed if submitted. We focus on work that is ready for immediate review. 1. Removing assigned reviewers from your Pull Request will cause it to be closed. The quality of our code is very important to us. Therefore we make experienced maintainers of our code base review your code. Removing these assigned persons is not in the best interest of this goal. 1. If you have not done so already, please read the `Pull Requests and Issues` and `Testing` sections above. From 962e995fd15629294e54b1f3a227d5327f3a769b Mon Sep 17 00:00:00 2001 From: Peter Harrison <16875803+palisadoes@users.noreply.github.com> Date: Sun, 26 Nov 2023 11:58:06 -0500 Subject: [PATCH 8/8] Update pull_request_template.md --- .github/pull_request_template.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index c2a991ba29..9e3081d0ee 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -4,9 +4,11 @@ This section can be deleted after reading. We employ the following branching strategy to simplify the development process and to ensure that only stable code is pushed to the `master` branch: - `develop`: For unstable code: New features and bug fixes. -- `alpha-x.x.x`: For stability testing: Only bug fixes accepted. - `master`: Where the stable production ready code lies. Only security related bugs. +NOTE!!! + +ONLY SUBMIT PRS AGAINST OUR `DEVELOP` BRANCH. THE DEFAULT IS `MAIN`, SO YOU WILL HAVE TO MODIFY THIS BEFORE SUBMITTING YOUR PR FOR REVIEW. PRS MADE AGAINST `MAIN` WILL BE CLOSED. -->