mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Panel/DashList: Fetch folders with View permission (#32406)
Closes #31357
This commit is contained in:
parent
5b2a419df8
commit
a98fd22e34
@ -18,6 +18,7 @@ export interface Props {
|
||||
dashboardId?: any;
|
||||
initialTitle?: string;
|
||||
initialFolderId?: number;
|
||||
permissionLevel?: 'View' | 'Edit';
|
||||
}
|
||||
|
||||
interface State {
|
||||
@ -40,11 +41,12 @@ export class FolderPicker extends PureComponent<Props, State> {
|
||||
});
|
||||
}
|
||||
|
||||
static defaultProps = {
|
||||
static defaultProps: Partial<Props> = {
|
||||
rootName: 'General',
|
||||
enableReset: false,
|
||||
initialTitle: '',
|
||||
enableCreateNew: false,
|
||||
permissionLevel: 'Edit',
|
||||
};
|
||||
|
||||
componentDidMount = async () => {
|
||||
@ -52,11 +54,11 @@ export class FolderPicker extends PureComponent<Props, State> {
|
||||
};
|
||||
|
||||
getOptions = async (query: string) => {
|
||||
const { rootName, enableReset, initialTitle } = this.props;
|
||||
const { rootName, enableReset, initialTitle, permissionLevel } = this.props;
|
||||
const params = {
|
||||
query,
|
||||
type: 'dash-folder',
|
||||
permission: 'Edit',
|
||||
permission: permissionLevel,
|
||||
};
|
||||
|
||||
// TODO: move search to BackendSrv interface
|
||||
|
@ -49,6 +49,7 @@ export const plugin = new PanelPlugin<DashListOptions>(DashList)
|
||||
initialFolderId={props.value}
|
||||
initialTitle="All"
|
||||
enableReset={true}
|
||||
permissionLevel="View"
|
||||
onChange={({ id }) => props.onChange(id)}
|
||||
/>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user