mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 00:45:19 +00:00
Teams dropdown bug (#11122)
## Addresses #10756 https://www.loom.com/share/b5ba605b892c4c789a73f05d160819cc - Set the teams dropdown's max-height to be 66% of the viewport height - Made a small script to automate creation of an arbitrary number of teams - [x] Changes file added for user-visible changes in `changes/` - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
parent
83bca0819e
commit
9ea390a7da
2
changes/10756-teams-dropdown-erratic-behavior
Normal file
2
changes/10756-teams-dropdown-erratic-behavior
Normal file
@ -0,0 +1,2 @@
|
||||
- Added a maximum height to the teams dropdown, allowng the user to scroll through a large number of
|
||||
teams
|
@ -22,7 +22,7 @@
|
||||
|
||||
.Select-menu {
|
||||
padding-right: $pad-small; // moves scrollbar to edge of dropdown
|
||||
max-height: none;
|
||||
max-height: 66vh;
|
||||
}
|
||||
|
||||
.Select-menu-outer {
|
||||
|
29
tools/api/fleet/teams/create_n_teams
Executable file
29
tools/api/fleet/teams/create_n_teams
Executable file
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
'''
|
||||
Create n new teams, each with a randomly generated 5-letter name, where n is the integer first
|
||||
argument passed to the script. Assumes all relevant environment variables are set.
|
||||
'''
|
||||
|
||||
import subprocess, os, sys, string, random
|
||||
|
||||
def main(n: int):
|
||||
token, server_url = os.environ.get("TOKEN"), os.environ.get("SERVER_URL")
|
||||
if not token or not server_url:
|
||||
raise Exception("Make sure you have set TOKEN and SERVER_URL as environment variables.")
|
||||
for i in range(n):
|
||||
name = "Team " + ''.join(random.choices(string.ascii_lowercase, k=5)).capitalize()
|
||||
data = f'{{"name": "{name}"}}'
|
||||
print(data)
|
||||
subprocess.run(
|
||||
["curl", "-X", "POST", "-k", "-s", "-H", f"Authorization: Bearer {token}", f"{server_url}/api/latest/fleet/teams", "-d", f"{data}", "--insecure"]
|
||||
)
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
n = int(sys.argv[1])
|
||||
except:
|
||||
raise Exception("Enter the number of teams to create as a single integer argument to this script.")
|
||||
main(n)
|
Loading…
Reference in New Issue
Block a user