@trackunit/filters-asset-filter-definitions 1.15.6 → 1.15.8
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 +363 -19
- package/index.esm.js +358 -20
- package/package.json +5 -5
- package/src/defaultFilters/defaults/RentalContractCustomerParentExternalReferenceFilter.d.ts +21 -0
- package/src/defaultFilters/defaults/RentalContractCustomerParentNameFilter.d.ts +21 -0
- package/src/defaultFilters/defaults/index.d.ts +2 -0
- package/src/generated/graphql-api/gql.d.ts +2 -2
- package/src/generated/graphql-api/graphql.d.ts +46 -0
- package/src/generated/graphql-api/mock.d.ts +6 -0
- package/src/translation.d.ts +2 -2
package/index.cjs.js
CHANGED
|
@@ -125,6 +125,8 @@ var defaultTranslations = {
|
|
|
125
125
|
"assetFilters.regions.WHOLE_WORLD": "Whole world",
|
|
126
126
|
"assetFilters.rentalActiveContractItemOffRentDatesDateRangeFilter.label": "Off rent date",
|
|
127
127
|
"assetFilters.rentalActiveContractItemOnRentDatesDateRangeFilter.label": "On rent date",
|
|
128
|
+
"assetFilters.rentalContractCustomerParentExternalReferenceFilter.label": "Customer parent external reference",
|
|
129
|
+
"assetFilters.rentalContractCustomerParentNameFilter.label": "Customer parent name",
|
|
128
130
|
"assetFilters.rentalContractOrderNumberFilter.label": "Order number",
|
|
129
131
|
"assetFilters.rentalContractReferenceCodeDescriptionFilter.label": "Reference code description",
|
|
130
132
|
"assetFilters.rentalContractReferenceCodeDescriptionFilter.searchPlaceholder": "Search by reference code description...",
|
|
@@ -352,7 +354,7 @@ const GET_ACCESS_MANAGEMENT_MODE_DESIRED_SUMMARY = client.gql `
|
|
|
352
354
|
}
|
|
353
355
|
}
|
|
354
356
|
`;
|
|
355
|
-
const FETCH_LIMIT$
|
|
357
|
+
const FETCH_LIMIT$d = 1000;
|
|
356
358
|
/**
|
|
357
359
|
Renders the Access Management Mode Filter view with the provided props.
|
|
358
360
|
|
|
@@ -366,7 +368,7 @@ const AccessManagementModeFilterView = ({ filterDefinition, filterState, filterB
|
|
|
366
368
|
const { data, loading } = reactGraphqlHooks.useQuery(GET_ACCESS_MANAGEMENT_MODE_DESIRED_SUMMARY, {
|
|
367
369
|
fetchPolicy: "cache-first",
|
|
368
370
|
variables: {
|
|
369
|
-
limit: FETCH_LIMIT$
|
|
371
|
+
limit: FETCH_LIMIT$d,
|
|
370
372
|
filters: {
|
|
371
373
|
...activeFilters,
|
|
372
374
|
accessManagementDesiredModes: null, // Omit the filters own values so list shows options correctly
|
|
@@ -2388,6 +2390,168 @@ const GetFleetRentalContractReferenceCodesSummaryDocument = {
|
|
|
2388
2390
|
},
|
|
2389
2391
|
],
|
|
2390
2392
|
};
|
|
2393
|
+
const GetFleetRentalCustomerParentExternalReferenceSummaryDocument = {
|
|
2394
|
+
kind: "Document",
|
|
2395
|
+
definitions: [
|
|
2396
|
+
{
|
|
2397
|
+
kind: "OperationDefinition",
|
|
2398
|
+
operation: "query",
|
|
2399
|
+
name: { kind: "Name", value: "GetFleetRentalCustomerParentExternalReferenceSummary" },
|
|
2400
|
+
variableDefinitions: [
|
|
2401
|
+
{
|
|
2402
|
+
kind: "VariableDefinition",
|
|
2403
|
+
variable: { kind: "Variable", name: { kind: "Name", value: "filters" } },
|
|
2404
|
+
type: { kind: "NamedType", name: { kind: "Name", value: "AssetFiltersInput" } },
|
|
2405
|
+
},
|
|
2406
|
+
{
|
|
2407
|
+
kind: "VariableDefinition",
|
|
2408
|
+
variable: { kind: "Variable", name: { kind: "Name", value: "limit" } },
|
|
2409
|
+
type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Int" } } },
|
|
2410
|
+
},
|
|
2411
|
+
{
|
|
2412
|
+
kind: "VariableDefinition",
|
|
2413
|
+
variable: { kind: "Variable", name: { kind: "Name", value: "search" } },
|
|
2414
|
+
type: { kind: "NamedType", name: { kind: "Name", value: "String" } },
|
|
2415
|
+
},
|
|
2416
|
+
],
|
|
2417
|
+
selectionSet: {
|
|
2418
|
+
kind: "SelectionSet",
|
|
2419
|
+
selections: [
|
|
2420
|
+
{
|
|
2421
|
+
kind: "Field",
|
|
2422
|
+
name: { kind: "Name", value: "assetSummary" },
|
|
2423
|
+
arguments: [
|
|
2424
|
+
{
|
|
2425
|
+
kind: "Argument",
|
|
2426
|
+
name: { kind: "Name", value: "filters" },
|
|
2427
|
+
value: { kind: "Variable", name: { kind: "Name", value: "filters" } },
|
|
2428
|
+
},
|
|
2429
|
+
],
|
|
2430
|
+
selectionSet: {
|
|
2431
|
+
kind: "SelectionSet",
|
|
2432
|
+
selections: [
|
|
2433
|
+
{
|
|
2434
|
+
kind: "Field",
|
|
2435
|
+
name: { kind: "Name", value: "rentalContractCustomerParentExternalReferences" },
|
|
2436
|
+
arguments: [
|
|
2437
|
+
{
|
|
2438
|
+
kind: "Argument",
|
|
2439
|
+
name: { kind: "Name", value: "limit" },
|
|
2440
|
+
value: { kind: "Variable", name: { kind: "Name", value: "limit" } },
|
|
2441
|
+
},
|
|
2442
|
+
{
|
|
2443
|
+
kind: "Argument",
|
|
2444
|
+
name: { kind: "Name", value: "filter" },
|
|
2445
|
+
value: { kind: "Variable", name: { kind: "Name", value: "search" } },
|
|
2446
|
+
},
|
|
2447
|
+
],
|
|
2448
|
+
selectionSet: {
|
|
2449
|
+
kind: "SelectionSet",
|
|
2450
|
+
selections: [
|
|
2451
|
+
{ kind: "Field", name: { kind: "Name", value: "total" } },
|
|
2452
|
+
{
|
|
2453
|
+
kind: "Field",
|
|
2454
|
+
name: { kind: "Name", value: "summary" },
|
|
2455
|
+
selectionSet: {
|
|
2456
|
+
kind: "SelectionSet",
|
|
2457
|
+
selections: [
|
|
2458
|
+
{ kind: "Field", name: { kind: "Name", value: "key" } },
|
|
2459
|
+
{ kind: "Field", name: { kind: "Name", value: "count" } },
|
|
2460
|
+
],
|
|
2461
|
+
},
|
|
2462
|
+
},
|
|
2463
|
+
],
|
|
2464
|
+
},
|
|
2465
|
+
},
|
|
2466
|
+
],
|
|
2467
|
+
},
|
|
2468
|
+
},
|
|
2469
|
+
],
|
|
2470
|
+
},
|
|
2471
|
+
},
|
|
2472
|
+
],
|
|
2473
|
+
};
|
|
2474
|
+
const GetFleetRentalCustomerParentNameSummaryDocument = {
|
|
2475
|
+
kind: "Document",
|
|
2476
|
+
definitions: [
|
|
2477
|
+
{
|
|
2478
|
+
kind: "OperationDefinition",
|
|
2479
|
+
operation: "query",
|
|
2480
|
+
name: { kind: "Name", value: "GetFleetRentalCustomerParentNameSummary" },
|
|
2481
|
+
variableDefinitions: [
|
|
2482
|
+
{
|
|
2483
|
+
kind: "VariableDefinition",
|
|
2484
|
+
variable: { kind: "Variable", name: { kind: "Name", value: "filters" } },
|
|
2485
|
+
type: { kind: "NamedType", name: { kind: "Name", value: "AssetFiltersInput" } },
|
|
2486
|
+
},
|
|
2487
|
+
{
|
|
2488
|
+
kind: "VariableDefinition",
|
|
2489
|
+
variable: { kind: "Variable", name: { kind: "Name", value: "limit" } },
|
|
2490
|
+
type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Int" } } },
|
|
2491
|
+
},
|
|
2492
|
+
{
|
|
2493
|
+
kind: "VariableDefinition",
|
|
2494
|
+
variable: { kind: "Variable", name: { kind: "Name", value: "search" } },
|
|
2495
|
+
type: { kind: "NamedType", name: { kind: "Name", value: "String" } },
|
|
2496
|
+
},
|
|
2497
|
+
],
|
|
2498
|
+
selectionSet: {
|
|
2499
|
+
kind: "SelectionSet",
|
|
2500
|
+
selections: [
|
|
2501
|
+
{
|
|
2502
|
+
kind: "Field",
|
|
2503
|
+
name: { kind: "Name", value: "assetSummary" },
|
|
2504
|
+
arguments: [
|
|
2505
|
+
{
|
|
2506
|
+
kind: "Argument",
|
|
2507
|
+
name: { kind: "Name", value: "filters" },
|
|
2508
|
+
value: { kind: "Variable", name: { kind: "Name", value: "filters" } },
|
|
2509
|
+
},
|
|
2510
|
+
],
|
|
2511
|
+
selectionSet: {
|
|
2512
|
+
kind: "SelectionSet",
|
|
2513
|
+
selections: [
|
|
2514
|
+
{
|
|
2515
|
+
kind: "Field",
|
|
2516
|
+
name: { kind: "Name", value: "rentalContractCustomerParentNames" },
|
|
2517
|
+
arguments: [
|
|
2518
|
+
{
|
|
2519
|
+
kind: "Argument",
|
|
2520
|
+
name: { kind: "Name", value: "limit" },
|
|
2521
|
+
value: { kind: "Variable", name: { kind: "Name", value: "limit" } },
|
|
2522
|
+
},
|
|
2523
|
+
{
|
|
2524
|
+
kind: "Argument",
|
|
2525
|
+
name: { kind: "Name", value: "filter" },
|
|
2526
|
+
value: { kind: "Variable", name: { kind: "Name", value: "search" } },
|
|
2527
|
+
},
|
|
2528
|
+
],
|
|
2529
|
+
selectionSet: {
|
|
2530
|
+
kind: "SelectionSet",
|
|
2531
|
+
selections: [
|
|
2532
|
+
{ kind: "Field", name: { kind: "Name", value: "total" } },
|
|
2533
|
+
{
|
|
2534
|
+
kind: "Field",
|
|
2535
|
+
name: { kind: "Name", value: "summary" },
|
|
2536
|
+
selectionSet: {
|
|
2537
|
+
kind: "SelectionSet",
|
|
2538
|
+
selections: [
|
|
2539
|
+
{ kind: "Field", name: { kind: "Name", value: "key" } },
|
|
2540
|
+
{ kind: "Field", name: { kind: "Name", value: "count" } },
|
|
2541
|
+
],
|
|
2542
|
+
},
|
|
2543
|
+
},
|
|
2544
|
+
],
|
|
2545
|
+
},
|
|
2546
|
+
},
|
|
2547
|
+
],
|
|
2548
|
+
},
|
|
2549
|
+
},
|
|
2550
|
+
],
|
|
2551
|
+
},
|
|
2552
|
+
},
|
|
2553
|
+
],
|
|
2554
|
+
};
|
|
2391
2555
|
const GetAccessManagementModeDesiredSummaryDocument = {
|
|
2392
2556
|
kind: "Document",
|
|
2393
2557
|
definitions: [
|
|
@@ -2868,7 +3032,7 @@ const useAssetTypeFilter = ({ showTypes } = { showTypes: ALL_TYPES }) => {
|
|
|
2868
3032
|
return result;
|
|
2869
3033
|
};
|
|
2870
3034
|
|
|
2871
|
-
const FETCH_LIMIT$
|
|
3035
|
+
const FETCH_LIMIT$c = 1000;
|
|
2872
3036
|
/**
|
|
2873
3037
|
* React component for rendering the brand filter.
|
|
2874
3038
|
*
|
|
@@ -2884,7 +3048,7 @@ const BrandFilterView = (props) => {
|
|
|
2884
3048
|
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetBrandsSummaryDocument, {
|
|
2885
3049
|
fetchPolicy: "cache-first",
|
|
2886
3050
|
variables: {
|
|
2887
|
-
limit: FETCH_LIMIT$
|
|
3051
|
+
limit: FETCH_LIMIT$c,
|
|
2888
3052
|
search: debouncedSearch.trim(),
|
|
2889
3053
|
filters: {
|
|
2890
3054
|
...activeFilters,
|
|
@@ -2901,7 +3065,7 @@ const BrandFilterView = (props) => {
|
|
|
2901
3065
|
return result;
|
|
2902
3066
|
}, [data?.assetSummary?.brands?.summary, getMachineTypeTranslation]);
|
|
2903
3067
|
react.useEffect(() => {
|
|
2904
|
-
setShowRequestMoreUseSearch(options.length === FETCH_LIMIT$
|
|
3068
|
+
setShowRequestMoreUseSearch(options.length === FETCH_LIMIT$c);
|
|
2905
3069
|
}, [options]);
|
|
2906
3070
|
return (jsxRuntime.jsx(filtersFilterBar.DefaultCheckboxFilter, { ...props, customSearch: { value: searchText, onChange: setSearchText, onClear: () => setSearchText("") }, loading: loading, options: options, showRequestMoreUseSearch: showRequestMoreUseSearch }));
|
|
2907
3071
|
};
|
|
@@ -3000,7 +3164,7 @@ const useCriticalityFilter = () => {
|
|
|
3000
3164
|
return result;
|
|
3001
3165
|
};
|
|
3002
3166
|
|
|
3003
|
-
const FETCH_LIMIT$
|
|
3167
|
+
const FETCH_LIMIT$b = 1000;
|
|
3004
3168
|
/**
|
|
3005
3169
|
* Custom hook to fetch customer summary data based on active filters and search text.
|
|
3006
3170
|
*
|
|
@@ -3015,7 +3179,7 @@ const useCustomerData = (filterValues, customerId) => {
|
|
|
3015
3179
|
const { data, loading } = reactGraphqlHooks.useQuery(GetCustomerIdSummaryDocument, {
|
|
3016
3180
|
fetchPolicy: "cache-first",
|
|
3017
3181
|
variables: {
|
|
3018
|
-
limit: FETCH_LIMIT$
|
|
3182
|
+
limit: FETCH_LIMIT$b,
|
|
3019
3183
|
search: debouncedSearch,
|
|
3020
3184
|
filters: {
|
|
3021
3185
|
...activeFilters,
|
|
@@ -3427,7 +3591,7 @@ const useFollowedFilter = () => {
|
|
|
3427
3591
|
return result;
|
|
3428
3592
|
};
|
|
3429
3593
|
|
|
3430
|
-
const FETCH_LIMIT$
|
|
3594
|
+
const FETCH_LIMIT$a = 1000;
|
|
3431
3595
|
/**
|
|
3432
3596
|
* The GroupIdsFilterView component is a filter view for group IDs.
|
|
3433
3597
|
* It utilizes a checkbox filter with a search feature to display and manage group selections.
|
|
@@ -3443,7 +3607,7 @@ const GroupIdsFilterView = (props) => {
|
|
|
3443
3607
|
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetGroupSummaryDocument, {
|
|
3444
3608
|
fetchPolicy: "cache-first",
|
|
3445
3609
|
variables: {
|
|
3446
|
-
limit: FETCH_LIMIT$
|
|
3610
|
+
limit: FETCH_LIMIT$a,
|
|
3447
3611
|
search: debouncedSearch,
|
|
3448
3612
|
filters: {
|
|
3449
3613
|
...activeFilters,
|
|
@@ -3467,7 +3631,7 @@ const GroupIdsFilterView = (props) => {
|
|
|
3467
3631
|
return result;
|
|
3468
3632
|
}, [data?.assetSummary?.groups, props.hasCount]);
|
|
3469
3633
|
react.useEffect(() => {
|
|
3470
|
-
setShowRequestMoreUseSearch(options.length === FETCH_LIMIT$
|
|
3634
|
+
setShowRequestMoreUseSearch(options.length === FETCH_LIMIT$a);
|
|
3471
3635
|
}, [options]);
|
|
3472
3636
|
return (jsxRuntime.jsx(filtersFilterBar.DefaultCheckboxFilter, { ...props, customSearch: { value: searchText, onChange: setSearchText, onClear: () => setSearchText("") }, loading: loading, options: options, showRequestMoreUseSearch: showRequestMoreUseSearch }));
|
|
3473
3637
|
};
|
|
@@ -3928,7 +4092,7 @@ const useMetadataCompletenessFilter = ({ isDefault } = {}) => {
|
|
|
3928
4092
|
return result;
|
|
3929
4093
|
};
|
|
3930
4094
|
|
|
3931
|
-
const FETCH_LIMIT$
|
|
4095
|
+
const FETCH_LIMIT$9 = 1000;
|
|
3932
4096
|
/**
|
|
3933
4097
|
* Renders a custom model filter component, allowing filtering of active assets by models.
|
|
3934
4098
|
* It also provides search functionality and controls for managing filtered results.
|
|
@@ -3945,7 +4109,7 @@ const ModelsFilterView = (props) => {
|
|
|
3945
4109
|
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetModelsSummaryDocument, {
|
|
3946
4110
|
fetchPolicy: "cache-first",
|
|
3947
4111
|
variables: {
|
|
3948
|
-
limit: FETCH_LIMIT$
|
|
4112
|
+
limit: FETCH_LIMIT$9,
|
|
3949
4113
|
search: debouncedSearch,
|
|
3950
4114
|
filters: {
|
|
3951
4115
|
...activeFilters,
|
|
@@ -3962,7 +4126,7 @@ const ModelsFilterView = (props) => {
|
|
|
3962
4126
|
return result;
|
|
3963
4127
|
}, [data?.assetSummary?.models?.summary, getMachineTypeTranslation]);
|
|
3964
4128
|
react.useEffect(() => {
|
|
3965
|
-
setShowRequestMoreUseSearch(options.length === FETCH_LIMIT$
|
|
4129
|
+
setShowRequestMoreUseSearch(options.length === FETCH_LIMIT$9);
|
|
3966
4130
|
}, [options]);
|
|
3967
4131
|
return (jsxRuntime.jsx(filtersFilterBar.DefaultCheckboxFilter, { ...props, customSearch: { value: searchText, onChange: setSearchText, onClear: () => setSearchText("") }, loading: loading, options: options, showRequestMoreUseSearch: showRequestMoreUseSearch }));
|
|
3968
4132
|
};
|
|
@@ -3987,7 +4151,7 @@ const useModelsFilter = () => {
|
|
|
3987
4151
|
return result;
|
|
3988
4152
|
};
|
|
3989
4153
|
|
|
3990
|
-
const FETCH_LIMIT$
|
|
4154
|
+
const FETCH_LIMIT$8 = 1000;
|
|
3991
4155
|
/**
|
|
3992
4156
|
* Component for rendering the Owner Account IDs filter view within the filter bar.
|
|
3993
4157
|
*
|
|
@@ -4002,7 +4166,7 @@ const OwnerAccountIdsFilterView = (props) => {
|
|
|
4002
4166
|
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetOwnerAccountSummaryDocument, {
|
|
4003
4167
|
fetchPolicy: "cache-first",
|
|
4004
4168
|
variables: {
|
|
4005
|
-
limit: FETCH_LIMIT$
|
|
4169
|
+
limit: FETCH_LIMIT$8,
|
|
4006
4170
|
search: debouncedSearch,
|
|
4007
4171
|
filters: {
|
|
4008
4172
|
...activeFilters,
|
|
@@ -4019,7 +4183,7 @@ const OwnerAccountIdsFilterView = (props) => {
|
|
|
4019
4183
|
return result;
|
|
4020
4184
|
}, [data?.assetSummary?.ownerAccounts?.summary]);
|
|
4021
4185
|
react.useEffect(() => {
|
|
4022
|
-
setShowRequestMoreUseSearch(options.length === FETCH_LIMIT$
|
|
4186
|
+
setShowRequestMoreUseSearch(options.length === FETCH_LIMIT$8);
|
|
4023
4187
|
}, [options]);
|
|
4024
4188
|
return (jsxRuntime.jsx(filtersFilterBar.DefaultCheckboxFilter, { ...props, customSearch: { value: searchText, onChange: setSearchText, onClear: () => setSearchText("") }, loading: loading, options: options, showRequestMoreUseSearch: showRequestMoreUseSearch }));
|
|
4025
4189
|
};
|
|
@@ -4135,7 +4299,7 @@ const usePeriodFilter = () => {
|
|
|
4135
4299
|
return result;
|
|
4136
4300
|
};
|
|
4137
4301
|
|
|
4138
|
-
const FETCH_LIMIT$
|
|
4302
|
+
const FETCH_LIMIT$7 = 1000;
|
|
4139
4303
|
/**
|
|
4140
4304
|
* Production Year Filter View component.
|
|
4141
4305
|
*
|
|
@@ -4156,7 +4320,7 @@ const ProductionYearFilterView = ({ filterDefinition, filterState, filterBarActi
|
|
|
4156
4320
|
const debouncedSearch = reactComponents.useDebounce(searchText, { delay: 500 });
|
|
4157
4321
|
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetProductionYearsSummaryDocument, {
|
|
4158
4322
|
variables: {
|
|
4159
|
-
limit: FETCH_LIMIT$
|
|
4323
|
+
limit: FETCH_LIMIT$7,
|
|
4160
4324
|
search: debouncedSearch,
|
|
4161
4325
|
filters: {
|
|
4162
4326
|
...activeFilters,
|
|
@@ -4173,7 +4337,7 @@ const ProductionYearFilterView = ({ filterDefinition, filterState, filterBarActi
|
|
|
4173
4337
|
return result;
|
|
4174
4338
|
}, [data?.assetSummary?.productionYears?.summary, t]);
|
|
4175
4339
|
react.useEffect(() => {
|
|
4176
|
-
setShowRequestMoreUseSearch(options.length === FETCH_LIMIT$
|
|
4340
|
+
setShowRequestMoreUseSearch(options.length === FETCH_LIMIT$7);
|
|
4177
4341
|
}, [options]);
|
|
4178
4342
|
return (jsxRuntime.jsx(filtersFilterBar.DefaultCheckboxFilter, { ...props, customSearch: { value: searchText, onChange: setSearchText, onClear: () => setSearchText("") }, filterBarActions: filterBarActions, filterDefinition: filterDefinition, filterState: filterState, loading: loading, options: options, showRequestMoreUseSearch: showRequestMoreUseSearch }));
|
|
4179
4343
|
};
|
|
@@ -4260,6 +4424,142 @@ const useRentalActiveContractItemOnRentDatesDateRangeFilter = ({ showInFilterBar
|
|
|
4260
4424
|
return result;
|
|
4261
4425
|
};
|
|
4262
4426
|
|
|
4427
|
+
const FETCH_LIMIT$6 = 1000;
|
|
4428
|
+
/**
|
|
4429
|
+
* Rental contract customer parent external reference filter view component.
|
|
4430
|
+
*
|
|
4431
|
+
* This component provides an interface to select rental contract customer parent external references.
|
|
4432
|
+
* It fetches data from a GraphQL query and integrates with the filter bar's filtering logic.
|
|
4433
|
+
*
|
|
4434
|
+
* @param {FilterViewProps<Array<string>>} props - The props for the component.
|
|
4435
|
+
* @returns {Element} The rendered component.
|
|
4436
|
+
*/
|
|
4437
|
+
const RentalContractCustomerParentExternalReferenceFilterView = (props) => {
|
|
4438
|
+
const [t] = useTranslation();
|
|
4439
|
+
const activeFilters = filtersGraphqlHook.useActiveAssetFilters(props.filterState.values);
|
|
4440
|
+
const [showRequestMoreUseSearch, setShowRequestMoreUseSearch] = react.useState(false);
|
|
4441
|
+
const [searchText, setSearchText] = react.useState("");
|
|
4442
|
+
const debouncedSearch = reactComponents.useDebounce(searchText, { delay: 500 });
|
|
4443
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetRentalCustomerParentExternalReferenceSummaryDocument, {
|
|
4444
|
+
fetchPolicy: "cache-first",
|
|
4445
|
+
context: {
|
|
4446
|
+
headers: {
|
|
4447
|
+
"TU-PREVIEW": "dragonfruit-monty,KOREAN-BELL",
|
|
4448
|
+
},
|
|
4449
|
+
},
|
|
4450
|
+
variables: {
|
|
4451
|
+
limit: FETCH_LIMIT$6,
|
|
4452
|
+
search: debouncedSearch,
|
|
4453
|
+
filters: {
|
|
4454
|
+
...activeFilters,
|
|
4455
|
+
rentalActiveContractFilters: {
|
|
4456
|
+
...activeFilters.rentalActiveContractFilters,
|
|
4457
|
+
customerParentExternalReferences: null,
|
|
4458
|
+
},
|
|
4459
|
+
},
|
|
4460
|
+
},
|
|
4461
|
+
});
|
|
4462
|
+
const options = react.useMemo(() => {
|
|
4463
|
+
return (data?.assetSummary?.rentalContractCustomerParentExternalReferences?.summary.map(edge => ({
|
|
4464
|
+
key: edge.key || "unknown",
|
|
4465
|
+
count: edge.count,
|
|
4466
|
+
label: (edge.key && edge.key !== "UNDEFINED") ? edge.key : t(`machine.types.Unknown`),
|
|
4467
|
+
})) ?? []);
|
|
4468
|
+
}, [data, t]);
|
|
4469
|
+
react.useEffect(() => {
|
|
4470
|
+
setShowRequestMoreUseSearch(options.length === FETCH_LIMIT$6);
|
|
4471
|
+
}, [options]);
|
|
4472
|
+
return (jsxRuntime.jsx(filtersFilterBar.DefaultCheckboxFilter, { ...props, customSearch: { value: searchText, onChange: setSearchText, onClear: () => setSearchText("") }, loading: loading, options: options, showRequestMoreUseSearch: showRequestMoreUseSearch }));
|
|
4473
|
+
};
|
|
4474
|
+
/**
|
|
4475
|
+
* Rental contract customer parent external reference filter definition
|
|
4476
|
+
*
|
|
4477
|
+
* @returns {StringArrayFilterDefinition} Rental contract customer parent external reference filter definition
|
|
4478
|
+
*/
|
|
4479
|
+
const useRentalContractCustomerParentExternalReferenceFilter = (props) => {
|
|
4480
|
+
const [t] = useTranslation();
|
|
4481
|
+
const result = react.useMemo(() => {
|
|
4482
|
+
return {
|
|
4483
|
+
filterKey: "rentalContractCustomerParentExternalReference",
|
|
4484
|
+
type: "stringArray",
|
|
4485
|
+
group: "CUSTOMERS",
|
|
4486
|
+
title: t("assetFilters.rentalContractCustomerParentExternalReferenceFilter.label"),
|
|
4487
|
+
showInFilterBar: props?.showInFilterBar ? props.showInFilterBar : () => true,
|
|
4488
|
+
valueAsText: values => values.map(value => value),
|
|
4489
|
+
component: properties => jsxRuntime.jsx(RentalContractCustomerParentExternalReferenceFilterView, { ...properties }),
|
|
4490
|
+
};
|
|
4491
|
+
}, [props?.showInFilterBar, t]);
|
|
4492
|
+
return result;
|
|
4493
|
+
};
|
|
4494
|
+
|
|
4495
|
+
const FETCH_LIMIT$5 = 1000;
|
|
4496
|
+
/**
|
|
4497
|
+
* Rental contract customer parent name filter view component.
|
|
4498
|
+
*
|
|
4499
|
+
* This component provides an interface to select rental contract customer parent names.
|
|
4500
|
+
* It fetches data from a GraphQL query and integrates with the filter bar's filtering logic.
|
|
4501
|
+
*
|
|
4502
|
+
* @param {FilterViewProps<Array<string>>} props - The props for the component.
|
|
4503
|
+
* @returns {Element} The rendered component.
|
|
4504
|
+
*/
|
|
4505
|
+
const RentalContractCustomerParentNameFilterView = (props) => {
|
|
4506
|
+
const [t] = useTranslation();
|
|
4507
|
+
const activeFilters = filtersGraphqlHook.useActiveAssetFilters(props.filterState.values);
|
|
4508
|
+
const [showRequestMoreUseSearch, setShowRequestMoreUseSearch] = react.useState(false);
|
|
4509
|
+
const [searchText, setSearchText] = react.useState("");
|
|
4510
|
+
const debouncedSearch = reactComponents.useDebounce(searchText, { delay: 500 });
|
|
4511
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetRentalCustomerParentNameSummaryDocument, {
|
|
4512
|
+
fetchPolicy: "cache-first",
|
|
4513
|
+
context: {
|
|
4514
|
+
headers: {
|
|
4515
|
+
"TU-PREVIEW": "dragonfruit-monty,KOREAN-BELL",
|
|
4516
|
+
},
|
|
4517
|
+
},
|
|
4518
|
+
variables: {
|
|
4519
|
+
limit: FETCH_LIMIT$5,
|
|
4520
|
+
search: debouncedSearch,
|
|
4521
|
+
filters: {
|
|
4522
|
+
...activeFilters,
|
|
4523
|
+
rentalActiveContractFilters: {
|
|
4524
|
+
...activeFilters.rentalActiveContractFilters,
|
|
4525
|
+
customerParentNames: null,
|
|
4526
|
+
},
|
|
4527
|
+
},
|
|
4528
|
+
},
|
|
4529
|
+
});
|
|
4530
|
+
const options = react.useMemo(() => {
|
|
4531
|
+
return (data?.assetSummary?.rentalContractCustomerParentNames?.summary.map(edge => ({
|
|
4532
|
+
key: edge.key || "unknown",
|
|
4533
|
+
count: edge.count,
|
|
4534
|
+
label: (edge.key && edge.key !== "UNDEFINED") ? edge.key : t(`machine.types.Unknown`),
|
|
4535
|
+
})) ?? []);
|
|
4536
|
+
}, [data, t]);
|
|
4537
|
+
react.useEffect(() => {
|
|
4538
|
+
setShowRequestMoreUseSearch(options.length === FETCH_LIMIT$5);
|
|
4539
|
+
}, [options]);
|
|
4540
|
+
return (jsxRuntime.jsx(filtersFilterBar.DefaultCheckboxFilter, { ...props, customSearch: { value: searchText, onChange: setSearchText, onClear: () => setSearchText("") }, loading: loading, options: options, showRequestMoreUseSearch: showRequestMoreUseSearch }));
|
|
4541
|
+
};
|
|
4542
|
+
/**
|
|
4543
|
+
* Rental contract customer parent name filter definition
|
|
4544
|
+
*
|
|
4545
|
+
* @returns {StringArrayFilterDefinition} Rental contract customer parent name filter definition
|
|
4546
|
+
*/
|
|
4547
|
+
const useRentalContractCustomerParentNameFilter = (props) => {
|
|
4548
|
+
const [t] = useTranslation();
|
|
4549
|
+
const result = react.useMemo(() => {
|
|
4550
|
+
return {
|
|
4551
|
+
filterKey: "rentalContractCustomerParentName",
|
|
4552
|
+
type: "stringArray",
|
|
4553
|
+
group: "CUSTOMERS",
|
|
4554
|
+
title: t("assetFilters.rentalContractCustomerParentNameFilter.label"),
|
|
4555
|
+
showInFilterBar: props?.showInFilterBar ? props.showInFilterBar : () => true,
|
|
4556
|
+
valueAsText: values => values.map(value => value),
|
|
4557
|
+
component: properties => jsxRuntime.jsx(RentalContractCustomerParentNameFilterView, { ...properties }),
|
|
4558
|
+
};
|
|
4559
|
+
}, [props?.showInFilterBar, t]);
|
|
4560
|
+
return result;
|
|
4561
|
+
};
|
|
4562
|
+
|
|
4263
4563
|
const FETCH_LIMIT$4 = 1000;
|
|
4264
4564
|
/**
|
|
4265
4565
|
* Rental contract order numbers filter view component.
|
|
@@ -5626,6 +5926,44 @@ const mockForGetFleetRentalContractReferenceCodesSummaryQuery = (variables, data
|
|
|
5626
5926
|
},
|
|
5627
5927
|
}, data || {}));
|
|
5628
5928
|
};
|
|
5929
|
+
const mockForGetFleetRentalCustomerParentExternalReferenceSummaryQuery = (variables, data) => {
|
|
5930
|
+
return reactCoreContextsTest.queryFor(GetFleetRentalCustomerParentExternalReferenceSummaryDocument, variables, utilities.mergeDeep({
|
|
5931
|
+
__typename: "Query",
|
|
5932
|
+
assetSummary: {
|
|
5933
|
+
__typename: "AssetSummary",
|
|
5934
|
+
rentalContractCustomerParentExternalReferences: {
|
|
5935
|
+
__typename: "MetadataSummary",
|
|
5936
|
+
total: 6273236744536064,
|
|
5937
|
+
summary: [
|
|
5938
|
+
{
|
|
5939
|
+
__typename: "Summary",
|
|
5940
|
+
key: "subito",
|
|
5941
|
+
count: 6273236744536064,
|
|
5942
|
+
},
|
|
5943
|
+
],
|
|
5944
|
+
},
|
|
5945
|
+
},
|
|
5946
|
+
}, data || {}));
|
|
5947
|
+
};
|
|
5948
|
+
const mockForGetFleetRentalCustomerParentNameSummaryQuery = (variables, data) => {
|
|
5949
|
+
return reactCoreContextsTest.queryFor(GetFleetRentalCustomerParentNameSummaryDocument, variables, utilities.mergeDeep({
|
|
5950
|
+
__typename: "Query",
|
|
5951
|
+
assetSummary: {
|
|
5952
|
+
__typename: "AssetSummary",
|
|
5953
|
+
rentalContractCustomerParentNames: {
|
|
5954
|
+
__typename: "MetadataSummary",
|
|
5955
|
+
total: 6273236744536064,
|
|
5956
|
+
summary: [
|
|
5957
|
+
{
|
|
5958
|
+
__typename: "Summary",
|
|
5959
|
+
key: "subito",
|
|
5960
|
+
count: 6273236744536064,
|
|
5961
|
+
},
|
|
5962
|
+
],
|
|
5963
|
+
},
|
|
5964
|
+
},
|
|
5965
|
+
}, data || {}));
|
|
5966
|
+
};
|
|
5629
5967
|
const mockForGetAccessManagementModeDesiredSummaryQuery = (variables, data) => {
|
|
5630
5968
|
return reactCoreContextsTest.queryFor(GetAccessManagementModeDesiredSummaryDocument, variables, utilities.mergeDeep({
|
|
5631
5969
|
__typename: "Query",
|
|
@@ -5865,6 +6203,8 @@ exports.OwnerAccountIdsFilterView = OwnerAccountIdsFilterView;
|
|
|
5865
6203
|
exports.PartnerFilterView = PartnerFilterView;
|
|
5866
6204
|
exports.PeriodFilterView = PeriodFilterView;
|
|
5867
6205
|
exports.ProductionYearFilterView = ProductionYearFilterView;
|
|
6206
|
+
exports.RentalContractCustomerParentExternalReferenceFilterView = RentalContractCustomerParentExternalReferenceFilterView;
|
|
6207
|
+
exports.RentalContractCustomerParentNameFilterView = RentalContractCustomerParentNameFilterView;
|
|
5868
6208
|
exports.RentalContractOrderNumberFilterView = RentalContractOrderNumberFilterView;
|
|
5869
6209
|
exports.RentalContractReferenceCodeDescriptionFilterView = RentalContractReferenceCodeDescriptionFilterView;
|
|
5870
6210
|
exports.RentalContractReferenceCodeFilterView = RentalContractReferenceCodeFilterView;
|
|
@@ -5901,6 +6241,8 @@ exports.mockForGetFleetOwnerAccountSummaryQuery = mockForGetFleetOwnerAccountSum
|
|
|
5901
6241
|
exports.mockForGetFleetProductionYearsSummaryQuery = mockForGetFleetProductionYearsSummaryQuery;
|
|
5902
6242
|
exports.mockForGetFleetRentalContractOrderNumberSummaryQuery = mockForGetFleetRentalContractOrderNumberSummaryQuery;
|
|
5903
6243
|
exports.mockForGetFleetRentalContractReferenceCodesSummaryQuery = mockForGetFleetRentalContractReferenceCodesSummaryQuery;
|
|
6244
|
+
exports.mockForGetFleetRentalCustomerParentExternalReferenceSummaryQuery = mockForGetFleetRentalCustomerParentExternalReferenceSummaryQuery;
|
|
6245
|
+
exports.mockForGetFleetRentalCustomerParentNameSummaryQuery = mockForGetFleetRentalCustomerParentNameSummaryQuery;
|
|
5904
6246
|
exports.mockForGetFleetServicePlanAssignmentsSummaryQuery = mockForGetFleetServicePlanAssignmentsSummaryQuery;
|
|
5905
6247
|
exports.mockForGetFleetServicePlanStatusesSummaryQuery = mockForGetFleetServicePlanStatusesSummaryQuery;
|
|
5906
6248
|
exports.mockForGetFleetServiceProvidersSummaryQuery = mockForGetFleetServiceProvidersSummaryQuery;
|
|
@@ -5946,6 +6288,8 @@ exports.usePlacesSearch = usePlacesSearch;
|
|
|
5946
6288
|
exports.useProductionYearFilter = useProductionYearFilter;
|
|
5947
6289
|
exports.useRentalActiveContractItemOffRentDatesDateRangeFilter = useRentalActiveContractItemOffRentDatesDateRangeFilter;
|
|
5948
6290
|
exports.useRentalActiveContractItemOnRentDatesDateRangeFilter = useRentalActiveContractItemOnRentDatesDateRangeFilter;
|
|
6291
|
+
exports.useRentalContractCustomerParentExternalReferenceFilter = useRentalContractCustomerParentExternalReferenceFilter;
|
|
6292
|
+
exports.useRentalContractCustomerParentNameFilter = useRentalContractCustomerParentNameFilter;
|
|
5949
6293
|
exports.useRentalContractOrderNumberFilter = useRentalContractOrderNumberFilter;
|
|
5950
6294
|
exports.useRentalContractReferenceCodeDescriptionFilter = useRentalContractReferenceCodeDescriptionFilter;
|
|
5951
6295
|
exports.useRentalContractReferenceCodeFilter = useRentalContractReferenceCodeFilter;
|