mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 11:20:15 +01:00
chore: address ESLint Warnings
This commit is contained in:
parent
717f61d878
commit
e97444a863
3 changed files with 57 additions and 46 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
const { logger } = require('@librechat/data-schemas');
|
||||||
const { Constants, isAgentsEndpoint } = require('librechat-data-provider');
|
const { Constants, isAgentsEndpoint } = require('librechat-data-provider');
|
||||||
const { canAccessResource } = require('./canAccessResource');
|
const { canAccessResource } = require('./canAccessResource');
|
||||||
const { getAgent } = require('~/models/Agent');
|
const { getAgent } = require('~/models/Agent');
|
||||||
|
|
@ -82,6 +83,7 @@ const canAccessAgentFromBody = (options) => {
|
||||||
|
|
||||||
return agentAccessMiddleware(tempReq, res, next);
|
return agentAccessMiddleware(tempReq, res, next);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
logger.error('Failed to validate agent access permissions', error);
|
||||||
return res.status(500).json({
|
return res.status(500).json({
|
||||||
error: 'Internal Server Error',
|
error: 'Internal Server Error',
|
||||||
message: 'Failed to validate agent access permissions',
|
message: 'Failed to validate agent access permissions',
|
||||||
|
|
|
||||||
|
|
@ -683,7 +683,6 @@ describe('PermissionService', () => {
|
||||||
|
|
||||||
describe('bulkUpdateResourcePermissions', () => {
|
describe('bulkUpdateResourcePermissions', () => {
|
||||||
const otherUserId = new mongoose.Types.ObjectId();
|
const otherUserId = new mongoose.Types.ObjectId();
|
||||||
const anotherGroupId = new mongoose.Types.ObjectId();
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
// Setup existing permissions for testing
|
// Setup existing permissions for testing
|
||||||
|
|
|
||||||
|
|
@ -132,53 +132,63 @@ export function SearchPicker<TOption extends { key: string; value: string }>({
|
||||||
'[pointer-events:auto]', // Override body's pointer-events:none when in modal
|
'[pointer-events:auto]', // Override body's pointer-events:none when in modal
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{isLoading ? (
|
{(() => {
|
||||||
<div className="space-y-2 p-2">
|
if (isLoading) {
|
||||||
{Array.from({ length: 3 }).map((_, index) => (
|
return (
|
||||||
<div key={index} className="flex items-center gap-3 px-3 py-2">
|
<div className="space-y-2 p-2">
|
||||||
<Skeleton className="h-8 w-8 rounded-full" />
|
{Array.from({ length: 3 }).map((_, index) => (
|
||||||
<div className="flex-1 space-y-1">
|
<div key={index} className="flex items-center gap-3 px-3 py-2">
|
||||||
<Skeleton className="h-4 w-3/4" />
|
<Skeleton className="h-8 w-8 rounded-full" />
|
||||||
<Skeleton className="h-3 w-1/2" />
|
<div className="flex-1 space-y-1">
|
||||||
|
<Skeleton className="h-4 w-3/4" />
|
||||||
|
<Skeleton className="h-3 w-1/2" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.length > 0) {
|
||||||
|
return options.map((o) => (
|
||||||
|
<Ariakit.ComboboxItem
|
||||||
|
key={o.key}
|
||||||
|
focusOnHover
|
||||||
|
// hideOnClick
|
||||||
|
value={o.value}
|
||||||
|
selectValueOnClick={false}
|
||||||
|
onClick={() => onPickHandler(o)}
|
||||||
|
className={cn(
|
||||||
|
'flex w-full cursor-pointer items-center px-3 text-sm',
|
||||||
|
'text-text-primary hover:bg-surface-tertiary',
|
||||||
|
'data-[active-item]:bg-surface-tertiary',
|
||||||
|
)}
|
||||||
|
render={renderOptions(o)}
|
||||||
|
></Ariakit.ComboboxItem>
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (query.trim().length >= minQueryLengthForNoResults) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={cn(
|
||||||
|
'flex items-center justify-center px-4 py-8 text-center',
|
||||||
|
'text-sm text-text-secondary',
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<div className="flex flex-col items-center gap-2">
|
||||||
|
<Search className="h-8 w-8 text-text-tertiary opacity-50" />
|
||||||
|
<div className="font-medium">{localize('com_ui_no_results_found')}</div>
|
||||||
|
<div className="text-xs text-text-tertiary">
|
||||||
|
{localize('com_ui_try_adjusting_search')}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
))}
|
);
|
||||||
</div>
|
}
|
||||||
) : options.length ? (
|
|
||||||
options.map((o) => (
|
return null;
|
||||||
<Ariakit.ComboboxItem
|
})()}
|
||||||
key={o.key}
|
|
||||||
focusOnHover
|
|
||||||
// hideOnClick
|
|
||||||
value={o.value}
|
|
||||||
selectValueOnClick={false}
|
|
||||||
onClick={(e) => onPickHandler(o)}
|
|
||||||
className={cn(
|
|
||||||
'flex w-full cursor-pointer items-center px-3 text-sm',
|
|
||||||
'text-text-primary hover:bg-surface-tertiary',
|
|
||||||
'data-[active-item]:bg-surface-tertiary',
|
|
||||||
)}
|
|
||||||
render={renderOptions(o)}
|
|
||||||
></Ariakit.ComboboxItem>
|
|
||||||
))
|
|
||||||
) : (
|
|
||||||
query.trim().length >= minQueryLengthForNoResults && (
|
|
||||||
<div
|
|
||||||
className={cn(
|
|
||||||
'flex items-center justify-center px-4 py-8 text-center',
|
|
||||||
'text-sm text-text-secondary',
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<div className="flex flex-col items-center gap-2">
|
|
||||||
<Search className="h-8 w-8 text-text-tertiary opacity-50" />
|
|
||||||
<div className="font-medium">{localize('com_ui_no_results_found')}</div>
|
|
||||||
<div className="text-xs text-text-tertiary">
|
|
||||||
{localize('com_ui_try_adjusting_search')}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
)}
|
|
||||||
</Ariakit.ComboboxPopover>
|
</Ariakit.ComboboxPopover>
|
||||||
</Ariakit.ComboboxProvider>
|
</Ariakit.ComboboxProvider>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue