* - initial work on data source config page
* - add links to test status box
- add tracking function
* - add test for the DataSourceConfigAlert component
* - fix flicker of the alert box
* - fix the build
* - small improvements
* - fix failing build
* - fix failing unit tests
* - prettier and betterer fixes
* - fix failing e2e tests
* - fix build again
* - rewrite solution according to the PR comments
* - cleanup
* - fix failing e2e
* - use absolute path in link
* Minor fixes
---------
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* Update behavior of defaults in connection limits
* Refactor to use config object instead
* Refactor remove unneeded function
---------
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
* Draft: Feature: Trusted Types support
* remove trusted-types package
* Create policy before jQuery and Angular is loaded and add feature flag
* Add trustedTypePolicies
* Sanitize scriptURL
* Add TT meta tag for test env
* Move trusted types into core
* Add DOMParser support for TrustedHTML
* Seperate RSS sanitization and add better TrustedHTML support
* Get test CSP header from config
* Remove dompurify dep from core
* Add documentation for trusted types
* Apply suggestions from code review
Co-authored-by: Kristian Bremberg <114284895+KristianGrafana@users.noreply.github.com>
* Add comment about Github discussion thread and things breaking
* Remove changes from News panel
* Remove TT feature toggle
* Expose TT and CSPReportOnly to frontend
* Log errors in console when CSP report only is enabled
* Log error for reporting and remove test mode
* Only insert CSP header in HTML for dev env
* Update docs
---------
Co-authored-by: Tobias Skarhed <tobias.skarhed@gmail.com>
Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
* adds alertstatehistory backend config to grafanaBootData
* add alertStateHistory api
* show different ASH modal when using loki implementation
* group log lines by instance (unique set of labels)
Co-Authored-By: Konrad Lalik <konrad.lalik@grafana.com>
* render log lines for each instance
Co-Authored-By: Konrad Lalik <konrad.lalik@grafana.com>
* Add visual improvements to the log record of state changes
* Add values to log records
* compute common labels and show unique labels
* Add state changes visualization
* fix common labels extraction
* Code cleanup
* Add timespan-based log record view
* WIP
* scroll to timestamp - poc
* Use SortedVector for timestamp field
* add conditional accessor for frames
* update some of the log formats and styles
* Timestamp-based visualization with scrolling
* minor improvements
* Split Loki's state history viewer into multiple files
* Add memoization to prevent graph rerender on filter updates
* make chart size shrink when fewer instances
* style updates
* show warning when instances are hidden
* Add basic label-based filtering
* Improve label-based filtering
* Add regex validation
* Improve no instances message when everything was filtered out
* Update warning message
* Move timeline viewer to a separate file, refactor handling timeline pointer changes
* Remove unused component, add comments
* Fix test snapshot, fix type error
* adds tests for common.ts
* Add tests for converting log records into data frames
* Add basic component test, fix type guards
* Use a constant for timeseries limit
* Improve a11y, update component test
* Memoize AlertStateTag, migrate from deprecated ArrayVector
* Update public/app/features/alerting/unified/components/rules/state-history/common.ts
* Move helper hook into a separate file. Add Search input component
* Change the limit of visible time series on the timeline
* Add LogRecordViewer perf improvements, refactor timeline cursor events tracking
* Use callback to pass timeline refs
* Add grouping tests for the log record viewer
---------
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
* Fix expressions instance settings loading
* Introduce a new method to get name or uid
* Update public/app/features/plugins/datasource_srv.ts
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* Move getNameOrUid method outside the class
---------
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* update react 18 related deps
* fix some types
* make sure we're on react-router-dom >= 5.3.3
* Use new root API
* Remove StrictMode for now - react 18 double rendering causes issues
* fix + ignore some @grafana/ui types
* fix some more types
* use renderHook from @testing-library/react in almost all cases
* fix storybook types
* rewrite useDashboardSave to not use useEffect
* make props optional
* only render if props are provided
* add correct type for useCallback
* make resourcepicker tests more robust
* fix ModalManager rendering
* fix some more unit tests
* store the click coordinates in a ref as setState is NOT synchronous
* fix remaining e2e tests
* rewrite dashboardpage tests to avoid act warnings
* undo lint ignores
* fix ExpanderCell types
* set SymbolCell type correctly
* fix QueryAndExpressionsStep
* looks like the types were actually wrong instead :D
* undo this for now...
* remove spinner waits
* more robust tests
* rewrite errorboundary test to not explicitly count the number of renders
* make urlParam expect async
* increase timeout in waitFor
* revert ExplorePage test changes
* Update public/app/features/dashboard/containers/DashboardPage.test.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Update public/app/features/dashboard/containers/PublicDashboardPage.test.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Update public/app/features/dashboard/containers/PublicDashboardPage.test.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Update public/app/features/dashboard/containers/PublicDashboardPage.test.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* skip fakeTimer test, ignore table types for now + other review comments
* update package peerDeps
* small tweak to resourcepicker test
* update lockfile...
* increase timeout in sharepublicdashboard tests
* ensure ExplorePaneContainer passes correct queries to initializeExplore
* fix LokiContextUI test
* fix unit tests
* make importDashboard flow more consistent
* wait for dashboard name before continuing
* more test fixes
* readd dashboard name to variable e2e tests
* wait for switches to be enabled before clicking
* fix modal rendering
* don't use @testing-library/dom directly
* quick fix for rendering of panels in firefox
* make PromQueryField test more robust
* don't wait for chartData - in react 18 this can happen before the wait code even gets executed
---------
Co-authored-by: kay delaney <kay@grafana.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* tracing: show backend trace ids in frontend
* better trace id naming
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
* better trace id naming
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
* better trace id naming
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
* added feature flag
* bind functionality to the feature flag
* use non-generic name for traceid header
* fixed tests
* loki: do not create empty fields
* do not add empty fields
* fixed graphite test mock data
* added unit-tests to queryResponse
* added unit-tests for backend_srv
* more typescript-friendly check
* added unit-tests for runRequest
---------
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
* Added onClick to the link and made path optional.
* Added type to the import.
* revert(plugin-extensions): put back isPromise utility function
* Minor update to the isPromise function.
* added onClick in the panel menu item.
---------
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* Update chunking mentions in the code and ui
* Rename files and exported functions
* Rename configuration attribute
* Rename grouped querying function name
* Update more function names
* Update unit test
* Update unit tests
* More renames
* Rename time splitting functions
* bring in source from database
* bring in transformations from database
* add regex transformations to scopevar
* Consolidate types, add better example, cleanup
* Add var only if match
* Change ScopedVar to not require text, do not leak transformation-made variables between links
* Add mappings and start implementing logfmt
* Add mappings and start implementing logfmt
* Remove mappings, turn off global regex
* Add example yaml and omit transformations if empty
* Fix the yaml
* Add logfmt transformation
* Cleanup transformations and yaml
* add transformation field to FE types and use it, safeStringify logfmt values
* Add tests, only safe stringify if non-string, fix bug with safe stringify where it would return empty string with false value
* Add test for transformation field
* Do not add null transformations object
* Add provisioning (to be removed) and show log lines with links
* Only display links if change to query was made
* Break out transformation logic, add tests to backend code
* Fix lint errors I understand 😅
* Fix the backend lint error
* Remove unnecessary code and mark new Transformations object as internal
* Add support for named capture groups
* Remove type assertion
* Remove variable name from transformation
* Add test for overriding regexes
* Add back variable name field, but change to mapValue
* fix go api test
* Change transformation types to enum, add better provisioning checks for bad type name and format
* Change transformation types to enum, add better provisioning checks for bad type name and format
* Check for expression with regex transformations
* Remove isInterpolated variable, add option to always use format function
* Add template variable check to links
* Use new functions
* Filter log line at render, remove extra createSpanLink imports
* Add scrollable to long log messages
* Remove test that is no longer accurate
* Remove test correlation
* Add tests, fix duplicate key issue
* WIP: show log line links key/value pairs
* Some not great style changes
* Change LogDetailsRow for better multi value formatting
* Cleanup
* Add additional information around variable regex, implement PR feedback
* Display name with fieldPath if applicable
* Add variables with fieldPaths to test
* Count empty string as undefined variable
* Add better commented version of function, fix tests by removing new variable
* Modify when links show
* Remove sample yaml
* If a link has no variables, set value to field name, and some formatting issues
* Add comments and change variable names to be more clear, add back logic where needed, add test coverage for new scenario
* Fix formatting of replaceInVariableRegex comment
* Remove changes from Grafana-data, move logic into explore
* Rename function and property to match similar format
* Move types to type files and consolidate definitions, rename functions, change field definitions to accept arrays of keys/values, move function to parser, hide actions on multi key/value rows
* Add tests to logParser’s new function
* add `correlationId` to queries
* trace correlation id in backend
* add correlation id to loki's span
* add correlation id to query chunks
* fix test
* fix DataSourceWithBackend test
* change to `queryGroupId`
* remove empty line
* fix test in `DataSourceWithBackend`
With v1.0.2 Faro explicitly closes fetch requests.
This fixes an issue were (headless) chrome browser
still considers those requests as open which lead to timeouts.
* only redirect to /login when anonymous access is disabled
* only search for dashboards when not logged in if anon access is enabled
* fix go logic
* add unit tests
* feat(plugins): introduce dashboard panel menu placement for adding menu items
* test: add test for getPanelMenu()
* added an unique identifier for each extension.
* added context to getPluginExtensions.
* wip
* Wip
* wiwip
* Wip
* feat: WWWIIIIPPPP 🧨
* Wip
* Renamed some of the types to align a bit better.
* added limit to how many extensions a plugin can register per placement.
* decreased number of items to 2
* will trim the lenght of titles to max 25 chars.
* wrapping configure function with error handling.
* added error handling for all scenarios.
* moved extension menu items to the bottom of the more sub menu.
* added tests for configuring the title.
* minor refactorings.
* changed so you need to specify the full path in package.json.
* wip
* removed unused type.
* big refactor to make things simpler and to centralize all configure error/validation handling.
* added missing import.
* fixed failing tests.
* fixed tests.
* revert(extensions): remove static extensions config in favour of registering via AppPlugin APIs
* removed the compose that didn't work for some reason.
* added tests just to verify that validation and error handling is tied together in configuration function.
* adding some more values to the context.
* draft validation.
* added missing tests for getPanelMenu.
* added more tests.
* refactor(extensions): move logic for validating extension link config to function
* Fixed ts errors.
* Started to add structure for supporting commands.
* fixed tests.
* adding commands to the registry
* tests: group test cases in describe blocks
* tests: add a little bit more refactoring to the tests
* tests: add a test case for checking correct placements
* feat: first version of the command handler
* feat: register panel menu items with commands
* refactor: make the 'configure' function not optional on `PluginExtensionRegistryItem`
* Wip
* Wip
* Wip
* added test to verify the default configure function.
* added some more tests to verify that commands have the proper error handling for its configure function.
* tests: fix TS errors in tests
* tests: add auxiliary functions
* refactor: small refactoring in tests
* refactor: refactoring tests for registryFactory
* refactor: refactoring tests for registryFactory
* refactor: refactoring tests for registryFactory
* refactor: refactoring tests for registryFactory
* refactor: refactoring tests for registryFactory
* refactor: refactoring tests for registryFactory
* refactor: refactoring tests for registryFactory
* refactor: refactoring tests for registryFactory
* draft of wrapping command handler with error handling.
* refactor: refactoring tests for registryFactory
* added test for edge case.
* replaced the registry item with a configure function.
* renamed the configure function type.
* refactoring of the registryfactory.
* added tests for handler error handling.
* fixed issue with assert function.
* added comment about the limited type.
* Update public/app/features/plugins/extensions/errorHandling.test.ts
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* Update public/app/features/plugins/extensions/errorHandling.test.ts
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* Update public/app/features/plugins/extensions/errorHandling.test.ts
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* added missing tests.
---------
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* feat(plugins): introduce dashboard panel menu placement for adding menu items
* test: add test for getPanelMenu()
* added an unique identifier for each extension.
* added context to getPluginExtensions.
* wip
* Wip
* wiwip
* Wip
* feat: WWWIIIIPPPP 🧨
* Wip
* Renamed some of the types to align a bit better.
* added limit to how many extensions a plugin can register per placement.
* decreased number of items to 2
* will trim the lenght of titles to max 25 chars.
* wrapping configure function with error handling.
* added error handling for all scenarios.
* moved extension menu items to the bottom of the more sub menu.
* added tests for configuring the title.
* minor refactorings.
* changed so you need to specify the full path in package.json.
* wip
* removed unused type.
* big refactor to make things simpler and to centralize all configure error/validation handling.
* added missing import.
* fixed failing tests.
* fixed tests.
* revert(extensions): remove static extensions config in favour of registering via AppPlugin APIs
* removed the compose that didn't work for some reason.
* added tests just to verify that validation and error handling is tied together in configuration function.
* adding some more values to the context.
* draft validation.
* added missing tests for getPanelMenu.
* added more tests.
* refactor(extensions): move logic for validating extension link config to function
* Fixed ts errors.
* Update packages/grafana-data/src/types/app.ts
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* Update packages/grafana-runtime/src/services/pluginExtensions/extensions.test.ts
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* refactor(extensions): rename limiter -> pluginPlacementCount
* refactor(getpanelmenu): remove redundant continue statement
---------
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
* Set default query when changing data source or adding new alert query
* Set default query when creating new alert rule
* Set fefault query for cloud and recording rules
* Create hook for getting defaults in AlertRuleForm
* fixing tests
* Use conditionals with 'if' for more clarity and rename lazy to async
* Add loading indicator for default queries
* Fix tests
* Make newModel a sync method and fix tests error
* Use useAsync instead of useEffect for an async call
* Update dependency rollup to v3
* build(rollup): update all rollup related deps to latest version
* chore(runtime): update peerDeps to match other package semver ranges
* chore(yarn): refresh lock file
* refactor(packages): migrate to esm for rollup@3 configs
* build(packages): remove unused rollup dependencies
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
* Renamed target -> id and href -> path after feedback.
* fixed type issues in test page.
* chore(pluginschemajson): update extensions props target -> id
* this is the final.
* fixed typings...again...
---------
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
* added extensions to plugin.json and exposing it via frontend settings.
* added extensions to the plugin.json schema.
* changing the extensions in frontend settings to a map instead of an array.
* wip
* feat(pluginregistry): begin wiring up registry
* feat(pluginextensions): prevent duplicate links and clean up
* added test case for link extensions.
* added tests and implemented the getPluginLink function.
* wip
* feat(pluginextensions): expose plugin extension registry
* fix(pluginextensions): appease the typescript gods post rename
* renamed file and will throw error if trying to call setExtensionsRegistry if trying to call it twice.
* added reafactorings.
* fixed failing test.
* minor refactorings to make sure we only include extensions if the app is enabled.
* fixed some nits.
* Update public/app/features/plugins/extensions/registry.test.ts
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* Update packages/grafana-runtime/src/services/pluginExtensions/registry.ts
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* Update packages/grafana-runtime/src/services/pluginExtensions/registry.ts
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* Update public/app/features/plugins/extensions/registry.test.ts
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* Moved types for extensions from data to runtime.
* added a small example on how you could consume link extensions.
* renamed after feedback from levi.
* updated the plugindef.cue.
* using the generated plugin def.
* added tests for apps and extensions.
* fixed linting issues.
* wip
* wip
* wip
* wip
* test(extensions): fix up failing tests
* feat(extensions): freeze registry extension arrays, include type in registry items
* added restrictions in the pugindef cue schema.
* wip
* added required fields.
* added key to uniquely identify each item.
* test(pluginextensions): align tests with implementation
* chore(schema): refresh reference.md
---------
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>