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E,EAAEF,OAG1D,SAASyR,EACdC,EACArJ,EACAkH,GAEA,IAAKlH,EAAY/G,OACf,OAAOoQ,EAAYnH,QAAQ/K,GACrBA,EAAEkD,QAAU4M,EAAAA,YAAAA,YACPC,EAAQjI,KAAO9H,EAAE8H,KAM9B,MAAML,GAAQ0K,EAAAA,EAAAA,yBAAwBtJ,GAAab,cAC7CoK,EAA2B,GAC3BhP,EAA2B,GAC3BiP,EAAe,QAAQC,WAAW7K,GAExC,IAAK,MAAM2E,KAAQ8F,EAAa,CAC9B,GAAI9F,EAAKlJ,QAAU4M,EAAAA,YAAAA,YAA0BC,EAAQjI,KAAOsE,EAAKtE,GAC/D,SAGF,MACMyK,EADOnG,EAAKlM,KAAK8H,cACNwK,QAAQ/K,GAEb,IAAR8K,EACFH,EAAMnR,KAAKmL,GACFmG,EAAM,EACfnP,EAAMnC,KAAKmL,GACFiG,GAA4B,eAAZjG,EAAKtE,IAC9BsK,EAAMnR,KAAKmL,GAIf,OAAOgG,EAAMK,OAAOrP,K,+ECvCf,MAAMsP,EAA8BC,IACzC,MAAMC,EASR,SAA6B1P,GAC3B,OAAQA,GACN,KAAK4M,EAAAA,YAAAA,WACH,MAAO,CACLhJ,KAAM,aACN+L,MAAO,MACPC,QAAU,sEAEd,KAAKhD,EAAAA,YAAAA,MACH,MAAO,CACLhJ,KAAM,QACN+L,MAAO,OACPC,QAAU,oFAEd,KAAKhD,EAAAA,YAAAA,KACH,MAAO,CACLhJ,KAAM,OACN+L,MAAO,OACPC,QAAU,0DAEd,QACE,OAAO,MA9BKC,CAAoBJ,EAAMzP,OAE1C,OAAK0P,GAIE,SAAC,EAAAI,MAAD,CAAOH,MAAOD,EAAQC,MAAOrP,MAAOoP,EAAQE,QAAShM,KAAM8L,EAAQ9L,KAAM7E,KAAM2Q,EAAQ3Q,OAHrF","sources":["webpack://grafana/./public/app/core/components/PanelTypeFilter/PanelTypeFilter.tsx","webpack://grafana/./public/app/features/library-panels/components/DeleteLibraryPanelModal/reducer.ts","webpack://grafana/./public/app/features/library-panels/components/DeleteLibraryPanelModal/DeleteLibraryPanelModal.tsx","webpack://grafana/./public/app/features/library-panels/components/DeleteLibraryPanelModal/actions.ts","webpack://grafana/./public/app/features/library-panels/components/LibraryPanelCard/LibraryPanelCard.tsx","webpack://grafana/./public/app/core/components/FolderFilter/FolderFilter.tsx","webpack://grafana/./public/app/features/library-panels/components/LibraryPanelsSearch/reducer.ts","webpack://grafana/./public/app/features/library-panels/components/LibraryPanelsSearch/LibraryPanelsSearch.tsx","webpack://grafana/./public/app/features/library-panels/components/LibraryPanelsView/LibraryPanelsView.tsx","webpack://grafana/./public/app/features/library-panels/components/LibraryPanelsView/actions.ts","webpack://grafana/./public/app/features/library-panels/components/LibraryPanelsView/reducer.ts","webpack://grafana/./public/app/features/library-panels/styles.ts","webpack://grafana/./public/app/features/panel/components/VizTypePicker/PanelTypeCard.tsx","webpack://grafana/./public/app/features/panel/state/util.ts","webpack://grafana/./public/app/features/plugins/components/PluginStateInfo.tsx"],"sourcesContent":["import { css } from '@emotion/css';\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport { GrafanaTheme2, PanelPluginMeta, SelectableValue } from '@grafana/data';\nimport { Icon, Button, MultiSelect, useStyles2 } from '@grafana/ui';\nimport { getAllPanelPluginMeta } from 'app/features/panel/state/util';\n\nexport interface Props {\n onChange: (plugins: PanelPluginMeta[]) => void;\n maxMenuHeight?: number;\n}\n\nexport const PanelTypeFilter = ({ onChange: propsOnChange, maxMenuHeight }: Props): JSX.Element => {\n const plugins = useMemo(() => {\n return getAllPanelPluginMeta();\n }, []);\n const options = useMemo(\n () =>\n plugins\n .map((p) => ({ label: p.name, imgUrl: p.info.logos.small, value: p }))\n .sort((a, b) => a.label?.localeCompare(b.label)),\n [plugins]\n );\n const [value, setValue] = useState>>([]);\n const onChange = useCallback(\n (plugins: Array>) => {\n const changedPlugins = [];\n for (const plugin of plugins) {\n if (plugin.value) {\n changedPlugins.push(plugin.value);\n }\n }\n propsOnChange(changedPlugins);\n setValue(plugins);\n },\n [propsOnChange]\n );\n const styles = useStyles2(getStyles);\n\n const selectOptions = {\n defaultOptions: true,\n getOptionLabel: (i: any) => i.label,\n getOptionValue: (i: any) => i.value,\n noOptionsMessage: 'No Panel types found',\n placeholder: 'Filter by type',\n maxMenuHeight,\n options,\n value,\n onChange,\n };\n\n return (\n
\n {value.length > 0 && (\n onChange([])}\n aria-label=\"Clear types\"\n >\n Clear types\n \n )}\n } aria-label=\"Panel Type filter\" />\n
\n );\n};\n\nfunction getStyles(theme: GrafanaTheme2) {\n return {\n container: css`\n label: container;\n position: relative;\n min-width: 180px;\n flex-grow: 1;\n `,\n clear: css`\n label: clear;\n font-size: ${theme.spacing(1.5)};\n position: absolute;\n top: -${theme.spacing(4.5)};\n right: 0;\n `,\n };\n}\n","import { createAction } from '@reduxjs/toolkit';\nimport { AnyAction } from 'redux';\n\nimport { LoadingState } from '@grafana/data';\nimport { DashboardSearchHit } from 'app/features/search/types';\n\nexport interface DeleteLibraryPanelModalState {\n loadingState: LoadingState;\n dashboardTitles: string[];\n}\n\nexport const initialDeleteLibraryPanelModalState: DeleteLibraryPanelModalState = {\n loadingState: LoadingState.Loading,\n dashboardTitles: [],\n};\n\nexport const searchCompleted = createAction<{ dashboards: DashboardSearchHit[] }>(\n 'libraryPanels/delete/searchCompleted'\n);\n\nexport const deleteLibraryPanelModalReducer = (\n state: DeleteLibraryPanelModalState = initialDeleteLibraryPanelModalState,\n action: AnyAction\n): DeleteLibraryPanelModalState => {\n if (searchCompleted.match(action)) {\n return {\n ...state,\n dashboardTitles: action.payload.dashboards.map((d) => d.title),\n loadingState: LoadingState.Done,\n };\n }\n\n return state;\n};\n","import React, { FC, useEffect, useMemo, useReducer } from 'react';\n\nimport { LoadingState } from '@grafana/data';\nimport { Button, Modal, useStyles } from '@grafana/ui';\n\nimport { getModalStyles } from '../../styles';\nimport { LibraryElementDTO } from '../../types';\nimport { asyncDispatcher } from '../LibraryPanelsView/actions';\n\nimport { getConnectedDashboards } from './actions';\nimport { deleteLibraryPanelModalReducer, initialDeleteLibraryPanelModalState } from './reducer';\n\ninterface Props {\n libraryPanel: LibraryElementDTO;\n onConfirm: () => void;\n onDismiss: () => void;\n}\n\nexport const DeleteLibraryPanelModal: FC = ({ libraryPanel, onDismiss, onConfirm }) => {\n const styles = useStyles(getModalStyles);\n const [{ dashboardTitles, loadingState }, dispatch] = useReducer(\n deleteLibraryPanelModalReducer,\n initialDeleteLibraryPanelModalState\n );\n const asyncDispatch = useMemo(() => asyncDispatcher(dispatch), [dispatch]);\n useEffect(() => {\n asyncDispatch(getConnectedDashboards(libraryPanel));\n }, [asyncDispatch, libraryPanel]);\n const connected = Boolean(dashboardTitles.length);\n const done = loadingState === LoadingState.Done;\n\n return (\n \n {!done ? : null}\n {done ? (\n
\n {connected ? : null}\n {!connected ? : null}\n\n \n \n \n \n
\n ) : null}\n
\n );\n};\n\nconst LoadingIndicator: FC = () => Loading library panel...;\n\nconst Confirm: FC = () => {\n const styles = useStyles(getModalStyles);\n\n return
Do you want to delete this panel?
;\n};\n\nconst HasConnectedDashboards: FC<{ dashboardTitles: string[] }> = ({ dashboardTitles }) => {\n const styles = useStyles(getModalStyles);\n const suffix = dashboardTitles.length === 1 ? 'dashboard.' : 'dashboards.';\n const message = `${dashboardTitles.length} ${suffix}`;\n if (dashboardTitles.length === 0) {\n return null;\n }\n\n return (\n
\n

\n {'This library panel can not be deleted because it is connected to '}\n {message}\n {' Remove the library panel from the dashboards listed below and retry.'}\n

\n \n \n \n \n \n \n \n {dashboardTitles.map((title, i) => (\n \n \n \n ))}\n \n
Dashboard name
{title}
\n
\n );\n};\n","import { getConnectedDashboards as apiGetConnectedDashboards } from '../../state/api';\nimport { DispatchResult, LibraryElementDTO } from '../../types';\n\nimport { searchCompleted } from './reducer';\n\nexport function getConnectedDashboards(libraryPanel: LibraryElementDTO): DispatchResult {\n return async function (dispatch) {\n const dashboards = await apiGetConnectedDashboards(libraryPanel.uid);\n dispatch(searchCompleted({ dashboards }));\n };\n}\n","import { css } from '@emotion/css';\nimport React, { ReactElement, useState } from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { config } from '@grafana/runtime';\nimport { Icon, Link, useStyles2 } from '@grafana/ui';\nimport { getPanelPluginNotFound } from 'app/features/panel/components/PanelPluginError';\nimport { PanelTypeCard } from 'app/features/panel/components/VizTypePicker/PanelTypeCard';\n\nimport { LibraryElementDTO } from '../../types';\nimport { DeleteLibraryPanelModal } from '../DeleteLibraryPanelModal/DeleteLibraryPanelModal';\n\nexport interface LibraryPanelCardProps {\n libraryPanel: LibraryElementDTO;\n onClick: (panel: LibraryElementDTO) => void;\n onDelete?: (panel: LibraryElementDTO) => void;\n showSecondaryActions?: boolean;\n}\n\nexport const LibraryPanelCard: React.FC = ({\n libraryPanel,\n onClick,\n onDelete,\n showSecondaryActions,\n}) => {\n const [showDeletionModal, setShowDeletionModal] = useState(false);\n\n const onDeletePanel = () => {\n onDelete?.(libraryPanel);\n setShowDeletionModal(false);\n };\n\n const panelPlugin = config.panels[libraryPanel.model.type] ?? getPanelPluginNotFound(libraryPanel.model.type).meta;\n\n return (\n <>\n onClick?.(libraryPanel)}\n onDelete={showSecondaryActions ? () => setShowDeletionModal(true) : undefined}\n >\n \n \n {showDeletionModal && (\n setShowDeletionModal(false)}\n />\n )}\n \n );\n};\n\ninterface FolderLinkProps {\n libraryPanel: LibraryElementDTO;\n}\n\nfunction FolderLink({ libraryPanel }: FolderLinkProps): ReactElement | null {\n const styles = useStyles2(getStyles);\n\n if (!libraryPanel.meta.folderUid && !libraryPanel.meta.folderName) {\n return null;\n }\n\n if (!libraryPanel.meta.folderUid) {\n return (\n \n \n {libraryPanel.meta.folderName}\n \n );\n }\n\n return (\n \n \n \n {libraryPanel.meta.folderName}\n \n \n );\n}\n\nfunction getStyles(theme: GrafanaTheme2) {\n return {\n metaContainer: css`\n display: flex;\n align-items: center;\n color: ${theme.colors.text.secondary};\n font-size: ${theme.typography.bodySmall.fontSize};\n padding-top: ${theme.spacing(0.5)};\n\n svg {\n margin-right: ${theme.spacing(0.5)};\n margin-bottom: 3px;\n }\n `,\n };\n}\n","import { css } from '@emotion/css';\nimport debounce from 'debounce-promise';\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport { GrafanaTheme2, SelectableValue } from '@grafana/data';\nimport { AsyncMultiSelect, Icon, Button, useStyles2 } from '@grafana/ui';\nimport { getBackendSrv } from 'app/core/services/backend_srv';\nimport { FolderInfo, PermissionLevelString } from 'app/types';\n\nexport interface FolderFilterProps {\n onChange: (folder: FolderInfo[]) => void;\n maxMenuHeight?: number;\n}\n\nexport function FolderFilter({ onChange: propsOnChange, maxMenuHeight }: FolderFilterProps): JSX.Element {\n const styles = useStyles2(getStyles);\n const [loading, setLoading] = useState(false);\n const getOptions = useCallback((searchString: string) => getFoldersAsOptions(searchString, setLoading), []);\n const debouncedLoadOptions = useMemo(() => debounce(getOptions, 300), [getOptions]);\n const [value, setValue] = useState>>([]);\n const onChange = useCallback(\n (folders: Array>) => {\n const changedFolders = [];\n for (const folder of folders) {\n if (folder.value) {\n changedFolders.push(folder.value);\n }\n }\n propsOnChange(changedFolders);\n setValue(folders);\n },\n [propsOnChange]\n );\n const selectOptions = {\n defaultOptions: true,\n isMulti: true,\n noOptionsMessage: 'No folders found',\n placeholder: 'Filter by folder',\n maxMenuHeight,\n value,\n onChange,\n };\n\n return (\n
\n {value.length > 0 && (\n onChange([])}\n aria-label=\"Clear folders\"\n >\n Clear folders\n \n )}\n }\n aria-label=\"Folder filter\"\n />\n
\n );\n}\n\nasync function getFoldersAsOptions(searchString: string, setLoading: (loading: boolean) => void) {\n setLoading(true);\n\n const params = {\n query: searchString,\n type: 'dash-folder',\n permission: PermissionLevelString.View,\n };\n\n const searchHits = await getBackendSrv().search(params);\n const options = searchHits.map((d) => ({ label: d.title, value: { id: d.id, title: d.title } }));\n if (!searchString || 'general'.includes(searchString.toLowerCase())) {\n options.unshift({ label: 'General', value: { id: 0, title: 'General' } });\n }\n\n setLoading(false);\n\n return options;\n}\n\nfunction getStyles(theme: GrafanaTheme2) {\n return {\n container: css`\n label: container;\n position: relative;\n min-width: 180px;\n flex-grow: 1;\n `,\n clear: css`\n label: clear;\n font-size: ${theme.spacing(1.5)};\n position: absolute;\n top: -${theme.spacing(4.5)};\n right: 0;\n `,\n };\n}\n","import { createAction } from '@reduxjs/toolkit';\nimport { AnyAction } from 'redux';\n\nimport { PanelPluginMeta, SelectableValue } from '@grafana/data';\n\nimport { FolderInfo } from '../../../../types';\n\nexport interface LibraryPanelsSearchState {\n searchQuery: string;\n sortDirection?: string;\n panelFilter: string[];\n folderFilter: string[];\n}\n\nexport const initialLibraryPanelsSearchState: LibraryPanelsSearchState = {\n searchQuery: '',\n panelFilter: [],\n folderFilter: [],\n sortDirection: undefined,\n};\n\nexport const searchChanged = createAction('libraryPanels/search/searchChanged');\nexport const sortChanged = createAction>('libraryPanels/search/sortChanged');\nexport const panelFilterChanged = createAction('libraryPanels/search/panelFilterChanged');\nexport const folderFilterChanged = createAction('libraryPanels/search/folderFilterChanged');\n\nexport const libraryPanelsSearchReducer = (state: LibraryPanelsSearchState, action: AnyAction) => {\n if (searchChanged.match(action)) {\n return { ...state, searchQuery: action.payload };\n }\n\n if (sortChanged.match(action)) {\n return { ...state, sortDirection: action.payload.value };\n }\n\n if (panelFilterChanged.match(action)) {\n return { ...state, panelFilter: action.payload.map((p) => p.id) };\n }\n\n if (folderFilterChanged.match(action)) {\n return { ...state, folderFilter: action.payload.map((f) => String(f.id!)) };\n }\n\n return state;\n};\n","import { css } from '@emotion/css';\nimport React, { useReducer } from 'react';\n\nimport { GrafanaTheme2, PanelPluginMeta, SelectableValue } from '@grafana/data';\nimport { HorizontalGroup, useStyles2, VerticalGroup, FilterInput } from '@grafana/ui';\n\nimport { FolderFilter } from '../../../../core/components/FolderFilter/FolderFilter';\nimport { PanelTypeFilter } from '../../../../core/components/PanelTypeFilter/PanelTypeFilter';\nimport { SortPicker } from '../../../../core/components/Select/SortPicker';\nimport { DEFAULT_PER_PAGE_PAGINATION } from '../../../../core/constants';\nimport { FolderInfo } from '../../../../types';\nimport { LibraryElementDTO } from '../../types';\nimport { LibraryPanelsView } from '../LibraryPanelsView/LibraryPanelsView';\n\nimport {\n folderFilterChanged,\n initialLibraryPanelsSearchState,\n libraryPanelsSearchReducer,\n panelFilterChanged,\n searchChanged,\n sortChanged,\n} from './reducer';\n\nexport enum LibraryPanelsSearchVariant {\n Tight = 'tight',\n Spacious = 'spacious',\n}\n\nexport interface LibraryPanelsSearchProps {\n onClick: (panel: LibraryElementDTO) => void;\n variant?: LibraryPanelsSearchVariant;\n showSort?: boolean;\n showPanelFilter?: boolean;\n showFolderFilter?: boolean;\n showSecondaryActions?: boolean;\n currentPanelId?: string;\n currentFolderId?: number;\n perPage?: number;\n}\n\nexport const LibraryPanelsSearch = ({\n onClick,\n variant = LibraryPanelsSearchVariant.Spacious,\n currentPanelId,\n currentFolderId,\n perPage = DEFAULT_PER_PAGE_PAGINATION,\n showPanelFilter = false,\n showFolderFilter = false,\n showSort = false,\n showSecondaryActions = false,\n}: LibraryPanelsSearchProps): JSX.Element => {\n const styles = useStyles2(getStyles);\n const [{ sortDirection, panelFilter, folderFilter, searchQuery }, dispatch] = useReducer(libraryPanelsSearchReducer, {\n ...initialLibraryPanelsSearchState,\n folderFilter: currentFolderId ? [currentFolderId.toString(10)] : [],\n });\n const onFilterChange = (searchString: string) => dispatch(searchChanged(searchString));\n const onSortChange = (sorting: SelectableValue) => dispatch(sortChanged(sorting));\n const onFolderFilterChange = (folders: FolderInfo[]) => dispatch(folderFilterChanged(folders));\n const onPanelFilterChange = (plugins: PanelPluginMeta[]) => dispatch(panelFilterChanged(plugins));\n\n if (variant === LibraryPanelsSearchVariant.Spacious) {\n return (\n
\n \n \n
\n \n {showSort && (\n \n )}\n \n {showFolderFilter && }\n {showPanelFilter && }\n \n \n
\n
\n \n
\n
\n
\n );\n }\n\n return (\n
\n \n
\n
\n \n
\n
\n {showSort && }\n {showFolderFilter && }\n {showPanelFilter && }\n
\n
\n
\n \n
\n
\n
\n );\n};\n\nfunction getStyles(theme: GrafanaTheme2) {\n return {\n container: css`\n width: 100%;\n overflow-y: auto;\n padding: ${theme.spacing(1)};\n `,\n buttonRow: css`\n display: flex;\n justify-content: space-between;\n width: 100%;\n margin-top: ${theme.spacing(2)}; // Clear types link\n `,\n tightButtonRow: css`\n display: flex;\n justify-content: space-between;\n width: 100%;\n margin-top: ${theme.spacing(4)}; // Clear types link\n `,\n tightFilter: css`\n flex-grow: 1;\n `,\n tightSortFilter: css`\n flex-grow: 1;\n padding: ${theme.spacing(0, 0, 0, 0.5)};\n `,\n libraryPanelsView: css`\n width: 100%;\n `,\n };\n}\n","import { css, cx } from '@emotion/css';\nimport React, { useMemo, useReducer } from 'react';\nimport { useDebounce } from 'react-use';\n\nimport { GrafanaTheme, LoadingState } from '@grafana/data';\nimport { Pagination, useStyles } from '@grafana/ui';\n\nimport { LibraryElementDTO } from '../../types';\nimport { LibraryPanelCard } from '../LibraryPanelCard/LibraryPanelCard';\n\nimport { asyncDispatcher, deleteLibraryPanel, searchForLibraryPanels } from './actions';\nimport { changePage, initialLibraryPanelsViewState, libraryPanelsViewReducer } from './reducer';\n\ninterface LibraryPanelViewProps {\n className?: string;\n onClickCard: (panel: LibraryElementDTO) => void;\n showSecondaryActions?: boolean;\n currentPanelId?: string;\n searchString: string;\n sortDirection?: string;\n panelFilter?: string[];\n folderFilter?: string[];\n perPage?: number;\n}\n\nexport const LibraryPanelsView: React.FC = ({\n className,\n onClickCard,\n searchString,\n sortDirection,\n panelFilter,\n folderFilter,\n showSecondaryActions,\n currentPanelId: currentPanel,\n perPage: propsPerPage = 40,\n}) => {\n const styles = useStyles(getPanelViewStyles);\n const [{ libraryPanels, page, perPage, numberOfPages, loadingState, currentPanelId }, dispatch] = useReducer(\n libraryPanelsViewReducer,\n {\n ...initialLibraryPanelsViewState,\n currentPanelId: currentPanel,\n perPage: propsPerPage,\n }\n );\n const asyncDispatch = useMemo(() => asyncDispatcher(dispatch), [dispatch]);\n useDebounce(\n () =>\n asyncDispatch(\n searchForLibraryPanels({\n searchString,\n sortDirection,\n panelFilter,\n folderFilter,\n page,\n perPage,\n currentPanelId,\n })\n ),\n 300,\n [searchString, sortDirection, panelFilter, folderFilter, page, asyncDispatch]\n );\n const onDelete = ({ uid }: LibraryElementDTO) =>\n asyncDispatch(deleteLibraryPanel(uid, { searchString, page, perPage }));\n const onPageChange = (page: number) => asyncDispatch(changePage({ page }));\n\n return (\n
\n
\n {loadingState === LoadingState.Loading ? (\n

Loading library panels...

\n ) : libraryPanels.length < 1 ? (\n

No library panels found.

\n ) : (\n libraryPanels?.map((item, i) => (\n \n ))\n )}\n
\n {libraryPanels.length ? (\n
\n \n
\n ) : null}\n
\n );\n};\n\nconst getPanelViewStyles = (theme: GrafanaTheme) => {\n return {\n container: css`\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n `,\n libraryPanelList: css`\n max-width: 100%;\n display: grid;\n grid-gap: ${theme.spacing.sm};\n `,\n searchHeader: css`\n display: flex;\n `,\n newPanelButton: css`\n margin-top: 10px;\n align-self: flex-start;\n `,\n pagination: css`\n align-self: center;\n margin-top: ${theme.spacing.sm};\n `,\n noPanelsFound: css`\n label: noPanelsFound;\n min-height: 200px;\n `,\n };\n};\n","import { AnyAction } from '@reduxjs/toolkit';\nimport { Dispatch } from 'react';\nimport { from, merge, of, Subscription, timer } from 'rxjs';\nimport { catchError, finalize, mapTo, mergeMap, share, takeUntil } from 'rxjs/operators';\n\nimport { deleteLibraryPanel as apiDeleteLibraryPanel, getLibraryPanels } from '../../state/api';\n\nimport { initialLibraryPanelsViewState, initSearch, searchCompleted } from './reducer';\n\ntype DispatchResult = (dispatch: Dispatch) => void;\ninterface SearchArgs {\n perPage: number;\n page: number;\n searchString: string;\n sortDirection?: string;\n panelFilter?: string[];\n folderFilter?: string[];\n currentPanelId?: string;\n}\n\nexport function searchForLibraryPanels(args: SearchArgs): DispatchResult {\n return function (dispatch) {\n const subscription = new Subscription();\n const dataObservable = from(\n getLibraryPanels({\n searchString: args.searchString,\n perPage: args.perPage,\n page: args.page,\n excludeUid: args.currentPanelId,\n sortDirection: args.sortDirection,\n typeFilter: args.panelFilter,\n folderFilter: args.folderFilter,\n })\n ).pipe(\n mergeMap(({ perPage, elements: libraryPanels, page, totalCount }) =>\n of(searchCompleted({ libraryPanels, page, perPage, totalCount }))\n ),\n catchError((err) => {\n console.error(err);\n return of(searchCompleted({ ...initialLibraryPanelsViewState, page: args.page, perPage: args.perPage }));\n }),\n finalize(() => subscription.unsubscribe()), // make sure we unsubscribe\n share()\n );\n\n subscription.add(\n // If 50ms without a response dispatch a loading state\n // mapTo will translate the timer event into a loading state\n // takeUntil will cancel the timer emit when first response is received on the dataObservable\n merge(timer(50).pipe(mapTo(initSearch()), takeUntil(dataObservable)), dataObservable).subscribe(dispatch)\n );\n };\n}\n\nexport function deleteLibraryPanel(uid: string, args: SearchArgs): DispatchResult {\n return async function (dispatch) {\n try {\n await apiDeleteLibraryPanel(uid);\n searchForLibraryPanels(args)(dispatch);\n } catch (e) {\n console.error(e);\n }\n };\n}\n\nexport function asyncDispatcher(dispatch: Dispatch) {\n return function (action: any) {\n if (action instanceof Function) {\n return action(dispatch);\n }\n return dispatch(action);\n };\n}\n","import { createAction } from '@reduxjs/toolkit';\nimport { AnyAction } from 'redux';\n\nimport { LoadingState } from '@grafana/data';\n\nimport { LibraryElementDTO } from '../../types';\n\nexport interface LibraryPanelsViewState {\n loadingState: LoadingState;\n libraryPanels: LibraryElementDTO[];\n totalCount: number;\n perPage: number;\n page: number;\n numberOfPages: number;\n currentPanelId?: string;\n}\n\nexport const initialLibraryPanelsViewState: LibraryPanelsViewState = {\n loadingState: LoadingState.Loading,\n libraryPanels: [],\n totalCount: 0,\n perPage: 40,\n page: 1,\n numberOfPages: 0,\n currentPanelId: undefined,\n};\n\nexport const initSearch = createAction('libraryPanels/view/initSearch');\nexport const searchCompleted = createAction<\n Omit\n>('libraryPanels/view/searchCompleted');\n\nexport const changePage = createAction>('libraryPanels/view/changePage');\n\nexport const libraryPanelsViewReducer = (state: LibraryPanelsViewState, action: AnyAction) => {\n if (initSearch.match(action)) {\n return { ...state, loadingState: LoadingState.Loading };\n }\n\n if (searchCompleted.match(action)) {\n const { libraryPanels, page, perPage, totalCount } = action.payload;\n const numberOfPages = Math.ceil(totalCount / perPage);\n return {\n ...state,\n libraryPanels,\n perPage,\n totalCount,\n loadingState: LoadingState.Done,\n numberOfPages,\n page: page > numberOfPages ? page - 1 : page,\n };\n }\n\n if (changePage.match(action)) {\n return { ...state, page: action.payload.page };\n }\n\n return state;\n};\n","import { css } from '@emotion/css';\n\nimport { GrafanaTheme } from '@grafana/data';\n\nexport function getModalStyles(theme: GrafanaTheme) {\n return {\n myTable: css`\n max-height: 204px;\n overflow-y: auto;\n margin-top: 11px;\n margin-bottom: 28px;\n border-radius: ${theme.border.radius.sm};\n border: 1px solid ${theme.colors.bg3};\n background: ${theme.colors.bg1};\n color: ${theme.colors.textSemiWeak};\n font-size: ${theme.typography.size.md};\n width: 100%;\n\n thead {\n color: #538ade;\n font-size: ${theme.typography.size.sm};\n }\n\n th,\n td {\n padding: 6px 13px;\n height: ${theme.spacing.xl};\n }\n\n tbody > tr:nth-child(odd) {\n background: ${theme.colors.bg2};\n }\n `,\n noteTextbox: css`\n margin-bottom: ${theme.spacing.xl};\n `,\n textInfo: css`\n color: ${theme.colors.textSemiWeak};\n font-size: ${theme.typography.size.sm};\n `,\n dashboardSearch: css`\n margin-top: ${theme.spacing.md};\n `,\n modal: css`\n width: 500px;\n `,\n modalText: css`\n font-size: ${theme.typography.heading.h4};\n color: ${theme.colors.link};\n margin-bottom: calc(${theme.spacing.d} * 2);\n padding-top: ${theme.spacing.d};\n `,\n };\n}\n","import { css, cx } from '@emotion/css';\nimport React, { MouseEventHandler } from 'react';\n\nimport { GrafanaTheme2, isUnsignedPluginSignature, PanelPluginMeta, PluginState } from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { IconButton, PluginSignatureBadge, useStyles2 } from '@grafana/ui';\nimport { PluginStateInfo } from 'app/features/plugins/components/PluginStateInfo';\n\ninterface Props {\n isCurrent: boolean;\n plugin: PanelPluginMeta;\n title: string;\n onClick: MouseEventHandler;\n onDelete?: () => void;\n disabled?: boolean;\n showBadge?: boolean;\n description?: string;\n}\n\nexport const PanelTypeCard: React.FC = ({\n isCurrent,\n title,\n plugin,\n onClick,\n onDelete,\n disabled,\n showBadge,\n description,\n children,\n}) => {\n const styles = useStyles2(getStyles);\n const cssClass = cx({\n [styles.item]: true,\n [styles.disabled]: disabled || plugin.state === PluginState.deprecated,\n [styles.current]: isCurrent,\n });\n\n return (\n \n \"\"\n\n
\n
{title}
\n {description ? {description} : null}\n {children}\n
\n {showBadge && (\n
\n \n
\n )}\n {onDelete && (\n {\n e.stopPropagation();\n onDelete();\n }}\n className={styles.deleteButton}\n aria-label=\"Delete button on panel type card\"\n />\n )}\n \n );\n};\n\nPanelTypeCard.displayName = 'PanelTypeCard';\n\nconst getStyles = (theme: GrafanaTheme2) => {\n return {\n item: css`\n position: relative;\n display: flex;\n flex-shrink: 0;\n cursor: pointer;\n background: ${theme.colors.background.secondary};\n border-radius: ${theme.shape.borderRadius()};\n box-shadow: ${theme.shadows.z1};\n border: 1px solid ${theme.colors.background.secondary};\n align-items: center;\n padding: 8px;\n width: 100%;\n position: relative;\n overflow: hidden;\n transition: ${theme.transitions.create(['background'], {\n duration: theme.transitions.duration.short,\n })};\n\n &:hover {\n background: ${theme.colors.emphasize(theme.colors.background.secondary, 0.03)};\n }\n `,\n itemContent: css`\n overflow: hidden;\n position: relative;\n padding: ${theme.spacing(0, 1)};\n `,\n current: css`\n label: currentVisualizationItem;\n border: 1px solid ${theme.colors.primary.border};\n background: ${theme.colors.action.selected};\n `,\n disabled: css`\n opacity: 0.2;\n filter: grayscale(1);\n cursor: default;\n pointer-events: none;\n `,\n name: css`\n text-overflow: ellipsis;\n overflow: hidden;\n font-size: ${theme.typography.size.sm};\n font-weight: ${theme.typography.fontWeightMedium};\n width: 100%;\n `,\n description: css`\n display: block;\n text-overflow: ellipsis;\n overflow: hidden;\n color: ${theme.colors.text.secondary};\n font-size: ${theme.typography.bodySmall.fontSize};\n font-weight: ${theme.typography.fontWeightLight};\n width: 100%;\n max-height: 4.5em;\n `,\n img: css`\n max-height: 38px;\n width: 38px;\n display: flex;\n align-items: center;\n `,\n badge: css`\n background: ${theme.colors.background.primary};\n `,\n deleteButton: css`\n margin-left: auto;\n `,\n };\n};\n\ninterface PanelPluginBadgeProps {\n plugin: PanelPluginMeta;\n}\n\nconst PanelPluginBadge: React.FC = ({ plugin }) => {\n if (isUnsignedPluginSignature(plugin.signature)) {\n return ;\n }\n\n return ;\n};\n\nPanelPluginBadge.displayName = 'PanelPluginBadge';\n","import { PanelPluginMeta, PluginState, unEscapeStringFromRegex } from '@grafana/data';\nimport { config } from 'app/core/config';\n\nexport function getAllPanelPluginMeta(): PanelPluginMeta[] {\n const allPanels = config.panels;\n\n return Object.keys(allPanels)\n .filter((key) => allPanels[key]['hideFromList'] === false)\n .map((key) => allPanels[key])\n .sort((a: PanelPluginMeta, b: PanelPluginMeta) => a.sort - b.sort);\n}\n\nexport function filterPluginList(\n pluginsList: PanelPluginMeta[],\n searchQuery: string, // Note: this will be an escaped regex string as it comes from `FilterInput`\n current: PanelPluginMeta\n): PanelPluginMeta[] {\n if (!searchQuery.length) {\n return pluginsList.filter((p) => {\n if (p.state === PluginState.deprecated) {\n return current.id === p.id;\n }\n return true;\n });\n }\n\n const query = unEscapeStringFromRegex(searchQuery).toLowerCase();\n const first: PanelPluginMeta[] = [];\n const match: PanelPluginMeta[] = [];\n const isGraphQuery = 'graph'.startsWith(query);\n\n for (const item of pluginsList) {\n if (item.state === PluginState.deprecated && current.id !== item.id) {\n continue;\n }\n\n const name = item.name.toLowerCase();\n const idx = name.indexOf(query);\n\n if (idx === 0) {\n first.push(item);\n } else if (idx > 0) {\n match.push(item);\n } else if (isGraphQuery && item.id === 'timeseries') {\n first.push(item);\n }\n }\n\n return first.concat(match);\n}\n","import React, { FC } from 'react';\n\nimport { PluginState } from '@grafana/data';\nimport { Badge, BadgeProps } from '@grafana/ui';\n\ninterface Props {\n state?: PluginState;\n}\n\nexport const PluginStateInfo: FC = (props) => {\n const display = getFeatureStateInfo(props.state);\n\n if (!display) {\n return null;\n }\n\n return ;\n};\n\nfunction getFeatureStateInfo(state?: PluginState): BadgeProps | null {\n switch (state) {\n case PluginState.deprecated:\n return {\n text: 'Deprecated',\n color: 'red',\n tooltip: `This feature is deprecated and will be removed in a future release`,\n };\n case PluginState.alpha:\n return {\n text: 'Alpha',\n color: 'blue',\n tooltip: `This feature is experimental and future updates might not be backward compatible`,\n };\n case PluginState.beta:\n return {\n text: 'Beta',\n color: 'blue',\n tooltip: `This feature is close to complete but not fully tested`,\n };\n default:\n return null;\n }\n}\n"],"names":["PanelTypeFilter","onChange","propsOnChange","maxMenuHeight","plugins","useMemo","getAllPanelPluginMeta","options","map","p","label","name","imgUrl","info","logos","small","value","sort","a","b","localeCompare","setValue","useState","useCallback","changedPlugins","plugin","push","styles","useStyles2","getStyles","selectOptions","defaultOptions","getOptionLabel","i","getOptionValue","noOptionsMessage","placeholder","className","container","length","Button","size","icon","fill","clear","onClick","MultiSelect","prefix","Icon","theme","css","spacing","initialDeleteLibraryPanelModalState","loadingState","LoadingState","dashboardTitles","searchCompleted","createAction","deleteLibraryPanelModalReducer","state","action","match","payload","dashboards","d","title","DeleteLibraryPanelModal","libraryPanel","onDismiss","onConfirm","useStyles","getModalStyles","dispatch","useReducer","asyncDispatch","asyncDispatcher","useEffect","async","apiGetConnectedDashboards","uid","getConnectedDashboards","connected","Boolean","done","Modal","modal","isOpen","LoadingIndicator","HasConnectedDashboards","Confirm","variant","disabled","modalText","suffix","message","textInfo","myTable","LibraryPanelCard","onDelete","showSecondaryActions","showDeletionModal","setShowDeletionModal","panelPlugin","config","model","type","getPanelPluginNotFound","meta","PanelTypeCard","isCurrent","description","undefined","FolderLink","folderUid","folderName","metaContainer","Link","href","colors","text","secondary","typography","bodySmall","fontSize","FolderFilter","loading","setLoading","getOptions","searchString","params","query","permission","PermissionLevelString","getBackendSrv","search","id","includes","toLowerCase","unshift","getFoldersAsOptions","debouncedLoadOptions","debounce","folders","changedFolders","folder","isMulti","AsyncMultiSelect","isLoading","loadOptions","initialLibraryPanelsSearchState","searchQuery","panelFilter","folderFilter","sortDirection","searchChanged","sortChanged","panelFilterChanged","folderFilterChanged","libraryPanelsSearchReducer","f","String","LibraryPanelsSearchVariant","LibraryPanelsSearch","Spacious","currentPanelId","currentFolderId","perPage","DEFAULT_PER_PAGE_PAGINATION","showPanelFilter","showFolderFilter","showSort","toString","onFilterChange","onSortChange","sorting","onFolderFilterChange","onPanelFilterChange","VerticalGroup","FilterInput","width","buttonRow","HorizontalGroup","justify","SortPicker","filter","libraryPanelsView","LibraryPanelsView","onClickCard","tightButtonRow","tightFilter","tightSortFilter","currentPanel","propsPerPage","getPanelViewStyles","libraryPanels","page","numberOfPages","libraryPanelsViewReducer","initialLibraryPanelsViewState","useDebounce","searchForLibraryPanels","deleteLibraryPanel","cx","libraryPanelList","noPanelsFound","item","pagination","Pagination","currentPage","onNavigate","changePage","hideWhenSinglePage","sm","searchHeader","newPanelButton","args","subscription","Subscription","dataObservable","from","getLibraryPanels","excludeUid","typeFilter","pipe","mergeMap","elements","totalCount","of","catchError","err","console","error","finalize","unsubscribe","share","add","merge","timer","mapTo","initSearch","takeUntil","subscribe","apiDeleteLibraryPanel","e","Function","Math","ceil","border","radius","bg3","bg1","textSemiWeak","md","xl","bg2","noteTextbox","dashboardSearch","heading","h4","link","showBadge","children","cssClass","PluginState","current","selectors","img","src","alt","itemContent","badge","PanelPluginBadge","IconButton","stopPropagation","deleteButton","displayName","background","shape","borderRadius","shadows","z1","transitions","create","duration","short","emphasize","primary","selected","fontWeightMedium","fontWeightLight","isUnsignedPluginSignature","signature","PluginSignatureBadge","status","allPanels","Object","keys","key","filterPluginList","pluginsList","unEscapeStringFromRegex","first","isGraphQuery","startsWith","idx","indexOf","concat","PluginStateInfo","props","display","color","tooltip","getFeatureStateInfo","Badge"],"sourceRoot":""}