Skip to content

Commit 4759b66

Browse files
authored
Merge branch 'epam:development' into feature/refactor-chat-component
2 parents 78de36b + b43571d commit 4759b66

File tree

8 files changed

+18
-9
lines changed

8 files changed

+18
-9
lines changed

apps/chat/src/components/Header/CreateNewChatMobile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ interface Props {
2121
}
2222

2323
export const CreateNewChatMobile = ({ iconSize }: Props) => {
24-
const { t } = useTranslation(Translation.SideBar);
24+
const { t } = useTranslation(Translation.Header);
2525
const dispatch = useAppDispatch();
2626

2727
const isConversationsLoaded = useAppSelector(

apps/chat/src/components/Header/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const Header = () => {
5959

6060
const dispatch = useAppDispatch();
6161

62-
const { t } = useTranslation(Translation.SideBar);
62+
const { t } = useTranslation(Translation.Header);
6363
const enabledFeatures = useAppSelector(
6464
SettingsSelectors.selectEnabledFeatures,
6565
);

apps/chat/src/components/Header/User/ProfileButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const ProfileButton = () => {
2121

2222
const dispatch = useAppDispatch();
2323

24-
const { t } = useTranslation(Translation.SideBar);
24+
const { t } = useTranslation(Translation.Header);
2525
const { data: session } = useSession();
2626

2727
const onClick = useCallback(() => {

apps/chat/src/components/Header/User/UserMobile.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import LogOutIcon from '@/public/images/icons/log-out.svg';
2020
import UserIcon from '@/public/images/icons/user.svg';
2121

2222
const UserInfo = () => {
23-
const { t } = useTranslation(Translation.SideBar);
23+
const { t } = useTranslation(Translation.Header);
2424

2525
const { data: session } = useSession();
2626

@@ -47,7 +47,7 @@ const UserInfo = () => {
4747

4848
const UserSettings = () => {
4949
const dispatch = useAppDispatch();
50-
const { t } = useTranslation(Translation.SideBar);
50+
const { t } = useTranslation(Translation.Header);
5151

5252
const onClick = useCallback(() => {
5353
dispatch(UIActions.setIsUserSettingsOpen(true));
@@ -66,7 +66,7 @@ const UserSettings = () => {
6666

6767
const Logout = () => {
6868
const { data: session } = useSession();
69-
const { t } = useTranslation(Translation.SideBar);
69+
const { t } = useTranslation(Translation.Header);
7070
const [isLogoutConfirmationOpened, setIsLogoutConfirmationOpened] =
7171
useState(false);
7272

apps/chat/src/store/import-export/importExport.epics.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ import { Conversation, Message } from '@/src/types/chat';
7676
import { FeatureType, UploadStatus } from '@/src/types/common';
7777
import { DialFile } from '@/src/types/files';
7878
import { FolderType } from '@/src/types/folder';
79+
import { HTTPMethod } from '@/src/types/http';
7980
import { LatestExportFormat, ReplaceOptions } from '@/src/types/import-export';
8081
import { Prompt } from '@/src/types/prompt';
8182
import { AppEpic } from '@/src/types/store';
@@ -1185,10 +1186,17 @@ const uploadConversationAttachmentsEpic: AppEpic = (action$, state$) =>
11851186
attachment.name,
11861187
);
11871188

1189+
const httpMethod =
1190+
attachmentsToReplace?.length &&
1191+
attachmentsToReplace.includes(attachment)
1192+
? HTTPMethod.PUT
1193+
: undefined;
1194+
11881195
return FileService.sendFile(
11891196
formData,
11901197
attachment.relativePath,
11911198
attachment.name,
1199+
httpMethod,
11921200
).pipe(
11931201
filter(
11941202
({ percent, result }) =>

apps/chat/src/types/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export interface CoreAIEntity<T = EntityType.Model> {
3636
system_prompt?: boolean;
3737
url_attachments?: boolean;
3838
folder_attachments?: boolean;
39-
allowResume?: boolean;
39+
allow_resume?: boolean;
4040
};
4141
tokenizer_model?: TokenizerModel;
4242
}

apps/chat/src/utils/app/data/file-service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ export class FileService {
1919
formData: FormData,
2020
relativePath: string | undefined,
2121
fileName: string,
22+
httpMethod?: HTTPMethod,
2223
): Observable<{ percent?: number; result?: DialFile }> {
2324
const resultPath = ApiUtils.encodeApiUrl(
2425
constructPath(getFileRootId(), relativePath, fileName),
2526
);
2627

2728
return ApiUtils.requestOld({
2829
url: `api/${resultPath}`,
29-
method: HTTPMethod.POST,
30+
method: httpMethod ? httpMethod : HTTPMethod.POST,
3031
async: true,
3132
body: formData,
3233
}).pipe(

apps/chat/src/utils/server/get-sorted-entities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export const getSortedEntities = async (token: JWT | null) => {
170170
truncatePrompt: entity.features.truncate_prompt ?? false,
171171
urlAttachments: entity.features.url_attachments ?? false,
172172
folderAttachments: entity.features.folder_attachments ?? false,
173-
allowResume: entity.features.allowResume ?? true,
173+
allowResume: entity.features.allow_resume ?? true,
174174
},
175175
inputAttachmentTypes: entity.input_attachment_types,
176176
maxInputAttachments: entity.max_input_attachments,

0 commit comments

Comments
 (0)