Merge pull request #260 from YangFong/fix/name

fix typo
This commit is contained in:
fantasticit 2024-03-18 09:25:56 +08:00 committed by GitHub
commit e552399332
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 17 additions and 12 deletions

View File

@ -4,7 +4,7 @@ import { IconUserAdd } from '@douyinfe/semi-icons';
import { Avatar, AvatarGroup, Button, Dropdown, Modal, Popover, Toast, Tooltip, Typography } from '@douyinfe/semi-ui';
import { Members } from 'components/members';
import { useDoumentMembers } from 'data/document';
import { useDocumentMembers } from 'data/document';
import { useUser } from 'data/user';
import { event, JOIN_USER } from 'event';
import { IsOnMobile } from 'hooks/use-on-mobile';
@ -41,7 +41,7 @@ export const DocumentCollaboration: React.FC<IProps> = ({ wikiId, documentId, di
<div style={{ padding: '24px 0' }}>
<Members
id={documentId}
hook={useDoumentMembers}
hook={useDocumentMembers}
descriptions={[
'权限继承:默认继承知识库成员权限',
'超级管理员:组织超级管理员、知识库超级管理员和文档创建者',

View File

@ -4,7 +4,7 @@ import { IconPlus } from '@douyinfe/semi-icons';
import { Button, Tree as SemiTree, Typography } from '@douyinfe/semi-ui';
import { DocumentActions } from 'components/document/actions';
import { DocumentCreator as DocumenCreatorForm } from 'components/document/create';
import { DocumentCreator as DocumentCreatorForm } from 'components/document/create';
import deepEqual from 'deep-equal';
import { CREATE_DOCUMENT, event, triggerCreateDocument } from 'event';
import { useToggle } from 'hooks/use-toggle';
@ -72,7 +72,12 @@ const AddDocument = () => {
}, [toggleVisible]);
return (
<DocumenCreatorForm wikiId={wikiId} parentDocumentId={documentId} visible={visible} toggleVisible={toggleVisible} />
<DocumentCreatorForm
wikiId={wikiId}
parentDocumentId={documentId}
visible={visible}
toggleVisible={toggleVisible}
/>
);
};

View File

@ -89,7 +89,7 @@ export const getDocumentMembers = (
* @param documentId
* @returns
*/
export const useDoumentMembers = (documentId, options?: UseQueryOptions<Array<{ user: IUser; auth: IAuthority }>>) => {
export const useDocumentMembers = (documentId, options?: UseQueryOptions<Array<{ user: IUser; auth: IAuthority }>>) => {
const [pageSize] = useState(12);
const [page, setPage] = useState(1);
const { data, error, isLoading, refetch } = useQuery(

View File

@ -3,7 +3,7 @@ import { useQuery, UseQueryOptions } from 'react-query';
import { IDocument, IWiki, StarApiDefinition } from '@think/domains';
import { event, TOGGLE_STAR_DOUCMENT, TOGGLE_STAR_WIKI, triggerToggleStarDocument, triggerToggleStarWiki } from 'event';
import { event, TOGGLE_STAR_DOCUMENT, TOGGLE_STAR_WIKI, triggerToggleStarDocument, triggerToggleStarWiki } from 'event';
import { HttpClient } from 'services/http-client';
export type IWikiWithIsMember = IWiki & { isMember?: boolean };
@ -122,10 +122,10 @@ export const useStarDocumentsInOrganization = (organizationId) => {
}
);
useEffect(() => {
event.on(TOGGLE_STAR_DOUCMENT, refetch);
event.on(TOGGLE_STAR_DOCUMENT, refetch);
return () => {
event.off(TOGGLE_STAR_DOUCMENT, refetch);
event.off(TOGGLE_STAR_DOCUMENT, refetch);
};
}, [refetch]);
return { data, error, loading: isLoading, refresh: refetch };
@ -218,10 +218,10 @@ export const useStarDocumentsInWiki = (organizationId, wikiId) => {
);
useEffect(() => {
event.on(TOGGLE_STAR_DOUCMENT, refetch);
event.on(TOGGLE_STAR_DOCUMENT, refetch);
return () => {
event.off(TOGGLE_STAR_DOUCMENT, refetch);
event.off(TOGGLE_STAR_DOCUMENT, refetch);
};
}, [refetch]);

View File

@ -8,7 +8,7 @@ export const REFRESH_ORGANIZATIONS = 'REFRESH_ORGANIZATIONS'; // 刷新组织列
export const REFRESH_TOCS = `REFRESH_TOCS`; // 刷新知识库目录
export const CREATE_DOCUMENT = `CREATE_DOCUMENT`;
export const TOGGLE_STAR_WIKI = `TOGGLE_STAR_WIKI`; // 收藏或取消收藏知识库
export const TOGGLE_STAR_DOUCMENT = `TOGGLE_STAR_DOUCMENT`; // 收藏或取消收藏文档
export const TOGGLE_STAR_DOCUMENT = `TOGGLE_STAR_DOCUMENT`; // 收藏或取消收藏文档
/**
*
@ -60,7 +60,7 @@ export const triggerToggleStarWiki = () => {
};
export const triggerToggleStarDocument = () => {
event.emit(TOGGLE_STAR_DOUCMENT);
event.emit(TOGGLE_STAR_DOCUMENT);
};
export const triggerRefreshOrganizations = () => {