@@ -3,30 +3,30 @@ import pluginJs from "@eslint/js";
|
|||||||
import tseslint from "typescript-eslint";
|
import tseslint from "typescript-eslint";
|
||||||
import pluginReact from "eslint-plugin-react";
|
import pluginReact from "eslint-plugin-react";
|
||||||
|
|
||||||
|
|
||||||
/** @type {import('eslint').Linter.Config[]} */
|
/** @type {import('eslint').Linter.Config[]} */
|
||||||
export default [
|
export default [
|
||||||
{files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"]},
|
{ files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"] },
|
||||||
{languageOptions: {
|
{
|
||||||
globals: globals.browser,
|
languageOptions: {
|
||||||
parserOptions: {
|
globals: globals.browser,
|
||||||
ecmaFeatures: {
|
parserOptions: {
|
||||||
jsx: true
|
ecmaFeatures: {
|
||||||
}
|
jsx: true,
|
||||||
}
|
},
|
||||||
}},
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
pluginJs.configs.recommended,
|
pluginJs.configs.recommended,
|
||||||
...tseslint.configs.recommended,
|
...tseslint.configs.recommended,
|
||||||
pluginReact.configs.flat.recommended,
|
pluginReact.configs.flat.recommended,
|
||||||
{
|
{
|
||||||
settings: {
|
settings: {
|
||||||
react: {
|
react: {
|
||||||
version: "detect"
|
version: "detect",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
"react/react-in-jsx-scope": "off",
|
"react/react-in-jsx-scope": "off",
|
||||||
"react/prop-types": "off",
|
},
|
||||||
}
|
},
|
||||||
}
|
];
|
||||||
];
|
|
||||||
|
|||||||
@@ -7,10 +7,29 @@
|
|||||||
|
|
||||||
<link rel="icon shortcut" href="/assets/favicon.ico" sizes="32x32" />
|
<link rel="icon shortcut" href="/assets/favicon.ico" sizes="32x32" />
|
||||||
<link rel="icon" href="/assets/favicon.svg" type="image/svg+xml" />
|
<link rel="icon" href="/assets/favicon.svg" type="image/svg+xml" />
|
||||||
<link rel="icon" href="/assets/favicon-dark.svg" type="image/svg+xml" media="(prefers-color-scheme: dark)" />
|
<link
|
||||||
<link rel="icon" href="/assets/favicon-16x16.png" type="image/png" sizes="16x16" />
|
rel="icon"
|
||||||
<link rel="icon" href="/assets/favicon-32x32.png" type="image/png" sizes="32x32" />
|
href="/assets/favicon-dark.svg"
|
||||||
<link rel="apple-touch-icon" href="/assets/apple-touch-icon.png" sizes="180x180" />
|
type="image/svg+xml"
|
||||||
|
media="(prefers-color-scheme: dark)"
|
||||||
|
/>
|
||||||
|
<link
|
||||||
|
rel="icon"
|
||||||
|
href="/assets/favicon-16x16.png"
|
||||||
|
type="image/png"
|
||||||
|
sizes="16x16"
|
||||||
|
/>
|
||||||
|
<link
|
||||||
|
rel="icon"
|
||||||
|
href="/assets/favicon-32x32.png"
|
||||||
|
type="image/png"
|
||||||
|
sizes="32x32"
|
||||||
|
/>
|
||||||
|
<link
|
||||||
|
rel="apple-touch-icon"
|
||||||
|
href="/assets/apple-touch-icon.png"
|
||||||
|
sizes="180x180"
|
||||||
|
/>
|
||||||
|
|
||||||
<meta name="description" content="The open-source compliance platform" />
|
<meta name="description" content="The open-source compliance platform" />
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ posthog.init(process.env.POSTHOG_KEY!, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const OrganizationSelectionPage = lazy(
|
const OrganizationSelectionPage = lazy(
|
||||||
() => import("./pages/OrganizationSelectionPage")
|
() => import("./pages/OrganizationSelectionPage"),
|
||||||
);
|
);
|
||||||
const HomePage = lazy(() => import("./pages/HomePage"));
|
const HomePage = lazy(() => import("./pages/HomePage"));
|
||||||
const NotFoundPage = lazy(() => import("./pages/NotFoundPage"));
|
const NotFoundPage = lazy(() => import("./pages/NotFoundPage"));
|
||||||
@@ -35,14 +35,14 @@ const VendorOverviewPage = lazy(() => import("./pages/VendorOverviewPage"));
|
|||||||
const SettingsPage = lazy(() => import("./pages/SettingsPage"));
|
const SettingsPage = lazy(() => import("./pages/SettingsPage"));
|
||||||
const CreatePeoplePage = lazy(() => import("./pages/CreatePeoplePage"));
|
const CreatePeoplePage = lazy(() => import("./pages/CreatePeoplePage"));
|
||||||
const FrameworkOverviewPage = lazy(
|
const FrameworkOverviewPage = lazy(
|
||||||
() => import("./pages/FrameworkOverviewPage")
|
() => import("./pages/FrameworkOverviewPage"),
|
||||||
);
|
);
|
||||||
const ControlOverviewPage = lazy(() => import("./pages/ControlOverviewPage"));
|
const ControlOverviewPage = lazy(() => import("./pages/ControlOverviewPage"));
|
||||||
const PeopleOverviewPage = lazy(() => import("./pages/PeopleOverviewPage"));
|
const PeopleOverviewPage = lazy(() => import("./pages/PeopleOverviewPage"));
|
||||||
const LoginPage = lazy(() => import("./pages/LoginPage"));
|
const LoginPage = lazy(() => import("./pages/LoginPage"));
|
||||||
const RegisterPage = lazy(() => import("./pages/RegisterPage"));
|
const RegisterPage = lazy(() => import("./pages/RegisterPage"));
|
||||||
const CreateOrganizationPage = lazy(
|
const CreateOrganizationPage = lazy(
|
||||||
() => import("./pages/CreateOrganizationPage")
|
() => import("./pages/CreateOrganizationPage"),
|
||||||
);
|
);
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export function NavMain({
|
|||||||
// If the item has sub-items, check if any of them match the current path
|
// If the item has sub-items, check if any of them match the current path
|
||||||
if (item.items?.length) {
|
if (item.items?.length) {
|
||||||
return item.items.some((subItem) =>
|
return item.items.some((subItem) =>
|
||||||
location.pathname.startsWith(subItem.url)
|
location.pathname.startsWith(subItem.url),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ export function NavMain({
|
|||||||
<SidebarMenuSub>
|
<SidebarMenuSub>
|
||||||
{item.items?.map((subItem) => {
|
{item.items?.map((subItem) => {
|
||||||
const subItemActive = location.pathname.startsWith(
|
const subItemActive = location.pathname.startsWith(
|
||||||
subItem.url
|
subItem.url,
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -40,11 +40,8 @@ export const teamSwitcherFragment = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// Extended type to include plan field until Relay compiler generates the types
|
|
||||||
type Organization =
|
type Organization =
|
||||||
TeamSwitcher_organizations$data["organizations"]["edges"][0]["node"] & {
|
TeamSwitcher_organizations$data["organizations"]["edges"][0]["node"];
|
||||||
plan?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export function TeamSwitcher({
|
export function TeamSwitcher({
|
||||||
organizations,
|
organizations,
|
||||||
@@ -60,9 +57,8 @@ export function TeamSwitcher({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (data.organizations && data.organizations.edges.length > 0) {
|
if (data.organizations && data.organizations.edges.length > 0) {
|
||||||
// Find the current organization based on the URL parameter
|
|
||||||
const org = data.organizations.edges.find(
|
const org = data.organizations.edges.find(
|
||||||
(edge) => edge.node.id === organizationId
|
(edge) => edge.node.id === organizationId,
|
||||||
);
|
);
|
||||||
if (org) {
|
if (org) {
|
||||||
setCurrentOrganization(org.node);
|
setCurrentOrganization(org.node);
|
||||||
@@ -70,12 +66,10 @@ export function TeamSwitcher({
|
|||||||
}
|
}
|
||||||
}, [data.organizations, organizationId]);
|
}, [data.organizations, organizationId]);
|
||||||
|
|
||||||
// If no organizations or data is still loading
|
|
||||||
if (!currentOrganization) {
|
if (!currentOrganization) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert logoUrl to a React component
|
|
||||||
const LogoComponent = ({
|
const LogoComponent = ({
|
||||||
org,
|
org,
|
||||||
className,
|
className,
|
||||||
@@ -90,7 +84,6 @@ export function TeamSwitcher({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleOrganizationSwitch = (org: Organization) => {
|
const handleOrganizationSwitch = (org: Organization) => {
|
||||||
// Navigate to the selected organization
|
|
||||||
navigate(`/organizations/${org.id}`);
|
navigate(`/organizations/${org.id}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ function BreadcrumbHome({ children }: { children: React.ReactNode }) {
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
{ organizationId: organizationId! },
|
{ organizationId: organizationId! },
|
||||||
{ fetchPolicy: "store-or-network" }
|
{ fetchPolicy: "store-or-network" },
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -107,7 +107,7 @@ function BreadcrumbFrameworkOverview() {
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
{ frameworkId: frameworkId! },
|
{ frameworkId: frameworkId! },
|
||||||
{ fetchPolicy: "store-or-network" }
|
{ fetchPolicy: "store-or-network" },
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -156,7 +156,7 @@ function BreadcrumbVendorOverview() {
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
{ vendorId: vendorId! },
|
{ vendorId: vendorId! },
|
||||||
{ fetchPolicy: "store-or-network" }
|
{ fetchPolicy: "store-or-network" },
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -216,7 +216,7 @@ function BreadcrumbPeopleOverview() {
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
{ peopleId: peopleId! },
|
{ peopleId: peopleId! },
|
||||||
{ fetchPolicy: "store-or-network" }
|
{ fetchPolicy: "store-or-network" },
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -259,7 +259,7 @@ function BreadcrumbControlOverview() {
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
{ frameworkId: frameworkId!, controlId: controlId! },
|
{ frameworkId: frameworkId!, controlId: controlId! },
|
||||||
{ fetchPolicy: "store-or-network" }
|
{ fetchPolicy: "store-or-network" },
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -86,11 +86,11 @@ export default function CreateOrganizationPage() {
|
|||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const data = useLazyLoadQuery<CreateOrganizationPageViewerQuery>(
|
const data = useLazyLoadQuery<CreateOrganizationPageViewerQuery>(
|
||||||
viewerQuery,
|
viewerQuery,
|
||||||
{}
|
{},
|
||||||
);
|
);
|
||||||
const [createOrganization] =
|
const [createOrganization] =
|
||||||
useMutation<CreateOrganizationPageCreateOrganizationMutation>(
|
useMutation<CreateOrganizationPageCreateOrganizationMutation>(
|
||||||
createOrganizationMutation
|
createOrganizationMutation,
|
||||||
);
|
);
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
name: "",
|
name: "",
|
||||||
@@ -114,7 +114,7 @@ export default function CreateOrganizationPage() {
|
|||||||
connections: [
|
connections: [
|
||||||
ConnectionHandler.getConnectionID(
|
ConnectionHandler.getConnectionID(
|
||||||
data.viewer.id,
|
data.viewer.id,
|
||||||
"TeamSwitcher_organizations"
|
"TeamSwitcher_organizations",
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ function CreatePeoplePageContent() {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const peopleConnectionId = ConnectionHandler.getConnectionID(
|
const peopleConnectionId = ConnectionHandler.getConnectionID(
|
||||||
organizationId!,
|
organizationId!,
|
||||||
"PeopleListPage_peoples"
|
"PeopleListPage_peoples",
|
||||||
);
|
);
|
||||||
|
|
||||||
createPeople({
|
createPeople({
|
||||||
@@ -165,7 +165,7 @@ function CreatePeoplePageContent() {
|
|||||||
newEmails[index] = e.target.value;
|
newEmails[index] = e.target.value;
|
||||||
handleFieldChange(
|
handleFieldChange(
|
||||||
"additionalEmailAddresses",
|
"additionalEmailAddresses",
|
||||||
newEmails
|
newEmails,
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -175,11 +175,11 @@ function CreatePeoplePageContent() {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
const newEmails =
|
const newEmails =
|
||||||
formData.additionalEmailAddresses.filter(
|
formData.additionalEmailAddresses.filter(
|
||||||
(_, i) => i !== index
|
(_, i) => i !== index,
|
||||||
);
|
);
|
||||||
handleFieldChange(
|
handleFieldChange(
|
||||||
"additionalEmailAddresses",
|
"additionalEmailAddresses",
|
||||||
newEmails
|
newEmails,
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -227,7 +227,7 @@ function CreatePeoplePageContent() {
|
|||||||
"rounded-full px-4 py-1 text-sm transition-colors",
|
"rounded-full px-4 py-1 text-sm transition-colors",
|
||||||
formData.kind === "EMPLOYEE"
|
formData.kind === "EMPLOYEE"
|
||||||
? "bg-blue-100 text-blue-900 ring-2 ring-blue-600 ring-offset-2"
|
? "bg-blue-100 text-blue-900 ring-2 ring-blue-600 ring-offset-2"
|
||||||
: "bg-gray-100 text-gray-900 hover:bg-gray-200"
|
: "bg-gray-100 text-gray-900 hover:bg-gray-200",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
Employee
|
Employee
|
||||||
@@ -239,7 +239,7 @@ function CreatePeoplePageContent() {
|
|||||||
"rounded-full px-4 py-1 text-sm transition-colors",
|
"rounded-full px-4 py-1 text-sm transition-colors",
|
||||||
formData.kind === "CONTRACTOR"
|
formData.kind === "CONTRACTOR"
|
||||||
? "bg-purple-100 text-purple-900 ring-2 ring-purple-600 ring-offset-2"
|
? "bg-purple-100 text-purple-900 ring-2 ring-purple-600 ring-offset-2"
|
||||||
: "bg-gray-100 text-gray-900 hover:bg-gray-200"
|
: "bg-gray-100 text-gray-900 hover:bg-gray-200",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
Contractor
|
Contractor
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ function FrameworkListPageContent({
|
|||||||
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-2">
|
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-2">
|
||||||
{frameworks.map((framework) => {
|
{frameworks.map((framework) => {
|
||||||
const validatedControls = framework.controls.edges.filter(
|
const validatedControls = framework.controls.edges.filter(
|
||||||
(edge) => edge?.node?.state === "IMPLEMENTED"
|
(edge) => edge?.node?.state === "IMPLEMENTED",
|
||||||
).length;
|
).length;
|
||||||
const totalControls = framework.controls.edges.length;
|
const totalControls = framework.controls.edges.length;
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ function FrameworkListPageFallback() {
|
|||||||
|
|
||||||
export default function FrameworkListPage() {
|
export default function FrameworkListPage() {
|
||||||
const [queryRef, loadQuery] = useQueryLoader<FrameworkListPageQueryType>(
|
const [queryRef, loadQuery] = useQueryLoader<FrameworkListPageQueryType>(
|
||||||
FrameworkListPageQuery
|
FrameworkListPageQuery,
|
||||||
);
|
);
|
||||||
|
|
||||||
const { organizationId } = useParams();
|
const { organizationId } = useParams();
|
||||||
|
|||||||
@@ -56,14 +56,17 @@ function FrameworkOverviewPageContent({
|
|||||||
const { organizationId } = useParams();
|
const { organizationId } = useParams();
|
||||||
|
|
||||||
// Group controls by their category
|
// Group controls by their category
|
||||||
const controlsByCategory = controls.reduce((acc, control) => {
|
const controlsByCategory = controls.reduce(
|
||||||
if (!control?.category) return acc;
|
(acc, control) => {
|
||||||
if (!acc[control.category]) {
|
if (!control?.category) return acc;
|
||||||
acc[control.category] = [];
|
if (!acc[control.category]) {
|
||||||
}
|
acc[control.category] = [];
|
||||||
acc[control.category].push(control);
|
}
|
||||||
return acc;
|
acc[control.category].push(control);
|
||||||
}, {} as Record<string, typeof controls>);
|
return acc;
|
||||||
|
},
|
||||||
|
{} as Record<string, typeof controls>,
|
||||||
|
);
|
||||||
|
|
||||||
const controlCards = Object.entries(controlsByCategory).map(
|
const controlCards = Object.entries(controlsByCategory).map(
|
||||||
([category, controls]) => ({
|
([category, controls]) => ({
|
||||||
@@ -71,11 +74,11 @@ function FrameworkOverviewPageContent({
|
|||||||
controls,
|
controls,
|
||||||
completed: controls.filter((c) => c?.state === "IMPLEMENTED").length,
|
completed: controls.filter((c) => c?.state === "IMPLEMENTED").length,
|
||||||
total: controls.length,
|
total: controls.length,
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
const totalImplemented = controls.filter(
|
const totalImplemented = controls.filter(
|
||||||
(c) => c?.state === "IMPLEMENTED"
|
(c) => c?.state === "IMPLEMENTED",
|
||||||
).length;
|
).length;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -187,7 +190,7 @@ function FrameworkOverviewPageContent({
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (control?.id) {
|
if (control?.id) {
|
||||||
navigate(
|
navigate(
|
||||||
`/organizations/${organizationId}/frameworks/${framework.id}/controls/${control.id}`
|
`/organizations/${organizationId}/frameworks/${framework.id}/controls/${control.id}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
@@ -271,7 +274,7 @@ function FrameworkOverviewPageContent({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>,
|
</div>,
|
||||||
document.body
|
document.body,
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -305,7 +308,7 @@ function FrameworkOverviewPageFallback() {
|
|||||||
export default function FrameworkOverviewPage() {
|
export default function FrameworkOverviewPage() {
|
||||||
const { frameworkId } = useParams();
|
const { frameworkId } = useParams();
|
||||||
const [queryRef, loadQuery] = useQueryLoader<FrameworkOverviewPageQueryType>(
|
const [queryRef, loadQuery] = useQueryLoader<FrameworkOverviewPageQueryType>(
|
||||||
FrameworkOverviewPageQuery
|
FrameworkOverviewPageQuery,
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ export default function OrganizationSelectionPage() {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const data = useLazyLoadQuery<OrganizationSelectionPageQuery>(
|
const data = useLazyLoadQuery<OrganizationSelectionPageQuery>(
|
||||||
organizationSelectionQuery,
|
organizationSelectionQuery,
|
||||||
{}
|
{},
|
||||||
);
|
);
|
||||||
|
|
||||||
const organizations = data.viewer.organizations.edges.map(
|
const organizations = data.viewer.organizations.edges.map(
|
||||||
(edge) => edge.node
|
(edge) => edge.node,
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ function PeopleListContent({
|
|||||||
}) {
|
}) {
|
||||||
const data = usePreloadedQuery<PeopleListPageQueryType>(
|
const data = usePreloadedQuery<PeopleListPageQueryType>(
|
||||||
peopleListPageQuery,
|
peopleListPageQuery,
|
||||||
queryRef
|
queryRef,
|
||||||
);
|
);
|
||||||
const [, setSearchParams] = useSearchParams();
|
const [, setSearchParams] = useSearchParams();
|
||||||
const [, startTransition] = useTransition();
|
const [, startTransition] = useTransition();
|
||||||
@@ -216,8 +216,8 @@ function PeopleListContent({
|
|||||||
{person?.kind === "EMPLOYEE"
|
{person?.kind === "EMPLOYEE"
|
||||||
? "Employee"
|
? "Employee"
|
||||||
: person?.kind === "CONTRACTOR"
|
: person?.kind === "CONTRACTOR"
|
||||||
? "Contractor"
|
? "Contractor"
|
||||||
: "Vendor"}
|
: "Vendor"}
|
||||||
</Badge>
|
</Badge>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
@@ -227,7 +227,7 @@ function PeopleListContent({
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (
|
if (
|
||||||
window.confirm(
|
window.confirm(
|
||||||
"Are you sure you want to delete this person?"
|
"Are you sure you want to delete this person?",
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
deletePeople({
|
deletePeople({
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ function PeopleOverviewPageContent({
|
|||||||
});
|
});
|
||||||
const [commit] = useMutation(updatePeopleMutation);
|
const [commit] = useMutation(updatePeopleMutation);
|
||||||
const [, loadQuery] = useQueryLoader<PeopleOverviewPageQueryType>(
|
const [, loadQuery] = useQueryLoader<PeopleOverviewPageQueryType>(
|
||||||
peopleOverviewPageQuery
|
peopleOverviewPageQuery,
|
||||||
);
|
);
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
|
|
||||||
@@ -198,7 +198,7 @@ function PeopleOverviewPageContent({
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
const newEmails =
|
const newEmails =
|
||||||
formData.additionalEmailAddresses.filter(
|
formData.additionalEmailAddresses.filter(
|
||||||
(_, i) => i !== index
|
(_, i) => i !== index,
|
||||||
);
|
);
|
||||||
handleFieldChange("additionalEmailAddresses", newEmails);
|
handleFieldChange("additionalEmailAddresses", newEmails);
|
||||||
}}
|
}}
|
||||||
@@ -243,7 +243,7 @@ function PeopleOverviewPageContent({
|
|||||||
"rounded-full px-4 py-1 text-sm transition-colors",
|
"rounded-full px-4 py-1 text-sm transition-colors",
|
||||||
formData.kind === "EMPLOYEE"
|
formData.kind === "EMPLOYEE"
|
||||||
? "bg-blue-100 text-blue-900 ring-2 ring-blue-600 ring-offset-2"
|
? "bg-blue-100 text-blue-900 ring-2 ring-blue-600 ring-offset-2"
|
||||||
: "bg-gray-100 text-gray-900 hover:bg-gray-200"
|
: "bg-gray-100 text-gray-900 hover:bg-gray-200",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
Employee
|
Employee
|
||||||
@@ -254,7 +254,7 @@ function PeopleOverviewPageContent({
|
|||||||
"rounded-full px-4 py-1 text-sm transition-colors",
|
"rounded-full px-4 py-1 text-sm transition-colors",
|
||||||
formData.kind === "CONTRACTOR"
|
formData.kind === "CONTRACTOR"
|
||||||
? "bg-purple-100 text-purple-900 ring-2 ring-purple-600 ring-offset-2"
|
? "bg-purple-100 text-purple-900 ring-2 ring-purple-600 ring-offset-2"
|
||||||
: "bg-gray-100 text-gray-900 hover:bg-gray-200"
|
: "bg-gray-100 text-gray-900 hover:bg-gray-200",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
Contractor
|
Contractor
|
||||||
@@ -303,7 +303,7 @@ function PeopleOverviewPageFallback() {
|
|||||||
export default function PeopleOverviewPage() {
|
export default function PeopleOverviewPage() {
|
||||||
const { peopleId } = useParams();
|
const { peopleId } = useParams();
|
||||||
const [queryRef, loadQuery] = useQueryLoader<PeopleOverviewPageQueryType>(
|
const [queryRef, loadQuery] = useQueryLoader<PeopleOverviewPageQueryType>(
|
||||||
peopleOverviewPageQuery
|
peopleOverviewPageQuery,
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ function VendorListContent({
|
|||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const data = usePreloadedQuery<VendorListPageQueryType>(
|
const data = usePreloadedQuery<VendorListPageQueryType>(
|
||||||
vendorListPageQuery,
|
vendorListPageQuery,
|
||||||
queryRef
|
queryRef,
|
||||||
);
|
);
|
||||||
const [, setSearchParams] = useSearchParams();
|
const [, setSearchParams] = useSearchParams();
|
||||||
const [, startTransition] = useTransition();
|
const [, startTransition] = useTransition();
|
||||||
@@ -335,7 +335,7 @@ function VendorListContent({
|
|||||||
e.preventDefault(); // Prevent navigation
|
e.preventDefault(); // Prevent navigation
|
||||||
if (
|
if (
|
||||||
window.confirm(
|
window.confirm(
|
||||||
"Are you sure you want to delete this vendor?"
|
"Are you sure you want to delete this vendor?",
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
deleteVendor({
|
deleteVendor({
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ function VendorOverviewPageContent({
|
|||||||
});
|
});
|
||||||
const [commit] = useMutation(updateVendorMutation);
|
const [commit] = useMutation(updateVendorMutation);
|
||||||
const [, loadQuery] = useQueryLoader<VendorOverviewPageQueryType>(
|
const [, loadQuery] = useQueryLoader<VendorOverviewPageQueryType>(
|
||||||
vendorOverviewPageQuery
|
vendorOverviewPageQuery,
|
||||||
);
|
);
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
|
|
||||||
@@ -259,7 +259,7 @@ function VendorOverviewPageContent({
|
|||||||
"rounded-full px-4 py-1 text-sm transition-colors",
|
"rounded-full px-4 py-1 text-sm transition-colors",
|
||||||
formData.serviceCriticality === "LOW"
|
formData.serviceCriticality === "LOW"
|
||||||
? "bg-green-100 text-green-900 ring-2 ring-green-600 ring-offset-2"
|
? "bg-green-100 text-green-900 ring-2 ring-green-600 ring-offset-2"
|
||||||
: "bg-gray-100 text-gray-900 hover:bg-gray-200"
|
: "bg-gray-100 text-gray-900 hover:bg-gray-200",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
Low
|
Low
|
||||||
@@ -272,7 +272,7 @@ function VendorOverviewPageContent({
|
|||||||
"rounded-full px-4 py-1 text-sm transition-colors",
|
"rounded-full px-4 py-1 text-sm transition-colors",
|
||||||
formData.serviceCriticality === "MEDIUM"
|
formData.serviceCriticality === "MEDIUM"
|
||||||
? "bg-yellow-100 text-yellow-900 ring-2 ring-yellow-600 ring-offset-2"
|
? "bg-yellow-100 text-yellow-900 ring-2 ring-yellow-600 ring-offset-2"
|
||||||
: "bg-gray-100 text-gray-900 hover:bg-gray-200"
|
: "bg-gray-100 text-gray-900 hover:bg-gray-200",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
Medium
|
Medium
|
||||||
@@ -285,7 +285,7 @@ function VendorOverviewPageContent({
|
|||||||
"rounded-full px-4 py-1 text-sm transition-colors",
|
"rounded-full px-4 py-1 text-sm transition-colors",
|
||||||
formData.serviceCriticality === "HIGH"
|
formData.serviceCriticality === "HIGH"
|
||||||
? "bg-red-100 text-red-900 ring-2 ring-red-600 ring-offset-2"
|
? "bg-red-100 text-red-900 ring-2 ring-red-600 ring-offset-2"
|
||||||
: "bg-gray-100 text-gray-900 hover:bg-gray-200"
|
: "bg-gray-100 text-gray-900 hover:bg-gray-200",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
High
|
High
|
||||||
@@ -313,7 +313,7 @@ function VendorOverviewPageContent({
|
|||||||
"rounded-full px-4 py-1 text-sm transition-colors",
|
"rounded-full px-4 py-1 text-sm transition-colors",
|
||||||
formData.riskTier === "CRITICAL"
|
formData.riskTier === "CRITICAL"
|
||||||
? "bg-red-100 text-red-900 ring-2 ring-red-600 ring-offset-2"
|
? "bg-red-100 text-red-900 ring-2 ring-red-600 ring-offset-2"
|
||||||
: "bg-gray-100 text-gray-900 hover:bg-gray-200"
|
: "bg-gray-100 text-gray-900 hover:bg-gray-200",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
Critical
|
Critical
|
||||||
@@ -326,7 +326,7 @@ function VendorOverviewPageContent({
|
|||||||
"rounded-full px-4 py-1 text-sm transition-colors",
|
"rounded-full px-4 py-1 text-sm transition-colors",
|
||||||
formData.riskTier === "SIGNIFICANT"
|
formData.riskTier === "SIGNIFICANT"
|
||||||
? "bg-yellow-100 text-yellow-900 ring-2 ring-yellow-600 ring-offset-2"
|
? "bg-yellow-100 text-yellow-900 ring-2 ring-yellow-600 ring-offset-2"
|
||||||
: "bg-gray-100 text-gray-900 hover:bg-gray-200"
|
: "bg-gray-100 text-gray-900 hover:bg-gray-200",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
Significant
|
Significant
|
||||||
@@ -337,7 +337,7 @@ function VendorOverviewPageContent({
|
|||||||
"rounded-full px-4 py-1 text-sm transition-colors",
|
"rounded-full px-4 py-1 text-sm transition-colors",
|
||||||
formData.riskTier === "GENERAL"
|
formData.riskTier === "GENERAL"
|
||||||
? "bg-green-100 text-green-900 ring-2 ring-green-600 ring-offset-2"
|
? "bg-green-100 text-green-900 ring-2 ring-green-600 ring-offset-2"
|
||||||
: "bg-gray-100 text-gray-900 hover:bg-gray-200"
|
: "bg-gray-100 text-gray-900 hover:bg-gray-200",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
General
|
General
|
||||||
@@ -418,7 +418,7 @@ function VendorOverviewPageFallback() {
|
|||||||
export default function VendorOverviewPage() {
|
export default function VendorOverviewPage() {
|
||||||
const { vendorId } = useParams();
|
const { vendorId } = useParams();
|
||||||
const [queryRef, loadQuery] = useQueryLoader<VendorOverviewPageQueryType>(
|
const [queryRef, loadQuery] = useQueryLoader<VendorOverviewPageQueryType>(
|
||||||
vendorOverviewPageQuery
|
vendorOverviewPageQuery,
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
2085
package-lock.json
generated
2085
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user