From eee8d06034afc6ede5978d31eef94f1ad6b6cbf6 Mon Sep 17 00:00:00 2001 From: AyushRanjan Date: Tue, 12 Dec 2023 15:16:15 +0530 Subject: [PATCH] TP-48565 | comment resolved --- src/Pages/JiraDashboard/constants.ts | 4 ++-- src/Pages/JiraDashboard/index.tsx | 6 ++---- src/Pages/JiraDashboard/partials/DashboardHeader.tsx | 2 +- src/Pages/JiraDashboard/partials/HyperlinkCellRenderer.tsx | 2 +- src/Pages/JiraDashboard/partials/SearchResultsTable.tsx | 3 ++- src/Pages/JiraDashboard/partials/SmartSearch.tsx | 4 ++-- src/Pages/JiraDashboard/partials/ticketNameCell.tsx | 4 ++-- 7 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/Pages/JiraDashboard/constants.ts b/src/Pages/JiraDashboard/constants.ts index d689c7c..2fe85c2 100644 --- a/src/Pages/JiraDashboard/constants.ts +++ b/src/Pages/JiraDashboard/constants.ts @@ -8,6 +8,6 @@ export const DashboardHeaderConstants = { //TO DO: Need to change the API URL export const FETCH_JIRA_DATA = (payload: string): string => { - return `${URL_PREFIX}/get-jira-statuses?${payload}`; - //return `https://mocki.io/v1/09bc40a5-1e6b-4217-8c82-c1e35f87230f`; + // return `${URL_PREFIX}/get-jira-statuses?${payload}`; + return `https://mocki.io/v1/09bc40a5-1e6b-4217-8c82-c1e35f87230f`; }; diff --git a/src/Pages/JiraDashboard/index.tsx b/src/Pages/JiraDashboard/index.tsx index abe6f48..6a48f12 100644 --- a/src/Pages/JiraDashboard/index.tsx +++ b/src/Pages/JiraDashboard/index.tsx @@ -29,7 +29,6 @@ const JiraDashboard: FC = () => { const navigate = useNavigate(); const startJiraSearch = (param): void => { - console.log('param', param); const endPoint = FETCH_JIRA_DATA(param); setIsLoading(true); ApiService.get(endPoint) @@ -67,8 +66,7 @@ const JiraDashboard: FC = () => { } const searchParam = searchParams.toString(); updateURLAndFetchData(searchParam); - //console.log('searchParam', searchParam); - }, [searchParams.toString()]); + }, [searchParams]); const handlePageNumber = (pageNumber: number): void => { searchParams.set('page_number', (pageNumber - 1).toString()); @@ -93,7 +91,7 @@ const JiraDashboard: FC = () => { startJiraSearch(`${finalParams}`); }; - const updateURLAndFetchData = (updatedQuery: string) => { + const updateURLAndFetchData = (updatedQuery: string): void => { navigate({ search: updatedQuery, }); diff --git a/src/Pages/JiraDashboard/partials/DashboardHeader.tsx b/src/Pages/JiraDashboard/partials/DashboardHeader.tsx index f3f4fd5..c92bc18 100644 --- a/src/Pages/JiraDashboard/partials/DashboardHeader.tsx +++ b/src/Pages/JiraDashboard/partials/DashboardHeader.tsx @@ -15,7 +15,7 @@ const DashboardHeader: FC = ({ fetchJiraData }) => { const [searchValue, setSearchValue] = useState(''); const navigate = useNavigate(); - const updateURLAndFetchData = (updatedQuery: string) => { + const updateURLAndFetchData = (updatedQuery: string): void => { navigate({ search: updatedQuery, }); diff --git a/src/Pages/JiraDashboard/partials/HyperlinkCellRenderer.tsx b/src/Pages/JiraDashboard/partials/HyperlinkCellRenderer.tsx index 0ce60c2..48bc893 100644 --- a/src/Pages/JiraDashboard/partials/HyperlinkCellRenderer.tsx +++ b/src/Pages/JiraDashboard/partials/HyperlinkCellRenderer.tsx @@ -5,7 +5,7 @@ import styles from '../Dashboard.module.scss'; const HyperlinkCellRenderer = ({ value, id }) => { const navigate = useNavigate(); - const handleClick = () => { + const handleClick = (): void => { navigate(`/incident/${id}`); }; diff --git a/src/Pages/JiraDashboard/partials/SearchResultsTable.tsx b/src/Pages/JiraDashboard/partials/SearchResultsTable.tsx index cd7a879..785bedc 100644 --- a/src/Pages/JiraDashboard/partials/SearchResultsTable.tsx +++ b/src/Pages/JiraDashboard/partials/SearchResultsTable.tsx @@ -6,6 +6,7 @@ import styles from '../SearchResultsTable.module.scss'; import cx from 'classnames'; import HyperlinkCellRenderer from './HyperlinkCellRenderer'; import TicketNameCell from './ticketNameCell'; +import { DropDownPosition } from '@navi/web-ui/lib/components/Pagination/constant'; //TO DO: will be moved to constants file interface SearchResultTableProps { currentPageData: any; @@ -128,7 +129,7 @@ const SearchResultsTable: FC = ({ = ({ } }, [searchParams]); - const handleSearchInput = (e: React.ChangeEvent) => { + const handleSearchInput = (e: React.ChangeEvent): void => { setSearchValue(e.target.value); }; const clearSearch = () => { @@ -38,7 +38,7 @@ const SmartSearch: FC = ({ //TO DO: will be moved to constants file const placeHolder = 'Search by Houston I.D.'; - const onKeyPressClickHandler = (event: React.KeyboardEvent) => { + const onKeyPressClickHandler = (event: React.KeyboardEvent): void => { if (event.key === 'Enter') { if (searchValue === '') { clearSearch(); diff --git a/src/Pages/JiraDashboard/partials/ticketNameCell.tsx b/src/Pages/JiraDashboard/partials/ticketNameCell.tsx index 45ce4f3..41d3181 100644 --- a/src/Pages/JiraDashboard/partials/ticketNameCell.tsx +++ b/src/Pages/JiraDashboard/partials/ticketNameCell.tsx @@ -8,7 +8,7 @@ import TaskIcon from '@src/assets/JiraIcons/TaskIcon'; import EpicIcon from '@src/assets/JiraIcons/EpicIcon'; import BugIcon from '@src/assets/JiraIcons/BugIcon'; -const getTicketIcon = ticketType => { +const getTicketIcon = (ticketType: string): JSX.Element | null => { switch (ticketType) { case 'Story': return ; @@ -26,7 +26,7 @@ const getTicketIcon = ticketType => { }; const TicketNameCell = ({ tickerName, ticketLink, ticketType }) => { - const handleClick = () => { + const handleClick = (): void => { window.open(ticketLink, '_blank'); }; return (