Skip to content

Commit

Permalink
fix: fix select folder root name (Issue #597) (#624)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Kezik authored Jan 30, 2024
1 parent ff21890 commit fe451a6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/components/Chat/ChangePathDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ import {
} from '@/src/store/prompts/prompts.reducers';
import { UIActions } from '@/src/store/ui/ui.reducers';

import { MAX_CHAT_AND_PROMPT_FOLDERS_DEPTH } from '@/src/constants/folders';
import {
MAX_CHAT_AND_PROMPT_FOLDERS_DEPTH,
PUBLISHING_FOLDER_NAME,
} from '@/src/constants/folders';

import { SelectFolder } from '@/src/components/Common/SelectFolder/SelectFolder';
import { SelectFolderFooter } from '@/src/components/Common/SelectFolder/SelectFolderFooter';
Expand Down Expand Up @@ -197,6 +200,7 @@ export const ChangePathDialog = ({
initiallySelectedFolderId={initiallySelectedFolderId}
selectedFolderId={selectedFolderId}
highlightTemporaryFolders
rootFolderName={PUBLISHING_FOLDER_NAME}
/>
</SelectFolderHeader>
<SelectFolderFooter
Expand Down
9 changes: 4 additions & 5 deletions src/components/Common/SelectFolder/SelectFolderList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import { DialFile } from '@/src/types/files';
import { Prompt } from '@/src/types/prompt';
import { Translation } from '@/src/types/translation';

import {
MAX_CHAT_AND_PROMPT_FOLDERS_DEPTH,
PUBLISHING_FOLDER_NAME,
} from '@/src/constants/folders';
import { MAX_CHAT_AND_PROMPT_FOLDERS_DEPTH } from '@/src/constants/folders';

import CaretIconComponent from '@/src/components/Common/CaretIconComponent';
import { NoResultsFound } from '@/src/components/Common/NoResultsFound';
Expand All @@ -22,6 +19,7 @@ interface Props<T, P = unknown> {
folderProps: Omit<FolderProps<T, P>, 'currentFolder'>;
handleToggleFolder: (folderId?: string) => void;
isAllEntitiesOpened: boolean;
rootFolderName: string;
selectedFolderId?: string;
initiallySelectedFolderId?: string;
highlightTemporaryFolders?: boolean;
Expand All @@ -34,6 +32,7 @@ export const SelectFolderList = <T extends Conversation | Prompt | DialFile>({
selectedFolderId,
initiallySelectedFolderId,
highlightTemporaryFolders,
rootFolderName,
}: Props<T>) => {
const { t } = useTranslation(Translation.Chat);

Expand All @@ -53,7 +52,7 @@ export const SelectFolderList = <T extends Conversation | Prompt | DialFile>({
onClick={() => handleToggleFolder()}
>
<CaretIconComponent isOpen={isAllEntitiesOpened} />
{t(PUBLISHING_FOLDER_NAME)}
{t(rootFolderName)}
</button>
{isAllEntitiesOpened && (
<div className="flex min-h-[250px] flex-col gap-0.5 overflow-auto">
Expand Down
1 change: 1 addition & 0 deletions src/components/Files/SelectFolderModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export const SelectFolderModal = ({
handleToggleFolder={handleToggleFolder}
isAllEntitiesOpened={isAllFilesOpened}
selectedFolderId={selectedFolderId}
rootFolderName="All files"
/>
</SelectFolderHeader>
<SelectFolderFooter
Expand Down

0 comments on commit fe451a6

Please sign in to comment.