Commit Graph

46 Commits

Author SHA1 Message Date
Karl Persson
7386f8652c
RBAC: Improve performance of dashboard filter query (#56813)
* RBAC: Move UserRolesFilter to domain package

* Dashboard Permissions: Rewrite rbac filter to check access in sql

* RBAC: Add break when wildcard is found

* RBAC: Add tests for dashboard filter

* RBAC: Update tests

* RBAC: Cover more test cases

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2022-10-25 11:14:27 +02:00
Kristin Laemmert
05709ce411
chore: remove sqlstore & mockstore dependencies from (most) packages (#57087)
* chore: add alias for InitTestDB and Session

Adds an alias for the sqlstore InitTestDB and Session, and updates tests using these to reduce dependencies on the sqlstore.Store.

* next pass of removing sqlstore imports
* last little bit
* remove mockstore where possible
2022-10-19 09:02:15 -04:00
owensmallwood
b2408dd7c5
Publicdasboards: Add annotations support (#56413)
adds annotations support for public dashboards
2022-10-18 19:48:20 -06:00
Kristin Laemmert
c61b5e85b4
chore: replace sqlstore.Store with db.DB (#57010)
* chore: replace sqlstore.SQLStore with db.DB

* more post-sqlstore.SQLStore cleanup
2022-10-14 15:33:06 -04:00
Sofia Papagiannaki
8b77ee2734
SQLStore: Ensure that sessions are always closed (#55864)
* SQLStore: Ensure that sessions are always closed

Delete `NewSession()` in favour of `WithDbSession()`

* Add WithDbSessionForceNewSession to the interface

* Apply suggestions from code review
2022-09-29 15:55:47 +03:00
ying-jeanne
2472777ce2
Chore: implement sqlx into tag service (#55908)
* add sqlx store to tag service

* add sqlx into tag service

* fix test

* change to camal cases

* change in xorm camal case
2022-09-28 08:23:40 -04:00
Sofia Papagiannaki
d0e7765c6a
Annotation: Optionally allow storing longer annotation tags (#54754)
* Annotation: Optionally allow longer annotation tags

* Do not accept configuration lower than today's default (500)

* Apply suggestion from code review
2022-09-23 06:04:41 -04:00
Sofia Papagiannaki
2f14575dd3
Chore: Move annotations cleanup to the annotations service (#55618) 2022-09-22 15:27:48 +03:00
ying-jeanne
7b4cea8151
Chore: StoreSplit tag service (#55453)
* move tag service outside

* fix dashboard

* fix test

* lint

* fix linter

* remove spew
2022-09-21 08:04:01 -04:00
Sofia Papagiannaki
754eea20b3
Chore: SQL store split for annotations (#55089)
* Chore: SQL store split for annotations

* Apply suggestion from code review
2022-09-19 10:54:37 +03:00
idafurjes
6afad51761
Move SignedInUser to user service and RoleType and Roles to org (#53445)
* Move SignedInUser to user service and RoleType and Roles to org

* Use go naming convention for roles

* Fix some imports and leftovers

* Fix ldap debug test

* Fix lint

* Fix lint 2

* Fix lint 3

* Fix type and not needed conversion

* Clean up messages in api tests

* Clean up api tests 2
2022-08-10 11:56:48 +02:00
ying-jeanne
7da0a6d3ce
Chore: Add dashboard UID as query parameter of Get annotation endpoint (#52764)
* Chore: Add dashboard uid as query parameter of Get annotation endpoint

* Update pkg/api/annotations.go

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* update the dashboarUID

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2022-07-26 21:52:34 -04:00
ying-jeanne
bde368be55
Chore : Replace dashboardid with dashboardUID in annotation API (#48481)
* replace dashboardid with dashboardUID in annotation API

* add some tests

* modify some docs and add uid into get endpoint

* rebase with main

* add map for avoiding too much retrieve on dashboards
2022-05-02 11:35:36 +02:00
Ieva
ef4c2672b3
Access control: SQL filtering for annotation listing (#47467)
* pass in user to attribute scope resolver

* add SQL filter to annotation listing

* check annotation FGAC permissions before exposing them for commenting

* remove the requirement to be able to list all annotations from annotation listing endpoint

* adding tests for annotation listing

* remove changes that got moved to a different PR

* unused var

* Update pkg/services/sqlstore/annotation.go

Co-authored-by: Ezequiel Victorero <evictorero@gmail.com>

* remove unneeded check

* remove unneeded check

* undo accidental change

* undo accidental change

* doc update

* move tests

* redo the approach for passing the user in for scope resolution

* accidental change

* cleanup

* error handling

Co-authored-by: Ezequiel Victorero <evictorero@gmail.com>
2022-04-11 13:18:38 +01:00
Kat Yang
90f2233ea9
Chore: Remove global database engine variable from annotation (#46940)
* Chore: Remove global database engine variable from annotation

* 💩
2022-03-25 13:23:09 -04:00
Ezequiel Victorero
c5f295b5b3
Access Control: adding FGAC validation to mass delete annotation endpoint (#46846)
* Access Control: adding FGAC validation to mass delete annotation endpoint
2022-03-23 18:39:00 -03:00
ying-jeanne
adc0cbf176
remove global variable in annotation (#46746)
* remove global varaible in annotation

* remove todo

* replace intransaction with withdbtransaction

* fix typo
2022-03-22 19:20:57 +08:00
Ezequiel Victorero
c717320942
Adding FGAC annotations validation for creation and deletion (#46736)
Access Control: Adding FGAC annotations validation for creation and deletion
Co-authored-by: IevaVasiljeva <ieva.vasiljeva@grafana.com>
2022-03-21 14:28:39 -03:00
Ieva
f2450575b3
Access control: FGAC for annotation updates (#46462)
* proposal

* PR feedback

* fix canSave bug

* update scope naming

* linting

* linting

Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
2022-03-18 17:33:21 +01:00
Hugo Häggmark
44c48ecebb
Chore: Replace util.DynMap with structs (#36332)
* Chore: Replace util.DynMap

* Chore: added comments
2021-07-01 10:23:33 +02:00
Hugo Häggmark
63f9231de1
Annotations: Adds tags endpoint (#36199)
* Annotations: Adds tags endpoint

* Chore: fixes sql  statement

* Refactor: adds count to the api

* Chore: changes after PR comments

* Refactor: changes after PR comments
2021-06-30 13:42:54 +02:00
Carl Bergquist
e1458391bb
API: Return 400 on invalid Annotation requests (#32429)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-03-29 15:47:16 +02:00
Dafydd
af3c0fe602
Bugfix 29848: Remove annotation_tag entries as part of annotations cleanup (#29534)
closes https://github.com/grafana/grafana/issues/29484
2020-12-08 19:41:35 +01:00
Arve Knudsen
dff84f6a31
Chore: Remove dead code (#28664)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-05 11:00:00 +01:00
Carl Bergquist
20747015f6
Annotation: Add clean up job for old annotations (#26156)
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-09-02 08:07:31 +02:00
Ryan McKinley
6335509a23 Annotations: use a single row to represent a region (#17673)
* SQLite migrations

* cleanup

* migrate end times

* switch to update with a query

* real migration

* anno migrations

* remove old docs

* set isRegion from time changes

* use <> for is not

* add comment and fix index decleration

* single validation place

* add test

* fix test

* add upgrading docs

* use AnnotationEvent

* fix import

* remove regionId from typescript
2019-08-16 10:49:30 +02:00
bergquist
aed8208d78 renames PartialMatch to MatchAny 2018-09-13 15:15:42 +02:00
bergquist
1638c6bea1 enable partial tag matches for annotations 2018-09-11 15:50:04 +02:00
Torkel Ödegaard
132df4553c fix: annnotation api & sql issue 2018-06-25 16:03:38 +02:00
ryan
a2bbd89a9e adding updated column 2018-03-22 15:52:09 +01:00
ryan
3898ea02e6 adding created column 2018-03-22 02:22:58 +01:00
Daniel Lee
3ae1bf0c16 dashfolders: permissions for saving annotations
ref #10275 Use folder permissions instead of hard coded
permissions on the annotations routes.
2018-01-09 14:44:36 +01:00
Torkel Ödegaard
0d12b37dfd fix: alert list panel now works correctly after adding manual annotation on dashboard, fixes #9951 2017-11-21 11:28:17 +01:00
Torkel Ödegaard
25aa9df270 Create annotations (#8197)
* annotations: add 25px space for events section

* annotations: restored create annotation action

* annotations: able to use fa icons as event markers

* annotations: initial emoji support from twemoji lib

* annotations: adjust fa icon position

* annotations: initial emoji picker

* annotation: include user info into annotation requests

* annotation: add icon info

* annotation: display user info in tooltip

* annotation: fix region saving

* annotation: initial region markers

* annotation: fix region clearing (add flot-temp-elem class)

* annotation: adjust styles a bit

* annotations: minor fixes

* annoations: removed userId look in loop, need a sql join or a user cache for this

* annotation: fix invisible events

* lib: changed twitter emoij lib to be npm dependency

* annotation: add icon picker to Add Annotation dialog

* annotation: save icon to annotation table

* annotation: able to set custom icon for annotation added by user

* annotations: fix emoji after library upgrade (switch to 72px)

* emoji: temporary remove bad code points

* annotations: improve icon picker

* annotations: icon show icon picker at the top

* annotations: use svg for emoji

* annotations: fix region drawing when add annotation editor opened

* annotations: use flot lib for drawing region fill

* annotations: move regions building into event_manager

* annotations: don't draw additional space if no events are got

* annotations: deduplicate events

* annotations: properly render cut regions

* annotations: fix cut region building

* annotations: refactor

* annotations: adjust event section size

* add-annotations: fix undefined default icon

* create-annotations:  edit event (frontend part)

* fixed bug causes error when hover event marker

* create-annotations:  update event (backend)

* ignore grafana-server debug binary in git (created VS Code)

* create-annotations: use PUT request for updating annotation.

* create-annotations: fixed time format when editing existing event

* create-annotations: support for region update

* create-annotations: fix bug with limit and event type

* create-annotations: delete annotation

* create-annotations: show only selected icon in edit mode

* create-annotations: show event editor only for users with at least Editor role

* create-annotations: handle double-sized emoji codepoints

* create-annotations: refactor

use CP_SEPARATOR from emojiDef

* create-annotations: update emoji list, add categories.

* create-annotations: copy SVG emoji into public/vendor/npm and use it as a base path

* create-annotations: initial tabs for emoji picker

* emoji-picker: adjust styles

* emoji-picker: minor refactor

* emoji-picker: refactor - rename and move into one directory

* emoji-picker: build emoji elements on app load, not on picker open

* emoji-picker: fix emoji searching

* emoji-picker: refactor

* emoji-picker: capitalize category name

* emoji-picker: refactor

move buildEmojiElem() into emoji_converter.ts for future reuse.

* jquery.flot.events: refactor

use buildEmojiElem() for making emojis, remove unused code for font awesome based icons.

* emoji_converter: handle converting error

* tech: updated

* merged with master

* shore: clean up some stuff

* annotation: wip tags

* annotation: filtering by tags

* tags: parse out spaces etc. from a tags string

* annotations: use tagsinput component for tag filtering

* annotation: wip work on how we query alert & panel annotations

* annotations: support for updating tags in an annotation

* linting

* annotations: work on unifying how alert history annotations and manual panel annotations are created

* tslint: fixes

* tags: create tag on blur as well

Currently, the tags directive only creates the tag when the
user presses enter. This change means the tag is created on
blur as well (when the user clicks outside the input field).

* annotations: fix update after refactoring

* annotations: progress on how alert annotations are fetched

* annotations: minor progress

* annotations: progress

* annotation: minor progress

* annotations: move tag parsing from tooltip to ds

Instead of parsing a tag string into an array in the annotation_tooltip
class, this moves the parsing to the datasources. InfluxDB ds already
does that parsing. Graphite now has it.

* annotations: more work on querying

* annotations: change from tags as string to array

when saving in the db and in the api.

* annotations: delete tag link if removed on edit

* annotation: more work on depricating annotation title

* annotations: delete tag links on delete

* annotations: fix for find

* annotation: added user to annotation tooltip and added alertName to annoation dto

* annotations: use id from route instead from cmd for updating

* annotations: http api docs

* create annotation: last edits

* annotations: minor fix for querying annotations before dashboard saved

* annotations: fix for popover placement when legend is on the side (and doubel render pass is causing original marker to be removed)

* annotations: changing how the built in query gets added

* annotation: added time to header in edit mode

* tests: fixed jshint built issue
2017-10-07 10:31:39 +02:00
Torkel Ödegaard
593b2ef866 annotation: added region support to annoations 2017-04-12 16:26:34 +02:00
Torkel Ödegaard
0156a94a49 annotations: you can now read annoations via manually created annoation query 2017-04-12 15:46:41 +02:00
Alexander Zobnin
d553498a33 graph(add annotation): initial backend implementation #1286 2017-04-10 20:22:58 +03:00
bergquist
f14e25612e annotations: go vet fixes 2017-02-15 14:15:42 +01:00
Torkel Ödegaard
c9d7eb0a7a feat(alerting): added clear history button to alert state history view, #6244 2016-10-14 09:33:42 +02:00
bergquist
d0f9623037 feat(alertlistpanel): support state filter
ref #5981
2016-09-14 10:49:05 +02:00
Torkel Ödegaard
8c30babdf1 feat(alerting): fixed build issues 2016-09-13 16:24:00 +02:00
Torkel Ödegaard
4a2f2fba73 feat(alerting): show panel specific alert annotations, #5694 2016-09-09 11:30:55 +02:00
Torkel Ödegaard
d60bd77658 feat(annotations): added support to show grafana stored annotations in graphs, #5982 2016-09-08 11:25:45 +02:00
bergquist
650a87dc05 feat(alerting): add alert history api endpoint
ref #5850
2016-08-30 09:32:56 +02:00
Torkel Ödegaard
1418cbbd8b feat(query_part): refactoring query part 2016-08-15 17:20:45 +02:00
Torkel Ödegaard
357358898d feat(annotations): working on alert annotations, #5694 2016-08-01 10:07:00 +02:00