Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next #417

Merged
merged 10 commits into from
Nov 16, 2024
Merged

next #417

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/api/src/controllers/ticket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ export function ticketRoutes(fastify: FastifyInstance) {
});

await sendAssignedEmail(assgined!.email);

const user = await checkSession(request);

await assignedNotification(engineer, ticket, user);
}

const webhook = await prisma.webhooks.findMany({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterEnum
ALTER TYPE "TicketStatus" ADD VALUE 'hold';
1 change: 1 addition & 0 deletions apps/api/src/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ enum Hook {
}

enum TicketStatus {
hold
needs_support
in_progress
in_review
Expand Down
97 changes: 50 additions & 47 deletions apps/client/components/TicketDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import { useUser } from "../../store/session";
import { ClientCombo, IconCombo, UserCombo } from "../Combo";

const ticketStatusMap = [
{ id: 0, value: "hold", name: "Hold", icon: CircleDotDashed },
{ id: 1, value: "needs_support", name: "Needs Support", icon: LifeBuoy },
{ id: 2, value: "in_progress", name: "In Progress", icon: CircleDotDashed },
{ id: 3, value: "in_review", name: "In Review", icon: Loader },
Expand Down Expand Up @@ -975,45 +976,46 @@ export default function Ticket() {
)}
</Button>

{data.ticket.following.length > 0 && (
<div className="flex space-x-2">
<Popover>
<PopoverTrigger>
<PanelTopClose className="h-4 w-4" />
</PopoverTrigger>
<PopoverContent>
<div className="flex flex-col space-y-1">
<span className="text-xs">Followers</span>
{data.ticket.following.map(
(follower: any) => {
const userMatch = users.find(
(user) =>
user.id === follower &&
user.id !==
data.ticket.assignedTo.id
);
console.log(userMatch);
return userMatch ? (
<div key={follower.id}>
<span>{userMatch.name}</span>
</div>
) : null;
}
)}
{data.ticket.following &&
data.ticket.following.length > 0 && (
<div className="flex space-x-2">
<Popover>
<PopoverTrigger>
<PanelTopClose className="h-4 w-4" />
</PopoverTrigger>
<PopoverContent>
<div className="flex flex-col space-y-1">
<span className="text-xs">Followers</span>
{data.ticket.following.map(
(follower: any) => {
const userMatch = users.find(
(user) =>
user.id === follower &&
user.id !==
data.ticket.assignedTo.id
);
console.log(userMatch);
return userMatch ? (
<div key={follower.id}>
<span>{userMatch.name}</span>
</div>
) : null;
}
)}

{data.ticket.following.filter(
(follower: any) =>
follower !== data.ticket.assignedTo.id
).length === 0 && (
<span className="text-xs">
This issue has no followers
</span>
)}
</div>
</PopoverContent>
</Popover>
</div>
)}
{data.ticket.following.filter(
(follower: any) =>
follower !== data.ticket.assignedTo.id
).length === 0 && (
<span className="text-xs">
This issue has no followers
</span>
)}
</div>
</PopoverContent>
</Popover>
</div>
)}
</div>
</div>
<div>
Expand Down Expand Up @@ -1110,15 +1112,16 @@ export default function Ticket() {
<span className="text-xs lowercase">
{moment(comment.createdAt).format("LLL")}
</span>
{comment.user &&
comment.userId === user.id && (
<Trash2
className="h-4 w-4 absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer text-muted-foreground hover:text-destructive"
onClick={() => {
deleteComment(comment.id);
}}
/>
)}
{(user.isAdmin ||
(comment.user &&
comment.userId === user.id)) && (
<Trash2
className="h-4 w-4 absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer text-muted-foreground hover:text-destructive"
onClick={() => {
deleteComment(comment.id);
}}
/>
)}
</div>
<span className="ml-1">{comment.text}</span>
</li>
Expand Down
Loading