mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-25 09:34:18 +08:00
CB-2783 show description when only one possible project (#1356)
This commit is contained in:
@@ -14,12 +14,13 @@ import { CachedMapAllKey } from '@cloudbeaver/core-sdk';
|
||||
|
||||
interface Props {
|
||||
value: string | null;
|
||||
filter?: (project: ProjectInfo) => boolean;
|
||||
onChange: (value: string) => void;
|
||||
autoHide?: boolean;
|
||||
readOnly?: boolean;
|
||||
disabled?: boolean;
|
||||
inline?: boolean;
|
||||
onChange: (value: string) => void;
|
||||
filter?: (project: ProjectInfo) => boolean;
|
||||
descriptionGetter?: (projects: ProjectInfo[], possibleOptions: string[]) => string | undefined;
|
||||
}
|
||||
|
||||
export const ProjectSelect = observer(function ProjectSelect({
|
||||
@@ -30,6 +31,7 @@ export const ProjectSelect = observer(function ProjectSelect({
|
||||
disabled,
|
||||
inline,
|
||||
onChange,
|
||||
descriptionGetter,
|
||||
}: Props) {
|
||||
const translate = useTranslate();
|
||||
|
||||
@@ -64,6 +66,8 @@ export const ProjectSelect = observer(function ProjectSelect({
|
||||
return null;
|
||||
}
|
||||
|
||||
const description = descriptionGetter?.(projects, possibleOptions);
|
||||
|
||||
return (
|
||||
<Combobox
|
||||
name='projectId'
|
||||
@@ -78,6 +82,7 @@ export const ProjectSelect = observer(function ProjectSelect({
|
||||
disabled={disabled}
|
||||
loading={projectsLoader.isLoading()}
|
||||
inline={inline}
|
||||
description={description}
|
||||
tiny
|
||||
fill
|
||||
onSelect={handleProjectSelect}
|
||||
|
||||
Reference in New Issue
Block a user