* InfoTooltip: refactor component to be accessible
* new: create ghostMode prop to allow turning on/off button styles
* update infoToolTip component to use ghostMode prop
* update story to show ghostMode state
* fix condition to work properly
* nit fix
* revert changes to former infoTooltip state
* InfoTooltip: use iconButton instead to achieve keyboard a11y
* fix minor type nit
* BarGauge: fix vertical view flip issue
* fix bar misalignment in vertical and horizontal orientations
* add test to prevent bar misalignment in the future
* Revert externalization of the tslib so it gets bundled with the plugins.
* Adding pnp-webpack-plugin to properly resolve dependencies in nested plugins.
* added dependency on lodash.
* Chore: move close popover utility to a standalone file
* remove duplicate function in colorpicker
* fixed incorrect import
* make method slightly flexible by removing type parameter
* add useToolTipTrigger react aria and state to grafana-ui
* show tooltip on focus and close tooltip when esc key is pressed
* remove react-aria/tooltip package
* fix failing test
* [cr] whitelist flexbox styles in text panel editor
* [cr] separate sanitize function for text panel only
* [cr] separate markdown function for text panel
* [cr] common markdown options
* Update dependency eslint-plugin-react to v7.27.1
* Fix up code to work with new version of eslint-plugin-react
* kick drone
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* ColorPicker: Refine design of the color picker popover
* One more tweak
* removed unneeded div and add hover style
* Fixing test
* Reverse order from dark to brighter
* Add 'JSON' field type to ConvertFieldTypeTransformer
I've been playing around with #41994 and found that it requires fields
to contain array values, which can't be sent from a backend plugin. This
PR adds the ability for the ConvertFieldTypeTransformer to parse
JSON values and store the result in the transformed field.
The main use case for this right now is so that a field
containing a JSONified array can be transformed into a field
containing an actual array, which can in
turn be used for the table charts in #41994.
Supersedes #42521.
* Add second option to complex field conversion to increase flexibility
This avoids falsely equating 'JSON' with FieldType.other, and instead
allows multiple parsers to be used if the 'Complex' type is selected.
Currently only JSON parsing is implemented, but others could be
supported easily in future.
* Revert "Add second option to complex field conversion to increase flexibility"
This reverts commit 6314ce35eb.
* Improve test for object parsing of complex field transformer
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* Use the api to login in cypress by default
* export getBaseUrl
* Revert "export getBaseUrl"
This reverts commit ae7eecea37.
* just use BASE_URL from the env
* fix exemplars test
* move into separate functions
* I18N: Add Core Lingui framework for translating the UI
* Make FieldSet accept ReactNode for the label, so it can be translated
* Translate a phrase in the User profile edit form
* Translate phrase
* run lingui compile before webpack builds
* init i18n more lazily
* i1n:compile in drone lint step
* wip for getting tests to work
* Use mock lingui/macros because its too hard to use the real macros in Jest...
* mock messages for tests
* use specific lingui version
* add comment for test helper
* we actually don't need the i18n setup in tests because we mock out <Trans />
* update package.json
* remove unneded imports
* revert back babel core version
* Create a I18nProvider wrapper
* AccessControl: Provide scope to frontend
* Covering datasources with accesscontrol metadata
* Write benchmark tests for GetResourcesMetadata
* Add accesscontrol util and interface
* Add the hasPermissionInMetadata function in the frontend access control code
* Use IsDisabled rather that performing a feature toggle check
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
* Add basic implementation
* Split import/export query interface
* Rename abstract query type
* Rename abstract query type
* Split loki/prom parsing
* Update docs
* Test importing abstract queries to Elastic
* Test exporting abstract queries from Graphite
* Test Prom and Loki query import/export
* Give better control to import/export all queries to data sources
* Fix unit test
* Fix unit test
* Filter out non-existing labels when importing queries to Loki
* Fix relative imports, names and docs
* Fix import type
* Move toPromLike query to Prometheus code
* Dedup label operator mappings
* importAbstractQueries -> importFromAbstractQueries
* Fix unit tests
* Infer dropdown menu position when using asynchronously loaded options
* Infer position only when the menu is opened when the component is created
* Add link to react-select bug
* Update docs
* ColorPicker: implement new ui
* makes color swatches tabbable
* implements next and previous arrow key navigation
* make colorPickerPopover to close when esc key is pressed
* colorValueEditor: fix colorPopover closing immediately when clicked
* add blue focus ring to both colorSwatch and picker tabs
* refactor color label divs to be more readable
* more cleanup
* refactor color swatches to use buttons instead
* removes left and right arrow navigation to maintain consistency
* makes colors selectable using the keyboard
* use native button instead for mouse and keyboard click hadling
* when a color is clicked, row backgound should change
* add left padding to last row in colorPopover
* when a color is hovered, row backgound should change
* test for colorPickerPopover component
* small typo fix
* ariaLabel over label
* make row background to not change when a color is selected
* style refactor to be standalone
* use HTMLAttributes instead
* Chore(dependencies): Tidy up deps in root package
* Tidy up dependencies in @grafana/data
* Tidy up dependencies in @grafana/e2e
* Tidy up @grafana/e2e-selectors packages
* Tidy up packages in @grafana/runtime
* tidy up packages in @grafana/ui
* tidy up packages in jaeger-ui-components
* Readd regenerator-runtime in @grafana/data
* chore(storybook): bump dependencies to 6.4.4
* chore(yarn): update packageExtensions to match latest storybook
* fix(storybook): get webpack builds to pass
* fix(storybook): theme switching works in docs
* fix(storybook): use text logo so accessibility link doesnt break layout
* Navigation: Start creating new NavBarMenu component
* Navigation: Apply new NavBarMenu to NavBarNext
* Navigation: Remove everything to do with .sidemenu-open--xs
* Navigation: Ensure search is passed to NavBarMenu
* Navigation: Standardise NavBarMenuItem
* This extra check isn't needed anymore
* Navigation: Refactor <li> out of NavBarMenu
* Navigation: Combine NavBarMenuItem with DropdownChild
* use spread syntax since performance shouldn't be a concern for such small arrays
* Improve active item logic
* Ensure unique keys
* Remove this duplicate code
* Add unit tests for getActiveItem
* Add tests for NavBarMenu
* Rename mobileMenuOpen -> menuOpen in NavBarNext (since it can be used for mobile menu or megamenu)
* just use index to key the items
* Use exact versions of @react-aria packages
* Navigation: Make the dropdown header a NavBarMenuItem
* Navigation: Stop using dropdown-menu for styles
* Navigation: Add react-aria relevant packages
* Navigation: Refactor NavBarDropdown to support react aria
* Navigation: apply keyboard navigation to NavBar component
* Navigation: UseHover hook for triggering submenu on navbar
* Navigation: rename testMenu component to NavBarItemButton
* WIP
* some hacks
* Refactor: clean up keybinding events
* Navigation: render subtitle on item menu and disable it
* Navigation: Adds react-aria types (#42113)
* Refactor: refactor out to NavBarItemWithoutMenu
* Refactor: cleaning up stuff
* Refactor: comment out unused code
* Chore: Removes section and uses items only
* Chore: fix NavBarNext
* Chore: adds tests
* Refactor: minimize props api
* Refactor: various refactors
* Refactor: rename enableAllItems
* Refactor: remove unused code
* Refactor: fix clicking on menuitems
* Refactor: use recommended onAction instead
* Navigation: Fix a11y issues on NavBar
* Navigation: Fix a11y navBar Next
* Navigation: Remove unnecessary label prop, use link.text instead
* Apply suggestions from code review
Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Apply unit tests suggestions from code review
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Update react-aria/menu package to latest version and apply PR suggestion
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Update jest monorepo
* Update version of marked so it doesn't throw an error, set testEnvironment
* Fix some unit tests
* Remove all these tests that aren't actually working...
* use spyOn instead of mocking the whole module
* Fix linting
Co-authored-by: Renovate Bot <bot@renovateapp.com>
* Explore: Fix ANSI dim style being unreadable in dark mode
* use GrafanaTheme2 instead of opacity
* tweak code and comment
* fix existing tests and add new test for ANSI dim code
* fix failing test
* add focus trapping to colorPickerPopover
* make popover exit using esc key
* fix colorPickerPopover to be tabbable
* fix focus escape in colorPickerPopover
* revert to focus trap fix
* Select: Fix input cursor position so that it is at the start for single value selects
* Fixing e2e tests
* Fixes cursor issue
* Fixing e2e tests
* e2e fix
* Select: ensure input always overlays singleValue, update pa11y config
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* PanelDataError: Show actions when current panel cannot visualize data
* Fixed so that suggestions tab is opened from action
* Cleanup
* Fixed tests
* Fix tests
* Fixing tests
* Fixed ts issues
* Update sentry-javascript monorepo to v6
* Pass fetch implementation to FetchTransport and stub in unit tests
* kick drone
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Update dependency react-select to v5
* Remove @types/react-select and update types accordingly
* Fix all unit tests
* Add @ts-expect-error to individual errors, remove prefix as it doesn't seem to exist?
* Another minor typescript fix
* Apply fixes from torkel's PR
* Fix last typescript error
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Select: Select menus now properly scroll when navigating with the keyboard
* Remove this unnecessary children declaration in the interface
* Guard this with an if statement to avoid the nullish coalescing
* Don't need the optional chaining if we're guarding with an if
* Dockerifle: Bump Go and Alpine versions
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
* Updating .drone.yml with 'make drone'
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
* Update dependency cypress to v9
* Update e2e test to work with Cypress 9
* kick drone
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Very simple role picker
* Style radio button
* Separate component for the built-in roles selector
* Custom component instead of Select
* refactor
* Custom input for role picker
* Refactor
* Able to select built-in role
* Add checkboxes for role selector
* Filter out fixed and internal roles
* Add action buttons
* Implement role search
* Fix selecting roles
* Pass custom roles to update
* User role picker
* Some UX work on role picker
* Clear search query on close
* Blur input when closed
* Add roles counter
* Refactor
* Add disabled state for picker
* Adjust disabled styles
* Replace ChangeOrgButton with role picker on admin/users page
* Remove unused code
* Apply suggestions from code review
Suggestions from the @Clarity-89
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Refactor: fix some errors after applying review suggestions
* Show fixed roles in the picker
* Show applied fixed roles
* Fix role counter
* Fix checkbox selection
* Use specific Role type for menu options
* Fix menu when roles list is empty
* Fix radio button name
* Make fixed roles from built-in role disabled
* Make whole menu scrollable
* Add BuiltInRole type
* Simplify appliedRoles
* Simplify options and props
* Do not select and disable inherited fixed roles
* Enable selecting fixed role
* Add description tooltip
* Fix role param name
* Export common input styles from grafana/ui
* Add ValueContainer
* Use value container
* Refactor appliedRoles logic
* Optimise role rendering
* Display selected roles
* Fix tooltip position
* Use OrgRole type
* Optimise role rendering
* Use radio button from grafana UI
* Submenu WIP
* Role picker submenu WIP
* Hide role description
* Tweak styles
* Implement submenu selection
* Disable role selection if it's inherited
* Show new role picker only in Enterprise
* Fix types
* Use orgid when fetching/updating roles
* Use orgId in all access control requests
* Styles for partially checked checkbox
* Tweak group option styles
* Role picker menu: refactor
* Reorganize roles in menu
* Fix input behaviour
* Hide groups on search
* Remove unused components
* Refactor
* Fix group selection
* Remove icons from role tags
* Add spacing for menu sections
* Rename clear all to clear in submenu
* Tweak menu width
* Show changes in the input when selecting roles
* Exclude inherited roles from selection
* Increase menu height
* Change built-in role in input on select
* Include inherited roles to the built-in role selection
* refcator import
* Refactor role picker to be able to pass roles and builtin roles getters
* Add role picker to the org users page
* Show inherited builtin roles in the popup
* Filter out managed roles
* Fix displaying initial builtin roles
* Show tooltip only for non-builtin roles
* Set min width for focused input
* Do not disable inherited roles (by design)
* Only show picker if access control enabled
* Fix tests
* Only close menu on click outside or on indicator click
* Open submenu on hover
* Don't search on empty query
* Do not open/close menu on click
* Refactor
* Apply suggestions from code review
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Fix formatting
* Apply suggestions
* Add more space for close menu sign
* Tune tooltip styles
* Move tooltip to the right side of option
* Use info sign instead of question
Co-authored-by: Clarity-89 <homes89@ukr.net>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Chore: moves alert to test-id
* Chore: moves Dashboard navigation to test-id
* Chore: moves Bar gauge value to data-testid
* Chore move Folder picker select container to data-testid
* Chore: moves Time zone picker select container to data-testid
* Chore: moves Choose starting day of the week to data-testid
* Chore: change tabIndex on search input
* Chore: moves various search related aria-lables to data-testid
* Chore: connects label to select input on alerting page
* Chore: connects TimeZonePicker and WeekStartPicker with labels
* Chore: moves CallToActionButton to data-testid
* Chore: move user home preferences select to data-testid
* Chore: lower all thresholds
* TimePickerSettings: make label appropriately link to input when clicked
* DashboardSettings: link labels to input
* use loweercase instead for IDs
* fixes failing e2e test
* properly set query type
* set default unit from data when found
* make AlertQueryRunner take into account ds.filterQuery
* fix tests
* feedback after pr
Co-authored-by: Peter Holmberg <peter.hlmbrg@gmail.com>
* Explore: Show ANSI colors when highlighting matched words
* only highlight ANSI text if needsHighlighter is true
Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
* fix lint error
Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
* refactor(pkg/api/frontendsettings): group plugin catalog settings
* feat(plugins/admin): add a default config value for `pluginCatalogHiddenPlugins`
* chore(grafana/config): add type for `pluginCatalogHiddenPlugins`
* feat(plugins/admin): hide plugins from the catalog based on the grafana config
* fix(plugins/admin): fix a rebase typo
* fix(plugins/admin): remove unnecessary filtering
* Barchart docs and styling fix
* Fix name of max length
* rename valueRotation -> xTickLabelRotation
also limits slider padding on sliders without marks
* Prometheus: Dont include empty exempalr frame in results
* Prometheus: Never run exemplar queries for alerting
* Remove exemplar field from alerting and set exemplar to false
* Add tests for frontend
* Add test for backend
* Fix parsing of float numbers in validation
* Adjust test
* Update packages/grafana-data/src/datetime/durationutil.test.ts
* Update packages/grafana-data/src/datetime/durationutil.test.ts
* Remove us from placeholder
* making it possible to cache plugins based on the version.
* feat(plugincache): introduce function to invalidate entries
* removed todo's
* added tests for the cache buster.
* fixed tests.
* fixed failing tests.
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
* Rename "Logs volume" labels to "Log volume"
Code references are kept intact as there's a lot of them, it could be renamed in a separate PR just with renaming
* Add log level docs
* Remove feature flag to enable log volume by default
* Update error message
* Update docs
* Fix unit test
* Fix unit test
Queries are now run automatically
* Add extra param for Loki API
* Remove "Load volume" button
* Update documentation about log volume
* Move comment
* Make reload button more accessible
* Update docs/sources/explore/logs-integration.md
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
* Hide full range log volume for Loki behind the feature toggle
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
* adds better aria-label for run and interval buttons
* enable refreshPicker to be keyboard navigable
* adds support for closing menu using esc key
* Fix: weird behaviour when navigating menu items
* adds focus trapping to refresh picker
* WIP: sanitize time interval values for screen readers to pronounce correctly
* WIP: improve sanitizeLabel function to work for all use cases
* Chore: move label sanitization to refreshPicker component instead
* Chore: add fallback label when ariaLabel prop is not set
* Chore: fix some type errors
* code cleanup
* update tests
* rename function to be more descriptive
* remove unnecessary type casting
* WIP: use cleaner solution
* WIP: use parseDuration util instead
* use more descriptive aria label
* fix: modify parseDuration util to output correct interval unit format
* fix: move interval unit format logic to refreshPicker
* Chore: add back old refreshPicker e2e selectors for backward compatibility
* Fix: improve refresh picker to voice out selected interval option
* Fix: use appropriate aria roles and states to aid screen reader a11y
* Fix: support dropdown expansion using down arrow key
* Chore: use better type construct
* Fix: add support for tab to close menu
* add more context to the deprecation warning message
* Chore: use formatDuration util instead to format interval labels
* Chore: small syntax fix
* chore: syntax fix
* syntax fix
* Chore: add back lockfile
* fix(storybook): make sure story background fills available height
* fix(storybook): add decorator to prevent badge filling all available height
* docs(badge): use centered story
* revert(badge): remove obsolete Meta typing
* Fix: make webpack pickup workers written in TS
* Add comlink to dependencies
* Temporary fix: copy paste `toDataQueryError` from @grafana/runtime to avoid web dependencies
* Implemented comlink-based centrifuge worker & worker proxy
* Temporary fix: implement comlink transferHandlers for subscriptions and streamingdataframes
* Move liveTimer filtering from CentrifugeService into GrafanaLiveService
* Switch from CentrifugeService to CentrifugeServiceWorkerProxy in GrafanaLive
* Naming fix
* Refactor: move liveTimer-based data filtering from GrafanaLiveService to CentrifugeServiceWorker
* observe dataStream on an async scheduler
* Fix: - Unsubscribe is now propagated from the main thread to the worker, - improve worker&workerProxy types
* Fix: Prettify types
* Fix: Add error & complete observers
* Docs: Add comment explaining the `subscriberTransferHandler`
* Fix: Replace `StreamingDataFrameHandler` with explicitly converting StreamingDataFrame to a DataFrameDTO
* Refactor: move liveTimer filtering to service.ts to make it easy to implement a `live-service-web-worker` feature flag
* Feat: add `live-service-web-worker` feature flag
* Fix: extract toDataQueryError.ts to a separate file within `@grafana-runtime` to avoid having a dependency from webworker to the whole package (@grafana-runtime/index.ts)
* Update public/app/features/dashboard/dashgrid/liveTimer.ts
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
* Fix: fixed default import class in worker file
* Fix: cast worker as Endpoint
* Migrate from worker-loader to webpack native worker support v1 - broken prod build
* Fix: Use custom path in HtmlWebpackPlugin
* Fix: Loading workers from CDNs
* Fix: Avoid issues with jest ESM support by mocking `createWorker` files
* Fix: move the custom mockWorker rendering layout to `test/mocks`
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
* Update dependency optimize-css-assets-webpack-plugin to v6
* Update to use exact version
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
* Refactor: adds affectedPanelIds and fixes some bugs
* Refactor: Fixes all dependencies and affected panel ids
* Refactor: glue it together with events
* Chore: remove debug code
* Chore: remove unused events
* Chore: removes unused function
* Chore: reverts processRepeats
* Chore: update to use redux state
* Refactor: adds feature toggle in variables settings
* Refactor: adds appEvents to jest-setup
* Tests: adds tests for strict panel refresh logic
* Refactor: small refactor
* Refactor: moved to more events
* Tests: fixes test
* Refactor: makes sure we store strictPanelRefreshMode in dashboard model
* Refactor: reporting and adds tests
* Tests: fix broken tests
* Tests: fix broken initDashboard test
* Tests: fix broken Wrapper test
* Refactor: adds solution for $__all_variables
* Chore: updates to radio button
* Refactor: removes toggle and calculates threshold instead
* Chore: fix up tests
* Refactor: moving functions around
* Tests: fixes broken test
* Update public/app/features/dashboard/services/TimeSrv.ts
Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
* Chore: fix after PR comments
* Chore: fix import and add comment
* Chore: update after PR comments
Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
* First working version of shared cursor for state timeline
* Only publish x value for time series
* Don't send legacy graph event
* Don't add y scale to cursor sync
* Snap cursor to the bottom of the canvas when sync is out of bounds
* Fix snapshot