grafana/pkg/api
owensmallwood cfdea1ee30
PublicDashboards: Frontend routing for public dashboards (#48834)
* add isPublic to dashboard

* refactor routes to use route group and add placeholder method for sharing apii

* add sharing pane and utils for public dashboard config to sharing modal

* Sharing modal now persists data through the api

* moves ShareDashboard endpoint to new file and starts adding tests

* generates mocks. Adds tests for public dashboard feature flag

* Adds ability to pass in array of features to enable for the test

* test to update public flag on dashboard WIP

* Adds mock for SaveDashboardSharingConfig

* Fixes tests. Had to use FakeDashboardService

* Adds React tests for public dashboards toggle

* removes semicolons

* refactors SharePublic component to use hooks

* rename from `share publicly` to `public dashboard config`

* checkpoint. debugging tests. need to verify name changes

* checkpoint. test bugs fixed. need to finish returning proper response codes

* finish renaming. fix test

* Update pkg/api/api.go

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* update backend url

* rename internal objects and commands. fix configuration modal labels

* add endpoint for retrieving public dashboard configuration and populate the frontend state from it

* add test for dashboardCanBePublic

* adds backend routes

* copy DashboardPage component into component for public dashboards. WIP

* adds react routes, and doesnt render main nav bar when viewing a public route

* removes extra react route from testing

* updates component name

* Wrap the original dashboard component so we can pass props relevant to public dashboards, turn kiosk mode on/off, etc

* Wraps DashboardPage in PublicDashboardPage component. DashboardPage gets rendered in kiosk mode when public prop is passed.

* removes commented out code from exploratory work

* Makes public dashboard routes require no auth

* extracts helper to own util file to check if were viewing a public page

* Hides panel dropdown when its being viewed publicly

* formatting

* use function from utils file for determining if publicly viewed. If public, hides app notifications, searchwrapper, and commandpalette.

* adds unit tests for util function used to see if page is being viewed publicly

* cant added annotations to panel when being publicly viewed

* removes useless comment

* hides backend and frontend pubdash routes behind feature flag

* consider feature flag when checking url path to see if on public dashboard

* renames function

* still render app notifications when in public view

* Extract pubdash route logic into own file

* fixes failing tests

* Determines path using location locationUtils. This covers the case when grafana is being hosted on a subpath. Updates tests.

* renames pubdash web route to be more understandable

* rename route

* fixes failing test

* fixes failing test. Needed to update pubdash urls

* sets flag on grafana boot config for if viewing public dashboard. Removes hacky check that looks at the url

* fixes failing tests. Uses config to determine if viewing public dashboard

* renders the blue panel timeInfo on public dashboard panel

* Extracts conditional logic for rendering components out into their own functions

* removes publicDashboardView check, and uses dashboard meta instead

* the timeInfo is always displayed on the panel

* After fetch of public dashboard dto, the meta isPublic flag gets set and used to determine if viewing public dashboard for child components. Fixes tests for PanelHeader.

* Fixes failing test. Needed to add isPublic flag to dashboard meta.

Co-authored-by: Jeff Levin <jeff@levinology.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2022-06-02 14:57:55 -06:00
..
apierrors Plugins: Refactor plugin dashboards (#44315) 2022-01-28 10:28:33 +01:00
avatar Dashboard: Mix initials and custom gravatars in recent viewers list (#47212) 2022-04-05 22:56:17 -04:00
datasource Check for empty URLs when creating/updating a data source (#42837) 2022-01-31 12:39:55 -03:00
docs API: Fix swagger specification (#50034) 2022-06-02 10:49:52 +03:00
dtos Datasource: Fix allowed cookies to be forwarded as header to backend datasources (#49541) 2022-05-31 17:02:58 +02:00
frontendlogging Logger migration from log15 to gokit/log (#41636) 2022-01-06 22:28:05 +08:00
navlinks show admin nav link it the user only has permissions to view licensing and not other pages under admin node (#41948) 2021-11-19 11:02:13 +00:00
pluginproxy Plugins: Support headers field for check health (#49930) 2022-05-31 17:58:06 +02:00
response Quick Ugly Fix for Oauth not to make web_hack.go panic (#49653) 2022-05-26 14:34:04 +02:00
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 AccessControl: Grant data source reader to all users when running oss (#49514) 2022-05-25 13:43:58 +02:00
admin_encryption.go Encryption: Add support for multiple data keys per day (#47765) 2022-05-23 13:13:55 +02:00
admin_provisioning_test.go Chore: Add context to org (#40685) 2021-11-03 11:31:56 +01:00
admin_provisioning.go Chore: Remove Dispatch and AddHandler (#42603) 2021-12-02 18:08:59 +01:00
admin_test.go Chore: Remove bus from admin (#44920) 2022-02-04 17:53:58 +01:00
admin_users_test.go Chore: Remove bus.Bus field (#47695) 2022-04-13 15:24:13 +02:00
admin_users.go fix status code 200 (#47818) 2022-04-15 08:01:58 -04:00
admin.go fix status code 200 (#47818) 2022-04-15 08:01:58 -04:00
alerting_test.go sqlstore split: dashboard permissions (#49962) 2022-06-01 14:16:26 -04:00
alerting.go fix status code 200 (#47818) 2022-04-15 08:01:58 -04:00
annotations_test.go sqlstore split: dashboard permissions (#49962) 2022-06-01 14:16:26 -04:00
annotations.go backend/services: Move GetDashboard from sqlstore to dashboard service (#48971) 2022-05-17 14:52:22 -04:00
api.go PublicDashboards: Frontend routing for public dashboards (#48834) 2022-06-02 14:57:55 -06:00
apikey.go Access control: Pass access control metadata for api keys (#48445) 2022-04-29 15:30:24 +02:00
app_routes.go Instrumentation: Proxy status code correction and various improvements (#47473) 2022-04-11 13:17:08 +02:00
basic_auth_test.go Macaron: remove custom Request type (#37874) 2021-09-01 11:18:30 +02:00
basic_auth.go Macaron: remove custom Request type (#37874) 2021-09-01 11:18:30 +02:00
comments.go fix status code 200 (#47818) 2022-04-15 08:01:58 -04:00
common_test.go AccessControl: Replace IsEnterprise checks with license checks (#49572) 2022-05-25 20:40:41 +02:00
dashboard_permission_test.go backend/services: Move GetDashboard from sqlstore to dashboard service (#48971) 2022-05-17 14:52:22 -04:00
dashboard_permission.go AccessControl: Create own interface and impl for each permission service (#48871) 2022-05-10 15:48:47 +02:00
dashboard_public_config_test.go chore: replace artisanal FakeDashboardService with generated mock (#49276) 2022-05-23 11:14:27 -04:00
dashboard_public_config.go sqlstore split: dashboard permissions (#49962) 2022-06-01 14:16:26 -04:00
dashboard_snapshot_test.go sqlstore split: dashboard permissions (#49962) 2022-06-01 14:16:26 -04:00
dashboard_snapshot.go fix status code 200 (#47818) 2022-04-15 08:01:58 -04:00
dashboard_test.go sqlstore split: dashboard permissions (#49962) 2022-06-01 14:16:26 -04:00
dashboard.go backend/sqlstore: move GetDashboardTags to dashboard service (#50091) 2022-06-02 10:00:47 -04:00
dataproxy.go Alerting: modify alertmanager endpoints for proxying using the datasource UID (#47978) 2022-04-29 10:25:22 +03:00
datasources_test.go Secrets: Implement basic unified secret store service (#45804) 2022-04-25 13:57:45 -03:00
datasources.go Plugins: Support headers field for check health (#49930) 2022-05-31 17:58:06 +02:00
fakes.go Plugins: Plugin Store API returns DTO model (#41340) 2021-11-17 12:04:22 +01:00
folder_permission_test.go backend/services: Move GetDashboard from sqlstore to dashboard service (#48971) 2022-05-17 14:52:22 -04:00
folder_permission.go Access control: refactor RBAC checks (#48107) 2022-04-25 10:42:09 +02:00
folder_test.go Chore: Remove bus.Bus field (#47695) 2022-04-13 15:24:13 +02:00
folder.go fix argument ordering (#48124) 2022-04-25 15:26:46 +02:00
frontend_logging_test.go Security: Sync security changes on main (#45083) 2022-02-09 13:44:38 +01:00
frontend_logging.go Logger migration from log15 to gokit/log (#41636) 2022-01-06 22:28:05 +08:00
frontend_metrics.go Chore: Report frontend metrics for JS/CSS load time (#42421) 2021-12-02 09:34:39 +01:00
frontendsettings_test.go Chore: Remove bus.Bus field (#47695) 2022-04-13 15:24:13 +02:00
frontendsettings.go AccessControl: Use RBACBuiltInRoleAssignmentEnabled in the frontend instead of FeatureToggle (#49261) 2022-05-20 06:53:28 +00:00
grafana_com_proxy.go Instrumentation: Proxy status code correction and various improvements (#47473) 2022-04-11 13:17:08 +02:00
health_test.go Chore: Remove bus from health api (#44897) 2022-02-04 14:33:35 +01:00
health.go Chore: Remove bus from health api (#44897) 2022-02-04 14:33:35 +01:00
http_server_test.go Plugins: Make backend plugin metrics endpoints available with optional authentication (#46467) 2022-03-29 11:18:26 +02:00
http_server.go API: Migrate CSRF to service and support additional options (#48120) 2022-06-02 15:52:30 +02:00
index.go PublicDashboards: Frontend routing for public dashboards (#48834) 2022-06-02 14:57:55 -06:00
ldap_debug_test.go Tracing: Use common traceID context value for opentracing and opentelemetry (#46411) 2022-04-14 17:54:49 +02:00
ldap_debug.go LDAP: Fix debug view to display the actual computed mapping in ldap.go (#48103) 2022-04-22 15:45:54 +02:00
login_oauth_test.go Fix wrap_handler() panic during OAuth login (#49671) 2022-05-26 12:18:18 +02:00
login_oauth.go Fix wrap_handler() panic during OAuth login (#49671) 2022-05-26 12:18:18 +02:00
login_test.go Logging: Unify logging fakes (#48822) 2022-05-06 17:44:22 +02:00
login.go fix status code 200 (#47818) 2022-04-15 08:01:58 -04:00
metrics_test.go backend/services: Move GetDashboard from sqlstore to dashboard service (#48971) 2022-05-17 14:52:22 -04:00
metrics.go Plugins: Remove deprecated /api/tsdb/query metrics endpoint (#49916) 2022-06-01 13:05:15 +02:00
org_invite.go fix status code 200 (#47818) 2022-04-15 08:01:58 -04:00
org_test.go ValidatedQueries: start of validated queries API (#44731) 2022-03-07 09:33:01 -09:00
org_users_test.go RBAC: Make RBAC action names more consistent (#49730) 2022-06-02 13:14:48 +01:00
org_users.go AccessControl: Replace IsEnterprise checks with license checks (#49572) 2022-05-25 20:40:41 +02:00
org.go Chore: Remove final x from sqlstore (#48086) 2022-04-25 13:07:11 -04:00
password.go fix status code 200 (#47818) 2022-04-15 08:01:58 -04:00
playlist_play.go backend/sqlstore: move GetDashboards to Dashboard Service (#49175) 2022-05-19 10:59:12 -04:00
playlist.go fix status code 200 (#47818) 2022-04-15 08:01:58 -04:00
plugin_dashboards_test.go Plugins: Refactor GetPluginDashboards/LoadPluginDashboard (#46316) 2022-03-10 18:38:04 +01:00
plugin_dashboards.go Plugins: Refactor GetPluginDashboards/LoadPluginDashboard (#46316) 2022-03-10 18:38:04 +01:00
plugin_metrics_test.go Plugins: Make backend plugin metrics endpoints available with optional authentication (#46467) 2022-03-29 11:18:26 +02:00
plugin_metrics.go Plugins: Make backend plugin metrics endpoints available with optional authentication (#46467) 2022-03-29 11:18:26 +02:00
plugin_resource.go Plugins: Refactor plugin resource call with and without data source (#48754) 2022-05-06 10:58:02 +02:00
plugins_test.go Logging: Unify logging fakes (#48822) 2022-05-06 17:44:22 +02:00
plugins.go Plugins: Support headers field for check health (#49930) 2022-05-31 17:58:06 +02:00
preferences_test.go chore: replace artisanal FakeDashboardService with generated mock (#49276) 2022-05-23 11:14:27 -04:00
preferences.go Preferences: Fix updating of preferences for Navbar and Query History (#49677) 2022-05-26 14:39:57 +02:00
quota_test.go ValidatedQueries: start of validated queries API (#44731) 2022-03-07 09:33:01 -09:00
quota.go fix status code 200 (#47818) 2022-04-15 08:01:58 -04:00
render.go Dash previews: populate crawler queue from SQL query (#44083) 2022-02-09 13:23:32 +04:00
search_test.go AccessControl: Add metadata to search result (#48879) 2022-05-17 15:51:44 +02:00
search.go Search (SQL): support dashboardUID query parameter (#50121) 2022-06-02 12:56:01 -07:00
short_url_test.go Chore: Remove bus (#47511) 2022-04-08 16:15:06 +02:00
short_url.go fix status code 200 (#47818) 2022-04-15 08:01:58 -04:00
signup.go fix status code 200 (#47818) 2022-04-15 08:01:58 -04:00
stars.go SearchV2 - Fix starred dashboards for new organizations error (#49645) 2022-05-25 20:57:18 +02:00
swagger.go fix status code 200 (#47818) 2022-04-15 08:01:58 -04:00
team_members_test.go Rename FGAC to RBAC in the codebase (#48051) 2022-04-21 14:31:02 +02:00
team_members.go AccessControl: Create own interface and impl for each permission service (#48871) 2022-05-10 15:48:47 +02:00
team_test.go backend/services: Move GetDashboard from sqlstore to dashboard service (#48971) 2022-05-17 14:52:22 -04:00
team.go Access control: refactor RBAC checks (#48107) 2022-04-25 10:42:09 +02:00
user_test.go Chore: Remove bus.Bus field (#47695) 2022-04-13 15:24:13 +02:00
user_token_test.go Chore: Remove bus.Bus field (#47695) 2022-04-13 15:24:13 +02:00
user_token.go fix status code 200 (#47818) 2022-04-15 08:01:58 -04:00
user.go RBAC: Make RBAC action names more consistent (#49730) 2022-06-02 13:14:48 +01:00
utils.go Permissions: Validate against Team/User permission role update (#29101) 2020-11-18 15:36:41 +01:00