Просмотр исходного кода

Merge pull request #9493 from weseek/fix/159236-module-name

fix: Module name
Yuki Takei 1 год назад
Родитель
Сommit
847c5e23bd

+ 2 - 1
apps/app/public/static/locales/en_US/translation.json

@@ -152,7 +152,8 @@
   "Page Tree": "Page Tree",
   "Page Tree": "Page Tree",
   "Bookmarks": "Bookmarks",
   "Bookmarks": "Bookmarks",
   "In-App Notification": "Notifications",
   "In-App Notification": "Notifications",
-  "Knowledge Assistant": "ナレッジアシスタント",
+  "AI Assistant": "AI Assistant",
+  "Knowledge Assistant": "Knowledge Assistant",
   "original_path": "Original path",
   "original_path": "Original path",
   "new_path": "New path",
   "new_path": "New path",
   "duplicated_path": "Duplicated path",
   "duplicated_path": "Duplicated path",

+ 1 - 0
apps/app/public/static/locales/fr_FR/translation.json

@@ -152,6 +152,7 @@
   "Page Tree": "Arbre",
   "Page Tree": "Arbre",
   "Bookmarks": "Favoris",
   "Bookmarks": "Favoris",
   "In-App Notification": "Notifications",
   "In-App Notification": "Notifications",
+  "AI Assistant": "Assistant IA",
   "Knowledge Assistant": "Assistant de Connaissance",
   "Knowledge Assistant": "Assistant de Connaissance",
   "original_path": "Chemin originel",
   "original_path": "Chemin originel",
   "new_path": "Nouveau chemin",
   "new_path": "Nouveau chemin",

+ 1 - 0
apps/app/public/static/locales/ja_JP/translation.json

@@ -153,6 +153,7 @@
   "Page Tree": "ページツリー",
   "Page Tree": "ページツリー",
   "Bookmarks": "ブックマーク",
   "Bookmarks": "ブックマーク",
   "In-App Notification": "通知",
   "In-App Notification": "通知",
+  "AI Assistant": "AI アシスタント",
   "Knowledge Assistant": "ナレッジアシスタント",
   "Knowledge Assistant": "ナレッジアシスタント",
   "original_path": "元のパス",
   "original_path": "元のパス",
   "new_path": "新しいパス",
   "new_path": "新しいパス",

+ 1 - 0
apps/app/public/static/locales/zh_CN/translation.json

@@ -158,6 +158,7 @@
   "Page Tree": "页面树",
   "Page Tree": "页面树",
   "Bookmarks": "书签",
   "Bookmarks": "书签",
   "In-App Notification": "通知",
   "In-App Notification": "通知",
+  "AI Assistant": "AI助手",
   "Knowledge Assistant": "知识助手",
   "Knowledge Assistant": "知识助手",
   "original_path": "Original path",
   "original_path": "Original path",
   "new_path": "New path",
   "new_path": "New path",

+ 3 - 3
apps/app/src/client/components/Sidebar/SidebarContents.tsx

@@ -1,6 +1,6 @@
 import React, { memo, useMemo } from 'react';
 import React, { memo, useMemo } from 'react';
 
 
-import { KnowledgeAssistant } from '~/features/openai/client/components/KnowledgeAssistant/Sidebar/KnowledgeAssistant';
+import { AiAssistant } from '~/features/openai/client/components/AiAssistant/Sidebar/AiAssistant';
 import { SidebarContentsType } from '~/interfaces/ui';
 import { SidebarContentsType } from '~/interfaces/ui';
 import { useCollapsedContentsOpened, useCurrentSidebarContents, useSidebarMode } from '~/stores/ui';
 import { useCollapsedContentsOpened, useCurrentSidebarContents, useSidebarMode } from '~/stores/ui';
 
 
@@ -33,8 +33,8 @@ export const SidebarContents = memo(() => {
         return Bookmarks;
         return Bookmarks;
       case SidebarContentsType.NOTIFICATION:
       case SidebarContentsType.NOTIFICATION:
         return InAppNotification;
         return InAppNotification;
-      case SidebarContentsType.KNOWNLEDGE_ASSISTANT:
-        return KnowledgeAssistant;
+      case SidebarContentsType.AI_ASSISTANT:
+        return AiAssistant;
       default:
       default:
         return PageTree;
         return PageTree;
     }
     }

+ 3 - 3
apps/app/src/client/components/Sidebar/SidebarNav/PrimaryItems.tsx

@@ -40,9 +40,9 @@ export const PrimaryItems = memo((props: Props) => {
       {isAiEnabled && (
       {isAiEnabled && (
         <PrimaryItem
         <PrimaryItem
           sidebarMode={sidebarMode}
           sidebarMode={sidebarMode}
-          contents={SidebarContentsType.KNOWNLEDGE_ASSISTANT}
-          label="Knowledge Assistant"
-          iconName="knowledge_assistant"
+          contents={SidebarContentsType.AI_ASSISTANT}
+          label="AI Assistant"
+          iconName="ai_assistant"
           isCustomIcon
           isCustomIcon
           onHover={onItemHover}
           onHover={onItemHover}
         />
         />

+ 4 - 4
apps/app/src/components/Layout/BasicLayout.tsx

@@ -35,9 +35,9 @@ const DeleteBookmarkFolderModal = dynamic(
 );
 );
 const SearchModal = dynamic(() => import('../../features/search/client/components/SearchModal'), { ssr: false });
 const SearchModal = dynamic(() => import('../../features/search/client/components/SearchModal'), { ssr: false });
 const AiChatModal = dynamic(() => import('~/features/openai/chat/components/AiChatModal').then(mod => mod.AiChatModal), { ssr: false });
 const AiChatModal = dynamic(() => import('~/features/openai/chat/components/AiChatModal').then(mod => mod.AiChatModal), { ssr: false });
-const KnowledgeAssistantManegementModal = dynamic(
-  () => import('~/features/openai/client/components/KnowledgeAssistant/KnowledgeAssistantManegementModal')
-    .then(mod => mod.KnowledgeAssistantManegementModal), { ssr: false },
+const AiAssistantManegementModal = dynamic(
+  () => import('~/features/openai/client/components/AiAssistant/AiAssistantManegementModal')
+    .then(mod => mod.AiAssistantManegementModal), { ssr: false },
 );
 );
 
 
 type Props = {
 type Props = {
@@ -72,7 +72,7 @@ export const BasicLayout = ({ children, className }: Props): JSX.Element => {
       <PutbackPageModal />
       <PutbackPageModal />
       <SearchModal />
       <SearchModal />
       <AiChatModal />
       <AiChatModal />
-      <KnowledgeAssistantManegementModal />
+      <AiAssistantManegementModal />
 
 
       <PagePresentationModal />
       <PagePresentationModal />
       <HotkeysManager />
       <HotkeysManager />

+ 2 - 2
apps/app/src/features/openai/client/components/KnowledgeAssistant/KnowledgeAssistantManegementModal.module.scss → apps/app/src/features/openai/client/components/AiAssistant/AiAssistantManegementModal.module.scss

@@ -1,8 +1,8 @@
 @use '@growi/core-styles/scss/variables/growi-official-colors';
 @use '@growi/core-styles/scss/variables/growi-official-colors';
 
 
 // == Colors
 // == Colors
-.grw-knowledge-assistant-manegement :global {
-  .growi-knowledge-assistant-icon {
+.grw-ai-assistant-manegement :global {
+  .growi-ai-assistant-icon {
     color: growi-official-colors.$growi-ai-purple;
     color: growi-official-colors.$growi-ai-purple;
   }
   }
 }
 }

+ 11 - 11
apps/app/src/features/openai/client/components/KnowledgeAssistant/KnowledgeAssistantManegementModal.tsx → apps/app/src/features/openai/client/components/AiAssistant/AiAssistantManegementModal.tsx

@@ -5,14 +5,14 @@ import {
   Modal, ModalHeader, ModalBody, ModalFooter, Form, FormGroup, Label, Input,
   Modal, ModalHeader, ModalBody, ModalFooter, Form, FormGroup, Label, Input,
 } from 'reactstrap';
 } from 'reactstrap';
 
 
-import { useKnowledgeAssistantModal } from '../../stores/knowledge-assistant';
+import { useAiAssistantManegementModal } from '../../stores/ai-assistant';
 
 
-import styles from './KnowledgeAssistantManegementModal.module.scss';
+import styles from './AiAssistantManegementModal.module.scss';
 
 
-const moduleClass = styles['grw-knowledge-assistant-manegement'] ?? '';
+const moduleClass = styles['grw-ai-assistant-manegement'] ?? '';
 
 
 
 
-const KnowledgeAssistantManegementModalSubstance = (): JSX.Element => {
+const AiAssistantManegementModalSubstance = (): JSX.Element => {
   return (
   return (
     <div className="px-4">
     <div className="px-4">
       <ModalBody>
       <ModalBody>
@@ -96,23 +96,23 @@ const KnowledgeAssistantManegementModalSubstance = (): JSX.Element => {
 };
 };
 
 
 
 
-export const KnowledgeAssistantManegementModal = (): JSX.Element => {
+export const AiAssistantManegementModal = (): JSX.Element => {
   const { t } = useTranslation();
   const { t } = useTranslation();
 
 
-  const { data: knowledgeAssistantModalData, close: closeKnowledgeAssistantModal } = useKnowledgeAssistantModal();
+  const { data: aiAssistantManegementModalData, close: closeAiAssistantManegementModal } = useAiAssistantManegementModal();
 
 
-  const isOpened = knowledgeAssistantModalData?.isOpened ?? false;
+  const isOpened = aiAssistantManegementModalData?.isOpened ?? false;
 
 
   return (
   return (
-    <Modal size="lg" isOpen={isOpened} toggle={closeKnowledgeAssistantModal} className={moduleClass} scrollable>
+    <Modal size="lg" isOpen={isOpened} toggle={closeAiAssistantManegementModal} className={moduleClass} scrollable>
 
 
-      <ModalHeader tag="h4" toggle={closeKnowledgeAssistantModal} className="pe-4">
-        <span className="growi-custom-icons growi-knowledge-assistant-icon me-3 fs-4">knowledge_assistant</span>
+      <ModalHeader tag="h4" toggle={closeAiAssistantManegementModal} className="pe-4">
+        <span className="growi-custom-icons growi-ai-assistant-icon me-3 fs-4">ai_assistant</span>
         <span className="fw-bold">新規アシスタントの追加</span> {/* TODO i18n */}
         <span className="fw-bold">新規アシスタントの追加</span> {/* TODO i18n */}
       </ModalHeader>
       </ModalHeader>
 
 
       { isOpened && (
       { isOpened && (
-        <KnowledgeAssistantManegementModalSubstance />
+        <AiAssistantManegementModalSubstance />
       ) }
       ) }
 
 
     </Modal>
     </Modal>

+ 3 - 3
apps/app/src/features/openai/client/components/KnowledgeAssistant/Sidebar/KnowledgeAssistant.tsx → apps/app/src/features/openai/client/components/AiAssistant/Sidebar/AiAssistant.tsx

@@ -5,9 +5,9 @@ import { useTranslation } from 'react-i18next';
 
 
 import ItemsTreeContentSkeleton from '~/client/components/ItemsTree/ItemsTreeContentSkeleton';
 import ItemsTreeContentSkeleton from '~/client/components/ItemsTree/ItemsTreeContentSkeleton';
 
 
-const KnowledgeAssistantContent = dynamic(() => import('./KnowledgeAssistantSubstance').then(mod => mod.KnowledgeAssistantContent), { ssr: false });
+const AiAssistantContent = dynamic(() => import('./AiAssistantSubstance').then(mod => mod.AiAssistantContent), { ssr: false });
 
 
-export const KnowledgeAssistant = (): JSX.Element => {
+export const AiAssistant = (): JSX.Element => {
   const { t } = useTranslation();
   const { t } = useTranslation();
 
 
   return (
   return (
@@ -18,7 +18,7 @@ export const KnowledgeAssistant = (): JSX.Element => {
         </h3>
         </h3>
       </div>
       </div>
       <Suspense fallback={<ItemsTreeContentSkeleton />}>
       <Suspense fallback={<ItemsTreeContentSkeleton />}>
-        <KnowledgeAssistantContent />
+        <AiAssistantContent />
       </Suspense>
       </Suspense>
     </div>
     </div>
   );
   );

+ 3 - 3
apps/app/src/features/openai/client/components/KnowledgeAssistant/Sidebar/KnowledgeAssistantSubstance.tsx → apps/app/src/features/openai/client/components/AiAssistant/Sidebar/AiAssistantSubstance.tsx

@@ -1,9 +1,9 @@
 import React from 'react';
 import React from 'react';
 
 
-import { useKnowledgeAssistantModal } from '../../../stores/knowledge-assistant';
+import { useAiAssistantManegementModal } from '../../../stores/ai-assistant';
 
 
-export const KnowledgeAssistantContent = (): JSX.Element => {
-  const { open } = useKnowledgeAssistantModal();
+export const AiAssistantContent = (): JSX.Element => {
+  const { open } = useAiAssistantManegementModal();
 
 
   return (
   return (
     <div>
     <div>

+ 1 - 1
apps/app/src/features/openai/client/components/RagSearchButton.tsx

@@ -27,7 +27,7 @@ const RagSearchButton = (): JSX.Element => {
         onClick={ragSearchButtonClickHandler}
         onClick={ragSearchButtonClickHandler}
         data-testid="open-search-modal-button"
         data-testid="open-search-modal-button"
       >
       >
-        <span className="growi-custom-icons fs-4 align-middle lh-1">knowledge_assistant</span>
+        <span className="growi-custom-icons fs-4 align-middle lh-1">ai_assistant</span>
       </button>
       </button>
     </NotAvailableForGuest>
     </NotAvailableForGuest>
   );
   );

+ 7 - 6
apps/app/src/features/openai/client/stores/knowledge-assistant.tsx → apps/app/src/features/openai/client/stores/ai-assistant.tsx

@@ -4,19 +4,20 @@ import { useSWRStatic } from '@growi/core/dist/swr';
 import type { SWRResponse } from 'swr';
 import type { SWRResponse } from 'swr';
 
 
 
 
-type KnowledgeAssistantMoldalStatus = {
+type AiAssistantManegementModalStatus = {
   isOpened: boolean,
   isOpened: boolean,
 }
 }
 
 
-type KnowledgeAssistantUtils = {
+type AiAssistantManegementModalUtils = {
   open(): void
   open(): void
   close(): void
   close(): void
 }
 }
-export const useKnowledgeAssistantModal = (
-    status?: KnowledgeAssistantMoldalStatus,
-): SWRResponse<KnowledgeAssistantMoldalStatus, Error> & KnowledgeAssistantUtils => {
+
+export const useAiAssistantManegementModal = (
+    status?: AiAssistantManegementModalStatus,
+): SWRResponse<AiAssistantManegementModalStatus, Error> & AiAssistantManegementModalUtils => {
   const initialStatus = { isOpened: false };
   const initialStatus = { isOpened: false };
-  const swrResponse = useSWRStatic<KnowledgeAssistantMoldalStatus, Error>('KnowledgeAssistantModal', status, { fallbackData: initialStatus });
+  const swrResponse = useSWRStatic<AiAssistantManegementModalStatus, Error>('AiAssistantManegementModal', status, { fallbackData: initialStatus });
 
 
   return {
   return {
     ...swrResponse,
     ...swrResponse,

+ 1 - 1
apps/app/src/interfaces/ui.ts

@@ -15,7 +15,7 @@ export const SidebarContentsType = {
   TAG: 'tag',
   TAG: 'tag',
   BOOKMARKS: 'bookmarks',
   BOOKMARKS: 'bookmarks',
   NOTIFICATION: 'notification',
   NOTIFICATION: 'notification',
-  KNOWNLEDGE_ASSISTANT: 'knowledgeAssistant',
+  AI_ASSISTANT: 'aiAssistant',
 } as const;
 } as const;
 export const AllSidebarContentsType = Object.values(SidebarContentsType);
 export const AllSidebarContentsType = Object.values(SidebarContentsType);
 export type SidebarContentsType = typeof SidebarContentsType[keyof typeof SidebarContentsType];
 export type SidebarContentsType = typeof SidebarContentsType[keyof typeof SidebarContentsType];

+ 0 - 0
packages/custom-icons/svg/knowledge_assistant.svg → packages/custom-icons/svg/ai_assistant.svg