@tuturuuu/ui 0.10.0 → 0.11.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/package.json +47 -47
  3. package/src/components/ui/finance/invoices/components/subscription-attendance-summary.tsx +19 -5
  4. package/src/components/ui/finance/invoices/components/subscription-prepaid-controls.test.tsx +41 -0
  5. package/src/components/ui/finance/invoices/components/subscription-prepaid-controls.tsx +93 -0
  6. package/src/components/ui/finance/invoices/hooks/use-subscription-auto-selection.ts +82 -70
  7. package/src/components/ui/finance/invoices/hooks/use-subscription-invoice-content.ts +50 -25
  8. package/src/components/ui/finance/invoices/hooks.ts +11 -2
  9. package/src/components/ui/finance/invoices/internal-api.ts +5 -0
  10. package/src/components/ui/finance/invoices/subscription-invoice.tsx +92 -31
  11. package/src/components/ui/finance/invoices/utils.test.ts +82 -0
  12. package/src/components/ui/finance/invoices/utils.ts +240 -7
  13. package/src/components/ui/text-editor/__tests__/extensions.test.ts +22 -0
  14. package/src/components/ui/tu-do/shared/__tests__/board-client.test.tsx +7 -0
  15. package/src/components/ui/tu-do/shared/__tests__/task-board-loading-state.test.tsx +37 -0
  16. package/src/components/ui/tu-do/shared/board-client.tsx +3 -1
  17. package/src/components/ui/tu-do/shared/task-board-loading-state.tsx +55 -1
  18. package/src/components/ui/tu-do/shared/task-edit-dialog/components/task-description-editor.tsx +3 -0
  19. package/src/components/ui/tu-do/shared/task-edit-dialog/components/task-list-selector.tsx +18 -2
  20. package/src/components/ui/tu-do/shared/task-edit-dialog/description-versions.test.ts +97 -0
  21. package/src/components/ui/tu-do/shared/task-edit-dialog/description-versions.ts +210 -0
  22. package/src/components/ui/tu-do/shared/task-edit-dialog/task-activity-section.tsx +56 -8
  23. package/src/components/ui/tu-do/shared/task-edit-dialog/task-description-change-dialog.test.tsx +63 -0
  24. package/src/components/ui/tu-do/shared/task-edit-dialog/task-description-change-dialog.tsx +218 -0
  25. package/src/components/ui/tu-do/shared/task-edit-dialog/task-description-restore-banner.tsx +83 -0
  26. package/src/components/ui/tu-do/shared/task-edit-dialog/task-description-version-restore-dialog.test.tsx +120 -0
  27. package/src/components/ui/tu-do/shared/task-edit-dialog/task-description-version-restore-dialog.tsx +180 -0
  28. package/src/components/ui/tu-do/shared/task-edit-dialog/task-properties-section.test.tsx +157 -4
  29. package/src/components/ui/tu-do/shared/task-edit-dialog/task-properties-section.tsx +178 -14
  30. package/src/components/ui/tu-do/shared/task-edit-dialog/utils.test.ts +100 -0
  31. package/src/components/ui/tu-do/shared/task-edit-dialog/utils.ts +109 -0
  32. package/src/components/ui/tu-do/shared/task-edit-dialog.tsx +381 -34
  33. package/src/components/ui/tu-do/templates/task-template-api.ts +142 -0
  34. package/src/components/ui/tu-do/templates/task-template-card.tsx +118 -0
  35. package/src/components/ui/tu-do/templates/task-template-client.test.tsx +52 -0
  36. package/src/components/ui/tu-do/templates/task-template-client.tsx +258 -0
  37. package/src/components/ui/tu-do/templates/task-template-dialogs.test.tsx +167 -0
  38. package/src/components/ui/tu-do/templates/task-template-dialogs.tsx +376 -0
  39. package/src/components/ui/tu-do/templates/task-templates-hub.test.tsx +114 -0
  40. package/src/components/ui/tu-do/templates/task-templates-hub.tsx +50 -0
  41. package/src/components/ui/tu-do/templates/task-templates-page.tsx +6 -11
@@ -2,10 +2,10 @@ import { Store } from '@tuturuuu/icons';
2
2
  import { createAdminClient } from '@tuturuuu/supabase/next/server';
3
3
  import { Button } from '@tuturuuu/ui/button';
4
4
  import FeatureSummary from '@tuturuuu/ui/custom/feature-summary';
5
- import TemplatesClient from '@tuturuuu/ui/tu-do/templates/client';
5
+ import { TaskTemplatesHub } from '@tuturuuu/ui/tu-do/templates/task-templates-hub';
6
6
  import type { BoardTemplate } from '@tuturuuu/ui/tu-do/templates/types';
7
7
  import { getCurrentUser } from '@tuturuuu/utils/user-helper';
8
- import { getPermissions, getWorkspace } from '@tuturuuu/utils/workspace-helper';
8
+ import { getWorkspace } from '@tuturuuu/utils/workspace-helper';
9
9
  import Link from 'next/link';
10
10
  import { notFound, redirect } from 'next/navigation';
11
11
  import { getTranslations } from 'next-intl/server';
@@ -121,13 +121,8 @@ export default async function TaskTemplatesPage({
121
121
 
122
122
  const wsId = workspace.id;
123
123
 
124
- const permissions = await getPermissions({ wsId });
125
- if (!permissions) notFound();
126
- const { withoutPermission } = permissions;
127
- if (withoutPermission('manage_projects')) redirect(`/${wsId}`);
128
-
129
124
  const { templates } = await getTemplates(wsId, user.id);
130
- const t = await getTranslations('ws-board-templates');
125
+ const t = await getTranslations('ws-task-templates');
131
126
 
132
127
  const marketplaceUrl = `/${wsId}/${templatesBasePath}/marketplace`;
133
128
 
@@ -144,14 +139,14 @@ export default async function TaskTemplatesPage({
144
139
  <Link href={marketplaceUrl}>
145
140
  <Button variant="outline" size="sm" className="gap-2">
146
141
  <Store className="h-4 w-4" />
147
- {t('gallery.marketplace')}
142
+ {t('gallery.board_marketplace')}
148
143
  </Button>
149
144
  </Link>
150
145
  }
151
146
  />
152
- <TemplatesClient
147
+ <TaskTemplatesHub
148
+ boardTemplates={templates}
153
149
  wsId={wsId}
154
- initialTemplates={templates}
155
150
  templatesBasePath={templatesBasePath}
156
151
  />
157
152
  </div>