Login, logout and middleware updates

This commit is contained in:
Darren Clarke 2024-12-13 16:37:20 +01:00
parent f552f8024f
commit 9fb3665ced
18 changed files with 96 additions and 50 deletions

View file

@ -37,11 +37,6 @@ export const TicketEdit: FC<TicketEditProps> = ({ id }) => {
const [agents, setAgents] = useState<any>();
const [pendingVisible, setPendingVisible] = useState(false);
const filteredStates =
ticketStates?.filter(
(state: any) => !["new", "merged", "removed"].includes(state.label),
) ?? [];
useEffect(() => {
const fetchAgents = async () => {
const groupID = formState?.values?.group?.split("/")?.pop();
@ -96,7 +91,7 @@ export const TicketEdit: FC<TicketEditProps> = ({ id }) => {
[name]: value,
},
});
const stateName = filteredStates?.find(
const stateName = ticketStates?.find(
(state: any) => state.id === formState.values.state,
)?.name;
setPendingVisible(stateName?.includes("pending") ?? false);
@ -141,7 +136,7 @@ export const TicketEdit: FC<TicketEditProps> = ({ id }) => {
label="State"
formState={formState}
updateFormState={updateFormState}
getOptions={() => filteredStates}
getOptions={() => ticketStates}
/>
</Grid>
<Grid