grafana/pkg/services/sqlstore
Ashley Harrison 586272e5f0
Navigation: Introduce a preferences table to store Navbar preferences (#44914)
* First attempt at creating new navbar_preferences table in db

* Apply to every nav item instead of just home

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* Chore: introduce initTestDB options for features

* fix unit tests

* Add another unit test and some logic for detecting if a preference already exists

* tidy up

* Only override IsFeatureToggleEnabled if it's defined

* Extract setNavPreferences out into it's own function, initialise features correctly

* Make the linter happy

* Use new structure

* user essentials mob! 🔱

* user essentials mob! 🔱

* Split NavbarPreferences from Preferences

* user essentials mob! 🔱

* user essentials mob! 🔱

* Fix lint error

* Start adding tests

* Change internal db structure to be a generic json object

* GetJsonData -> GetPreferencesJsonData

* Stop using simplejson + add some more unit tests

* Update pkg/api/preferences.go

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Updates following review comments

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* Change patch to upsert, add a unit test

* remove commented out code

* introduce patch user/org preferences methods

* Return Navbar preferences in the get call

* Fix integration test by instantiating JsonData

* Address review comments

* Rename HideFromNavbar -> Hide

* add swagger:model comment

* Add patch to the preferences documentation

* Add openapi annotations

* Add a short description

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* Update unit tests

* remove unneeded url

* remove outdated comment

* Update integration tests

* update generated swagger

Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-03-17 12:07:20 +00:00
..
migrations Navigation: Introduce a preferences table to store Navbar preferences (#44914) 2022-03-17 12:07:20 +00:00
migrator Search: sort results correctly when using postgres (#46466) 2022-03-15 15:08:40 +01:00
mockstore Navigation: Introduce a preferences table to store Navbar preferences (#44914) 2022-03-17 12:07:20 +00:00
permissions Search Service to support search for folders available for alerting (#46483) 2022-03-16 14:07:04 +00:00
searchstore Search Service to support search for folders available for alerting (#46483) 2022-03-16 14:07:04 +00:00
sqlutil Chore: Add CloudWatch HTTP API tests (#29691) 2021-01-07 11:36:13 +01:00
alert_notification_test.go Refactor: Change sqlstore.inTransaction to .WithTransactionalDBSession (#43245) 2022-01-06 18:21:39 +01:00
alert_notification.go Chore: Remove x from health, alert notification, dashboard, stats, user (#45265) 2022-02-17 16:59:09 +01:00
alert_test.go Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactionalDBSession in misc files (#43926) 2022-01-25 20:30:08 +01:00
alert.go Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactionalDBSession in alert files (#43815) 2022-01-19 19:25:52 +00:00
annotation_cleanup_test.go Instrumentation: Start tracing database requests (#34572) 2021-05-27 13:55:33 +02:00
annotation_cleanup.go Annotations: Prevent orphaned annotation tags cleanup when no annotations were cleaned (#33957) 2021-05-12 10:44:00 +02:00
annotation_test.go fix for CWE-89 (#43407) 2021-12-21 19:04:56 +01:00
annotation.go fix for CWE-89 (#43407) 2021-12-21 19:04:56 +01:00
apikey_test.go Separate API key store from SA token store (#45862) 2022-02-28 11:30:45 +01:00
apikey.go Service accounts: Split user and service account database (#46442) 2022-03-14 18:24:07 +01:00
dashboard_acl.go Dashboards: Refactor service to make it injectable by wire (#44588) 2022-02-16 14:15:44 +01:00
dashboard_provisioning.go Chore: Remove bus.Dispatch from provisioning services (#44989) 2022-02-23 11:12:37 +01:00
dashboard_snapshot_test.go Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactional… (#43772) 2022-01-07 17:50:59 +01:00
dashboard_snapshot.go Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactional… (#43772) 2022-01-07 17:50:59 +01:00
dashboard_thumbs_test.go Previews: capability check (#44601) 2022-02-16 21:49:50 +04:00
dashboard_thumbs.go Previews: capability check (#44601) 2022-02-16 21:49:50 +04:00
dashboard_version_test.go Dashboards: Refactor service to make it injectable by wire (#44588) 2022-02-16 14:15:44 +01:00
dashboard_version.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
dashboard.go Search Service to support search for folders available for alerting (#46483) 2022-03-16 14:07:04 +00:00
database_wrapper.go Chore: Implement OpenTelemtry in Grafana (#42674) 2022-01-20 11:10:12 +01:00
datasource_test.go AccessControl: Remove permissions on data source delete (#45504) 2022-02-17 14:06:34 +01:00
datasource.go Chore: fix comment (#45593) 2022-02-18 11:46:52 +01:00
health_test.go Chore: Remove bus from health api (#44897) 2022-02-04 14:33:35 +01:00
health.go Chore: Remove x from health, alert notification, dashboard, stats, user (#45265) 2022-02-17 16:59:09 +01:00
logger.go Chore: Update the xorm dependency (#22376) 2020-04-01 15:57:21 +02:00
login_attempt_test.go Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactionalDBSession in misc files (#43926) 2022-01-25 20:30:08 +01:00
login_attempt.go Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactionalDBSession in misc files (#43926) 2022-01-25 20:30:08 +01:00
org_test.go Service accounts: make is_service_account nullable (#45541) 2022-02-18 13:08:00 +01:00
org_users_test.go FeatureFlags: define features outside settings.Cfg (take 3) (#44443) 2022-01-26 09:44:20 -08:00
org_users.go Service accounts: Split user and service account database (#46442) 2022-03-14 18:24:07 +01:00
org.go Chore: Remove bus.Dispatch from provisioning services (#44989) 2022-02-23 11:12:37 +01:00
playlist_test.go Chore: Add context to playlist (#41337) 2021-11-19 14:32:14 +01:00
playlist.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
plugin_setting.go Chore: Propagate context for plugin settings (#41166) 2021-11-02 13:42:55 +01:00
preferences_test.go Navigation: Introduce a preferences table to store Navbar preferences (#44914) 2022-03-17 12:07:20 +00:00
preferences.go Navigation: Introduce a preferences table to store Navbar preferences (#44914) 2022-03-17 12:07:20 +00:00
quota_test.go Chore: Add context to org (#40685) 2021-11-03 11:31:56 +01:00
quota.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
session.go Reuse opened session in the context (#44939) 2022-02-08 09:02:23 -05:00
sqlbuilder_test.go Dashboards: Refactor service to make it injectable by wire (#44588) 2022-02-16 14:15:44 +01:00
sqlbuilder.go Remove unnecesary joins from queries (#43626) 2022-01-04 13:04:02 +01:00
sqlstore_test.go Chore: update all +build statements (#38782) 2021-09-01 17:38:56 +03:00
sqlstore.go Chore: Remove bus.Dispatch from provisioning services (#44989) 2022-02-23 11:12:37 +01:00
sqlstore.goconvey feat(invite): small progress 2015-07-17 14:42:49 +02:00
star.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
stars_test.go Chore: Add context to star and stats (#39591) 2021-09-28 17:54:45 +02:00
stats_integration_test.go Chore: Remove bus from admin (#44920) 2022-02-04 17:53:58 +01:00
stats_test.go Chore: Remove bus.Dispatch from provisioning services (#44989) 2022-02-23 11:12:37 +01:00
stats.go Service Accounts: Implement basic usage stats (#46619) 2022-03-16 16:54:34 +01:00
store.go Navigation: Introduce a preferences table to store Navbar preferences (#44914) 2022-03-17 12:07:20 +00:00
tables.go Began work on real sql schema definitions, and migration engine 2015-01-17 21:40:22 +01:00
tags_test.go Chore: Remove GoConvey from sqlstore package (#40753) 2021-10-21 14:09:19 +02:00
tags.go Chore: Enable Go linter gocritic (#26224) 2020-07-16 14:39:01 +02:00
team_test.go Dashboards: Refactor service to make it injectable by wire (#44588) 2022-02-16 14:15:44 +01:00
team.go Access control: Support filter on several actions (#46524) 2022-03-14 17:11:21 +01:00
temp_user_test.go Chore: Add context to temp user (#41284) 2021-11-04 11:17:07 +01:00
temp_user.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
tls_mysql.go Chore: Fix staticcheck issues (#28854) 2020-11-05 11:57:20 +01:00
transactions_test.go Reuse opened session in the context (#44939) 2022-02-08 09:02:23 -05:00
transactions.go Reuse opened session in the context (#44939) 2022-02-08 09:02:23 -05:00
user_test.go Dashboards: Refactor service to make it injectable by wire (#44588) 2022-02-16 14:15:44 +01:00
user.go Access control: Delete user permissions when a user is deleted (#46021) 2022-03-16 10:43:44 +01:00