* update eslint, tsconfig + esbuild to handle new jsx transform
* remove thing that breaks the new jsx transform
* remove react imports
* adjust grafana-icons build
* is this the correct syntax?
* try this
* well this was much easier than expected...
* change grafana-plugin-configs webpack config
* fixes
* fix lockfile
* fix 2 more violations
* use path.resolve instead of require.resolve
* remove react import
* fix react imports
* more fixes
* remove React import
* remove import React from docs
* remove another react import
* apply empty state in a bunch of places
* fix unit tests
* put alert back on top
* add data-testids so e2e tests keep working
* remove info boxes
* fix annotations empty state alignment with new maxWidth
* remove advancedDataSourcePicker feature toggle from DataSourcePickerWithPrompt
* remove advancedDataSourcePicker toggle from DataSourcePicker and adjust tests that relied on old picker
* adjust failing tests in QueryVariableEditorForm
* move DataSourceDropdown to DataSourcePicker file
* covert style declaration syntax to object style in DataSourcePicker
* remove advancedDataSourcePicker feature flag from registry
* remove .only from test
* adjust QueryVariableEditor test to avoid console.error
* Extract transformations editor row to a seprate component
* Use css object instead of string literals
* Update .betterer.results
* Post merge fixes
* Bring back validation rules
* Switch to css/object
* Post-merge fixes
Ensuring Stack from grafana-ui is used after conflicts with 25779bb6e5
* grafana/ui: Move Stack out of unstable
* grafana/ui: Replace imports
* Replace the import from experimental
* Cleanup
* Remove invalid prop
* Add flexGrow
* Remove Stack used in Field
* Remove import
* Add transformation add modal and use it
* Hook up saving
* Add transformation vars to var list, show added transformations
* Form validation
* Remove type assertion, start building out transformation data in helper (WIP)
* Style expression better, add delete logic
* Add ability to edit, additional styling on transformation card in helper
* simplify styling, conditionally run edit set up logic
* Keep more field information in function, integrate it with new editor
* Show default label on collapsed section, use deleteButton for confirmation of deleting transformations
* Change transformation add calculations from function to hook, add label to collapsed header, add transformation tooltip
* Make correlation and editor dirty state distinctive and integrate, WIP
* Track action pane for more detailed messaging/actions
* Better cancel modal logic
* Remove changes to adminsitration transformation editor
* Remove debugging line
* Remove unneeded comment
* Add in logic for closing editor mode
* Add tests for modal logic
* Use state to build vars list for helper
* WIP
* Fix labels and dirty state
* Fix bad message and stop exiting mode if discard action is performed
* Fix tests
* Update to not use unstable component and tweak default label
* remove wrapping div
* update tests, just gotta figure out how to handle fontawesome :(
* add spinner.svg which matches the font-awesome spinner
* add mock for react-inlinesvg
* update mock and fix some tests
* fix FormField test
* fix CorrelationsPage tests
* increase timeout
* Start adding correlations editor mode
* Add selector for merge conflict resolution
* Enable saving
* Build out new corelation helper component
* flesh out save with label/description, change color
* Have breadcrumb exit correlation editor mode
* Add extension property to show/hide, use it for correlations
* Bring in feature toggle
* Remove unnecessary param
* Cleanup
* Parse logs json
* Work on correlation edit mode bar
* Tinker with a top element for the editor mode
* Handle various explore state changes with correlations editor mode
* WIP - add unsaved changes modal
* Have correlation bar always rendered, sometimes hidden
* Add various prompt modals
* Clear correlations data on mode bar unmount, only use not left pane changes to count as dirty
* Move special logic to explore
* Remove all shouldShow logic from plugin extensions
* remove grafana data changes
* WIP - clean up correlations state
* Interpolate data before sending to onclick
* Override outline button coloring to account for dark background
* More cleanup, more color tweaking
* Prettier formatting, change state to refer to editor
* Fix tests
* More state change tweaks
* ensure correlation save ability, change correlation editor state vars
* fix import
* Remove independent selector for editorMode, work close pane into editor exit flow
* Add change datasource post action
* Clean up based on PR feedback, handle closing left panel with helper better
* Remove breadcrumb additions, add section and better ID to cmd palette action
* Interpolate query results if it is ran with a helper with vars
* Pass the datasource query along with the correlate link to ensure the datasource unique ID requirement passes
* Use different onmount function to capture state of panes at time of close instead of time of mount
* Fix node graph’s datalink not working
* Actually commit the fix to saving
* Fix saving correlations with mixed datasource to use the first query correlation UID
* Add tracking
* Use query datasources in mixed scenario, move exit tracking to click handler
* Add correlations to a place where both can be used in the correlations editor
* Be more selective on when we await the datasource get
* Fix CSS to use objects
* Update betterer
* Add test around new decorator functionality
* Add tests for decorate with correlations
* Some reorganization and a few tweaks based on feedback
* Move dirty state change to state function and out of component
* Change the verbiage around a little
* Various suggestions from Gio
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
* More small Gio-related tweaks
* Tie helper data to datasource - clear it out when the datasource changes
* Missed another Gio tweak
* Fix linter error
* Only clear helper data on left pane changes
* Add height offset for correlation editor bar so it doesn’t scroll off page
---------
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
* Allow creating correlations for provisioned data sources
* Update docs
* Fix linting
* Add missing props
* Add missing props
* Fix linting
* Fix linting
* Clarify error name
* Removed error handling for a non-existing use case
* Create a list of deleted data datasources based on all configs
* Add org_id to correlations
* Add tests
* Allow org_id to be null in case org_id=0 is used
* Create organization to ensure stable id is generated
* Fix linting
* Ensure backwards compatibility
* Add deprecation information
* Update comments
* Override existing datasSource variable so the UID is retrieved correctly
* Migrate correlations indices
* Default org_id when migrating
* Remove redundant default
* Make PK non-nullable
* Post merge fixes
* Separate data sources / correlations provisioning
* Adjust comments
* Store new data sources in spy store so it can be used to test correlations as well
* Fix linting
* Update tests
* Ensure response is closed
* Avoid creating duplicates during provisioning
* Fix updating provisioned column and update tests
* Rename error message
* Fix linting errors
* Fix linting errors and rename variable
* Update test
* Update pkg/services/sqlstore/migrations/correlations_mig.go
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
* Remove unused error
* Fix lining
---------
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
* Add pagination params and apply to sql
* Create getCorrelationsResponse that returns metadata
* Set up pagination, change correlations fetch to only get source datasource correlations
* Move correlations from root to pane, only fetch correlations for one datasource when initialized or datasource is changed
* Fix tests
* Fix remaining tests
* Use functional component to handle state
* Remove unneeded mocks, fix tests
* Change perPage to limit
* Fix Go Tests
* Fix linter
* Remove parameter
* Account for mixed datasources
* Delete unused hook
* add source UID filter to API, start backing out front end hook changes
* add source IDs to API, use when loading or changing datasource
* Fix prettier
* Mock correlations response
* Get correlations for all datasources in mixed scenario
* Add documentation for new parameters
* Attempt to fix swagger
* Fix correlations page
* add swagger and openapi docs
* Add mocks to failing test
* Change API for consistency, remove extra hooks and unused function
* Add max to limit and re-gen api docs
* Move the page to the previous page if deleting all the rows on the page
* Only fetch if remove does not have value
* Change page to a reference hook
* Fix documentation, a test and some logic thinking page could be 0
* Account for restricted datasource
* Allow for fetching datasource to return undefined and beef up filtering after to remove invalid datasources
* Revert "Account for restricted datasource"
This reverts commit 1087159b93.
* Empty-Commit
* refactor: tooltip is required
* refactor: add tooltips
* refactor: add tooltips
* refactor: add tooltips
* refactor: add tooltips
* refactor: add tooltips
* refactor: add tooltips
* refactor: adjust tests
* refactor: apply changes from code review
* refactor: adjust component for e2e test
* refactor: adjust fallback
* refactor: apply changes from code review
* refactor: apply changes from code review
* refactor: set IconButton default as type=button and remove from use cases
* refactor: remove aria-labels when duplicated and type=button from use cases
* refactor: clean up
* refactor: fix tests
* refactor: fix type errors
* refactor: remove changes in order in order to add them to a separate PR
* refactor: set IconButton default as type=button
* refactor: remove tooltip
* refactor: apply changes requested in review
* Enable correlations links for traceView formatted fields
* Add other links to the span UI
* Show both “legacy” and dataframe links
* bandaid test
* Remove special path logic, stringify all non strings before applying regex
* Fix test
* Do not create new instance of factory for every call, change header to correlations
* Get links from more than one field
* Remove categories
* Fix google cloud link tests
* Add test for multiple internal links
* Remove changes to datasources provisioning
* Added sorting, changed log link title
* There was an attempt
* Change disabled state based on transformation type
* Add validation to transformation type
* Revert "Add validation to transformation type"
This reverts commit 2188a3d9a93aec5eeafcdd40510391ba1a53671a.
* Add validation to transformation type
* Move transformations editor to a separate file
* Make name more descriptive
* Ensure type dropdown has always the same width
* Add tooltips around transformation options
* Slight style changes
* Remove autofocus on append, integrate read only to transformationeditor, save values that disappear so they come back
* Remove yaml changes
* Have variable background color work with alternating colors on different themes
* Make expression required for regular expressions
* Remove unused empty form object
* Fix bug about transformation’s values saved in memory
* Better validation formatting for expression
* Add labels and (for now) non working test, attempt to fix saved transformation delete/add bug
* Fix datalink comment
* Remove fancy CSS due to background change
* Fix deleting saved transformation bug, finish tests
* Consolidate transformation types
* Double check aria labels
* Change aria labels, fix tests
* Add a transformation with the create correlation test
---------
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
* Show variables used in the target query
* Remove redundant dot
* Add usage stats about correlations
* Revert "Add usage stats about correlations"
This reverts commit 6f0c70084a.
* Create simple Wizard for Correlations editor
* Allow using custom navigation in the wizard
* Update types
* Add more info
* Add comments
* Update comments
* Remove main info box to avoid having too many info boxes
* Fix CorrelationsPage.test.tsx
* Add Wizard test
* Simplify Correlations wizard
* Make expected typing error more explicit
* Don't use meaningless defaults
* 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
* 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
* Check for expression with regex transformations
* Keybindings: No global keybindings on chromeless pages
* simplify condition
* Refactoring
* Align name and file
* Move logic into AppChrome
* minor fix
* Update Page.tsx
* Fixing test
* Fixed tests
* More fixes
* Fixed more tests
* Fixing final test
* Fixed search in old nav
* feat(UI/Alert): add two new optional properties: 'ariaLabel' and 'role'
* docs(UI/Alert): add some docs to the props
* feat: infer the role based on the severity
* fix: stop overriding props
* fix: fix a test depending on the wrong alert role
* feat: add draft version of validate button
* feat: add some styling and basics
* temp: intermediate result
* refactor: solve TODOs
* refactor: replace string in state
* refactor: replace error message style
* refactor: set validate state on change in ds
* refactor: add QueryRunner
* refactor: add QueryRunner
* temp: temporary status
* Emit PanelData to check if the query is valid
* refactor: clean up
* refactor: improve a11y of error message and adjust test
* Remove deprecated property call, change equality
* refactor: add changes from code review
* refactor: remove memory leak
* refactor: replace query runner
* refactor: adjust error handling
* refactor: move testing to related unit test
* refactor: clean up test for QueryEditorField
* refactor: clean up test for CorrelationsPage
* refactor: repair test
* refactor: clean up
* refactor: add refId in order avoid errors when running Loki queries
* refactor: replace buildQueryTransaction + set query to invalid if query is empty
* refactor: add empty query value to test cases
* refactor: end handleValidation after setIsValidQuery()
* refactor: refactor test
* refactor: fix last two tests
* refactor: modify validation
* refactor: add happy path
* refactor: clean up
* refactor: clean up tests (not final)
* refactor: further clean up
* refactor: add condition for failing
* refactor: finish clean up
* refactor: changes from code review
* refactor: add response state to condition
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
* refactor: fix prettier issue
* refactor: remove unused return
* refactor: replace change in queryAnalytics.ts
* refactor: remove correlations from query analytics
* refactor: remove unnecessary test preparation
* refactor: revert changes from commit 4997327
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
Co-authored-by: Kristina Durivage <kristina.durivage@grafana.com>
* Attach static generic data link to data frames in Explore
* WIP
* Always load correlations config when the query is run
This will be moved to Wrapper.tsx and called only once Explore is mounted
* remove comment
* Load the config when Explore is loaded
* Clean up
* Check for feature toggle, simplify cod
* Simplify the code
* Remove unused code
* Fix types
* Add a test for attaching links
* Revert package.json changes
* Display title provided in the correlation label
* Add missing mocks
* Fix tests
* Merge branch 'main' into ifrost/integration/attach-generic-data-link
# Conflicts:
# public/app/features/explore/Wrapper.tsx
# public/app/features/explore/state/main.ts
* Remove redundant async calls
* Do not block Wrapper before correlations are loaded (only delay the query)
* Test showing results after correlations are loaded
* Post-merge fix
* Use more consistent naming
* Avoid null assertions
Co-authored-by: Elfo404 <me@giordanoricci.com>