Graylog2 / Graylog2/graylog2-server

Create user page does not display a warning when taken username is entered

Open
#13,850 5 comments 0 reactions 0 assignees View on GitHub
bug test-day triaged
Dominant language
Java
Stars
8.1k
Forks
1.1k
Avg merge
1d 20h
Merged PRs (30d)
217

Description

## Expected Behavior

When entering a username that is already taken on the Users > Create user page, a warning should be displayed under the username field that indicates that the username is already taken.

## Current Behavior

When a taken username is entered, the Create User button at the bottom of the page is greyed out (and un-clickable), and there is no explanation to the user for why.

It took me some time to figure out what was causing the button to be greyed out.

For example, see here that the username `dan` is already taken, but there is no warning or explanation displayed on why the Create user button is greyed out.

![image](https://user-images.githubusercontent.com/3423655/199252390-6b302748-5dce-4109-a383-37c61fbaa9fc.png)

## Possible Solution

Add a visible warning under the Username field that says that the entered name is already taken.

The validation for if a username is taken is done here:
https://github.com/Graylog2/graylog2-server/blob/744d9d0157620c77d6237955ed38954c796df98d/graylog2-web-interface/src/components/users/UserCreate/UserCreate.tsx#L69-L79

But, the error is not being displayed anywhere.

## Steps to Reproduce (for bugs)

Create a new user and enter a username that is already taken.

## Context

## Your Environment

* Graylog Version: 5.0.0-beta.2
* Java Version:
* Elasticsearch Version: OpenSearch 2.2.1
* MongoDB Version: 5.0.13
* Operating System: Mac OS Monterey 12.6
* Browser version: Chrome 107.0.5304.87 (Official Build) (arm64)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.