Update deps, ticket edit updates
This commit is contained in:
parent
aa453954ed
commit
2d892779bf
19 changed files with 1753 additions and 7776 deletions
|
|
@ -42,31 +42,31 @@ export const TicketEdit: FC<TicketEditProps> = ({ id }) => {
|
|||
useEffect(() => {
|
||||
const fetchAgents = async () => {
|
||||
const result = await getAgentsAction();
|
||||
console.log({ result });
|
||||
console.log({ agents: result });
|
||||
setAgents(result);
|
||||
};
|
||||
|
||||
const fetchGroups = async () => {
|
||||
const result = await getGroupsAction();
|
||||
console.log({ result });
|
||||
console.log({ groups: result });
|
||||
setGroups(result);
|
||||
};
|
||||
|
||||
const fetchTicketStates = async () => {
|
||||
const result = await getTicketStatesAction();
|
||||
console.log({ result });
|
||||
console.log({ ticketStates: result });
|
||||
setTicketStates(result);
|
||||
};
|
||||
|
||||
const fetchTicketPriorities = async () => {
|
||||
const result = await getTicketPrioritiesAction();
|
||||
console.log({ result });
|
||||
console.log({ ticketPriorities: result });
|
||||
setTicketPriorities(result);
|
||||
};
|
||||
|
||||
const fetchTicketTags = async () => {
|
||||
const result = await getTicketTagsAction();
|
||||
console.log({ result });
|
||||
console.log({ tags: result });
|
||||
setTags(result);
|
||||
};
|
||||
|
||||
|
|
@ -127,10 +127,10 @@ export const TicketEdit: FC<TicketEditProps> = ({ id }) => {
|
|||
errors: [],
|
||||
values: {
|
||||
customer: "",
|
||||
group: ticket.group.id?.split("/").pop(),
|
||||
owner: ticket.owner.id?.split("/").pop(),
|
||||
priority: ticket.priority.id?.split("/").pop(),
|
||||
state: ticket.state.id?.split("/").pop(),
|
||||
group: ticket?.group?.id?.split("/").pop(),
|
||||
owner: ticket?.owner?.id?.split("/").pop(),
|
||||
priority: ticket?.priority?.id?.split("/").pop(),
|
||||
state: ticket?.state?.id?.split("/").pop(),
|
||||
tags: [],
|
||||
title: "",
|
||||
article: {
|
||||
|
|
@ -157,21 +157,7 @@ export const TicketEdit: FC<TicketEditProps> = ({ id }) => {
|
|||
name="group"
|
||||
label="Group"
|
||||
formState={formState}
|
||||
getOptions={() =>
|
||||
groups?.map((group: any) => ({
|
||||
value: group.id,
|
||||
label: group.name,
|
||||
})) ?? []
|
||||
}
|
||||
/*
|
||||
onChange={(e: any) => {
|
||||
const newGroup = e.target.value;
|
||||
setSelectedGroup(newGroup);
|
||||
updateTicket({
|
||||
groupId: `gid://zammad/Group/${newGroup}`,
|
||||
});
|
||||
}}
|
||||
*/
|
||||
getOptions={() => groups}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
|
|
@ -180,19 +166,7 @@ export const TicketEdit: FC<TicketEditProps> = ({ id }) => {
|
|||
name="owner"
|
||||
label="Owner"
|
||||
formState={formState}
|
||||
getOptions={() =>
|
||||
agents?.map((user: any) => ({
|
||||
value: user.id,
|
||||
label: `${user.firstname} ${user.lastname}`,
|
||||
})) ?? []
|
||||
}
|
||||
/*
|
||||
onChange={(e: any) => {
|
||||
const newOwner = e.target.value;
|
||||
setSelectedOwner(newOwner);
|
||||
updateTicket({ ownerId: `gid://zammad/User/${newOwner}` });
|
||||
}}
|
||||
*/
|
||||
getOptions={() => agents}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
|
|
@ -249,12 +223,7 @@ export const TicketEdit: FC<TicketEditProps> = ({ id }) => {
|
|||
name="priority"
|
||||
label="Priority"
|
||||
formState={formState}
|
||||
getOptions={() =>
|
||||
ticketPriorities?.map((priority: any) => ({
|
||||
value: priority.id,
|
||||
label: priority.name,
|
||||
})) ?? []
|
||||
}
|
||||
getOptions={() => ticketPriorities}
|
||||
/*
|
||||
onChange={(e: any) => {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue