mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-04-07 00:15:23 +02:00
Merge 2bc8957689 into 8ed0bcf5ca
This commit is contained in:
commit
bec2280de3
5 changed files with 68 additions and 7 deletions
|
|
@ -143,13 +143,15 @@ export default function useSideNavLinks({
|
|||
});
|
||||
}
|
||||
|
||||
links.push({
|
||||
title: 'com_sidepanel_attach_files',
|
||||
label: '',
|
||||
icon: AttachmentIcon,
|
||||
id: 'files',
|
||||
Component: FilesPanel,
|
||||
});
|
||||
if (interfaceConfig.attachFiles !== false) {
|
||||
links.push({
|
||||
title: 'com_sidepanel_attach_files',
|
||||
label: '',
|
||||
icon: AttachmentIcon,
|
||||
id: 'files',
|
||||
Component: FilesPanel,
|
||||
});
|
||||
}
|
||||
|
||||
if (hasAccessToBookmarks) {
|
||||
links.push({
|
||||
|
|
@ -195,6 +197,7 @@ export default function useSideNavLinks({
|
|||
hasAccessToMemories,
|
||||
hasAccessToReadMemories,
|
||||
interfaceConfig.parameters,
|
||||
interfaceConfig.attachFiles,
|
||||
endpointType,
|
||||
hasAccessToBookmarks,
|
||||
availableMCPServers,
|
||||
|
|
|
|||
|
|
@ -83,6 +83,10 @@ interface:
|
|||
modelSelect: true
|
||||
parameters: true
|
||||
presets: true
|
||||
# Enable/disable the Attach Files sidebar panel (default: true)
|
||||
# When set to false, hides the sidebar's file management panel
|
||||
# but users can still upload files directly in chats
|
||||
attachFiles: true
|
||||
prompts:
|
||||
use: true
|
||||
create: true
|
||||
|
|
|
|||
|
|
@ -154,4 +154,55 @@ describe('AppService interface configuration', () => {
|
|||
// Verify that peoplePicker is undefined when not provided
|
||||
expect(result.interfaceConfig?.peoplePicker).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should set attachFiles to true when config specifies attachFiles as true', async () => {
|
||||
const config = {
|
||||
interface: {
|
||||
attachFiles: true,
|
||||
},
|
||||
};
|
||||
|
||||
const result = await AppService({ config });
|
||||
|
||||
expect(result).toEqual(
|
||||
expect.objectContaining({
|
||||
interfaceConfig: expect.objectContaining({
|
||||
attachFiles: true,
|
||||
}),
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should set attachFiles to false when config specifies attachFiles as false', async () => {
|
||||
const config = {
|
||||
interface: {
|
||||
attachFiles: false,
|
||||
},
|
||||
};
|
||||
|
||||
const result = await AppService({ config });
|
||||
|
||||
expect(result).toEqual(
|
||||
expect.objectContaining({
|
||||
interfaceConfig: expect.objectContaining({
|
||||
attachFiles: false,
|
||||
}),
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should not set attachFiles when not provided in config', async () => {
|
||||
const config = {};
|
||||
|
||||
const result = await AppService({ config });
|
||||
|
||||
expect(result).toEqual(
|
||||
expect.objectContaining({
|
||||
interfaceConfig: expect.anything(),
|
||||
}),
|
||||
);
|
||||
|
||||
// Verify that attachFiles is undefined when not provided
|
||||
expect(result.interfaceConfig?.attachFiles).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -696,6 +696,7 @@ export const interfaceSchema = z
|
|||
bookmarks: z.boolean().optional(),
|
||||
memories: z.boolean().optional(),
|
||||
presets: z.boolean().optional(),
|
||||
attachFiles: z.boolean().optional(),
|
||||
prompts: z
|
||||
.union([
|
||||
z.boolean(),
|
||||
|
|
@ -752,6 +753,7 @@ export const interfaceSchema = z
|
|||
multiConvo: true,
|
||||
bookmarks: true,
|
||||
memories: true,
|
||||
attachFiles: true,
|
||||
prompts: {
|
||||
use: true,
|
||||
create: true,
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ export async function loadDefaultInterface({
|
|||
customWelcome: interfaceConfig?.customWelcome ?? defaults.customWelcome,
|
||||
|
||||
// Permissions - only include if explicitly configured
|
||||
attachFiles: interfaceConfig?.attachFiles,
|
||||
bookmarks: interfaceConfig?.bookmarks,
|
||||
memories: shouldDisableMemories ? false : interfaceConfig?.memories,
|
||||
prompts: interfaceConfig?.prompts,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue