|
@@ -11,6 +11,7 @@ import type {
|
|
|
import {
|
|
import {
|
|
|
isClient, pagePathUtils, pathUtils,
|
|
isClient, pagePathUtils, pathUtils,
|
|
|
} from '@growi/core/dist/utils';
|
|
} from '@growi/core/dist/utils';
|
|
|
|
|
+import { AcceptedUploadFileType } from '@growi/editor';
|
|
|
import ExtensibleCustomError from 'extensible-custom-error';
|
|
import ExtensibleCustomError from 'extensible-custom-error';
|
|
|
import type {
|
|
import type {
|
|
|
GetServerSideProps, GetServerSidePropsContext,
|
|
GetServerSideProps, GetServerSidePropsContext,
|
|
@@ -40,7 +41,9 @@ import {
|
|
|
useIsAclEnabled, useIsSearchPage, useIsEnabledAttachTitleHeader,
|
|
useIsAclEnabled, useIsSearchPage, useIsEnabledAttachTitleHeader,
|
|
|
useCsrfToken, useIsSearchScopeChildrenAsDefault, useIsEnabledMarp, useCurrentPathname,
|
|
useCsrfToken, useIsSearchScopeChildrenAsDefault, useIsEnabledMarp, useCurrentPathname,
|
|
|
useIsSlackConfigured, useRendererConfig, useGrowiCloudUri,
|
|
useIsSlackConfigured, useRendererConfig, useGrowiCloudUri,
|
|
|
- useEditorConfig, useIsAllReplyShown, useIsUploadAllFileAllowed, useIsUploadEnabled, useIsContainerFluid, useIsNotCreatable,
|
|
|
|
|
|
|
+ useEditorConfig, useIsAllReplyShown, useIsContainerFluid, useIsNotCreatable,
|
|
|
|
|
+ useIsUploadAllFileAllowed, useIsUploadEnabled,
|
|
|
|
|
+ // useAcceptedUploadFileType,
|
|
|
} from '~/stores/context';
|
|
} from '~/stores/context';
|
|
|
import { useEditingMarkdown } from '~/stores/editor';
|
|
import { useEditingMarkdown } from '~/stores/editor';
|
|
|
import {
|
|
import {
|
|
@@ -222,6 +225,7 @@ const Page: NextPageWithLayout<Props> = (props: Props) => {
|
|
|
|
|
|
|
|
useIsUploadAllFileAllowed(props.editorConfig.upload.isUploadAllFileAllowed);
|
|
useIsUploadAllFileAllowed(props.editorConfig.upload.isUploadAllFileAllowed);
|
|
|
useIsUploadEnabled(props.editorConfig.upload.isUploadEnabled);
|
|
useIsUploadEnabled(props.editorConfig.upload.isUploadEnabled);
|
|
|
|
|
+ // useAcceptedUploadFileType(props.editorConfig.acceptedUploadFileType);
|
|
|
|
|
|
|
|
const { pageWithMeta } = props;
|
|
const { pageWithMeta } = props;
|
|
|
|
|
|
|
@@ -567,7 +571,17 @@ function injectServerConfigurations(context: GetServerSidePropsContext, props: P
|
|
|
isUploadAllFileAllowed: crowi.fileUploadService.getFileUploadEnabled(),
|
|
isUploadAllFileAllowed: crowi.fileUploadService.getFileUploadEnabled(),
|
|
|
isUploadEnabled: crowi.fileUploadService.getIsUploadable(),
|
|
isUploadEnabled: crowi.fileUploadService.getIsUploadable(),
|
|
|
},
|
|
},
|
|
|
|
|
+ // acceptedUploadFileType: (() => {
|
|
|
|
|
+ // if (!crowi.fileUploadService.getIsUploadable()) {
|
|
|
|
|
+ // return AcceptedUploadFileType.NONE;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (crowi.fileUploadService.getFileUploadEnabled()) {
|
|
|
|
|
+ // return AcceptedUploadFileType.ALL;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // return AcceptedUploadFileType.IMAGE;
|
|
|
|
|
+ // })(),
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
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');
|
|
|
|
|
|