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AChBA,EAAM,OAAO,OAAO;AAAA,oBAC1BA,EAAM,OAAO,WAAW;AAAA,eAC7BA,EAAM,OAAO,KAAK;AAAA,mBACdA,EAAM,WAAW,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,qBAKlBA,EAAM,WAAW,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAM9BA,EAAM,QAAQ,CAAC;AAAA;AAAA;AAAA;AAAA,sBAIXA,EAAM,OAAO,WAAW;AAAA;AAAA,MAG1C,eAAa;AAAA,uBACMA,EAAM,QAAQ,CAAC;AAAA,MAElC,YAAU;AAAA,eACCA,EAAM,OAAO,KAAK;AAAA,mBACdA,EAAM,WAAW,KAAK;AAAA,MAErC,mBAAiB;AAAA,oBACDA,EAAM,QAAQ,CAAC;AAAA,MAE/B,SAAO;AAAA;AAAA,MAGP,aAAW;AAAA,mBACIA,EAAM,WAAW,GAAG;AAAA,eACxBA,EAAM,OAAO,KAAK;AAAA,uBACVA,EAAM,QAAQ,CAAC;AAAA,qBACjBA,EAAM,QAAQ,CAAC;AAAA,KAElC,CACF,C","sources":["webpack://grafana/./public/app/core/components/PanelTypeFilter/PanelTypeFilter.tsx","webpack://grafana/./public/app/core/components/Select/SortPicker.tsx","webpack://grafana/./public/app/features/library-panels/components/DeleteLibraryPanelModal/reducer.ts","webpack://grafana/./public/app/features/library-panels/components/DeleteLibraryPanelModal/actions.ts","webpack://grafana/./public/app/features/library-panels/components/DeleteLibraryPanelModal/DeleteLibraryPanelModal.tsx","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"],"sourcesContent":["import { css } from '@emotion/css';\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport { GrafanaTheme2, PanelPluginMeta, SelectableValue } from '@grafana/data';\nimport { config } from '@grafana/runtime';\nimport { Icon, Button, MultiSelect, useStyles2 } from '@grafana/ui';\nimport { getAllPanelPluginMeta, getVizPluginMeta, getWidgetPluginMeta } from 'app/features/panel/state/util';\n\nexport interface Props {\n onChange: (plugins: PanelPluginMeta[]) => void;\n maxMenuHeight?: number;\n isWidget?: boolean;\n}\n\nexport const PanelTypeFilter = ({ onChange: propsOnChange, maxMenuHeight, isWidget = false }: Props): JSX.Element => {\n const getPluginMetaData = (): PanelPluginMeta[] => {\n if (config.featureToggles.vizAndWidgetSplit) {\n return isWidget ? getWidgetPluginMeta() : getVizPluginMeta();\n } else {\n return getAllPanelPluginMeta();\n }\n };\n\n const plugins = useMemo(getPluginMetaData, [isWidget]);\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: SelectableValue) => i.label,\n getOptionValue: (i: SelectableValue) => 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 {...selectOptions} prefix={} 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 React from 'react';\nimport { useAsync } from 'react-use';\n\nimport { SelectableValue } from '@grafana/data';\nimport { Icon, Select } from '@grafana/ui';\nimport { DEFAULT_SORT } from 'app/features/search/constants';\nimport { getGrafanaSearcher } from 'app/features/search/service';\n\nexport interface Props {\n onChange: (sortValue: SelectableValue) => void;\n value?: string;\n placeholder?: string;\n getSortOptions?: () => Promise;\n filter?: string[];\n isClearable?: boolean;\n}\n\nconst defaultSortOptionsGetter = (): Promise => {\n return getGrafanaSearcher().getSortOptions();\n};\n\nexport function SortPicker({ onChange, value, placeholder, filter, getSortOptions, isClearable }: Props) {\n // Using sync Select and manual options fetching here since we need to find the selected option by value\n const options = useAsync<() => Promise>(async () => {\n const vals = await (getSortOptions ?? defaultSortOptionsGetter)();\n if (filter) {\n return vals.filter((v) => filter.includes(v.value));\n }\n return vals;\n }, [getSortOptions, filter]);\n\n if (options.loading) {\n return null;\n }\n\n const isDesc = Boolean(value?.includes('desc') || value?.startsWith('-')); // bluge syntax starts with \"-\"\n return (\n opt.value === value) ?? null}\n options={options.value}\n aria-label=\"Sort\"\n placeholder={placeholder ?? `Sort (Default ${DEFAULT_SORT.label})`}\n prefix={}\n isClearable={isClearable}\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 { 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 React, { FC, useEffect, useMemo, useReducer } from 'react';\n\nimport { LoadingState } from '@grafana/data';\nimport { Button, Modal, useStyles2 } 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 = useStyles2(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 = () => Loading library panel...;\n\nconst Confirm = () => {\n const styles = useStyles2(getModalStyles);\n\n return
Do you want to delete this panel?
;\n};\n\nconst HasConnectedDashboards: FC<{ dashboardTitles: string[] }> = ({ dashboardTitles }) => {\n const styles = useStyles2(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 { css } from '@emotion/css';\nimport React, { ReactElement, useState } from 'react';\nimport Skeleton from 'react-loading-skeleton';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { config } from '@grafana/runtime';\nimport { Icon, Link, useStyles2 } from '@grafana/ui';\nimport { SkeletonComponent, attachSkeleton } from '@grafana/ui/src/unstable';\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\ntype Props = LibraryPanelCardProps & { children?: JSX.Element | JSX.Element[] };\n\nconst LibraryPanelCardComponent = ({ libraryPanel, onClick, onDelete, showSecondaryActions }: Props) => {\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\nconst LibraryPanelCardSkeleton: SkeletonComponent> = ({\n showSecondaryActions,\n rootProps,\n}) => {\n const styles = useStyles2(getStyles);\n\n return (\n \n \n \n );\n};\n\nexport const LibraryPanelCard = attachSkeleton(LibraryPanelCardComponent, LibraryPanelCardSkeleton);\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 alignItems: 'center',\n color: theme.colors.text.secondary,\n fontSize: theme.typography.bodySmall.fontSize,\n paddingTop: theme.spacing(0.5),\n\n svg: {\n marginRight: theme.spacing(0.5),\n marginBottom: 3,\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 { 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 = await getBackendSrv().search(params);\n const options = searchHits.map((d) => ({ label: d.title, value: { uid: d.uid, title: d.title } }));\n if (!searchString || 'general'.includes(searchString.toLowerCase())) {\n options.unshift({ label: 'General', value: { uid: 'general', 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 minWidth: '180px',\n flexGrow: 1,\n }),\n clear: css({\n label: 'clear',\n fontSize: 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 currentFolderUID?: string;\n perPage?: number;\n}\n\nexport const LibraryPanelsSearch = ({\n onClick,\n variant = LibraryPanelsSearchVariant.Spacious,\n currentPanelId,\n currentFolderUID,\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, 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(currentFolderUID ? [currentFolderUID] : []);\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(getRowStyles, 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) => f.uid ?? '')),\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 } from '@emotion/css';\nimport React, { useMemo, useReducer } from 'react';\nimport { useDebounce } from 'react-use';\n\nimport { GrafanaTheme2, LoadingState } from '@grafana/data';\nimport { Pagination, Stack, useStyles2 } 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 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 isWidget?: boolean;\n}\n\nexport const LibraryPanelsView = ({\n onClickCard,\n searchString,\n sortDirection,\n panelFilter,\n folderFilter,\n showSecondaryActions,\n currentPanelId: currentPanel,\n perPage: propsPerPage = 40,\n isWidget,\n}: LibraryPanelViewProps) => {\n const styles = useStyles2(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 folderFilterUIDs: folderFilter,\n page,\n perPage,\n currentPanelId,\n isWidget,\n })\n ),\n 300,\n [searchString, sortDirection, panelFilter, folderFilter, page, asyncDispatch]\n );\n const onDelete = ({ uid }: LibraryElementDTO) =>\n asyncDispatch(\n deleteLibraryPanel(uid, {\n searchString,\n sortDirection,\n panelFilter,\n folderFilterUIDs: folderFilter,\n page,\n perPage,\n })\n );\n const onPageChange = (page: number) => asyncDispatch(changePage({ page }));\n\n return (\n \n {loadingState === LoadingState.Loading ? (\n <>\n \n \n \n \n ) : libraryPanels.length < 1 ? (\n

No library panels found.

\n ) : (\n libraryPanels?.map((item, i) => (\n \n ))\n )}\n {libraryPanels.length ? (\n
\n \n
\n ) : null}\n
\n );\n};\n\nconst getPanelViewStyles = (theme: GrafanaTheme2) => {\n return {\n pagination: css({\n alignSelf: 'center',\n marginTop: theme.spacing(1),\n }),\n noPanelsFound: css({\n label: 'noPanelsFound',\n minHeight: 200,\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 { PanelPluginMeta } from '@grafana/data';\nimport { config } from '@grafana/runtime';\nimport { LibraryPanel } from '@grafana/schema';\nimport { getAllPanelPluginMeta } from 'app/features/panel/state/util';\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 folderFilterUIDs?: string[];\n currentPanelId?: string;\n isWidget?: boolean;\n}\n\nexport function searchForLibraryPanels(args: SearchArgs): DispatchResult {\n // Functions to support filtering out library panels per plugin type that have skipDataQuery set to true\n\n const findPluginMeta = (pluginMeta: PanelPluginMeta, libraryPanel: LibraryPanel) =>\n pluginMeta.id === libraryPanel.type;\n\n const filterLibraryPanels = (libraryPanels: LibraryPanel[], isWidget: boolean) => {\n const pluginMetaList = getAllPanelPluginMeta();\n\n return libraryPanels.filter((libraryPanel) => {\n const matchingPluginMeta = pluginMetaList.find((pluginMeta) => findPluginMeta(pluginMeta, libraryPanel));\n // widget mode filter\n if (isWidget) {\n return !!matchingPluginMeta?.skipDataQuery;\n }\n // non-widget mode filter\n return !matchingPluginMeta?.skipDataQuery;\n });\n };\n\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 folderFilterUIDs: args.folderFilterUIDs,\n })\n ).pipe(\n //filter out library panels per plugin type that have skipDataQuery set to true\n mergeMap((libraryPanelsResult) => {\n const { elements: libraryPanels } = libraryPanelsResult;\n\n if (config.featureToggles.vizAndWidgetSplit && args.isWidget !== undefined) {\n const filteredLibraryPanels = filterLibraryPanels(libraryPanels, args.isWidget);\n return of({ ...libraryPanelsResult, elements: filteredLibraryPanels });\n }\n\n return of({ ...libraryPanelsResult, elements: libraryPanels });\n }),\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 { GrafanaTheme2 } from '@grafana/data';\n\nexport function getModalStyles(theme: GrafanaTheme2) {\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.shape.radius.default};\n border: 1px solid ${theme.colors.action.hover};\n background: ${theme.colors.background.primary};\n color: ${theme.colors.text.secondary};\n font-size: ${theme.typography.h6.fontSize};\n width: 100%;\n\n thead {\n color: #538ade;\n font-size: ${theme.typography.bodySmall.fontSize};\n }\n\n th,\n td {\n padding: 6px 13px;\n height: ${theme.spacing(4)};\n }\n\n tbody > tr:nth-child(odd) {\n background: ${theme.colors.background.secondary};\n }\n `,\n noteTextbox: css`\n margin-bottom: ${theme.spacing(4)};\n `,\n textInfo: css`\n color: ${theme.colors.text.secondary};\n font-size: ${theme.typography.size.sm};\n `,\n dashboardSearch: css`\n margin-top: ${theme.spacing(2)};\n `,\n modal: css`\n width: 500px;\n `,\n modalText: css`\n font-size: ${theme.typography.h4.fontSize};\n color: ${theme.colors.text.primary};\n margin-bottom: ${theme.spacing(4)};\n padding-top: ${theme.spacing(2)};\n `,\n };\n}\n"],"names":["PanelTypeFilter","propsOnChange","maxMenuHeight","isWidget","getPluginMetaData","plugins","options","p","a","b","value","setValue","onChange","changedPlugins","styles","getStyles","selectOptions","i","theme","defaultSortOptionsGetter","SortPicker","placeholder","filter","getSortOptions","isClearable","vals","v","isDesc","opt","initialDeleteLibraryPanelModalState","searchCompleted","deleteLibraryPanelModalReducer","state","action","d","getConnectedDashboards","libraryPanel","dispatch","dashboards","api","DeleteLibraryPanelModal","onDismiss","onConfirm","dashboardTitles","loadingState","asyncDispatch","connected","done","Modal","LoadingIndicator","HasConnectedDashboards","Confirm","Button","suffix","message","title","LibraryPanelCardComponent","onClick","onDelete","showSecondaryActions","showDeletionModal","setShowDeletionModal","onDeletePanel","panelPlugin","config","PanelTypeCard","FolderLink","LibraryPanelCardSkeleton","rootProps","LibraryPanelCard","Link","Icon","FolderFilter","loading","setLoading","getOptions","searchString","getFoldersAsOptions","debouncedLoadOptions","onSelectOptionChange","folders","changedFolderIds","f","params","LibraryPanelsSearchVariant","LibraryPanelsSearch","variant","currentPanelId","currentFolderUID","perPage","showPanelFilter","showFolderFilter","showSort","searchQuery","setSearchQuery","debouncedSearchQuery","setDebouncedSearchQuery","useDebounce","sortDirection","setSortDirection","folderFilter","setFolderFilter","panelFilter","setPanelFilter","sortOrFiltersVisible","verticalGroupSpacing","FilterInput","SearchControls","LibraryPanelsView","tightLayout","onSortChange","onFolderFilterChange","onPanelFilterChange","getRowStyles","panelFilterChanged","folderFilterChanged","searchRowContainer","searchRowContainerTight","filterContainer","filterContainerTight","onClickCard","currentPanel","propsPerPage","getPanelViewStyles","libraryPanels","page","numberOfPages","uid","onPageChange","item","searchForLibraryPanels","args","findPluginMeta","pluginMeta","filterLibraryPanels","pluginMetaList","matchingPluginMeta","subscription","dataObservable","libraryPanelsResult","filteredLibraryPanels","totalCount","err","deleteLibraryPanel","e","asyncDispatcher","initialLibraryPanelsViewState","initSearch","changePage","libraryPanelsViewReducer","getModalStyles"],"sourceRoot":""}