From cb60df749ef02c68c0705e450e063c341e2b1ae2 Mon Sep 17 00:00:00 2001 From: Ajeyakrishna Date: Fri, 22 Dec 2023 15:36:18 +0530 Subject: [PATCH 1/4] chore: removes task requests dev flag --- src/components/issues/Card.tsx | 62 +++++++++++----------------- src/components/taskDetails/index.tsx | 46 ++++++++++----------- src/pages/issues/index.tsx | 2 +- 3 files changed, 47 insertions(+), 63 deletions(-) diff --git a/src/components/issues/Card.tsx b/src/components/issues/Card.tsx index 3b43810b6..7f8747308 100644 --- a/src/components/issues/Card.tsx +++ b/src/components/issues/Card.tsx @@ -21,8 +21,6 @@ const Card: FC = ({ issue }) => { const date = new Date(issue.created_at).toDateString(); const [taskExists, setTaskExists] = useState(issue.taskExists ?? false); const [isLoading, setIsLoading] = useState(false); - const router = useRouter(); - const devMode = router.query.dev === 'true' ? true : false; const { data: userData, isUserAuthorized } = useUserData(); const [taskId, setTaskId] = useState(issue.taskId); const [requestId, setRequestId] = useState(); @@ -209,42 +207,30 @@ const Card: FC = ({ issue }) => {
- {devMode ? ( - <> - - - - ) : ( - <> - - - )} + ( + <> + + + + )
); diff --git a/src/components/taskDetails/index.tsx b/src/components/taskDetails/index.tsx index 5b9f3a12b..ea2e88b61 100755 --- a/src/components/taskDetails/index.tsx +++ b/src/components/taskDetails/index.tsx @@ -477,31 +477,29 @@ const TaskDetails: FC = ({ taskID }) => { Update Progress - {isDevModeEnabled && ( -
- + + - - -
- )} + Request for task + + + + diff --git a/src/pages/issues/index.tsx b/src/pages/issues/index.tsx index 506b5c61d..b6cebe7ed 100644 --- a/src/pages/issues/index.tsx +++ b/src/pages/issues/index.tsx @@ -26,7 +26,7 @@ const Issues: FC = () => { const fetchIssues = async (searchText = '') => { try { setIsLoading(true); - const res = await fetch(`${ISSUES_URL}?dev=true&q=${searchText}`); + const res = await fetch(`${ISSUES_URL}?q=${searchText}`); const data = await res.json(); if ('issues' in data) { // GitHub treats issues and PRs as issues From abae5fc4efc2909a8897dd3545fcf9c040614fdb Mon Sep 17 00:00:00 2001 From: Ajeyakrishna Date: Fri, 22 Dec 2023 15:40:27 +0530 Subject: [PATCH 2/4] chore: remove brackets --- src/components/issues/Card.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/issues/Card.tsx b/src/components/issues/Card.tsx index 7f8747308..103baa09d 100644 --- a/src/components/issues/Card.tsx +++ b/src/components/issues/Card.tsx @@ -207,7 +207,6 @@ const Card: FC = ({ issue }) => {
- ( <>
); From 1db7962955b29dd96e822c7a46e0fea96d97c5b1 Mon Sep 17 00:00:00 2001 From: Ajeyakrishna Date: Fri, 22 Dec 2023 20:58:43 +0530 Subject: [PATCH 3/4] fix: remove dev flag from test cases --- .../Unit/Components/Issues/Card.test.tsx | 33 +++---------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/__tests__/Unit/Components/Issues/Card.test.tsx b/__tests__/Unit/Components/Issues/Card.test.tsx index 295f07251..79f606fd2 100644 --- a/__tests__/Unit/Components/Issues/Card.test.tsx +++ b/__tests__/Unit/Components/Issues/Card.test.tsx @@ -46,7 +46,7 @@ describe('Issue card', () => { expect( screen.getByText(issuesResponseSearchedWithQuery[0].html_url) ).toBeInTheDocument(); - expect(screen.getByRole('button')).toHaveTextContent('Convert to task'); + expect(screen.getByRole('button')).toHaveTextContent('Convert to Task'); }); test('Should render issue created by information correctly', () => { @@ -115,25 +115,11 @@ describe('Issue card', () => { expect(markdownElement2).toBeInTheDocument(); }); - test('Should render action form when dev mode is enabled', () => { - const screen = renderWithRouter( - - - , - { - query: { dev: 'true' }, - } - ); - expect(screen.getByRole('button')).toHaveTextContent('Convert to Task'); - }); test('should render issue card with convert to task button', () => { const screen = renderWithRouter( - , - { - query: { dev: 'true' }, - } + ); expect(screen.getByRole('button')).toHaveTextContent('Convert to Task'); }); @@ -141,10 +127,7 @@ describe('Issue card', () => { const screen = renderWithRouter( - , - { - query: { dev: 'true' }, - } + ); const convertToTaskButton = screen.getByText(/Convert to Task/i); fireEvent.click(convertToTaskButton); @@ -157,10 +140,7 @@ describe('Issue card', () => { const screen = renderWithRouter( - , - { - query: { dev: 'true' }, - } + ); const convertToTaskButton = screen.getByText(/Convert to Task/i); fireEvent.click(convertToTaskButton); @@ -188,10 +168,7 @@ describe('Issue card', () => { taskId: undefined, }} /> - , - { - query: { dev: 'true' }, - } + ); const convertToTaskButton = screen.getByText(/Convert to Task/i); fireEvent.click(convertToTaskButton); From f5d5bd65e0ab36e00cbf0fe8f9ff74e612f69551 Mon Sep 17 00:00:00 2001 From: Ajeyakrishna Date: Fri, 22 Dec 2023 23:16:14 +0530 Subject: [PATCH 4/4] fix: dashboard site task requests link --- src/constants/url.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants/url.ts b/src/constants/url.ts index 7fc2a99cb..f10f0f295 100644 --- a/src/constants/url.ts +++ b/src/constants/url.ts @@ -32,4 +32,4 @@ export const MAIN_SITE_URL = 'https://www.realdevsquad.com'; export const MY_SITE_URL = 'https://my.realdevsquad.com'; export const DASHBOARD_URL = 'https://dashboard.realdevsquad.com'; export const USER_MANAGEMENT_URL = `${DASHBOARD_URL}/users/details/`; -export const TASK_REQUESTS_DETAILS_URL = `${DASHBOARD_URL}/taskRequests/details/`; +export const TASK_REQUESTS_DETAILS_URL = `${DASHBOARD_URL}/task-requests/details/`;