From d1c36dfd97bad0cd0dc462b84895232e11eb13ff Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Tue, 15 Apr 2025 01:08:59 +0530 Subject: [PATCH] Changed 'Role' to 'Application Role' --- src/components/master/CreateRole.jsx | 4 ++-- src/components/master/EditRole.jsx | 6 +++--- src/components/master/MasterModal.jsx | 4 ++-- src/data/masters.js | 4 +++- src/hooks/masterHook/useMaster.js | 2 +- src/pages/master/MasterTable.jsx | 4 ++-- src/slices/localVariablesSlice.jsx | 2 +- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/components/master/CreateRole.jsx b/src/components/master/CreateRole.jsx index 18fb9233..90f608e6 100644 --- a/src/components/master/CreateRole.jsx +++ b/src/components/master/CreateRole.jsx @@ -61,8 +61,8 @@ const onSubmit = (values) => { const cachedData = getCachedData( "Role" ); const updatedData = [...cachedData, resp.data]; - cacheData("Role", updatedData); - showToast("Role Added successfully.", "success"); + cacheData("Application Role", updatedData); + showToast("Application Role Added successfully.", "success"); onClose() } ).catch( ( err ) => { diff --git a/src/components/master/EditRole.jsx b/src/components/master/EditRole.jsx index 9dee7f11..51652f05 100644 --- a/src/components/master/EditRole.jsx +++ b/src/components/master/EditRole.jsx @@ -101,7 +101,7 @@ const EditMaster=({master,onClose})=> { setIsLoading( false ) - const cachedData = getCachedData("Role"); + const cachedData = getCachedData("Application Role"); if (cachedData) { @@ -109,9 +109,9 @@ const EditMaster=({master,onClose})=> { role.id === resp.data?.id ? { ...role, ...resp.data } : role ); - cacheData("Role", updatedData); + cacheData("Application Role", updatedData); } - showToast( "Role Update successfully.", "success" ); + showToast( "Application Role Updated successfully.", "success" ); setIsLoading(false) onClose() }).catch((Err)=>{ diff --git a/src/components/master/MasterModal.jsx b/src/components/master/MasterModal.jsx index 19aea645..3a2dd4ae 100644 --- a/src/components/master/MasterModal.jsx +++ b/src/components/master/MasterModal.jsx @@ -33,13 +33,13 @@ const MasterModal = ({ modaldata, closeModal }) => { onClick={closeModal} >
- {modaldata?.modalType === "Role" && ( + {modaldata?.modalType === "Application Role" && ( )} - {modaldata?.modalType === "Edit-Role" && ( + {modaldata?.modalType === "Edit-Application Role" && ( )} {modaldata?.modalType === "delete" && ( diff --git a/src/data/masters.js b/src/data/masters.js index dcf0c834..c1036ed7 100644 --- a/src/data/masters.js +++ b/src/data/masters.js @@ -1,4 +1,6 @@ -export const mastersList = [{id:1, name: "Role"},{id:2, name: "Job Role"},{id:3,name:"Activity"}] +// it important ------ +export const mastersList = [ {id: 1, name: "Application Role"}, {id: 2, name: "Job Role"}, {id: 3, name: "Activity"} ] +// ------------------- export const dailyTask = [ { diff --git a/src/hooks/masterHook/useMaster.js b/src/hooks/masterHook/useMaster.js index dbe420e8..089f5678 100644 --- a/src/hooks/masterHook/useMaster.js +++ b/src/hooks/masterHook/useMaster.js @@ -35,7 +35,7 @@ const useMaster = () => { } else { let response; switch (selectedMaster) { - case "Role": + case "Application Role": response = await MasterRespository.getRoles(); response = response.data; break; diff --git a/src/pages/master/MasterTable.jsx b/src/pages/master/MasterTable.jsx index 44715ea5..c2e75172 100644 --- a/src/pages/master/MasterTable.jsx +++ b/src/pages/master/MasterTable.jsx @@ -28,7 +28,7 @@ const MasterTable = ( {data, columns, loading, handleModalData} ) => .map((col) => ({ ...col, label: - col.key === "role" || col.key === "Activity" || col.key === "status" ? "Name" : col.label, + col.key === "role" || col.key === "activityName" || col.key === "status" ? "Name" : col.label, })); return ( @@ -45,7 +45,7 @@ const MasterTable = ( {data, columns, loading, handleModalData} ) => - { selectedMaster} Name + Name {selectedMaster} {selectedMaster === "Activity" ? "Unit":"Description" } Actions diff --git a/src/slices/localVariablesSlice.jsx b/src/slices/localVariablesSlice.jsx index 8a01ff33..11a33621 100644 --- a/src/slices/localVariablesSlice.jsx +++ b/src/slices/localVariablesSlice.jsx @@ -3,7 +3,7 @@ import { createSlice } from "@reduxjs/toolkit"; const localVariablesSlice = createSlice({ name: "localVariables", initialState: { - selectedMaster:"Role", + selectedMaster:"Application Role", regularizationCount:0, projectId:1,