TP-24538: Minor update
This commit is contained in:
@@ -19,4 +19,5 @@ export interface TeamFormProps {
|
||||
teamId: string;
|
||||
isExpanded: boolean;
|
||||
setTeamId: (val: string) => void;
|
||||
setLastUpdatedAt: (value: string) => void;
|
||||
}
|
||||
|
||||
@@ -16,17 +16,20 @@ import MembersDetails from '@src/components/MembersDetails';
|
||||
import styles from '../Team.module.scss';
|
||||
|
||||
const TeamForm = (props: TeamFormProps) => {
|
||||
const { teamId, isExpanded, setTeamId } = props;
|
||||
const { teamId, isExpanded, setTeamId, setLastUpdatedAt } = props;
|
||||
const [data, setData] = useState<any>({});
|
||||
const [slackUserIds, setSlackUserIds] = useState('');
|
||||
const [isLoading, setIsLoading] = useState<boolean>(false);
|
||||
|
||||
const fetchTeamById = () => {
|
||||
const fetchTeamById = (updateDate = false) => {
|
||||
const endPoint = FETCH_SINGLE_TEAM_DATA(teamId);
|
||||
setIsLoading(true);
|
||||
ApiService.get(endPoint)
|
||||
.then(response => {
|
||||
setIsLoading(false);
|
||||
if (updateDate) {
|
||||
setLastUpdatedAt(response?.data?.data?.lastUpdatedAt);
|
||||
}
|
||||
setData(response?.data?.data);
|
||||
setTeamId('');
|
||||
})
|
||||
@@ -61,7 +64,7 @@ const TeamForm = (props: TeamFormProps) => {
|
||||
})
|
||||
.then(response => {
|
||||
toast.success('Team Updated Successfully !!');
|
||||
fetchTeamById();
|
||||
fetchTeamById(true);
|
||||
})
|
||||
.catch(error => {
|
||||
const toastMessage = `${
|
||||
|
||||
@@ -12,14 +12,23 @@ import styles from '../Team.module.scss';
|
||||
|
||||
const TeamResultsTable = (props: TeamResultsTableProps) => {
|
||||
const { teamsData } = props;
|
||||
|
||||
const [lastUpdated, setLastUpdated] = useState<string>('');
|
||||
const [teamId, setTeamId] = useState<string>('');
|
||||
|
||||
const returnAccordionKey = (value): string => {
|
||||
return lastUpdated.length ? `${value}-${lastUpdated}` : `${value}`;
|
||||
};
|
||||
|
||||
const returnDate = date => {
|
||||
const finalDate = lastUpdated.length ? lastUpdated : date;
|
||||
return returnFormattedDate(finalDate);
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<AccordionGroup spaced className={styles['accordion-wrapper']}>
|
||||
{teamsData?.map((team: TeamsData) => (
|
||||
<div key={team?.id}>
|
||||
<div key={returnAccordionKey(team?.id)}>
|
||||
<Accordion
|
||||
onToggledExpansion={(isExpanded: boolean) => {
|
||||
if (isExpanded) setTeamId(team?.id);
|
||||
@@ -35,7 +44,7 @@ const TeamResultsTable = (props: TeamResultsTableProps) => {
|
||||
className={styles['title']}
|
||||
color="#585858"
|
||||
>
|
||||
Updated At: {returnFormattedDate(team?.lastUpdatedAt)}
|
||||
Updated At: {returnDate(team?.lastUpdatedAt)}
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
@@ -45,6 +54,7 @@ const TeamResultsTable = (props: TeamResultsTableProps) => {
|
||||
teamId={team?.id}
|
||||
isExpanded={teamId === team?.id}
|
||||
setTeamId={setTeamId}
|
||||
setLastUpdatedAt={setLastUpdated}
|
||||
/>
|
||||
</Accordion>
|
||||
</div>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
.header {
|
||||
display: inline-flex;
|
||||
gap: 16px;
|
||||
align-items: center;
|
||||
min-width: max-content;
|
||||
}
|
||||
|
||||
|
||||
@@ -99,9 +99,9 @@ const LeftNav: React.FC<LeftNavProps> = ({ children }) => {
|
||||
const headerContent: JSX.Element = (
|
||||
<div>
|
||||
<div className={styles.header}>
|
||||
<NaviNewLogoIcon width={28} height={28} />
|
||||
<NaviNewLogoIcon width={32} height={32} />
|
||||
{isExpanded && (
|
||||
<Typography variant="p2" color="white">
|
||||
<Typography variant="h2" color="white" style={{ marginTop: '8px' }}>
|
||||
Houston UI
|
||||
</Typography>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user