TP-24975: minor updates
This commit is contained in:
@@ -36,16 +36,16 @@ export const TimeSpan = [
|
||||
|
||||
export const getSeverityColor = (value: string) => {
|
||||
switch (value) {
|
||||
case 'severity-0':
|
||||
case 'Sev-0':
|
||||
return 'red';
|
||||
|
||||
case 'severity-1':
|
||||
case 'Sev-1':
|
||||
return 'orange';
|
||||
|
||||
case 'severity-2':
|
||||
case 'Sev-2':
|
||||
return 'yellow';
|
||||
|
||||
case 'severity-3':
|
||||
case 'Sev-3':
|
||||
return 'green';
|
||||
|
||||
default:
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
margin: 12px 0 24px 0;
|
||||
margin: 0 0 24px 0;
|
||||
}
|
||||
|
||||
.header-filter-results-wrapper {
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
.header-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import cx from 'classnames';
|
||||
import { AgTable, Pagination } from '@navi/web-ui/lib/components';
|
||||
import { Tag } from '@navi/web-ui/lib/primitives';
|
||||
|
||||
import { returnFormattedDate } from '@src/services/globalUtils';
|
||||
import styles from '../SearchResultsTable.module.scss';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { getSeverityColor } from '../constants';
|
||||
@@ -48,8 +49,9 @@ const SearchResultsTable: FC<SearchResultTableProps> = ({
|
||||
statusName: item?.statusName,
|
||||
severityName: item?.severityName,
|
||||
teamName: item?.teamName,
|
||||
createdBy: item?.createdBy,
|
||||
createdAt: item?.createdBy,
|
||||
createdAt: returnFormattedDate(item?.createdAt),
|
||||
updatedBy: item?.updatedBy,
|
||||
updatedAt: returnFormattedDate(item?.updatedAt),
|
||||
};
|
||||
});
|
||||
|
||||
@@ -77,8 +79,9 @@ const SearchResultsTable: FC<SearchResultTableProps> = ({
|
||||
},
|
||||
{
|
||||
field: 'severityName',
|
||||
headerName: 'Severity Name',
|
||||
headerName: 'Severity',
|
||||
suppressMovable: true,
|
||||
width: 120,
|
||||
cellRenderer: params => (
|
||||
<Tag
|
||||
color={getSeverityColor(params?.value)}
|
||||
@@ -92,11 +95,6 @@ const SearchResultsTable: FC<SearchResultTableProps> = ({
|
||||
headerName: 'Team Name',
|
||||
suppressMovable: true,
|
||||
},
|
||||
{
|
||||
field: 'createdBy',
|
||||
headerName: 'Created By',
|
||||
suppressMovable: true,
|
||||
},
|
||||
{
|
||||
field: 'createdAt',
|
||||
headerName: 'Created At',
|
||||
|
||||
@@ -6,13 +6,13 @@ import Typography from '@navi/web-ui/lib/primitives/Typography';
|
||||
import { toast } from '@navi/web-ui/lib/primitives/Toast';
|
||||
import LoadingIcon from '@navi/web-ui/lib/icons/LoadingIcon';
|
||||
|
||||
import { ApiService } from '@src/services/api';
|
||||
import { returnFormattedDate } from '@src/services/globalUtils';
|
||||
import {
|
||||
ContentProps,
|
||||
FETCH_PARTICIPANTS_DATA,
|
||||
IncidentConstants,
|
||||
} from '../constants';
|
||||
import { ApiService } from '@src/services/api';
|
||||
|
||||
import styles from './Content.module.scss';
|
||||
import commonStyles from '../Incidents.module.scss';
|
||||
|
||||
@@ -55,7 +55,7 @@ const Content = (props: ContentProps) => {
|
||||
<div>
|
||||
<Typography variant="h4" className={styles['content-info']}>
|
||||
{IncidentConstants.title}:{' '}
|
||||
<Typography variant="p3">{incidentData?.incidentName}</Typography>
|
||||
<Typography variant="p3">{incidentData?.title}</Typography>
|
||||
</Typography>
|
||||
</div>
|
||||
<div className={styles['description-details']}>
|
||||
@@ -69,7 +69,7 @@ const Content = (props: ContentProps) => {
|
||||
dataArray={[
|
||||
{
|
||||
key: 'Created At',
|
||||
value: incidentData?.createdAt,
|
||||
value: returnFormattedDate(incidentData?.createdAt),
|
||||
},
|
||||
{
|
||||
key: 'Created By',
|
||||
@@ -77,7 +77,7 @@ const Content = (props: ContentProps) => {
|
||||
},
|
||||
{
|
||||
key: 'Updated At',
|
||||
value: incidentData?.updatedAt,
|
||||
value: returnFormattedDate(incidentData?.updatedAt),
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ export const FETCH_SINGLE_INCIDENT_DATA = (payload: any): string => {
|
||||
};
|
||||
|
||||
export const FETCH_PARTICIPANTS_DATA = (payload: string): string => {
|
||||
return `${window?.config?.BASE_API_URL}/users?${payload}`;
|
||||
return `${window?.config?.BASE_API_URL}/users?channelId=${payload}`;
|
||||
};
|
||||
|
||||
export const FETCH_HEADER_DETAILS = `${window?.config?.BASE_API_URL}/incidents/header`;
|
||||
|
||||
@@ -46,11 +46,8 @@ const Incident: FC = () => {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Typography variant="p3" className={styles['incident-detail']}>
|
||||
{IncidentConstants.incidents}:{' '}
|
||||
<Typography variant="h3">
|
||||
{data?.id} - {data?.title}
|
||||
</Typography>
|
||||
<Typography variant="h3" className={styles['incident-detail']}>
|
||||
{data?.id}: <Typography variant="h3">{data?.title}</Typography>
|
||||
</Typography>
|
||||
<Header incidentId={incidentId} incidentData={data} />
|
||||
<div className={styles['incident-info-wrapper']}>
|
||||
|
||||
@@ -8,7 +8,6 @@ import { ApiService } from '@src/services/api';
|
||||
import {
|
||||
DefaultSeverityState,
|
||||
FETCH_SEVERITY_DATA,
|
||||
isSaveBtnDisabled,
|
||||
UPDATE_SEVERITY_DATA,
|
||||
} from './constants';
|
||||
import FallbackComponent from '@src/components/Fallback';
|
||||
@@ -49,6 +48,7 @@ const SeverityForm: FC = () => {
|
||||
ApiService.post(endPoint, data)
|
||||
.then(response => {
|
||||
toast.success('Severities Updated Successfully');
|
||||
console.log('severity update response: ', response);
|
||||
})
|
||||
.catch(error => {
|
||||
const toastMessage = `${
|
||||
@@ -84,7 +84,6 @@ const SeverityForm: FC = () => {
|
||||
</div>
|
||||
))}
|
||||
<Button
|
||||
disabled={isSaveBtnDisabled(data)}
|
||||
className={styles['save-btn']}
|
||||
variant="primary"
|
||||
onClick={submitHandler}
|
||||
|
||||
@@ -19,3 +19,11 @@ export const convertToCamelCase = (input: string): string => {
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
export const returnFormattedDate = (date: any): string => {
|
||||
if (!date) {
|
||||
return '-';
|
||||
}
|
||||
const formattedDate = new Date(date);
|
||||
return `${formattedDate?.toLocaleDateString()} ${formattedDate?.toLocaleTimeString()}`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user