Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/api/dtos/frontend_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
6 changes: 4 additions & 2 deletions pkg/api/frontendsettings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
3 changes: 2 additions & 1 deletion public/app/core/components/Login/LoginCtrl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ export class LoginCtrl extends PureComponent<Props, State> {

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;

Expand Down
2 changes: 1 addition & 1 deletion public/app/core/components/Login/LoginPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ jest.mock('@grafana/runtime', () => ({
}));

describe('Login Page', () => {

beforeEach(() => {
jest.resetAllMocks();
});

it('renders correctly', () => {
render(<LoginPage />);

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();
Expand Down
2 changes: 1 addition & 1 deletion public/app/core/components/Login/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const LoginPage = () => {
skipPasswordChange,
isChangingPassword,
showDefaultPasswordWarning,
loginErrorMessage,
loginErrorMessage
}) => (
<LoginLayout isChangingPassword={isChangingPassword}>
{!isChangingPassword && !showPasswordlessConfirmation && (
Expand Down
Loading