|
1 |
| -import type { PropsWithChildren } from 'react'; |
2 | 1 | import React, { useCallback, useEffect, useRef } from 'react';
|
| 2 | +import type { PropsWithChildren } from 'react'; |
3 | 3 |
|
4 | 4 | import { useIsMutating, useMutation, useQueryClient } from '@tanstack/react-query';
|
5 |
| -import type { AxiosRequestConfig } from 'axios'; |
6 | 5 | import dot from 'dot-object';
|
7 | 6 | import deepEqual from 'fast-deep-equal';
|
| 7 | +import type { AxiosRequestConfig } from 'axios'; |
8 | 8 |
|
9 | 9 | import { useAppMutations } from 'src/core/contexts/AppQueriesProvider';
|
10 | 10 | import { ContextNotProvided } from 'src/core/contexts/context';
|
11 | 11 | import { createZustandContext } from 'src/core/contexts/zustandContext';
|
12 | 12 | import { useApplicationMetadata } from 'src/features/applicationMetadata/ApplicationMetadataProvider';
|
13 | 13 | import { DataModels } from 'src/features/datamodel/DataModelsProvider';
|
14 |
| -import type { SchemaLookupTool } from 'src/features/datamodel/useDataModelSchemaQuery'; |
15 |
| -import type { IRuleConnections } from 'src/features/form/dynamics'; |
16 | 14 | import { useRuleConnections } from 'src/features/form/dynamics/DynamicsContext';
|
17 | 15 | import { usePageSettings } from 'src/features/form/layoutSettings/LayoutSettingsContext';
|
18 |
| -import type { FormDataWriteProxies } from 'src/features/formData/FormDataWriteProxies'; |
19 | 16 | import { useFormDataWriteProxies } from 'src/features/formData/FormDataWriteProxies';
|
20 |
| -import type { |
21 |
| - DataModelState, |
22 |
| - FDActionResult, |
23 |
| - FDSaveFinished, |
24 |
| - FormDataContext, |
25 |
| - UpdatedDataModel, |
26 |
| -} from 'src/features/formData/FormDataWriteStateMachine'; |
27 | 17 | import { createFormDataWriteStore } from 'src/features/formData/FormDataWriteStateMachine';
|
28 | 18 | import { createPatch } from 'src/features/formData/jsonPatch/createPatch';
|
29 |
| -import type { DebounceReason, IPatchListItem } from 'src/features/formData/types'; |
30 | 19 | import { ALTINN_ROW_ID } from 'src/features/formData/types';
|
31 | 20 | import { formDataQueries, useGetDataModelUrl } from 'src/features/formData/useFormDataQuery';
|
32 |
| -import type { ChangeInstanceData } from 'src/features/instance/InstanceContext'; |
33 | 21 | import { useLaxInstanceId, useOptimisticallyUpdateCachedInstance } from 'src/features/instance/InstanceContext';
|
34 | 22 | import { useCurrentLanguage } from 'src/features/language/LanguageProvider';
|
35 | 23 | import { useSelectedParty } from 'src/features/party/PartiesProvider';
|
36 | 24 | import { type BackendValidationIssueGroups, IgnoredValidators } from 'src/features/validation';
|
37 | 25 | import { useIsUpdatingInitialValidations } from 'src/features/validation/backendValidation/backendValidationQuery';
|
38 | 26 | import { useAsRef } from 'src/hooks/useAsRef';
|
39 | 27 | import { useWaitForState } from 'src/hooks/useWaitForState';
|
| 28 | +import { doPatchMultipleFormData } from 'src/queries/queries'; |
| 29 | +import { getMultiPatchUrl } from 'src/utils/urls/appUrlHelper'; |
| 30 | +import { getUrlWithLanguage } from 'src/utils/urls/urlHelper'; |
| 31 | +import type { SchemaLookupTool } from 'src/features/datamodel/useDataModelSchemaQuery'; |
| 32 | +import type { IRuleConnections } from 'src/features/form/dynamics'; |
| 33 | +import type { FormDataWriteProxies } from 'src/features/formData/FormDataWriteProxies'; |
| 34 | +import type { |
| 35 | + DataModelState, |
| 36 | + FDActionResult, |
| 37 | + FDSaveFinished, |
| 38 | + FormDataContext, |
| 39 | + UpdatedDataModel, |
| 40 | +} from 'src/features/formData/FormDataWriteStateMachine'; |
| 41 | +import type { DebounceReason, IPatchListItem } from 'src/features/formData/types'; |
| 42 | +import type { ChangeInstanceData } from 'src/features/instance/InstanceContext'; |
40 | 43 | import type { FormDataRowsSelector, FormDataSelector } from 'src/layout';
|
41 | 44 | import type { IDataModelReference, IMapping } from 'src/layout/common.generated';
|
42 | 45 | import type { IDataModelBindings } from 'src/layout/layout';
|
43 |
| -import { doPatchMultipleFormData } from 'src/queries/queries'; |
44 | 46 | import type { BaseRow } from 'src/utils/layout/types';
|
45 |
| -import { getMultiPatchUrl } from 'src/utils/urls/appUrlHelper'; |
46 |
| -import { getUrlWithLanguage } from 'src/utils/urls/urlHelper'; |
47 | 47 |
|
48 | 48 | export type FDLeafValue = string | number | boolean | null | undefined | string[];
|
49 | 49 | export type FDValue = FDLeafValue | object | FDValue[];
|
|
0 commit comments