fleetdm / fleet

Open-source platform for IT, security, and infrastructure teams. (Linux, macOS, Chrome, Windows, cloud, data center)
https://fleetdm.com
Other
2.95k stars 409 forks source link

Team name sorting #22212

Open getvictor opened 3 days ago

getvictor commented 3 days ago

Fleet version: <!-- Copy this from the "My account" page in the Fleet UI, or run fleetctl --version --> 4.46.0 Web browser and operating system:


💥  Actual behavior

https://www.loom.com/share/eff317c89e0c43a8a1c2e184ffadf157 and

image.png

🧑‍💻  Steps to reproduce

See video

🕯️ More info (optional)

N/A

🛠️ To fix

sharon-fdm commented 3 days ago

@noahtalerman, we suggest two options: 1 - not allow leading white-spaces in team names. 2 - trim if exists. Please advise.

RachelElysia commented 3 days ago

Suggesting: Backend fix only since you can create/edit a team without the UI

noahtalerman commented 3 days ago

@noahtalerman, we suggest two options: 1 - not allow leading white-spaces in team names. 2 - trim if exists.

@rachaelshaw this feels like a common problem that a lot of apps run into. Do you know how this problem is solved in other apps? Do they even solve it?

cc @sharon-fdm

rachaelshaw commented 3 days ago

@noahtalerman in the past I've usually trimmed leading/trailing whitespace in the form fields and in the API (unless there was a specific reason to allow it somewhere); It's a pretty common problem to end up with extra spaces when text is copied/pasted into form fields. I just tested w/ queries and looks like this spans more than just teams:

Screenshot 2024-09-18 at 4 03 51 PM

To handle this, we could potentially:

noahtalerman commented 2 days ago

@rachaelshaw thanks!

Which one do you think we should go with? Sounds like trimming is the go-to in other apps?

rachaelshaw commented 2 days ago

Which one do you think we should go with?

@noahtalerman I was thinking both:

(If I had to pick one or the other for the sake of time, though, I'd just go with trimming the form fields)