Commit Graph

81 Commits

Author SHA1 Message Date
idafurjes
7e5544ab21
Add MFolderIDsServiceCount to count folderIDs in services pkg (#81237) 2024-01-25 11:10:35 +01:00
Jo
0de66a8099
Authz: Remove use of SignedInUser copy for permission evaluation (#78448)
* remove use of SignedInUserCopies

* add extra safety to not cross assign permissions

unwind circular dependency

dashboardacl->dashboardaccess

fix missing import

* correctly set teams for permissions

* fix missing inits

* nit: check err

* exit early for api keys
2023-11-22 14:20:22 +01:00
Kat Yang
71dd335bf8
Chore: Deprecate FolderID in Hit (#77623)
* Chore: Deprecate FolderID in Hit

* chore: regen specs

* chore: remove accidental deprecation comment
2023-11-07 09:51:54 -05:00
Kat Yang
a5044fe6db
Chore: Deprecate FolderIds in Query (#77624)
Chore: Deprecate FolderID in Query
2023-11-07 09:51:44 -05:00
Gabriel MABILLE
96cbe70b14
User: Support sort query param for user and org user, search endpoints (#75229)
* User: Add sort option to user search

* Switch to an approach that uses the dashboard search options

* Cable user sort on the org endpoint

* Alias user table with u in org store

* Add test and cover orgs/:orgID/users/search endpoint

* Add test to userimpl store

* Simplify the store_test with sortopts.ParseSortQueryParam

* Account for PR feedback

* Positive check

* Update docs

* Update docs

* Switch to ErrOrFallback

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

---------

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2023-09-28 10:16:18 +02:00
Josh Hunt
7bc6d32eb9
Search API: Search by folder UID (#65040)
* Search: Attempt to support folderUID filter

* Search: Use folder UID instead of ID for searching folders

* Update swagger

* Fix JSON property casing

* Add integration test

* Remove redundant query condition

* Fix frontend test

* Fix listing dashboards in General/root

* Add support for fetching top level folders

using `folderUIDs=` (empty string) query parameter

* Add deprecation notice

* Send uid of general in sql.ts

* Use 'general' for query folderUIDs query param for fetching folder

* Add tests

* Fix FolderUIDFilter

---------

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2023-08-04 12:43:47 +03:00
Serge Zaitsev
f19569d61d
Chore: Remove result field from search (#65583)
remove result field from search
2023-03-30 11:28:12 +02:00
Serge Zaitsev
4b551ae532
Chore: Remove result field from dashboards (#65249)
remove result field from dashboards
2023-03-30 07:29:52 +02:00
Ieva
f966045129
Search: Improvements for starred dashboard search (#64758)
* improvements for starred dashboard search

* fix workflows for the case when no dashboards are starred

* PR feedback (don't query DB if starred dashboards and requested but no starred IDs are found) and linting

* return empty list not null in case of no starred dashboards

* return empty list not null in case of no starred dashboards pt 2

* return empty list not null in case of no starred dashboards pt 3
2023-03-16 09:20:07 +00:00
idafurjes
3bda112c5f
Chore: Move search model from models package to search service (#62215)
* Chore: Move search model from models package to search service

* Remove unused imports

* Cleanup after merge
2023-01-30 15:17:53 +01:00
Serge Zaitsev
bc2813ef06
Chore: Fix goimports grouping in pkg/services (#62420)
* fix goimports

* fix goimports order
2023-01-30 08:21:27 +00:00
Kristin Laemmert
e8b8a9e276
chore: move dashboard_acl models into dashboard service (#62151) 2023-01-26 08:46:30 -05: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
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
idafurjes
a14621fff6
Chore: Add user service method SetUsingOrg and GetSignedInUserWithCacheCtx (#53343)
* Chore: Add user service method SetUsingOrg

* Chore: Add user service method GetSignedInUserWithCacheCtx

* Use method GetSignedInUserWithCacheCtx from user service

* Fix lint after rebase

* Fix lint

* Fix lint error

* roll back some changes

* Roll back changes in api and middleware

* Add xorm tags to SignedInUser ID fields
2022-08-11 13:28:55 +02: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
Ryan McKinley
d452322aa8
Search (SQL): support dashboardUID query parameter (#50121) 2022-06-02 12:56:01 -07:00
Kristin Laemmert
debbb8d59d
sqlstore: finish removing Find and SearchDashboards (#49347)
* chore: replace artisnal FakeDashboardService with generated mock

Maintaining a handcrafted FakeDashboardService is not sustainable now that we are in the process of moving the dashboard-related functions out of sqlstore.

* sqlstore: finish removing Find and SearchDashboards

Find and SearchDashboards were previously copied into the dashboard service. This commit completes that work, removing Find and SearchDashboards from the sqlstore and updating callers to use the dashboard service.

* dashboards: remove SearchDashboards from Store interface

SearchDashboards is a wrapper around FindDashboard that transforms the results, so it's been moved out of the Store entirely and the functionality moved into the Dashboard Service's search implementation.

The database tests depended heavily on the transformation, so I added testSearchDashboards, a copy of search dashboards, instead of (heavily) refactoring all the tests.
2022-05-24 09:24:55 -04:00
ying-jeanne
e2ea064584
integrat star service into APIs (#49220) 2022-05-19 14:32:10 +02:00
Serge Zaitsev
e86b6662a1
Chore: Remove bus.Bus field (#47695)
* Chore: Remove bus.Bus field

* fix integration test
2022-04-13 15:24:13 +02:00
Serge Zaitsev
18e93c7077
Chore: Remove bus (#47511)
* Chore: Remove bus

* remove unused const
2022-04-08 16:15:06 +02:00
ying-jeanne
0d5a6c2194
remove bus from search and avoid import cycle (#46789)
* fix the import cicle

* fix some unittest

* fix removal bus from search
2022-03-21 23:54:30 +08:00
Serge Zaitsev
058e3ffc21
Chore: Remove bus from Alerting API (#44894)
* assign handlers to httpserver

* turn sqlstore mock in to a pointer

* add search service interface

* fix tests for alerting and other apis

* once again, make linter happy
2022-02-04 13:41:15 +01:00
ying-jeanne
c5211f848d
remove bus from search service (#44825) 2022-02-03 18:46:38 +01:00
idafurjes
82892331c1
Chore: Remove bus from signup and playlist api (#44485)
* Remove bus from signup and playlist api

* Remove bus from playlist play
2022-01-27 10:33:02 +01:00
idafurjes
8e6d6af744
Rename DispatchCtx to Dispatch (#43563) 2021-12-28 17:36:22 +01:00
idafurjes
7936c4c522
Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
Marcus Efraimsson
2d2f7afbde
Chore: Propagate context for search (#41010)
Propagate context for search.Query, FindPersistedDashboardsQuery, 
GetUserStarsQuery. Followup on context.TODO added by #40810.

Ref #36734
2021-10-28 11:29:07 +02:00
Will Browne
67449b95e9
dispatch with context where missing (#40810) 2021-10-27 15:57:06 +02:00
Arve Knudsen
78596a6756
Migrate to Wire for dependency injection (#32289)
Fixes #30144

Co-authored-by: dsotirakis <sotirakis.dim@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Co-authored-by: spinillos <selenepinillos@gmail.com>
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: Leonard Gram <leo@xlson.com>
2021-08-25 15:11:22 +02:00
Carl Bergquist
4710566514
bus: add ctx for all signed in user queries (#33970)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-05-18 18:24:42 +02:00
Hugo Häggmark
20ee0e9601
LibraryPanels: Adds panel type filter and sorting (#33425)
* Wip: inital commit

* Chore: updating api

* Refactor: adds description search and sorting

* Refactor: adds panel filtering

* Refactor: limits the height of select

* Tests: updates snapshot

* Refactor: small UI improvements
2021-04-28 09:18:13 +02:00
Alex Khomenko
c21e45e428
Search: display sort metadata (#31167)
* Search: display metadata

* Search: update SortPicker icon

* Search: display folder meta data

* Search: reset sort picker on layout change

* Search: align tags in Card component

* Search: replace hyphen with dash

* Search: preserve sort state on layout change

* Search: update tests

* Search: fix tests

* Update pkg/services/search/hits.go

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Update public/app/features/search/components/SearchItem.tsx

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Update public/app/features/search/components/SearchItem.tsx

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Update public/app/features/search/types.ts

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Search: fix type error

* Search: add General folder name and adjust icon margin

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
2021-02-17 14:06:19 +02:00
Agnès Toulet
3303e28b38
Search: add sort information in dashboard results (#30609)
* Search: add SortMeta in dashboard results

* fix integration tests

* trim SortMeta

* fix searchstore tests

* Update pkg/services/sqlstore/dashboard.go

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2021-02-11 08:49:16 +01:00
Marcus Efraimsson
b97d1f4170
Provisioning: Fix bug when provision app plugins using Enterprise edition (#26340)
In OSS provisioning service init after plugin registration, but in
Enterprise it's the opposite order and installed app plugin check
fails. This adjusts service registry init priority to make sure plugins
are registered before provisioning inits.

Which issue(s) this PR fixes:
Fixes #26336
2020-07-16 10:36:08 +02:00
Emil Tullstedt
078d08d036
Search: Support multiple order filters (#24230) 2020-05-06 11:42:52 +02:00
Emil Tullstedt
830e8dc5fd
Search: Replace search implementation (#23855) 2020-04-27 14:16:03 +02:00
Leonard Gram
8620b7c2aa
Search: raise service init prio (#23740) 2020-04-21 15:30:09 +02:00
Emil Tullstedt
55c306eb6d
Refactor search (#23550)
Co-Authored-By: Arve Knudsen <arve.knudsen@grafana.com>
Co-Authored-By: Leonard Gram <leonard.gram@grafana.com>
2020-04-20 16:20:45 +02:00
Kyle Brandt
2c3c576ca6
fix: export Bus on search service (#19773)
fix pkg/services/search/service.go:52:3: s.bus undefined (type *SearchService has no field or method bus, but does have Bus)

fixes issue introduced by #19765
2019-10-11 11:46:44 -04:00
Marcus Olsson
60f86c3b9c
Chore: Refactor GoConvey into stdlib for search service (#19765)
* Refactor GoConvey into stdlib

* Fix review comments
2019-10-11 17:08:15 +02:00
Torkel Ödegaard
8b0dd4244b
Search: Fixes search limits and adds a page parameter (#16458)
* Search: Fixes search limits and adds a page parameter

This adds a page parameter to search api without adding
any major breaking change.

It does at an api validation error when trying to use
a limit beyond 5000. This is a breaking change. We could
remove this and have it only in the docs and describe that this
is a limit that grafana will apply silently.

Fixes #16049

* Fix: Corrected wrong array slice change

* Docs: minor docs fix

* Search: fixed folder tests

* Fixed: Moved limit to correct inner query

* Search: moving limit check and page check

* Search: limit in handler is no longer needed
2019-04-17 13:07:50 +02:00
Johannes Schill
8d5ccc7831 fix: Return url when query dashboards by tag 2019-02-28 10:44:39 +01:00
Carl Bergquist
28f7b6dad1 Enable Grafana extensions at build time. (#11752)
* extensions: import and build

* bus: use predefined error

* enterprise: build script for enterprise packages

* poc: auto registering services and dependency injection

(cherry picked from commit b5b1ef875f905473af41e49f8071cb9028edc845)

* poc: backend services registry progress

(cherry picked from commit 97be69725881241bfbf1e7adf0e66801d6b0af3d)

* poc: minor update

(cherry picked from commit 03d7a6888b81403f458b94305792e075568f0794)

* ioc: introduce manuel ioc

* enterprise: adds setting for enterprise

* build: test and build specific ee commit

* cleanup: test testing code

* removes example hello service
2018-04-27 13:41:58 +02:00
Torkel Ödegaard
8e8f3c4332 dashboard and folder search with permissions 2018-02-08 17:11:01 +01:00
Marcus Efraimsson
a879dd8c0c dashboards: render correct link for folder when searching for dashboards (#10763)
Fixes #10761
2018-02-05 13:23:24 +01:00
Marcus Efraimsson
035b724725 dashboards: remove slug property in dashboard search responses
Removes slug property in dashboard search responses since this property isn't needed
anymore and it haven't been released to any stable release.
2018-01-31 18:40:54 +01:00
Marcus Efraimsson
92a0171a9b folders: change the front end route for browsing folders
Change the front end route for folders to /dashboards/f/<uid>/<slug of folder title>.
Use new route for deleting dashboard/folder by uid.
Retrieve dashboard/folder by uid when moving or deleting dashboards/folders.
2018-01-31 18:40:54 +01:00
Marcus Efraimsson
9fb7b887db dashboards: add url property to dashboard meta and search api responses
#7883
2018-01-30 23:18:34 +01:00
Torkel Ödegaard
313735bd75 search: worked on search results 2017-12-13 15:51:59 +01:00