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
|
@@ -60,21 +60,21 @@ function createTopicScopePage({
|
|
|
60
60
|
}) {
|
|
61
61
|
return function ContentTopicScopePage() {
|
|
62
62
|
const { t, locale } = useTranslator();
|
|
63
|
-
const {
|
|
64
|
-
const isFieldAllowed = (type, field, fieldRuleKey) => allowField({
|
|
65
|
-
const isContentTopicScope = isContentTopic(staticTopics,
|
|
63
|
+
const { topicKey } = useParams();
|
|
64
|
+
const isFieldAllowed = (type, field, fieldRuleKey) => allowField({ topicKey, type, field, fieldRuleKey });
|
|
65
|
+
const isContentTopicScope = isContentTopic(staticTopics, topicKey);
|
|
66
66
|
const hasPost = isContentTopicScope;
|
|
67
67
|
const hasCategory = hasTopicRole(
|
|
68
68
|
staticTopics,
|
|
69
|
-
|
|
69
|
+
topicKey,
|
|
70
70
|
POST_TYPES.CATEGORY
|
|
71
71
|
);
|
|
72
72
|
const hasSubcategory = hasTopicRole(
|
|
73
73
|
staticTopics,
|
|
74
|
-
|
|
74
|
+
topicKey,
|
|
75
75
|
POST_TYPES.SUBCATEGORY
|
|
76
76
|
);
|
|
77
|
-
const topic = Object.hasOwn(staticTopics,
|
|
77
|
+
const topic = Object.hasOwn(staticTopics, topicKey) ? staticTopics[topicKey] : void 0;
|
|
78
78
|
const topicT = { title: topic?.title[locale] ?? "" };
|
|
79
79
|
const [categoryStates, setCategoryStates] = useState({});
|
|
80
80
|
const [subcategoryStates, setSubcategoryStates] = useState({});
|
|
@@ -94,12 +94,12 @@ function createTopicScopePage({
|
|
|
94
94
|
{
|
|
95
95
|
usableFields: getUsableFields(POST_TYPES.POST),
|
|
96
96
|
type: POST_TYPES.POST,
|
|
97
|
-
topicKey: topic ?
|
|
97
|
+
topicKey: topic ? topicKey : DO_NOT_FETCH_KEY,
|
|
98
98
|
setListItemStates: setPostStates,
|
|
99
99
|
localKey: `post-${POST_TYPES.POST}`
|
|
100
100
|
}
|
|
101
101
|
);
|
|
102
|
-
const websiteHref = externalHref?.(
|
|
102
|
+
const websiteHref = externalHref?.(topicKey) ?? `/${topicKey}`;
|
|
103
103
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
104
104
|
/* @__PURE__ */ jsx(
|
|
105
105
|
PageHeaderLayout,
|
|
@@ -117,7 +117,7 @@ function createTopicScopePage({
|
|
|
117
117
|
icon: Plus,
|
|
118
118
|
href: joinUrl(
|
|
119
119
|
CMS_PATHS.content["content-management"].category.pathname(
|
|
120
|
-
|
|
120
|
+
topicKey
|
|
121
121
|
),
|
|
122
122
|
"create"
|
|
123
123
|
),
|
|
@@ -133,7 +133,7 @@ function createTopicScopePage({
|
|
|
133
133
|
variant: "success",
|
|
134
134
|
icon: Plus,
|
|
135
135
|
href: joinUrl(
|
|
136
|
-
CMS_PATHS.content["content-management"].subcategory.pathname(
|
|
136
|
+
CMS_PATHS.content["content-management"].subcategory.pathname(topicKey),
|
|
137
137
|
"create"
|
|
138
138
|
),
|
|
139
139
|
isDisabled: !topic || !isContentTopicScope,
|
|
@@ -149,7 +149,7 @@ function createTopicScopePage({
|
|
|
149
149
|
icon: File,
|
|
150
150
|
href: joinUrl(
|
|
151
151
|
CMS_PATHS.content["content-management"].post.pathname(
|
|
152
|
-
|
|
152
|
+
topicKey
|
|
153
153
|
),
|
|
154
154
|
"create"
|
|
155
155
|
),
|
|
@@ -192,7 +192,7 @@ function createTopicScopePage({
|
|
|
192
192
|
{
|
|
193
193
|
usableFields: getUsableFields(POST_TYPES.CATEGORY),
|
|
194
194
|
type: POST_TYPES.CATEGORY,
|
|
195
|
-
topicKey: topic ?
|
|
195
|
+
topicKey: topic ? topicKey : DO_NOT_FETCH_KEY,
|
|
196
196
|
setListItemStates: setCategoryStates,
|
|
197
197
|
Card: (props) => /* @__PURE__ */ jsx(CategoryCard, { ...props }),
|
|
198
198
|
Table: (props) => /* @__PURE__ */ jsx(CategoryTable, { ...props }),
|
|
@@ -220,7 +220,7 @@ function createTopicScopePage({
|
|
|
220
220
|
{
|
|
221
221
|
usableFields: getUsableFields(POST_TYPES.SUBCATEGORY),
|
|
222
222
|
type: POST_TYPES.SUBCATEGORY,
|
|
223
|
-
topicKey: topic ?
|
|
223
|
+
topicKey: topic ? topicKey : DO_NOT_FETCH_KEY,
|
|
224
224
|
setListItemStates: setSubcategoryStates,
|
|
225
225
|
Card: (props) => /* @__PURE__ */ jsx(CategoryCard, { ...props, isSubcategory: true }),
|
|
226
226
|
Table: (props) => /* @__PURE__ */ jsx(CategoryTable, { ...props, isSubcategory: true }),
|
|
@@ -55,15 +55,15 @@ function createPostEditPage({
|
|
|
55
55
|
}) {
|
|
56
56
|
return function PostEditPage() {
|
|
57
57
|
const { t } = useTranslator();
|
|
58
|
-
const { id,
|
|
59
|
-
const allowFieldInTopic = (params) => allowField?.({ ...params,
|
|
58
|
+
const { id, topicKey } = useParams();
|
|
59
|
+
const allowFieldInTopic = (params) => allowField?.({ ...params, topicKey: params.topicKey ?? topicKey }) ?? false;
|
|
60
60
|
const postType = POST_TYPES.POST;
|
|
61
|
-
const roles = staticTopics[
|
|
61
|
+
const roles = staticTopics[topicKey]?.roles ?? [];
|
|
62
62
|
const hasCategory = roles.includes(POST_TYPES.CATEGORY);
|
|
63
63
|
const hasSubcategory = roles.includes(POST_TYPES.SUBCATEGORY);
|
|
64
64
|
const categoryType = POST_TYPES.CATEGORY;
|
|
65
65
|
const subcategoryType = POST_TYPES.SUBCATEGORY;
|
|
66
|
-
const topic = Object.hasOwn(staticTopics,
|
|
66
|
+
const topic = Object.hasOwn(staticTopics, topicKey) ? { ...staticTopics[topicKey], key: topicKey } : void 0;
|
|
67
67
|
const {
|
|
68
68
|
data: post,
|
|
69
69
|
isFetching,
|
|
@@ -98,9 +98,7 @@ function createPostEditPage({
|
|
|
98
98
|
{
|
|
99
99
|
useConfirm: true,
|
|
100
100
|
href: joinUrl(
|
|
101
|
-
CMS_PATHS.content["content-management"].post.pathname(
|
|
102
|
-
topicSlug
|
|
103
|
-
),
|
|
101
|
+
CMS_PATHS.content["content-management"].post.pathname(topicKey),
|
|
104
102
|
id
|
|
105
103
|
)
|
|
106
104
|
}
|
|
@@ -64,13 +64,13 @@ function createPostShowPage({
|
|
|
64
64
|
}) {
|
|
65
65
|
return function PostShowPage() {
|
|
66
66
|
const { t } = useTranslator();
|
|
67
|
-
const { id,
|
|
67
|
+
const { id, topicKey } = useParams();
|
|
68
68
|
const router = useRouter();
|
|
69
69
|
const postType = POST_TYPES.POST;
|
|
70
|
-
const subcategoryType = staticTopics[
|
|
70
|
+
const subcategoryType = staticTopics[topicKey]?.roles.includes(
|
|
71
71
|
POST_TYPES.SUBCATEGORY
|
|
72
72
|
) ? POST_TYPES.SUBCATEGORY : void 0;
|
|
73
|
-
const topic = Object.hasOwn(staticTopics,
|
|
73
|
+
const topic = Object.hasOwn(staticTopics, topicKey) ? { ...staticTopics[topicKey]} : void 0;
|
|
74
74
|
const {
|
|
75
75
|
data: post,
|
|
76
76
|
isFetching,
|
|
@@ -86,10 +86,7 @@ function createPostShowPage({
|
|
|
86
86
|
() => postDeleteAction({ id }),
|
|
87
87
|
{
|
|
88
88
|
onSuccess: () => router.replace(
|
|
89
|
-
joinUrl(
|
|
90
|
-
CMS_PATHS.content["content-management"].pathname,
|
|
91
|
-
topicSlug
|
|
92
|
-
)
|
|
89
|
+
joinUrl(CMS_PATHS.content["content-management"].pathname, topicKey)
|
|
93
90
|
)
|
|
94
91
|
}
|
|
95
92
|
);
|
|
@@ -103,7 +100,7 @@ function createPostShowPage({
|
|
|
103
100
|
{
|
|
104
101
|
href: joinUrl(
|
|
105
102
|
CMS_PATHS.content["content-management"].pathname,
|
|
106
|
-
|
|
103
|
+
topicKey
|
|
107
104
|
)
|
|
108
105
|
}
|
|
109
106
|
),
|
|
@@ -128,7 +125,7 @@ function createPostShowPage({
|
|
|
128
125
|
icon: Pen,
|
|
129
126
|
href: joinUrl(
|
|
130
127
|
CMS_PATHS.content["content-management"].post.pathname(
|
|
131
|
-
|
|
128
|
+
topicKey
|
|
132
129
|
),
|
|
133
130
|
id,
|
|
134
131
|
"edit"
|
|
@@ -188,7 +185,7 @@ function createPostShowPage({
|
|
|
188
185
|
{
|
|
189
186
|
href: joinUrl(
|
|
190
187
|
CMS_PATHS.content["content-management"].post.pathname(
|
|
191
|
-
|
|
188
|
+
topicKey
|
|
192
189
|
),
|
|
193
190
|
id,
|
|
194
191
|
"relations"
|
|
@@ -54,19 +54,19 @@ function createPostCreatePage({
|
|
|
54
54
|
}) {
|
|
55
55
|
return function PostCreatePage() {
|
|
56
56
|
const { t } = useTranslator();
|
|
57
|
-
const {
|
|
58
|
-
const allowFieldInTopic = (params) => allowField?.({ ...params,
|
|
57
|
+
const { topicKey } = useParams();
|
|
58
|
+
const allowFieldInTopic = (params) => allowField?.({ ...params, topicKey: params.topicKey ?? topicKey }) ?? false;
|
|
59
59
|
const postType = POST_TYPES.POST;
|
|
60
|
-
const roles = staticTopics[
|
|
60
|
+
const roles = staticTopics[topicKey]?.roles ?? [];
|
|
61
61
|
const hasCategory = roles.includes(POST_TYPES.CATEGORY);
|
|
62
62
|
const hasSubcategory = roles.includes(POST_TYPES.SUBCATEGORY);
|
|
63
63
|
const categoryType = POST_TYPES.CATEGORY;
|
|
64
64
|
const subcategoryType = POST_TYPES.SUBCATEGORY;
|
|
65
65
|
const returnHref = joinUrl(
|
|
66
66
|
CMS_PATHS.content["content-management"].pathname,
|
|
67
|
-
|
|
67
|
+
topicKey
|
|
68
68
|
);
|
|
69
|
-
const topic = Object.hasOwn(staticTopics,
|
|
69
|
+
const topic = Object.hasOwn(staticTopics, topicKey) ? { ...staticTopics[topicKey], key: topicKey } : void 0;
|
|
70
70
|
const { data: posts, isFetching: isFetchingControlMeta } = useCmsQuery(
|
|
71
71
|
() => postFindManyAction({
|
|
72
72
|
type: postType,
|
|
@@ -52,11 +52,11 @@ function createSubcategoryEditPage({
|
|
|
52
52
|
}) {
|
|
53
53
|
return function SubcategoryEditPage() {
|
|
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: subcategory,
|
|
62
62
|
isFetching,
|
|
@@ -63,10 +63,10 @@ function createSubcategoryShowPage({
|
|
|
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: subcategory,
|
|
72
72
|
isFetching,
|
|
@@ -82,10 +82,7 @@ function createSubcategoryShowPage({
|
|
|
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 createSubcategoryShowPage({
|
|
|
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 createSubcategoryShowPage({
|
|
|
125
122
|
icon: Pen,
|
|
126
123
|
href: joinUrl(
|
|
127
124
|
CMS_PATHS.content["content-management"].subcategory.pathname(
|
|
128
|
-
|
|
125
|
+
topicKey
|
|
129
126
|
),
|
|
130
127
|
id,
|
|
131
128
|
"edit"
|
|
@@ -183,7 +180,7 @@ function createSubcategoryShowPage({
|
|
|
183
180
|
PostRelationsLink,
|
|
184
181
|
{
|
|
185
182
|
href: joinUrl(
|
|
186
|
-
CMS_PATHS.content["content-management"].subcategory.pathname(
|
|
183
|
+
CMS_PATHS.content["content-management"].subcategory.pathname(topicKey),
|
|
187
184
|
id,
|
|
188
185
|
"relations"
|
|
189
186
|
)
|
|
@@ -53,15 +53,15 @@ function createSubcategoryCreatePage({
|
|
|
53
53
|
}) {
|
|
54
54
|
return function SubcategoryCreatePage() {
|
|
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: subcategories, isFetching: isFetchingControlMeta } = useCmsQuery(
|
|
66
66
|
() => postFindManyAction({
|
|
67
67
|
type: subcategoryType,
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { POST_TYPES } from 'sitero-domain';
|
|
2
2
|
|
|
3
|
-
function getTopicItemsByRole(topics,
|
|
4
|
-
if (!
|
|
3
|
+
function getTopicItemsByRole(topics, topicKey, items, role) {
|
|
4
|
+
if (!topicKey || !hasTopicRole(topics, topicKey, role)) return [];
|
|
5
5
|
return (items ?? []).filter((item) => item.type === role);
|
|
6
6
|
}
|
|
7
|
-
function hasTopicRole(topics,
|
|
8
|
-
return Object.hasOwn(topics,
|
|
7
|
+
function hasTopicRole(topics, topicKey, role) {
|
|
8
|
+
return Object.hasOwn(topics, topicKey) && (topics[topicKey]?.roles.includes(role) ?? false);
|
|
9
9
|
}
|
|
10
|
-
function isContentTopic(topics,
|
|
11
|
-
return hasTopicRole(topics,
|
|
10
|
+
function isContentTopic(topics, topicKey) {
|
|
11
|
+
return hasTopicRole(topics, topicKey, POST_TYPES.POST) && !hasTopicRole(topics, topicKey, POST_TYPES.PRODUCT);
|
|
12
12
|
}
|
|
13
|
-
function isProductTopic(topics,
|
|
14
|
-
return hasTopicRole(topics,
|
|
13
|
+
function isProductTopic(topics, topicKey) {
|
|
14
|
+
return hasTopicRole(topics, topicKey, POST_TYPES.PRODUCT);
|
|
15
15
|
}
|
|
16
|
-
function getTopicCategories(topics,
|
|
17
|
-
return getTopicItemsByRole(topics,
|
|
16
|
+
function getTopicCategories(topics, topicKey, items) {
|
|
17
|
+
return getTopicItemsByRole(topics, topicKey, items, POST_TYPES.CATEGORY);
|
|
18
18
|
}
|
|
19
|
-
function getTopicSubcategories(topics,
|
|
20
|
-
return getTopicItemsByRole(topics,
|
|
19
|
+
function getTopicSubcategories(topics, topicKey, items) {
|
|
20
|
+
return getTopicItemsByRole(topics, topicKey, items, POST_TYPES.SUBCATEGORY);
|
|
21
21
|
}
|
|
22
|
-
function getTopicPosts(topics,
|
|
23
|
-
return getTopicItemsByRole(topics,
|
|
22
|
+
function getTopicPosts(topics, topicKey, items) {
|
|
23
|
+
return getTopicItemsByRole(topics, topicKey, items, POST_TYPES.POST);
|
|
24
24
|
}
|
|
25
|
-
function getTopicProducts(topics,
|
|
26
|
-
return getTopicItemsByRole(topics,
|
|
25
|
+
function getTopicProducts(topics, topicKey, items) {
|
|
26
|
+
return getTopicItemsByRole(topics, topicKey, items, POST_TYPES.PRODUCT);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export { getTopicCategories, getTopicPosts, getTopicProducts, getTopicSubcategories, hasTopicRole, isContentTopic, isProductTopic };
|
|
@@ -45,13 +45,13 @@ const CMS_PATHS = {
|
|
|
45
45
|
"content-management": {
|
|
46
46
|
pathname: `${DB}/content/content-management`,
|
|
47
47
|
post: {
|
|
48
|
-
pathname: (
|
|
48
|
+
pathname: (topicKey = "") => `${DB}/content/content-management/${topicKey}/post`
|
|
49
49
|
},
|
|
50
50
|
category: {
|
|
51
|
-
pathname: (
|
|
51
|
+
pathname: (topicKey = "") => `${DB}/content/content-management/${topicKey}/category`
|
|
52
52
|
},
|
|
53
53
|
subcategory: {
|
|
54
|
-
pathname: (
|
|
54
|
+
pathname: (topicKey = "") => `${DB}/content/content-management/${topicKey}/subcategory`
|
|
55
55
|
},
|
|
56
56
|
tag: { pathname: `${DB}/content/content-management/tag` },
|
|
57
57
|
trash: { pathname: `${DB}/content/content-management/trash` }
|
|
@@ -272,7 +272,6 @@ function createPostPrismaPorts(prisma) {
|
|
|
272
272
|
...customStateFilters,
|
|
273
273
|
...input.type ? { type: input.type } : {},
|
|
274
274
|
...input.topicKey === void 0 ? {} : { topicKey: input.topicKey },
|
|
275
|
-
...input.topicSlug ? { AND: [{ topicKey: input.topicSlug }] } : {},
|
|
276
275
|
...input.authorId ? { authorId: input.authorId } : {},
|
|
277
276
|
...input.postIds || input.excludeIds ? {
|
|
278
277
|
id: {
|
|
@@ -326,7 +325,7 @@ function createPostPrismaPorts(prisma) {
|
|
|
326
325
|
const scope = {
|
|
327
326
|
AND: [postReadWhere(input)],
|
|
328
327
|
...input.isActive === void 0 ? {} : { isActive: input.isActive },
|
|
329
|
-
...input.
|
|
328
|
+
...input.topicKey ? { topicKey: input.topicKey } : {}
|
|
330
329
|
};
|
|
331
330
|
const post = await prisma.post.findFirst({
|
|
332
331
|
where: { ...scope, ...lookup },
|
|
@@ -13,8 +13,8 @@ function toNullableWebPostListCard(post) {
|
|
|
13
13
|
function getSlug(post) {
|
|
14
14
|
return "slug" in post && typeof post.slug === "string" ? post.slug : "";
|
|
15
15
|
}
|
|
16
|
-
function topicHasRole(staticTopics,
|
|
17
|
-
const topic = Object.hasOwn(staticTopics,
|
|
16
|
+
function topicHasRole(staticTopics, topicKey, role) {
|
|
17
|
+
const topic = Object.hasOwn(staticTopics, topicKey) ? staticTopics[topicKey] : void 0;
|
|
18
18
|
return !!topic && topic.roles.includes(role);
|
|
19
19
|
}
|
|
20
20
|
function createWebPostActions({
|
|
@@ -48,16 +48,16 @@ function createWebPostActions({
|
|
|
48
48
|
};
|
|
49
49
|
const loadCategories = async ({
|
|
50
50
|
locale,
|
|
51
|
-
|
|
51
|
+
topicKey,
|
|
52
52
|
childrenCount
|
|
53
53
|
}) => {
|
|
54
|
-
if (!topicHasRole(staticTopics,
|
|
54
|
+
if (!topicHasRole(staticTopics, topicKey, POST_TYPES.CATEGORY)) {
|
|
55
55
|
return { categories: [] };
|
|
56
56
|
}
|
|
57
57
|
const response = await postFindListCardsAction({
|
|
58
58
|
locale,
|
|
59
59
|
type: POST_TYPES.CATEGORY,
|
|
60
|
-
|
|
60
|
+
topicKey
|
|
61
61
|
});
|
|
62
62
|
if (!response.success) {
|
|
63
63
|
return { categories: [] };
|
|
@@ -71,7 +71,7 @@ function createWebPostActions({
|
|
|
71
71
|
categories.map(async (category) => {
|
|
72
72
|
const { posts } = await loadPosts({
|
|
73
73
|
locale,
|
|
74
|
-
|
|
74
|
+
topicKey,
|
|
75
75
|
categorySlug: getSlug(category),
|
|
76
76
|
currentPage: 1,
|
|
77
77
|
pageSize: childrenCount
|
|
@@ -85,16 +85,16 @@ function createWebPostActions({
|
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
87
|
const loadCategory = async ({
|
|
88
|
-
|
|
88
|
+
topicKey,
|
|
89
89
|
categorySlug
|
|
90
90
|
}) => {
|
|
91
|
-
if (!topicHasRole(staticTopics,
|
|
91
|
+
if (!topicHasRole(staticTopics, topicKey, POST_TYPES.CATEGORY)) {
|
|
92
92
|
return { category: void 0 };
|
|
93
93
|
}
|
|
94
94
|
const response = await postFindDetailAction({
|
|
95
95
|
type: POST_TYPES.CATEGORY,
|
|
96
96
|
slug: categorySlug,
|
|
97
|
-
|
|
97
|
+
topicKey
|
|
98
98
|
});
|
|
99
99
|
return {
|
|
100
100
|
category: response.success ? response.data?.post : void 0
|
|
@@ -102,17 +102,17 @@ function createWebPostActions({
|
|
|
102
102
|
};
|
|
103
103
|
const loadSubcategories = async ({
|
|
104
104
|
locale,
|
|
105
|
-
|
|
105
|
+
topicKey,
|
|
106
106
|
categorySlug,
|
|
107
107
|
childrenCount
|
|
108
108
|
}) => {
|
|
109
|
-
if (!topicHasRole(staticTopics,
|
|
109
|
+
if (!topicHasRole(staticTopics, topicKey, POST_TYPES.SUBCATEGORY)) {
|
|
110
110
|
return { subcategories: [] };
|
|
111
111
|
}
|
|
112
112
|
const response = await postFindListCardsAction({
|
|
113
113
|
locale,
|
|
114
114
|
type: POST_TYPES.SUBCATEGORY,
|
|
115
|
-
|
|
115
|
+
topicKey,
|
|
116
116
|
...categorySlug ? { parentSlug: categorySlug } : {}
|
|
117
117
|
});
|
|
118
118
|
if (!response.success) {
|
|
@@ -127,7 +127,7 @@ function createWebPostActions({
|
|
|
127
127
|
subcategories.map(async (subcategory) => {
|
|
128
128
|
const { posts } = await loadPosts({
|
|
129
129
|
locale,
|
|
130
|
-
|
|
130
|
+
topicKey,
|
|
131
131
|
categorySlug: getSlug(subcategory),
|
|
132
132
|
currentPage: 1,
|
|
133
133
|
pageSize: childrenCount
|
|
@@ -141,16 +141,16 @@ function createWebPostActions({
|
|
|
141
141
|
};
|
|
142
142
|
};
|
|
143
143
|
const loadSubcategory = async ({
|
|
144
|
-
|
|
144
|
+
topicKey,
|
|
145
145
|
subcategorySlug
|
|
146
146
|
}) => {
|
|
147
|
-
if (!topicHasRole(staticTopics,
|
|
147
|
+
if (!topicHasRole(staticTopics, topicKey, POST_TYPES.SUBCATEGORY)) {
|
|
148
148
|
return { subcategory: void 0 };
|
|
149
149
|
}
|
|
150
150
|
const response = await postFindDetailAction({
|
|
151
151
|
type: POST_TYPES.SUBCATEGORY,
|
|
152
152
|
slug: subcategorySlug,
|
|
153
|
-
|
|
153
|
+
topicKey
|
|
154
154
|
});
|
|
155
155
|
return {
|
|
156
156
|
subcategory: response.success ? response.data?.post : void 0
|
|
@@ -158,7 +158,7 @@ function createWebPostActions({
|
|
|
158
158
|
};
|
|
159
159
|
const loadPosts = async ({
|
|
160
160
|
locale,
|
|
161
|
-
|
|
161
|
+
topicKey,
|
|
162
162
|
categorySlug,
|
|
163
163
|
currentPage = 1,
|
|
164
164
|
pageSize,
|
|
@@ -167,14 +167,14 @@ function createWebPostActions({
|
|
|
167
167
|
excludeIds,
|
|
168
168
|
...params
|
|
169
169
|
}) => {
|
|
170
|
-
if (!topicHasRole(staticTopics,
|
|
170
|
+
if (!topicHasRole(staticTopics, topicKey, POST_TYPES.POST)) {
|
|
171
171
|
return { posts: [], total: 0, totalPages: 1 };
|
|
172
172
|
}
|
|
173
173
|
const response = await postFindListCardsAction({
|
|
174
174
|
...params,
|
|
175
175
|
locale,
|
|
176
176
|
type: POST_TYPES.POST,
|
|
177
|
-
|
|
177
|
+
topicKey,
|
|
178
178
|
...categorySlug ? { parentSlug: categorySlug } : {},
|
|
179
179
|
page: currentPage,
|
|
180
180
|
...pageSize ? { pageSize } : {},
|
|
@@ -194,17 +194,14 @@ function createWebPostActions({
|
|
|
194
194
|
totalPages
|
|
195
195
|
};
|
|
196
196
|
};
|
|
197
|
-
const loadPost = async ({
|
|
198
|
-
|
|
199
|
-
slug
|
|
200
|
-
}) => {
|
|
201
|
-
if (!topicHasRole(staticTopics, topicSlug, POST_TYPES.POST)) {
|
|
197
|
+
const loadPost = async ({ topicKey, slug }) => {
|
|
198
|
+
if (!topicHasRole(staticTopics, topicKey, POST_TYPES.POST)) {
|
|
202
199
|
return { post: void 0, prev: void 0, next: void 0 };
|
|
203
200
|
}
|
|
204
201
|
const response = await postFindDetailAction({
|
|
205
202
|
type: POST_TYPES.POST,
|
|
206
203
|
slug,
|
|
207
|
-
|
|
204
|
+
topicKey
|
|
208
205
|
});
|
|
209
206
|
if (!response.success) {
|
|
210
207
|
return { post: void 0, prev: void 0, next: void 0 };
|
|
@@ -5,11 +5,11 @@ import { loadSitemapCards, loadSitemapDetail } from './queries.js';
|
|
|
5
5
|
|
|
6
6
|
function createGetCategoryItems(ctx) {
|
|
7
7
|
const buildEntries = createBuildSitemapEntries(ctx);
|
|
8
|
-
return async function getCategoryItems({
|
|
8
|
+
return async function getCategoryItems({ topicKey }) {
|
|
9
9
|
if (ctx.constants.forceNoIndex) return [];
|
|
10
10
|
const categories = await loadSitemapCards(ctx.findListCards, {
|
|
11
11
|
type: POST_TYPES.CATEGORY,
|
|
12
|
-
|
|
12
|
+
topicKey,
|
|
13
13
|
locale: ctx.constants.webClientIntorConfig.defaultLocale
|
|
14
14
|
});
|
|
15
15
|
const entries = [];
|
|
@@ -19,7 +19,7 @@ function createGetCategoryItems(ctx) {
|
|
|
19
19
|
continue;
|
|
20
20
|
entries.push(
|
|
21
21
|
...buildEntries(
|
|
22
|
-
joinUrl("/",
|
|
22
|
+
joinUrl("/", topicKey, category.slug),
|
|
23
23
|
category,
|
|
24
24
|
category.updatedAt
|
|
25
25
|
)
|
|
@@ -6,20 +6,20 @@ import { loadSitemapCards, loadSitemapDetail } from './queries.js';
|
|
|
6
6
|
function createGetPostItems(ctx) {
|
|
7
7
|
const buildEntries = createBuildSitemapEntries(ctx);
|
|
8
8
|
return async function getPostItems({
|
|
9
|
-
|
|
9
|
+
topicKey,
|
|
10
10
|
routeMode
|
|
11
11
|
}) {
|
|
12
12
|
if (ctx.constants.forceNoIndex) return [];
|
|
13
13
|
const cards = await loadSitemapCards(ctx.findListCards, {
|
|
14
14
|
type: POST_TYPES.POST,
|
|
15
|
-
|
|
15
|
+
topicKey,
|
|
16
16
|
locale: ctx.constants.webClientIntorConfig.defaultLocale
|
|
17
17
|
});
|
|
18
18
|
const entries = [];
|
|
19
19
|
for (const card of cards) {
|
|
20
20
|
const post = await loadSitemapDetail(ctx.findDetail, { id: card.id });
|
|
21
21
|
if (!post || !post.isActive) continue;
|
|
22
|
-
let pathname = joinUrl("/",
|
|
22
|
+
let pathname = joinUrl("/", topicKey, post.slug);
|
|
23
23
|
if (routeMode !== "flat") {
|
|
24
24
|
const parentId = post.parents[0]?.id;
|
|
25
25
|
if (!parentId) continue;
|
|
@@ -30,7 +30,7 @@ function createGetPostItems(ctx) {
|
|
|
30
30
|
continue;
|
|
31
31
|
if (routeMode === "category") {
|
|
32
32
|
if (parent.type !== POST_TYPES.CATEGORY) continue;
|
|
33
|
-
pathname = joinUrl("/",
|
|
33
|
+
pathname = joinUrl("/", topicKey, parent.slug, post.slug);
|
|
34
34
|
} else {
|
|
35
35
|
if (parent.type !== POST_TYPES.SUBCATEGORY) continue;
|
|
36
36
|
const categoryId = parent.parents[0]?.id;
|
|
@@ -42,7 +42,7 @@ function createGetPostItems(ctx) {
|
|
|
42
42
|
continue;
|
|
43
43
|
pathname = joinUrl(
|
|
44
44
|
"/",
|
|
45
|
-
|
|
45
|
+
topicKey,
|
|
46
46
|
category.slug,
|
|
47
47
|
parent.slug,
|
|
48
48
|
post.slug
|
|
@@ -6,13 +6,13 @@ import { loadSitemapCards, loadSitemapDetail } from './queries.js';
|
|
|
6
6
|
function createGetSubcategoryItems(ctx) {
|
|
7
7
|
const buildEntries = createBuildSitemapEntries(ctx);
|
|
8
8
|
return async function getSubcategoryItems({
|
|
9
|
-
|
|
9
|
+
topicKey,
|
|
10
10
|
categorySlug
|
|
11
11
|
}) {
|
|
12
12
|
if (ctx.constants.forceNoIndex) return [];
|
|
13
13
|
const cards = await loadSitemapCards(ctx.findListCards, {
|
|
14
14
|
type: POST_TYPES.SUBCATEGORY,
|
|
15
|
-
|
|
15
|
+
topicKey,
|
|
16
16
|
locale: ctx.constants.webClientIntorConfig.defaultLocale,
|
|
17
17
|
...categorySlug ? { parentSlug: categorySlug } : {}
|
|
18
18
|
});
|
|
@@ -30,7 +30,7 @@ function createGetSubcategoryItems(ctx) {
|
|
|
30
30
|
continue;
|
|
31
31
|
entries.push(
|
|
32
32
|
...buildEntries(
|
|
33
|
-
joinUrl("/",
|
|
33
|
+
joinUrl("/", topicKey, category.slug, subcategory.slug),
|
|
34
34
|
subcategory,
|
|
35
35
|
subcategory.updatedAt
|
|
36
36
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { createAuthLayout, // layout
|
|
2
2
|
createSignInPage, createVerifyEmailPage, createEmailUnverifiedPage, createForgotPasswordPage, createResetPasswordPage, createDashboardLayout, // layout
|
|
3
3
|
createDashboardPage, createChangePasswordPage, createAccessPage, createAdminIndexPage, createAdminCreatePage, createAdminShowPage, createAdminEditPage, createAdminRelationsPage, createAdminSessionsPage, createStoragePage, createFileIndexPage, createFileCreatePage, createFileShowPage, createFileRelationsPage, createFileEditPage, createFileDeleteManyPage, createFileCreateManyPage, createTrashPage, createWebsiteConfigPage, createWebsiteConfigShowPage, createWebsiteConfigEditPage, createWebsitePagePage, createWebsitePageShowPage, createWebsitePageEditPage, createInquiryIndexPage, createInquiryShowPage, createContentManagementPage as createCollectionsPage, createTopicScopePage, createPostCreatePage, createPostShowPage, createPostRelationsPage, createPostEditPage, createCategoryCreatePage, createCategoryShowPage, createCategoryRelationsPage, createCategoryEditPage, createSubcategoryCreatePage, createSubcategoryShowPage, createSubcategoryRelationsPage, createSubcategoryEditPage, createTagIndexPage, createTagCreatePage, createTagShowPage, createTagRelationsPage, createTagEditPage, } from "../../../../src/cms/client/interfaces/pages";
|
|
4
4
|
export { createPostTrashPage } from "../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/trash/page";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../export/cms/client/pages/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../export/cms/client/pages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,gBAAgB,EAAE,SAAS;AAC3B,gBAAgB,EAChB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EAMvB,qBAAqB,EAAE,SAAS;AAChC,mBAAmB,EAGnB,wBAAwB,EAOxB,gBAAgB,EAGhB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EAIvB,iBAAiB,EAGjB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,EAGxB,eAAe,EAOf,uBAAuB,EACvB,2BAA2B,EAC3B,2BAA2B,EAI3B,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EAIzB,sBAAsB,EACtB,qBAAqB,EAMrB,2BAA2B,IAAI,qBAAqB,EAGpD,oBAAoB,EAGpB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAGlB,wBAAwB,EACxB,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,EAGtB,2BAA2B,EAC3B,yBAAyB,EACzB,8BAA8B,EAC9B,yBAAyB,EAKzB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6FAA6F,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { resolveRequestContext, type ResolveRequestContext, } from "../../../src/shared/next/server";
|
|
2
|
-
export { createWebServer, createWebSeo, createWebPageActions, createWebConfigActions, createWebInquiryActions, createWebPostActions, type InquirySubmitFormData, type ConfigFindDetailAction, type InquirySubmitAction, type PostFindDetailAction, type PostFindListCardsAction, type WebPostListCard, type WebServer, type WebServerInput, type WebSeo, type WebSeoInput, } from "../../../src/web/server";
|
|
2
|
+
export { createWebServer, createWebSeo, createWebPageActions, createWebConfigActions, createWebInquiryActions, createWebPostActions, type InquirySubmitFormData, type ConfigFindDetailAction, type InquirySubmitAction, type PostFindDetailAction, type PostFindListCardsAction, type WebPostListCard, type WebServer, type WebServerInput, type WebServerLoaders, type WebSeo, type WebSeoInput, } from "../../../src/web/server";
|
|
3
3
|
export { createBuildUrlsFromPathname, createGetPageItems, createGetCategoryItems, createGetSubcategoryItems, createGetPostItems, } from "../../../src/web/server/seo";
|
|
4
4
|
export type { PostRouteMode } from "../../../src/web/server/seo";
|
|
5
5
|
export type { PageFindDetailAction } from "../../../src/web/contracts/resources/page/actions";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../export/web/server/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,WAAW,GACjB,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAEL,2BAA2B,EAC3B,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AAErC,YAAY,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../export/web/server/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,KAAK,WAAW,GACjB,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAEL,2BAA2B,EAC3B,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AAErC,YAAY,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC"}
|