diff --git a/pkg/api/dtos/frontend_settings.go b/pkg/api/dtos/frontend_settings.go index a9581366b1328..6bbb7bf52d161 100644 --- a/pkg/api/dtos/frontend_settings.go +++ b/pkg/api/dtos/frontend_settings.go @@ -220,8 +220,10 @@ type FrontendSettingsDTO struct { LicenseInfo FrontendSettingsLicenseInfoDTO `json:"licenseInfo"` - FeatureToggles map[string]bool `json:"featureToggles"` - AnonymousEnabled bool `json:"anonymousEnabled"` + FeatureToggles map[string]bool `json:"featureToggles"` + AnonymousEnabled bool `json:"anonymousEnabled"` + // @PERCONA: add anonymousOrgRole to the frontend settings + AnonymousOrgRole string `json:"anonymousOrgRole"` AnonymousDeviceLimit int64 `json:"anonymousDeviceLimit"` RendererAvailable bool `json:"rendererAvailable"` RendererVersion string `json:"rendererVersion"` diff --git a/pkg/api/frontendsettings.go b/pkg/api/frontendsettings.go index ac7086f0a2c34..78cf64e2a8529 100644 --- a/pkg/api/frontendsettings.go +++ b/pkg/api/frontendsettings.go @@ -272,8 +272,10 @@ func (hs *HTTPServer) getFrontendSettings(c *contextmodel.ReqContext) (*dtos.Fro EnabledFeatures: hs.License.EnabledFeatures(), }, - FeatureToggles: featureToggles, - AnonymousEnabled: hs.Cfg.Anonymous.Enabled, + FeatureToggles: featureToggles, + AnonymousEnabled: hs.Cfg.Anonymous.Enabled, + // @PERCONA: add anonymousOrgRole to the frontend settings + AnonymousOrgRole: hs.Cfg.Anonymous.OrgRole, AnonymousDeviceLimit: hs.Cfg.Anonymous.DeviceLimit, RendererAvailable: hs.RenderService.IsAvailable(c.Req.Context()), RendererVersion: hs.RenderService.Version(), diff --git a/public/app/core/components/Login/LoginCtrl.tsx b/public/app/core/components/Login/LoginCtrl.tsx index 00a007b636018..3acb86a69420e 100644 --- a/public/app/core/components/Login/LoginCtrl.tsx +++ b/public/app/core/components/Login/LoginCtrl.tsx @@ -247,7 +247,8 @@ export class LoginCtrl extends PureComponent { render() { const { children } = this.props; - const { isLoggingIn, isChangingPassword, showDefaultPasswordWarning, loginErrorMessage } = this.state; + const { isLoggingIn, isChangingPassword, showDefaultPasswordWarning, loginErrorMessage } = + this.state; const { login, toGrafana, changePassword, passwordlessStart, passwordlessConfirm } = this; const { loginHint, passwordHint, disableLoginForm, disableUserSignUp } = config; diff --git a/public/app/core/components/Login/LoginPage.test.tsx b/public/app/core/components/Login/LoginPage.test.tsx index 0e2369b0a8d31..b1aee71c00c66 100644 --- a/public/app/core/components/Login/LoginPage.test.tsx +++ b/public/app/core/components/Login/LoginPage.test.tsx @@ -34,6 +34,7 @@ jest.mock('@grafana/runtime', () => ({ })); describe('Login Page', () => { + beforeEach(() => { jest.resetAllMocks(); }); @@ -41,7 +42,6 @@ describe('Login Page', () => { it('renders correctly', () => { render(); - expect(screen.getByRole('heading', { name: 'Welcome to Grafana' })).toBeInTheDocument(); expect(screen.getByRole('textbox', { name: 'Email or username' })).toBeInTheDocument(); expect(screen.getByLabelText('Password')).toBeInTheDocument(); expect(screen.getByRole('button', { name: 'Log in' })).toBeInTheDocument(); diff --git a/public/app/core/components/Login/LoginPage.tsx b/public/app/core/components/Login/LoginPage.tsx index 0296e6dd803ff..deec41fee7276 100644 --- a/public/app/core/components/Login/LoginPage.tsx +++ b/public/app/core/components/Login/LoginPage.tsx @@ -38,7 +38,7 @@ const LoginPage = () => { skipPasswordChange, isChangingPassword, showDefaultPasswordWarning, - loginErrorMessage, + loginErrorMessage }) => ( {!isChangingPassword && !showPasswordlessConfirmation && (