From b9940e618c5e5f5d261441598e8a1ced227c1ee1 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Tue, 21 Mar 2017 14:34:48 +0100 Subject: [PATCH] profile: locks login fields if disable_login_form If the auth config variable, disable_login_form, is set to true then the username and email fields are set to read-only on the profile page. The reason for this is so that the user does not lock themselves out by changing their email address or username. Or create a new user by changing both. ref #7810 --- public/app/features/org/partials/profile.html | 24 ++++++++++--------- public/app/features/org/profile_ctrl.ts | 1 + public/sass/_grafana.scss | 1 - public/sass/components/_gf-form.scss | 7 ++++++ 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/public/app/features/org/partials/profile.html b/public/app/features/org/partials/profile.html index c51c3750ee5..7f52fbbd9d1 100644 --- a/public/app/features/org/partials/profile.html +++ b/public/app/features/org/partials/profile.html @@ -9,18 +9,20 @@

Information

-
- Name - -
-
- Email - -
-
- Username - +
+ Name +
+
+ Email + + +
+
+ Username + + +
diff --git a/public/app/features/org/profile_ctrl.ts b/public/app/features/org/profile_ctrl.ts index c0e8b5ae246..4687218826c 100644 --- a/public/app/features/org/profile_ctrl.ts +++ b/public/app/features/org/profile_ctrl.ts @@ -10,6 +10,7 @@ export class ProfileCtrl { orgs: any = []; userForm: any; showOrgsList = false; + readonlyLoginFields = config.disableLoginForm; /** @ngInject **/ constructor(private backendSrv, private contextSrv, private $location) { diff --git a/public/sass/_grafana.scss b/public/sass/_grafana.scss index 25db63858e8..370a5db943a 100644 --- a/public/sass/_grafana.scss +++ b/public/sass/_grafana.scss @@ -85,6 +85,5 @@ @import "pages/signup"; @import "pages/styleguide"; - @import "old_responsive"; @import "components/view_states.scss"; diff --git a/public/sass/components/_gf-form.scss b/public/sass/components/_gf-form.scss index 19588634dd3..94691334fe2 100644 --- a/public/sass/components/_gf-form.scss +++ b/public/sass/components/_gf-form.scss @@ -286,3 +286,10 @@ $gf-form-margin: 0.25rem; select.gf-form-input ~ .gf-form-help-icon { right: 10px; } + +.gf-form-icon--right-absolute { + position: absolute; + right: $spacer; + top: 10px; + color: $text-muted; +}