From 9b58c84cf6956b05f422bd06d344bb972cfc7893 Mon Sep 17 00:00:00 2001 From: amritkv Date: Mon, 29 Jul 2024 16:51:06 +0530 Subject: [PATCH 1/3] feat(CR): Added edit button under actions column in open CR table --- .../components/OpenClearingRequest.tsx | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/app/[locale]/requests/components/OpenClearingRequest.tsx b/src/app/[locale]/requests/components/OpenClearingRequest.tsx index 1108f7ce1..4ff3bfab7 100644 --- a/src/app/[locale]/requests/components/OpenClearingRequest.tsx +++ b/src/app/[locale]/requests/components/OpenClearingRequest.tsx @@ -19,6 +19,7 @@ import { getSession, signOut, useSession } from 'next-auth/react' import { notFound } from 'next/navigation' import { ClearingRequest } from '@/object-types' import { Spinner } from 'react-bootstrap' +import { FaPencilAlt } from 'react-icons/fa' type EmbeddedClearingRequest = Embedded @@ -200,7 +201,9 @@ function OpenClearingRequest() { item.requestedClearingDate ?? '', item.agreedClearingDate ?? '', clearingRequestType[item.clearingType] ?? '', - '' + { + requestId: item.id + }, ] }) ) @@ -215,7 +218,8 @@ function OpenClearingRequest() { formatter: ({ requestId }: { requestId: string; }) => _( <> - + {requestId} @@ -339,6 +343,15 @@ function OpenClearingRequest() { id: 'openClearingRequest.actions', name: t('Actions'), sort: true, + formatter: ({ requestId }: { requestId: string }) => + _( + <> + + + + + ) } ] @@ -351,7 +364,10 @@ function OpenClearingRequest() {
{loading == false ? (
- +
) : ( From 3abcd991068319b3aa17ec6b7335ee9836d50764 Mon Sep 17 00:00:00 2001 From: amritkv Date: Mon, 29 Jul 2024 17:17:02 +0530 Subject: [PATCH 2/3] feat(CR): Added tooltip to edit CR icon in open CR table --- .../requests/components/OpenClearingRequest.tsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/app/[locale]/requests/components/OpenClearingRequest.tsx b/src/app/[locale]/requests/components/OpenClearingRequest.tsx index 4ff3bfab7..2fe468a8a 100644 --- a/src/app/[locale]/requests/components/OpenClearingRequest.tsx +++ b/src/app/[locale]/requests/components/OpenClearingRequest.tsx @@ -18,7 +18,7 @@ import { Embedded, HttpStatus } from '@/object-types' import { getSession, signOut, useSession } from 'next-auth/react' import { notFound } from 'next/navigation' import { ClearingRequest } from '@/object-types' -import { Spinner } from 'react-bootstrap' +import { OverlayTrigger, Spinner, Tooltip } from 'react-bootstrap' import { FaPencilAlt } from 'react-icons/fa' type EmbeddedClearingRequest = Embedded @@ -346,10 +346,15 @@ function OpenClearingRequest() { formatter: ({ requestId }: { requestId: string }) => _( <> - - - + + {t('Edit')} + }> + + + + ) } From c71f0088201774fe8ca2b2f1e46cbf15c72dc304 Mon Sep 17 00:00:00 2001 From: amritkv Date: Wed, 7 Aug 2024 13:31:58 +0530 Subject: [PATCH 3/3] feat(Open_CR): Added edit button in open CR table --- .../requests/components/OpenClearingRequest.tsx | 17 ++++++++++------- src/styles/globals.css | 13 +++++++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/app/[locale]/requests/components/OpenClearingRequest.tsx b/src/app/[locale]/requests/components/OpenClearingRequest.tsx index 2fe468a8a..6edef68d2 100644 --- a/src/app/[locale]/requests/components/OpenClearingRequest.tsx +++ b/src/app/[locale]/requests/components/OpenClearingRequest.tsx @@ -18,7 +18,7 @@ import { Embedded, HttpStatus } from '@/object-types' import { getSession, signOut, useSession } from 'next-auth/react' import { notFound } from 'next/navigation' import { ClearingRequest } from '@/object-types' -import { OverlayTrigger, Spinner, Tooltip } from 'react-bootstrap' +import { Button, OverlayTrigger, Spinner, Tooltip } from 'react-bootstrap' import { FaPencilAlt } from 'react-icons/fa' type EmbeddedClearingRequest = Embedded @@ -113,6 +113,7 @@ function OpenClearingRequest() { const t = useTranslations('default') const [loading, setLoading] = useState(true) const { data: session, status } = useSession() + const [isProjectDeleted, setIsProjectDeleted] = useState(false) const [tableData, setTableData] = useState>([]) const clearingRequestStatus : ClearingRequestDataMap = { NEW: t('New'), @@ -162,9 +163,8 @@ function OpenClearingRequest() { }); setTableData( filteredClearingRequests.map((item: ClearingRequest) => { - let isProjectDeleted : boolean = false if (!Object.hasOwn(item, 'projectId')){ - isProjectDeleted = true + setIsProjectDeleted(true) } return [ { @@ -350,10 +350,13 @@ function OpenClearingRequest() { {t('Edit')} }> - - - + ) diff --git a/src/styles/globals.css b/src/styles/globals.css index 2db0a1852..90c107ce4 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -1174,3 +1174,16 @@ a.text-primary { border-color: transparent !important; color: #ffffff !important; } + +.btn-transparent { + background-color: #ffffff !important; + border-color: #ffffff !important; + color: #000000 !important; +} + +.btn-transparent:hover { + background-color: #ffffff !important; + border-color: #ffffff !important; + color: #000000 !important; +} +