@tuturuuu/ui 0.36.0 → 0.36.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/package.json +4 -4
- package/src/components/ui/finance/invoices/hooks.ts +5 -5
- package/src/components/ui/finance/invoices/pending-invoices-tab.tsx +14 -13
- package/src/components/ui/finance/invoices/query-invalidation.test.ts +1 -0
- package/src/components/ui/finance/invoices/query-invalidation.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.36.1](https://github.com/tutur3u/platform/compare/ui-v0.36.0...ui-v0.36.1) (2026-09-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **finance:** respect class join dates in pending tuition ([1aaaff0](https://github.com/tutur3u/platform/commit/1aaaff054d9b87c8ada88af6bdcadb840e54a186)) ([#5618](https://github.com/tutur3u/platform/issues/5618)) ([4a0d26c](https://github.com/tutur3u/platform/commit/4a0d26ca1246cd4075e9fcc6ad3dd7a093861766))
|
|
9
|
+
|
|
3
10
|
## [0.36.0](https://github.com/tutur3u/platform/compare/ui-v0.35.1...ui-v0.36.0) (2026-09-27)
|
|
4
11
|
|
|
5
12
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuturuuu/ui",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -88,12 +88,12 @@
|
|
|
88
88
|
"@tiptap/react": "3.31.3",
|
|
89
89
|
"@tiptap/starter-kit": "3.31.3",
|
|
90
90
|
"@tuturuuu/ai": "0.16.1",
|
|
91
|
-
"@tuturuuu/apis": "0.
|
|
91
|
+
"@tuturuuu/apis": "0.12.0",
|
|
92
92
|
"@tuturuuu/hooks": "0.1.2",
|
|
93
93
|
"@tuturuuu/icons": "0.1.1",
|
|
94
|
-
"@tuturuuu/internal-api": "0.
|
|
94
|
+
"@tuturuuu/internal-api": "0.46.0",
|
|
95
95
|
"@tuturuuu/supabase": "0.5.2",
|
|
96
|
-
"@tuturuuu/utils": "0.
|
|
96
|
+
"@tuturuuu/utils": "0.32.0",
|
|
97
97
|
"@types/debug": "^4.1.13",
|
|
98
98
|
"browser-image-compression": "^2.0.2",
|
|
99
99
|
"class-variance-authority": "^0.7.1",
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
useQueryClient,
|
|
7
7
|
} from '@tanstack/react-query';
|
|
8
8
|
import {
|
|
9
|
-
|
|
9
|
+
getPendingFinanceInvoicesCount,
|
|
10
10
|
getSubscriptionInvoiceContext,
|
|
11
11
|
listFinanceInvoices,
|
|
12
12
|
listPendingFinanceInvoices,
|
|
@@ -814,16 +814,16 @@ export const usePendingInvoices = (
|
|
|
814
814
|
});
|
|
815
815
|
};
|
|
816
816
|
|
|
817
|
-
//
|
|
818
|
-
export const
|
|
817
|
+
// Count the same all-month scope shown in the table and downloaded report.
|
|
818
|
+
export const usePendingInvoicesCount = (
|
|
819
819
|
wsId: string,
|
|
820
820
|
groupByUser = false,
|
|
821
821
|
enabled = true
|
|
822
822
|
) => {
|
|
823
823
|
return useQuery({
|
|
824
|
-
queryKey: ['pending-invoices-
|
|
824
|
+
queryKey: ['pending-invoices-count', wsId, groupByUser],
|
|
825
825
|
queryFn: async () => {
|
|
826
|
-
const count = await
|
|
826
|
+
const count = await getPendingFinanceInvoicesCount(wsId, {
|
|
827
827
|
groupByUser,
|
|
828
828
|
});
|
|
829
829
|
return typeof count === 'number' ? count : 0;
|
|
@@ -4,7 +4,7 @@ import { CircleDashed } from '@tuturuuu/icons';
|
|
|
4
4
|
import { Badge } from '@tuturuuu/ui/badge';
|
|
5
5
|
import { TabsTrigger } from '@tuturuuu/ui/tabs';
|
|
6
6
|
import { useWorkspaceConfig } from '../../../../hooks/use-workspace-config';
|
|
7
|
-
import {
|
|
7
|
+
import { usePendingInvoicesCount } from './hooks';
|
|
8
8
|
|
|
9
9
|
interface Props {
|
|
10
10
|
wsId: string;
|
|
@@ -21,23 +21,24 @@ export function PendingInvoicesTab({ wsId, label }: Props) {
|
|
|
21
21
|
|
|
22
22
|
const groupByUser = groupByUserConfig === 'true';
|
|
23
23
|
|
|
24
|
-
const { data:
|
|
25
|
-
|
|
24
|
+
const { data: pendingCount, isLoading } = usePendingInvoicesCount(
|
|
25
|
+
wsId,
|
|
26
|
+
groupByUser,
|
|
27
|
+
!isConfigLoading
|
|
28
|
+
);
|
|
26
29
|
|
|
27
30
|
return (
|
|
28
31
|
<TabsTrigger value="pending" className="gap-2">
|
|
29
32
|
<CircleDashed className="h-4 w-4" />
|
|
30
33
|
{label}
|
|
31
|
-
{!isLoading &&
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
</Badge>
|
|
40
|
-
)}
|
|
34
|
+
{!isLoading && pendingCount !== undefined && pendingCount > 0 && (
|
|
35
|
+
<Badge
|
|
36
|
+
variant="destructive"
|
|
37
|
+
className="ml-1 h-5 min-w-5 justify-center px-1.5 text-xs"
|
|
38
|
+
>
|
|
39
|
+
{pendingCount}
|
|
40
|
+
</Badge>
|
|
41
|
+
)}
|
|
41
42
|
</TabsTrigger>
|
|
42
43
|
);
|
|
43
44
|
}
|