45 Commits

Author SHA1 Message Date
3a1437fe9c Access control: Move enterprise-specific access control actions (#33781)
* Access control: add reporting permissions

* Move enterprise-specific access control actions
2021-05-06 15:28:38 +02:00
a7e721e987 Access control: Make Admin/Users UI working with the permissions (#33176)
* API: authorize admin/users views

* Render admin/users components based on user's permissions

* Add LDAP permissions (required by admin/user page)

* Extend default admin role by LDAP permissions

* Show/hide LDAP debug views

* Render LDAP debug page if user has access

* Authorize LDAP debug view

* fix permissions definitions

* Add LDAP page permissions

* remove ambiguous permissions check

* Hide logout buttons in sessions table

* Add org/users permissions

* Use org permissions for managing user roles in orgs

* Apply permissions to org/users

* Apply suggestions from review

* Fix tests

* remove scopes from the frontend

* Tweaks according to review

* Handle /invites endpoints
2021-04-22 13:19:41 +03:00
bad048b7ba Performance: Standardize lodash imports to use destructured members (#33040)
* Performance: Standardize lodash imports to use destructured members
Changes lodash imports of the form `import x from 'lodash/x'` to
`import { x } from 'lodash'` to reduce bundle size.

* Remove unnecessary _ import from Graph component

* Enforce lodash import style

* Fix remaining lodash imports
2021-04-21 09:38:00 +02:00
025b671146 Dashboard: Unsaved changes warning shown for anyone that can save (#33145)
* Dashboard: Unsaved changes warning shown for anyone that can save

* Refactor: changes the order in function
2021-04-20 09:55:46 +02:00
8b843eb0a6 Access control: expose permissions to the frontend (#32954)
* Expose user permissions to the frontend

* Do not include empty scope

* Extend ContextSrv with hasPermission() method

* Add access control types

* Fix type error (make permissions optional)

* Fallback if access control disabled

* Move UserPermission to types

* Simplify hasPermission()
2021-04-16 16:02:16 +03:00
34b4f7c717 Chore: Reduces strict errors (#33012)
* Chore: reduces strict error in OptionPicker tests

* Chore: reduces strict errors in FormDropdownCtrl

* Chore: reduces has no initializer and is not definitely assigned in the constructor errors

* Chore: reduces has no initializer and is not definitely assigned in the constructor errors

* Chore: lowers strict count limit

* Tests: updates snapshots

* Tests: updates snapshots

* Chore: updates after PR comments

* Refactor: removes throw and changes signature for DashboardSrv.getCurrent
2021-04-15 14:21:06 +02:00
e2ecb70051 Dashboard: Ignore changes to dashboard when the user session expires (#30897)
When the user session expires, and the 401 triggers a page reload to get the user to the login page, ChangeTracker will interfer. By setting the user as logged out in the context when the session is timed out, we can ignore the changes in ChangeTracker.
2021-02-04 15:29:38 +01:00
dbaf213f8a Variables: added __user.email to global variable (#28853)
* added email to global variable.

* forgot to increase the count.
2020-11-05 15:26:08 +01:00
febbc60e8b RangeUtils: migrate logic from kbn to grafana/data (#27347) 2020-09-02 23:54:06 -07:00
75e14aa120 Chore: Let kbn util infer types (#26907)
* Chore: Let kbn util infer types

Type fixes where needed

* Address review comments + test fix

* Modify kbn method and property names to pascalCase
2020-08-13 09:35:32 +02:00
add1bcb59c Variable: removed __user.name/___.user.email from global variables and added docs for the rest of the __user variable. (#25275)
* added docs for new global variable.

* reverting the name + email so we only expose the bare minumum that should be enough for most cases.
2020-06-02 12:05:05 +02:00
f98e176d7b Templating: Add bult in __user {name, id, login, email} variable to templating system (#23378)
* Updated templating code to support the $__user variable to expose the current
userid, username, email and login.

Fixed the $__org variable as it was returning the user id instead of the ordId.

Updated the documentation to match

* Updated solution to retrieving $__user variables to pull directly from user record (thereby allowing future access to properties that
might not exist in the contextSvr).

Replicated this initialisation in the variables feature

Corrected typo's in documentation.

* Repaired typecheck issues.

* Updated patch to pull entirely from contextSrv without API calls.

* ... And removed the redundant comments.

* Updated documentation.
2020-06-02 08:47:54 +02:00
72628c8ea0 Dashboard: Adds support for a global minimum dashboard refresh interval (#19416)
This feature would provide a way for administrators to limit the minimum 
dashboard refresh interval globally.
Filters out the refresh intervals available in the time picker that are lower 
than the set minimum refresh interval in the configuration .ini file
Adds the minimum refresh interval as available in the time picker.
If the user tries to enter a refresh interval that is lower than the minimum 
in the URL, defaults to the minimum interval.
When trying to update the JSON via the API, rejects the update if the 
dashboard's refresh interval is lower than the minimum.
When trying to update a dashboard via provisioning having a lower 
refresh interval than the minimum, defaults to the minimum interval 
and logs a warning. 

Fixes #3356

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2020-02-28 14:32:01 +01:00
178bb1d3ab Echo: mechanism for collecting custom events lazily (#20365)
* Introduce Echo for collecting frontend metrics

* Update public/app/core/services/echo/Echo.ts

Co-Authored-By: Peter Holmberg <peterholmberg@users.noreply.github.com>

* Custom meta when adding event

* Rename consumer to backend

* Remove buffer from Echo

* Minor tweaks

* Update package.json

* Update public/app/app.ts

* Update public/app/app.ts

* Collect paint metrics when collecting tti. Remove echoBackendFactory

* Update yarn.lock

* Move Echo interfaces to runtime

* progress on meta and echo

* Collect meta analytics events

* Move MetaanalyticsBackend to enterprise repo

* Fixed unit tests

* Removed unused type from test

* Fixed issues with chunk loading (reverted index-template changes)

* Restored changes

* Fixed webpack prod
2019-12-05 08:30:39 +01:00
a4f5c54871 Chore: Fixed no implicit any Typescript errors (#16799) 2019-04-28 09:58:12 +02:00
96aa4ae19f teams: remov permission select for non admin users 2019-03-19 14:01:12 +01:00
0736b8a1fb chore: Move sidemenu out of context service and use the logic we have in the router already for hiding the sidemenu 2019-03-11 13:18:22 +01:00
d6449ee629 fix: Logo goes Home instead of toggling side menu #15482 2019-03-07 09:36:40 +01:00
93bb30a561 Enable new color picker in Gauge and Thresholds editor, use ThemeProvider instead of ContextSrv 2019-01-22 09:14:30 +01:00
721e40db90 fixed trailing whitespace 2019-01-21 13:51:33 +01:00
778e1f78c2 Merge branch 'master' into hugoh/bug-viewers-can-edit-not-working-for-explore 2019-01-21 13:31:05 +01:00
b95650d19c Added function hasAccessToExplore in ContextSrv and refactored tests 2019-01-21 10:50:34 +01:00
f16101101d Minor refactoring and name changes 2019-01-18 11:58:29 +01:00
00c0b71f3d Merge branch '12918-only-arrow-functions4' 2018-09-05 11:46:54 +02:00
cab6861d27 Reactify sidebar (#13091)
* created react component and moved markdown

* extracting components

* Broke out parts into components

* tests

* Flattened file structure

* Tests

* made instances typed in test

* typing

* function instead of variable

* updated user model with missing properties

* added full set of properties to user mock

* redone from variable to function

* refactor: minor refactorings of #13091

* removed logging
2018-09-04 17:24:08 +02:00
dc4f547a40 Changed functions to arrow functions for only-arrow-functions rule. 2018-09-04 17:02:32 +02:00
5e0d0c5816 changed var to const (#13061) 2018-08-29 14:26:50 +02:00
b8724ae0c4 refactoring: enterprise build/hooks refactorings (#12478) 2018-07-02 04:33:39 -07:00
5c57c7cff5 dashboard: show save as button if can edit and has edit permission to folders 2018-04-30 15:38:46 +02:00
3a1f52d8a2 prettier: ran on all files again, sorry. now settings are defined in package.json 2017-12-21 08:39:31 +01:00
85879a7014 prettier: change to single quoting 2017-12-20 12:33:33 +01:00
fadfc665e4 tech: ran pretttier on all typescript files 2017-12-19 16:06:54 +01:00
68dab71275 refactor: sidemenu toggle & hiding logic 2017-12-07 16:25:21 +01:00
66657d24b8 sidemenu: responsive sidemenu view for smallest breakpoint
For the smallest breakpoint, expands the sidemenu to be width 100% and
to be toggled on or off rather than visible all the time.
2017-12-04 12:37:00 +01:00
00df24b348 ux: search progress 2017-11-24 16:54:55 +01:00
4dd4631b87 ux: sidemenu toggling 2017-08-17 14:00:41 +02:00
a4da0adf38 ux: switching orgs now works through modal 2017-08-16 15:37:13 +02:00
5061b3c691 ux: nav experiments 2017-06-12 21:11:22 +02:00
f77f8ebfc6 heatmap: changes to color spectrum, inverted some on dark theme 2017-03-31 17:12:50 +02:00
4b567e35d5 suppress refresh when user is inactive (#7219) 2017-01-11 19:46:34 +01:00
fb57bf77da ux(getting started): progress on getting started panel and persited help flag states, #6466 2016-11-09 10:41:39 +01:00
5ded88fa4d feat(templating): progress on variable system refactoring, #6048 2016-09-19 11:34:08 +02:00
6b813b4e2a feat(query editors): remember collapsed state 2016-04-25 15:11:40 +02:00
431a610f00 fix(): fixed failing unit test 2016-04-03 10:12:43 -04:00
55d95f9009 feat(prefs): moved context srv to typescript 2016-04-03 05:27:35 -07:00