mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
DSPicker: Respect datasource & mixed props (#70377)
This commit is contained in:
parent
5622f2f43a
commit
d5d3db9a6e
@ -18,10 +18,12 @@ interface BuiltInDataSourceListProps {
|
||||
className?: string;
|
||||
current: DataSourceRef | string | null | undefined;
|
||||
onChange: (ds: DataSourceInstanceSettings) => void;
|
||||
dashboard?: boolean;
|
||||
mixed?: boolean;
|
||||
}
|
||||
|
||||
export function BuiltInDataSourceList({ className, current, onChange }: BuiltInDataSourceListProps) {
|
||||
const grafanaDataSources = useDatasources({ mixed: true, dashboard: true, filter: (ds) => !!ds.meta.builtIn });
|
||||
export function BuiltInDataSourceList({ className, current, onChange, dashboard, mixed }: BuiltInDataSourceListProps) {
|
||||
const grafanaDataSources = useDatasources({ mixed, dashboard, filter: (ds) => !!ds.meta.builtIn });
|
||||
|
||||
return (
|
||||
<div className={className}>
|
||||
|
@ -240,6 +240,8 @@ const PickerContent = React.forwardRef<HTMLDivElement, PickerContentProps>((prop
|
||||
enableFileUpload: props.enableFileUpload,
|
||||
fileUploadOptions: props.fileUploadOptions,
|
||||
reportedInteractionFrom: 'ds_picker',
|
||||
dashboard: props.dashboard,
|
||||
mixed: props.mixed,
|
||||
current,
|
||||
onDismiss: hideModal,
|
||||
onChange: (ds) => {
|
||||
|
@ -37,12 +37,16 @@ interface DataSourceModalProps {
|
||||
onDismiss: () => void;
|
||||
recentlyUsed?: string[];
|
||||
enableFileUpload?: boolean;
|
||||
dashboard?: boolean;
|
||||
mixed?: boolean;
|
||||
fileUploadOptions?: DropzoneOptions;
|
||||
reportedInteractionFrom?: string;
|
||||
}
|
||||
|
||||
export function DataSourceModal({
|
||||
enableFileUpload,
|
||||
dashboard,
|
||||
mixed,
|
||||
fileUploadOptions,
|
||||
onChange,
|
||||
current,
|
||||
@ -113,6 +117,8 @@ export function DataSourceModal({
|
||||
}
|
||||
/>
|
||||
<BuiltInDataSourceList
|
||||
dashboard={dashboard}
|
||||
mixed={mixed}
|
||||
className={styles.appendBuiltInDataSourcesList}
|
||||
onChange={onChangeDataSource}
|
||||
current={current}
|
||||
@ -122,7 +128,12 @@ export function DataSourceModal({
|
||||
<div className={styles.rightColumn}>
|
||||
<div className={styles.builtInDataSources}>
|
||||
<CustomScrollbar className={styles.builtInDataSourcesList}>
|
||||
<BuiltInDataSourceList onChange={onChangeDataSource} current={current} />
|
||||
<BuiltInDataSourceList
|
||||
onChange={onChangeDataSource}
|
||||
current={current}
|
||||
dashboard={dashboard}
|
||||
mixed={mixed}
|
||||
/>
|
||||
</CustomScrollbar>
|
||||
{enableFileUpload && (
|
||||
<FileDropzone
|
||||
|
@ -13,6 +13,8 @@ export interface DataSourceDropdownProps {
|
||||
onClickAddCSV?: () => void;
|
||||
recentlyUsed?: string[];
|
||||
hideTextValue?: boolean;
|
||||
dashboard?: boolean;
|
||||
mixed?: boolean;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
@ -20,6 +22,8 @@ export interface PickerContentProps extends DataSourceDropdownProps {
|
||||
keyboardEvents: Observable<React.KeyboardEvent>;
|
||||
style: React.CSSProperties;
|
||||
filterTerm?: string;
|
||||
dashboard?: boolean;
|
||||
mixed?: boolean;
|
||||
onClose: () => void;
|
||||
onDismiss: () => void;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user