Fix apps/trust lint issues
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -18,16 +18,16 @@ export function DocumentsPage({ queryRef }: Props) {
|
||||
const { __ } = useTranslate();
|
||||
const data = usePreloadedQuery<TrustGraphCurrentDocumentsQuery>(
|
||||
currentTrustDocumentsQuery,
|
||||
queryRef
|
||||
queryRef,
|
||||
);
|
||||
const documents =
|
||||
data.currentTrustCenter?.documents.edges.map((edge) => edge.node) ?? [];
|
||||
const files =
|
||||
data.currentTrustCenter?.trustCenterFiles.edges.map((edge) => edge.node) ?? [];
|
||||
const documentsPerType = groupBy(documents, (document) =>
|
||||
documentTypeLabel(document.documentType, __)
|
||||
const documents
|
||||
= data.currentTrustCenter?.documents.edges.map(edge => edge.node) ?? [];
|
||||
const files
|
||||
= data.currentTrustCenter?.trustCenterFiles.edges.map(edge => edge.node) ?? [];
|
||||
const documentsPerType = groupBy(documents, document =>
|
||||
documentTypeLabel(document.documentType, __),
|
||||
);
|
||||
const filesPerCategory = groupBy(files, (file) => file.category);
|
||||
const filesPerCategory = groupBy(files, file => file.category);
|
||||
return (
|
||||
<div>
|
||||
<h2 className="font-medium mb-1">{__("Documents")}</h2>
|
||||
@@ -38,7 +38,7 @@ export function DocumentsPage({ queryRef }: Props) {
|
||||
{objectEntries(documentsPerType).map(([label, documents]) => (
|
||||
<Fragment key={label}>
|
||||
<RowHeader>{label}</RowHeader>
|
||||
{documents.map((document) => (
|
||||
{documents.map(document => (
|
||||
<DocumentRow key={document.id} document={document} />
|
||||
))}
|
||||
</Fragment>
|
||||
@@ -46,7 +46,7 @@ export function DocumentsPage({ queryRef }: Props) {
|
||||
{objectEntries(filesPerCategory).map(([category, files]) => (
|
||||
<Fragment key={category}>
|
||||
<RowHeader>{category}</RowHeader>
|
||||
{files.map((file) => (
|
||||
{files.map(file => (
|
||||
<TrustCenterFileRow key={file.id} file={file} />
|
||||
))}
|
||||
</Fragment>
|
||||
|
||||
@@ -67,14 +67,14 @@ const overviewFragment = graphql`
|
||||
|
||||
export function OverviewPage() {
|
||||
const { trustCenter } = useOutletContext<{
|
||||
trustCenter: OverviewPageFragment$key &
|
||||
TrustGraphCurrentQuery$data["currentTrustCenter"];
|
||||
trustCenter: OverviewPageFragment$key
|
||||
& TrustGraphCurrentQuery$data["currentTrustCenter"];
|
||||
}>();
|
||||
const fragment = useFragment(overviewFragment, trustCenter);
|
||||
return (
|
||||
<div>
|
||||
<References
|
||||
references={fragment.references.edges.map((edge) => edge.node)}
|
||||
references={fragment.references.edges.map(edge => edge.node)}
|
||||
/>
|
||||
<Documents
|
||||
audits={trustCenter.audits.edges}
|
||||
@@ -106,12 +106,12 @@ function Documents({
|
||||
}) {
|
||||
const { __ } = useTranslate();
|
||||
const documentsPerType = groupBy(
|
||||
documents.map((edge) => edge.node),
|
||||
(node) => documentTypeLabel(node.documentType, __),
|
||||
documents.map(edge => edge.node),
|
||||
node => documentTypeLabel(node.documentType, __),
|
||||
);
|
||||
const filesPerCategory = groupBy(
|
||||
files.map((edge) => edge.node),
|
||||
(node) => node.category,
|
||||
files.map(edge => edge.node),
|
||||
node => node.category,
|
||||
);
|
||||
const hasAudits = audits.length > 0;
|
||||
const hasDocuments = hasAudits || documents.length > 0 || files.length > 0;
|
||||
@@ -130,7 +130,7 @@ function Documents({
|
||||
{audits.length > 0 && (
|
||||
<>
|
||||
<RowHeader>{__("Compliance")}</RowHeader>
|
||||
{audits.map((audit) => (
|
||||
{audits.map(audit => (
|
||||
<AuditRow key={audit.node.id} audit={audit.node} />
|
||||
))}
|
||||
</>
|
||||
@@ -138,7 +138,7 @@ function Documents({
|
||||
{objectEntries(documentsPerType).map(([label, documents]) => (
|
||||
<Fragment key={label}>
|
||||
<RowHeader>{label}</RowHeader>
|
||||
{documents.map((document) => (
|
||||
{documents.map(document => (
|
||||
<DocumentRow key={document.id} document={document} />
|
||||
))}
|
||||
</Fragment>
|
||||
@@ -146,7 +146,7 @@ function Documents({
|
||||
{objectEntries(filesPerCategory).map(([category, files]) => (
|
||||
<Fragment key={category}>
|
||||
<RowHeader>{category}</RowHeader>
|
||||
{files.map((file) => (
|
||||
{files.map(file => (
|
||||
<TrustCenterFileRow key={file.id} file={file} />
|
||||
))}
|
||||
</Fragment>
|
||||
@@ -189,7 +189,7 @@ function Subprocessors({
|
||||
)}
|
||||
</p>
|
||||
<Rows className="mb-8 *:py-5">
|
||||
{vendors.map((vendor) => (
|
||||
{vendors.map(vendor => (
|
||||
<VendorRow
|
||||
key={vendor.node.id}
|
||||
vendor={vendor.node}
|
||||
@@ -223,7 +223,7 @@ function References({ references }: { references: Reference[] }) {
|
||||
<div className="mb-8">
|
||||
<h2 className="font-medium mb-4">{__("Trusted by")}</h2>
|
||||
<Card className="grid grid-cols-2 flex-wrap p-6 gap-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-7">
|
||||
{references.map((reference) => (
|
||||
{references.map(reference => (
|
||||
<a
|
||||
key={reference.id}
|
||||
href={reference.websiteUrl}
|
||||
|
||||
@@ -13,8 +13,8 @@ type Props = {
|
||||
export function SubprocessorsPage({ queryRef }: Props) {
|
||||
const { __ } = useTranslate();
|
||||
const data = usePreloadedQuery(currentTrustVendorsQuery, queryRef);
|
||||
const vendors =
|
||||
data.currentTrustCenter?.vendors.edges.map((edge) => edge.node) ?? [];
|
||||
const vendors
|
||||
= data.currentTrustCenter?.vendors.edges.map(edge => edge.node) ?? [];
|
||||
|
||||
const hasAnyCountries = vendors.some(vendor => vendor.countries.length > 0);
|
||||
|
||||
@@ -24,11 +24,11 @@ export function SubprocessorsPage({ queryRef }: Props) {
|
||||
<p className="text-sm text-txt-secondary mb-4">
|
||||
{sprintf(
|
||||
__("Third-party subprocessors %s work with:"),
|
||||
data.currentTrustCenter?.organization.name ?? ""
|
||||
data.currentTrustCenter?.organization.name ?? "",
|
||||
)}
|
||||
</p>
|
||||
<Rows>
|
||||
{vendors.map((vendor) => (
|
||||
{vendors.map(vendor => (
|
||||
<VendorRow key={vendor.id} vendor={vendor} hasAnyCountries={hasAnyCountries} />
|
||||
))}
|
||||
</Rows>
|
||||
|
||||
@@ -59,12 +59,11 @@ export function ConnectPage(props: {
|
||||
if (!magicLinkSent && interval.current) {
|
||||
clearInterval(interval.current);
|
||||
interval.current = undefined;
|
||||
setTimer(timerDurationSeconds);
|
||||
}
|
||||
if (magicLinkSent) {
|
||||
clearInterval(interval.current);
|
||||
interval.current = setInterval(() => {
|
||||
setTimer((timer) => Math.max(timer - 1, 0));
|
||||
setTimer(timer => Math.max(timer - 1, 0));
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
@@ -138,7 +137,7 @@ export function ConnectPage(props: {
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form onSubmit={handleSubmit} className="space-y-4">
|
||||
<form onSubmit={e => void handleSubmit(e)} className="space-y-4">
|
||||
<Field
|
||||
label={__("Email")}
|
||||
placeholder="john.doe@acme.com"
|
||||
|
||||
@@ -5,8 +5,8 @@ import { RelayProvider } from "/providers/RelayProviders";
|
||||
import type { ConnectPageQuery } from "./__generated__/ConnectPageQuery.graphql";
|
||||
|
||||
function ConnectPageLoader() {
|
||||
const [queryRef, loadQuery] =
|
||||
useQueryLoader<ConnectPageQuery>(connectPageQuery);
|
||||
const [queryRef, loadQuery]
|
||||
= useQueryLoader<ConnectPageQuery>(connectPageQuery);
|
||||
|
||||
useEffect(() => {
|
||||
if (!queryRef) {
|
||||
|
||||
@@ -42,7 +42,7 @@ export default function VerifyMagicLinkPagePageMutation() {
|
||||
verifyMagicLinkMutation,
|
||||
);
|
||||
|
||||
const handleSubmit = form.handleSubmit(async (data) => {
|
||||
const handleSubmit = form.handleSubmit((data) => {
|
||||
verifyMagicLink({
|
||||
variables: {
|
||||
input: {
|
||||
@@ -79,7 +79,7 @@ export default function VerifyMagicLinkPagePageMutation() {
|
||||
|
||||
useEffect(() => {
|
||||
if (!submittedRef.current && searchParams.get("token")) {
|
||||
handleSubmit();
|
||||
void handleSubmit();
|
||||
submittedRef.current = true;
|
||||
}
|
||||
});
|
||||
@@ -94,7 +94,7 @@ export default function VerifyMagicLinkPagePageMutation() {
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form onSubmit={handleSubmit} className="space-y-4">
|
||||
<form onSubmit={e => void handleSubmit(e)} className="space-y-4">
|
||||
<Field
|
||||
label={__("Confirmation Token")}
|
||||
type="text"
|
||||
|
||||
Reference in New Issue
Block a user