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

Format code #46

Merged
merged 1 commit into from
Dec 22, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/components/authorities/authority-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ import {
getAuthorities,
} from "@/lib/actions/authorities.action";
import { obfuscate } from "@/lib/endecode";
import { useError } from "@/providers/error-provider";
import { AuthorityDTO } from "@/types/authorities";
import { PermissionUtils } from "@/types/resources";
import { useError } from "@/providers/error-provider";

export function AuthoritiesView() {
const router = useRouter();
Expand Down
2 changes: 1 addition & 1 deletion src/components/authorities/authority-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ import {
getUsersByAuthority,
} from "@/lib/actions/authorities.action";
import { obfuscate } from "@/lib/endecode";
import { useError } from "@/providers/error-provider";
import {
AuthorityDTO,
AuthorityResourcePermissionDTO,
} from "@/types/authorities";
import { PermissionUtils } from "@/types/resources";
import { UserDTO } from "@/types/users";
import { useError } from "@/providers/error-provider";

export const AuthorityView = ({ authorityId }: { authorityId: string }) => {
const permissionLevel = usePagePermission();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
import { getUserActivities } from "@/lib/actions/activity-logs.action";
import { formatDateTimeDistanceToNow } from "@/lib/datetime";
import { obfuscate } from "@/lib/endecode";
import { ActivityLogDTO } from "@/types/activity-logs";
import { useError } from "@/providers/error-provider";
import { ActivityLogDTO } from "@/types/activity-logs";

const RecentUserTeamActivities = () => {
const [activityLogs, setActivityLogs] = useState<ActivityLogDTO[]>([]);
Expand Down
2 changes: 1 addition & 1 deletion src/components/dashboard/notifications-user.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
markNotificationsAsRead,
} from "@/lib/actions/notifications.action";
import { formatDateTimeDistanceToNow } from "@/lib/datetime";
import { NotificationDTO } from "@/types/commons";
import { useError } from "@/providers/error-provider";
import { NotificationDTO } from "@/types/commons";

const UserNotifications = () => {
const [notifications, setNotifications] = useState<NotificationDTO[]>([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Spinner } from "@/components/ui/spinner";
import { getTeamTicketPriorityDistributionForUser } from "@/lib/actions/teams-request.action";
import { TeamRequestPriority } from "@/types/team-requests";
import { useError } from "@/providers/error-provider";
import { TeamRequestPriority } from "@/types/team-requests";

const PRIORITY_COLORS: Record<TeamRequestPriority, string> = {
Critical: "#dc2626",
Expand Down
2 changes: 1 addition & 1 deletion src/components/shared/audit-log-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import { getActivityLogs } from "@/lib/actions/activity-logs.action";
import { formatDateTimeDistanceToNow } from "@/lib/datetime";
import { obfuscate } from "@/lib/endecode";
import { cn } from "@/lib/utils";
import { useError } from "@/providers/error-provider";
import { ActivityLogDTO } from "@/types/activity-logs";
import { EntityType } from "@/types/commons";
import { useError } from "@/providers/error-provider";

type AuditLogViewProps = {
entityType: EntityType;
Expand Down
2 changes: 1 addition & 1 deletion src/components/shared/comments-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
} from "@/lib/actions/comments.action";
import { formatDateTimeDistanceToNow } from "@/lib/datetime";
import { obfuscate } from "@/lib/endecode";
import { CommentDTO, EntityType } from "@/types/commons";
import { useError } from "@/providers/error-provider";
import { CommentDTO, EntityType } from "@/types/commons";

type CommentsViewProps = {
entityType: EntityType;
Expand Down
2 changes: 1 addition & 1 deletion src/components/shared/user-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ import {
} from "@/components/ui/tooltip";
import { searchUsers } from "@/lib/actions/users.action";
import { cn } from "@/lib/utils";
import { useError } from "@/providers/error-provider";
import { QueryDTO } from "@/types/query";
import { UiAttributes } from "@/types/ui-components";
import { useError } from "@/providers/error-provider";

export const UserSelectField = ({
form,
Expand Down
2 changes: 1 addition & 1 deletion src/components/teams/team-add-user-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import {
} from "@/components/ui/form";
import MultipleSelector from "@/components/ui/multi-select-dynamic";
import { addUsersToTeam, findUsersNotInTeam } from "@/lib/actions/teams.action";
import { TeamDTO } from "@/types/teams";
import { useError } from "@/providers/error-provider";
import { TeamDTO } from "@/types/teams";

type AddUserToTeamDialogProps = {
open: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/components/teams/team-dashboard-recent-activities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
} from "@/components/ui/tooltip";
import { getActivityLogs } from "@/lib/actions/activity-logs.action";
import { formatDateTimeDistanceToNow } from "@/lib/datetime";
import { ActivityLogDTO } from "@/types/activity-logs";
import { useError } from "@/providers/error-provider";
import { ActivityLogDTO } from "@/types/activity-logs";

const RecentTeamActivities = ({ teamId }: { teamId: number }) => {
const [activityLogs, setActivityLogs] = useState<ActivityLogDTO[]>([]);
Expand Down
3 changes: 1 addition & 2 deletions src/components/teams/team-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { Loader2 } from "lucide-react";
import { useRouter } from "next/navigation";
import { useSession } from "next-auth/react";
import React, { useEffect, useState } from "react";
import { useForm } from "react-hook-form";

Expand Down Expand Up @@ -32,8 +31,8 @@ import { findTeamById } from "@/lib/actions/teams.action";
import { BACKEND_API } from "@/lib/constants";
import { obfuscate } from "@/lib/endecode";
import { validateForm } from "@/lib/validator";
import { TeamDTO, TeamDTOSchema } from "@/types/teams";
import { useError } from "@/providers/error-provider";
import { TeamDTO, TeamDTOSchema } from "@/types/teams";

export const TeamForm = ({ teamId }: { teamId: number | undefined }) => {
const router = useRouter();
Expand Down
2 changes: 1 addition & 1 deletion src/components/teams/team-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ import { usePagePermission } from "@/hooks/use-page-permission";
import { deleteTeams, searchTeams } from "@/lib/actions/teams.action";
import { obfuscate } from "@/lib/endecode";
import { cn } from "@/lib/utils";
import { useError } from "@/providers/error-provider";
import { Filter, QueryDTO } from "@/types/query";
import { PermissionUtils } from "@/types/resources";
import { TeamDTO } from "@/types/teams";
import { useError } from "@/providers/error-provider";

export const TeamList = () => {
const router = useRouter();
Expand Down
2 changes: 1 addition & 1 deletion src/components/teams/team-new-request-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ import {
FormMessage,
} from "@/components/ui/form";
import { createTeamRequest } from "@/lib/actions/teams-request.action";
import { useError } from "@/providers/error-provider";
import {
TeamRequestDTO,
TeamRequestDTOSchema,
TeamRequestPriority,
} from "@/types/team-requests";
import { TeamDTO } from "@/types/teams";
import { WorkflowDTO } from "@/types/workflows";
import { useError } from "@/providers/error-provider";

type NewRequestToTeamDialogProps = {
open: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/components/teams/team-request-detail-sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import { updateTeamRequest } from "@/lib/actions/teams-request.action";
import { formatDateTimeDistanceToNow } from "@/lib/datetime";
import { obfuscate } from "@/lib/endecode";
import { getSpecifiedColor } from "@/lib/utils";
import { TeamRequestDTO } from "@/types/team-requests";
import { useError } from "@/providers/error-provider";
import { TeamRequestDTO } from "@/types/team-requests";

type RequestDetailsProps = {
open: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/components/teams/team-requests-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import { obfuscate } from "@/lib/endecode";
import { navigateToRecord } from "@/lib/navigation-record";
import { getSpecifiedColor, randomPair } from "@/lib/utils";
import { BreadcrumbProvider } from "@/providers/breadcrumb-provider";
import { useError } from "@/providers/error-provider";
import { PermissionUtils } from "@/types/resources";
import { TeamRequestDTO } from "@/types/team-requests";
import { useError } from "@/providers/error-provider";

const TeamRequestDetailView = ({
teamRequestId,
Expand Down
2 changes: 1 addition & 1 deletion src/components/teams/team-requests-distribution-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Spinner } from "@/components/ui/spinner";
import { getTicketsAssignmentDistributionByTeam } from "@/lib/actions/teams-request.action";
import { obfuscate } from "@/lib/endecode";
import { TicketDistributionDTO } from "@/types/team-requests";
import { useError } from "@/providers/error-provider";
import { TicketDistributionDTO } from "@/types/team-requests";

interface TicketDistributionChartProps {
teamId: number;
Expand Down
4 changes: 2 additions & 2 deletions src/components/teams/team-requests-form.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { zodResolver } from "@hookform/resolvers/zod";
import { notFound, useRouter } from "next/navigation";
import { useRouter } from "next/navigation";
import React, { useEffect, useState } from "react";
import { useForm } from "react-hook-form";

Expand Down Expand Up @@ -34,12 +34,12 @@ import {
import { obfuscate } from "@/lib/endecode";
import { randomPair } from "@/lib/utils";
import { validateForm } from "@/lib/validator";
import { useError } from "@/providers/error-provider";
import {
TeamRequestDTO,
TeamRequestDTOSchema,
TeamRequestPriority,
} from "@/types/team-requests";
import { useError } from "@/providers/error-provider";

export const TeamRequestForm = ({
teamRequestId,
Expand Down
2 changes: 1 addition & 1 deletion src/components/teams/team-requests-overdue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import {
import { getOverdueTicketsByTeam } from "@/lib/actions/teams-request.action";
import { formatDateTimeDistanceToNow } from "@/lib/datetime";
import { obfuscate } from "@/lib/endecode";
import { TeamRequestDTO, TeamRequestPriority } from "@/types/team-requests";
import { useError } from "@/providers/error-provider";
import { TeamRequestDTO, TeamRequestPriority } from "@/types/team-requests";

const TeamOverdueTickets = ({ teamId }: { teamId: number }) => {
const [currentPage, setCurrentPage] = useState(1);
Expand Down
2 changes: 1 addition & 1 deletion src/components/teams/team-requests-priority-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import {
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Spinner } from "@/components/ui/spinner";
import { getTicketsPriorityDistributionByTeam } from "@/lib/actions/teams-request.action";
import { useError } from "@/providers/error-provider";
import { PriorityDistributionDTO } from "@/types/team-requests";
import { TeamRequestPriority } from "@/types/team-requests";
import { useError } from "@/providers/error-provider";

const TicketPriorityPieChart = ({ teamId }: { teamId: number }) => {
const [priorityData, setPriorityData] = useState<PriorityDistributionDTO[]>(
Expand Down
2 changes: 1 addition & 1 deletion src/components/teams/team-requests-timeline-history.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import {
} from "@/components/ui/tooltip";
import { getTeamRequestStateChangesHistory } from "@/lib/actions/teams.action";
import { formatDateTimeDistanceToNow } from "@/lib/datetime";
import { TransitionItemCollectionDTO } from "@/types/teams";
import { useError } from "@/providers/error-provider";
import { TransitionItemCollectionDTO } from "@/types/teams";

const TeamRequestsTimelineHistory = ({ teamId }: { teamId: number }) => {
const [transitionItemCollection, setTransitionItemCollection] =
Expand Down
2 changes: 1 addition & 1 deletion src/components/teams/team-requests-unassigned.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import {
import { getUnassignedTickets } from "@/lib/actions/teams-request.action";
import { formatDateTimeDistanceToNow } from "@/lib/datetime";
import { obfuscate } from "@/lib/endecode";
import { TeamRequestDTO, TeamRequestPriority } from "@/types/team-requests";
import { useError } from "@/providers/error-provider";
import { TeamRequestDTO, TeamRequestPriority } from "@/types/team-requests";

const UnassignedTickets = ({ teamId }: { teamId: number }) => {
const [currentPage, setCurrentPage] = useState(1);
Expand Down
2 changes: 1 addition & 1 deletion src/components/teams/team-requests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ import { searchTeamRequests } from "@/lib/actions/teams-request.action";
import { getWorkflowsByTeam } from "@/lib/actions/workflows.action";
import { obfuscate } from "@/lib/endecode";
import { BreadcrumbProvider } from "@/providers/breadcrumb-provider";
import { useError } from "@/providers/error-provider";
import { useTeam } from "@/providers/team-provider";
import { useUserTeamRole } from "@/providers/user-team-role-provider";
import { Filter, GroupFilter, QueryDTO } from "@/types/query";
import { PermissionUtils } from "@/types/resources";
import { TeamRequestDTO } from "@/types/team-requests";
import { WorkflowDTO } from "@/types/workflows";
import { useError } from "@/providers/error-provider";

export type Pagination = {
page: number;
Expand Down
2 changes: 1 addition & 1 deletion src/components/teams/team-users-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import {
} from "@/components/ui/popover";
import { findMembersByTeamId } from "@/lib/actions/teams.action";
import { cn } from "@/lib/utils";
import { useError } from "@/providers/error-provider";
import { UiAttributes } from "@/types/ui-components";
import { UserWithTeamRoleDTO } from "@/types/users";
import { useError } from "@/providers/error-provider";

const TeamUserSelectField = ({
form,
Expand Down
2 changes: 1 addition & 1 deletion src/components/teams/team-users.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ import {
} from "@/lib/actions/teams.action";
import { obfuscate } from "@/lib/endecode";
import { BreadcrumbProvider } from "@/providers/breadcrumb-provider";
import { useError } from "@/providers/error-provider";
import { useTeam } from "@/providers/team-provider";
import { useUserTeamRole } from "@/providers/user-team-role-provider";
import { PermissionUtils } from "@/types/resources";
import { UserWithTeamRoleDTO } from "@/types/users";
import { useError } from "@/providers/error-provider";

const TeamUsersView = () => {
const team = useTeam();
Expand Down
2 changes: 1 addition & 1 deletion src/components/teams/team-workflow-detail-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import {
} from "@/lib/actions/workflows.action";
import { obfuscate } from "@/lib/endecode";
import { BreadcrumbProvider } from "@/providers/breadcrumb-provider";
import { useError } from "@/providers/error-provider";
import { useTeam } from "@/providers/team-provider";
import { useUserTeamRole } from "@/providers/user-team-role-provider";
import { PermissionUtils } from "@/types/resources";
import { WorkflowDetailDTO } from "@/types/workflows";
import { useError } from "@/providers/error-provider";

const TeamWorkflowDetailView = ({ workflowId }: { workflowId: number }) => {
const team = useTeam();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import {
getGlobalWorkflowHasNotLinkedWithTeam,
} from "@/lib/actions/workflows.action";
import { obfuscate } from "@/lib/endecode";
import { WorkflowDTO } from "@/types/workflows";
import { useError } from "@/providers/error-provider";
import { WorkflowDTO } from "@/types/workflows";

const workflowReferenceSchema = z.object({
referenceWorkflowId: z
Expand Down
2 changes: 1 addition & 1 deletion src/components/teams/team-workflows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ import {
import { obfuscate } from "@/lib/endecode";
import { cn } from "@/lib/utils";
import { BreadcrumbProvider } from "@/providers/breadcrumb-provider";
import { useError } from "@/providers/error-provider";
import { useTeam } from "@/providers/team-provider";
import { useUserTeamRole } from "@/providers/user-team-role-provider";
import { PermissionUtils } from "@/types/resources";
import { WorkflowDTO } from "@/types/workflows";
import { useError } from "@/providers/error-provider";

const TeamWorkflowsView = () => {
const team = useTeam();
Expand Down
2 changes: 1 addition & 1 deletion src/components/users/authorities-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import {
} from "@/components/ui/form";
import { MultiSelect } from "@/components/ui/multi-select";
import { getAuthorities } from "@/lib/actions/authorities.action";
import { useError } from "@/providers/error-provider";
import { AuthorityDTO } from "@/types/authorities";
import { UiAttributes } from "@/types/ui-components";
import { useError } from "@/providers/error-provider";

interface AuthoritiesSelectProps {
form: any;
Expand Down
2 changes: 1 addition & 1 deletion src/components/users/user-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import { Form } from "@/components/ui/form";
import { Separator } from "@/components/ui/separator";
import { createUser, findUserById } from "@/lib/actions/users.action";
import { obfuscate } from "@/lib/endecode";
import { UserDTO, UserDTOSchema } from "@/types/users";
import { useError } from "@/providers/error-provider";
import { UserDTO, UserDTOSchema } from "@/types/users";

type UserFormValues = z.infer<typeof UserDTOSchema>;

Expand Down
2 changes: 1 addition & 1 deletion src/components/users/user-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ import {
} from "@/lib/actions/users.action";
import { obfuscate } from "@/lib/endecode";
import { cn } from "@/lib/utils";
import { useError } from "@/providers/error-provider";
import { QueryDTO } from "@/types/query";
import { PermissionUtils } from "@/types/resources";
import { UserDTO } from "@/types/users";
import { useError } from "@/providers/error-provider";

export const UserList = () => {
const { toast } = useToast();
Expand Down
2 changes: 1 addition & 1 deletion src/components/users/user-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import { usePagePermission } from "@/hooks/use-page-permission";
import { findTeamsByMemberId } from "@/lib/actions/teams.action";
import { findUserById, getDirectReports } from "@/lib/actions/users.action";
import { obfuscate } from "@/lib/endecode";
import { useError } from "@/providers/error-provider";
import { PermissionUtils } from "@/types/resources";
import { TeamDTO } from "@/types/teams";
import { UserDTO } from "@/types/users";
import { useError } from "@/providers/error-provider";

export const UserView = ({ userId }: { userId: number }) => {
const [user, setUser] = useState<UserDTO | undefined | null>(undefined);
Expand Down
2 changes: 1 addition & 1 deletion src/components/workflows/workflow-create-from-scratch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { WorkflowDiagram } from "@/components/workflows/workflow-diagram-view";
import WorkflowEditForm from "@/components/workflows/workflow-editor-form";
import { saveWorkflowDetail } from "@/lib/actions/workflows.action";
import { obfuscate } from "@/lib/endecode";
import { WorkflowDetailDTO } from "@/types/workflows";
import { useError } from "@/providers/error-provider";
import { WorkflowDetailDTO } from "@/types/workflows";

const defaultWorkflow: WorkflowDetailDTO = {
id: undefined,
Expand Down
2 changes: 1 addition & 1 deletion src/components/workflows/workflow-detail-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import {
getWorkflowDetail,
updateWorkflowDetail,
} from "@/lib/actions/workflows.action";
import { useError } from "@/providers/error-provider";
import { PermissionUtils } from "@/types/resources";
import { WorkflowDetailDTO } from "@/types/workflows";
import { useError } from "@/providers/error-provider";

const GlobalWorkflowDetailView = ({ workflowId }: { workflowId: number }) => {
const router = useRouter();
Expand Down
Loading
Loading