@trackunit/filters-asset-filter-definitions 1.10.23 → 1.10.26
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 +23 -23
- package/index.esm.js +3 -3
- package/package.json +19 -18
package/index.cjs.js
CHANGED
|
@@ -7,8 +7,8 @@ var reactCoreHooks = require('@trackunit/react-core-hooks');
|
|
|
7
7
|
var reactFilterComponents = require('@trackunit/react-filter-components');
|
|
8
8
|
var reactFormComponents = require('@trackunit/react-form-components');
|
|
9
9
|
var react = require('react');
|
|
10
|
-
var client = require('@apollo/client');
|
|
11
10
|
var filtersGraphqlHook = require('@trackunit/filters-graphql-hook');
|
|
11
|
+
var reactGraphqlHooks = require('@trackunit/react-graphql-hooks');
|
|
12
12
|
var utilizationIndicator = require('@trackunit/utilization-indicator');
|
|
13
13
|
var geoJsonUtils = require('@trackunit/geo-json-utils');
|
|
14
14
|
var reactComponents = require('@trackunit/react-components');
|
|
@@ -2116,7 +2116,7 @@ const mapActivityToLabelId = (state) => {
|
|
|
2116
2116
|
const ActivityFiltersView = ({ filterBarActions, filterDefinition, filterState, value, setValue, }) => {
|
|
2117
2117
|
const [t] = useTranslation();
|
|
2118
2118
|
const activeFilters = filtersGraphqlHook.useActiveAssetFilters(filterState.values);
|
|
2119
|
-
const { data, loading } =
|
|
2119
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetActivitySummaryDocument, {
|
|
2120
2120
|
fetchPolicy: "cache-first",
|
|
2121
2121
|
variables: {
|
|
2122
2122
|
filters: {
|
|
@@ -2252,13 +2252,13 @@ const usePlacesSearch = ({ localStorageKey = SHARED_LOCATIONS_LOCAL_STORAGE_KEY,
|
|
|
2252
2252
|
return recentPlaces.some(r => r.placeId === placeId);
|
|
2253
2253
|
}, [recentPlaces]);
|
|
2254
2254
|
// Query for place predictions
|
|
2255
|
-
const { data: placeAutocompleteData, previousData: previousPlaceAutocompleteData, loading: loadingPlaceAutocomplete, } =
|
|
2255
|
+
const { data: placeAutocompleteData, previousData: previousPlaceAutocompleteData, loading: loadingPlaceAutocomplete, } = reactGraphqlHooks.useQuery(GetPlaceAutocompletePredictionsDocument, {
|
|
2256
2256
|
variables: { search: debouncedSearchString },
|
|
2257
2257
|
skip: !debouncedSearchString || searchString.replace(/\s/g, "").length < MIN_LENGTH_SEARCH,
|
|
2258
2258
|
});
|
|
2259
2259
|
const stablePlaceAutocompleteData = react.useMemo(() => placeAutocompleteData ?? previousPlaceAutocompleteData, [placeAutocompleteData, previousPlaceAutocompleteData]);
|
|
2260
2260
|
// Query for place details when a place is selected
|
|
2261
|
-
const { data: placeDetailsData, loading: loadingDetails } =
|
|
2261
|
+
const { data: placeDetailsData, loading: loadingDetails } = reactGraphqlHooks.useQuery(GetPlaceDetailsDocument, {
|
|
2262
2262
|
variables: { placeId: selectedPrediction?.placeId ?? "" },
|
|
2263
2263
|
skip: !selectedPrediction?.placeId || isRecentPlace(selectedPrediction.placeId),
|
|
2264
2264
|
});
|
|
@@ -2563,7 +2563,7 @@ const ALL_TYPES = sharedUtils.objectValues(assetTypeConst);
|
|
|
2563
2563
|
const AssetTypesFilterView = (props) => {
|
|
2564
2564
|
const [t] = useTranslation();
|
|
2565
2565
|
const activeFilters = filtersGraphqlHook.useActiveAssetFilters(props.filterState.values);
|
|
2566
|
-
const { data, loading } =
|
|
2566
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetAssetTypesSummaryDocument, {
|
|
2567
2567
|
fetchPolicy: "cache-first",
|
|
2568
2568
|
variables: {
|
|
2569
2569
|
filters: {
|
|
@@ -2631,7 +2631,7 @@ const BrandFilterView = (props) => {
|
|
|
2631
2631
|
const [showRequestMoreUseSearch, setShowRequestMoreUseSearch] = react.useState(false);
|
|
2632
2632
|
const [searchText, setSearchText] = react.useState("");
|
|
2633
2633
|
const debouncedSearch = reactComponents.useDebounce(searchText, 500);
|
|
2634
|
-
const { data, loading } =
|
|
2634
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetBrandsSummaryDocument, {
|
|
2635
2635
|
fetchPolicy: "cache-first",
|
|
2636
2636
|
variables: {
|
|
2637
2637
|
limit: FETCH_LIMIT$a,
|
|
@@ -2699,7 +2699,7 @@ const mapCriticalityToLabelId = (state) => {
|
|
|
2699
2699
|
const CriticalityFiltersView = (props) => {
|
|
2700
2700
|
const [t] = useTranslation();
|
|
2701
2701
|
const activeFilters = filtersGraphqlHook.useActiveAssetFilters(props.filterState.values);
|
|
2702
|
-
const { data, loading } =
|
|
2702
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetCriticalitySummaryDocument, {
|
|
2703
2703
|
fetchPolicy: "cache-first",
|
|
2704
2704
|
variables: {
|
|
2705
2705
|
filters: {
|
|
@@ -2762,7 +2762,7 @@ const useCustomerData = (filterValues, customerId) => {
|
|
|
2762
2762
|
const activeFilters = filtersGraphqlHook.useActiveAssetFilters(filterValues);
|
|
2763
2763
|
const [searchText, setSearchText] = react.useState("");
|
|
2764
2764
|
const debouncedSearch = reactComponents.useDebounce(searchText, 500);
|
|
2765
|
-
const { data, loading } =
|
|
2765
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetCustomerIdSummaryDocument, {
|
|
2766
2766
|
fetchPolicy: "cache-first",
|
|
2767
2767
|
variables: {
|
|
2768
2768
|
limit: FETCH_LIMIT$9,
|
|
@@ -2975,7 +2975,7 @@ const GroupIdsFilterView = (props) => {
|
|
|
2975
2975
|
const [showRequestMoreUseSearch, setShowRequestMoreUseSearch] = react.useState(false);
|
|
2976
2976
|
const [searchText, setSearchText] = react.useState("");
|
|
2977
2977
|
const debouncedSearch = reactComponents.useDebounce(searchText, 500);
|
|
2978
|
-
const { data, loading } =
|
|
2978
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetGroupSummaryDocument, {
|
|
2979
2979
|
fetchPolicy: "cache-first",
|
|
2980
2980
|
variables: {
|
|
2981
2981
|
limit: FETCH_LIMIT$8,
|
|
@@ -3153,7 +3153,7 @@ const mapMetadataCompletenessToLabelId = (type) => {
|
|
|
3153
3153
|
const MetadataCompletenessFilterView = (props) => {
|
|
3154
3154
|
const [t] = useTranslation();
|
|
3155
3155
|
const activeFilters = filtersGraphqlHook.useActiveAssetFilters(props.filterState.values);
|
|
3156
|
-
const { data, loading } =
|
|
3156
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetMetadataCompletenessSummaryDocument, {
|
|
3157
3157
|
variables: {
|
|
3158
3158
|
filters: {
|
|
3159
3159
|
...activeFilters,
|
|
@@ -3216,7 +3216,7 @@ const ModelsFilterView = (props) => {
|
|
|
3216
3216
|
const [showRequestMoreUseSearch, setShowRequestMoreUseSearch] = react.useState(false);
|
|
3217
3217
|
const [searchText, setSearchText] = react.useState("");
|
|
3218
3218
|
const debouncedSearch = reactComponents.useDebounce(searchText, 500);
|
|
3219
|
-
const { data, loading } =
|
|
3219
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetModelsSummaryDocument, {
|
|
3220
3220
|
fetchPolicy: "cache-first",
|
|
3221
3221
|
variables: {
|
|
3222
3222
|
limit: FETCH_LIMIT$7,
|
|
@@ -3273,7 +3273,7 @@ const OwnerAccountIdsFilterView = (props) => {
|
|
|
3273
3273
|
const [showRequestMoreUseSearch, setShowRequestMoreUseSearch] = react.useState(false);
|
|
3274
3274
|
const [searchText, setSearchText] = react.useState("");
|
|
3275
3275
|
const debouncedSearch = reactComponents.useDebounce(searchText, 500);
|
|
3276
|
-
const { data, loading } =
|
|
3276
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetOwnerAccountSummaryDocument, {
|
|
3277
3277
|
fetchPolicy: "cache-first",
|
|
3278
3278
|
variables: {
|
|
3279
3279
|
limit: FETCH_LIMIT$6,
|
|
@@ -3428,7 +3428,7 @@ const ProductionYearFilterView = ({ filterDefinition, filterState, filterBarActi
|
|
|
3428
3428
|
const [showRequestMoreUseSearch, setShowRequestMoreUseSearch] = react.useState(false);
|
|
3429
3429
|
const [searchText, setSearchText] = react.useState("");
|
|
3430
3430
|
const debouncedSearch = reactComponents.useDebounce(searchText, 500);
|
|
3431
|
-
const { data, loading } =
|
|
3431
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetProductionYearsSummaryDocument, {
|
|
3432
3432
|
variables: {
|
|
3433
3433
|
limit: FETCH_LIMIT$5,
|
|
3434
3434
|
search: debouncedSearch,
|
|
@@ -3485,7 +3485,7 @@ const RentalContractOrderNumberFilterView = (props) => {
|
|
|
3485
3485
|
const [showRequestMoreUseSearch, setShowRequestMoreUseSearch] = react.useState(false);
|
|
3486
3486
|
const [searchText, setSearchText] = react.useState("");
|
|
3487
3487
|
const debouncedSearch = reactComponents.useDebounce(searchText, 500);
|
|
3488
|
-
const { data, loading } =
|
|
3488
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetRentalContractOrderNumberSummaryDocument, {
|
|
3489
3489
|
fetchPolicy: "cache-first",
|
|
3490
3490
|
context: {
|
|
3491
3491
|
headers: {
|
|
@@ -3529,7 +3529,7 @@ const useRentalContractOrderNumberFilter = ({ showInFilterBar } = {
|
|
|
3529
3529
|
group: "CUSTOMERS",
|
|
3530
3530
|
title: t("assetFilters.rentalContractOrderNumberFilter.label"),
|
|
3531
3531
|
showInFilterBar,
|
|
3532
|
-
valueAsText: values =>
|
|
3532
|
+
valueAsText: values => values.map(value => value),
|
|
3533
3533
|
component: props => jsxRuntime.jsx(RentalContractOrderNumberFilterView, { ...props }),
|
|
3534
3534
|
};
|
|
3535
3535
|
}, [showInFilterBar, t]);
|
|
@@ -3636,7 +3636,7 @@ const RentalContractReferenceCodeFilterView = (props) => {
|
|
|
3636
3636
|
const [showRequestMoreUseSearch, setShowRequestMoreUseSearch] = react.useState(false);
|
|
3637
3637
|
const [searchText, setSearchText] = react.useState("");
|
|
3638
3638
|
const debouncedSearch = reactComponents.useDebounce(searchText, 500);
|
|
3639
|
-
const { data, loading } =
|
|
3639
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetRentalContractReferenceCodesSummaryDocument, {
|
|
3640
3640
|
fetchPolicy: "cache-first",
|
|
3641
3641
|
context: {
|
|
3642
3642
|
headers: {
|
|
@@ -3680,7 +3680,7 @@ const useRentalContractReferenceCodeFilter = ({ showInFilterBar } = {
|
|
|
3680
3680
|
group: "CUSTOMERS",
|
|
3681
3681
|
title: t("assetFilters.rentalContractReferenceCodeFilter.label"),
|
|
3682
3682
|
showInFilterBar,
|
|
3683
|
-
valueAsText: values =>
|
|
3683
|
+
valueAsText: values => values.map(value => value),
|
|
3684
3684
|
component: props => jsxRuntime.jsx(RentalContractReferenceCodeFilterView, { ...props }),
|
|
3685
3685
|
};
|
|
3686
3686
|
}, [showInFilterBar, t]);
|
|
@@ -3821,7 +3821,7 @@ const mapServicePlansStatusToLabelId = (servicePlan) => {
|
|
|
3821
3821
|
const ServicePanStatusesFiltersView = (props) => {
|
|
3822
3822
|
const [t] = useTranslation();
|
|
3823
3823
|
const activeFilters = filtersGraphqlHook.useActiveAssetFilters(props.filterState.values);
|
|
3824
|
-
const { data, loading } =
|
|
3824
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetServicePlanStatusesSummaryDocument, {
|
|
3825
3825
|
fetchPolicy: "cache-first",
|
|
3826
3826
|
variables: {
|
|
3827
3827
|
filters: {
|
|
@@ -3888,7 +3888,7 @@ const SiteDepotOwnershipIdsFilterView = (props) => {
|
|
|
3888
3888
|
const [showRequestMoreUseSearch, setShowRequestMoreUseSearch] = react.useState(false);
|
|
3889
3889
|
const [searchText, setSearchText] = react.useState("");
|
|
3890
3890
|
const debouncedSearch = reactComponents.useDebounce(searchText, 500);
|
|
3891
|
-
const { data, loading } =
|
|
3891
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetSiteDepotOwnershipIdSummaryDocument, {
|
|
3892
3892
|
fetchPolicy: "cache-first",
|
|
3893
3893
|
variables: {
|
|
3894
3894
|
limit: FETCH_LIMIT$2,
|
|
@@ -3954,7 +3954,7 @@ const SiteIdsFilterView = (props) => {
|
|
|
3954
3954
|
const [showRequestMoreUseSearch, setShowRequestMoreUseSearch] = react.useState(false);
|
|
3955
3955
|
const [searchText, setSearchText] = react.useState("");
|
|
3956
3956
|
const debouncedSearch = reactComponents.useDebounce(searchText, 500);
|
|
3957
|
-
const { data, loading } =
|
|
3957
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetSiteIdSummaryDocument, {
|
|
3958
3958
|
fetchPolicy: "cache-first",
|
|
3959
3959
|
variables: {
|
|
3960
3960
|
limit: FETCH_LIMIT$1,
|
|
@@ -4102,7 +4102,7 @@ const sortSiteTypeSummary = (arr) => {
|
|
|
4102
4102
|
const SiteTypesFilterView = (props) => {
|
|
4103
4103
|
const [t] = useTranslation();
|
|
4104
4104
|
const { assetQueryVariables } = filtersGraphqlHook.useAssetQueryFilters({ filters: props.filterState.values });
|
|
4105
|
-
const { data, loading } =
|
|
4105
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetSiteTypeSummaryDocument, {
|
|
4106
4106
|
fetchPolicy: "cache-first",
|
|
4107
4107
|
variables: {
|
|
4108
4108
|
filters: {
|
|
@@ -4189,7 +4189,7 @@ const TelematicsConnectedFiltersView = (props) => {
|
|
|
4189
4189
|
const [t] = useTranslation();
|
|
4190
4190
|
const { logEvent } = reactCoreHooks.useAnalytics(filtersFilterBar.FilterEvents);
|
|
4191
4191
|
const activeFilters = filtersGraphqlHook.useActiveAssetFilters(props.filterState.values);
|
|
4192
|
-
const { data, loading } =
|
|
4192
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetAssetTelematicsDeviceConnectionSummaryDocument, {
|
|
4193
4193
|
fetchPolicy: "cache-first",
|
|
4194
4194
|
variables: {
|
|
4195
4195
|
filters: {
|
|
@@ -4252,7 +4252,7 @@ const TypesFilterView = (props) => {
|
|
|
4252
4252
|
const [showRequestMoreUseSearch, setShowRequestMoreUseSearch] = react.useState(false);
|
|
4253
4253
|
const [searchText, setSearchText] = react.useState("");
|
|
4254
4254
|
const debouncedSearch = reactComponents.useDebounce(searchText, 500);
|
|
4255
|
-
const { data, loading } =
|
|
4255
|
+
const { data, loading } = reactGraphqlHooks.useQuery(GetFleetTypesSummaryDocument, {
|
|
4256
4256
|
fetchPolicy: "cache-first",
|
|
4257
4257
|
variables: {
|
|
4258
4258
|
limit: FETCH_LIMIT,
|
package/index.esm.js
CHANGED
|
@@ -5,8 +5,8 @@ import { useAnalytics, useLocalStorage, usePrevious, useCurrentUser } from '@tra
|
|
|
5
5
|
import { FilterBody, RadioFilterItem } from '@trackunit/react-filter-components';
|
|
6
6
|
import { RadioGroup, RadioItem, Search } from '@trackunit/react-form-components';
|
|
7
7
|
import { useMemo, useState, useCallback, useEffect, useRef } from 'react';
|
|
8
|
-
import { useQuery } from '@apollo/client';
|
|
9
8
|
import { useActiveAssetFilters, useAssetQueryFilters } from '@trackunit/filters-graphql-hook';
|
|
9
|
+
import { useQuery } from '@trackunit/react-graphql-hooks';
|
|
10
10
|
import { ActivityIndicator } from '@trackunit/utilization-indicator';
|
|
11
11
|
import { geoJsonPolygonSchema, geoJsonPointSchema, geoJsonMultiPolygonSchema, geoJsonBboxSchema, getBboxFromGeoJsonPolygon, getPolygonFromBbox } from '@trackunit/geo-json-utils';
|
|
12
12
|
import { Tooltip, IconButton, Icon, Text, Button, useDebounce, MenuItem, useGeometry, Popover, PopoverTrigger, PopoverContent, MenuList } from '@trackunit/react-components';
|
|
@@ -3527,7 +3527,7 @@ const useRentalContractOrderNumberFilter = ({ showInFilterBar } = {
|
|
|
3527
3527
|
group: "CUSTOMERS",
|
|
3528
3528
|
title: t("assetFilters.rentalContractOrderNumberFilter.label"),
|
|
3529
3529
|
showInFilterBar,
|
|
3530
|
-
valueAsText: values =>
|
|
3530
|
+
valueAsText: values => values.map(value => value),
|
|
3531
3531
|
component: props => jsx(RentalContractOrderNumberFilterView, { ...props }),
|
|
3532
3532
|
};
|
|
3533
3533
|
}, [showInFilterBar, t]);
|
|
@@ -3678,7 +3678,7 @@ const useRentalContractReferenceCodeFilter = ({ showInFilterBar } = {
|
|
|
3678
3678
|
group: "CUSTOMERS",
|
|
3679
3679
|
title: t("assetFilters.rentalContractReferenceCodeFilter.label"),
|
|
3680
3680
|
showInFilterBar,
|
|
3681
|
-
valueAsText: values =>
|
|
3681
|
+
valueAsText: values => values.map(value => value),
|
|
3682
3682
|
component: props => jsx(RentalContractReferenceCodeFilterView, { ...props }),
|
|
3683
3683
|
};
|
|
3684
3684
|
}, [showInFilterBar, t]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/filters-asset-filter-definitions",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.26",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -16,23 +16,24 @@
|
|
|
16
16
|
"jest-fetch-mock": "^3.0.3",
|
|
17
17
|
"string-ts": "^2.0.0",
|
|
18
18
|
"tailwind-merge": "^2.0.0",
|
|
19
|
-
"@trackunit/iris-app-build-utilities": "1.7.
|
|
20
|
-
"@trackunit/filters-filter-bar": "1.8.
|
|
21
|
-
"@trackunit/react-core-hooks": "1.7.
|
|
22
|
-
"@trackunit/react-filter-components": "1.7.
|
|
23
|
-
"@trackunit/react-form-components": "1.8.
|
|
24
|
-
"@trackunit/filters-graphql-hook": "1.10.
|
|
25
|
-
"@trackunit/utilization-indicator": "1.7.
|
|
26
|
-
"@trackunit/geo-json-utils": "1.7.
|
|
27
|
-
"@trackunit/react-components": "1.9.
|
|
28
|
-
"@trackunit/shared-utils": "1.9.
|
|
29
|
-
"@trackunit/translations-machine-type": "1.7.
|
|
30
|
-
"@trackunit/criticality-indicator": "1.7.
|
|
31
|
-
"@trackunit/iris-app-api": "1.7.
|
|
32
|
-
"@trackunit/react-core-contexts-test": "1.7.
|
|
33
|
-
"@trackunit/i18n-library-translation": "1.7.
|
|
34
|
-
"@trackunit/react-core-contexts-api": "1.8.
|
|
35
|
-
"@trackunit/react-test-setup": "1.4.
|
|
19
|
+
"@trackunit/iris-app-build-utilities": "1.7.17",
|
|
20
|
+
"@trackunit/filters-filter-bar": "1.8.26",
|
|
21
|
+
"@trackunit/react-core-hooks": "1.7.19",
|
|
22
|
+
"@trackunit/react-filter-components": "1.7.26",
|
|
23
|
+
"@trackunit/react-form-components": "1.8.26",
|
|
24
|
+
"@trackunit/filters-graphql-hook": "1.10.26",
|
|
25
|
+
"@trackunit/utilization-indicator": "1.7.26",
|
|
26
|
+
"@trackunit/geo-json-utils": "1.7.16",
|
|
27
|
+
"@trackunit/react-components": "1.9.26",
|
|
28
|
+
"@trackunit/shared-utils": "1.9.16",
|
|
29
|
+
"@trackunit/translations-machine-type": "1.7.20",
|
|
30
|
+
"@trackunit/criticality-indicator": "1.7.26",
|
|
31
|
+
"@trackunit/iris-app-api": "1.7.17",
|
|
32
|
+
"@trackunit/react-core-contexts-test": "1.7.19",
|
|
33
|
+
"@trackunit/i18n-library-translation": "1.7.20",
|
|
34
|
+
"@trackunit/react-core-contexts-api": "1.8.18",
|
|
35
|
+
"@trackunit/react-test-setup": "1.4.16",
|
|
36
|
+
"@trackunit/react-graphql-hooks": "1.7.26"
|
|
36
37
|
},
|
|
37
38
|
"module": "./index.esm.js",
|
|
38
39
|
"main": "./index.cjs.js",
|