sitero 0.6.0 → 0.8.0
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/dist/export/cms/client/components/index.js +6 -2
- package/dist/export/cms/client/index.js +2 -0
- package/dist/export/cms/client/pages/index.js +1 -4
- package/dist/export/cms/server/index.js +1 -0
- package/dist/export/core/server/index.js +2 -0
- package/dist/export/index.js +1 -0
- package/dist/export/web/server/index.js +1 -0
- package/dist/prisma/generated/internal/class.js +4 -4
- package/dist/src/cms/client/applications/create-applications.js +5 -0
- package/dist/src/cms/client/applications/resources/page/form-data.js +56 -0
- package/dist/src/cms/client/applications/resources/page/use-page-update-form-data.js +30 -0
- package/dist/src/cms/client/applications/resources/post/use-create-form-data.js +5 -5
- package/dist/src/cms/client/applications/resources/post/use-update-form-data.js +1 -1
- package/dist/src/cms/client/applications/resources/seo-metadata/build-seo-metadata-translations.js +35 -0
- package/dist/src/cms/client/applications/resources/seo-metadata/use-upsert-form-data.js +15 -31
- package/dist/src/cms/client/applications/ui/use-nav-items.js +28 -39
- package/dist/src/cms/client/infrastructure/i18n/messages/en-US/resources/file.js +5 -4
- package/dist/src/cms/client/infrastructure/i18n/messages/en-US/resources/index.js +7 -0
- package/dist/src/cms/client/infrastructure/i18n/messages/en-US/resources/post.js +32 -1
- package/dist/src/cms/client/infrastructure/i18n/messages/en-US/ui/index.js +8 -1
- package/dist/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/file.js +6 -5
- package/dist/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/index.js +7 -0
- package/dist/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/post.js +18 -1
- package/dist/src/cms/client/infrastructure/i18n/messages/zh-TW/ui/index.js +12 -7
- package/dist/src/cms/client/infrastructure/operation-result/presentation/message.js +15 -0
- package/dist/src/cms/client/interfaces/components/create-components.js +7 -8
- package/dist/src/cms/client/interfaces/components/create-page-contents.js +28 -0
- package/dist/src/cms/client/interfaces/components/resources/page/content/field-groups.js +16 -0
- package/dist/src/cms/client/interfaces/components/resources/page/content/page-edit-content.js +216 -0
- package/dist/src/cms/client/interfaces/components/resources/page/content/page-show-content.js +114 -0
- package/dist/src/cms/client/interfaces/components/resources/page/content/types.js +12 -0
- package/dist/src/cms/client/interfaces/components/resources/post/category/category-card.js +17 -5
- package/dist/src/cms/client/interfaces/components/resources/post/category/category-table.js +16 -5
- package/dist/src/cms/client/interfaces/components/resources/post/content/post-create-content.js +13 -8
- package/dist/src/cms/client/interfaces/components/resources/post/content/post-edit-content.js +11 -7
- package/dist/src/cms/client/interfaces/components/resources/post/content/post-show-content.js +7 -2
- package/dist/src/cms/client/interfaces/components/resources/post/post-card.js +17 -5
- package/dist/src/cms/client/interfaces/components/resources/post/post-list.js +49 -10
- package/dist/src/cms/client/interfaces/components/resources/post/post-state-icons.js +37 -6
- package/dist/src/cms/client/interfaces/components/resources/post/post-table.js +18 -5
- package/dist/src/cms/client/interfaces/components/resources/post/search/control-fields-filters.js +5 -1
- package/dist/src/cms/client/interfaces/components/resources/post/tag/tag-card.js +12 -2
- package/dist/src/cms/client/interfaces/components/resources/post/tag/tag-table.js +10 -1
- package/dist/src/cms/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.js +90 -67
- package/dist/src/cms/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.js +11 -1
- package/dist/src/cms/client/interfaces/components/ui/blocks/list-container/list-container.js +1 -1
- package/dist/src/cms/client/interfaces/components/ui/blocks/list-container/pagination.js +9 -9
- package/dist/src/cms/client/interfaces/components/ui/features/accordion/accordion-header.js +15 -3
- package/dist/src/cms/client/interfaces/components/ui/features/accordion/accordion.js +5 -7
- package/dist/src/cms/client/interfaces/components/ui/form/control-fields/control-fields-display.js +1 -1
- package/dist/src/cms/client/interfaces/components/ui/form/control-fields/control-fields-input.js +1 -1
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/_id_/edit/page.js +11 -11
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/_id_/page.js +12 -16
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/_id_/relations/page.js +6 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/create/page.js +15 -16
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/page.js +18 -41
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/_id_/edit/page.js +10 -11
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/_id_/page.js +11 -16
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/_id_/relations/page.js +1 -0
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/create/page.js +14 -16
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/_id_/edit/page.js +11 -11
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/_id_/page.js +12 -16
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/_id_/relations/page.js +1 -0
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/create/page.js +15 -16
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/page.js +18 -32
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/_id_/edit/page.js +2 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/_id_/page.js +9 -9
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/_id_/relations/page.js +6 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/create/page.js +2 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/trash/page.js +204 -0
- package/dist/src/cms/client/interfaces/pages/dashboard/system/access/admin/_id_/admin-refresh-token/page.js +1 -0
- package/dist/src/cms/client/interfaces/pages/dashboard/system/access/admin/_id_/page.js +1 -0
- package/dist/src/cms/client/interfaces/pages/dashboard/system/access/admin/_id_/relations/page.js +8 -3
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/file/_id_/page.js +3 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/file/_id_/relations/page.js +41 -30
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/file/delete-many/page.js +3 -3
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/file/page.js +1 -1
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/trash/page.js +3 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/website/website-page/_slug_/edit/page.js +19 -11
- package/dist/src/cms/client/interfaces/pages/dashboard/website/website-page/_slug_/page.js +23 -10
- package/dist/src/cms/client/interfaces/pages/dashboard/website/website-page/page.js +7 -7
- package/dist/src/cms/server/create-cms-server.js +2 -0
- package/dist/src/cms/server/resources/page/actions.js +31 -0
- package/dist/src/cms/server/resources/post/actions.js +27 -6
- package/dist/src/cms/server/resources/seo-metadata/actions.js +7 -16
- package/dist/src/config/content-ui.js +24 -0
- package/dist/src/config/topics.js +1 -1
- package/dist/src/constants/paths/cms-paths.js +2 -2
- package/dist/src/core/infrastructure/prisma/file/include.js +44 -0
- package/dist/src/core/infrastructure/prisma/file/mappers.js +51 -3
- package/dist/src/core/infrastructure/prisma/helpers/active-file-references.js +2 -1
- package/dist/src/core/infrastructure/prisma/page/include.js +20 -0
- package/dist/src/core/infrastructure/prisma/page/mappers.js +44 -0
- package/dist/src/core/infrastructure/prisma/page/page-prisma-ports.js +91 -0
- package/dist/src/core/infrastructure/prisma/post/include.js +2 -5
- package/dist/src/core/infrastructure/prisma/post/lifecycle.js +108 -0
- package/dist/src/core/infrastructure/prisma/post/mappers.js +0 -2
- package/dist/src/core/infrastructure/prisma/post/post-prisma-ports.js +76 -24
- package/dist/src/core/infrastructure/prisma/post/read-scope.js +45 -0
- package/dist/src/core/infrastructure/prisma/seo-metadata/mappers.js +6 -1
- package/dist/src/core/infrastructure/prisma/seo-metadata/seo-metadata-prisma-ports.js +32 -11
- package/dist/src/core/seeders/page/seeder.js +9 -29
- package/dist/src/core/seeders/seed.js +0 -3
- package/dist/src/core/sitero-server/create-sitero-server.js +10 -0
- package/dist/src/web/server/create-web-server.js +5 -1
- package/dist/src/web/server/resources/page/actions.js +20 -0
- package/dist/src/web/server/resources/post/actions.js +3 -13
- package/dist/src/web/server/seo/sitemap/get-page-items.js +7 -6
- package/dist/src/web/server/seo/sitemap/get-post-items.js +2 -2
- package/dist/src/web/server/seo/sitemap/get-subcategory-items.js +1 -1
- package/dist/types/export/cms/client/components/index.d.ts +3 -0
- package/dist/types/export/cms/client/components/index.d.ts.map +1 -1
- package/dist/types/export/cms/client/index.d.ts +2 -0
- package/dist/types/export/cms/client/index.d.ts.map +1 -1
- package/dist/types/export/cms/client/pages/index.d.ts +3 -2
- package/dist/types/export/cms/client/pages/index.d.ts.map +1 -1
- package/dist/types/export/cms/server/index.d.ts +2 -1
- package/dist/types/export/cms/server/index.d.ts.map +1 -1
- package/dist/types/export/index.d.ts +1 -1
- package/dist/types/export/index.d.ts.map +1 -1
- package/dist/types/export/web/server/index.d.ts +2 -1
- package/dist/types/export/web/server/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/applications/create-applications.d.ts.map +1 -1
- package/dist/types/src/cms/client/applications/index.d.ts +1 -0
- package/dist/types/src/cms/client/applications/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/applications/resources/index.d.ts +1 -0
- package/dist/types/src/cms/client/applications/resources/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/applications/resources/page/form-data.d.ts +21 -0
- package/dist/types/src/cms/client/applications/resources/page/form-data.d.ts.map +1 -0
- package/dist/types/src/cms/client/applications/resources/page/index.d.ts +3 -0
- package/dist/types/src/cms/client/applications/resources/page/index.d.ts.map +1 -0
- package/dist/types/src/cms/client/applications/resources/page/use-page-update-form-data.d.ts +12 -0
- package/dist/types/src/cms/client/applications/resources/page/use-page-update-form-data.d.ts.map +1 -0
- package/dist/types/src/cms/client/applications/resources/post/use-create-form-data.d.ts +3 -5
- package/dist/types/src/cms/client/applications/resources/post/use-create-form-data.d.ts.map +1 -1
- package/dist/types/src/cms/client/applications/resources/post/use-update-form-data.d.ts.map +1 -1
- package/dist/types/src/cms/client/applications/resources/seo-metadata/build-seo-metadata-translations.d.ts +6 -0
- package/dist/types/src/cms/client/applications/resources/seo-metadata/build-seo-metadata-translations.d.ts.map +1 -0
- package/dist/types/src/cms/client/applications/resources/seo-metadata/use-upsert-form-data.d.ts +5 -4
- package/dist/types/src/cms/client/applications/resources/seo-metadata/use-upsert-form-data.d.ts.map +1 -1
- package/dist/types/src/cms/client/applications/types.d.ts +2 -1
- package/dist/types/src/cms/client/applications/types.d.ts.map +1 -1
- package/dist/types/src/cms/client/applications/ui/use-nav-items.d.ts +3 -4
- package/dist/types/src/cms/client/applications/ui/use-nav-items.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/index.d.ts +86 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/file.d.ts +3 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/file.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/index.d.ts +71 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/post.d.ts +51 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/post.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/ui/index.d.ts +15 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/ui/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/index.d.ts +172 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/index.d.ts +86 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/file.d.ts +3 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/file.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/index.d.ts +71 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/post.d.ts +51 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/post.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/ui/index.d.ts +15 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/ui/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/operation-result/presentation/message.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/create-components.d.ts +6 -3
- package/dist/types/src/cms/client/interfaces/components/create-components.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/create-page-contents.d.ts +30 -0
- package/dist/types/src/cms/client/interfaces/components/create-page-contents.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/index.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/page/content/field-groups.d.ts +3 -0
- package/dist/types/src/cms/client/interfaces/components/resources/page/content/field-groups.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/page/content/page-edit-content.d.ts +14 -0
- package/dist/types/src/cms/client/interfaces/components/resources/page/content/page-edit-content.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/page/content/page-show-content.d.ts +7 -0
- package/dist/types/src/cms/client/interfaces/components/resources/page/content/page-show-content.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/page/content/types.d.ts +27 -0
- package/dist/types/src/cms/client/interfaces/components/resources/page/content/types.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/page/index.d.ts +4 -0
- package/dist/types/src/cms/client/interfaces/components/resources/page/index.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-card.d.ts +5 -2
- package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-card.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-table.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-table.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-create-content.d.ts +3 -5
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-create-content.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-edit-content.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-show-content.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-card.d.ts +6 -3
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-card.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-list.d.ts +6 -3
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-list.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-state-icons.d.ts +7 -2
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-state-icons.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-table.d.ts +5 -2
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-table.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/search/control-fields-filters.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/tag/tag-card.d.ts +3 -2
- package/dist/types/src/cms/client/interfaces/components/resources/post/tag/tag-card.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/tag/tag-table.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/tag/tag-table.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.d.ts +5 -2
- package/dist/types/src/cms/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.d.ts +2 -1
- package/dist/types/src/cms/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/blocks/list-container/list-container.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/features/accordion/accordion-header.d.ts +3 -1
- package/dist/types/src/cms/client/interfaces/components/ui/features/accordion/accordion-header.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/features/accordion/accordion.d.ts +2 -1
- package/dist/types/src/cms/client/interfaces/components/ui/features/accordion/accordion.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/form/control-fields/control-fields-display.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/form/control-fields/control-fields-input.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/edit/page.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/edit/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/page.d.ts +3 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/relations/page.d.ts +3 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/relations/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/create/page.d.ts +4 -7
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/create/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/page.d.ts +1 -4
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/[id]/edit/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/[id]/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/[id]/relations/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/create/page.d.ts +4 -7
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/create/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/edit/page.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/edit/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/page.d.ts +3 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/relations/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/create/page.d.ts +4 -7
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/create/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/page.d.ts +1 -3
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/[id]/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/[id]/relations/page.d.ts +3 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/[id]/relations/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/trash/index.d.ts +2 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/trash/index.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/trash/page.d.ts +18 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/trash/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/system/access/admin/[id]/relations/page.d.ts +3 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/system/access/admin/[id]/relations/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/system/storage/file/[id]/relations/page.d.ts +5 -6
- package/dist/types/src/cms/client/interfaces/pages/dashboard/system/storage/file/[id]/relations/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/system/storage/trash/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/website/website-page/[slug]/edit/page.d.ts +7 -9
- package/dist/types/src/cms/client/interfaces/pages/dashboard/website/website-page/[slug]/edit/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/website/website-page/[slug]/page.d.ts +7 -9
- package/dist/types/src/cms/client/interfaces/pages/dashboard/website/website-page/[slug]/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/website/website-page/page.d.ts +3 -3
- package/dist/types/src/cms/client/interfaces/pages/dashboard/website/website-page/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/index.d.ts +1 -2
- package/dist/types/src/cms/client/interfaces/pages/index.d.ts.map +1 -1
- package/dist/types/src/cms/contracts/resources/page/actions.d.ts +7 -0
- package/dist/types/src/cms/contracts/resources/page/actions.d.ts.map +1 -0
- package/dist/types/src/cms/contracts/resources/post/actions.d.ts +2 -0
- package/dist/types/src/cms/contracts/resources/post/actions.d.ts.map +1 -1
- package/dist/types/src/cms/contracts/resources/post/form-data.d.ts +1 -1
- package/dist/types/src/cms/contracts/resources/post/form-data.d.ts.map +1 -1
- package/dist/types/src/cms/contracts/resources/seo-metadata/form-data.d.ts +2 -2
- package/dist/types/src/cms/contracts/resources/seo-metadata/form-data.d.ts.map +1 -1
- package/dist/types/src/cms/server/create-cms-server.d.ts +7 -0
- package/dist/types/src/cms/server/create-cms-server.d.ts.map +1 -1
- package/dist/types/src/cms/server/index.d.ts +1 -1
- package/dist/types/src/cms/server/index.d.ts.map +1 -1
- package/dist/types/src/cms/server/resources/index.d.ts +1 -0
- package/dist/types/src/cms/server/resources/index.d.ts.map +1 -1
- package/dist/types/src/cms/server/resources/page/actions.d.ts +8 -0
- package/dist/types/src/cms/server/resources/page/actions.d.ts.map +1 -0
- package/dist/types/src/cms/server/resources/post/actions.d.ts +2 -0
- package/dist/types/src/cms/server/resources/post/actions.d.ts.map +1 -1
- package/dist/types/src/cms/server/resources/seo-metadata/actions.d.ts.map +1 -1
- package/dist/types/src/config/content-ui.d.ts +14 -0
- package/dist/types/src/config/content-ui.d.ts.map +1 -0
- package/dist/types/src/config/index.d.ts +2 -0
- package/dist/types/src/config/index.d.ts.map +1 -1
- package/dist/types/src/config/page.d.ts +4 -0
- package/dist/types/src/config/page.d.ts.map +1 -0
- package/dist/types/src/config/topics.d.ts +2 -2
- package/dist/types/src/config/topics.d.ts.map +1 -1
- package/dist/types/src/constants/paths/cms-paths.d.ts +3 -3
- package/dist/types/src/core/infrastructure/index.d.ts +1 -0
- package/dist/types/src/core/infrastructure/index.d.ts.map +1 -1
- package/dist/types/src/core/infrastructure/prisma/file/include.d.ts +121 -0
- package/dist/types/src/core/infrastructure/prisma/file/include.d.ts.map +1 -1
- package/dist/types/src/core/infrastructure/prisma/file/mappers.d.ts.map +1 -1
- package/dist/types/src/core/infrastructure/prisma/helpers/active-file-references.d.ts +1 -1
- package/dist/types/src/core/infrastructure/prisma/helpers/active-file-references.d.ts.map +1 -1
- package/dist/types/src/core/infrastructure/prisma/index.d.ts +1 -0
- package/dist/types/src/core/infrastructure/prisma/index.d.ts.map +1 -1
- package/dist/types/src/core/infrastructure/prisma/page/include.d.ts +63 -0
- package/dist/types/src/core/infrastructure/prisma/page/include.d.ts.map +1 -0
- package/dist/types/src/core/infrastructure/prisma/page/index.d.ts +4 -0
- package/dist/types/src/core/infrastructure/prisma/page/index.d.ts.map +1 -0
- package/dist/types/src/core/infrastructure/prisma/page/mappers.d.ts +9 -0
- package/dist/types/src/core/infrastructure/prisma/page/mappers.d.ts.map +1 -0
- package/dist/types/src/core/infrastructure/prisma/page/page-prisma-ports.d.ts +7 -0
- package/dist/types/src/core/infrastructure/prisma/page/page-prisma-ports.d.ts.map +1 -0
- package/dist/types/src/core/infrastructure/prisma/page/types.d.ts +10 -0
- package/dist/types/src/core/infrastructure/prisma/page/types.d.ts.map +1 -0
- package/dist/types/src/core/infrastructure/prisma/post/include.d.ts +0 -29
- package/dist/types/src/core/infrastructure/prisma/post/include.d.ts.map +1 -1
- package/dist/types/src/core/infrastructure/prisma/post/lifecycle.d.ts +66 -0
- package/dist/types/src/core/infrastructure/prisma/post/lifecycle.d.ts.map +1 -0
- package/dist/types/src/core/infrastructure/prisma/post/mappers.d.ts.map +1 -1
- package/dist/types/src/core/infrastructure/prisma/post/post-prisma-ports.d.ts.map +1 -1
- package/dist/types/src/core/infrastructure/prisma/post/read-scope.d.ts +271 -0
- package/dist/types/src/core/infrastructure/prisma/post/read-scope.d.ts.map +1 -0
- package/dist/types/src/core/infrastructure/prisma/seo-metadata/mappers.d.ts +1 -1
- package/dist/types/src/core/infrastructure/prisma/seo-metadata/mappers.d.ts.map +1 -1
- package/dist/types/src/core/infrastructure/prisma/seo-metadata/seo-metadata-prisma-ports.d.ts +2 -2
- package/dist/types/src/core/infrastructure/prisma/seo-metadata/seo-metadata-prisma-ports.d.ts.map +1 -1
- package/dist/types/src/core/seeders/page/seeder.d.ts +3 -3
- package/dist/types/src/core/seeders/page/seeder.d.ts.map +1 -1
- package/dist/types/src/core/seeders/seed.d.ts +2 -3
- package/dist/types/src/core/seeders/seed.d.ts.map +1 -1
- package/dist/types/src/core/sitero-server/create-sitero-server.d.ts.map +1 -1
- package/dist/types/src/core/sitero-server/types.d.ts +2 -0
- package/dist/types/src/core/sitero-server/types.d.ts.map +1 -1
- package/dist/types/src/shared/list-item.d.ts +1 -0
- package/dist/types/src/shared/list-item.d.ts.map +1 -1
- package/dist/types/src/web/contracts/index.d.ts +1 -0
- package/dist/types/src/web/contracts/index.d.ts.map +1 -1
- package/dist/types/src/web/contracts/resources/page/actions.d.ts +5 -0
- package/dist/types/src/web/contracts/resources/page/actions.d.ts.map +1 -0
- package/dist/types/src/web/contracts/resources/post/actions.d.ts +1 -1
- package/dist/types/src/web/contracts/resources/post/actions.d.ts.map +1 -1
- package/dist/types/src/web/server/create-web-server.d.ts.map +1 -1
- package/dist/types/src/web/server/index.d.ts +1 -1
- package/dist/types/src/web/server/index.d.ts.map +1 -1
- package/dist/types/src/web/server/resources/index.d.ts +1 -0
- package/dist/types/src/web/server/resources/index.d.ts.map +1 -1
- package/dist/types/src/web/server/resources/page/actions.d.ts +17 -0
- package/dist/types/src/web/server/resources/page/actions.d.ts.map +1 -0
- package/dist/types/src/web/server/resources/post/actions.d.ts +1 -6
- package/dist/types/src/web/server/resources/post/actions.d.ts.map +1 -1
- package/dist/types/src/web/server/seo/metadata/build-metadata.d.ts +5 -2
- package/dist/types/src/web/server/seo/metadata/build-metadata.d.ts.map +1 -1
- package/dist/types/src/web/server/seo/sitemap/build-entries.d.ts +2 -2
- package/dist/types/src/web/server/seo/sitemap/build-entries.d.ts.map +1 -1
- package/dist/types/src/web/server/seo/sitemap/get-page-items.d.ts +6 -2
- package/dist/types/src/web/server/seo/sitemap/get-page-items.d.ts.map +1 -1
- package/dist/types/src/web/server/seo/sitemap/get-post-items.d.ts.map +1 -1
- package/dist/types/src/web/server/seo/sitemap/get-subcategory-items.d.ts.map +1 -1
- package/dist/types/src/web/server/types.d.ts +6 -2
- package/dist/types/src/web/server/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/src/cms/client/interfaces/components/resources/post/topic/topic-card.js +0 -81
- package/dist/src/cms/client/interfaces/components/resources/post/topic/topic-table.js +0 -120
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/_id_/edit/page.js +0 -110
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/_id_/page.js +0 -161
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/page.js +0 -103
- package/dist/src/cms/client/interfaces/pages/page.js +0 -17
- package/dist/src/core/seeders/topic/seeder.js +0 -47
- package/dist/types/src/cms/client/interfaces/components/resources/post/topic/index.d.ts +0 -3
- package/dist/types/src/cms/client/interfaces/components/resources/post/topic/index.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/topic/topic-card.d.ts +0 -5
- package/dist/types/src/cms/client/interfaces/components/resources/post/topic/topic-card.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/topic/topic-table.d.ts +0 -3
- package/dist/types/src/cms/client/interfaces/components/resources/post/topic/topic-table.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/[id]/edit/page.d.ts +0 -20
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/[id]/edit/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/[id]/page.d.ts +0 -20
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/[id]/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/index.d.ts +0 -4
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/index.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/page.d.ts +0 -14
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/page.d.ts +0 -2
- package/dist/types/src/cms/client/interfaces/pages/page.d.ts.map +0 -1
- package/dist/types/src/core/seeders/topic/seeder.d.ts +0 -10
- package/dist/types/src/core/seeders/topic/seeder.d.ts.map +0 -1
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { useTranslator } from 'intor/react';
|
|
4
|
-
import { SquareLibrary, SquareArrowOutUpRight,
|
|
4
|
+
import { SquareLibrary, SquareArrowOutUpRight, Plus, File, Notebook } from 'lucide-react';
|
|
5
5
|
import { useParams } from 'next/navigation';
|
|
6
6
|
import { useState } from 'react';
|
|
7
7
|
import { POST_TYPES } from 'sitero-domain';
|
|
8
|
-
import 'zod';
|
|
9
|
-
import 'sonner';
|
|
10
|
-
import 'ua-parser-js';
|
|
11
|
-
import '../../../../../../../../shared/client/react-query/client.js';
|
|
12
|
-
import '@tanstack/react-query';
|
|
13
|
-
import { useCmsQuery } from '../../../../../../infrastructure/operation-result/use-cms-query.js';
|
|
14
8
|
import { isContentTopic, hasTopicRole } from '../../../../../../../../config/topics.js';
|
|
15
9
|
import { POST_CUSTOM_STATE_FIELDS } from '../../../../../../../../config/post.js';
|
|
16
10
|
import { CMS_PATHS } from '../../../../../../../../constants/paths/cms-paths.js';
|
|
17
11
|
import '../../../../../../../../constants/paths/redirect.js';
|
|
18
12
|
import '../../../../../../../../constants/cms-locale.js';
|
|
19
13
|
import 'mime-types';
|
|
20
|
-
import
|
|
14
|
+
import 'ua-parser-js';
|
|
15
|
+
import '../../../../../../../../shared/client/react-query/client.js';
|
|
16
|
+
import '@tanstack/react-query';
|
|
21
17
|
import 'clsx';
|
|
22
18
|
import 'tailwind-merge';
|
|
23
19
|
import { joinUrl } from '../../../../../../../../shared/utils/join-url.js';
|
|
@@ -36,7 +32,7 @@ import '@radix-ui/react-select';
|
|
|
36
32
|
import '@radix-ui/react-separator';
|
|
37
33
|
import '../../../../../components/shadcn/sidebar/sidebar.js';
|
|
38
34
|
import 'next-themes';
|
|
39
|
-
import
|
|
35
|
+
import 'sonner';
|
|
40
36
|
import '@radix-ui/react-tabs';
|
|
41
37
|
import '@radix-ui/react-tooltip';
|
|
42
38
|
import { LinkButton } from '../../../../../components/ui/buttons/link-button.js';
|
|
@@ -52,13 +48,12 @@ import { Accordion } from '../../../../../components/ui/features/accordion/accor
|
|
|
52
48
|
import 'next/image';
|
|
53
49
|
import '../../../../../../infrastructure/admin-session/admin-context.js';
|
|
54
50
|
import 'intor/next';
|
|
51
|
+
import 'zod';
|
|
55
52
|
import { ContentContainer } from '../../../../../components/ui/layouts/content-container.js';
|
|
56
53
|
|
|
57
54
|
function createTopicScopePage({
|
|
58
|
-
enableTopic,
|
|
59
55
|
topics: staticTopics,
|
|
60
56
|
externalHref,
|
|
61
|
-
postFindDetailAction,
|
|
62
57
|
CategoryCard,
|
|
63
58
|
PostList: PostListBase,
|
|
64
59
|
allowField
|
|
@@ -79,16 +74,8 @@ function createTopicScopePage({
|
|
|
79
74
|
topicSlug,
|
|
80
75
|
POST_TYPES.SUBCATEGORY
|
|
81
76
|
);
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
isFetching,
|
|
85
|
-
isNotFound
|
|
86
|
-
} = useCmsQuery(
|
|
87
|
-
() => postFindDetailAction({ type: POST_TYPES.TOPIC, slug: topicSlug }),
|
|
88
|
-
["postFindDetailAction", POST_TYPES.TOPIC, topicSlug],
|
|
89
|
-
{ select: (data) => data?.post }
|
|
90
|
-
);
|
|
91
|
-
const topicT = findTranslation(topic?.translations, locale);
|
|
77
|
+
const topic = Object.hasOwn(staticTopics, topicSlug) ? staticTopics[topicSlug] : void 0;
|
|
78
|
+
const topicT = { title: topic?.title[locale] ?? "" };
|
|
92
79
|
const [categoryStates, setCategoryStates] = useState({});
|
|
93
80
|
const [subcategoryStates, setSubcategoryStates] = useState({});
|
|
94
81
|
const [postStates, setPostStates] = useState(
|
|
@@ -107,7 +94,7 @@ function createTopicScopePage({
|
|
|
107
94
|
{
|
|
108
95
|
usableFields: getUsableFields(POST_TYPES.POST),
|
|
109
96
|
type: POST_TYPES.POST,
|
|
110
|
-
|
|
97
|
+
topicKey: topic ? topicSlug : DO_NOT_FETCH_KEY,
|
|
111
98
|
setListItemStates: setPostStates,
|
|
112
99
|
localKey: `post-${POST_TYPES.POST}`
|
|
113
100
|
}
|
|
@@ -120,22 +107,9 @@ function createTopicScopePage({
|
|
|
120
107
|
navigation: /* @__PURE__ */ jsx(ReturnButton, { pushToParent: true }),
|
|
121
108
|
titleProps: {
|
|
122
109
|
icon: SquareLibrary,
|
|
123
|
-
title:
|
|
110
|
+
title: topicT.title
|
|
124
111
|
},
|
|
125
112
|
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
126
|
-
enableTopic && /* @__PURE__ */ jsx(
|
|
127
|
-
LinkButton,
|
|
128
|
-
{
|
|
129
|
-
variant: "outline",
|
|
130
|
-
icon: Pen,
|
|
131
|
-
href: joinUrl(
|
|
132
|
-
CMS_PATHS.content["content-management"].topic.pathname,
|
|
133
|
-
topic?.id
|
|
134
|
-
),
|
|
135
|
-
isDisabled: isFetching || isNotFound || !isContentTopicScope,
|
|
136
|
-
children: t("ui.setting.text")
|
|
137
|
-
}
|
|
138
|
-
),
|
|
139
113
|
hasCategory && /* @__PURE__ */ jsx(
|
|
140
114
|
LinkButton,
|
|
141
115
|
{
|
|
@@ -147,7 +121,7 @@ function createTopicScopePage({
|
|
|
147
121
|
),
|
|
148
122
|
"create"
|
|
149
123
|
),
|
|
150
|
-
isDisabled:
|
|
124
|
+
isDisabled: !topic || !isContentTopicScope,
|
|
151
125
|
children: t("ui.create-resource.text", {
|
|
152
126
|
resource: t("resources.category.text")
|
|
153
127
|
})
|
|
@@ -162,7 +136,7 @@ function createTopicScopePage({
|
|
|
162
136
|
CMS_PATHS.content["content-management"].subcategory.pathname(topicSlug),
|
|
163
137
|
"create"
|
|
164
138
|
),
|
|
165
|
-
isDisabled:
|
|
139
|
+
isDisabled: !topic || !isContentTopicScope,
|
|
166
140
|
children: t("ui.create-resource.text", {
|
|
167
141
|
resource: t("resources.subcategory.text")
|
|
168
142
|
})
|
|
@@ -179,7 +153,7 @@ function createTopicScopePage({
|
|
|
179
153
|
),
|
|
180
154
|
"create"
|
|
181
155
|
),
|
|
182
|
-
isDisabled:
|
|
156
|
+
isDisabled: !topic || !isContentTopicScope,
|
|
183
157
|
children: t("ui.create-resource.text", {
|
|
184
158
|
resource: t("resources.post.text")
|
|
185
159
|
})
|
|
@@ -203,6 +177,7 @@ function createTopicScopePage({
|
|
|
203
177
|
Accordion,
|
|
204
178
|
{
|
|
205
179
|
accordionHeaderProps: {
|
|
180
|
+
showCount: true,
|
|
206
181
|
count: categoryStates.count,
|
|
207
182
|
children: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
|
|
208
183
|
/* @__PURE__ */ jsx(Notebook, { className: "size-4" }),
|
|
@@ -217,7 +192,7 @@ function createTopicScopePage({
|
|
|
217
192
|
{
|
|
218
193
|
usableFields: getUsableFields(POST_TYPES.CATEGORY),
|
|
219
194
|
type: POST_TYPES.CATEGORY,
|
|
220
|
-
|
|
195
|
+
topicKey: topic ? topicSlug : DO_NOT_FETCH_KEY,
|
|
221
196
|
setListItemStates: setCategoryStates,
|
|
222
197
|
Card: (props) => /* @__PURE__ */ jsx(CategoryCard, { ...props }),
|
|
223
198
|
Table: (props) => /* @__PURE__ */ jsx(CategoryTable, { ...props }),
|
|
@@ -230,6 +205,7 @@ function createTopicScopePage({
|
|
|
230
205
|
Accordion,
|
|
231
206
|
{
|
|
232
207
|
accordionHeaderProps: {
|
|
208
|
+
showCount: true,
|
|
233
209
|
count: subcategoryStates.count,
|
|
234
210
|
children: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
|
|
235
211
|
/* @__PURE__ */ jsx(Notebook, { className: "size-4" }),
|
|
@@ -244,7 +220,7 @@ function createTopicScopePage({
|
|
|
244
220
|
{
|
|
245
221
|
usableFields: getUsableFields(POST_TYPES.SUBCATEGORY),
|
|
246
222
|
type: POST_TYPES.SUBCATEGORY,
|
|
247
|
-
|
|
223
|
+
topicKey: topic ? topicSlug : DO_NOT_FETCH_KEY,
|
|
248
224
|
setListItemStates: setSubcategoryStates,
|
|
249
225
|
Card: (props) => /* @__PURE__ */ jsx(CategoryCard, { ...props, isSubcategory: true }),
|
|
250
226
|
Table: (props) => /* @__PURE__ */ jsx(CategoryTable, { ...props, isSubcategory: true }),
|
|
@@ -257,6 +233,7 @@ function createTopicScopePage({
|
|
|
257
233
|
Accordion,
|
|
258
234
|
{
|
|
259
235
|
accordionHeaderProps: {
|
|
236
|
+
showCount: true,
|
|
260
237
|
count: postStates.count,
|
|
261
238
|
children: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
|
|
262
239
|
/* @__PURE__ */ jsx(File, { className: "size-4" }),
|
|
@@ -14,7 +14,6 @@ import { CMS_PATHS } from '../../../../../../../../../../../constants/paths/cms-
|
|
|
14
14
|
import '../../../../../../../../../../../constants/paths/redirect.js';
|
|
15
15
|
import '../../../../../../../../../../../constants/cms-locale.js';
|
|
16
16
|
import 'mime-types';
|
|
17
|
-
import { findTranslation } from '../../../../../../../../../../../shared/translation/find-translation.js';
|
|
18
17
|
import 'clsx';
|
|
19
18
|
import 'tailwind-merge';
|
|
20
19
|
import { ensureArray } from '../../../../../../../../../../../shared/utils/ensure-array.js';
|
|
@@ -64,11 +63,7 @@ function createPostEditPage({
|
|
|
64
63
|
const hasSubcategory = roles.includes(POST_TYPES.SUBCATEGORY);
|
|
65
64
|
const categoryType = POST_TYPES.CATEGORY;
|
|
66
65
|
const subcategoryType = POST_TYPES.SUBCATEGORY;
|
|
67
|
-
const
|
|
68
|
-
() => postFindDetailAction({ type: POST_TYPES.TOPIC, slug: topicSlug }),
|
|
69
|
-
["postFindDetailAction", POST_TYPES.TOPIC, topicSlug],
|
|
70
|
-
{ select: (data) => data?.post }
|
|
71
|
-
);
|
|
66
|
+
const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug], key: topicSlug } : void 0;
|
|
72
67
|
const {
|
|
73
68
|
data: post,
|
|
74
69
|
isFetching,
|
|
@@ -81,8 +76,12 @@ function createPostEditPage({
|
|
|
81
76
|
}
|
|
82
77
|
);
|
|
83
78
|
const { data: posts, isFetching: isFetchingControlMeta } = useCmsQuery(
|
|
84
|
-
() => postFindManyAction({
|
|
85
|
-
|
|
79
|
+
() => postFindManyAction({
|
|
80
|
+
type: postType,
|
|
81
|
+
topicKey: topic?.key,
|
|
82
|
+
deletion: "all"
|
|
83
|
+
}),
|
|
84
|
+
["postFindManyAction", postType, topic?.key, "all"],
|
|
86
85
|
{ select: (data) => data?.posts, enabled: !!topic }
|
|
87
86
|
);
|
|
88
87
|
const controlMeta = getControlMeta({
|
|
@@ -108,7 +107,7 @@ function createPostEditPage({
|
|
|
108
107
|
),
|
|
109
108
|
titleProps: {
|
|
110
109
|
title: t("resources.post.text"),
|
|
111
|
-
leftChildren: /* @__PURE__ */ jsx(Badge, { isLoading: isFetching, children:
|
|
110
|
+
leftChildren: /* @__PURE__ */ jsx(Badge, { isLoading: isFetching, children: topic?.title[defaultWebLocale] })
|
|
112
111
|
}
|
|
113
112
|
}
|
|
114
113
|
),
|
|
@@ -127,7 +126,7 @@ function createPostEditPage({
|
|
|
127
126
|
parentLabelKey: "resources.category.text"
|
|
128
127
|
} : {},
|
|
129
128
|
controlMeta,
|
|
130
|
-
isFetching:
|
|
129
|
+
isFetching: isFetching || isFetchingControlMeta,
|
|
131
130
|
isNotFound,
|
|
132
131
|
allowField: allowFieldInTopic
|
|
133
132
|
}
|
|
@@ -138,7 +137,7 @@ function createPostEditPage({
|
|
|
138
137
|
categoryType,
|
|
139
138
|
subcategoryType,
|
|
140
139
|
controlMeta,
|
|
141
|
-
isFetching:
|
|
140
|
+
isFetching: isFetching || isFetchingControlMeta,
|
|
142
141
|
isNotFound
|
|
143
142
|
})
|
|
144
143
|
] });
|
|
@@ -5,18 +5,16 @@ import { SquareArrowOutUpRight, Pen, Trash2, Lock } from 'lucide-react';
|
|
|
5
5
|
import { useParams, useRouter } from 'next/navigation';
|
|
6
6
|
import { POST_TYPES } from 'sitero-domain';
|
|
7
7
|
import 'zod';
|
|
8
|
-
import '
|
|
9
|
-
import 'react';
|
|
10
|
-
import 'ua-parser-js';
|
|
11
|
-
import '../../../../../../../../../../shared/client/react-query/client.js';
|
|
12
|
-
import '@tanstack/react-query';
|
|
13
|
-
import { useCommand } from '../../../../../../../../../../shared/client/react-query/use-command.js';
|
|
8
|
+
import { useCmsCommand } from '../../../../../../../../infrastructure/operation-result/use-cms-command.js';
|
|
14
9
|
import { useCmsQuery } from '../../../../../../../../infrastructure/operation-result/use-cms-query.js';
|
|
15
10
|
import { CMS_PATHS } from '../../../../../../../../../../constants/paths/cms-paths.js';
|
|
16
11
|
import '../../../../../../../../../../constants/paths/redirect.js';
|
|
17
12
|
import '../../../../../../../../../../constants/cms-locale.js';
|
|
18
13
|
import 'mime-types';
|
|
19
|
-
import
|
|
14
|
+
import 'react';
|
|
15
|
+
import 'ua-parser-js';
|
|
16
|
+
import '../../../../../../../../../../shared/client/react-query/client.js';
|
|
17
|
+
import '@tanstack/react-query';
|
|
20
18
|
import 'clsx';
|
|
21
19
|
import 'tailwind-merge';
|
|
22
20
|
import { joinUrl } from '../../../../../../../../../../shared/utils/join-url.js';
|
|
@@ -34,6 +32,7 @@ import '@radix-ui/react-select';
|
|
|
34
32
|
import '@radix-ui/react-separator';
|
|
35
33
|
import '../../../../../../../components/shadcn/sidebar/sidebar.js';
|
|
36
34
|
import 'next-themes';
|
|
35
|
+
import 'sonner';
|
|
37
36
|
import '@radix-ui/react-tabs';
|
|
38
37
|
import '@radix-ui/react-tooltip';
|
|
39
38
|
import { Badge } from '../../../../../../../components/ui/display/badge.js';
|
|
@@ -71,11 +70,7 @@ function createPostShowPage({
|
|
|
71
70
|
const subcategoryType = staticTopics[topicSlug]?.roles.includes(
|
|
72
71
|
POST_TYPES.SUBCATEGORY
|
|
73
72
|
) ? POST_TYPES.SUBCATEGORY : void 0;
|
|
74
|
-
const
|
|
75
|
-
() => postFindDetailAction({ type: POST_TYPES.TOPIC, slug: topicSlug }),
|
|
76
|
-
["postFindDetailAction", POST_TYPES.TOPIC, topicSlug],
|
|
77
|
-
{ select: (data) => data?.post }
|
|
78
|
-
);
|
|
73
|
+
const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug]} : void 0;
|
|
79
74
|
const {
|
|
80
75
|
data: post,
|
|
81
76
|
isFetching,
|
|
@@ -87,7 +82,7 @@ function createPostShowPage({
|
|
|
87
82
|
select: (data) => data?.post
|
|
88
83
|
}
|
|
89
84
|
);
|
|
90
|
-
const { execute, isRedirecting } =
|
|
85
|
+
const { execute, isRedirecting } = useCmsCommand(
|
|
91
86
|
() => postDeleteAction({ id }),
|
|
92
87
|
{
|
|
93
88
|
onSuccess: () => router.replace(
|
|
@@ -114,7 +109,7 @@ function createPostShowPage({
|
|
|
114
109
|
),
|
|
115
110
|
titleProps: {
|
|
116
111
|
title: t("resources.post.text"),
|
|
117
|
-
leftChildren: /* @__PURE__ */ jsx(Badge, {
|
|
112
|
+
leftChildren: /* @__PURE__ */ jsx(Badge, { children: topic?.title[defaultWebLocale] }),
|
|
118
113
|
rightChildren: post?.isLocked && /* @__PURE__ */ jsx(
|
|
119
114
|
Lock,
|
|
120
115
|
{
|
|
@@ -148,12 +143,12 @@ function createPostShowPage({
|
|
|
148
143
|
variant: "destructive",
|
|
149
144
|
icon: Trash2,
|
|
150
145
|
onClick: () => {
|
|
151
|
-
if (!confirm(t("ui.dialog.
|
|
146
|
+
if (!confirm(t("ui.dialog.move-to-trash.text"))) return;
|
|
152
147
|
void execute();
|
|
153
148
|
},
|
|
154
149
|
isLoading: isRedirecting,
|
|
155
150
|
isDisabled: isFetching || post?.isLocked,
|
|
156
|
-
children: t("ui.
|
|
151
|
+
children: t("ui.move-to-trash.text")
|
|
157
152
|
}
|
|
158
153
|
)
|
|
159
154
|
] }),
|
|
@@ -14,7 +14,6 @@ import { CMS_PATHS } from '../../../../../../../../../../constants/paths/cms-pat
|
|
|
14
14
|
import '../../../../../../../../../../constants/paths/redirect.js';
|
|
15
15
|
import '../../../../../../../../../../constants/cms-locale.js';
|
|
16
16
|
import 'mime-types';
|
|
17
|
-
import { findTranslation } from '../../../../../../../../../../shared/translation/find-translation.js';
|
|
18
17
|
import 'clsx';
|
|
19
18
|
import 'tailwind-merge';
|
|
20
19
|
import { ensureArray } from '../../../../../../../../../../shared/utils/ensure-array.js';
|
|
@@ -47,7 +46,6 @@ import '../../../../../../../components/ui/inputs/password-input.js';
|
|
|
47
46
|
|
|
48
47
|
function createPostCreatePage({
|
|
49
48
|
topics: staticTopics,
|
|
50
|
-
postFindDetailAction,
|
|
51
49
|
postFindManyAction,
|
|
52
50
|
renderPostCreateContent,
|
|
53
51
|
PostCreateContent,
|
|
@@ -68,14 +66,14 @@ function createPostCreatePage({
|
|
|
68
66
|
CMS_PATHS.content["content-management"].pathname,
|
|
69
67
|
topicSlug
|
|
70
68
|
);
|
|
71
|
-
const
|
|
72
|
-
() => postFindDetailAction({ type: POST_TYPES.TOPIC, slug: topicSlug }),
|
|
73
|
-
["postFindDetailAction", POST_TYPES.TOPIC, topicSlug],
|
|
74
|
-
{ select: (data) => data?.post }
|
|
75
|
-
);
|
|
69
|
+
const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug], key: topicSlug } : void 0;
|
|
76
70
|
const { data: posts, isFetching: isFetchingControlMeta } = useCmsQuery(
|
|
77
|
-
() => postFindManyAction({
|
|
78
|
-
|
|
71
|
+
() => postFindManyAction({
|
|
72
|
+
type: postType,
|
|
73
|
+
topicKey: topic?.key,
|
|
74
|
+
deletion: "all"
|
|
75
|
+
}),
|
|
76
|
+
["postFindManyAction", postType, topic?.key, "all"],
|
|
79
77
|
{ select: (data) => data?.posts, enabled: !!topic }
|
|
80
78
|
);
|
|
81
79
|
const controlMeta = getControlMeta({ records: ensureArray(posts) });
|
|
@@ -86,14 +84,14 @@ function createPostCreatePage({
|
|
|
86
84
|
navigation: /* @__PURE__ */ jsx(ReturnButton, { useConfirm: true, href: returnHref }),
|
|
87
85
|
titleProps: {
|
|
88
86
|
title: t("resources.post.text"),
|
|
89
|
-
leftChildren: /* @__PURE__ */ jsx(Badge, {
|
|
87
|
+
leftChildren: /* @__PURE__ */ jsx(Badge, { children: topic?.title[defaultWebLocale] })
|
|
90
88
|
}
|
|
91
89
|
}
|
|
92
90
|
),
|
|
93
|
-
PostCreateContent && allowField && /* @__PURE__ */ jsx(
|
|
91
|
+
topic && PostCreateContent && allowField && /* @__PURE__ */ jsx(
|
|
94
92
|
PostCreateContent,
|
|
95
93
|
{
|
|
96
|
-
topic,
|
|
94
|
+
topicKey: topic?.key,
|
|
97
95
|
postType,
|
|
98
96
|
...hasSubcategory ? {
|
|
99
97
|
parentType: subcategoryType,
|
|
@@ -105,18 +103,18 @@ function createPostCreatePage({
|
|
|
105
103
|
parentLabelKey: "resources.category.text"
|
|
106
104
|
} : {},
|
|
107
105
|
controlMeta,
|
|
108
|
-
isFetching:
|
|
106
|
+
isFetching: isFetchingControlMeta,
|
|
109
107
|
allowField: allowFieldInTopic,
|
|
110
108
|
cancelButtonHref: returnHref
|
|
111
109
|
}
|
|
112
110
|
),
|
|
113
|
-
renderPostCreateContent && renderPostCreateContent({
|
|
114
|
-
topic,
|
|
111
|
+
topic && renderPostCreateContent && renderPostCreateContent({
|
|
112
|
+
topicKey: topic?.key,
|
|
115
113
|
postType,
|
|
116
114
|
categoryType,
|
|
117
115
|
subcategoryType,
|
|
118
116
|
controlMeta,
|
|
119
|
-
isFetching:
|
|
117
|
+
isFetching: isFetchingControlMeta,
|
|
120
118
|
cancelButtonHref: returnHref
|
|
121
119
|
})
|
|
122
120
|
] });
|
|
@@ -12,7 +12,6 @@ import '../../../../../../../../../../../shared/client/react-query/client.js';
|
|
|
12
12
|
import '@tanstack/react-query';
|
|
13
13
|
import { useCmsQuery } from '../../../../../../../../../infrastructure/operation-result/use-cms-query.js';
|
|
14
14
|
import 'mime-types';
|
|
15
|
-
import { findTranslation } from '../../../../../../../../../../../shared/translation/find-translation.js';
|
|
16
15
|
import 'clsx';
|
|
17
16
|
import 'tailwind-merge';
|
|
18
17
|
import { ensureArray } from '../../../../../../../../../../../shared/utils/ensure-array.js';
|
|
@@ -44,6 +43,7 @@ import '../../../../../../../../components/ui/inputs/switch-input.js';
|
|
|
44
43
|
import '../../../../../../../../components/ui/inputs/password-input.js';
|
|
45
44
|
|
|
46
45
|
function createSubcategoryEditPage({
|
|
46
|
+
topics: staticTopics,
|
|
47
47
|
postFindDetailAction,
|
|
48
48
|
postFindManyAction,
|
|
49
49
|
renderPostEditContent,
|
|
@@ -56,11 +56,7 @@ function createSubcategoryEditPage({
|
|
|
56
56
|
const allowFieldInTopic = (params) => allowField?.({ ...params, topicSlug: params.topicSlug ?? topicSlug }) ?? false;
|
|
57
57
|
const categoryType = POST_TYPES.CATEGORY;
|
|
58
58
|
const subcategoryType = POST_TYPES.SUBCATEGORY;
|
|
59
|
-
const
|
|
60
|
-
() => postFindDetailAction({ type: POST_TYPES.TOPIC, slug: topicSlug }),
|
|
61
|
-
["postFindDetailAction", POST_TYPES.TOPIC, topicSlug],
|
|
62
|
-
{ select: (data) => data?.post }
|
|
63
|
-
);
|
|
59
|
+
const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug], key: topicSlug } : void 0;
|
|
64
60
|
const {
|
|
65
61
|
data: subcategory,
|
|
66
62
|
isFetching,
|
|
@@ -73,8 +69,12 @@ function createSubcategoryEditPage({
|
|
|
73
69
|
}
|
|
74
70
|
);
|
|
75
71
|
const { data: categories, isFetching: isFetchingControlMeta } = useCmsQuery(
|
|
76
|
-
() => postFindManyAction({
|
|
77
|
-
|
|
72
|
+
() => postFindManyAction({
|
|
73
|
+
type: subcategoryType,
|
|
74
|
+
topicKey: topic?.key,
|
|
75
|
+
deletion: "all"
|
|
76
|
+
}),
|
|
77
|
+
["postFindManyAction", subcategoryType, topic?.key, "all"],
|
|
78
78
|
{ select: (data) => data?.posts, enabled: !!topic }
|
|
79
79
|
);
|
|
80
80
|
const controlMeta = getControlMeta({
|
|
@@ -90,7 +90,7 @@ function createSubcategoryEditPage({
|
|
|
90
90
|
titleProps: {
|
|
91
91
|
icon: Notebook,
|
|
92
92
|
title: t("resources.subcategory.text"),
|
|
93
|
-
leftChildren: /* @__PURE__ */ jsx(Badge, {
|
|
93
|
+
leftChildren: /* @__PURE__ */ jsx(Badge, { children: topic?.title[locale] })
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
),
|
|
@@ -102,7 +102,7 @@ function createSubcategoryEditPage({
|
|
|
102
102
|
parentType: categoryType,
|
|
103
103
|
parentLabelKey: "resources.category.text",
|
|
104
104
|
controlMeta,
|
|
105
|
-
isFetching:
|
|
105
|
+
isFetching: isFetching || isFetchingControlMeta,
|
|
106
106
|
isNotFound,
|
|
107
107
|
allowField: allowFieldInTopic
|
|
108
108
|
}
|
|
@@ -112,7 +112,7 @@ function createSubcategoryEditPage({
|
|
|
112
112
|
categoryType,
|
|
113
113
|
subcategoryType,
|
|
114
114
|
controlMeta,
|
|
115
|
-
isFetching:
|
|
115
|
+
isFetching: isFetching || isFetchingControlMeta,
|
|
116
116
|
isNotFound
|
|
117
117
|
})
|
|
118
118
|
] });
|
|
@@ -5,18 +5,16 @@ import { Notebook, SquareArrowOutUpRight, Pen, Trash2, Lock } from 'lucide-react
|
|
|
5
5
|
import { useParams, useRouter } from 'next/navigation';
|
|
6
6
|
import { POST_TYPES } from 'sitero-domain';
|
|
7
7
|
import 'zod';
|
|
8
|
-
import '
|
|
9
|
-
import 'react';
|
|
10
|
-
import 'ua-parser-js';
|
|
11
|
-
import '../../../../../../../../../../shared/client/react-query/client.js';
|
|
12
|
-
import '@tanstack/react-query';
|
|
13
|
-
import { useCommand } from '../../../../../../../../../../shared/client/react-query/use-command.js';
|
|
8
|
+
import { useCmsCommand } from '../../../../../../../../infrastructure/operation-result/use-cms-command.js';
|
|
14
9
|
import { useCmsQuery } from '../../../../../../../../infrastructure/operation-result/use-cms-query.js';
|
|
15
10
|
import { CMS_PATHS } from '../../../../../../../../../../constants/paths/cms-paths.js';
|
|
16
11
|
import '../../../../../../../../../../constants/paths/redirect.js';
|
|
17
12
|
import '../../../../../../../../../../constants/cms-locale.js';
|
|
18
13
|
import 'mime-types';
|
|
19
|
-
import
|
|
14
|
+
import 'react';
|
|
15
|
+
import 'ua-parser-js';
|
|
16
|
+
import '../../../../../../../../../../shared/client/react-query/client.js';
|
|
17
|
+
import '@tanstack/react-query';
|
|
20
18
|
import 'clsx';
|
|
21
19
|
import 'tailwind-merge';
|
|
22
20
|
import { joinUrl } from '../../../../../../../../../../shared/utils/join-url.js';
|
|
@@ -34,6 +32,7 @@ import '@radix-ui/react-select';
|
|
|
34
32
|
import '@radix-ui/react-separator';
|
|
35
33
|
import '../../../../../../../components/shadcn/sidebar/sidebar.js';
|
|
36
34
|
import 'next-themes';
|
|
35
|
+
import 'sonner';
|
|
37
36
|
import '@radix-ui/react-tabs';
|
|
38
37
|
import '@radix-ui/react-tooltip';
|
|
39
38
|
import { Badge } from '../../../../../../../components/ui/display/badge.js';
|
|
@@ -54,6 +53,7 @@ import 'intor/next';
|
|
|
54
53
|
function createSubcategoryShowPage({
|
|
55
54
|
enableSeoMetadata,
|
|
56
55
|
externalHref,
|
|
56
|
+
topics: staticTopics,
|
|
57
57
|
postFindDetailAction,
|
|
58
58
|
postDeleteAction,
|
|
59
59
|
SeoMetadataDialog,
|
|
@@ -66,11 +66,7 @@ function createSubcategoryShowPage({
|
|
|
66
66
|
const { id, topicSlug } = useParams();
|
|
67
67
|
const router = useRouter();
|
|
68
68
|
const postType = POST_TYPES.POST;
|
|
69
|
-
const
|
|
70
|
-
() => postFindDetailAction({ type: POST_TYPES.TOPIC, slug: topicSlug }),
|
|
71
|
-
["postFindDetailAction", POST_TYPES.TOPIC, topicSlug],
|
|
72
|
-
{ select: (data) => data?.post }
|
|
73
|
-
);
|
|
69
|
+
const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug]} : void 0;
|
|
74
70
|
const {
|
|
75
71
|
data: subcategory,
|
|
76
72
|
isFetching,
|
|
@@ -82,7 +78,7 @@ function createSubcategoryShowPage({
|
|
|
82
78
|
select: (data) => data?.post
|
|
83
79
|
}
|
|
84
80
|
);
|
|
85
|
-
const { execute, isRedirecting } =
|
|
81
|
+
const { execute, isRedirecting } = useCmsCommand(
|
|
86
82
|
() => postDeleteAction({ id }),
|
|
87
83
|
{
|
|
88
84
|
onSuccess: () => router.replace(
|
|
@@ -110,7 +106,7 @@ function createSubcategoryShowPage({
|
|
|
110
106
|
titleProps: {
|
|
111
107
|
icon: Notebook,
|
|
112
108
|
title: t("resources.subcategory.text"),
|
|
113
|
-
leftChildren: /* @__PURE__ */ jsx(Badge, {
|
|
109
|
+
leftChildren: /* @__PURE__ */ jsx(Badge, { children: topic?.title[locale] }),
|
|
114
110
|
rightChildren: subcategory?.isLocked && /* @__PURE__ */ jsx(
|
|
115
111
|
Lock,
|
|
116
112
|
{
|
|
@@ -144,12 +140,12 @@ function createSubcategoryShowPage({
|
|
|
144
140
|
variant: "destructive",
|
|
145
141
|
icon: Trash2,
|
|
146
142
|
onClick: () => {
|
|
147
|
-
if (!confirm(t("ui.dialog.
|
|
143
|
+
if (!confirm(t("ui.dialog.move-to-trash.text"))) return;
|
|
148
144
|
void execute();
|
|
149
145
|
},
|
|
150
146
|
isLoading: isRedirecting,
|
|
151
147
|
isDisabled: isFetching || subcategory?.isLocked,
|
|
152
|
-
children: t("ui.
|
|
148
|
+
children: t("ui.move-to-trash.text")
|
|
153
149
|
}
|
|
154
150
|
)
|
|
155
151
|
] }),
|
|
@@ -14,7 +14,6 @@ import { CMS_PATHS } from '../../../../../../../../../../constants/paths/cms-pat
|
|
|
14
14
|
import '../../../../../../../../../../constants/paths/redirect.js';
|
|
15
15
|
import '../../../../../../../../../../constants/cms-locale.js';
|
|
16
16
|
import 'mime-types';
|
|
17
|
-
import { findTranslation } from '../../../../../../../../../../shared/translation/find-translation.js';
|
|
18
17
|
import 'clsx';
|
|
19
18
|
import 'tailwind-merge';
|
|
20
19
|
import { ensureArray } from '../../../../../../../../../../shared/utils/ensure-array.js';
|
|
@@ -46,7 +45,7 @@ import '../../../../../../../components/ui/inputs/switch-input.js';
|
|
|
46
45
|
import '../../../../../../../components/ui/inputs/password-input.js';
|
|
47
46
|
|
|
48
47
|
function createSubcategoryCreatePage({
|
|
49
|
-
|
|
48
|
+
topics: staticTopics,
|
|
50
49
|
postFindManyAction,
|
|
51
50
|
renderPostCreateContent,
|
|
52
51
|
PostCreateContent,
|
|
@@ -62,14 +61,14 @@ function createSubcategoryCreatePage({
|
|
|
62
61
|
CMS_PATHS.content["content-management"].pathname,
|
|
63
62
|
topicSlug
|
|
64
63
|
);
|
|
65
|
-
const
|
|
66
|
-
() => postFindDetailAction({ type: POST_TYPES.TOPIC, slug: topicSlug }),
|
|
67
|
-
["postFindDetailAction", POST_TYPES.TOPIC, topicSlug],
|
|
68
|
-
{ select: (data) => data?.post }
|
|
69
|
-
);
|
|
64
|
+
const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug], key: topicSlug } : void 0;
|
|
70
65
|
const { data: subcategories, isFetching: isFetchingControlMeta } = useCmsQuery(
|
|
71
|
-
() => postFindManyAction({
|
|
72
|
-
|
|
66
|
+
() => postFindManyAction({
|
|
67
|
+
type: subcategoryType,
|
|
68
|
+
topicKey: topic?.key,
|
|
69
|
+
deletion: "all"
|
|
70
|
+
}),
|
|
71
|
+
["postFindManyAction", subcategoryType, topic?.key, "all"],
|
|
73
72
|
{ select: (data) => data?.posts, enabled: !!topic }
|
|
74
73
|
);
|
|
75
74
|
const controlMeta = getControlMeta({ records: ensureArray(subcategories) });
|
|
@@ -80,29 +79,29 @@ function createSubcategoryCreatePage({
|
|
|
80
79
|
navigation: /* @__PURE__ */ jsx(ReturnButton, { useConfirm: true, href: returnHref }),
|
|
81
80
|
titleProps: {
|
|
82
81
|
title: t("resources.subcategory.text"),
|
|
83
|
-
leftChildren: /* @__PURE__ */ jsx(Badge, {
|
|
82
|
+
leftChildren: /* @__PURE__ */ jsx(Badge, { children: topic?.title[locale] })
|
|
84
83
|
}
|
|
85
84
|
}
|
|
86
85
|
),
|
|
87
|
-
PostCreateContent && allowField && /* @__PURE__ */ jsx(
|
|
86
|
+
topic && PostCreateContent && allowField && /* @__PURE__ */ jsx(
|
|
88
87
|
PostCreateContent,
|
|
89
88
|
{
|
|
90
|
-
topic,
|
|
89
|
+
topicKey: topic?.key,
|
|
91
90
|
postType: subcategoryType,
|
|
92
91
|
parentType: categoryType,
|
|
93
92
|
parentLabelKey: "resources.category.text",
|
|
94
93
|
controlMeta,
|
|
95
|
-
isFetching:
|
|
94
|
+
isFetching: isFetchingControlMeta,
|
|
96
95
|
allowField: allowFieldInTopic,
|
|
97
96
|
cancelButtonHref: returnHref
|
|
98
97
|
}
|
|
99
98
|
),
|
|
100
|
-
renderPostCreateContent?.({
|
|
101
|
-
topic,
|
|
99
|
+
topic && renderPostCreateContent?.({
|
|
100
|
+
topicKey: topic?.key,
|
|
102
101
|
categoryType,
|
|
103
102
|
subcategoryType,
|
|
104
103
|
controlMeta,
|
|
105
|
-
isFetching:
|
|
104
|
+
isFetching: isFetchingControlMeta,
|
|
106
105
|
cancelButtonHref: returnHref
|
|
107
106
|
})
|
|
108
107
|
] });
|