grafana/pkg/api
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
..
apierrors Plugins: Refactor plugin dashboards (#44315) 2022-01-28 10:28:33 +01:00
avatar
datasource Check for empty URLs when creating/updating a data source (#42837) 2022-01-31 12:39:55 -03:00
docs Navigation: Introduce a preferences table to store Navbar preferences (#44914) 2022-03-17 12:07:20 +00:00
dtos Navigation: Introduce a preferences table to store Navbar preferences (#44914) 2022-03-17 12:07:20 +00:00
frontendlogging Logger migration from log15 to gokit/log (#41636) 2022-01-06 22:28:05 +08:00
navlinks
pluginproxy Plugins: Plugin settings refactor (#46246) 2022-03-04 17:09:50 +01:00
response
routing Instrumentation: Fix HTTP request instrumentation of authentication failures (#44234) 2022-02-02 18:48:46 +01:00
static API: Extract OpenAPI specification from source code using go-swagger (#40528) 2022-02-08 13:38:43 +01:00
accesscontrol.go Access control: Move data source actions and scopes to datasource package (#46594) 2022-03-16 15:11:03 +01:00
admin.go Chore: Remove bus from admin (#44920) 2022-02-04 17:53:58 +01:00
admin_provisioning.go Chore: Remove Dispatch and AddHandler (#42603) 2021-12-02 18:08:59 +01:00
admin_provisioning_test.go
admin_test.go Chore: Remove bus from admin (#44920) 2022-02-04 17:53:58 +01:00
admin_users.go Chore: Remove bus from admin users (#44869) 2022-02-04 13:45:42 -05:00
admin_users_test.go Security: Sync security changes on main (#45083) 2022-02-09 13:44:38 +01:00
alerting.go Fix alerting methods using AlertNotificationService (#45477) 2022-02-16 18:54:29 +01:00
alerting_test.go Security: Sync security changes on main (#45083) 2022-02-09 13:44:38 +01:00
annotations.go Access control: adding FGAC to annotation GET endpoints and fixed roles (#45102) 2022-02-11 15:43:29 -03:00
annotations_test.go Access control: adding FGAC to annotation GET endpoints and fixed roles (#45102) 2022-02-11 15:43:29 -03:00
api.go Navigation: Introduce a preferences table to store Navbar preferences (#44914) 2022-03-17 12:07:20 +00:00
apikey.go Separate API key store from SA token store (#45862) 2022-02-28 11:30:45 +01:00
app_routes.go Plugins: Plugin settings refactor (#46246) 2022-03-04 17:09:50 +01:00
basic_auth.go
basic_auth_test.go
comments.go Comments: support live comments in dashboards and annotations (#44980) 2022-02-22 10:47:42 +03:00
common_test.go Plugins: Refactor GetPluginDashboards/LoadPluginDashboard (#46316) 2022-03-10 18:38:04 +01:00
dashboard.go Access control: Move call to create default permissions into folder and dashboard service (#46186) 2022-03-10 12:58:18 +01:00
dashboard_permission.go Access control: Use access control for dashboard and folder (#44702) 2022-03-03 15:05:47 +01:00
dashboard_permission_test.go Folder name scope resolver (#46380) 2022-03-10 12:19:50 -05:00
dashboard_snapshot.go add dashboardsnap as service of http server (#45461) 2022-02-17 09:31:26 +01:00
dashboard_snapshot_test.go add dashboardsnap as service of http server (#45461) 2022-02-17 09:31:26 +01:00
dashboard_test.go Folder name scope resolver (#46380) 2022-03-10 12:19:50 -05:00
dataproxy.go
datasources.go Dashboard Extractor: Don't fail when using default OSS implementation (#46024) 2022-03-02 11:04:29 +01:00
datasources_test.go Access control: Move data source actions and scopes to datasource package (#46594) 2022-03-16 15:11:03 +01:00
fakes.go
folder.go Access control: Move call to create default permissions into folder and dashboard service (#46186) 2022-03-10 12:58:18 +01:00
folder_permission.go Access control: Use access control for dashboard and folder (#44702) 2022-03-03 15:05:47 +01:00
folder_permission_test.go Folder name scope resolver (#46380) 2022-03-10 12:19:50 -05:00
folder_test.go Access control: Use access control for dashboard and folder (#44702) 2022-03-03 15:05:47 +01:00
frontend_logging.go Logger migration from log15 to gokit/log (#41636) 2022-01-06 22:28:05 +08:00
frontend_logging_test.go Security: Sync security changes on main (#45083) 2022-02-09 13:44:38 +01:00
frontend_metrics.go Chore: Report frontend metrics for JS/CSS load time (#42421) 2021-12-02 09:34:39 +01:00
frontendsettings.go Access control: Move licensing actions to licensing package (#46588) 2022-03-16 14:37:19 +01:00
frontendsettings_test.go Plugins: Plugin settings refactor (#46246) 2022-03-04 17:09:50 +01:00
grafana_com_proxy.go
health.go Chore: Remove bus from health api (#44897) 2022-02-04 14:33:35 +01:00
health_test.go Chore: Remove bus from health api (#44897) 2022-02-04 14:33:35 +01:00
http_server.go Plugins: Refactor GetPluginDashboards/LoadPluginDashboard (#46316) 2022-03-10 18:38:04 +01:00
http_server_test.go
index.go Navigation: Introduce a preferences table to store Navbar preferences (#44914) 2022-03-17 12:07:20 +00:00
ldap_debug.go ldap debug bus removal (#45014) 2022-02-09 11:45:31 +01:00
ldap_debug_test.go ldap debug bus removal (#45014) 2022-02-09 11:45:31 +01:00
login.go Configuration: Add ability to customize okta login button name and icon (#44079) 2022-02-16 11:35:00 -05:00
login_oauth.go Chore: add setting to skip org assignment for external users (#34834) 2022-02-21 17:34:47 +01:00
login_oauth_test.go Chore: Move remaining web framework code to pkg/web, remove macaron binding module (#43018) 2021-12-13 15:56:14 +01:00
login_test.go remove bus from login (#44995) 2022-02-09 17:17:09 +01:00
metrics.go ValidatedQueries: start of validated queries API (#44731) 2022-03-07 09:33:01 -09:00
metrics_test.go ValidatedQueries: start of validated queries API (#44731) 2022-03-07 09:33:01 -09:00
org.go Chore: Remove bus.Dispatch from provisioning services (#44989) 2022-02-23 11:12:37 +01:00
org_invite.go Remove bus from org invite api (#44530) 2022-01-31 17:24:52 +01:00
org_test.go ValidatedQueries: start of validated queries API (#44731) 2022-03-07 09:33:01 -09:00
org_users.go AccessControl: Compute metadata from context permissions (#45578) 2022-02-18 11:27:00 +01:00
org_users_test.go ValidatedQueries: start of validated queries API (#44731) 2022-03-07 09:33:01 -09:00
password.go Chore: Remove bus from password (#44482) 2022-02-03 10:33:46 +01:00
playlist.go Chore: Remove bus from signup and playlist api (#44485) 2022-01-27 10:33:02 +01:00
playlist_play.go Chore: Remove bus from signup and playlist api (#44485) 2022-01-27 10:33:02 +01:00
plugin_dashboards.go Plugins: Refactor GetPluginDashboards/LoadPluginDashboard (#46316) 2022-03-10 18:38:04 +01:00
plugin_dashboards_test.go Plugins: Refactor GetPluginDashboards/LoadPluginDashboard (#46316) 2022-03-10 18:38:04 +01:00
plugins.go Plugins: Refactor GetPluginDashboards/LoadPluginDashboard (#46316) 2022-03-10 18:38:04 +01:00
plugins_test.go Security: Sync security changes on main (#45083) 2022-02-09 13:44:38 +01:00
preferences.go Navigation: Introduce a preferences table to store Navbar preferences (#44914) 2022-03-17 12:07:20 +00:00
preferences_test.go Navigation: Introduce a preferences table to store Navbar preferences (#44914) 2022-03-17 12:07:20 +00:00
quota.go Remove bus from quota, preferences, plugins, user_token (#44762) 2022-02-03 09:20:20 +01:00
quota_test.go ValidatedQueries: start of validated queries API (#44731) 2022-03-07 09:33:01 -09:00
render.go Dash previews: populate crawler queue from SQL query (#44083) 2022-02-09 13:23:32 +04:00
search.go remove bus from search service (#44825) 2022-02-03 18:46:38 +01:00
short_url.go Chore: Refactor api handlers to use web.Bind (#42199) 2021-11-29 10:18:01 +01:00
short_url_test.go Security: Sync security changes on main (#45083) 2022-02-09 13:44:38 +01:00
signup.go Remove bus from org invite api (#44530) 2022-01-31 17:24:52 +01:00
stars.go Chore: Remove bus from team (#44218) 2022-01-24 11:52:35 +01:00
swagger.go API: Extract OpenAPI specification from source code using go-swagger (#40528) 2022-02-08 13:38:43 +01:00
team.go AccessControl: Compute metadata from context permissions (#45578) 2022-02-18 11:27:00 +01:00
team_members.go Access control: Set default permissions for data sources when using access control (#45482) 2022-02-17 14:03:45 +01:00
team_members_test.go ValidatedQueries: start of validated queries API (#44731) 2022-03-07 09:33:01 -09:00
team_test.go Access control: Set default permissions for data sources when using access control (#45482) 2022-02-17 14:03:45 +01:00
user.go AccessControl: Compute metadata from context permissions (#45578) 2022-02-18 11:27:00 +01:00
user_test.go Bus: Tests cleanup (#46025) 2022-03-02 11:05:31 +01:00
user_token.go Remove bus from quota, preferences, plugins, user_token (#44762) 2022-02-03 09:20:20 +01:00
user_token_test.go Chore: Remove bus from Alerting API (#44894) 2022-02-04 13:41:15 +01:00
utils.go