sitero 0.7.0 → 0.9.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/pages/index.js +13 -14
- package/dist/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/post.js +1 -1
- package/dist/src/cms/client/infrastructure/i18n/messages/zh-TW/ui/index.js +5 -5
- package/dist/src/cms/client/interfaces/components/create-components.js +3 -0
- package/dist/src/cms/client/interfaces/components/resources/post/category/category-card.js +16 -6
- package/dist/src/cms/client/interfaces/components/resources/post/category/category-table.js +10 -1
- package/dist/src/cms/client/interfaces/components/resources/post/content/post-create-content.js +3 -4
- package/dist/src/cms/client/interfaces/components/resources/post/content/post-edit-content.js +4 -4
- package/dist/src/cms/client/interfaces/components/resources/post/content/post-show-content.js +4 -4
- package/dist/src/cms/client/interfaces/components/resources/post/content/types.js +2 -2
- package/dist/src/cms/client/interfaces/components/resources/post/post-card.js +16 -6
- package/dist/src/cms/client/interfaces/components/resources/post/post-list.js +4 -0
- package/dist/src/cms/client/interfaces/components/resources/post/post-state-icons.js +23 -8
- package/dist/src/cms/client/interfaces/components/resources/post/post-table.js +10 -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/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/category/_id_/edit/page.js +3 -3
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/category/_id_/page.js +6 -9
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/category/_id_/relations/page.js +2 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/category/create/page.js +4 -4
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/page.js +13 -13
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/post/_id_/edit/page.js +5 -7
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/post/_id_/page.js +7 -10
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/post/create/page.js +5 -5
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/subcategory/_id_/edit/page.js +3 -3
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/subcategory/_id_/page.js +6 -9
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/subcategory/create/page.js +4 -4
- package/dist/src/config/topics.js +16 -16
- package/dist/src/constants/paths/cms-paths.js +3 -3
- package/dist/src/core/infrastructure/prisma/post/post-prisma-ports.js +1 -2
- package/dist/src/web/server/resources/post/actions.js +22 -25
- package/dist/src/web/server/seo/sitemap/get-category-items.js +3 -3
- package/dist/src/web/server/seo/sitemap/get-post-items.js +5 -5
- package/dist/src/web/server/seo/sitemap/get-subcategory-items.js +3 -3
- package/dist/types/export/cms/client/pages/index.d.ts +1 -1
- package/dist/types/export/cms/client/pages/index.d.ts.map +1 -1
- package/dist/types/export/web/server/index.d.ts +1 -1
- package/dist/types/export/web/server/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/create-components.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-card.d.ts +3 -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.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/types.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/types.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-card.d.ts +5 -4
- 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.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-presentation.d.ts +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 +3 -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/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/shadcn/sidebar/sidebar.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/shadcn/sidebar/use-mobile.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/category/[id]/edit/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/category/[id]/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/category/[id]/relations/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/category/create/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/category/index.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/page.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/post/[id]/edit/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/post/[id]/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/post/[id]/relations/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/post/create/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/post/index.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/subcategory/[id]/edit/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/subcategory/[id]/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/subcategory/[id]/relations/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/subcategory/create/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/subcategory/index.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/index.d.ts +4 -5
- package/dist/types/src/cms/client/interfaces/pages/index.d.ts.map +1 -1
- package/dist/types/src/config/topics.d.ts +8 -8
- 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/constants/paths/cms-paths.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/web/server/index.d.ts +1 -1
- package/dist/types/src/web/server/resources/post/actions.d.ts +6 -8
- package/dist/types/src/web/server/resources/post/actions.d.ts.map +1 -1
- package/dist/types/src/web/server/seo/sitemap/get-category-items.d.ts +2 -2
- package/dist/types/src/web/server/seo/sitemap/get-category-items.d.ts.map +1 -1
- package/dist/types/src/web/server/seo/sitemap/get-post-items.d.ts +2 -2
- 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 +2 -2
- 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 +7 -10
- package/dist/types/src/web/server/types.d.ts.map +1 -1
- package/package.json +4 -3
- package/dist/src/cms/client/interfaces/pages/page.js +0 -17
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/edit/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/relations/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/create/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/index.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/[id]/edit/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/[id]/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/[id]/relations/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/create/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/index.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/edit/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/relations/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/create/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/index.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/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/post/_id_/relations/page.js +0 -0
- /package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/subcategory/_id_/relations/page.js +0 -0
- /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/category/[id]/edit/page.d.ts +0 -0
- /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/category/[id]/page.d.ts +0 -0
- /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/category/[id]/relations/page.d.ts +0 -0
- /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/category/create/page.d.ts +0 -0
- /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/category/index.d.ts +0 -0
- /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/index.d.ts +0 -0
- /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/post/[id]/edit/page.d.ts +0 -0
- /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/post/[id]/page.d.ts +0 -0
- /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/post/[id]/relations/page.d.ts +0 -0
- /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/post/create/page.d.ts +0 -0
- /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/post/index.d.ts +0 -0
- /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/subcategory/[id]/edit/page.d.ts +0 -0
- /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/subcategory/[id]/page.d.ts +0 -0
- /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/subcategory/[id]/relations/page.d.ts +0 -0
- /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/subcategory/create/page.d.ts +0 -0
- /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/subcategory/index.d.ts +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { createCmsPage } from '../../../../src/cms/client/interfaces/pages/page.js';
|
|
2
1
|
export { createSignInPage } from '../../../../src/cms/client/interfaces/pages/(auth)/sign-in/page.js';
|
|
3
2
|
export { createVerifyEmailPage } from '../../../../src/cms/client/interfaces/pages/(auth)/verify-email/page.js';
|
|
4
3
|
export { createEmailUnverifiedPage } from '../../../../src/cms/client/interfaces/pages/(auth)/email-unverified/page.js';
|
|
@@ -33,19 +32,19 @@ export { createWebsitePageEditPage } from '../../../../src/cms/client/interfaces
|
|
|
33
32
|
export { createInquiryIndexPage } from '../../../../src/cms/client/interfaces/pages/dashboard/website/inquiry/page.js';
|
|
34
33
|
export { createInquiryShowPage } from '../../../../src/cms/client/interfaces/pages/dashboard/website/inquiry/_id_/page.js';
|
|
35
34
|
export { createContentManagementPage as createCollectionsPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/page.js';
|
|
36
|
-
export { createTopicScopePage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/
|
|
37
|
-
export { createPostCreatePage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/
|
|
38
|
-
export { createPostShowPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/
|
|
39
|
-
export { createPostRelationsPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/
|
|
40
|
-
export { createPostEditPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/
|
|
41
|
-
export { createCategoryCreatePage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/
|
|
42
|
-
export { createCategoryShowPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/
|
|
43
|
-
export { createCategoryRelationsPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/
|
|
44
|
-
export { createCategoryEditPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/
|
|
45
|
-
export { createSubcategoryCreatePage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/
|
|
46
|
-
export { createSubcategoryShowPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/
|
|
47
|
-
export { createSubcategoryRelationsPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/
|
|
48
|
-
export { createSubcategoryEditPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/
|
|
35
|
+
export { createTopicScopePage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/page.js';
|
|
36
|
+
export { createPostCreatePage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/post/create/page.js';
|
|
37
|
+
export { createPostShowPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/post/_id_/page.js';
|
|
38
|
+
export { createPostRelationsPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/post/_id_/relations/page.js';
|
|
39
|
+
export { createPostEditPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/post/_id_/edit/page.js';
|
|
40
|
+
export { createCategoryCreatePage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/category/create/page.js';
|
|
41
|
+
export { createCategoryShowPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/category/_id_/page.js';
|
|
42
|
+
export { createCategoryRelationsPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/category/_id_/relations/page.js';
|
|
43
|
+
export { createCategoryEditPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/category/_id_/edit/page.js';
|
|
44
|
+
export { createSubcategoryCreatePage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/subcategory/create/page.js';
|
|
45
|
+
export { createSubcategoryShowPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/subcategory/_id_/page.js';
|
|
46
|
+
export { createSubcategoryRelationsPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/subcategory/_id_/relations/page.js';
|
|
47
|
+
export { createSubcategoryEditPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/subcategory/_id_/edit/page.js';
|
|
49
48
|
export { createTagIndexPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/tag/page.js';
|
|
50
49
|
export { createTagCreatePage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/tag/create/page.js';
|
|
51
50
|
export { createTagShowPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/tag/_id_/page.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const post = {
|
|
2
|
-
"is-public": { text: "\
|
|
2
|
+
"is-public": { text: "\u516C\u958B" },
|
|
3
3
|
"confirm-restore": { text: "\u78BA\u5B9A\u9084\u539F\u9078\u53D6\u7684\u5167\u5BB9\uFF1F\u9084\u539F\u5F8C\u5C07\u4FDD\u6301\u672A\u516C\u958B\u3002" },
|
|
4
4
|
type: { text: "\u5167\u5BB9\u985E\u578B" },
|
|
5
5
|
"previous-page": { text: "\u4E0A\u4E00\u9801" },
|
|
@@ -153,13 +153,13 @@ const ui = {
|
|
|
153
153
|
no: { text: "\u5426" }
|
|
154
154
|
},
|
|
155
155
|
"control-fields": {
|
|
156
|
-
"is-active": { text: "\
|
|
157
|
-
"is-index-active": { text: "\
|
|
156
|
+
"is-active": { text: "\u555F\u7528" },
|
|
157
|
+
"is-index-active": { text: "\u555F\u7528\u6392\u5E8F" },
|
|
158
158
|
index: { text: "\u6392\u5E8F" },
|
|
159
|
-
"is-slug-active": { text: "\
|
|
159
|
+
"is-slug-active": { text: "\u555F\u7528\u7DB2\u5740" },
|
|
160
160
|
slug: { text: "\u7DB2\u5740\u8B58\u5225\u540D\u7A31 (\u5FC5\u9808\u552F\u4E00)" },
|
|
161
|
-
"is-featured": { text: "\
|
|
162
|
-
"is-shown-on-home": { text: "\
|
|
161
|
+
"is-featured": { text: "\u7CBE\u9078" },
|
|
162
|
+
"is-shown-on-home": { text: "\u986F\u793A\u65BC\u9996\u9801" }
|
|
163
163
|
}
|
|
164
164
|
};
|
|
165
165
|
|
|
@@ -73,6 +73,7 @@ function createComponents(input) {
|
|
|
73
73
|
locales: constants.webLocales
|
|
74
74
|
});
|
|
75
75
|
const PostCard = createPostCard({
|
|
76
|
+
customControlFields: constants.post.customControlFields,
|
|
76
77
|
topics: constants.topics ?? {},
|
|
77
78
|
storageUrl: constants.storageUrl,
|
|
78
79
|
defaultWebLocale: constants.defaultWebLocale,
|
|
@@ -88,10 +89,12 @@ function createComponents(input) {
|
|
|
88
89
|
strategies: constants.post.strategies
|
|
89
90
|
});
|
|
90
91
|
const CategoryCard = createCategoryCard({
|
|
92
|
+
customControlFields: constants.post.customControlFields,
|
|
91
93
|
topics: constants.topics ?? {},
|
|
92
94
|
defaultWebLocale: constants.defaultWebLocale
|
|
93
95
|
});
|
|
94
96
|
const TagCard = createTagCard({
|
|
97
|
+
customControlFields: constants.post.customControlFields,
|
|
95
98
|
defaultWebLocale: constants.defaultWebLocale
|
|
96
99
|
});
|
|
97
100
|
const AdminCard = createAdminCard({
|
|
@@ -42,12 +42,15 @@ import { PostStateIcons } from '../post-state-icons.js';
|
|
|
42
42
|
const WIDTH = "200px";
|
|
43
43
|
function createCategoryCard({
|
|
44
44
|
topics = {},
|
|
45
|
-
defaultWebLocale
|
|
45
|
+
defaultWebLocale,
|
|
46
|
+
customControlFields: defaultCustomControlFields = []
|
|
46
47
|
}) {
|
|
47
48
|
return function CategoryCard({
|
|
48
49
|
post: category,
|
|
49
|
-
|
|
50
|
+
topicKey,
|
|
50
51
|
isSubcategory,
|
|
52
|
+
customControlFields = defaultCustomControlFields,
|
|
53
|
+
usableFields,
|
|
51
54
|
// link
|
|
52
55
|
openNewTab,
|
|
53
56
|
// pick
|
|
@@ -56,19 +59,19 @@ function createCategoryCard({
|
|
|
56
59
|
// base
|
|
57
60
|
className = ""
|
|
58
61
|
}) {
|
|
59
|
-
const
|
|
62
|
+
const resolvedTopicKey = category.topicKey ?? topicKey;
|
|
60
63
|
const topicT = {
|
|
61
64
|
title: topics[category.topicKey ?? ""]?.title[defaultWebLocale] ?? category.topicKey ?? ""
|
|
62
65
|
};
|
|
63
66
|
const categoryT = findTranslation(category?.translations, defaultWebLocale);
|
|
64
67
|
const href = isSubcategory ? joinUrl(
|
|
65
68
|
CMS_PATHS.content["content-management"].subcategory.pathname(
|
|
66
|
-
|
|
69
|
+
resolvedTopicKey
|
|
67
70
|
),
|
|
68
71
|
category?.id
|
|
69
72
|
) : joinUrl(
|
|
70
73
|
CMS_PATHS.content["content-management"].category.pathname(
|
|
71
|
-
|
|
74
|
+
resolvedTopicKey
|
|
72
75
|
),
|
|
73
76
|
category?.id
|
|
74
77
|
);
|
|
@@ -77,7 +80,14 @@ function createCategoryCard({
|
|
|
77
80
|
{
|
|
78
81
|
interaction: onSelect ? { type: "select", isSelected: !!isPicked, onSelect } : { type: "navigate", href, openNewTab },
|
|
79
82
|
identity: { icon: /* @__PURE__ */ jsx(Notebook, {}), badge: topicT.title },
|
|
80
|
-
state: /* @__PURE__ */ jsx(
|
|
83
|
+
state: /* @__PURE__ */ jsx(
|
|
84
|
+
PostStateIcons,
|
|
85
|
+
{
|
|
86
|
+
post: category,
|
|
87
|
+
customControlFields,
|
|
88
|
+
usableFields
|
|
89
|
+
}
|
|
90
|
+
),
|
|
81
91
|
title: categoryT.title || /* @__PURE__ */ jsx(NoData, {}),
|
|
82
92
|
className,
|
|
83
93
|
style: { width: WIDTH }
|
|
@@ -45,6 +45,8 @@ function CategoryTable({
|
|
|
45
45
|
topics = {},
|
|
46
46
|
posts: categories,
|
|
47
47
|
contentLocale,
|
|
48
|
+
customControlFields,
|
|
49
|
+
usableFields,
|
|
48
50
|
pickedItems,
|
|
49
51
|
onSelect,
|
|
50
52
|
openNewTab,
|
|
@@ -118,7 +120,14 @@ function CategoryTable({
|
|
|
118
120
|
isSelecting && /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx("div", { className: "flex-center text-muted-foreground/60", children: isPicked ? /* @__PURE__ */ jsx(Tick, { isPicked: true }) : /* @__PURE__ */ jsx(Circle, { "aria-hidden": true, className: "size-5!" }) }) }),
|
|
119
121
|
/* @__PURE__ */ jsx(TableCell, { className: "border-r", children: /* @__PURE__ */ jsx("div", { className: "flex-center", children: /* @__PURE__ */ jsx(Notebook, { className: "text-muted-foreground" }) }) }),
|
|
120
122
|
/* @__PURE__ */ jsx(TableCell, { className: "w-40", children: /* @__PURE__ */ jsx(Badge, { className: "h-5.5 w-fit max-w-32 min-w-0 px-3", children: topicT.title }) }),
|
|
121
|
-
/* @__PURE__ */ jsx(TableCell, { className: "w-40", children: /* @__PURE__ */ jsx(
|
|
123
|
+
/* @__PURE__ */ jsx(TableCell, { className: "w-40", children: /* @__PURE__ */ jsx(
|
|
124
|
+
PostStateIcons,
|
|
125
|
+
{
|
|
126
|
+
post: category,
|
|
127
|
+
customControlFields,
|
|
128
|
+
usableFields
|
|
129
|
+
}
|
|
130
|
+
) }),
|
|
122
131
|
/* @__PURE__ */ jsx(TableCell, { className: "max-w-[200px]", children: title ? /* @__PURE__ */ jsx("p", { className: "truncate", children: title }) : /* @__PURE__ */ jsx(NoData, {}) })
|
|
123
132
|
]
|
|
124
133
|
},
|
package/dist/src/cms/client/interfaces/components/resources/post/content/post-create-content.js
CHANGED
|
@@ -102,8 +102,7 @@ function createPostCreateContent({
|
|
|
102
102
|
const parentPathname = useParentPathname();
|
|
103
103
|
const { admin } = useAdmin();
|
|
104
104
|
const editorLocale = cmsLocale.startsWith("zh") ? "zh" : "en";
|
|
105
|
-
const
|
|
106
|
-
const isFieldAllowed = (type, field, fieldRuleKey) => allowField({ topicSlug, type, field, fieldRuleKey });
|
|
105
|
+
const isFieldAllowed = (type, field, fieldRuleKey) => allowField({ topicKey, type, field, fieldRuleKey });
|
|
107
106
|
const { formData, setFormData } = usePostCreateFormData({
|
|
108
107
|
type: postType,
|
|
109
108
|
admin,
|
|
@@ -230,7 +229,7 @@ function createPostCreateContent({
|
|
|
230
229
|
{
|
|
231
230
|
openNewTab: true,
|
|
232
231
|
post: parent,
|
|
233
|
-
|
|
232
|
+
topicKey,
|
|
234
233
|
isSubcategory: isSubcategoryParent
|
|
235
234
|
},
|
|
236
235
|
parent.id
|
|
@@ -579,7 +578,7 @@ function createPostCreateContent({
|
|
|
579
578
|
{
|
|
580
579
|
openNewTab: true,
|
|
581
580
|
post: relatedPost,
|
|
582
|
-
|
|
581
|
+
topicKey
|
|
583
582
|
},
|
|
584
583
|
relatedPost.id
|
|
585
584
|
))
|
package/dist/src/cms/client/interfaces/components/resources/post/content/post-edit-content.js
CHANGED
|
@@ -101,8 +101,8 @@ function createPostEditContent({
|
|
|
101
101
|
const editorLocale = cmsLocale.startsWith("zh") ? "zh" : "en";
|
|
102
102
|
const id = post?.id ?? "";
|
|
103
103
|
const slug = post?.slug;
|
|
104
|
-
const
|
|
105
|
-
const isFieldAllowed = (type, field, fieldRuleKey) => allowField({
|
|
104
|
+
const topicKey = post?.topicKey ?? void 0;
|
|
105
|
+
const isFieldAllowed = (type, field, fieldRuleKey) => allowField({ topicKey, type, field, fieldRuleKey });
|
|
106
106
|
const { formData, setFormData } = usePostUpdateFormData({
|
|
107
107
|
post,
|
|
108
108
|
type: postType
|
|
@@ -227,7 +227,7 @@ function createPostEditContent({
|
|
|
227
227
|
{
|
|
228
228
|
openNewTab: true,
|
|
229
229
|
post: parent,
|
|
230
|
-
|
|
230
|
+
topicKey: post?.topicKey ?? void 0,
|
|
231
231
|
isSubcategory: isSubcategoryParent
|
|
232
232
|
},
|
|
233
233
|
parent.id
|
|
@@ -577,7 +577,7 @@ function createPostEditContent({
|
|
|
577
577
|
{
|
|
578
578
|
openNewTab: true,
|
|
579
579
|
post: relatedPost,
|
|
580
|
-
|
|
580
|
+
topicKey: post?.topicKey ?? void 0
|
|
581
581
|
},
|
|
582
582
|
relatedPost.id
|
|
583
583
|
))
|
package/dist/src/cms/client/interfaces/components/resources/post/content/post-show-content.js
CHANGED
|
@@ -72,10 +72,10 @@ function createPostShowContent({
|
|
|
72
72
|
}) {
|
|
73
73
|
const { t, format, locale: cmsLocale } = useTranslator();
|
|
74
74
|
const type = post?.type;
|
|
75
|
-
const
|
|
75
|
+
const topicKey = post?.topicKey ?? void 0;
|
|
76
76
|
const categories = post?.parents;
|
|
77
77
|
const parentLabelKey = subcategoryType && categories?.[0]?.type === subcategoryType ? "resources.subcategory.text" : "resources.category.text";
|
|
78
|
-
const isFieldAllowed = (type2, field, fieldRuleKey) => allowField({
|
|
78
|
+
const isFieldAllowed = (type2, field, fieldRuleKey) => allowField({ topicKey, type: type2, field, fieldRuleKey });
|
|
79
79
|
return /* @__PURE__ */ jsx(ContentContainer, { isNotFound, children: /* @__PURE__ */ jsxs(FieldsContainer, { children: [
|
|
80
80
|
/* @__PURE__ */ jsxs(MainFields, { children: [
|
|
81
81
|
topChildren,
|
|
@@ -90,7 +90,7 @@ function createPostShowContent({
|
|
|
90
90
|
CategoryCard,
|
|
91
91
|
{
|
|
92
92
|
post: p,
|
|
93
|
-
|
|
93
|
+
topicKey,
|
|
94
94
|
openNewTab: true,
|
|
95
95
|
isSubcategory: p.type === subcategoryType
|
|
96
96
|
},
|
|
@@ -273,7 +273,7 @@ function createPostShowContent({
|
|
|
273
273
|
PostCard,
|
|
274
274
|
{
|
|
275
275
|
post: p,
|
|
276
|
-
|
|
276
|
+
topicKey,
|
|
277
277
|
openNewTab: true
|
|
278
278
|
},
|
|
279
279
|
p.id
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
function createAllowPostField(rules) {
|
|
2
2
|
const isFieldRuleKey = (key) => key in rules;
|
|
3
|
-
return ({
|
|
3
|
+
return ({ topicKey, type, field, fieldRuleKey = "default" }) => {
|
|
4
4
|
if (!type || !field) return false;
|
|
5
|
-
const ruleKey =
|
|
5
|
+
const ruleKey = topicKey && isFieldRuleKey(topicKey) ? topicKey : "global";
|
|
6
6
|
const fieldsInType = rules[ruleKey]?.[type];
|
|
7
7
|
const fields = fieldsInType?.[fieldRuleKey] ?? fieldsInType?.["default"] ?? [];
|
|
8
8
|
return fields.includes(field);
|
|
@@ -48,11 +48,14 @@ function createPostCard({
|
|
|
48
48
|
SmartImage,
|
|
49
49
|
storageUrl,
|
|
50
50
|
strategies,
|
|
51
|
-
defaultWebLocale
|
|
51
|
+
defaultWebLocale,
|
|
52
|
+
customControlFields: defaultCustomControlFields = []
|
|
52
53
|
}) {
|
|
53
54
|
return function PostCard({
|
|
54
55
|
post,
|
|
55
|
-
|
|
56
|
+
topicKey,
|
|
57
|
+
customControlFields = defaultCustomControlFields,
|
|
58
|
+
usableFields,
|
|
56
59
|
// link
|
|
57
60
|
openNewTab,
|
|
58
61
|
// pick
|
|
@@ -61,16 +64,16 @@ function createPostCard({
|
|
|
61
64
|
// base
|
|
62
65
|
className = ""
|
|
63
66
|
}) {
|
|
64
|
-
const
|
|
67
|
+
const resolvedTopicKey = post.topicKey ?? topicKey;
|
|
65
68
|
const topicT = {
|
|
66
69
|
title: topics[post.topicKey ?? ""]?.title[defaultWebLocale] ?? post.topicKey ?? ""
|
|
67
70
|
};
|
|
68
71
|
const postT = findTranslation(post.translations, defaultWebLocale);
|
|
69
|
-
const strategy = strategies?.[post.type]?.[
|
|
72
|
+
const strategy = strategies?.[post.type]?.[resolvedTopicKey ?? ""] ?? {};
|
|
70
73
|
const presentation = resolvePostPresentation(postT, strategy);
|
|
71
74
|
const coverImage = "coverImage" in post ? post.coverImage : null;
|
|
72
75
|
const href = joinUrl(
|
|
73
|
-
CMS_PATHS.content["content-management"].post.pathname(
|
|
76
|
+
CMS_PATHS.content["content-management"].post.pathname(resolvedTopicKey),
|
|
74
77
|
post?.id
|
|
75
78
|
);
|
|
76
79
|
return /* @__PURE__ */ jsx(
|
|
@@ -86,7 +89,14 @@ function createPostCard({
|
|
|
86
89
|
openNewTab
|
|
87
90
|
},
|
|
88
91
|
identity: { icon: /* @__PURE__ */ jsx(File, {}), badge: topicT.title },
|
|
89
|
-
state: /* @__PURE__ */ jsx(
|
|
92
|
+
state: /* @__PURE__ */ jsx(
|
|
93
|
+
PostStateIcons,
|
|
94
|
+
{
|
|
95
|
+
post,
|
|
96
|
+
customControlFields,
|
|
97
|
+
usableFields
|
|
98
|
+
}
|
|
99
|
+
),
|
|
90
100
|
media: strategy.media !== false ? /* @__PURE__ */ jsx(
|
|
91
101
|
"div",
|
|
92
102
|
{
|
|
@@ -196,6 +196,8 @@ function createPostList({
|
|
|
196
196
|
Card,
|
|
197
197
|
{
|
|
198
198
|
post,
|
|
199
|
+
customControlFields,
|
|
200
|
+
usableFields,
|
|
199
201
|
openNewTab,
|
|
200
202
|
isPicked,
|
|
201
203
|
onSelect: handleClick ? () => handleClick(post) : void 0,
|
|
@@ -209,6 +211,8 @@ function createPostList({
|
|
|
209
211
|
{
|
|
210
212
|
topics,
|
|
211
213
|
posts,
|
|
214
|
+
customControlFields,
|
|
215
|
+
usableFields,
|
|
212
216
|
pickedItems,
|
|
213
217
|
onSelect: handleClick,
|
|
214
218
|
openNewTab,
|
|
@@ -8,12 +8,18 @@ import 'ua-parser-js';
|
|
|
8
8
|
import '../../../../../../shared/client/react-query/client.js';
|
|
9
9
|
import '@tanstack/react-query';
|
|
10
10
|
import { cn } from '../../../../../../shared/utils/cn.js';
|
|
11
|
+
import { resolveControlFieldLabel } from './content/resolve-control-field-label.js';
|
|
11
12
|
|
|
12
|
-
function PostStateIcons({
|
|
13
|
-
|
|
13
|
+
function PostStateIcons({
|
|
14
|
+
post,
|
|
15
|
+
customControlFields = [],
|
|
16
|
+
usableFields
|
|
17
|
+
}) {
|
|
18
|
+
const enabled = (field) => !usableFields || usableFields.includes(field);
|
|
19
|
+
const { t, locale } = useTranslator();
|
|
14
20
|
const { isActive, isSlugActive, index, isFeatured, isShownOnHome } = post;
|
|
15
21
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
16
|
-
isActive ? /* @__PURE__ */ jsx(
|
|
22
|
+
enabled("isActive") && (isActive ? /* @__PURE__ */ jsx(
|
|
17
23
|
Eye,
|
|
18
24
|
{
|
|
19
25
|
className: "size-4",
|
|
@@ -27,8 +33,8 @@ function PostStateIcons({ post }) {
|
|
|
27
33
|
role: "img",
|
|
28
34
|
"aria-label": t("resources.post.unpublished.text")
|
|
29
35
|
}
|
|
30
|
-
),
|
|
31
|
-
index !== void 0 && /* @__PURE__ */ jsx(
|
|
36
|
+
)),
|
|
37
|
+
enabled("isIndexActive") && index !== void 0 && /* @__PURE__ */ jsx(
|
|
32
38
|
"p",
|
|
33
39
|
{
|
|
34
40
|
className: cn(
|
|
@@ -38,14 +44,23 @@ function PostStateIcons({ post }) {
|
|
|
38
44
|
children: index ?? 0
|
|
39
45
|
}
|
|
40
46
|
),
|
|
41
|
-
isSlugActive !== void 0 && /* @__PURE__ */ jsx(
|
|
47
|
+
enabled("isSlugActive") && isSlugActive !== void 0 && /* @__PURE__ */ jsx(
|
|
42
48
|
MapPinCheckInside,
|
|
43
49
|
{
|
|
44
50
|
className: cn("size-4", !isSlugActive && "opacity-10")
|
|
45
51
|
}
|
|
46
52
|
),
|
|
47
|
-
isFeatured !== void 0 && /* @__PURE__ */ jsx(Star, { className: cn("size-4", !isFeatured && "opacity-10") }),
|
|
48
|
-
isShownOnHome !== void 0 && /* @__PURE__ */ jsx(House, { className: cn("size-4", !isShownOnHome && "opacity-10") })
|
|
53
|
+
enabled("isFeatured") && isFeatured !== void 0 && /* @__PURE__ */ jsx(Star, { className: cn("size-4", !isFeatured && "opacity-10") }),
|
|
54
|
+
enabled("isShownOnHome") && isShownOnHome !== void 0 && /* @__PURE__ */ jsx(House, { className: cn("size-4", !isShownOnHome && "opacity-10") }),
|
|
55
|
+
customControlFields.filter(({ key }) => enabled(key) && post[key] !== void 0).map(({ key, icon: Icon, label }) => /* @__PURE__ */ jsx(
|
|
56
|
+
Icon,
|
|
57
|
+
{
|
|
58
|
+
role: "img",
|
|
59
|
+
"aria-label": resolveControlFieldLabel(label, locale),
|
|
60
|
+
className: cn("size-4", !post[key] && "opacity-10")
|
|
61
|
+
},
|
|
62
|
+
key
|
|
63
|
+
))
|
|
49
64
|
] });
|
|
50
65
|
}
|
|
51
66
|
|
|
@@ -48,6 +48,8 @@ function PostTable({
|
|
|
48
48
|
topics = {},
|
|
49
49
|
posts,
|
|
50
50
|
contentLocale,
|
|
51
|
+
customControlFields,
|
|
52
|
+
usableFields,
|
|
51
53
|
strategies,
|
|
52
54
|
pickedItems,
|
|
53
55
|
onSelect,
|
|
@@ -114,7 +116,14 @@ function PostTable({
|
|
|
114
116
|
isSelecting && /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx("div", { className: "flex-center text-muted-foreground/60", children: isPicked ? /* @__PURE__ */ jsx(Tick, { isPicked: true }) : /* @__PURE__ */ jsx(Circle, { "aria-hidden": true, className: "size-5!" }) }) }),
|
|
115
117
|
/* @__PURE__ */ jsx(TableCell, { className: "border-r", children: /* @__PURE__ */ jsx("div", { className: "flex-center", children: /* @__PURE__ */ jsx(File, { className: "text-muted-foreground" }) }) }),
|
|
116
118
|
/* @__PURE__ */ jsx(TableCell, { className: "w-40", children: /* @__PURE__ */ jsx(Badge, { className: "h-5.5 w-fit max-w-32 min-w-0 px-3", children: topicT.title }) }),
|
|
117
|
-
/* @__PURE__ */ jsx(TableCell, { className: "w-40", children: /* @__PURE__ */ jsx(
|
|
119
|
+
/* @__PURE__ */ jsx(TableCell, { className: "w-40", children: /* @__PURE__ */ jsx(
|
|
120
|
+
PostStateIcons,
|
|
121
|
+
{
|
|
122
|
+
post,
|
|
123
|
+
customControlFields,
|
|
124
|
+
usableFields
|
|
125
|
+
}
|
|
126
|
+
) }),
|
|
118
127
|
/* @__PURE__ */ jsx(TableCell, { className: "max-w-[200px]", children: title ? /* @__PURE__ */ jsx("p", { className: "truncate", children: title }) : /* @__PURE__ */ jsx(NoData, {}) }),
|
|
119
128
|
/* @__PURE__ */ jsx(TableCell, { className: "max-w-[320px]", children: presentation.excerpt ? /* @__PURE__ */ jsx(
|
|
120
129
|
TextDisplay,
|
|
@@ -41,10 +41,13 @@ import { PostStateIcons } from '../post-state-icons.js';
|
|
|
41
41
|
|
|
42
42
|
const WIDTH = "200px";
|
|
43
43
|
function createTagCard({
|
|
44
|
-
defaultWebLocale
|
|
44
|
+
defaultWebLocale,
|
|
45
|
+
customControlFields: defaultCustomControlFields = []
|
|
45
46
|
}) {
|
|
46
47
|
return function TagCard({
|
|
47
48
|
post: tag,
|
|
49
|
+
customControlFields = defaultCustomControlFields,
|
|
50
|
+
usableFields,
|
|
48
51
|
// link
|
|
49
52
|
openNewTab,
|
|
50
53
|
// pick
|
|
@@ -63,7 +66,14 @@ function createTagCard({
|
|
|
63
66
|
{
|
|
64
67
|
interaction: onSelect ? { type: "select", isSelected: !!isPicked, onSelect } : { type: "navigate", href, openNewTab },
|
|
65
68
|
identity: { icon: /* @__PURE__ */ jsx(Tag, {}) },
|
|
66
|
-
state: /* @__PURE__ */ jsx(
|
|
69
|
+
state: /* @__PURE__ */ jsx(
|
|
70
|
+
PostStateIcons,
|
|
71
|
+
{
|
|
72
|
+
post: tag,
|
|
73
|
+
customControlFields,
|
|
74
|
+
usableFields
|
|
75
|
+
}
|
|
76
|
+
),
|
|
67
77
|
title: tagT.title || /* @__PURE__ */ jsx(NoData, {}),
|
|
68
78
|
className,
|
|
69
79
|
style: { width: WIDTH }
|
|
@@ -43,6 +43,8 @@ import { PostStateIcons } from '../post-state-icons.js';
|
|
|
43
43
|
function TagTable({
|
|
44
44
|
posts: tags,
|
|
45
45
|
contentLocale,
|
|
46
|
+
customControlFields,
|
|
47
|
+
usableFields,
|
|
46
48
|
pickedItems,
|
|
47
49
|
onSelect,
|
|
48
50
|
openNewTab
|
|
@@ -98,7 +100,14 @@ function TagTable({
|
|
|
98
100
|
children: [
|
|
99
101
|
isSelecting && /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx("div", { className: "flex-center text-muted-foreground/60", children: isPicked ? /* @__PURE__ */ jsx(Tick, { isPicked: true }) : /* @__PURE__ */ jsx(Circle, { "aria-hidden": true, className: "size-5!" }) }) }),
|
|
100
102
|
/* @__PURE__ */ jsx(TableCell, { className: "border-r", children: /* @__PURE__ */ jsx("div", { className: "flex-center", children: /* @__PURE__ */ jsx(Tag, { className: "text-muted-foreground" }) }) }),
|
|
101
|
-
/* @__PURE__ */ jsx(TableCell, { className: "w-40", children: /* @__PURE__ */ jsx(
|
|
103
|
+
/* @__PURE__ */ jsx(TableCell, { className: "w-40", children: /* @__PURE__ */ jsx(
|
|
104
|
+
PostStateIcons,
|
|
105
|
+
{
|
|
106
|
+
post: tag,
|
|
107
|
+
customControlFields,
|
|
108
|
+
usableFields
|
|
109
|
+
}
|
|
110
|
+
) }),
|
|
102
111
|
/* @__PURE__ */ jsx(TableCell, { className: "max-w-[200px]", children: title ? /* @__PURE__ */ jsx("p", { className: "truncate", children: title }) : /* @__PURE__ */ jsx(NoData, {}) })
|
|
103
112
|
]
|
|
104
113
|
},
|
|
@@ -52,11 +52,11 @@ function createCategoryEditPage({
|
|
|
52
52
|
}) {
|
|
53
53
|
return function CategoryEditPage() {
|
|
54
54
|
const { t, locale } = useTranslator();
|
|
55
|
-
const { id,
|
|
56
|
-
const allowFieldInTopic = (params) => allowField?.({ ...params,
|
|
55
|
+
const { id, topicKey } = useParams();
|
|
56
|
+
const allowFieldInTopic = (params) => allowField?.({ ...params, topicKey: params.topicKey ?? topicKey }) ?? false;
|
|
57
57
|
const categoryType = POST_TYPES.CATEGORY;
|
|
58
58
|
const subcategoryType = POST_TYPES.SUBCATEGORY;
|
|
59
|
-
const topic = Object.hasOwn(staticTopics,
|
|
59
|
+
const topic = Object.hasOwn(staticTopics, topicKey) ? { ...staticTopics[topicKey], key: topicKey } : void 0;
|
|
60
60
|
const {
|
|
61
61
|
data: category,
|
|
62
62
|
isFetching,
|
|
@@ -63,10 +63,10 @@ function createCategoryShowPage({
|
|
|
63
63
|
}) {
|
|
64
64
|
return function CategoryShowPage() {
|
|
65
65
|
const { t, locale } = useTranslator();
|
|
66
|
-
const { id,
|
|
66
|
+
const { id, topicKey } = useParams();
|
|
67
67
|
const router = useRouter();
|
|
68
68
|
const postType = POST_TYPES.POST;
|
|
69
|
-
const topic = Object.hasOwn(staticTopics,
|
|
69
|
+
const topic = Object.hasOwn(staticTopics, topicKey) ? { ...staticTopics[topicKey]} : void 0;
|
|
70
70
|
const {
|
|
71
71
|
data: category,
|
|
72
72
|
isFetching,
|
|
@@ -82,10 +82,7 @@ function createCategoryShowPage({
|
|
|
82
82
|
() => postDeleteAction({ id }),
|
|
83
83
|
{
|
|
84
84
|
onSuccess: () => router.replace(
|
|
85
|
-
joinUrl(
|
|
86
|
-
CMS_PATHS.content["content-management"].pathname,
|
|
87
|
-
topicSlug
|
|
88
|
-
)
|
|
85
|
+
joinUrl(CMS_PATHS.content["content-management"].pathname, topicKey)
|
|
89
86
|
)
|
|
90
87
|
}
|
|
91
88
|
);
|
|
@@ -99,7 +96,7 @@ function createCategoryShowPage({
|
|
|
99
96
|
{
|
|
100
97
|
href: joinUrl(
|
|
101
98
|
CMS_PATHS.content["content-management"].pathname,
|
|
102
|
-
|
|
99
|
+
topicKey
|
|
103
100
|
)
|
|
104
101
|
}
|
|
105
102
|
),
|
|
@@ -125,7 +122,7 @@ function createCategoryShowPage({
|
|
|
125
122
|
icon: Pen,
|
|
126
123
|
href: joinUrl(
|
|
127
124
|
CMS_PATHS.content["content-management"].category.pathname(
|
|
128
|
-
|
|
125
|
+
topicKey
|
|
129
126
|
),
|
|
130
127
|
id,
|
|
131
128
|
"edit"
|
|
@@ -184,7 +181,7 @@ function createCategoryShowPage({
|
|
|
184
181
|
{
|
|
185
182
|
href: joinUrl(
|
|
186
183
|
CMS_PATHS.content["content-management"].category.pathname(
|
|
187
|
-
|
|
184
|
+
topicKey
|
|
188
185
|
),
|
|
189
186
|
id,
|
|
190
187
|
"relations"
|
|
@@ -53,14 +53,14 @@ function createCategoryRelationsPage({
|
|
|
53
53
|
postFindRelationsAction
|
|
54
54
|
});
|
|
55
55
|
return function CategoryRelationsPage() {
|
|
56
|
-
const {
|
|
56
|
+
const { topicKey } = useParams();
|
|
57
57
|
const { t } = useTranslator();
|
|
58
58
|
const [subcategoryStates, setSubcategoryStates] = useState({});
|
|
59
59
|
const [postStates, setPostStates] = useState(
|
|
60
60
|
{}
|
|
61
61
|
);
|
|
62
62
|
return /* @__PURE__ */ jsx(PostRelationsLayout, { children: (relations) => /* @__PURE__ */ jsxs(AccordionContainer, { children: [
|
|
63
|
-
(contentUi ? contentUi.byTopic[
|
|
63
|
+
(contentUi ? contentUi.byTopic[topicKey]?.hasSubcategory ?? false : true) && /* @__PURE__ */ jsx(
|
|
64
64
|
Accordion,
|
|
65
65
|
{
|
|
66
66
|
hasBorder: true,
|
|
@@ -53,15 +53,15 @@ function createCategoryCreatePage({
|
|
|
53
53
|
}) {
|
|
54
54
|
return function CategoryCreatePage() {
|
|
55
55
|
const { t, locale } = useTranslator();
|
|
56
|
-
const {
|
|
57
|
-
const allowFieldInTopic = (params) => allowField?.({ ...params,
|
|
56
|
+
const { topicKey } = useParams();
|
|
57
|
+
const allowFieldInTopic = (params) => allowField?.({ ...params, topicKey: params.topicKey ?? topicKey }) ?? false;
|
|
58
58
|
const categoryType = POST_TYPES.CATEGORY;
|
|
59
59
|
const subcategoryType = POST_TYPES.SUBCATEGORY;
|
|
60
60
|
const returnHref = joinUrl(
|
|
61
61
|
CMS_PATHS.content["content-management"].pathname,
|
|
62
|
-
|
|
62
|
+
topicKey
|
|
63
63
|
);
|
|
64
|
-
const topic = Object.hasOwn(staticTopics,
|
|
64
|
+
const topic = Object.hasOwn(staticTopics, topicKey) ? { ...staticTopics[topicKey], key: topicKey } : void 0;
|
|
65
65
|
const { data: categories, isFetching: isFetchingControlMeta } = useCmsQuery(
|
|
66
66
|
() => postFindManyAction({
|
|
67
67
|
type: categoryType,
|