From bf7c4c1371427655b8936171eeab332ebdcb4805 Mon Sep 17 00:00:00 2001 From: yashmantri Date: Wed, 26 Apr 2023 14:41:03 +0530 Subject: [PATCH 1/4] TP-24975 | Bug Fixes --- src/Pages/Dashboard/partials/SmartSearch.tsx | 6 +----- src/Pages/Team/partials/TeamForm.tsx | 4 +++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Pages/Dashboard/partials/SmartSearch.tsx b/src/Pages/Dashboard/partials/SmartSearch.tsx index 2c69669..576edbe 100644 --- a/src/Pages/Dashboard/partials/SmartSearch.tsx +++ b/src/Pages/Dashboard/partials/SmartSearch.tsx @@ -32,11 +32,7 @@ const SmartSearch: FC = ({ updateSearchResults }) => { placeholder={placeHolder} containerClassName={cx(styles['input-container'])} /> - diff --git a/src/Pages/Team/partials/TeamForm.tsx b/src/Pages/Team/partials/TeamForm.tsx index 7cf0de1..4f49e8e 100644 --- a/src/Pages/Team/partials/TeamForm.tsx +++ b/src/Pages/Team/partials/TeamForm.tsx @@ -50,7 +50,8 @@ const TeamForm = (props: TeamFormProps) => { const submitHandler = () => { const endPoint = UPDATE_TEAM_DATA(); - const slackIds = data?.participants?.map(participant => participant?.id); + const slackIds = + data?.participants?.map(participant => participant?.id) || []; ApiService.post(endPoint, { id: teamId, slackUserIds: [...slackIds, ...slackUserIds.split(',')]?.map(id => @@ -107,6 +108,7 @@ const TeamForm = (props: TeamFormProps) => { variant="primary" onClick={submitHandler} className={styles['update-team-btn']} + disabled={!slackUserIds.length} > Update team details From ee395975c88ccdedfee9339f7e846c0530d52761 Mon Sep 17 00:00:00 2001 From: "k.kamalakannan" Date: Wed, 26 Apr 2023 15:02:48 +0530 Subject: [PATCH 2/4] TP-24975: bug fix for add members in the team --- src/Pages/Team/partials/TeamForm.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Pages/Team/partials/TeamForm.tsx b/src/Pages/Team/partials/TeamForm.tsx index 4f49e8e..50ff4cb 100644 --- a/src/Pages/Team/partials/TeamForm.tsx +++ b/src/Pages/Team/partials/TeamForm.tsx @@ -54,9 +54,10 @@ const TeamForm = (props: TeamFormProps) => { data?.participants?.map(participant => participant?.id) || []; ApiService.post(endPoint, { id: teamId, - slackUserIds: [...slackIds, ...slackUserIds.split(',')]?.map(id => - id?.trim(), - ), + slackUserIds: slackIds, + workEmailIds: slackUserIds?.includes(',') + ? slackUserIds.split(',').map(item => item?.trim()) + : [slackUserIds], }) .then(response => { toast.success('Team Updated Successfully !!'); From 830c4f2731d3deaef2efd347006a46bc206fa0d5 Mon Sep 17 00:00:00 2001 From: yashmantri Date: Wed, 26 Apr 2023 16:59:35 +0530 Subject: [PATCH 3/4] TP-24975 | Added Log --- src/services/api.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/services/api.ts b/src/services/api.ts index 97a546a..60ffb2f 100644 --- a/src/services/api.ts +++ b/src/services/api.ts @@ -10,6 +10,11 @@ export class ApiService { if (!ApiService.instance) { ApiService.instance = new ApiService(); const userData = localStorage.getItem('user-data'); + console.log({ userData }); + console.log( + 'JSON.parse(userData)?.emailId', + JSON.parse(userData ?? '')?.emailId, + ); ApiService.instance.service.interceptors.request.use((req: any) => { req.headers['X-Session-Token'] = localStorage.getItem('react-token') || ''; From f29542b7123ab001b0525003c53f3046b41338f1 Mon Sep 17 00:00:00 2001 From: yashmantri Date: Wed, 26 Apr 2023 22:57:06 +0530 Subject: [PATCH 4/4] TP-24975 | Minor Bug Fixes --- .../Dashboard/partials/SearchResultsTable.tsx | 27 +++++++++++-------- src/Pages/Dashboard/partials/SmartSearch.tsx | 2 +- src/Pages/Incidents/DrawerMode/index.tsx | 25 +++++++++-------- src/Pages/Severity/Severity.module.scss | 1 + src/Pages/Severity/SeverityForm.tsx | 4 ++- src/Pages/Severity/SeverityResults.tsx | 8 ++++-- src/Pages/Team/Team.module.scss | 7 +++++ src/Pages/Team/index.tsx | 11 +++++++- src/Pages/Team/partials/TeamResultsTable.tsx | 8 ++++-- 9 files changed, 62 insertions(+), 31 deletions(-) diff --git a/src/Pages/Dashboard/partials/SearchResultsTable.tsx b/src/Pages/Dashboard/partials/SearchResultsTable.tsx index 7ea21d4..67cf864 100644 --- a/src/Pages/Dashboard/partials/SearchResultsTable.tsx +++ b/src/Pages/Dashboard/partials/SearchResultsTable.tsx @@ -37,6 +37,13 @@ const SearchResultsTable: FC = ({ const incidentData = useRef({}); const navigate = useNavigate(); + const cellStyle = { + 'text-overflow': 'ellipsis', + 'white-space': 'nowrap', + overflow: 'hidden', + padding: 0, + }; + const rowData = currentPageData?.map((item: any, ind: number) => { let index = 1; @@ -48,6 +55,7 @@ const SearchResultsTable: FC = ({ return { sNo: ind === 0 ? index : index + ind, id: item?.id, + incidentName: item?.incidentName, title: item?.title, statusName: item?.statusName, severityName: item?.severityName, @@ -68,16 +76,16 @@ const SearchResultsTable: FC = ({ width: 120, suppressMovable: true, }, + { + field: 'incidentName', + headerName: 'Channel Name', + suppressMovable: true, + }, { field: 'title', headerName: 'Title', suppressMovable: true, - cellStyle: { - 'text-overflow': 'ellipsis', - 'white-space': 'nowrap', - overflow: 'hidden', - padding: 0, - }, + cellStyle: cellStyle, }, { field: 'statusName', @@ -102,15 +110,11 @@ const SearchResultsTable: FC = ({ headerName: 'Team Name', suppressMovable: true, }, - { - field: 'createdAt', - headerName: 'Created On', - suppressMovable: true, - }, { field: 'createdBy', headerName: 'Created By', suppressMovable: true, + cellStyle: cellStyle, }, { field: 'updatedAt', @@ -121,6 +125,7 @@ const SearchResultsTable: FC = ({ field: 'updatedBy', headerName: 'Updated By', suppressMovable: true, + cellStyle: cellStyle, }, ]; diff --git a/src/Pages/Dashboard/partials/SmartSearch.tsx b/src/Pages/Dashboard/partials/SmartSearch.tsx index 576edbe..d31fca5 100644 --- a/src/Pages/Dashboard/partials/SmartSearch.tsx +++ b/src/Pages/Dashboard/partials/SmartSearch.tsx @@ -21,7 +21,7 @@ const SmartSearch: FC = ({ updateSearchResults }) => { updateSearchResults(searchValue); }; - const placeHolder = 'Enter the incident name here'; + const placeHolder = 'Enter the channel name here'; return (
diff --git a/src/Pages/Incidents/DrawerMode/index.tsx b/src/Pages/Incidents/DrawerMode/index.tsx index a6cc71b..581662c 100644 --- a/src/Pages/Incidents/DrawerMode/index.tsx +++ b/src/Pages/Incidents/DrawerMode/index.tsx @@ -48,7 +48,6 @@ const DrawerMode: FC = ({ incidentId, slackChannel }) => { }; const initFilters = (incidentDetails): void => { - console.log('incidentDetails', incidentDetails); const severity = headerData?.severities?.find( item => item.value === incidentDetails?.severityId, ); @@ -108,11 +107,7 @@ const DrawerMode: FC = ({ incidentId, slackChannel }) => { }, [incidentId, slackChannel]); useEffect(() => { - if ( - Object.keys(headerData).length && - Object.keys(incidentDetails).length && - incidentParticipants.length - ) { + if (Object.keys(headerData).length && Object.keys(incidentDetails).length) { initFilters(incidentDetails); } }, [headerData, incidentDetails, incidentParticipants]); @@ -203,14 +198,18 @@ const DrawerMode: FC = ({ incidentId, slackChannel }) => { }; const returnParticipants = () => { - return incidentParticipants?.map(participant => ( -
-
- {' '} - {participant?.name} + return incidentParticipants?.length ? ( + incidentParticipants?.map(participant => ( +
+
+ {' '} + {participant?.name} +
-
- )); + )) + ) : ( +
-
+ ); }; if (isLoading) { diff --git a/src/Pages/Severity/Severity.module.scss b/src/Pages/Severity/Severity.module.scss index 3f5a745..4f67693 100644 --- a/src/Pages/Severity/Severity.module.scss +++ b/src/Pages/Severity/Severity.module.scss @@ -11,6 +11,7 @@ display: flex; justify-content: space-between; gap: 24px; + padding: 6px 0; } .table-wrapper { diff --git a/src/Pages/Severity/SeverityForm.tsx b/src/Pages/Severity/SeverityForm.tsx index 54ebfb4..b166eec 100644 --- a/src/Pages/Severity/SeverityForm.tsx +++ b/src/Pages/Severity/SeverityForm.tsx @@ -52,7 +52,9 @@ const SeverityForm = (props: SeverityFormProps) => { const endPoint = UPDATE_SEVERITY_DATA; const updatedSlackUsers = slackUsers?.includes(',') ? slackUsers?.split(',')?.map(item => item.trim()) - : [slackUsers]; + : slackUsers?.length + ? [slackUsers] + : []; if (!severities?.workEmailIds) { severities.workEmailIds = [...updatedSlackUsers]; const payload = [{ ...severities }]; diff --git a/src/Pages/Severity/SeverityResults.tsx b/src/Pages/Severity/SeverityResults.tsx index 86225c6..503d20c 100644 --- a/src/Pages/Severity/SeverityResults.tsx +++ b/src/Pages/Severity/SeverityResults.tsx @@ -61,8 +61,12 @@ const SeverityResults = () => { {severity?.name} {severity?.lastUpdatedAt && ( - - {returnFormattedDate(severity?.lastUpdatedAt)} + + Updated At: {returnFormattedDate(severity?.lastUpdatedAt)} )}
diff --git a/src/Pages/Team/Team.module.scss b/src/Pages/Team/Team.module.scss index 510d28b..b68eb4f 100644 --- a/src/Pages/Team/Team.module.scss +++ b/src/Pages/Team/Team.module.scss @@ -27,6 +27,7 @@ display: flex; justify-content: space-between; gap: 24px; + padding: 6px 0; } .team-name-wrapper { @@ -71,3 +72,9 @@ padding: 12px; } } + +.team-header-wrapper { + display: flex; + justify-content: space-between; + align-items: center; +} diff --git a/src/Pages/Team/index.tsx b/src/Pages/Team/index.tsx index 6d8482e..bb85218 100644 --- a/src/Pages/Team/index.tsx +++ b/src/Pages/Team/index.tsx @@ -55,7 +55,16 @@ const Team: FC = () => { return ( <> - Team +
+ Team + + Total: + + {' '} + {data?.length} teams{' '} + + +
{returnTable()} ); diff --git a/src/Pages/Team/partials/TeamResultsTable.tsx b/src/Pages/Team/partials/TeamResultsTable.tsx index 2685bda..fb3ad79 100644 --- a/src/Pages/Team/partials/TeamResultsTable.tsx +++ b/src/Pages/Team/partials/TeamResultsTable.tsx @@ -30,8 +30,12 @@ const TeamResultsTable = (props: TeamResultsTableProps) => { {team?.name} {team?.lastUpdatedAt && ( - - {returnFormattedDate(team?.lastUpdatedAt)} + + Updated At: {returnFormattedDate(team?.lastUpdatedAt)} )}