From f68c72a92a85f5155e9052216f516bd8034c61d2 Mon Sep 17 00:00:00 2001 From: shancds Date: Mon, 26 May 2025 10:26:51 +0530 Subject: [PATCH] feat(ratecard-drawer): add confirmation popover for role deletion and improve button styling --- .../ratecard-drawer/ratecard-drawer.tsx | 49 ++++++++++++------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/worklenz-frontend/src/features/finance/ratecard-drawer/ratecard-drawer.tsx b/worklenz-frontend/src/features/finance/ratecard-drawer/ratecard-drawer.tsx index 70db6293..2855cea0 100644 --- a/worklenz-frontend/src/features/finance/ratecard-drawer/ratecard-drawer.tsx +++ b/worklenz-frontend/src/features/finance/ratecard-drawer/ratecard-drawer.tsx @@ -1,4 +1,4 @@ -import { Drawer, Select, Typography, Flex, Button, Input, Table } from 'antd'; +import { Drawer, Select, Typography, Flex, Button, Input, Table, Popconfirm, Tooltip } from 'antd'; import React, { useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useAppSelector } from '../../../hooks/useAppSelector'; @@ -7,7 +7,8 @@ import { deleteRateCard, fetchRateCardById, fetchRateCards, toggleRatecardDrawer import { RatecardType, IJobType } from '@/types/project/ratecard.types'; import { IJobTitlesViewModel } from '@/types/job.types'; import { jobTitlesApiService } from '@/api/settings/job-titles/job-titles.api.service'; -import { DeleteOutlined } from '@ant-design/icons'; +import { DeleteOutlined, ExclamationCircleFilled } from '@ant-design/icons'; +import { colors } from '@/styles/colors'; interface PaginationType { current: number; @@ -220,7 +221,7 @@ const RatecardDrawer = ({ setAddingRowIndex(null); }} onBlur={() => { - if (roles[index].job_title_id === ""){ + if (roles[index].job_title_id === "") { handleDeleteRole(index); } setEditingRowIndex(null); @@ -244,7 +245,7 @@ const RatecardDrawer = ({ return ( setEditingRowIndex(index)} + // onClick={() => setEditingRowIndex(index)} > {record.jobtitle} @@ -280,11 +281,25 @@ const RatecardDrawer = ({ title: t('actionsColumn') || 'Actions', dataIndex: 'actions', render: (_: any, __: any, index: number) => ( - + } > @@ -356,13 +371,13 @@ const RatecardDrawer = ({ pagination={false} footer={() => ( + type="dashed" + onClick={handleAddRole} + block + style={{ margin: 0, padding: 0 }} + > + {t('addRoleButton')} + )} />