@@ -4,7 +4,6 @@ import js from "@eslint/js";
|
|||||||
import { defineConfig } from "eslint/config";
|
import { defineConfig } from "eslint/config";
|
||||||
import globals from "globals";
|
import globals from "globals";
|
||||||
import reactHooks from "eslint-plugin-react-hooks";
|
import reactHooks from "eslint-plugin-react-hooks";
|
||||||
import reactRefresh from "eslint-plugin-react-refresh";
|
|
||||||
import tseslint from "typescript-eslint";
|
import tseslint from "typescript-eslint";
|
||||||
|
|
||||||
export default defineConfig([
|
export default defineConfig([
|
||||||
@@ -21,14 +20,9 @@ export default defineConfig([
|
|||||||
},
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
"react-hooks": reactHooks,
|
"react-hooks": reactHooks,
|
||||||
"react-refresh": reactRefresh,
|
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
...reactHooks.configs.recommended.rules,
|
...reactHooks.configs.recommended.rules,
|
||||||
"react-refresh/only-export-components": [
|
|
||||||
"warn",
|
|
||||||
{ allowConstantExport: true },
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -45,7 +45,6 @@
|
|||||||
"babel-plugin-relay": "^19.0.0",
|
"babel-plugin-relay": "^19.0.0",
|
||||||
"eslint": "^9.25.0",
|
"eslint": "^9.25.0",
|
||||||
"eslint-plugin-react-hooks": "^5.2.0",
|
"eslint-plugin-react-hooks": "^5.2.0",
|
||||||
"eslint-plugin-react-refresh": "^0.4.19",
|
|
||||||
"globals": "^16.0.0",
|
"globals": "^16.0.0",
|
||||||
"graphql": "^16.11.0",
|
"graphql": "^16.11.0",
|
||||||
"prettier": "^3.5.3",
|
"prettier": "^3.5.3",
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ function LinkedAuditsDialogContent(props: Omit<Props, "children">) {
|
|||||||
);
|
);
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
const audits = data.audits?.edges?.map((edge) => edge.node) ?? [];
|
const audits = useMemo(() => data.audits?.edges?.map((edge) => edge.node) ?? [], [data.audits]);
|
||||||
const linkedIds = useMemo(() => {
|
const linkedIds = useMemo(() => {
|
||||||
return new Set(props.linkedAudits?.map((a) => a.id) ?? []);
|
return new Set(props.linkedAudits?.map((a) => a.id) ?? []);
|
||||||
}, [props.linkedAudits]);
|
}, [props.linkedAudits]);
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ function LinkedDocumentsDialogContent(props: Omit<Props, "children">) {
|
|||||||
);
|
);
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
const documents = data.documents?.edges?.map((edge) => edge.node) ?? [];
|
const documents = useMemo(() => data.documents?.edges?.map((edge) => edge.node) ?? [], [data.documents]);
|
||||||
const linkedIds = useMemo(() => {
|
const linkedIds = useMemo(() => {
|
||||||
return new Set(props.linkedDocuments?.map((m) => m.id) ?? []);
|
return new Set(props.linkedDocuments?.map((m) => m.id) ?? []);
|
||||||
}, [props.linkedDocuments]);
|
}, [props.linkedDocuments]);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ function LinkedMeasuresDialogContent(props: Omit<Props, "children">) {
|
|||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
const [category, setCategory] = useState<string | null>(null);
|
const [category, setCategory] = useState<string | null>(null);
|
||||||
const measures = data.measures?.edges?.map((edge) => edge.node) ?? [];
|
const measures = useMemo(() => data.measures?.edges?.map((edge) => edge.node) ?? [], [data.measures]);
|
||||||
const linkedIds = useMemo(() => {
|
const linkedIds = useMemo(() => {
|
||||||
return new Set(props.linkedMeasures?.map((m) => m.id) ?? []);
|
return new Set(props.linkedMeasures?.map((m) => m.id) ?? []);
|
||||||
}, [props.linkedMeasures]);
|
}, [props.linkedMeasures]);
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ function LinkedObligationsDialogContent(props: Omit<Props, "children">) {
|
|||||||
);
|
);
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
const obligations = data.obligations?.edges?.map((edge) => edge.node) ?? [];
|
const obligations = useMemo(() => data.obligations?.edges?.map((edge) => edge.node) ?? [], [data.obligations]);
|
||||||
const linkedIds = useMemo(() => {
|
const linkedIds = useMemo(() => {
|
||||||
return new Set(props.linkedObligations?.map((o) => o.id) ?? []);
|
return new Set(props.linkedObligations?.map((o) => o.id) ?? []);
|
||||||
}, [props.linkedObligations]);
|
}, [props.linkedObligations]);
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ function LinkedRisksDialogContent(props: Omit<Props, "children">) {
|
|||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
const [category, setCategory] = useState<string | null>(null);
|
const [category, setCategory] = useState<string | null>(null);
|
||||||
const risks = data.organization?.risks?.edges?.map((edge) => edge.node) ?? [];
|
const risks = useMemo(() => data.organization?.risks?.edges?.map((edge) => edge.node) ?? [], [data.organization?.risks]);
|
||||||
const linkedIds = useMemo(() => {
|
const linkedIds = useMemo(() => {
|
||||||
return new Set(props.linkedRisks?.map((r) => r.id) ?? []);
|
return new Set(props.linkedRisks?.map((r) => r.id) ?? []);
|
||||||
}, [props.linkedRisks]);
|
}, [props.linkedRisks]);
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ function LinkedSnapshotsDialogContent(props: Omit<Props, "children">) {
|
|||||||
|
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
const snapshots = data.snapshots?.edges?.map((edge) => edge.node) ?? [];
|
const snapshots = useMemo(() => data.snapshots?.edges?.map((edge) => edge.node) ?? [], [data.snapshots]);
|
||||||
const linkedIds = useMemo(() => {
|
const linkedIds = useMemo(() => {
|
||||||
return new Set(props.linkedSnapshots?.map((s) => s.id) ?? []);
|
return new Set(props.linkedSnapshots?.map((s) => s.id) ?? []);
|
||||||
}, [props.linkedSnapshots]);
|
}, [props.linkedSnapshots]);
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ export const useDeleteFrameworkMutation = (
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
[framework, connectionId, commitDelete]
|
[framework, connectionId, commitDelete, confirm, __]
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export function useMutationWithToasts<T extends MutationParameters>(
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
[mutate, toast, __]
|
[mutate, toast, __, baseOptions]
|
||||||
);
|
);
|
||||||
|
|
||||||
return [mutateWithToast, isLoading] as const;
|
return [mutateWithToast, isLoading] as const;
|
||||||
|
|||||||
@@ -120,10 +120,11 @@ function SignatureList(props: {
|
|||||||
version: Version;
|
version: Version;
|
||||||
selectedStates: SignatureState[];
|
selectedStates: SignatureState[];
|
||||||
}) {
|
}) {
|
||||||
|
const { version: propVersion, selectedStates } = props;
|
||||||
const [version, refetch] = useRefetchableFragment<
|
const [version, refetch] = useRefetchableFragment<
|
||||||
DocumentSignaturesTabRefetchQuery,
|
DocumentSignaturesTabRefetchQuery,
|
||||||
DocumentSignaturesTab_version$key
|
DocumentSignaturesTab_version$key
|
||||||
>(versionFragment, props.version);
|
>(versionFragment, propVersion);
|
||||||
const signatures = version.signatures?.edges?.map((edge) => edge.node) ?? [];
|
const signatures = version.signatures?.edges?.map((edge) => edge.node) ?? [];
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const signatureMap = new Map(signatures.map((s) => [s.signedBy.id, s]));
|
const signatureMap = new Map(signatures.map((s) => [s.signedBy.id, s]));
|
||||||
@@ -140,10 +141,10 @@ function SignatureList(props: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const filter =
|
const filter =
|
||||||
props.selectedStates.length > 0 ? { states: props.selectedStates } : null;
|
selectedStates.length > 0 ? { states: selectedStates } : null;
|
||||||
|
|
||||||
refetch({ signatureFilter: filter });
|
refetch({ signatureFilter: filter });
|
||||||
}, [JSON.stringify(props.selectedStates), refetch]);
|
}, [selectedStates, refetch]);
|
||||||
|
|
||||||
if (!version.signatures) {
|
if (!version.signatures) {
|
||||||
return (
|
return (
|
||||||
@@ -163,11 +164,11 @@ function SignatureList(props: {
|
|||||||
|
|
||||||
// When a filter is active, only show people who have signatures in the filtered results
|
// When a filter is active, only show people who have signatures in the filtered results
|
||||||
const filteredPeople =
|
const filteredPeople =
|
||||||
props.selectedStates.length > 0
|
selectedStates.length > 0
|
||||||
? people.filter((p) => signatureMap.has(p.id))
|
? people.filter((p) => signatureMap.has(p.id))
|
||||||
: people;
|
: people;
|
||||||
|
|
||||||
if (filteredPeople.length === 0 && props.selectedStates.length > 0) {
|
if (filteredPeople.length === 0 && selectedStates.length > 0) {
|
||||||
return (
|
return (
|
||||||
<div className="text-center text-sm text-txt-tertiary py-3">
|
<div className="text-center text-sm text-txt-tertiary py-3">
|
||||||
{__("No signatures match the selected filters")}
|
{__("No signatures match the selected filters")}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ function DownloadLink({ evidenceId, onClose }: Props) {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
downloadFile(evidence.file?.downloadUrl, evidence.file?.fileName ?? "evidence");
|
downloadFile(evidence.file?.downloadUrl, evidence.file?.fileName ?? "evidence");
|
||||||
onClose();
|
onClose();
|
||||||
}, [evidence]);
|
}, [evidence.file?.downloadUrl, evidence.file?.fileName, onClose]);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ function EvidencePreviewContent({
|
|||||||
return () => {
|
return () => {
|
||||||
abortController.abort();
|
abortController.abort();
|
||||||
};
|
};
|
||||||
}, [evidence.file?.downloadUrl, isUriFile]);
|
}, [evidence.file?.downloadUrl, isUriFile, onClose, __, toast]);
|
||||||
|
|
||||||
if (!evidence.file?.downloadUrl) {
|
if (!evidence.file?.downloadUrl) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export function EditContactDialog({ contactId, contact, onClose }: Props) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dialogRef.current?.open();
|
dialogRef.current?.open();
|
||||||
}, []);
|
}, [dialogRef]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog
|
<Dialog
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export function EditServiceDialog({ serviceId, service, onClose }: Props) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dialogRef.current?.open();
|
dialogRef.current?.open();
|
||||||
}, []);
|
}, [dialogRef]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog
|
<Dialog
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ export default function VendorOverviewTab() {
|
|||||||
{ name: "securityPageUrl", label: __("Security page URL") },
|
{ name: "securityPageUrl", label: __("Security page URL") },
|
||||||
{ name: "trustPageUrl", label: __("Trust page URL") },
|
{ name: "trustPageUrl", label: __("Trust page URL") },
|
||||||
] as const,
|
] as const,
|
||||||
[],
|
[__],
|
||||||
);
|
);
|
||||||
|
|
||||||
usePageTitle(vendor.name + " - " + __("Overview"));
|
usePageTitle(vendor.name + " - " + __("Overview"));
|
||||||
|
|||||||
1
package-lock.json
generated
1
package-lock.json
generated
@@ -54,7 +54,6 @@
|
|||||||
"babel-plugin-relay": "^19.0.0",
|
"babel-plugin-relay": "^19.0.0",
|
||||||
"eslint": "^9.25.0",
|
"eslint": "^9.25.0",
|
||||||
"eslint-plugin-react-hooks": "^5.2.0",
|
"eslint-plugin-react-hooks": "^5.2.0",
|
||||||
"eslint-plugin-react-refresh": "^0.4.19",
|
|
||||||
"globals": "^16.0.0",
|
"globals": "^16.0.0",
|
||||||
"graphql": "^16.11.0",
|
"graphql": "^16.11.0",
|
||||||
"prettier": "^3.5.3",
|
"prettier": "^3.5.3",
|
||||||
|
|||||||
@@ -1,28 +1,31 @@
|
|||||||
import js from '@eslint/js'
|
import js from "@eslint/js";
|
||||||
import globals from 'globals'
|
import globals from "globals";
|
||||||
import reactHooks from 'eslint-plugin-react-hooks'
|
import reactHooks from "eslint-plugin-react-hooks";
|
||||||
import reactRefresh from 'eslint-plugin-react-refresh'
|
import reactRefresh from "eslint-plugin-react-refresh";
|
||||||
import tseslint from 'typescript-eslint'
|
import tseslint from "typescript-eslint";
|
||||||
|
|
||||||
export default tseslint.config(
|
export default tseslint.config(
|
||||||
{ ignores: ['dist'] },
|
{ ignores: ["dist"] },
|
||||||
{
|
{
|
||||||
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
||||||
files: ['**/*.{ts,tsx}'],
|
files: ["**/*.{ts,tsx}"],
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
ecmaVersion: 2020,
|
ecmaVersion: 2020,
|
||||||
globals: globals.browser,
|
globals: globals.browser,
|
||||||
|
parserOptions: {
|
||||||
|
tsconfigRootDir: import.meta.dirname,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
"react-hooks": reactHooks,
|
||||||
|
"react-refresh": reactRefresh,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
...reactHooks.configs.recommended.rules,
|
||||||
|
"react-refresh/only-export-components": [
|
||||||
|
"warn",
|
||||||
|
{ allowConstantExport: true },
|
||||||
|
],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
plugins: {
|
);
|
||||||
'react-hooks': reactHooks,
|
|
||||||
'react-refresh': reactRefresh,
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
...reactHooks.configs.recommended.rules,
|
|
||||||
'react-refresh/only-export-components': [
|
|
||||||
'warn',
|
|
||||||
{ allowConstantExport: true },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { input } from "../Input/Input";
|
|||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
|
|
||||||
type Props = TextareaHTMLAttributes<HTMLTextAreaElement> & {
|
type Props = TextareaHTMLAttributes<HTMLTextAreaElement> & {
|
||||||
|
variant?: "bordered" | "ghost" | "title";
|
||||||
autogrow?: boolean;
|
autogrow?: boolean;
|
||||||
ref?: RefCallback<HTMLTextAreaElement>;
|
ref?: RefCallback<HTMLTextAreaElement>;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user