Refactor_Directory And Project Level Permsssion #404

Merged
pramod.mahajan merged 90 commits from Refactor_Directory into main 2025-09-17 10:24:46 +00:00
5 changed files with 12 additions and 12 deletions
Showing only changes of commit 7e5b6952f5 - Show all commits

View File

@ -81,21 +81,21 @@ export const defaultContactValue = {
}; };
export const contactsFilter = z.object({ export const contactsFilter = z.object({
buckets: z.array(z.string()).optional(), bucketIds: z.array(z.string()).optional(),
contactCategories: z.array(z.string()).optional(), categoryIds: z.array(z.string()).optional(),
}); });
export const defaultContactFilter = { export const defaultContactFilter = {
buckets: [], bucketIds: [],
contactCategories: [], categoryIds: [],
}; };
export const notesFilter = z.object({ export const notesFilter = z.object({
createdBy: z.array(z.string()).optional(), createdByIds: z.array(z.string()).optional(),
organizations: z.array(z.string()).optional(), organizations: z.array(z.string()).optional(),
}); });
export const defaultNotesFilter = { export const defaultNotesFilter = {
createdBy: [], createdByIds: [],
organizations: [], organizations: [],
}; };

View File

@ -243,7 +243,7 @@ export const useDirectoryNotes = (
const cleanFilter = (filter) => { const cleanFilter = (filter) => {
const cleaned = { ...filter }; const cleaned = { ...filter };
["bucketIds", "contactCategories"].forEach((key) => { ["bucketIds", "categoryIds"].forEach((key) => {
if (Array.isArray(cleaned[key]) && cleaned[key].length === 0) { if (Array.isArray(cleaned[key]) && cleaned[key].length === 0) {
delete cleaned[key]; delete cleaned[key];
} }
@ -307,7 +307,7 @@ export const useContactDetails = (contactId) => {
const cleanNoteFilter = (filter) => { const cleanNoteFilter = (filter) => {
const cleaned = { ...filter }; const cleaned = { ...filter };
["bucketIds", "contactCategories"].forEach((key) => { ["createdByIds", "organizations"].forEach((key) => {
if (Array.isArray(cleaned[key]) && cleaned[key].length === 0) { if (Array.isArray(cleaned[key]) && cleaned[key].length === 0) {
delete cleaned[key]; delete cleaned[key];
} }

View File

@ -42,14 +42,14 @@ const ContactFilterPanel = ({ onApply, clearFilter }) => {
<form onSubmit={handleSubmit(onSubmit)} className="p-2 text-start"> <form onSubmit={handleSubmit(onSubmit)} className="p-2 text-start">
<div className="row g-2"> <div className="row g-2">
<SelectMultiple <SelectMultiple
name="buckets" name="bucketIds"
label="Buckets :" label="Buckets :"
options={data.buckets} options={data.buckets}
labelKey="name" labelKey="name"
valueKey="id" valueKey="id"
/> />
<SelectMultiple <SelectMultiple
name="contactCategories" name="categoryIds"
label="Contact Category :" label="Contact Category :"
options={data.contactCategories} options={data.contactCategories}
labelKey={(item) => item.name} labelKey={(item) => item.name}

View File

@ -42,7 +42,7 @@ const NoteFilterPanel = ({ onApply, clearFilter }) => {
<form onSubmit={handleSubmit(onSubmit)} className="p-2 text-start"> <form onSubmit={handleSubmit(onSubmit)} className="p-2 text-start">
<div className="row g-2"> <div className="row g-2">
<SelectMultiple <SelectMultiple
name="createdBy" name="createdByIds"
label="Created By :" label="Created By :"
options={data.createdBy} options={data.createdBy}
labelKey="name" labelKey="name"

View File

@ -62,5 +62,5 @@ export const DirectoryRepository = {
)}&searchString=${encodeURIComponent(searchString)}` )}&searchString=${encodeURIComponent(searchString)}`
); );
}, },
GetNoteFilter:()=>api.get("/api/Directory/notes/filter") GetNoteFilter:()=>api.get("/api/directory/notes/filter")
}; };