Compare commits

...

10 Commits

Author SHA1 Message Date
Shivam Handa
d51b3dd407 NTP-45411 | ui manager fix (#148)
Some checks failed
Build / Build Check (18.17.1) (push) Has been cancelled
Lint and Prettier checks / Lint checks and prettier (18.17.1) (push) Has been cancelled
2025-03-06 18:41:21 +05:30
Amitesh Vijaykumar Magar
a4e20c4395 NTP-42029 | Last minute changes (#147)
* NTP-42029 | Updated Dockerfile.

* NTP-42029 | DropDown changes.

* NTP-42029 | Version changes.
2025-02-26 18:48:08 +05:30
Amitesh Vijaykumar Magar
3f3ae0bbb3 NTP-42029 | Final changes in UI (#146)
* NTP-42029 | Changes in Houston-ui.

* NTP-42029 | Completed first set of corrections.

* NTP-42029 | Fixing lint checks.

* NTP-42029 | Lint fixes.

* NTP-42029 | Resolving comments.

* NTP-42029 | Added error absence validatin for submit activeness.

* NTP-42029 | Changes for fetching team_type.
2025-02-26 16:59:22 +05:30
Amitesh Vijaykumar Magar
944a8bcad4 NTP-42029 | Changes in Houston-ui. (#145)
* NTP-42029 | Changes in Houston-ui.

* NTP-42029 | Completed first set of corrections.

* NTP-42029 | Fixing lint checks.

* NTP-42029 | Lint fixes.

* NTP-42029 | Resolving comments.

* NTP-42029 | Added error absence validatin for submit activeness.
2025-02-26 15:29:37 +05:30
Vijay Joshi
cf2c345977 Merge pull request #143 from navi-sa/INFRA-3705
INFRA-3705 : Add checkbox for is cx
2024-09-17 16:09:18 +05:30
Vijay Joshi
ac4f1def1a INFRA-3705 : Fix checkbox message 2024-09-17 15:57:31 +05:30
Vijay Joshi
15d03dbd83 INFRA-3705 : Add checkbox for is cx 2024-09-17 15:45:51 +05:30
Vijay Joshi
3a34d49b4d Merge pull request #142 from navi-sa/INFRA-3664
INFRA-3664 : Change endpoint for fetching incident participants data
2024-08-29 11:54:22 +05:30
Vijay Joshi
d8a569ba42 INFRA-3664 : Change endpoint for fetching incident participants data 2024-08-29 11:28:07 +05:30
Vijay Joshi
4c581f5bb3 INFRA-3664 : Change endpoint for fetching incident participants data 2024-08-29 11:25:46 +05:30
10 changed files with 91 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
FROM 193044292705.dkr.ecr.ap-south-1.amazonaws.com/common/node:16.15.1-alpine3.16 as build
FROM 193044292705.dkr.ecr.ap-south-1.amazonaws.com/common/node:16.17.0-alpine3.16 as build
WORKDIR /app
COPY . /app
@@ -10,6 +10,7 @@ RUN yarn build
FROM 193044292705.dkr.ecr.ap-south-1.amazonaws.com/common/nginx:1.23.3-alpine
COPY --from=build /app/dist /usr/share/nginx/html
RUN apk update && apk upgrade
RUN adduser -u 4000 non-root-user -D ''
RUN chown -R 4000:4000 /var/cache/nginx \
&& chown -R 4000:4000 /etc/nginx/conf.d/ \

View File

@@ -20,7 +20,7 @@ export const FETCH_INCIDENT_DATA = (payload: any): string => {
};
export const FETCH_PARTICIPANTS_DATA = (payload: string): string => {
return `${URL_PREFIX}/users?channel_id=${payload}`;
return `${URL_PREFIX}/incident-user?incident_id=${payload}`;
};
export const FETCH_HEADER_DETAILS = `${URL_PREFIX}/incidents/header`;

View File

@@ -51,7 +51,7 @@ const useIncidentApis = (): useIncidentApiProps => {
.then(response => {
dispatch(setIncidentData(response?.data?.data));
fetchIncidentLog(incidentId);
fetchParticipants(response?.data?.data?.slackChannel);
fetchParticipants(response?.data?.data?.id);
})
.catch(handleApiError);
};
@@ -65,8 +65,8 @@ const useIncidentApis = (): useIncidentApiProps => {
.catch(handleApiError);
};
const fetchParticipants = (slackChannel: string): void => {
const endPoint = FETCH_PARTICIPANTS_DATA(slackChannel);
const fetchParticipants = (incidentId: string): void => {
const endPoint = FETCH_PARTICIPANTS_DATA(incidentId);
ApiService.get(endPoint)
.then(response => {
dispatch(setParticipantsData(response?.data?.data));

View File

@@ -1,5 +1,6 @@
import { createURL } from '@src/services/globalUtils';
import { ActionType, AppState, Member } from './types';
import { ActionType, AppState } from './types';
import { SelectPickerOptionProps } from '@navi/web-ui/lib/components/SelectPicker/types';
const URL_PREFIX = createURL('/houston');
@@ -12,6 +13,10 @@ export const FETCH_SINGLE_TEAM_DATA = (payload: string): string => {
return `${URL_PREFIX}/teams-v2/${payload}`;
};
export const FETCH_TEAM_TYPES = (payload: string): string => {
return `${URL_PREFIX}/team-types`;
};
export const UPDATE_TEAM_DATA = (): string => {
return `${URL_PREFIX}/teams-v2`;
};
@@ -26,6 +31,7 @@ export const MAKE_MANAGER = (teamId: string, userId: string): string => {
export const regularExpression = /^[a-zA-Z][a-zA-Z0-9_ -]{1,48}[a-zA-Z0-9]$/;
export const validEmail = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
export const teamTypeRegularExpression = /^[A-Z]{2,10}$/;
export const emailRegularExpression = /^[a-zA-Z0-9._+-]+@navi\.com$/;
export const DEFAULT_SEVERITY = {
label: 'Sev-3',
@@ -50,6 +56,8 @@ export const actionTypes = {
SET_TEAM_NAME_ERROR: 'SET_TEAM_NAME_ERROR',
SET_EMAIL_ERROR: 'SET_EMAIL_ERROR',
SET_EMAIL: 'SET_EMAIL',
SET_TEAM_TYPE: 'SET_TEAM_TYPE',
SET_IS_CX: 'SET_IS_CX',
SET_CLEAR_MODAL: 'SET_CLEAR_MODAL',
SET_ADD_MEMBER_ERROR: 'SET_ADD_MEMBER_ERROR',
};
@@ -82,6 +90,9 @@ export const initialState: AppState = {
teamName: '',
teamNameError: '',
emailError: '',
teamType: '',
teamTypeError: '',
isCx: false,
email: '',
clearModal: false,
addMemberError: '',
@@ -190,7 +201,29 @@ export const reducer = (state: AppState, action: ActionType): AppState => {
...state,
addMemberError: action.payload,
};
case actionTypes.SET_IS_CX:
return {
...state,
isCx: action.payload,
};
case actionTypes.SET_TEAM_TYPE:
return {
...state,
teamType: action.payload,
};
default:
return state;
}
};
export enum TEAM_TYPES {
CX = 'CX',
BF = 'BF',
DEFAULT = 'DEFAULT',
}
export const teamTypesMapping: SelectPickerOptionProps[] = [
{ label: 'CX-Team', value: TEAM_TYPES.CX },
{ label: 'Business-Function Team', value: TEAM_TYPES.BF },
{ label: 'Default (Tech-Team)', value: TEAM_TYPES.DEFAULT },
];

View File

@@ -12,3 +12,9 @@
.input-wrapper {
@include team-form-wrapper;
}
.select-picker-wrapper {
@include team-form-wrapper;
}
.team-type-label {
@include team-form-wrapper;
}

View File

@@ -1,7 +1,9 @@
import { useReducer } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { Typography } from '@navi/web-ui/lib/primitives';
import Typography from '@navi/web-ui/lib/primitives/Typography';
import { AlertOutlineIcon } from '@navi/web-ui/lib/icons';
import { SingleSelectAutoComplete } from '@navi/web-ui/lib/components';
import { SelectPickerValue } from '@navi/web-ui/lib/components/SelectPicker/types';
import { BorderedInput, ModalDialog } from '@navi/web-ui/lib/primitives';
import { toast } from '@navi/web-ui/lib/primitives/Toast';
import { AppDispatch } from '@src/store';
@@ -24,6 +26,7 @@ import {
regularExpression,
emailRegularExpression,
validEmail,
teamTypesMapping,
} from '@src/Pages/TeamRevamp/constants';
import { CreateTeamProps } from '@src/Pages/TeamRevamp/types';
import styles from './CreateTeam.module.scss';
@@ -36,6 +39,7 @@ const CreateTeam: React.FC<CreateTeamProps> = ({ handleSetTeam }) => {
const { fireEvent } = useClickStream();
const { EVENT_NAME, SCREEN_NAME } = CLICK_STREAM_EVENT_FACTORY;
const { modalOpen } = useSelector(selectSearchTeamData);
const validateTeamName = (value: string): void => {
value = value.trim();
dispatchData({
@@ -56,6 +60,7 @@ const CreateTeam: React.FC<CreateTeamProps> = ({ handleSetTeam }) => {
: '',
});
};
const handleTeamNameChange = (
e: React.ChangeEvent<HTMLInputElement>,
): void => {
@@ -76,6 +81,14 @@ const CreateTeam: React.FC<CreateTeamProps> = ({ handleSetTeam }) => {
validateEmail(inputValue);
};
const handleTeamTypeChange = (option: SelectPickerValue): void => {
if (!option) return;
dispatchData({
type: actionTypes.SET_TEAM_TYPE,
payload: option.toString(),
});
};
const addTeamHandler = (): void => {
fireEvent(EVENT_NAME.Houston_Create_Team, {
screen_name: SCREEN_NAME.TEAM_PAGE,
@@ -86,6 +99,7 @@ const CreateTeam: React.FC<CreateTeamProps> = ({ handleSetTeam }) => {
email: state.email,
severity_id: DEFAULT_SEVERITY_ID,
},
team_type: state.teamType,
})
.then(response => {
const toastMessage = `${response?.data?.data?.message}`;
@@ -132,6 +146,8 @@ const CreateTeam: React.FC<CreateTeamProps> = ({ handleSetTeam }) => {
disabled:
!!state.teamNameError ||
!!state.emailError ||
!!state.teamTypeError ||
!state.teamType ||
!state.teamName ||
!state.email,
},
@@ -168,6 +184,20 @@ const CreateTeam: React.FC<CreateTeamProps> = ({ handleSetTeam }) => {
/>
</Typography>
</div>
<div className={styles['select-picker-wrapper']}>
<Typography variant="p1">
<SingleSelectAutoComplete
inputLabel={'Team type'}
options={teamTypesMapping}
selectedOption={state.teamType ?? 'DEFAULT'}
updateSelectedOptions={handleTeamTypeChange}
variant="bordered"
placeholder={'Select team type'}
containerClassName={styles['team-type']}
/>
</Typography>
</div>
</ModalDialog>
)}
</div>

View File

@@ -16,6 +16,12 @@
.team-name {
margin: 24px 24px 24px 0px;
color: var(--navi-color-gray-c1);
display: inline;
}
.team-type-label {
margin: 12px 12px 12px 0px;
color: var(--navi-color-gray-c2);
display: inline;
}
.slack-details-wrapper {
display: inline-flex;

View File

@@ -157,6 +157,9 @@ const TeamDetails: React.FC = () => {
<Typography variant="h1" className={styles['team-name']}>
{teamDetails?.name}
</Typography>{' '}
<Typography variant="h3" className={styles['team-type-label']}>
{teamDetails?.team_type}
</Typography>
<Typography variant="h5" className={styles['member-div']}>
SLACK DETAILS
</Typography>{' '}

View File

@@ -29,7 +29,7 @@ const SeverityWiseList: FC<SeverityWiseListProps> = (
const Role = useAuthData();
const computedClassName = (item: Member): string => {
return (
(manager?.email === item.email && styles['manager-wrapper']) ||
(manager?.id === item.id && styles['manager-wrapper']) ||
(userEmail !== managerEmail &&
!Role.includes('Admin') &&
styles['team-member-view']) ||

View File

@@ -92,6 +92,7 @@ export interface TeamsDetail {
oncall?: { id: string; name: string };
pse_oncall?: { id: string; name: string };
slack_channel?: { id: string; name: string };
team_type?: string;
}
export interface AppState {
openDialog: boolean;
@@ -119,7 +120,10 @@ export interface AppState {
teamName: string;
teamNameError: string;
emailError: string;
teamType: string;
teamTypeError: string;
email: string;
isCx: boolean;
clearModal: boolean;
addMemberError: string;
}