* added missing permissions check
* moved the permission check to the datasource component.
* added test for checking permissions.
* added tests with different permissions.
* minor refactoring so the mockUserPermisson can be reused.
* added post installation steps.
* changes according to feedback.
* removing return union null type.
* added tests.
* changing the wording of the button to 'create a..'
* updated tests to check for the updated copy.
* changing the back to be a regular back button.
* updated snapshot
* Initial pass to move panel state to it's own, and make it by key not panel.id
* Progress
* Not making much progress, having panel.key be mutable is causing a lot of issues
* Think this is starting to work
* Began fixing tests
* Add selector
* Bug fixes and changes to cleanup, and fixing all flicking when switching library panels
* Removed console.log
* fixes after merge
* fixing tests
* fixing tests
* Added new test for changePlugin thunk
* fix(pluginsettings): reject with error so datasource plugin loading failures still render ui
* feat(pluginpage): handle plugin loading error
* refactor(datasources): separate out datasource and meta loading so store has info for deletion
* fix(datasourcesettings): introduce loading flag to wait for datasource and meta loading
* test(datasourcesettings): fix failing test
* test(datasources): assert loading status of datasource settings
* test(datasources): update action tests for latest changes
* refactor(Plugins/Admin): add a "badge" for displaying available updates
* refactor(Plugins/Admin): rename component
* refactor(Plugins/Admin): use the PluginListItemBadges component
* chore(Plugins/Admin): make the Plugins Catalog the default way to interact with plugins
* chore(defaults.ini): change the default value for `plugin_admin_enabled`
* test(Plugins): make the tests pass
* working version but with duplications.
* refactor(Plugins/Admin): use "fr" instead of "repeat" for grid columns
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
* fix(Plugins/Admin): use PluginIconName instead of IconName
* refactor(Plugins/Admin): store the display-mode on the state
* refactor(Plugins/Admin): use && for conditional rendering
* refactor(Plugins/Admin): rename variable
* refactor(Plugins/Admin): share code between card and row components
* test(PluginListItemRow): add tests
* test(Plugins/Admin): add a simple test for the display-mode switching
* fix(Plugins/Admin): compose styles with css``
* refactor(Plugins/Admin): rename "table" to "grid" for display modes
* test(Plugins/Browse): follow up on renaming "table" to "grid"
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
* Expose FilterInput from grafana/ui
* Make table filter case insensitive
* Update packages/grafana-ui/src/components/Table/FilterList.tsx
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
* added possibility to track if remote plugins could be fetched.
* adding hook to detect if remote plugins are available.
* feat(catalog): disable installed/all filter if remote plugins are unavailable
* feat(Plugins/Admin): hide the install controls if GCOM is not available
* refactor(Plugins/Admin): group `@grafana` dependencies
* fix(Plugins/Admin): don't show an error alert if a remote plugin is not available
* feat(Plugins/Admin): prefer to use the local version of the readme
* chore(Plugins/Admin): type the mocked state properly
* test(Plugins/Admin): add tests for the Plugin Details when GCOM is not available
* test(Plugins/Admin): add tests for the Browse when GCOM is not available
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* feat(catalog): introduce id and href to PluginDetailsTabs
* feat(catalog): add hrefs and ids to PluginDetails tabs. Pass queryParams to PluginDetailsBody
* feat(catalog): pass queryParams to PluginsDetailsBody and add page param to PluginListCard
* fix(catalog): prevent flicker of content by waiting for fetch details to finish loading
* feat(catalog): add tab icons to PluginDetails page
* feat(catalog): make breadcrumbs in PluginDetailsHeader aware of page queryparam
* fix(catalog): fix deeplinking to PluginDetails by comparing tabs length
* test(catalog): update tests with correct props and wrap in router
* refactor(Plugins/Admin): add an extra line-break between tests
* test(Plugins/Admin): add a couple of more tests for Plugin Details
* fix(Plugins/Admin): fix accidental linting issue
* test(Plugins/Admin): add tests for the helper functions
* chore(Plugins/Admin): add `error` field to the CatalogPlugin mock
* test(Plugins/Admin): add new properties `error` & `isDisabled` to test expectations
* refactor(Plugins/Admin): make the `errors` param optional everywhere
* fix(Plugins/Admin): fix a rebase bug
* added errors in plugin list.
* added error to details page.
* adding badge on details page.
* added some more tests.
* Renamed to disabled and will handle the scenario in the plugin catalog.
* Update public/app/features/plugins/admin/components/PluginDetailsDisabledError.tsx
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* fixing some nits
* added missing isDisabeld to the mock.
* adding tests to verify scenarios when plugin is disabled.
* fixed issue with formatting after file changed on GH.
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* feat(Plugins/Admin): show a confirmation modal when uninstalling a plugin
* refactor(Plugins/Admin): use a helper function for showing/hiding the modal
* test(Plugins/Admin): test if the modal disappears after an uninstall
* refactor(Plugins/Admin): add a type for version coming back from the API
* refactor(Plugins/Admin): only add necessary version information to the state
* test(Plugins/Admin): add a mock for a CatalogPlugin
* test(Plugins/ADmin): add a mock for a LocalPlugin
* test(Plugins/Admin): add a test for a RemotePlugin
* test(Plugins/Admin): add helpers for mocking plugin states
* refactor(Plugins/Admin): mock the Redux state instead of the API responses
This makes it simpler to add new test cases and also makes
the tests easier to reason about.
* refactor(Plugins/Admin): mock the Redux state instead of the API responses
* feat(catalog): add update info to PluginListCard
* refactor(catalog): use IconName enum and minor styling changes to PluginHeaderDependencies
* fix(catalog): add a semver range to grafanaVersion for dependency checks in InstallControls
* fix(@grafana/data): add a missing optional field to the plugin types
* refactor(Plugins/ADmin): use the type from @grafana/data for plugin dependencies
* fix(Datasources/Graphite): add missing `state` to useEffect dependencies
* refactor(Plugins/Admin): remove unnecessary comment
* feat(Plugins/Admin): add plugin and grafana dependencies to the CatalogPluginDetails
* feat(Plugins/ADmin): show Grafana dependency under plugin details
* feat(Plugins/Admin): show grafana and plugin dependencies for a plugin
* test(Plugins/Admin): add a smoke test for plugin dependencies
* refactor(Plugins/Admin): remove unused style from the header
* feat(Plugins/Catalog): start adding necessary apis
* feat(PLugins/Catalog): add extra helpers for merging local & remote plugins
* feat(Plugins/Catalog): add plugin details as an optional field of CatalogPlugin
* feat(PLugins/Catalog): add scaffolding for the new redux model
* feat(PLugins/Catalog): export reducers based on a feature-flag
* refactor(Plugins/Admin): rename api methods
* feat(Plugin/Catalog): add an api method for fetching a single plugin
* feat(Plugins/Admin): try cleaning stuff around plugin fetching
* ffeat(Plugins/Catalog): return the catalog reducer when the feature flag is set
* refactor(Plugins/Admin): fix typings
* feat(Plugins/Admin): use the new reducer for the browse page
* feat(catalog): introduce selectors to search and filter plugins list
* refactor(Plugins/Details): rename page prop type
* refactor(Plugins/Admin): add a const for a state prefix
* refactor(Plugins/Admin): use the state prefix in the actions
* feat(Plugins/Admin): add types for the requests
* refactor(Plugins/Admin): add request info to the reducer
* refactor(Plugins/Admin): add request handling to the hooks & selectors
* refactor(Plugins/Details): start using the data stored in Redux
* refactor(Plugins/Admin): rename selector to start with "select"
* fix(Plugins/Admin): only fetch plugins once
* refactor(Plugins/Admin): make the tab selection work in details
* refactor(catalog): put back loading and error states in plugin list
* refactor(Plugins/Admin): use CatalogPlugin for <PluginDetailsSignature />
* feat(Plugins/Admin): add an api method for fetching plugin details
* refactor(Plugins/Admin): add action for updating the details
* irefactor(Plugins/Admin): show basic plugin details info
* refactor(Plugin Details): migrate the plugin details header
* refactor(Plugins/Admin): make the config and dashboards tabs work
* refactor(Plugins/Admin): add old reducer state to the new one
* feat(catalog): introduce actions, reducers and hooks for install & uninstall
* refactor(catalog): wire up InstallControls component to redux
* refactor(catalog): move parentUrl inside PluginDetailsHeader and uncomment InstallControls
* feat(catalog): introduce code for plugin updates to install action
* refactor(Plugins/Admin): add backward compatible actions
* test(catalog): update PluginDetails and Browse tests to work with catalog store
* refactor(Plugins/Admin): make the dashboards and panels work again
* refactor(Plugins/Admin): fix linter and typescript errors
* fix(Plugins/Admin): put the local-only plugins to the beginning of the list
* fix(Plugins/Admin): fix the mocks in the tests for PluginDetails
* refactor(Plugins/Admin): remove unecessary hook usePluginsByFilter()
* refactor(Plugins/Admin): extract the useTabs() hook to its own file
* refactor(Plugins/Admin): remove unused helpers and types
* fix(Plugins/Admin): show the first tab when uninstalling an app plugin
This can cause the user to find themselves on a dissappeared tab, as the
config and dashboards tabs are removed.
* fix(catalog): correct logic for checking if activeTabIndex is greater than total tabs
* fix(Plugins/Admin): fix race-condition between fetching plugin details and all plugins
* fix(Plugins): fix strict type errors
* chore(catalog): remove todos
* feat(catalog): render an alert in PluginDetails when a plugin cannot be found
* feat(catalog): use the proper store state
* refactor(Plugins/Admin): fetch local and remote plugins in parallell
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
* style(catalog): fix prettier error in api
* fix(catalog): prevent throwing error if InstallControlsButton is unmounted during install
* refactor(Plugins/Admin): add a separate hook for filtering & sorting plugins
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
* build(webpack): bump to v5 and successful yarn start compilation
* build(webpack): update postcss dependencies
* build(webpack): silence warnings about hash renamed to fullhash
* build(webpack): enable persistent cache to store generated webpack modules / chunks
* build(webpack): prefer eslintWebpackPlugin over tschecker so eslint doesn't block typechecking
* chore(yarn): run yarn-deduplicate to clean up dependencies
* chore(yarn): refresh lock file after clean install
* build(webpack): prefer output.clean over CleanWebpackPlugin
* build(webpack): prefer esbuild over babel-loader for dev config
* build(babel): turn off cache compression to improve build performance
* build(webpack): get production builds working
* build(webpack): remove phantomJS (removed from grafana in v7) specific loader
* build(webpack): put back babel for dev builds no performance gain in using esbuild in webpack
* build(webpack): prefer terser and optimise css plugins for prod. slower but smaller bundles
* build(webpack): clean up redundant code. inform postcss about node_modules
* build(webpack): remove deprecation warnings flag
* build(webpack): bump packages, dev performance optimisations, attempt to get hot working
* chore(storybook): use webpack 5 for dev and production builds
* build(storybook): speed up dev build
* chore(yarn): refresh lock file
* chore(webpack): bump webpack and related deps to latest
* refactor(webpack): put back inline-source-map, move start scripts out of grafana toolkit
* feat(webpack): prefer react-refresh over react-hot-loader
* build(webpack): update webpack.hot to use react-refresh
* chore: remove react-hot-loader from codebase
* refactor(queryeditorrow): fix circular dependency causing react-fast-refresh errors
* revert(webpack): remove stats.errorDetails from common config
* build(webpack): bump to v5 and successful yarn start compilation
* build(webpack): update postcss dependencies
* build(webpack): silence warnings about hash renamed to fullhash
* build(webpack): enable persistent cache to store generated webpack modules / chunks
* build(webpack): prefer eslintWebpackPlugin over tschecker so eslint doesn't block typechecking
* chore(yarn): run yarn-deduplicate to clean up dependencies
* chore(yarn): refresh lock file after clean install
* build(webpack): prefer output.clean over CleanWebpackPlugin
* build(webpack): prefer esbuild over babel-loader for dev config
* build(babel): turn off cache compression to improve build performance
* build(webpack): get production builds working
* build(webpack): remove phantomJS (removed from grafana in v7) specific loader
* build(webpack): put back babel for dev builds no performance gain in using esbuild in webpack
* build(webpack): prefer terser and optimise css plugins for prod. slower but smaller bundles
* build(webpack): clean up redundant code. inform postcss about node_modules
* build(webpack): remove deprecation warnings flag
* build(webpack): bump packages, dev performance optimisations, attempt to get hot working
* chore(storybook): use webpack 5 for dev and production builds
* build(storybook): speed up dev build
* chore(yarn): refresh lock file
* chore(webpack): bump webpack and related deps to latest
* refactor(webpack): put back inline-source-map, move start scripts out of grafana toolkit
* feat(webpack): prefer react-refresh over react-hot-loader
* build(webpack): update webpack.hot to use react-refresh
* chore: remove react-hot-loader from codebase
* refactor(queryeditorrow): fix circular dependency causing react-fast-refresh errors
* revert(webpack): remove stats.errorDetails from common config
* revert(webpack): remove include from babel-loader so symlinks (enterprise) work as before
* refactor(webpack): fix deprecation warnings in prod builds
* fix(storybook): fix failing builds due to replacing css-optimise webpack plugin
* fix(storybook): use raw-loader for svg icons
* build(webpack): fix dev script colors error
* chore(webpack): bump css-loader and react-refresh-webpack-plugin to latest versions
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* refaactor: extract the tab labels into a const
* feat: list - show signature badge for enterprise plugins as well
* feat(plugins): add a component for showing plugin signature details
* feat: add a component for showing signature info under details
* feat: add a component for displaying signature info in details header
* feat: extract the plugin details header into a separate component
* feat: show signature information on the plugins details page
* refactor(Plugins): use an enum instead of an object
* refactor(Plugins): use more strict typing for tabs
* refactor(Plugins): use function declaration instead of fat-arrow for components
* fix(Plugins): fix typo
* fix: make installed plugin config an optional param again
* refactor: cache plugin meta requests
* refactor: move PLUGIN_TAB_LABELS to the types module
* Add filter parsing to rule list filters
* Add unit tests for label parsing
* Make label operators an enum
* add example for parsing function
* Update labels operator regex
* Use tooltip for query syntax example
* refactor to use Matchers for filtering
* wip: initial alertmanager notifications panel
* Panel for alertmanager notificaitons
* add filtering for notifications list
* remove icon
* rename am notifications to alert groups
* naming fixes
* Feature toggle
* Add toggle for expand all
* add pluralize
* add action buttons
* test work in progress
* Tests for alert groups panel
* Add useEffect for expandAll prop change
* Set panel to alpha state
* Fix colors
* fix polling interval callback
Co-authored-by: Domas <domas.lapinskas@grafana.com>
Co-authored-by: Domas <domas.lapinskas@grafana.com>
* feat(catalog): lazy load and add alt text to plugin logos
* refactor(catalog): use plugin types, make sure data is available for new ui
* test(catalog): fix up tests after types refactor
* feat(catalog): introduce Tile and PluginBadge components for ui updates
* refactor(catalog): update PluginList to use new components, lazy load images, add creditcard icon
* test(catalog): update Browse.test types
* fix(catalog): if local and remote make sure to get the correct local plugin from array
* refactor(catalog): prefer grafana/ui components over custom Tile component
* chore(catalog): delete redundant components
* feat(catalog): introduce ascending descending name sort for Browse
* refactor(catalog): prefer theme spacing over hardcoded values
* refactor(catalog): update Local and Remote plugin types to match api responses
* fix(catalog): prefer local.hasUpdate and local.signature so updateable plugin signature is valid
* test(catalog): update test plugin mocks
* test(catalog): add tests for sorting and categorise
* test(catalog): add tests for plugin cards, remove grid component
* test(catalog): add tests for PluginBadges component
* refactor(catalog): change enterprise learn more link to open plugin page on website
* simplify toggle + add link to server admin
* feat(catalog): org admins can configure plugin apps, cannot install/uninstall plugins
* fix(catalog): dont show buttons if user doesn't have install permissions
* feat(catalog): cater for accessing catalog via /plugins and /admin/plugins
* feat(catalog): use location for list links and match.url to define breadcrumb links
* test(catalog): mock isGrafanaAdmin for PluginDetails tests
* test(catalog): preserve default bootdata in PluginDetails mock
* refactor(catalog): move orgAdmin check out of state and make easier to reason with
Co-authored-by: Will Browne <will.browne@grafana.com>
* feat(catalog): introduce additive filters for plugin type, installed status and search
* feat(catalog): prefer FilterInput over custom styled search field
* feat(catalog): update Browse page to use new search, filter features
* refactor(catalog): keep filters with usePluginsByFilter hook
* test(catalog): update tests to reflect new filtering and searching
* refactor(catalog): rearrange filterByType radio buttons
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* feat(catalog): ntroduce css for responsive filter layout
* refactor(catalog): introduce pluginfilter type and give filter methods better names
* fix(catalog): default q param to empty string so FiterInput doesn't show clear button on load
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>