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Q,YAAac,EAAAA,GAAI;;;;eAIND,EAAME,OAAOC,KAAKC;mBACdJ,EAAMK,WAAWC,UAAUC;qBACzBP,EAAMK,WAAW6P;;;MAIlCxB,IAAKzO,EAAAA,GAAI;;;;;MAMT+O,MAAO/O,EAAAA,GAAI;oBACKD,EAAME,OAAOmP,WAAWU;MAExCX,aAAcnP,EAAAA,GAAI;;QAUhBgP,EAAoD,IAAgB,IAAf,OAAE7P,GAAa,EACxE,OAAI+Q,EAAAA,EAAAA,2BAA0B/Q,EAAOgR,YAC5B,SAAC,EAAAC,qBAAD,CAAsBC,OAAQlR,EAAOgR,aAGvC,SAAC,IAAD,CAAiBhV,MAAOgE,EAAOhE,SAGxC6T,EAAiB7D,YAAc,oB,+ECpJxB,MAAMmF,EAA8BpG,IACzC,MAAMqG,EASR,SAA6BpV,GAC3B,OAAQA,GACN,KAAKqT,EAAAA,YAAAA,WACH,MAAO,CACLtO,KAAM,aACNsQ,MAAO,MACPC,QAAU,sEAEd,KAAKjC,EAAAA,YAAAA,MACH,MAAO,CACLtO,KAAM,QACNsQ,MAAO,OACPC,QAAU,oFAEd,KAAKjC,EAAAA,YAAAA,KACH,MAAO,CACLtO,KAAM,OACNsQ,MAAO,OACPC,QAAU,0DAEd,QACE,OAAO,MA9BKC,CAAoBxG,EAAM/O,OAE1C,OAAKoV,GAIE,SAAC,EAAAI,MAAD,CAAOH,MAAOD,EAAQC,MAAO9U,MAAO6U,EAAQE,QAASvQ,KAAMqQ,EAAQrQ,KAAM/C,KAAMoT,EAAQpT,OAHrF","sources":["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/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/manage-dashboards/utils/validation.ts","webpack://grafana/./public/app/features/manage-dashboards/components/ImportDashboardLibraryPanelsList.tsx","webpack://grafana/./public/app/features/manage-dashboards/components/ImportDashboardForm.tsx","webpack://grafana/./public/app/features/manage-dashboards/components/ImportDashboardOverview.tsx","webpack://grafana/./public/app/features/manage-dashboards/DashboardImportPage.tsx","webpack://grafana/./public/app/features/panel/components/VizTypePicker/PanelTypeCard.tsx","webpack://grafana/./public/app/features/plugins/components/PluginStateInfo.tsx"],"sourcesContent":["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 { 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 { getBackendSrv } from '@grafana/runtime';\n\nimport { validationSrv } from '../services/ValidationSrv';\n\nexport const validateDashboardJson = (json: string) => {\n try {\n JSON.parse(json);\n return true;\n } catch (error) {\n return 'Not valid JSON';\n }\n};\n\nexport const validateGcomDashboard = (gcomDashboard: string) => {\n // From DashboardImportCtrl\n const match = /(^\\d+$)|dashboards\\/(\\d+)/.exec(gcomDashboard);\n\n return match && (match[1] || match[2]) ? true : 'Could not find a valid Grafana.com ID';\n};\n\nexport const validateTitle = (newTitle: string, folderId: number) => {\n return validationSrv\n .validateNewDashboardName(folderId, newTitle)\n .then(() => {\n return true;\n })\n .catch((error) => {\n if (error.type === 'EXISTING') {\n return error.message;\n }\n });\n};\n\nexport const validateUid = (value: string) => {\n return getBackendSrv()\n .get(`/api/dashboards/uid/${value}`)\n .then((existingDashboard) => {\n return `Dashboard named '${existingDashboard?.dashboard.title}' in folder '${existingDashboard?.meta.folderTitle}' has the same UID`;\n })\n .catch((error) => {\n error.isHandled = true;\n return true;\n });\n};\n","import { css } from '@emotion/css';\nimport React, { ReactElement } from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { Field, useStyles2 } from '@grafana/ui';\n\nimport { LibraryPanelCard } from '../../library-panels/components/LibraryPanelCard/LibraryPanelCard';\nimport { LibraryPanelInput, LibraryPanelInputState } from '../state/reducers';\n\ninterface ImportDashboardLibraryPanelsListProps {\n inputs: LibraryPanelInput[];\n label: string;\n description: string;\n folderName?: string;\n}\n\nexport function ImportDashboardLibraryPanelsList({\n inputs,\n label,\n description,\n folderName,\n}: ImportDashboardLibraryPanelsListProps): ReactElement | null {\n const styles = useStyles2(getStyles);\n\n if (!Boolean(inputs?.length)) {\n return null;\n }\n\n return (\n
\n \n <>\n {inputs.map((input, index) => {\n const libraryPanelIndex = `elements[${index}]`;\n const libraryPanel =\n input.state === LibraryPanelInputState.New\n ? { ...input.model, meta: { ...input.model.meta, folderName: folderName ?? 'General' } }\n : { ...input.model };\n return (\n
\n undefined} />\n
\n );\n })}\n \n
\n
\n );\n}\n\nfunction getStyles(theme: GrafanaTheme2) {\n return {\n spacer: css`\n margin-bottom: ${theme.spacing(2)};\n `,\n item: css`\n margin-bottom: ${theme.spacing(1)};\n `,\n };\n}\n","import React, { FC, useEffect, useState } from 'react';\n\nimport { selectors } from '@grafana/e2e-selectors';\nimport { DataSourcePicker } from '@grafana/runtime';\nimport { ExpressionDatasourceRef } from '@grafana/runtime/src/utils/DataSourceWithBackend';\nimport {\n Button,\n Field,\n FormAPI,\n FormFieldErrors,\n FormsOnSubmit,\n HorizontalGroup,\n Input,\n InputControl,\n Legend,\n} from '@grafana/ui';\nimport { FolderPicker } from 'app/core/components/Select/FolderPicker';\n\nimport {\n DashboardInput,\n DashboardInputs,\n DataSourceInput,\n ImportDashboardDTO,\n LibraryPanelInputState,\n} from '../state/reducers';\nimport { validateTitle, validateUid } from '../utils/validation';\n\nimport { ImportDashboardLibraryPanelsList } from './ImportDashboardLibraryPanelsList';\n\ninterface Props extends Pick, 'register' | 'errors' | 'control' | 'getValues' | 'watch'> {\n uidReset: boolean;\n inputs: DashboardInputs;\n initialFolderId: number;\n\n onCancel: () => void;\n onUidReset: () => void;\n onSubmit: FormsOnSubmit;\n}\n\nexport const ImportDashboardForm: FC = ({\n register,\n errors,\n control,\n getValues,\n uidReset,\n inputs,\n initialFolderId,\n onUidReset,\n onCancel,\n onSubmit,\n watch,\n}) => {\n const [isSubmitted, setSubmitted] = useState(false);\n const watchDataSources = watch('dataSources');\n const watchFolder = watch('folder');\n\n /*\n This useEffect is needed for overwriting a dashboard. It\n submits the form even if there's validation errors on title or uid.\n */\n useEffect(() => {\n if (isSubmitted && (errors.title || errors.uid)) {\n onSubmit(getValues(), {} as any);\n }\n }, [errors, getValues, isSubmitted, onSubmit]);\n const newLibraryPanels = inputs?.libraryPanels?.filter((i) => i.state === LibraryPanelInputState.New) ?? [];\n const existingLibraryPanels = inputs?.libraryPanels?.filter((i) => i.state === LibraryPanelInputState.Exists) ?? [];\n\n return (\n <>\n Options\n \n await validateTitle(v, getValues().folder.id),\n })}\n type=\"text\"\n data-testid={selectors.components.ImportDashboardForm.name}\n />\n \n \n (\n \n )}\n name=\"folder\"\n control={control}\n />\n \n \n <>\n {!uidReset ? (\n await validateUid(v) })}\n addonAfter={!uidReset && }\n />\n ) : (\n await validateUid(v) })} />\n )}\n \n \n {inputs.dataSources &&\n inputs.dataSources.map((input: DataSourceInput, index: number) => {\n if (input.pluginId === ExpressionDatasourceRef.type) {\n return null;\n }\n const dataSourceOption = `dataSources[${index}]`;\n const current = watchDataSources ?? [];\n return (\n \n (\n \n )}\n control={control}\n rules={{ required: true }}\n />\n \n );\n })}\n {inputs.constants &&\n inputs.constants.map((input: DashboardInput, index) => {\n const constantIndex = `constants[${index}]`;\n return (\n \n \n \n );\n })}\n \n \n \n {\n setSubmitted(true);\n }}\n >\n {getButtonText(errors)}\n \n \n \n \n );\n};\n\nfunction getButtonVariant(errors: FormFieldErrors) {\n return errors && (errors.title || errors.uid) ? 'destructive' : 'primary';\n}\n\nfunction getButtonText(errors: FormFieldErrors) {\n return errors && (errors.title || errors.uid) ? 'Import (Overwrite)' : 'Import';\n}\n","import React, { PureComponent } from 'react';\nimport { connect, ConnectedProps } from 'react-redux';\n\nimport { dateTimeFormat } from '@grafana/data';\nimport { locationService, reportInteraction } from '@grafana/runtime';\nimport { Form, Legend } from '@grafana/ui';\nimport { StoreState } from 'app/types';\n\nimport { clearLoadedDashboard, importDashboard } from '../state/actions';\nimport { DashboardSource, ImportDashboardDTO } from '../state/reducers';\n\nimport { ImportDashboardForm } from './ImportDashboardForm';\n\nconst IMPORT_FINISHED_EVENT_NAME = 'dashboard_import_imported';\n\nconst mapStateToProps = (state: StoreState) => {\n const searchObj = locationService.getSearchObject();\n\n return {\n dashboard: state.importDashboard.dashboard,\n meta: state.importDashboard.meta,\n source: state.importDashboard.source,\n inputs: state.importDashboard.inputs,\n folder: searchObj.folderId ? { id: Number(searchObj.folderId) } : { id: 0 },\n };\n};\n\nconst mapDispatchToProps = {\n clearLoadedDashboard,\n importDashboard,\n};\n\nconst connector = connect(mapStateToProps, mapDispatchToProps);\n\ntype Props = ConnectedProps;\n\ninterface State {\n uidReset: boolean;\n}\n\nclass ImportDashboardOverviewUnConnected extends PureComponent {\n state: State = {\n uidReset: false,\n };\n\n onSubmit = (form: ImportDashboardDTO) => {\n reportInteraction(IMPORT_FINISHED_EVENT_NAME);\n\n this.props.importDashboard(form);\n };\n\n onCancel = () => {\n this.props.clearLoadedDashboard();\n };\n\n onUidReset = () => {\n this.setState({ uidReset: true });\n };\n\n render() {\n const { dashboard, inputs, meta, source, folder } = this.props;\n const { uidReset } = this.state;\n\n return (\n <>\n {source === DashboardSource.Gcom && (\n
\n
\n \n Importing dashboard from{' '}\n \n Grafana.com\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n
Published by{meta.orgName}
Updated on{dateTimeFormat(meta.updatedAt)}
\n
\n )}\n \n {({ register, errors, control, watch, getValues }) => (\n \n )}\n \n \n );\n }\n}\n\nexport const ImportDashboardOverview = connector(ImportDashboardOverviewUnConnected);\nImportDashboardOverview.displayName = 'ImportDashboardOverview';\n","import { css } from '@emotion/css';\nimport React, { FormEvent, PureComponent } from 'react';\nimport { connect, ConnectedProps } from 'react-redux';\n\nimport { AppEvents, GrafanaTheme2, LoadingState } from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { reportInteraction } from '@grafana/runtime';\nimport {\n Button,\n Field,\n FileUpload,\n Form,\n HorizontalGroup,\n Input,\n Spinner,\n stylesFactory,\n TextArea,\n Themeable2,\n VerticalGroup,\n withTheme2,\n} from '@grafana/ui';\nimport appEvents from 'app/core/app_events';\nimport Page from 'app/core/components/Page/Page';\nimport { GrafanaRouteComponentProps } from 'app/core/navigation/types';\nimport { getNavModel } from 'app/core/selectors/navModel';\nimport { StoreState } from 'app/types';\n\nimport { cleanUpAction } from '../../core/actions/cleanUp';\n\nimport { ImportDashboardOverview } from './components/ImportDashboardOverview';\nimport { fetchGcomDashboard, importDashboardJson } from './state/actions';\nimport { validateDashboardJson, validateGcomDashboard } from './utils/validation';\n\ntype DashboardImportPageRouteSearchParams = {\n gcomDashboardId?: string;\n};\n\ntype OwnProps = Themeable2 & GrafanaRouteComponentProps<{}, DashboardImportPageRouteSearchParams>;\n\nconst IMPORT_STARTED_EVENT_NAME = 'dashboard_import_loaded';\n\nconst mapStateToProps = (state: StoreState) => ({\n navModel: getNavModel(state.navIndex, 'import', undefined, true),\n loadingState: state.importDashboard.state,\n});\n\nconst mapDispatchToProps = {\n fetchGcomDashboard,\n importDashboardJson,\n cleanUpAction,\n};\n\nconst connector = connect(mapStateToProps, mapDispatchToProps);\n\ntype Props = OwnProps & ConnectedProps;\n\nclass UnthemedDashboardImport extends PureComponent {\n constructor(props: Props) {\n super(props);\n const { gcomDashboardId } = this.props.queryParams;\n if (gcomDashboardId) {\n this.getGcomDashboard({ gcomDashboard: gcomDashboardId });\n return;\n }\n }\n\n componentWillUnmount() {\n this.props.cleanUpAction({ stateSelector: (state: StoreState) => state.importDashboard });\n }\n\n onFileUpload = (event: FormEvent) => {\n reportInteraction(IMPORT_STARTED_EVENT_NAME, {\n import_source: 'json_uploaded',\n });\n\n const { importDashboardJson } = this.props;\n const file = event.currentTarget.files && event.currentTarget.files.length > 0 && event.currentTarget.files[0];\n\n if (file) {\n const reader = new FileReader();\n const readerOnLoad = () => {\n return (e: any) => {\n let dashboard: any;\n try {\n dashboard = JSON.parse(e.target.result);\n } catch (error) {\n appEvents.emit(AppEvents.alertError, [\n 'Import failed',\n 'JSON -> JS Serialization failed: ' + error.message,\n ]);\n return;\n }\n importDashboardJson(dashboard);\n };\n };\n reader.onload = readerOnLoad();\n reader.readAsText(file);\n }\n };\n\n getDashboardFromJson = (formData: { dashboardJson: string }) => {\n reportInteraction(IMPORT_STARTED_EVENT_NAME, {\n import_source: 'json_pasted',\n });\n\n this.props.importDashboardJson(JSON.parse(formData.dashboardJson));\n };\n\n getGcomDashboard = (formData: { gcomDashboard: string }) => {\n reportInteraction(IMPORT_STARTED_EVENT_NAME, {\n import_source: 'gcom',\n });\n\n let dashboardId;\n const match = /(^\\d+$)|dashboards\\/(\\d+)/.exec(formData.gcomDashboard);\n if (match && match[1]) {\n dashboardId = match[1];\n } else if (match && match[2]) {\n dashboardId = match[2];\n }\n\n if (dashboardId) {\n this.props.fetchGcomDashboard(dashboardId);\n }\n };\n\n renderImportForm() {\n const styles = importStyles(this.props.theme);\n\n return (\n <>\n
\n \n Upload JSON file\n \n
\n
\n
\n {({ register, errors }) => (\n \n Load}\n />\n \n )}\n \n
\n
\n
\n {({ register, errors }) => (\n <>\n \n \n \n \n \n )}\n \n
\n \n );\n }\n\n render() {\n const { loadingState, navModel } = this.props;\n\n return (\n \n \n {loadingState === LoadingState.Loading && (\n \n \n \n \n \n )}\n {[LoadingState.Error, LoadingState.NotStarted].includes(loadingState) && this.renderImportForm()}\n {loadingState === LoadingState.Done && }\n \n \n );\n }\n}\n\nconst DashboardImportUnConnected = withTheme2(UnthemedDashboardImport);\nconst DashboardImport = connector(DashboardImportUnConnected);\nDashboardImport.displayName = 'DashboardImport';\nexport default DashboardImport;\n\nconst importStyles = stylesFactory((theme: GrafanaTheme2) => {\n return {\n option: css`\n margin-bottom: ${theme.spacing(4)};\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 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":["initialDeleteLibraryPanelModalState","loadingState","LoadingState","dashboardTitles","searchCompleted","createAction","deleteLibraryPanelModalReducer","state","action","match","payload","dashboards","map","d","title","DeleteLibraryPanelModal","libraryPanel","onDismiss","onConfirm","styles","useStyles","getModalStyles","dispatch","useReducer","asyncDispatch","useMemo","asyncDispatcher","useEffect","async","apiGetConnectedDashboards","uid","getConnectedDashboards","connected","Boolean","length","done","Modal","className","modal","icon","isOpen","LoadingIndicator","HasConnectedDashboards","Confirm","Button","variant","onClick","fill","disabled","modalText","suffix","message","textInfo","myTable","i","LibraryPanelCard","onDelete","showSecondaryActions","showDeletionModal","setShowDeletionModal","useState","panelPlugin","config","model","type","getPanelPluginNotFound","meta","PanelTypeCard","isCurrent","name","description","plugin","undefined","FolderLink","useStyles2","getStyles","folderUid","folderName","metaContainer","Link","href","Icon","size","theme","css","colors","text","secondary","typography","bodySmall","fontSize","spacing","searchForLibraryPanels","args","subscription","Subscription","dataObservable","from","getLibraryPanels","searchString","perPage","page","excludeUid","currentPanelId","sortDirection","typeFilter","panelFilter","folderFilter","pipe","mergeMap","elements","libraryPanels","totalCount","of","catchError","err","console","error","initialLibraryPanelsViewState","finalize","unsubscribe","share","add","merge","timer","mapTo","initSearch","takeUntil","subscribe","deleteLibraryPanel","apiDeleteLibraryPanel","e","Function","numberOfPages","changePage","libraryPanelsViewReducer","Math","ceil","border","radius","sm","bg3","bg1","textSemiWeak","md","xl","bg2","noteTextbox","dashboardSearch","heading","h4","link","validateDashboardJson","json","JSON","parse","validateGcomDashboard","gcomDashboard","exec","validateUid","value","getBackendSrv","get","then","existingDashboard","dashboard","folderTitle","catch","isHandled","ImportDashboardLibraryPanelsList","inputs","label","spacer","Field","input","index","libraryPanelIndex","LibraryPanelInputState","item","ImportDashboardForm","register","errors","control","getValues","uidReset","initialFolderId","onUidReset","onCancel","onSubmit","watch","isSubmitted","setSubmitted","watchDataSources","watchFolder","newLibraryPanels","filter","existingLibraryPanels","Legend","invalid","Input","required","validate","await","newTitle","v","folderId","folder","id","validationSrv","selectors","InputControl","render","field","FolderPicker","enableCreateNew","addonAfter","dataSources","pluginId","ExpressionDatasourceRef","dataSourceOption","current","DataSourcePicker","noDefault","placeholder","info","rules","constants","constantIndex","defaultValue","HorizontalGroup","getButtonVariant","getButtonText","mapDispatchToProps","clearLoadedDashboard","importDashboard","connector","connect","searchObj","locationService","source","Number","ImportDashboardOverviewUnConnected","PureComponent","form","reportInteraction","this","props","setState","DashboardSource","style","marginBottom","gnetId","target","rel","orgName","dateTimeFormat","updatedAt","Form","defaultValues","validateOnMount","validateFieldsOnMount","validateOn","ImportDashboardOverview","displayName","IMPORT_STARTED_EVENT_NAME","fetchGcomDashboard","importDashboardJson","cleanUpAction","navModel","getNavModel","navIndex","UnthemedDashboardImport","constructor","super","event","import_source","file","currentTarget","files","reader","FileReader","readerOnLoad","result","appEvents","AppEvents","onload","readAsText","formData","dashboardJson","dashboardId","gcomDashboardId","queryParams","getGcomDashboard","componentWillUnmount","stateSelector","renderImportForm","importStyles","option","FileUpload","accept","onFileUpload","getDashboardFromJson","TextArea","rows","Page","VerticalGroup","justify","Spinner","includes","DashboardImport","withTheme2","stylesFactory","showBadge","children","cssClass","cx","PluginState","img","src","logos","small","alt","itemContent","badge","PanelPluginBadge","IconButton","stopPropagation","deleteButton","background","shape","borderRadius","shadows","z1","transitions","create","duration","short","emphasize","primary","selected","fontWeightMedium","fontWeightLight","isUnsignedPluginSignature","signature","PluginSignatureBadge","status","PluginStateInfo","display","color","tooltip","getFeatureStateInfo","Badge"],"sourceRoot":""}