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/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/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(() => getAllPanelPluginMeta(), []);\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 = plugins.filter((p) => p.value).map((p) => p.value!);\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 { DashboardSearchItem } 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: DashboardSearchItem[] }>(\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 { DashboardSearchHit, DashboardSearchItemType } from 'app/features/search/types';\nimport { FolderInfo, PermissionLevelString } from 'app/types';\n\nexport interface FolderFilterProps {\n onChange: (folder: FolderInfo[]) => void;\n maxMenuHeight?: number;\n}\n\nexport function FolderFilter({ onChange, 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\n const [value, setValue] = useState>>([]);\n const onSelectOptionChange = useCallback(\n (folders: Array>) => {\n const changedFolderIds = folders.filter((f) => Boolean(f.value)).map((f) => f.value!);\n onChange(changedFolderIds);\n setValue(folders);\n },\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 defaultOptions\n />\n
\n );\n}\n\nasync function getFoldersAsOptions(\n searchString: string,\n setLoading: (loading: boolean) => void\n): Promise>> {\n setLoading(true);\n\n const params = {\n query: searchString,\n type: DashboardSearchItemType.DashFolder,\n permission: PermissionLevelString.View,\n };\n\n // FIXME: stop using id from search and use UID instead\n const searchHits: DashboardSearchHit[] = 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 { css } from '@emotion/css';\nimport React, { useCallback, useState } from 'react';\nimport { useDebounce } from 'react-use';\n\nimport { GrafanaTheme2, PanelPluginMeta, SelectableValue } from '@grafana/data';\nimport { useStyles2, VerticalGroup, FilterInput } from '@grafana/ui';\nimport { FolderInfo } from 'app/types';\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 { LibraryElementDTO } from '../../types';\nimport { LibraryPanelsView } from '../LibraryPanelsView/LibraryPanelsView';\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(useCallback((theme) => getStyles(theme, variant), [variant]));\n\n const [searchQuery, setSearchQuery] = useState('');\n const [debouncedSearchQuery, setDebouncedSearchQuery] = useState('');\n useDebounce(() => setDebouncedSearchQuery(searchQuery), 200, [searchQuery]);\n\n const [sortDirection, setSortDirection] = useState>({});\n const [folderFilter, setFolderFilter] = useState(currentFolderId ? [String(currentFolderId)] : []);\n const [panelFilter, setPanelFilter] = useState([]);\n\n const sortOrFiltersVisible = showSort || showPanelFilter || showFolderFilter;\n const verticalGroupSpacing = variant === LibraryPanelsSearchVariant.Tight ? 'lg' : 'xs';\n\n return (\n
\n \n
\n
\n \n
\n {sortOrFiltersVisible && (\n \n )}\n
\n\n
\n \n
\n
\n
\n );\n};\n\nfunction getStyles(theme: GrafanaTheme2, variant: LibraryPanelsSearchVariant) {\n const tightLayout = css`\n flex-direction: row;\n row-gap: ${theme.spacing(1)};\n `;\n return {\n filterInputWrapper: css`\n flex-grow: ${variant === LibraryPanelsSearchVariant.Tight ? 1 : 'initial'};\n `,\n container: css`\n width: 100%;\n overflow-y: auto;\n padding: ${theme.spacing(1)};\n `,\n libraryPanelsView: css`\n width: 100%;\n `,\n gridContainer: css`\n ${variant === LibraryPanelsSearchVariant.Tight ? tightLayout : ''};\n display: flex;\n flex-direction: column;\n width: 100%;\n column-gap: ${theme.spacing(1)};\n row-gap: ${theme.spacing(1)};\n padding-bottom: ${theme.spacing(2)};\n `,\n };\n}\n\ninterface SearchControlsProps {\n showSort: boolean;\n showPanelFilter: boolean;\n showFolderFilter: boolean;\n sortDirection?: string;\n onSortChange: (sortValue: SelectableValue) => void;\n onFolderFilterChange: (folder: string[]) => void;\n onPanelFilterChange: (plugins: string[]) => void;\n variant?: LibraryPanelsSearchVariant;\n}\n\nconst SearchControls = React.memo(\n ({\n variant = LibraryPanelsSearchVariant.Spacious,\n showSort,\n showPanelFilter,\n showFolderFilter,\n sortDirection,\n onSortChange,\n onFolderFilterChange,\n onPanelFilterChange,\n }: SearchControlsProps) => {\n const styles = useStyles2(useCallback((theme) => getRowStyles(theme, variant), [variant]));\n const panelFilterChanged = useCallback(\n (plugins: PanelPluginMeta[]) => onPanelFilterChange(plugins.map((p) => p.id)),\n [onPanelFilterChange]\n );\n const folderFilterChanged = useCallback(\n (folders: FolderInfo[]) => onFolderFilterChange(folders.map((f) => String(f.id))),\n [onFolderFilterChange]\n );\n\n return (\n
\n {showSort && }\n {(showFolderFilter || showPanelFilter) && (\n
\n {showFolderFilter && }\n {showPanelFilter && }\n
\n )}\n
\n );\n }\n);\nSearchControls.displayName = 'SearchControls';\n\nfunction getRowStyles(theme: GrafanaTheme2, variant = LibraryPanelsSearchVariant.Spacious) {\n const searchRowContainer = css`\n display: flex;\n gap: ${theme.spacing(1)};\n flex-grow: 1;\n flex-direction: row;\n justify-content: end;\n `;\n const searchRowContainerTight = css`\n ${searchRowContainer};\n flex-grow: initial;\n flex-direction: column;\n justify-content: normal;\n `;\n const filterContainer = css`\n display: flex;\n flex-direction: row;\n margin-left: auto;\n gap: 4px;\n `;\n const filterContainerTight = css`\n ${filterContainer};\n flex-direction: column;\n margin-left: initial;\n `;\n\n switch (variant) {\n case LibraryPanelsSearchVariant.Spacious:\n return {\n container: searchRowContainer,\n filterContainer: filterContainer,\n };\n case LibraryPanelsSearchVariant.Tight:\n return {\n container: searchRowContainerTight,\n filterContainer: filterContainerTight,\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 isDisabled = disabled || plugin.state === PluginState.deprecated;\n const cssClass = cx({\n [styles.item]: true,\n [styles.itemDisabled]: isDisabled,\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 itemDisabled: css`\n cursor: default;\n\n &,\n &:hover {\n background: ${theme.colors.action.disabledBackground};\n }\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: ${theme.colors.action.disabledOpacity};\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 cursor: pointer;\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","filter","styles","useStyles2","getStyles","selectOptions","defaultOptions","getOptionLabel","i","getOptionValue","noOptionsMessage","placeholder","className","container","length","size","icon","fill","clear","onClick","prefix","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","Button","variant","disabled","modalText","suffix","message","textInfo","myTable","LibraryPanelCard","onDelete","showSecondaryActions","showDeletionModal","setShowDeletionModal","panelPlugin","config","model","type","getPanelPluginNotFound","meta","PanelTypeCard","isCurrent","description","plugin","undefined","FolderLink","folderUid","folderName","metaContainer","Link","href","Icon","colors","text","secondary","typography","bodySmall","fontSize","FolderFilter","loading","setLoading","getOptions","searchString","params","query","DashboardSearchItemType","permission","PermissionLevelString","getBackendSrv","search","id","includes","toLowerCase","unshift","getFoldersAsOptions","debouncedLoadOptions","debounce","onSelectOptionChange","folders","changedFolderIds","f","isLoading","loadOptions","LibraryPanelsSearchVariant","LibraryPanelsSearch","Spacious","currentPanelId","currentFolderId","perPage","DEFAULT_PER_PAGE_PAGINATION","showPanelFilter","showFolderFilter","showSort","tightLayout","filterInputWrapper","Tight","libraryPanelsView","gridContainer","searchQuery","setSearchQuery","debouncedSearchQuery","setDebouncedSearchQuery","useDebounce","sortDirection","setSortDirection","folderFilter","setFolderFilter","String","panelFilter","setPanelFilter","sortOrFiltersVisible","verticalGroupSpacing","FilterInput","width","escapeRegex","SearchControls","onSortChange","onFolderFilterChange","onPanelFilterChange","LibraryPanelsView","onClickCard","React","searchRowContainer","searchRowContainerTight","filterContainer","filterContainerTight","getRowStyles","panelFilterChanged","folderFilterChanged","SortPicker","displayName","currentPanel","propsPerPage","getPanelViewStyles","libraryPanels","page","numberOfPages","libraryPanelsViewReducer","initialLibraryPanelsViewState","searchForLibraryPanels","deleteLibraryPanel","cx","libraryPanelList","noPanelsFound","item","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","isDisabled","PluginState","cssClass","itemDisabled","current","selectors","img","src","alt","itemContent","badge","PanelPluginBadge","stopPropagation","deleteButton","background","shape","borderRadius","shadows","z1","transitions","create","duration","short","emphasize","disabledBackground","primary","selected","disabledOpacity","fontWeightMedium","fontWeightLight","isUnsignedPluginSignature","signature","status","allPanels","Object","keys","key","filterPluginList","pluginsList","unEscapeStringFromRegex","first","isGraphQuery","startsWith","idx","indexOf","push","concat","PluginStateInfo","props","display","color","tooltip","getFeatureStateInfo"],"sourceRoot":""}