Add no team option to automatic enrollment modal (#15616)

This commit is contained in:
Sarah Gillespie 2023-12-13 12:27:14 -06:00 committed by GitHub
parent 654783b715
commit a59699d207
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);