فهرست منبع

Merge branch 'master' into postgres-query-builder

Sven Klemm 7 سال پیش
والد
کامیت
5b3b0295e8
100فایلهای تغییر یافته به همراه295 افزوده شده و 82 حذف شده
  1. 6 0
      .circleci/config.yml
  2. 3 3
      .github/CONTRIBUTING.md
  3. 4 0
      CHANGELOG.md
  4. 6 15
      README.md
  5. 12 0
      conf/defaults.ini
  6. 103 1
      docs/sources/installation/configuration.md
  7. 8 11
      docs/sources/project/building_from_source.md
  8. 1 1
      jest.config.js
  9. 0 40
      karma.conf.js
  10. 0 10
      package.json
  11. 1 0
      pkg/models/models.go
  12. 132 0
      pkg/social/gitlab_oauth.go
  13. 15 1
      pkg/social/social.go
  14. 0 0
      public/app/containers/AlertRuleList/AlertRuleList.test.tsx
  15. 0 0
      public/app/containers/AlertRuleList/__snapshots__/AlertRuleList.test.tsx.snap
  16. 0 0
      public/app/containers/Explore/PromQueryField.test.tsx
  17. 0 0
      public/app/containers/Explore/TimePicker.test.tsx
  18. 0 0
      public/app/containers/Explore/slate-plugins/braces.test.ts
  19. 0 0
      public/app/containers/Explore/slate-plugins/clear.test.ts
  20. 0 0
      public/app/containers/Explore/utils/prometheus.test.ts
  21. 0 0
      public/app/containers/ManageDashboards/FolderSettings.test.tsx
  22. 0 0
      public/app/containers/ServerStats/ServerStats.test.tsx
  23. 0 0
      public/app/containers/ServerStats/__snapshots__/ServerStats.test.tsx.snap
  24. 0 0
      public/app/core/components/DeleteButton/DeleteButton.test.tsx
  25. 0 0
      public/app/core/components/EmptyListCTA/EmptyListCTA.test.tsx
  26. 0 0
      public/app/core/components/EmptyListCTA/__snapshots__/EmptyListCTA.test.tsx.snap
  27. 0 0
      public/app/core/components/PageHeader/PageHeader.test.tsx
  28. 0 0
      public/app/core/components/Permissions/AddPermissions.test.tsx
  29. 0 0
      public/app/core/components/Picker/PickerOption.test.tsx
  30. 0 0
      public/app/core/components/Picker/TeamPicker.test.tsx
  31. 0 0
      public/app/core/components/Picker/UserPicker.test.tsx
  32. 0 0
      public/app/core/components/Picker/__snapshots__/PickerOption.test.tsx.snap
  33. 0 0
      public/app/core/components/Picker/__snapshots__/TeamPicker.test.tsx.snap
  34. 0 0
      public/app/core/components/Picker/__snapshots__/UserPicker.test.tsx.snap
  35. 0 0
      public/app/core/components/Tooltip/Popover.test.tsx
  36. 0 0
      public/app/core/components/Tooltip/Tooltip.test.tsx
  37. 0 0
      public/app/core/components/Tooltip/__snapshots__/Popover.test.tsx.snap
  38. 0 0
      public/app/core/components/Tooltip/__snapshots__/Tooltip.test.tsx.snap
  39. 0 0
      public/app/core/specs/ColorPalette.test.tsx
  40. 0 0
      public/app/core/specs/PasswordStrength.test.tsx
  41. 0 0
      public/app/core/specs/__snapshots__/ColorPalette.test.tsx.snap
  42. 0 0
      public/app/core/specs/backend_srv.test.ts
  43. 0 0
      public/app/core/specs/datemath.test.ts
  44. 0 0
      public/app/core/specs/emitter.test.ts
  45. 0 0
      public/app/core/specs/file_export.test.ts
  46. 0 0
      public/app/core/specs/flatten.test.ts
  47. 0 0
      public/app/core/specs/kbn.test.ts
  48. 0 0
      public/app/core/specs/location_util.test.ts
  49. 0 0
      public/app/core/specs/manage_dashboards.test.ts
  50. 0 0
      public/app/core/specs/org_switcher.test.ts
  51. 0 0
      public/app/core/specs/rangeutil.test.ts
  52. 0 0
      public/app/core/specs/search.test.ts
  53. 0 0
      public/app/core/specs/search_results.test.ts
  54. 0 0
      public/app/core/specs/search_srv.test.ts
  55. 0 0
      public/app/core/specs/store.test.ts
  56. 0 0
      public/app/core/specs/table_model.test.ts
  57. 0 0
      public/app/core/specs/ticks.test.ts
  58. 0 0
      public/app/core/specs/time_series.test.ts
  59. 0 0
      public/app/core/specs/value_select_dropdown.test.ts
  60. 0 0
      public/app/features/alerting/specs/threshold_mapper.test.ts
  61. 0 0
      public/app/features/annotations/specs/annotations_srv.test.ts
  62. 0 0
      public/app/features/annotations/specs/annotations_srv_specs.test.ts
  63. 0 0
      public/app/features/dashboard/specs/AddPanelPanel.test.tsx
  64. 0 0
      public/app/features/dashboard/specs/DashboardRow.test.tsx
  65. 0 0
      public/app/features/dashboard/specs/change_tracker.test.ts
  66. 0 0
      public/app/features/dashboard/specs/dashboard_import_ctrl.test.ts
  67. 0 0
      public/app/features/dashboard/specs/dashboard_migration.test.ts
  68. 0 0
      public/app/features/dashboard/specs/dashboard_model.test.ts
  69. 0 0
      public/app/features/dashboard/specs/exporter.test.ts
  70. 0 0
      public/app/features/dashboard/specs/history_ctrl.test.ts
  71. 0 0
      public/app/features/dashboard/specs/history_srv.test.ts
  72. 0 0
      public/app/features/dashboard/specs/repeat.test.ts
  73. 0 0
      public/app/features/dashboard/specs/save_as_modal.test.ts
  74. 0 0
      public/app/features/dashboard/specs/save_modal.test.ts
  75. 0 0
      public/app/features/dashboard/specs/save_provisioned_modal.test.ts
  76. 0 0
      public/app/features/dashboard/specs/time_srv.test.ts
  77. 0 0
      public/app/features/dashboard/specs/viewstate_srv.test.ts
  78. 0 0
      public/app/features/panel/specs/metrics_panel_ctrl.test.ts
  79. 0 0
      public/app/features/panellinks/specs/link_srv.test.ts
  80. 0 0
      public/app/features/playlist/specs/playlist_edit_ctrl.test.ts
  81. 0 0
      public/app/features/plugins/specs/datasource_srv.test.ts
  82. 0 0
      public/app/features/templating/specs/adhoc_variable.test.ts
  83. 0 0
      public/app/features/templating/specs/editor_ctrl.test.ts
  84. 0 0
      public/app/features/templating/specs/query_variable.test.ts
  85. 0 0
      public/app/features/templating/specs/template_srv.test.ts
  86. 0 0
      public/app/features/templating/specs/variable.test.ts
  87. 0 0
      public/app/features/templating/specs/variable_srv.test.ts
  88. 0 0
      public/app/features/templating/specs/variable_srv_init.test.ts
  89. 4 0
      public/app/partials/login.html
  90. 0 0
      public/app/plugins/datasource/cloudwatch/specs/datasource.test.ts
  91. 0 0
      public/app/plugins/datasource/elasticsearch/specs/datasource.test.ts
  92. 0 0
      public/app/plugins/datasource/elasticsearch/specs/elastic_response.test.ts
  93. 0 0
      public/app/plugins/datasource/elasticsearch/specs/index_pattern.test.ts
  94. 0 0
      public/app/plugins/datasource/elasticsearch/specs/query_builder.test.ts
  95. 0 0
      public/app/plugins/datasource/elasticsearch/specs/query_def.test.ts
  96. 0 0
      public/app/plugins/datasource/graphite/specs/datasource.test.ts
  97. 0 0
      public/app/plugins/datasource/graphite/specs/gfunc.test.ts
  98. 0 0
      public/app/plugins/datasource/graphite/specs/graphite_query.test.ts
  99. 0 0
      public/app/plugins/datasource/graphite/specs/lexer.test.ts
  100. 0 0
      public/app/plugins/datasource/graphite/specs/parser.test.ts

+ 6 - 0
.circleci/config.yml

@@ -147,6 +147,12 @@ jobs:
       - run:
           name: sign packages
           command: './scripts/build/sign_packages.sh'
+      - run:
+          name: verify signed packages
+          command: |
+            mkdir -p ~/.rpmdb/pubkeys
+            curl -s https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana > ~/.rpmdb/pubkeys/grafana.key
+            ./scripts/build/verify_signed_packages.sh dist/*.rpm
       - run:
           name: sha-sum packages
           command: 'go run build.go sha-dist'

+ 3 - 3
.github/CONTRIBUTING.md

@@ -2,12 +2,12 @@ Follow the setup guide in README.md
 
 ### Rebuild frontend assets on source change
 ```
-grunt && grunt watch
+yarn watch
 ```
 
 ### Rerun tests on source change
 ```
-grunt karma:dev
+yarn jest
 ```
 
 ### Run tests for backend assets before commit
@@ -17,6 +17,6 @@ test -z "$(gofmt -s -l . | grep -v -E 'vendor/(github.com|golang.org|gopkg.in)'
 
 ### Run tests for frontend assets before commit
 ```
-npm test
+yarn test
 go test -v ./pkg/...
 ```

+ 4 - 0
CHANGELOG.md

@@ -61,6 +61,10 @@ These are new features that's still being worked on and are in an experimental p
 
 * **Dashboard**: Auto fit dashboard panels to optimize space used for current TV / Monitor [#12768](https://github.com/grafana/grafana/issues/12768)
 
+### Tech
+
+* **Frontend**: Convert all Frontend Karma tests to Jest tests [#12224](https://github.com/grafana/grafana/issues/12224)
+
 # 5.2.2 (2018-07-25)
 
 ### Minor

+ 6 - 15
README.md

@@ -43,7 +43,7 @@ To build the assets, rebuild on file change, and serve them by Grafana's webserv
 ```bash
 npm install -g yarn
 yarn install --pure-lockfile
-yarn run watch
+yarn watch
 ```
 
 Build the assets, rebuild on file change with Hot Module Replacement (HMR), and serve them by webpack-dev-server (http://localhost:3333):
@@ -56,12 +56,7 @@ Note: HMR for Angular is not supported. If you edit files in the Angular part of
 
 Run tests
 ```bash
-yarn run jest
-```
-
-Run karma tests
-```bash
-yarn run karma
+yarn jest
 ```
 
 ### Recompile backend on source change
@@ -98,17 +93,13 @@ In your custom.ini uncomment (remove the leading `;`) sign. And set `app_mode =
 #### Frontend
 Execute all frontend tests
 ```bash
-yarn run test
+yarn test
 ```
 
-Writing & watching frontend tests (we have two test runners)
+Writing & watching frontend tests
 
-- jest for all new tests that do not require browser context (React+more)
-   - Start watcher: `yarn run jest`
-   - Jest will run all test files that end with the name ".jest.ts"
-- karma + mocha is used for testing angularjs components. We do want to migrate these test to jest over time (if possible).
-  - Start watcher: `yarn run karma`
-  - Karma+Mocha runs all files that end with the name "_specs.ts".
+- Start watcher: `yarn jest`
+- Jest will run all test files that end with the name ".test.ts"
 
 #### Backend
 ```bash

+ 12 - 0
conf/defaults.ini

@@ -270,6 +270,18 @@ api_url = https://api.github.com/user
 team_ids =
 allowed_organizations =
 
+#################################### GitLab Auth #########################
+[auth.gitlab]
+enabled = false
+allow_sign_up = true
+client_id = some_id
+client_secret = some_secret
+scopes = api
+auth_url = https://gitlab.com/oauth/authorize
+token_url = https://gitlab.com/oauth/token
+api_url = https://gitlab.com/api/v4
+allowed_groups =
+
 #################################### Google Auth #########################
 [auth.google]
 enabled = false

+ 103 - 1
docs/sources/installation/configuration.md

@@ -84,7 +84,7 @@ command line in the init.d script or the systemd service file.
 
 ### temp_data_lifetime
 
-How long temporary images in `data` directory should be kept. Defaults to: `24h`. Supported modifiers: `h` (hours), 
+How long temporary images in `data` directory should be kept. Defaults to: `24h`. Supported modifiers: `h` (hours),
 `m` (minutes), for example: `168h`, `30m`, `10h30m`. Use `0` to never clean up temporary files.
 
 ### logs
@@ -430,6 +430,108 @@ allowed_organizations = github google
 
 <hr>
 
+## [auth.gitlab]
+
+> Only available in Grafana v5.3+.
+
+You need to [create a GitLab OAuth
+application](https://docs.gitlab.com/ce/integration/oauth_provider.html).
+Choose a descriptive *Name*, and use the following *Redirect URI*:
+
+```
+https://grafana.example.com/login/gitlab
+```
+
+where `https://grafana.example.com` is the URL you use to connect to Grafana.
+Adjust it as needed if you don't use HTTPS or if you use a different port; for
+instance, if you access Grafana at `http://203.0.113.31:3000`, you should use
+
+```
+http://203.0.113.31:3000/login/gitlab
+```
+
+Finally, select *api* as the *Scope* and submit the form. Note that if you're
+not going to use GitLab groups for authorization (i.e. not setting
+`allowed_groups`, see below), you can select *read_user* instead of *api* as
+the *Scope*, thus giving a more restricted access to your GitLab API.
+
+You'll get an *Application Id* and a *Secret* in return; we'll call them
+`GITLAB_APPLICATION_ID` and `GITLAB_SECRET` respectively for the rest of this
+section.
+
+Add the following to your Grafana configuration file to enable GitLab
+authentication:
+
+```ini
+[auth.gitlab]
+enabled = false
+allow_sign_up = false
+client_id = GITLAB_APPLICATION_ID
+client_secret = GITLAB_SECRET
+scopes = api
+auth_url = https://gitlab.com/oauth/authorize
+token_url = https://gitlab.com/oauth/token
+api_url = https://gitlab.com/api/v4
+allowed_groups =
+```
+
+Restart the Grafana backend for your changes to take effect.
+
+If you use your own instance of GitLab instead of `gitlab.com`, adjust
+`auth_url`, `token_url` and `api_url` accordingly by replacing the `gitlab.com`
+hostname with your own.
+
+With `allow_sign_up` set to `false`, only existing users will be able to login
+using their GitLab account, but with `allow_sign_up` set to `true`, *any* user
+who can authenticate on GitLab will be able to login on your Grafana instance;
+if you use the public `gitlab.com`, it means anyone in the world would be able
+to login on your Grafana instance.
+
+You can can however limit access to only members of a given group or list of
+groups by setting the `allowed_groups` option.
+
+### allowed_groups
+
+To limit access to authenticated users that are members of one or more [GitLab
+groups](https://docs.gitlab.com/ce/user/group/index.html), set `allowed_groups`
+to a comma- or space-separated list of groups. For instance, if you want to
+only give access to members of the `example` group, set
+
+
+```ini
+allowed_groups = example
+```
+
+If you want to also give access to members of the subgroup `bar`, which is in
+the group `foo`, set
+
+```ini
+allowed_groups = example, foo/bar
+```
+
+Note that in GitLab, the group or subgroup name doesn't always match its
+display name, especially if the display name contains spaces or special
+characters. Make sure you always use the group or subgroup name as it appears
+in the URL of the group or subgroup.
+
+Here's a complete example with `alloed_sign_up` enabled, and access limited to
+the `example` and `foo/bar` groups:
+
+```ini
+[auth.gitlab]
+enabled = false
+allow_sign_up = true
+client_id = GITLAB_APPLICATION_ID
+client_secret = GITLAB_SECRET
+scopes = api
+auth_url = https://gitlab.com/oauth/authorize
+token_url = https://gitlab.com/oauth/token
+api_url = https://gitlab.com/api/v4
+allowed_groups = example, foo/bar
+```
+
+<hr>
+
 ## [auth.google]
 
 First, you need to create a Google OAuth Client:

+ 8 - 11
docs/sources/project/building_from_source.md

@@ -57,7 +57,7 @@ For this you need nodejs (v.6+).
 ```bash
 npm install -g yarn
 yarn install --pure-lockfile
-npm run watch
+yarn watch
 ```
 
 ## Running Grafana Locally
@@ -83,21 +83,18 @@ go get github.com/Unknwon/bra
 bra run
 ```
 
-You'll also need to run `npm run watch` to watch for changes to the front-end (typescript, html, sass)
+You'll also need to run `yarn watch` to watch for changes to the front-end (typescript, html, sass)
 
 ### Running tests
 
-- You can run backend Golang tests using "go test ./pkg/...".
-- Execute all frontend tests with "npm run test"
+- You can run backend Golang tests using `go test ./pkg/...`.
+- Execute all frontend tests with `yarn test`
 
-Writing & watching frontend tests (we have two test runners)
+Writing & watching frontend tests
+
+- Start watcher: `yarn jest`
+- Jest will run all test files that end with the name ".test.ts"
 
-- jest for all new tests that do not require browser context (React+more)
-   - Start watcher: `npm run jest`
-   - Jest will run all test files that end with the name ".jest.ts"
-- karma + mocha is used for testing angularjs components. We do want to migrate these test to jest over time (if possible).
-  - Start watcher: `npm run karma`
-  - Karma+Mocha runs all files that end with the name "_specs.ts".
 
 ## Creating optimized release packages
 

+ 1 - 1
jest.config.js

@@ -13,7 +13,7 @@ module.exports = {
   "roots": [
     "<rootDir>/public"
   ],
-  "testRegex": "(\\.|/)(jest)\\.(jsx?|tsx?)$",
+  "testRegex": "(\\.|/)(test)\\.(jsx?|tsx?)$",
   "moduleFileExtensions": [
     "ts",
     "tsx",

+ 0 - 40
karma.conf.js

@@ -1,40 +0,0 @@
-var webpack = require('webpack');
-var path = require('path');
-var webpackTestConfig = require('./scripts/webpack/webpack.test.js');
-
-module.exports = function(config) {
-
-  'use strict';
-
-  config.set({
-    frameworks: ['mocha', 'expect', 'sinon'],
-
-    // list of files / patterns to load in the browser
-    files: [
-      { pattern: 'public/test/index.ts', watched: false }
-    ],
-
-    preprocessors: {
-      'public/test/index.ts': ['webpack', 'sourcemap'],
-    },
-
-    webpack: webpackTestConfig,
-    webpackMiddleware: {
-      stats: 'minimal',
-    },
-
-    // list of files to exclude
-    exclude: [],
-    reporters: ['dots'],
-    port: 9876,
-    colors: true,
-    logLevel: config.LOG_INFO,
-    autoWatch: true,
-    browsers: ['PhantomJS'],
-    captureTimeout: 20000,
-    singleRun: true,
-    // autoWatchBatchDelay: 1000,
-    // browserNoActivityTimeout: 60000,
-  });
-
-};

+ 0 - 10
package.json

@@ -46,7 +46,6 @@
     "grunt-contrib-copy": "~1.0.0",
     "grunt-contrib-cssmin": "~1.0.2",
     "grunt-exec": "^1.0.1",
-    "grunt-karma": "~2.0.0",
     "grunt-notify": "^0.4.5",
     "grunt-postcss": "^0.8.0",
     "grunt-sass": "^2.0.0",
@@ -58,14 +57,6 @@
     "html-webpack-plugin": "^3.2.0",
     "husky": "^0.14.3",
     "jest": "^22.0.4",
-    "karma": "1.7.0",
-    "karma-chrome-launcher": "~2.2.0",
-    "karma-expect": "~1.1.3",
-    "karma-mocha": "~1.3.0",
-    "karma-phantomjs-launcher": "1.0.4",
-    "karma-sinon": "^1.0.5",
-    "karma-sourcemap-loader": "^0.3.7",
-    "karma-webpack": "^3.0.0",
     "lint-staged": "^6.0.0",
     "load-grunt-tasks": "3.5.2",
     "mini-css-extract-plugin": "^0.4.0",
@@ -112,7 +103,6 @@
     "test": "grunt test",
     "test:coverage": "grunt test --coverage=true",
     "lint": "tslint -c tslint.json --project tsconfig.json --type-check",
-    "karma": "grunt karma:dev",
     "jest": "jest --notify --watch",
     "api-tests": "jest --notify --watch --config=tests/api/jest.js",
     "precommit": "lint-staged && grunt precommit"

+ 1 - 0
pkg/models/models.go

@@ -8,4 +8,5 @@ const (
 	TWITTER
 	GENERIC
 	GRAFANA_COM
+	GITLAB
 )

+ 132 - 0
pkg/social/gitlab_oauth.go

@@ -0,0 +1,132 @@
+package social
+
+import (
+	"encoding/json"
+	"fmt"
+	"net/http"
+	"regexp"
+
+	"github.com/grafana/grafana/pkg/models"
+
+	"golang.org/x/oauth2"
+)
+
+type SocialGitlab struct {
+	*SocialBase
+	allowedDomains []string
+	allowedGroups  []string
+	apiUrl         string
+	allowSignup    bool
+}
+
+var (
+	ErrMissingGroupMembership = &Error{"User not a member of one of the required groups"}
+)
+
+func (s *SocialGitlab) Type() int {
+	return int(models.GITLAB)
+}
+
+func (s *SocialGitlab) IsEmailAllowed(email string) bool {
+	return isEmailAllowed(email, s.allowedDomains)
+}
+
+func (s *SocialGitlab) IsSignupAllowed() bool {
+	return s.allowSignup
+}
+
+func (s *SocialGitlab) IsGroupMember(client *http.Client) bool {
+	if len(s.allowedGroups) == 0 {
+		return true
+	}
+
+	for groups, url := s.GetGroups(client, s.apiUrl+"/groups"); groups != nil; groups, url = s.GetGroups(client, url) {
+		for _, allowedGroup := range s.allowedGroups {
+			for _, group := range groups {
+				if group == allowedGroup {
+					return true
+				}
+			}
+		}
+	}
+
+	return false
+}
+
+func (s *SocialGitlab) GetGroups(client *http.Client, url string) ([]string, string) {
+	type Group struct {
+		FullPath string `json:"full_path"`
+	}
+
+	var (
+		groups []Group
+		next   string
+	)
+
+	if url == "" {
+		return nil, next
+	}
+
+	response, err := HttpGet(client, url)
+	if err != nil {
+		s.log.Error("Error getting groups from GitLab API", "err", err)
+		return nil, next
+	}
+
+	if err := json.Unmarshal(response.Body, &groups); err != nil {
+		s.log.Error("Error parsing JSON from GitLab API", "err", err)
+		return nil, next
+	}
+
+	fullPaths := make([]string, len(groups))
+	for i, group := range groups {
+		fullPaths[i] = group.FullPath
+	}
+
+	if link, ok := response.Headers["Link"]; ok {
+		pattern := regexp.MustCompile(`<([^>]+)>; rel="next"`)
+		if matches := pattern.FindStringSubmatch(link[0]); matches != nil {
+			next = matches[1]
+		}
+	}
+
+	return fullPaths, next
+}
+
+func (s *SocialGitlab) UserInfo(client *http.Client, token *oauth2.Token) (*BasicUserInfo, error) {
+
+	var data struct {
+		Id       int
+		Username string
+		Email    string
+		Name     string
+		State    string
+	}
+
+	response, err := HttpGet(client, s.apiUrl+"/user")
+	if err != nil {
+		return nil, fmt.Errorf("Error getting user info: %s", err)
+	}
+
+	err = json.Unmarshal(response.Body, &data)
+	if err != nil {
+		return nil, fmt.Errorf("Error getting user info: %s", err)
+	}
+
+	if data.State != "active" {
+		return nil, fmt.Errorf("User %s is inactive", data.Username)
+	}
+
+	userInfo := &BasicUserInfo{
+		Id:    fmt.Sprintf("%d", data.Id),
+		Name:  data.Name,
+		Login: data.Username,
+		Email: data.Email,
+	}
+
+	if !s.IsGroupMember(client) {
+		return nil, ErrMissingGroupMembership
+	}
+
+	return userInfo, nil
+}

+ 15 - 1
pkg/social/social.go

@@ -55,7 +55,7 @@ func NewOAuthService() {
 	setting.OAuthService = &setting.OAuther{}
 	setting.OAuthService.OAuthInfos = make(map[string]*setting.OAuthInfo)
 
-	allOauthes := []string{"github", "google", "generic_oauth", "grafananet", "grafana_com"}
+	allOauthes := []string{"github", "gitlab", "google", "generic_oauth", "grafananet", "grafana_com"}
 
 	for _, name := range allOauthes {
 		sec := setting.Raw.Section("auth." + name)
@@ -115,6 +115,20 @@ func NewOAuthService() {
 			}
 		}
 
+		// GitLab.
+		if name == "gitlab" {
+			SocialMap["gitlab"] = &SocialGitlab{
+				SocialBase: &SocialBase{
+					Config: &config,
+					log:    logger,
+				},
+				allowedDomains: info.AllowedDomains,
+				apiUrl:         info.ApiUrl,
+				allowSignup:    info.AllowSignup,
+				allowedGroups:  util.SplitString(sec.Key("allowed_groups").String()),
+			}
+		}
+
 		// Google.
 		if name == "google" {
 			SocialMap["google"] = &SocialGoogle{

+ 0 - 0
public/app/containers/AlertRuleList/AlertRuleList.jest.tsx → public/app/containers/AlertRuleList/AlertRuleList.test.tsx


+ 0 - 0
public/app/containers/AlertRuleList/__snapshots__/AlertRuleList.jest.tsx.snap → public/app/containers/AlertRuleList/__snapshots__/AlertRuleList.test.tsx.snap


+ 0 - 0
public/app/containers/Explore/PromQueryField.jest.tsx → public/app/containers/Explore/PromQueryField.test.tsx


+ 0 - 0
public/app/containers/Explore/TimePicker.jest.tsx → public/app/containers/Explore/TimePicker.test.tsx


+ 0 - 0
public/app/containers/Explore/slate-plugins/braces.jest.ts → public/app/containers/Explore/slate-plugins/braces.test.ts


+ 0 - 0
public/app/containers/Explore/slate-plugins/clear.jest.ts → public/app/containers/Explore/slate-plugins/clear.test.ts


+ 0 - 0
public/app/containers/Explore/utils/prometheus.jest.ts → public/app/containers/Explore/utils/prometheus.test.ts


+ 0 - 0
public/app/containers/ManageDashboards/FolderSettings.jest.tsx → public/app/containers/ManageDashboards/FolderSettings.test.tsx


+ 0 - 0
public/app/containers/ServerStats/ServerStats.jest.tsx → public/app/containers/ServerStats/ServerStats.test.tsx


+ 0 - 0
public/app/containers/ServerStats/__snapshots__/ServerStats.jest.tsx.snap → public/app/containers/ServerStats/__snapshots__/ServerStats.test.tsx.snap


+ 0 - 0
public/app/core/components/DeleteButton/DeleteButton.jest.tsx → public/app/core/components/DeleteButton/DeleteButton.test.tsx


+ 0 - 0
public/app/core/components/EmptyListCTA/EmptyListCTA.jest.tsx → public/app/core/components/EmptyListCTA/EmptyListCTA.test.tsx


+ 0 - 0
public/app/core/components/EmptyListCTA/__snapshots__/EmptyListCTA.jest.tsx.snap → public/app/core/components/EmptyListCTA/__snapshots__/EmptyListCTA.test.tsx.snap


+ 0 - 0
public/app/core/components/PageHeader/PageHeader.jest.tsx → public/app/core/components/PageHeader/PageHeader.test.tsx


+ 0 - 0
public/app/core/components/Permissions/AddPermissions.jest.tsx → public/app/core/components/Permissions/AddPermissions.test.tsx


+ 0 - 0
public/app/core/components/Picker/PickerOption.jest.tsx → public/app/core/components/Picker/PickerOption.test.tsx


+ 0 - 0
public/app/core/components/Picker/TeamPicker.jest.tsx → public/app/core/components/Picker/TeamPicker.test.tsx


+ 0 - 0
public/app/core/components/Picker/UserPicker.jest.tsx → public/app/core/components/Picker/UserPicker.test.tsx


+ 0 - 0
public/app/core/components/Picker/__snapshots__/PickerOption.jest.tsx.snap → public/app/core/components/Picker/__snapshots__/PickerOption.test.tsx.snap


+ 0 - 0
public/app/core/components/Picker/__snapshots__/TeamPicker.jest.tsx.snap → public/app/core/components/Picker/__snapshots__/TeamPicker.test.tsx.snap


+ 0 - 0
public/app/core/components/Picker/__snapshots__/UserPicker.jest.tsx.snap → public/app/core/components/Picker/__snapshots__/UserPicker.test.tsx.snap


+ 0 - 0
public/app/core/components/Tooltip/Popover.jest.tsx → public/app/core/components/Tooltip/Popover.test.tsx


+ 0 - 0
public/app/core/components/Tooltip/Tooltip.jest.tsx → public/app/core/components/Tooltip/Tooltip.test.tsx


+ 0 - 0
public/app/core/components/Tooltip/__snapshots__/Popover.jest.tsx.snap → public/app/core/components/Tooltip/__snapshots__/Popover.test.tsx.snap


+ 0 - 0
public/app/core/components/Tooltip/__snapshots__/Tooltip.jest.tsx.snap → public/app/core/components/Tooltip/__snapshots__/Tooltip.test.tsx.snap


+ 0 - 0
public/app/core/specs/ColorPalette.jest.tsx → public/app/core/specs/ColorPalette.test.tsx


+ 0 - 0
public/app/core/specs/PasswordStrength.jest.tsx → public/app/core/specs/PasswordStrength.test.tsx


+ 0 - 0
public/app/core/specs/__snapshots__/ColorPalette.jest.tsx.snap → public/app/core/specs/__snapshots__/ColorPalette.test.tsx.snap


+ 0 - 0
public/app/core/specs/backend_srv.jest.ts → public/app/core/specs/backend_srv.test.ts


+ 0 - 0
public/app/core/specs/datemath.jest.ts → public/app/core/specs/datemath.test.ts


+ 0 - 0
public/app/core/specs/emitter.jest.ts → public/app/core/specs/emitter.test.ts


+ 0 - 0
public/app/core/specs/file_export.jest.ts → public/app/core/specs/file_export.test.ts


+ 0 - 0
public/app/core/specs/flatten.jest.ts → public/app/core/specs/flatten.test.ts


+ 0 - 0
public/app/core/specs/kbn.jest.ts → public/app/core/specs/kbn.test.ts


+ 0 - 0
public/app/core/specs/location_util.jest.ts → public/app/core/specs/location_util.test.ts


+ 0 - 0
public/app/core/specs/manage_dashboards.jest.ts → public/app/core/specs/manage_dashboards.test.ts


+ 0 - 0
public/app/core/specs/org_switcher.jest.ts → public/app/core/specs/org_switcher.test.ts


+ 0 - 0
public/app/core/specs/rangeutil.jest.ts → public/app/core/specs/rangeutil.test.ts


+ 0 - 0
public/app/core/specs/search.jest.ts → public/app/core/specs/search.test.ts


+ 0 - 0
public/app/core/specs/search_results.jest.ts → public/app/core/specs/search_results.test.ts


+ 0 - 0
public/app/core/specs/search_srv.jest.ts → public/app/core/specs/search_srv.test.ts


+ 0 - 0
public/app/core/specs/store.jest.ts → public/app/core/specs/store.test.ts


+ 0 - 0
public/app/core/specs/table_model.jest.ts → public/app/core/specs/table_model.test.ts


+ 0 - 0
public/app/core/specs/ticks.jest.ts → public/app/core/specs/ticks.test.ts


+ 0 - 0
public/app/core/specs/time_series.jest.ts → public/app/core/specs/time_series.test.ts


+ 0 - 0
public/app/core/specs/value_select_dropdown.jest.ts → public/app/core/specs/value_select_dropdown.test.ts


+ 0 - 0
public/app/features/alerting/specs/threshold_mapper.jest.ts → public/app/features/alerting/specs/threshold_mapper.test.ts


+ 0 - 0
public/app/features/annotations/specs/annotations_srv.jest.ts → public/app/features/annotations/specs/annotations_srv.test.ts


+ 0 - 0
public/app/features/annotations/specs/annotations_srv_specs.jest.ts → public/app/features/annotations/specs/annotations_srv_specs.test.ts


+ 0 - 0
public/app/features/dashboard/specs/AddPanelPanel.jest.tsx → public/app/features/dashboard/specs/AddPanelPanel.test.tsx


+ 0 - 0
public/app/features/dashboard/specs/DashboardRow.jest.tsx → public/app/features/dashboard/specs/DashboardRow.test.tsx


+ 0 - 0
public/app/features/dashboard/specs/change_tracker.jest.ts → public/app/features/dashboard/specs/change_tracker.test.ts


+ 0 - 0
public/app/features/dashboard/specs/dashboard_import_ctrl.jest.ts → public/app/features/dashboard/specs/dashboard_import_ctrl.test.ts


+ 0 - 0
public/app/features/dashboard/specs/dashboard_migration.jest.ts → public/app/features/dashboard/specs/dashboard_migration.test.ts


+ 0 - 0
public/app/features/dashboard/specs/dashboard_model.jest.ts → public/app/features/dashboard/specs/dashboard_model.test.ts


+ 0 - 0
public/app/features/dashboard/specs/exporter.jest.ts → public/app/features/dashboard/specs/exporter.test.ts


+ 0 - 0
public/app/features/dashboard/specs/history_ctrl.jest.ts → public/app/features/dashboard/specs/history_ctrl.test.ts


+ 0 - 0
public/app/features/dashboard/specs/history_srv.jest.ts → public/app/features/dashboard/specs/history_srv.test.ts


+ 0 - 0
public/app/features/dashboard/specs/repeat.jest.ts → public/app/features/dashboard/specs/repeat.test.ts


+ 0 - 0
public/app/features/dashboard/specs/save_as_modal.jest.ts → public/app/features/dashboard/specs/save_as_modal.test.ts


+ 0 - 0
public/app/features/dashboard/specs/save_modal.jest.ts → public/app/features/dashboard/specs/save_modal.test.ts


+ 0 - 0
public/app/features/dashboard/specs/save_provisioned_modal.jest.ts → public/app/features/dashboard/specs/save_provisioned_modal.test.ts


+ 0 - 0
public/app/features/dashboard/specs/time_srv.jest.ts → public/app/features/dashboard/specs/time_srv.test.ts


+ 0 - 0
public/app/features/dashboard/specs/viewstate_srv.jest.ts → public/app/features/dashboard/specs/viewstate_srv.test.ts


+ 0 - 0
public/app/features/panel/specs/metrics_panel_ctrl.jest.ts → public/app/features/panel/specs/metrics_panel_ctrl.test.ts


+ 0 - 0
public/app/features/panellinks/specs/link_srv.jest.ts → public/app/features/panellinks/specs/link_srv.test.ts


+ 0 - 0
public/app/features/playlist/specs/playlist_edit_ctrl.jest.ts → public/app/features/playlist/specs/playlist_edit_ctrl.test.ts


+ 0 - 0
public/app/features/plugins/specs/datasource_srv.jest.ts → public/app/features/plugins/specs/datasource_srv.test.ts


+ 0 - 0
public/app/features/templating/specs/adhoc_variable.jest.ts → public/app/features/templating/specs/adhoc_variable.test.ts


+ 0 - 0
public/app/features/templating/specs/editor_ctrl.jest.ts → public/app/features/templating/specs/editor_ctrl.test.ts


+ 0 - 0
public/app/features/templating/specs/query_variable.jest.ts → public/app/features/templating/specs/query_variable.test.ts


+ 0 - 0
public/app/features/templating/specs/template_srv.jest.ts → public/app/features/templating/specs/template_srv.test.ts


+ 0 - 0
public/app/features/templating/specs/variable.jest.ts → public/app/features/templating/specs/variable.test.ts


+ 0 - 0
public/app/features/templating/specs/variable_srv.jest.ts → public/app/features/templating/specs/variable_srv.test.ts


+ 0 - 0
public/app/features/templating/specs/variable_srv_init.jest.ts → public/app/features/templating/specs/variable_srv_init.test.ts


+ 4 - 0
public/app/partials/login.html

@@ -51,6 +51,10 @@
             <i class="btn-service-icon fa fa-github"></i>
             Sign in with GitHub
           </a>
+          <a class="btn btn-medium btn-service btn-service--gitlab login-btn" href="login/gitlab" target="_self" ng-if="oauth.gitlab">
+            <i class="btn-service-icon fa fa-gitlab"></i>
+            Sign in with GitLab
+          </a>
           <a class="btn btn-medium btn-inverse btn-service btn-service--grafanacom login-btn" href="login/grafana_com" target="_self"
             ng-if="oauth.grafana_com">
             <i class="btn-service-icon"></i>

+ 0 - 0
public/app/plugins/datasource/cloudwatch/specs/datasource.jest.ts → public/app/plugins/datasource/cloudwatch/specs/datasource.test.ts


+ 0 - 0
public/app/plugins/datasource/elasticsearch/specs/datasource.jest.ts → public/app/plugins/datasource/elasticsearch/specs/datasource.test.ts


+ 0 - 0
public/app/plugins/datasource/elasticsearch/specs/elastic_response.jest.ts → public/app/plugins/datasource/elasticsearch/specs/elastic_response.test.ts


+ 0 - 0
public/app/plugins/datasource/elasticsearch/specs/index_pattern.jest.ts → public/app/plugins/datasource/elasticsearch/specs/index_pattern.test.ts


+ 0 - 0
public/app/plugins/datasource/elasticsearch/specs/query_builder.jest.ts → public/app/plugins/datasource/elasticsearch/specs/query_builder.test.ts


+ 0 - 0
public/app/plugins/datasource/elasticsearch/specs/query_def.jest.ts → public/app/plugins/datasource/elasticsearch/specs/query_def.test.ts


+ 0 - 0
public/app/plugins/datasource/graphite/specs/datasource.jest.ts → public/app/plugins/datasource/graphite/specs/datasource.test.ts


+ 0 - 0
public/app/plugins/datasource/graphite/specs/gfunc.jest.ts → public/app/plugins/datasource/graphite/specs/gfunc.test.ts


+ 0 - 0
public/app/plugins/datasource/graphite/specs/graphite_query.jest.ts → public/app/plugins/datasource/graphite/specs/graphite_query.test.ts


+ 0 - 0
public/app/plugins/datasource/graphite/specs/lexer.jest.ts → public/app/plugins/datasource/graphite/specs/lexer.test.ts


+ 0 - 0
public/app/plugins/datasource/graphite/specs/parser.jest.ts → public/app/plugins/datasource/graphite/specs/parser.test.ts


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است