mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Add no team option to automatic enrollment modal (#15616)
This commit is contained in:
parent
654783b715
commit
a59699d207
1 changed files with 12 additions and 4 deletions
|
|
@ -1,7 +1,10 @@
|
|||
import React, { useState, useContext, FormEvent } from "react";
|
||||
|
||||
import { AppContext } from "context/app";
|
||||
import { APP_CONTEXT_NO_TEAM_ID } from "interfaces/team";
|
||||
import {
|
||||
APP_CONTEXT_NO_TEAM_ID,
|
||||
APP_CONTEX_NO_TEAM_SUMMARY,
|
||||
} from "interfaces/team";
|
||||
import configAPI from "services/entities/config";
|
||||
|
||||
// @ts-ignore
|
||||
|
|
@ -26,11 +29,16 @@ const EditTeamModal = ({
|
|||
|
||||
const [selectedTeam, setSelectedTeam] = useState(defaultTeamName);
|
||||
|
||||
// TODO: Should this include "No team" as an option?
|
||||
const teamNameOptions = availableTeams
|
||||
?.filter((t) => t.id > APP_CONTEXT_NO_TEAM_ID)
|
||||
?.filter((t) => t.id >= APP_CONTEXT_NO_TEAM_ID)
|
||||
.map((teamSummary) => {
|
||||
return { value: teamSummary.name, label: teamSummary.name };
|
||||
return {
|
||||
value:
|
||||
teamSummary.name === APP_CONTEX_NO_TEAM_SUMMARY.name
|
||||
? ""
|
||||
: teamSummary.name,
|
||||
label: teamSummary.name,
|
||||
};
|
||||
});
|
||||
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
|
|
|||
Loading…
Reference in a new issue