@trackunit/custom-field-api 1.7.142 → 1.7.146
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js
CHANGED
|
@@ -2524,7 +2524,9 @@ const customFieldHasValue = (field) => {
|
|
|
2524
2524
|
* Execute custom fields update from form data
|
|
2525
2525
|
*/
|
|
2526
2526
|
const useUpdateCustomFieldValues = (entityId, entityType, customFields, systemOfMeasurement = irisAppRuntimeCoreApi.SystemOfMeasurement.Si) => {
|
|
2527
|
-
const [setCustomFieldValues, { data: saveResult, loading: savingCustomFields }] = client.useMutation(UpdateCustomFieldValuesDocument, {
|
|
2527
|
+
const [setCustomFieldValues, { data: saveResult, loading: savingCustomFields }] = client.useMutation(UpdateCustomFieldValuesDocument, {
|
|
2528
|
+
refetchQueries: ["GetCustomFieldsForAsset"],
|
|
2529
|
+
});
|
|
2528
2530
|
const customFieldsMap = react.useMemo(() => customFields.reduce((acc, current) => ({ ...acc, [current.definition.id]: current }), {}), [customFields]);
|
|
2529
2531
|
const updateCustomFields = react.useCallback(async (data) => {
|
|
2530
2532
|
// Transform data to custom field updates
|
package/index.esm.js
CHANGED
|
@@ -2522,7 +2522,9 @@ const customFieldHasValue = (field) => {
|
|
|
2522
2522
|
* Execute custom fields update from form data
|
|
2523
2523
|
*/
|
|
2524
2524
|
const useUpdateCustomFieldValues = (entityId, entityType, customFields, systemOfMeasurement = SystemOfMeasurement.Si) => {
|
|
2525
|
-
const [setCustomFieldValues, { data: saveResult, loading: savingCustomFields }] = useMutation(UpdateCustomFieldValuesDocument, {
|
|
2525
|
+
const [setCustomFieldValues, { data: saveResult, loading: savingCustomFields }] = useMutation(UpdateCustomFieldValuesDocument, {
|
|
2526
|
+
refetchQueries: ["GetCustomFieldsForAsset"],
|
|
2527
|
+
});
|
|
2526
2528
|
const customFieldsMap = useMemo(() => customFields.reduce((acc, current) => ({ ...acc, [current.definition.id]: current }), {}), [customFields]);
|
|
2527
2529
|
const updateCustomFields = useCallback(async (data) => {
|
|
2528
2530
|
// Transform data to custom field updates
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/custom-field-api",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.146",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=24.x"
|
|
6
6
|
},
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
"graphql": "^16.10.0",
|
|
13
13
|
"@apollo/client": "3.13.8",
|
|
14
14
|
"react": "19.0.0",
|
|
15
|
-
"@trackunit/iris-app-build-utilities": "1.7.
|
|
16
|
-
"@trackunit/iris-app-api": "1.10.
|
|
17
|
-
"@trackunit/react-core-contexts-test": "1.7.
|
|
18
|
-
"@trackunit/shared-utils": "1.9.
|
|
19
|
-
"@trackunit/react-core-hooks": "1.7.
|
|
20
|
-
"@trackunit/iris-app-runtime-core": "1.8.
|
|
21
|
-
"@trackunit/iris-app-runtime-core-api": "1.7.
|
|
22
|
-
"@trackunit/react-graphql-hooks": "1.7.
|
|
15
|
+
"@trackunit/iris-app-build-utilities": "1.7.116",
|
|
16
|
+
"@trackunit/iris-app-api": "1.10.3",
|
|
17
|
+
"@trackunit/react-core-contexts-test": "1.7.124",
|
|
18
|
+
"@trackunit/shared-utils": "1.9.110",
|
|
19
|
+
"@trackunit/react-core-hooks": "1.7.124",
|
|
20
|
+
"@trackunit/iris-app-runtime-core": "1.8.120",
|
|
21
|
+
"@trackunit/iris-app-runtime-core-api": "1.7.120",
|
|
22
|
+
"@trackunit/react-graphql-hooks": "1.7.151"
|
|
23
23
|
},
|
|
24
24
|
"module": "./index.esm.js",
|
|
25
25
|
"main": "./index.cjs.js",
|
|
@@ -10,7 +10,7 @@ type CustomFieldValueAndDefinitionNode = FragmentType<typeof CustomFieldValueAnd
|
|
|
10
10
|
* @param node - The node containing the CustomFieldValueAndDefinition, which may be null or undefined.
|
|
11
11
|
* @returns {CustomFieldValueAndDefinitionNode} The CustomFieldValueAndDefinition if it exists, or undefined otherwise.
|
|
12
12
|
*/
|
|
13
|
-
export declare const getAllCustomFieldValueAndDefinitionFromRelevantNode: (node?: CustomFieldValueAndDefinitionNode | null) =>
|
|
13
|
+
export declare const getAllCustomFieldValueAndDefinitionFromRelevantNode: (node?: CustomFieldValueAndDefinitionNode | null) => AllCustomFieldValueAndDefinition | null | undefined;
|
|
14
14
|
export interface UseAllCustomFieldsValueAndDefinitionProps {
|
|
15
15
|
entityId?: string;
|
|
16
16
|
entityType?: AllSupportedEntityTypes;
|
|
@@ -10,7 +10,7 @@ type CustomFieldValueAndDefinitionNode = FragmentType<typeof CustomFieldValueAnd
|
|
|
10
10
|
* @param node - The node containing the CustomFieldValueAndDefinition, which may be null or undefined.
|
|
11
11
|
* @returns {CustomFieldValueAndDefinitionNode} The CustomFieldValueAndDefinition if it exists, or undefined otherwise.
|
|
12
12
|
*/
|
|
13
|
-
export declare const getCustomFieldValueAndDefinitionFromRelevantNode: (node?: CustomFieldValueAndDefinitionNode | null) =>
|
|
13
|
+
export declare const getCustomFieldValueAndDefinitionFromRelevantNode: (node?: CustomFieldValueAndDefinitionNode | null) => CustomFieldValueAndDefinition | null | undefined;
|
|
14
14
|
export interface UseCustomFieldsValueAndDefinitionProps {
|
|
15
15
|
entityId?: string;
|
|
16
16
|
entityType?: SupportedEntityTypes;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
import { FetchResult } from "@apollo/client";
|
|
1
2
|
import { EntityType } from "@trackunit/iris-app-api";
|
|
2
3
|
import { SystemOfMeasurementType } from "@trackunit/iris-app-runtime-core-api";
|
|
4
|
+
import { UpdateCustomFieldValuesMutation } from "./generated/graphql-api/graphql";
|
|
3
5
|
import { CustomFieldValueAndDefinition } from "./useCustomFieldsValueAndDefinition";
|
|
6
|
+
type UseUpdateCustomFieldValuesReturnValue = {
|
|
7
|
+
updateCustomFields: (data: Record<string, unknown>) => Promise<FetchResult<UpdateCustomFieldValuesMutation, Record<string, unknown>, Record<string, unknown>>>;
|
|
8
|
+
result: UpdateCustomFieldValuesMutation | null | undefined;
|
|
9
|
+
inProgress: boolean;
|
|
10
|
+
};
|
|
4
11
|
/**
|
|
5
12
|
* Execute custom fields update from form data
|
|
6
13
|
*/
|
|
7
|
-
export declare const useUpdateCustomFieldValues: (entityId: string, entityType: EntityType, customFields: Array<CustomFieldValueAndDefinition>, systemOfMeasurement?: SystemOfMeasurementType) =>
|
|
8
|
-
|
|
9
|
-
result: import("./generated/graphql-api/graphql").UpdateCustomFieldValuesMutation | null | undefined;
|
|
10
|
-
inProgress: boolean;
|
|
11
|
-
};
|
|
14
|
+
export declare const useUpdateCustomFieldValues: (entityId: string, entityType: EntityType, customFields: Array<CustomFieldValueAndDefinition>, systemOfMeasurement?: SystemOfMeasurementType) => UseUpdateCustomFieldValuesReturnValue;
|
|
15
|
+
export {};
|