|
@@ -62,7 +62,7 @@ import {
|
|
|
useIsEnabledStaleNotification, useIsIdenticalPath,
|
|
useIsEnabledStaleNotification, useIsIdenticalPath,
|
|
|
useIsSearchServiceConfigured, useIsSearchServiceReachable, useDisableLinkSharing,
|
|
useIsSearchServiceConfigured, useIsSearchServiceReachable, useDisableLinkSharing,
|
|
|
useDrawioUri, useHackmdUri, useDefaultIndentSize, useIsIndentSizeForced,
|
|
useDrawioUri, useHackmdUri, useDefaultIndentSize, useIsIndentSizeForced,
|
|
|
- useIsAclEnabled, useIsSearchPage, useTemplateTagData,
|
|
|
|
|
|
|
+ useIsAclEnabled, useIsSearchPage, useTemplateTagData, useTemplateBodyData, useIsEnabledAttachTitleHeader,
|
|
|
useCsrfToken, useIsSearchScopeChildrenAsDefault, useCurrentPageId, useCurrentPathname,
|
|
useCsrfToken, useIsSearchScopeChildrenAsDefault, useCurrentPageId, useCurrentPathname,
|
|
|
useIsSlackConfigured, useRendererConfig, useEditingMarkdown,
|
|
useIsSlackConfigured, useRendererConfig, useEditingMarkdown,
|
|
|
useEditorConfig, useIsAllReplyShown, useIsUploadableFile, useIsUploadableImage, useCustomizedLogoSrc, useIsContainerFluid,
|
|
useEditorConfig, useIsAllReplyShown, useIsUploadableFile, useIsUploadableImage, useCustomizedLogoSrc, useIsContainerFluid,
|
|
@@ -162,6 +162,7 @@ type Props = CommonProps & {
|
|
|
isContainerFluid: boolean,
|
|
isContainerFluid: boolean,
|
|
|
editorConfig: EditorConfig,
|
|
editorConfig: EditorConfig,
|
|
|
isEnabledStaleNotification: boolean,
|
|
isEnabledStaleNotification: boolean,
|
|
|
|
|
+ isEnabledAttachTitleHeader: boolean,
|
|
|
// isEnabledLinebreaks: boolean,
|
|
// isEnabledLinebreaks: boolean,
|
|
|
// isEnabledLinebreaksInComments: boolean,
|
|
// isEnabledLinebreaksInComments: boolean,
|
|
|
adminPreferredIndentSize: number,
|
|
adminPreferredIndentSize: number,
|
|
@@ -216,7 +217,9 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
|
|
|
useIsSearchPage(false);
|
|
useIsSearchPage(false);
|
|
|
|
|
|
|
|
useTemplateTagData(props.templateTagData);
|
|
useTemplateTagData(props.templateTagData);
|
|
|
|
|
+ useTemplateBodyData(props.templateBodyData);
|
|
|
|
|
|
|
|
|
|
+ useIsEnabledAttachTitleHeader(props.isEnabledAttachTitleHeader);
|
|
|
useIsSearchServiceConfigured(props.isSearchServiceConfigured);
|
|
useIsSearchServiceConfigured(props.isSearchServiceConfigured);
|
|
|
useIsSearchServiceReachable(props.isSearchServiceReachable);
|
|
useIsSearchServiceReachable(props.isSearchServiceReachable);
|
|
|
useIsSearchScopeChildrenAsDefault(props.isSearchScopeChildrenAsDefault);
|
|
useIsSearchScopeChildrenAsDefault(props.isSearchScopeChildrenAsDefault);
|
|
@@ -249,7 +252,8 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
|
|
|
useCurrentPathname(props.currentPathname);
|
|
useCurrentPathname(props.currentPathname);
|
|
|
|
|
|
|
|
const { data: currentPage } = useSWRxCurrentPage(undefined, pageWithMeta?.data ?? null); // store initial data
|
|
const { data: currentPage } = useSWRxCurrentPage(undefined, pageWithMeta?.data ?? null); // store initial data
|
|
|
- useEditingMarkdown(pageWithMeta?.data.revision?.body ?? props.templateBodyData ?? '');
|
|
|
|
|
|
|
+
|
|
|
|
|
+ useEditingMarkdown(pageWithMeta?.data.revision?.body);
|
|
|
|
|
|
|
|
const { data: grantData } = useSWRxIsGrantNormalized(pageId);
|
|
const { data: grantData } = useSWRxIsGrantNormalized(pageId);
|
|
|
const { mutate: mutateSelectedGrant } = useSelectedGrant();
|
|
const { mutate: mutateSelectedGrant } = useSelectedGrant();
|
|
@@ -469,7 +473,6 @@ async function injectRoutingInformation(context: GetServerSidePropsContext, prop
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
props.isNotFound = page.isEmpty;
|
|
props.isNotFound = page.isEmpty;
|
|
|
-
|
|
|
|
|
// /62a88db47fed8b2d94f30000 ==> /path/to/page
|
|
// /62a88db47fed8b2d94f30000 ==> /path/to/page
|
|
|
if (isPermalink && page.isEmpty) {
|
|
if (isPermalink && page.isEmpty) {
|
|
|
props.currentPathname = page.path;
|
|
props.currentPathname = page.path;
|
|
@@ -533,6 +536,8 @@ function injectServerConfigurations(context: GetServerSidePropsContext, props: P
|
|
|
props.adminPreferredIndentSize = configManager.getConfig('markdown', 'markdown:adminPreferredIndentSize');
|
|
props.adminPreferredIndentSize = configManager.getConfig('markdown', 'markdown:adminPreferredIndentSize');
|
|
|
props.isIndentSizeForced = configManager.getConfig('markdown', 'markdown:isIndentSizeForced');
|
|
props.isIndentSizeForced = configManager.getConfig('markdown', 'markdown:isIndentSizeForced');
|
|
|
|
|
|
|
|
|
|
+ props.isEnabledAttachTitleHeader = configManager.getConfig('crowi', 'customize:isEnabledAttachTitleHeader');
|
|
|
|
|
+
|
|
|
props.rendererConfig = {
|
|
props.rendererConfig = {
|
|
|
isEnabledLinebreaks: configManager.getConfig('markdown', 'markdown:isEnabledLinebreaks'),
|
|
isEnabledLinebreaks: configManager.getConfig('markdown', 'markdown:isEnabledLinebreaks'),
|
|
|
isEnabledLinebreaksInComments: configManager.getConfig('markdown', 'markdown:isEnabledLinebreaksInComments'),
|
|
isEnabledLinebreaksInComments: configManager.getConfig('markdown', 'markdown:isEnabledLinebreaksInComments'),
|