Add import order sorting rules
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { z } from "zod";
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useFragment } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
import { z } from "zod";
|
||||
|
||||
import type {
|
||||
useRiskFormFragment$data,
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { z } from "zod";
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useFragment } from "react-relay";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { useEffect, useMemo } from "react";
|
||||
import { useFragment } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
import { z } from "zod";
|
||||
|
||||
import type { useVendorFormFragment$key } from "/__generated__/core/useVendorFormFragment.graphql";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
import { useFormWithSchema } from "../useFormWithSchema";
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
const schema = z.object({
|
||||
name: z.string().min(1, "Name is required"),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useMutation } from "react-relay";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { promisifyMutation, sprintf } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useMutation } from "react-relay";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { promisifyMutation, sprintf } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useMutation } from "react-relay";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { promisifyMutation, sprintf } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useMutation } from "react-relay";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { promisifyMutation, sprintf } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
export const dataQuery = graphql`
|
||||
query DatumGraphListQuery($organizationId: ID!, $snapshotId: ID = null) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { DocumentGraphBulkExportDocumentsMutation } from "/__generated__/core/DocumentGraphBulkExportDocumentsMutation.graphql";
|
||||
import type { DocumentGraphDeleteDraftMutation } from "/__generated__/core/DocumentGraphDeleteDraftMutation.graphql";
|
||||
import type { DocumentGraphDeleteMutation } from "/__generated__/core/DocumentGraphDeleteMutation.graphql";
|
||||
import type { DocumentGraphSendSigningNotificationsMutation } from "/__generated__/core/DocumentGraphSendSigningNotificationsMutation.graphql";
|
||||
import type { DocumentGraphDeleteDraftMutation } from "/__generated__/core/DocumentGraphDeleteDraftMutation.graphql";
|
||||
import type { DocumentGraphBulkExportDocumentsMutation } from "/__generated__/core/DocumentGraphBulkExportDocumentsMutation.graphql";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useCallback } from "react";
|
||||
import { sprintf } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useCallback } from "react";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useMutation } from "react-relay";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { promisifyMutation, sprintf } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useMutation } from "react-relay";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { promisifyMutation } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
import {
|
||||
formatError,
|
||||
type GraphQLError,
|
||||
promisifyMutation,
|
||||
sprintf,
|
||||
} from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { useConfirm, useToast } from "@probo/ui";
|
||||
import { useMemo } from "react";
|
||||
import {
|
||||
type PreloadedQuery,
|
||||
useLazyLoadQuery,
|
||||
useMutation,
|
||||
usePaginationFragment,
|
||||
usePreloadedQuery,
|
||||
type PreloadedQuery,
|
||||
} from "react-relay";
|
||||
import { useMemo } from "react";
|
||||
import { useConfirm, useToast } from "@probo/ui";
|
||||
import {
|
||||
promisifyMutation,
|
||||
sprintf,
|
||||
formatError,
|
||||
type GraphQLError,
|
||||
} from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { PeopleGraphPaginatedQuery } from "/__generated__/core/PeopleGraphPaginatedQuery.graphql";
|
||||
import type { PeopleGraphPaginatedFragment$key } from "/__generated__/core/PeopleGraphPaginatedFragment.graphql";
|
||||
import type { PeopleGraphDeleteMutation } from "/__generated__/core/PeopleGraphDeleteMutation.graphql";
|
||||
import type { PeopleGraphPaginatedFragment$key } from "/__generated__/core/PeopleGraphPaginatedFragment.graphql";
|
||||
import type { PeopleGraphPaginatedQuery } from "/__generated__/core/PeopleGraphPaginatedQuery.graphql";
|
||||
import type { PeopleGraphQuery } from "/__generated__/core/PeopleGraphQuery.graphql";
|
||||
|
||||
export const peopleQuery = graphql`
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useMutation } from "react-relay";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { promisifyMutation, sprintf } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useMutation } from "react-relay";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { promisifyMutation, sprintf } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import {
|
||||
usePreloadedQuery,
|
||||
usePaginationFragment,
|
||||
type PreloadedQuery,
|
||||
usePaginationFragment,
|
||||
usePreloadedQuery,
|
||||
} from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { RiskGraphDeleteMutation } from "/__generated__/core/RiskGraphDeleteMutation.graphql.ts";
|
||||
import type { RiskGraphListQuery } from "/__generated__/core/RiskGraphListQuery.graphql.ts";
|
||||
import type { RiskGraphFragment$key } from "/__generated__/core/RiskGraphFragment.graphql.ts";
|
||||
import type { RiskGraphListQuery } from "/__generated__/core/RiskGraphListQuery.graphql.ts";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts.ts";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useMutation } from "react-relay";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { promisifyMutation, sprintf } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
import {
|
||||
formatError,
|
||||
type GraphQLError,
|
||||
promisifyMutation,
|
||||
sprintf,
|
||||
} from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { useConfirm, useToast } from "@probo/ui";
|
||||
import {
|
||||
type PreloadedQuery,
|
||||
useMutation,
|
||||
usePaginationFragment,
|
||||
usePreloadedQuery,
|
||||
type PreloadedQuery,
|
||||
} from "react-relay";
|
||||
import { useConfirm, useToast } from "@probo/ui";
|
||||
import {
|
||||
promisifyMutation,
|
||||
sprintf,
|
||||
formatError,
|
||||
type GraphQLError,
|
||||
} from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { StateOfApplicabilityGraphDeleteMutation } from "/__generated__/core/StateOfApplicabilityGraphDeleteMutation.graphql";
|
||||
import type { StateOfApplicabilityGraphPaginatedFragment$key } from "/__generated__/core/StateOfApplicabilityGraphPaginatedFragment.graphql";
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { graphql, useLazyLoadQuery, usePaginationFragment } from "react-relay";
|
||||
|
||||
import type { TrustCenterAccessGraphQuery } from "/__generated__/core/TrustCenterAccessGraphQuery.graphql";
|
||||
import type {
|
||||
TrustCenterAccessGraph_accesses$data,
|
||||
TrustCenterAccessGraph_accesses$key,
|
||||
} from "/__generated__/core/TrustCenterAccessGraph_accesses.graphql";
|
||||
import type { TrustCenterAccessGraphQuery } from "/__generated__/core/TrustCenterAccessGraphQuery.graphql";
|
||||
|
||||
export const trustCenterAccessesPaginationFragment = graphql`
|
||||
fragment TrustCenterAccessGraph_accesses on TrustCenter
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
|
||||
import type { TrustCenterAuditGraphUpdateMutation } from "/__generated__/core/TrustCenterAuditGraphUpdateMutation.graphql";
|
||||
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
|
||||
|
||||
export const trustCenterAuditUpdateMutation = graphql`
|
||||
mutation TrustCenterAuditGraphUpdateMutation($input: UpdateAuditInput!) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
|
||||
import type { TrustCenterDocumentGraphUpdateMutation } from "/__generated__/core/TrustCenterDocumentGraphUpdateMutation.graphql";
|
||||
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
|
||||
|
||||
export const trustCenterDocumentsQuery = graphql`
|
||||
query TrustCenterDocumentGraphQuery($organizationId: ID!) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
|
||||
import type { TrustCenterGraphUpdateMutation } from "/__generated__/core/TrustCenterGraphUpdateMutation.graphql";
|
||||
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
|
||||
|
||||
export const trustCenterQuery = graphql`
|
||||
query TrustCenterGraphQuery($organizationId: ID!) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { graphql } from "react-relay";
|
||||
|
||||
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
|
||||
import type { TrustCenterReferenceGraphCreateMutation } from "/__generated__/core/TrustCenterReferenceGraphCreateMutation.graphql";
|
||||
import type { TrustCenterReferenceGraphDeleteMutation } from "/__generated__/core/TrustCenterReferenceGraphDeleteMutation.graphql";
|
||||
import type { TrustCenterReferenceGraphUpdateMutation } from "/__generated__/core/TrustCenterReferenceGraphUpdateMutation.graphql";
|
||||
import type { TrustCenterReferenceGraphUpdateRankMutation } from "/__generated__/core/TrustCenterReferenceGraphUpdateRankMutation.graphql";
|
||||
import type { TrustCenterReferenceGraphDeleteMutation } from "/__generated__/core/TrustCenterReferenceGraphDeleteMutation.graphql";
|
||||
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
|
||||
|
||||
export const trustCenterReferencesQuery = graphql`
|
||||
query TrustCenterReferenceGraphQuery($trustCenterId: ID!) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
|
||||
import type { TrustCenterVendorGraphUpdateMutation } from "/__generated__/core/TrustCenterVendorGraphUpdateMutation.graphql";
|
||||
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
|
||||
|
||||
export const trustCenterVendorUpdateMutation = graphql`
|
||||
mutation TrustCenterVendorGraphUpdateMutation($input: UpdateVendorInput!) {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { graphql } from "relay-runtime";
|
||||
import { useMutation, useLazyLoadQuery } from "react-relay";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { promisifyMutation, sprintf } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useMemo } from "react";
|
||||
import { useLazyLoadQuery, useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { VendorGraphSelectQuery } from "/__generated__/core/VendorGraphSelectQuery.graphql.ts";
|
||||
import type { VendorGraphDeleteMutation } from "/__generated__/core/VendorGraphDeleteMutation.graphql.ts";
|
||||
import type { VendorGraphCreateMutation } from "/__generated__/core/VendorGraphCreateMutation.graphql.ts";
|
||||
import type { VendorGraphDeleteMutation } from "/__generated__/core/VendorGraphDeleteMutation.graphql.ts";
|
||||
import type { VendorGraphSelectQuery } from "/__generated__/core/VendorGraphSelectQuery.graphql.ts";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts.ts";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { graphql, useLazyLoadQuery, usePaginationFragment } from "react-relay";
|
||||
|
||||
import type { usePaginatedMeasuresQuery } from "/__generated__/core/usePaginatedMeasuresQuery.graphql";
|
||||
import type { usePaginatedMeasuresFragment$key } from "/__generated__/core/usePaginatedMeasuresFragment.graphql";
|
||||
import type { usePaginatedMeasuresQuery } from "/__generated__/core/usePaginatedMeasuresQuery.graphql";
|
||||
|
||||
const measuresQuery = graphql`
|
||||
query usePaginatedMeasuresQuery($organizationId: ID!) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useForm } from "react-hook-form";
|
||||
import type { z, ZodTypeAny } from "zod";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
|
||||
export function useFormWithSchema<T extends ZodTypeAny>(
|
||||
schema: T,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GraphQLTaggedNode } from "relay-runtime";
|
||||
import { useMutation } from "react-relay";
|
||||
import type { GraphQLTaggedNode } from "relay-runtime";
|
||||
|
||||
export type MutationFieldUpdate<T extends Record<string, unknown>, TKey extends keyof T> = (
|
||||
field: TKey,
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import { formatError, type GraphQLError } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { useToast } from "@probo/ui";
|
||||
import { useCallback } from "react";
|
||||
import {
|
||||
useMutation,
|
||||
@@ -10,9 +13,6 @@ import {
|
||||
type GraphQLTaggedNode,
|
||||
type MutationParameters,
|
||||
} from "relay-runtime";
|
||||
import { useToast } from "@probo/ui";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { formatError, type GraphQLError } from "@probo/helpers";
|
||||
|
||||
const defaultOptions = {
|
||||
field: "totalCount",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { formatError, type GraphQLError } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { useToast } from "@probo/ui";
|
||||
import { useCallback } from "react";
|
||||
import { useMutation, type UseMutationConfig } from "react-relay";
|
||||
import { useToast } from "@probo/ui";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import type { MutationParameters, GraphQLTaggedNode } from "relay-runtime";
|
||||
import { formatError, type GraphQLError } from "@probo/helpers";
|
||||
import type { GraphQLTaggedNode, MutationParameters } from "relay-runtime";
|
||||
|
||||
/**
|
||||
* A decorated useMutation hook that emits toast notifications on success or error.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { z, ZodError, type ZodTypeAny } from "zod";
|
||||
import { useCallback, useMemo, useState } from "react";
|
||||
import { z, ZodError, type ZodTypeAny } from "zod";
|
||||
|
||||
export function useStateWithSchema<T extends ZodTypeAny>(
|
||||
schema: T,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import MiniSearch from "minisearch";
|
||||
import type { Vendor } from "@probo/vendors";
|
||||
import MiniSearch from "minisearch";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
|
||||
export function useVendorSearch() {
|
||||
const searchRef = useRef<(s: string) => Vendor[]>(() => []);
|
||||
|
||||
Reference in New Issue
Block a user