From 35b036398f5ad7a38bb30978d3c32ff54af27778 Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Mon, 19 May 2025 13:37:05 +0530 Subject: [PATCH 01/26] chnaged checkbox color --- src/components/common/MultiSelectDropdown.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/common/MultiSelectDropdown.css b/src/components/common/MultiSelectDropdown.css index eae0fa94..38ada243 100644 --- a/src/components/common/MultiSelectDropdown.css +++ b/src/components/common/MultiSelectDropdown.css @@ -118,8 +118,8 @@ } .custom-checkbox:checked { - background-color: #0d6efd; - border-color: #0d6efd; + background-color: #696cff; + border-color: #696cff; } .custom-checkbox:checked::after { From 8a53e2d8deea8959ce1a090df1ca3546d1634cf2 Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Mon, 19 May 2025 16:32:09 +0530 Subject: [PATCH 02/26] replace add phone & email button with icon-only element for cleaner UI --- src/components/Directory/ManageDirectory.jsx | 63 ++++++++++---------- src/components/Directory/UpdateContact.jsx | 62 ++++++++++--------- 2 files changed, 61 insertions(+), 64 deletions(-) diff --git a/src/components/Directory/ManageDirectory.jsx b/src/components/Directory/ManageDirectory.jsx index a460f1b5..c01e92c2 100644 --- a/src/components/Directory/ManageDirectory.jsx +++ b/src/components/Directory/ManageDirectory.jsx @@ -204,23 +204,22 @@ useEffect(() => { placeholder="email@example.com" /> {index === emailFields.length - 1 ? ( - + // + // + // + // + // + // + // + // + >}
{children} {/* Render children here, which can be the ReportTask component */} From 3738730ecf54d934e12d3d01a6b7213fcd35a7b4 Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Tue, 20 May 2025 18:04:19 +0530 Subject: [PATCH 07/26] added GetNot,CreateNote,UpdateNote inside DirectoryRepository --- src/repositories/DirectoryRepository.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/repositories/DirectoryRepository.jsx b/src/repositories/DirectoryRepository.jsx index a45458a8..f1ad4dc7 100644 --- a/src/repositories/DirectoryRepository.jsx +++ b/src/repositories/DirectoryRepository.jsx @@ -9,5 +9,7 @@ export const DirectoryRepository = { GetContactProfile: ( id ) => api.get( `/api/directory/profile/${ id }` ), - CreateNote:(data)=>api.post('/api/directory/note',data) + CreateNote: ( data ) => api.post( '/api/directory/note', data ), + GetNote: ( id ) => api.get( `/api/directory/note/${ id }` ), + UpdateNote:(id,data)=>api.put(`/api/directory/note/${id }`,data ) } \ No newline at end of file From 6e8bd7eef81d36c5e042ada7f4427b856c9b8850 Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Tue, 20 May 2025 18:09:18 +0530 Subject: [PATCH 08/26] created useContactNote hook --- src/hooks/useDirectory.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/hooks/useDirectory.js b/src/hooks/useDirectory.js index 93a64058..7d18a554 100644 --- a/src/hooks/useDirectory.js +++ b/src/hooks/useDirectory.js @@ -99,3 +99,42 @@ const fetchContactProfile = async () => { return { conatProfile, loading, Error }; } + + +export const useContactNotes = (id) => +{ + const [ conatNotes, setContactNotes ] = useState( [] ); + const [ loading, setLoading ] = useState( false ); + const [ Error, setError ] = useState( "" ); + + +const fetchContactNotes = async () => { + const cached = getCachedData("Contact Notes"); + + if (!cached || cached.contactId !== id) { + setLoading(true); + try { + const resp = await DirectoryRepository.GetNote(id); + setContactNotes(resp.data); + cacheData("Contact Notes", { data: resp.data, contactId: id }); + } catch (err) { + const msg = + err?.response?.data?.message || err?.message || "Something went wrong"; + setError(msg); + } finally { + setLoading(false); + } + } else { + setContactNotes(cached.data); + } + }; + + useEffect(() => { + if ( id ) + { + fetchContactNotes(id); + } + }, [id]); + + return { conatProfile, loading, Error }; +} From c4de655fdf659531c11e4c25468453b9f836b065 Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Tue, 20 May 2025 18:10:52 +0530 Subject: [PATCH 09/26] created separated editor component for customize react-quill --- src/components/common/TextEditor/Editor.jsx | 91 +++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 src/components/common/TextEditor/Editor.jsx diff --git a/src/components/common/TextEditor/Editor.jsx b/src/components/common/TextEditor/Editor.jsx new file mode 100644 index 00000000..d23b22f3 --- /dev/null +++ b/src/components/common/TextEditor/Editor.jsx @@ -0,0 +1,91 @@ +import React, { useRef } from "react"; +import ReactQuill from "react-quill"; +import "quill/dist/quill.snow.css"; +import "./Editor.css"; + +const Editor = ({ + value, + onChange, + onCancel, + onSubmit, + placeholder = "Start writing...", +}) => { + const modules = { + toolbar: { + container: "#custom-toolbar", + }, + }; + + const formats = [ + "header", + "bold", + "italic", + "underline", + "strike", + "list", + "bullet", + "blockquote", + "code-block", + "link", + "align", + "image" + ]; + + return ( +
+ + +
+
+ {/* Left: Quill Format Buttons */} + + + +
+
+
+ ); +}; + +export default Editor; From 9c9a69bc52040f7a2270713372c67589a5a41482 Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Tue, 20 May 2025 18:13:22 +0530 Subject: [PATCH 10/26] Replaced buttons with icon-only UI for cleaner layout and smaller size --- src/components/Directory/UpdateContact.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Directory/UpdateContact.jsx b/src/components/Directory/UpdateContact.jsx index e1a07c16..03ae906c 100644 --- a/src/components/Directory/UpdateContact.jsx +++ b/src/components/Directory/UpdateContact.jsx @@ -245,7 +245,7 @@ await submitContact({ ...cleaned, id: existingContact.id }); // style={{ width: "24px", height: "24px" }} // > - + ) : ( //
@@ -305,7 +305,7 @@ await submitContact({ ...cleaned, id: existingContact.id }); // onClick={handleAddPhone} // style={{ width: "24px", height: "24px" }} // > - + ) : ( // - -
+
- { - listView ? ( -
- - - - - - - - - - - - - - {loading && ContatList.length === 0 && ( + {listView ? ( +
+
-
- alert("User icon clicked")} - /> - Name -
-
-
- - Email -
-
-
- alert("User icon clicked")} - /> - Phone -
-
-
- - Organization -
-
Category - Action -
+ - - - )} - {!loading && contacts.length == 0 && ContatList.length === 0 && ( - - - - )} - {!loading && - currentItems.map((contact) => ( - - ))} - -
Loading...
No Contact Found
-
- ) : ( -
- {currentItems.map((contact, index) => ( -
- -
- ))} -
- ) - } + +
+ alert("User icon clicked")} + /> + Name +
+ + +
+ + Email +
+ - - - + +
+ alert("User icon clicked")} + /> + Phone +
+ + +
+ + Organization +
+ + Category + + Action + + + + + {loading && ContatList.length === 0 && ( + + Loading... + + )} + {!loading && + contacts.length == 0 && + ContatList.length === 0 && ( + + No Contact Found + + )} + {!loading && + currentItems.map((contact) => ( + + ))} + + + + ) : ( +
+ {currentItems.map((contact, index) => ( +
+ +
+ ))} +
+ )} {!loading && (