@@ -27,8 +27,6 @@ export default [
|
|||||||
rules: {
|
rules: {
|
||||||
"react/react-in-jsx-scope": "off",
|
"react/react-in-jsx-scope": "off",
|
||||||
"react/prop-types": "off",
|
"react/prop-types": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "warn",
|
|
||||||
"react/no-unescaped-entities": "off"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@@ -15,13 +15,6 @@ type ToasterToast = ToastProps & {
|
|||||||
action?: ToastActionElement;
|
action?: ToastActionElement;
|
||||||
};
|
};
|
||||||
|
|
||||||
const actionTypes = {
|
|
||||||
ADD_TOAST: "ADD_TOAST",
|
|
||||||
UPDATE_TOAST: "UPDATE_TOAST",
|
|
||||||
DISMISS_TOAST: "DISMISS_TOAST",
|
|
||||||
REMOVE_TOAST: "REMOVE_TOAST",
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
let count = 0;
|
let count = 0;
|
||||||
|
|
||||||
function genId() {
|
function genId() {
|
||||||
@@ -29,23 +22,21 @@ function genId() {
|
|||||||
return count.toString();
|
return count.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
type ActionType = typeof actionTypes;
|
|
||||||
|
|
||||||
type Action =
|
type Action =
|
||||||
| {
|
| {
|
||||||
type: ActionType["ADD_TOAST"];
|
type: "ADD_TOAST";
|
||||||
toast: ToasterToast;
|
toast: ToasterToast;
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: ActionType["UPDATE_TOAST"];
|
type: "UPDATE_TOAST";
|
||||||
toast: Partial<ToasterToast>;
|
toast: Partial<ToasterToast>;
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: ActionType["DISMISS_TOAST"];
|
type: "DISMISS_TOAST";
|
||||||
toastId?: ToasterToast["id"];
|
toastId?: ToasterToast["id"];
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: ActionType["REMOVE_TOAST"];
|
type: "REMOVE_TOAST";
|
||||||
toastId?: ToasterToast["id"];
|
toastId?: ToasterToast["id"];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -8,10 +8,8 @@ import {
|
|||||||
CardHeader,
|
CardHeader,
|
||||||
CardTitle,
|
CardTitle,
|
||||||
CardDescription,
|
CardDescription,
|
||||||
CardContent,
|
|
||||||
CardFooter,
|
CardFooter,
|
||||||
} from "@/components/ui/card";
|
} from "@/components/ui/card";
|
||||||
import { useToast } from "@/hooks/use-toast";
|
|
||||||
import { Plus } from "lucide-react";
|
import { Plus } from "lucide-react";
|
||||||
import { OrganizationSelectionPageQuery } from "./__generated__/OrganizationSelectionPageQuery.graphql";
|
import { OrganizationSelectionPageQuery } from "./__generated__/OrganizationSelectionPageQuery.graphql";
|
||||||
|
|
||||||
@@ -34,7 +32,6 @@ const organizationSelectionQuery = graphql`
|
|||||||
|
|
||||||
export default function OrganizationSelectionPage() {
|
export default function OrganizationSelectionPage() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { toast } = useToast();
|
|
||||||
const data = useLazyLoadQuery<OrganizationSelectionPageQuery>(
|
const data = useLazyLoadQuery<OrganizationSelectionPageQuery>(
|
||||||
organizationSelectionQuery,
|
organizationSelectionQuery,
|
||||||
{}
|
{}
|
||||||
@@ -45,13 +42,11 @@ export default function OrganizationSelectionPage() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// If there's only one organization, redirect to it automatically
|
|
||||||
if (organizations.length === 1) {
|
if (organizations.length === 1) {
|
||||||
navigate(`/organizations/${organizations[0].id}`);
|
navigate(`/organizations/${organizations[0].id}`);
|
||||||
}
|
}
|
||||||
}, [organizations, navigate]);
|
}, [organizations, navigate]);
|
||||||
|
|
||||||
// If no organizations, show a message to create one
|
|
||||||
if (organizations.length === 0) {
|
if (organizations.length === 0) {
|
||||||
return (
|
return (
|
||||||
<div className="container mx-auto py-10">
|
<div className="container mx-auto py-10">
|
||||||
@@ -63,8 +58,8 @@ export default function OrganizationSelectionPage() {
|
|||||||
<CardHeader>
|
<CardHeader>
|
||||||
<CardTitle>Welcome to Probo</CardTitle>
|
<CardTitle>Welcome to Probo</CardTitle>
|
||||||
<CardDescription>
|
<CardDescription>
|
||||||
You don't have any organizations yet. Create your first one to
|
You don{"'"}t have any organizations yet. Create your first one
|
||||||
get started.
|
to get started.
|
||||||
</CardDescription>
|
</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardFooter>
|
<CardFooter>
|
||||||
@@ -81,7 +76,6 @@ export default function OrganizationSelectionPage() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If multiple organizations, show a selection screen
|
|
||||||
return (
|
return (
|
||||||
<div className="container mx-auto py-10">
|
<div className="container mx-auto py-10">
|
||||||
<Helmet>
|
<Helmet>
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ function PeopleListContent({
|
|||||||
<div>
|
<div>
|
||||||
<h2 className="text-2xl font-semibold mb-1">Employees</h2>
|
<h2 className="text-2xl font-semibold mb-1">Employees</h2>
|
||||||
<p className="text-muted-foreground">
|
<p className="text-muted-foreground">
|
||||||
Keep track of your company's workforce and their progress towards
|
Keep track of your company{"'"}s workforce and their progress towards
|
||||||
completing tasks assigned to them.
|
completing tasks assigned to them.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user