From 1ae017fb6615924e61121716ffe87735112ebb2a Mon Sep 17 00:00:00 2001 From: pooja Date: Mon, 25 Sep 2023 15:09:25 +0530 Subject: [PATCH] TP-40366| fixed Design callouts --- src/Pages/Team/index.tsx | 5 ++--- src/Pages/Team/partials/CreateTeam.tsx | 22 +++++++++++++------- src/Pages/Team/partials/TeamForm.tsx | 3 ++- src/Pages/Team/partials/TeamResultsTable.tsx | 5 +++-- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/Pages/Team/index.tsx b/src/Pages/Team/index.tsx index 2f09ccf..4d8a0b3 100644 --- a/src/Pages/Team/index.tsx +++ b/src/Pages/Team/index.tsx @@ -69,9 +69,9 @@ const Team: FC = () => { return (
- + Teams{' '} - + ({data?.length}) @@ -93,7 +93,6 @@ const Team: FC = () => {
{returnTable()} - = ({ startTeamSearch, setOpen, }) => { + // console.log("fetchTeamById",fetchTeamById); + const [teamName, setTeamName] = useState(''); const [teamNameError, setTeamNameError] = useState(''); const [emailError, setEmailError] = useState(''); @@ -25,7 +27,7 @@ const CreateTeam: React.FC = ({ value = value.trim(); if (!regularExpression.test(value)) { setTeamNameError( - 'Min. 3 characters required. For special characters use spaces, ‘_’, or ‘-’ only”', + 'Min. 3 characters required. Use spaces, ‘_’, or ‘-’ only', ); } else { setTeamNameError(''); @@ -33,10 +35,13 @@ const CreateTeam: React.FC = ({ }; const validateEmail = (value: string): void => { - if (!emailRegularExpression.test(value)) { - setEmailError('Please enter a Navi email ID'); - } else { - setEmailError(''); + const validEmail = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/; + if (validEmail.test(value)) { + if (!emailRegularExpression.test(value)) { + setEmailError('Please enter a Navi email ID'); + } else { + setEmailError(''); + } } }; @@ -56,6 +61,9 @@ const CreateTeam: React.FC = ({ .then((response: any) => { toast.success('Team added successfully'); startTeamSearch(response?.data?.data?.id); + //scroll to the newly created team + //route to the newly created team + console.log(response?.data?.data?.id); setOpen(false); setTeamName(''); setEmail(''); @@ -106,7 +114,7 @@ const CreateTeam: React.FC = ({ value={teamName} onChange={handleTeamNameChange} error={teamNameError} - Icon={} + Icon={} placeholder="E.g. NaviPay_Operations" /> diff --git a/src/Pages/Team/partials/TeamForm.tsx b/src/Pages/Team/partials/TeamForm.tsx index 8bd999a..29f3979 100644 --- a/src/Pages/Team/partials/TeamForm.tsx +++ b/src/Pages/Team/partials/TeamForm.tsx @@ -14,12 +14,13 @@ import { slackUserOptions, userInputPlaceholders, } from '../constants'; + import { ApiService } from '@src/services/api'; import MembersDetails from '@src/components/MembersDetails'; import DrawerStyles from '@src/Pages/Incidents/DrawerMode/DrawerMode.module.scss'; import styles from '../Team.module.scss'; -const TeamForm = (props: TeamFormProps) => { +export const TeamForm = (props: TeamFormProps) => { const { teamId, isExpanded, setTeamId, setLastUpdatedAt } = props; const [data, setData] = useState({}); const [slackUserIds, setSlackUserIds] = useState(''); diff --git a/src/Pages/Team/partials/TeamResultsTable.tsx b/src/Pages/Team/partials/TeamResultsTable.tsx index 7591276..f1bc921 100644 --- a/src/Pages/Team/partials/TeamResultsTable.tsx +++ b/src/Pages/Team/partials/TeamResultsTable.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react'; +import { useState, useRef } from 'react'; import Typography from '@navi/web-ui/lib/primitives/Typography'; import { Accordion, AccordionGroup } from '@navi/web-ui/lib/primitives'; import { TeamResultsTableProps } from '@src/Pages/Incidents/constants'; @@ -6,6 +6,7 @@ import TeamForm from './TeamForm'; import { TeamsData } from '../constants'; import { returnFormattedDate } from '@src/services/globalUtils'; import styles from '../Team.module.scss'; +import { Link } from 'react-router-dom'; const TeamResultsTable = (props: TeamResultsTableProps) => { const { teamsData } = props; @@ -24,7 +25,7 @@ const TeamResultsTable = (props: TeamResultsTableProps) => {
{teamsData?.map((team: TeamsData) => ( -
+
{ if (isExpanded) setTeamId(team?.id);