Changed 'Role' to 'Application Role'

This commit is contained in:
Pramod Mahajan 2025-04-15 01:08:59 +05:30
parent 57272eb894
commit d1c36dfd97
7 changed files with 14 additions and 12 deletions

View File

@ -61,8 +61,8 @@ const onSubmit = (values) => {
const cachedData = getCachedData( "Role" ); const cachedData = getCachedData( "Role" );
const updatedData = [...cachedData, resp.data]; const updatedData = [...cachedData, resp.data];
cacheData("Role", updatedData); cacheData("Application Role", updatedData);
showToast("Role Added successfully.", "success"); showToast("Application Role Added successfully.", "success");
onClose() onClose()
} ).catch( ( err ) => } ).catch( ( err ) =>
{ {

View File

@ -101,7 +101,7 @@ const EditMaster=({master,onClose})=> {
setIsLoading( false ) setIsLoading( false )
const cachedData = getCachedData("Role"); const cachedData = getCachedData("Application Role");
if (cachedData) { if (cachedData) {
@ -109,9 +109,9 @@ const EditMaster=({master,onClose})=> {
role.id === resp.data?.id ? { ...role, ...resp.data } : role 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) setIsLoading(false)
onClose() onClose()
}).catch((Err)=>{ }).catch((Err)=>{

View File

@ -33,13 +33,13 @@ const MasterModal = ({ modaldata, closeModal }) => {
onClick={closeModal} onClick={closeModal}
></button> ></button>
<div className="text-center mb-2"></div> <div className="text-center mb-2"></div>
{modaldata?.modalType === "Role" && ( {modaldata?.modalType === "Application Role" && (
<CreateRole <CreateRole
masmodalType={modaldata.masterType} masmodalType={modaldata.masterType}
onClose={closeModal} onClose={closeModal}
/> />
)} )}
{modaldata?.modalType === "Edit-Role" && ( {modaldata?.modalType === "Edit-Application Role" && (
<EditRole master={modaldata} onClose={closeModal} /> <EditRole master={modaldata} onClose={closeModal} />
)} )}
{modaldata?.modalType === "delete" && ( {modaldata?.modalType === "delete" && (

View File

@ -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 = [ export const dailyTask = [
{ {

View File

@ -35,7 +35,7 @@ const useMaster = () => {
} else { } else {
let response; let response;
switch (selectedMaster) { switch (selectedMaster) {
case "Role": case "Application Role":
response = await MasterRespository.getRoles(); response = await MasterRespository.getRoles();
response = response.data; response = response.data;
break; break;

View File

@ -28,7 +28,7 @@ const MasterTable = ( {data, columns, loading, handleModalData} ) =>
.map((col) => ({ .map((col) => ({
...col, ...col,
label: 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 ( return (
@ -45,7 +45,7 @@ const MasterTable = ( {data, columns, loading, handleModalData} ) =>
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
<th>{ selectedMaster} Name</th> <th> Name</th>
<th>{selectedMaster} {selectedMaster === "Activity" ? "Unit":"Description" }</th> <th>{selectedMaster} {selectedMaster === "Activity" ? "Unit":"Description" }</th>
<th className={` ${!hasMasterPermission && 'd-none'}`}>Actions</th> <th className={` ${!hasMasterPermission && 'd-none'}`}>Actions</th>
</tr> </tr>

View File

@ -3,7 +3,7 @@ import { createSlice } from "@reduxjs/toolkit";
const localVariablesSlice = createSlice({ const localVariablesSlice = createSlice({
name: "localVariables", name: "localVariables",
initialState: { initialState: {
selectedMaster:"Role", selectedMaster:"Application Role",
regularizationCount:0, regularizationCount:0,
projectId:1, projectId:1,