diff --git a/public/img/illustrations/Box.svg b/public/img/illustrations/Box.svg new file mode 100644 index 00000000..378f1e39 --- /dev/null +++ b/public/img/illustrations/Box.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/public/img/illustrations/Done.svg b/public/img/illustrations/Done.svg new file mode 100644 index 00000000..bdeb5fda --- /dev/null +++ b/public/img/illustrations/Done.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/public/img/illustrations/EmptyInbox.svg b/public/img/illustrations/EmptyInbox.svg new file mode 100644 index 00000000..ca2c41f3 --- /dev/null +++ b/public/img/illustrations/EmptyInbox.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/public/img/illustrations/Error.svg b/public/img/illustrations/Error.svg new file mode 100644 index 00000000..5639086f --- /dev/null +++ b/public/img/illustrations/Error.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/public/img/illustrations/NoConnection.svg b/public/img/illustrations/NoConnection.svg new file mode 100644 index 00000000..fa6e0274 --- /dev/null +++ b/public/img/illustrations/NoConnection.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/public/img/illustrations/NoCreditCard.svg b/public/img/illustrations/NoCreditCard.svg new file mode 100644 index 00000000..06a8a244 --- /dev/null +++ b/public/img/illustrations/NoCreditCard.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/public/img/illustrations/NoDocuments.svg b/public/img/illustrations/NoDocuments.svg new file mode 100644 index 00000000..84a46ab4 --- /dev/null +++ b/public/img/illustrations/NoDocuments.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/public/img/illustrations/NoImages.svg b/public/img/illustrations/NoImages.svg new file mode 100644 index 00000000..c7e4ddf0 --- /dev/null +++ b/public/img/illustrations/NoImages.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/public/img/illustrations/NoItemsCart.svg b/public/img/illustrations/NoItemsCart.svg new file mode 100644 index 00000000..a94fe69c --- /dev/null +++ b/public/img/illustrations/NoItemsCart.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/public/img/illustrations/NoMessages.svg b/public/img/illustrations/NoMessages.svg new file mode 100644 index 00000000..5d87bb0f --- /dev/null +++ b/public/img/illustrations/NoMessages.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/public/img/illustrations/NoSearchResult.svg b/public/img/illustrations/NoSearchResult.svg new file mode 100644 index 00000000..ca9d4929 --- /dev/null +++ b/public/img/illustrations/NoSearchResult.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/public/img/illustrations/NoTasks.svg b/public/img/illustrations/NoTasks.svg new file mode 100644 index 00000000..492c7138 --- /dev/null +++ b/public/img/illustrations/NoTasks.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/repositories/ColllectionRepository.jsx b/src/repositories/ColllectionRepository.jsx index 343fc5cd..258e99f4 100644 --- a/src/repositories/ColllectionRepository.jsx +++ b/src/repositories/ColllectionRepository.jsx @@ -32,7 +32,7 @@ export const CollectionRepository = { isPending, filter ) => { - let url = `/api/Collection/invoice/list`; + let url = `/api/collection/invoice/list/dynamic`; const params = []; if (projectId) params.push(`projectId=${projectId}`); diff --git a/src/services/pmsGrid/PmsGrid.jsx b/src/services/pmsGrid/PmsGrid.jsx index 5b2a7332..baee4496 100644 --- a/src/services/pmsGrid/PmsGrid.jsx +++ b/src/services/pmsGrid/PmsGrid.jsx @@ -55,6 +55,7 @@ export default function PmsGrid({ colState, updateColumn, loading, + error, totalRows, expanded, toggleExpand, @@ -185,7 +186,7 @@ export default function PmsGrid({ )} {features.grouping && ( -
+
- - +
+ {!pinned && } + + No Pin + +
+ +
+ {pinned === "left" && ( + + )} + + Pin Left + +
+ +
+ {pinned === "right" && ( + + )} + + Pin Right + +
)} diff --git a/src/services/pmsGrid/pms-grid.css b/src/services/pmsGrid/pms-grid.css index 5066ca4d..0eadc437 100644 --- a/src/services/pmsGrid/pms-grid.css +++ b/src/services/pmsGrid/pms-grid.css @@ -214,4 +214,43 @@ box-shadow: -2px 0 3px rgba(0, 0, 0, 0.08); +} + + + +/* Skeleton Loader */ + +.loading-skeleton { + color: transparent; + appearance: none; + -webkit-appearance: none; + background-color: #eee; + border-color: #eee; + + &::placeholder { + color: transparent; + } +} +@keyframes loading-skeleton { + from { + opacity: .4; + } + to { + opacity: 1; + } +} +.loading-skeleton { + pointer-events: none; + animation: loading-skeleton 1s infinite alternate; + + img { + filter: grayscale(100) contrast(0%) brightness(1.8); + } + h1, h2, h3, h4, h5, h6, + p, li, + .btn, + label, + .form-control { + @extend %loading-skeleton; + } } \ No newline at end of file diff --git a/src/services/pmsGrid/useGridCore.js b/src/services/pmsGrid/useGridCore.js index 4038f7cd..7fdb388f 100644 --- a/src/services/pmsGrid/useGridCore.js +++ b/src/services/pmsGrid/useGridCore.js @@ -1,4 +1,11 @@ -import { useState, useMemo, useCallback, useEffect,useLayoutEffect } from "react"; +import { error } from "pdf-lib"; +import { + useState, + useMemo, + useCallback, + useEffect, + useLayoutEffect, +} from "react"; /* options: @@ -7,13 +14,12 @@ import { useState, useMemo, useCallback, useEffect,useLayoutEffect } from "react - initialPageSize */ - export function useGridCore({ data, serverMode = false, fetcher, rowKey = "id", - initialPageSize = 5, + initialPageSize = 20, columns = [], }) { const [page, setPage] = useState(1); @@ -40,6 +46,7 @@ export function useGridCore({ const [totalRows, setTotalRows] = useState(data ? data.length : 0); const [loading, setLoading] = useState(false); + const [error, setError] = useState(null); const [serverRows, setServerRows] = useState([]); /* ---------------- SEARCH (DEBOUNCE) ---------------- */ @@ -62,7 +69,9 @@ export function useGridCore({ const q = search.toLowerCase(); filtered = filtered.filter((r) => Object.values(r).some((v) => - String(v ?? "").toLowerCase().includes(q) + String(v ?? "") + .toLowerCase() + .includes(q) ) ); } @@ -121,6 +130,8 @@ export function useGridCore({ setServerRows(resp?.rows || []); setTotalRows(resp?.total ?? resp?.rows?.length ?? 0); + } catch (err) { + setError(err); } finally { setLoading(false); } @@ -140,18 +151,18 @@ export function useGridCore({ }, [serverMode, fetchServer]); /* ---------------- ADVANCED FILTER API ---------------- */ - const setColumnAdvanceFilter = useCallback((columnKey, filter) => { + const setColumnAdvanceFilter = useCallback((column, filter) => { setAdvanceFilters((prev) => { if (!filter) { const copy = { ...prev }; - delete copy[columnKey]; + delete copy[column]; return copy; } return { ...prev, - [columnKey]: { - columnKey, + [column]: { + column, ...filter, }, }; @@ -235,8 +246,9 @@ export function useGridCore({ totalRows, totalPages, - // loading + // loading & error loading, + error, // search search, @@ -279,13 +291,6 @@ export function useGridCore({ }; } - - - - - - - export function useDropdownPosition(btnRef, menuRef, isOpen, level = 0) { const [style, setStyle] = useState({}); @@ -348,4 +353,3 @@ export function useDropdownPosition(btnRef, menuRef, isOpen, level = 0) { return style; } -