@trackunit/filters-asset-filter-definitions 1.11.113 → 1.12.0
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 +395 -0
- package/index.esm.js +393 -2
- package/package.json +18 -18
- package/src/defaultFilters/defaults/DeviceHealthIssueCategoryFilter/DeviceHealthIssueCategoryFilter.d.ts +9 -0
- package/src/defaultFilters/defaults/DeviceHealthIssueCategoryFilter/getHealthCategoryEnumWithFallback/getHealthCategoryEnumWithFallback.d.ts +8 -0
- package/src/defaultFilters/defaults/DeviceHealthIssueCategoryFilter/useDeviceHealthIssueCategoryDisplayNames/useDeviceHealthIssueCategoryDisplayNames.d.ts +7 -0
- package/src/defaultFilters/defaults/DeviceHealthIssueCategoryFilter/useDeviceHealthIssueCategoryFilter.d.ts +7 -0
- package/src/defaultFilters/defaults/DeviceHealthIssueTypeFilter/DeviceHealthIssueTypeFilter.d.ts +9 -0
- package/src/defaultFilters/defaults/DeviceHealthIssueTypeFilter/getHealthTypeEnumWithFallback/getHealthTypeEnumWithFallback.d.ts +8 -0
- package/src/defaultFilters/defaults/DeviceHealthIssueTypeFilter/useDeviceHealthIssueTypeDisplayNames/useDeviceHealthIssueTypeDisplayNames.d.ts +7 -0
- package/src/defaultFilters/defaults/DeviceHealthIssueTypeFilter/useDeviceHealthIssueTypeFilter.d.ts +7 -0
- package/src/defaultFilters/defaults/index.d.ts +2 -0
- package/src/generated/graphql-api/gql.d.ts +14 -0
- package/src/generated/graphql-api/graphql.d.ts +38 -0
- package/src/generated/graphql-api/mock.d.ts +6 -0
- package/src/hooks/useDefaultAssetFilterBarDefinition.d.ts +2 -0
- package/src/translation.d.ts +2 -2
package/index.cjs.js
CHANGED
|
@@ -65,6 +65,20 @@ var defaultTranslations = {
|
|
|
65
65
|
"assetFilters.criticality.CRITICAL": "Critical",
|
|
66
66
|
"assetFilters.criticality.LOW": "Low",
|
|
67
67
|
"assetFilters.criticality.NONE": "Good",
|
|
68
|
+
"assetFilters.deviceHealthIssueCategories": "Issue Categories",
|
|
69
|
+
"assetFilters.deviceHealthIssueCategory.coverageIssues": "Coverage",
|
|
70
|
+
"assetFilters.deviceHealthIssueCategory.deviceBatteryIssues": "Device battery",
|
|
71
|
+
"assetFilters.deviceHealthIssueCategory.installAndConfigurationHealth": "Install and configuration",
|
|
72
|
+
"assetFilters.deviceHealthIssueCategory.nonReportingUnit": "Non reporting devices",
|
|
73
|
+
"assetFilters.deviceHealthIssueType.dataNotReceived": "Data not received",
|
|
74
|
+
"assetFilters.deviceHealthIssueType.installationValidationMissing": "Installation validation missing",
|
|
75
|
+
"assetFilters.deviceHealthIssueType.lowCellularCoverage": "Low cellular coverage",
|
|
76
|
+
"assetFilters.deviceHealthIssueType.lowDeviceBatteryVoltage": "Low device battery voltage",
|
|
77
|
+
"assetFilters.deviceHealthIssueType.lowDeviceInputVoltage": "Low device input voltage",
|
|
78
|
+
"assetFilters.deviceHealthIssueType.lowGpsCoverage": "Low GPS coverage",
|
|
79
|
+
"assetFilters.deviceHealthIssueType.noCanDataConfiguration": "No CAN data",
|
|
80
|
+
"assetFilters.deviceHealthIssueType.operatingHours": "Unusual operating hours",
|
|
81
|
+
"assetFilters.deviceHealthIssueTypes": "Issue Types",
|
|
68
82
|
"assetFilters.followedFilter.label": "Followed",
|
|
69
83
|
"assetFilters.hourIntervalFilter.label": "Hour interval",
|
|
70
84
|
"assetFilters.lastSeenFilter.anytime": "Any time",
|
|
@@ -448,6 +462,22 @@ const assetCriticalityState = {
|
|
|
448
462
|
LOW: "LOW",
|
|
449
463
|
NONE: "NONE",
|
|
450
464
|
};
|
|
465
|
+
const fleetDataHealthIssueCategory = {
|
|
466
|
+
COVERAGE_ISSUES: "COVERAGE_ISSUES",
|
|
467
|
+
DEVICE_BATTERY_ISSUES: "DEVICE_BATTERY_ISSUES",
|
|
468
|
+
INSTALL_AND_CONFIGURATION_HEALTH: "INSTALL_AND_CONFIGURATION_HEALTH",
|
|
469
|
+
NON_REPORTING_UNIT: "NON_REPORTING_UNIT",
|
|
470
|
+
};
|
|
471
|
+
const fleetDataHealthIssueType = {
|
|
472
|
+
DATA_NOT_RECEIVED: "DATA_NOT_RECEIVED",
|
|
473
|
+
INSTALLATION_VALIDATION_MISSING: "INSTALLATION_VALIDATION_MISSING",
|
|
474
|
+
LOW_CELLULAR_COVERAGE: "LOW_CELLULAR_COVERAGE",
|
|
475
|
+
LOW_DEVICE_BATTERY_VOLTAGE: "LOW_DEVICE_BATTERY_VOLTAGE",
|
|
476
|
+
LOW_DEVICE_INPUT_VOLTAGE: "LOW_DEVICE_INPUT_VOLTAGE",
|
|
477
|
+
LOW_GPS_COVERAGE: "LOW_GPS_COVERAGE",
|
|
478
|
+
NO_CAN_DATA_CONFIGURATION: "NO_CAN_DATA_CONFIGURATION",
|
|
479
|
+
OPERATING_HOURS: "OPERATING_HOURS",
|
|
480
|
+
};
|
|
451
481
|
const servicePlanStatus = {
|
|
452
482
|
COMPLETE: "COMPLETE",
|
|
453
483
|
DRAFT: "DRAFT",
|
|
@@ -461,6 +491,124 @@ const servicePlanStatus = {
|
|
|
461
491
|
UNKNOWN: "UNKNOWN",
|
|
462
492
|
UPCOMING: "UPCOMING",
|
|
463
493
|
};
|
|
494
|
+
const DeviceHealthIssueCategorySummariesDocument = {
|
|
495
|
+
kind: "Document",
|
|
496
|
+
definitions: [
|
|
497
|
+
{
|
|
498
|
+
kind: "OperationDefinition",
|
|
499
|
+
operation: "query",
|
|
500
|
+
name: { kind: "Name", value: "DeviceHealthIssueCategorySummaries" },
|
|
501
|
+
variableDefinitions: [
|
|
502
|
+
{
|
|
503
|
+
kind: "VariableDefinition",
|
|
504
|
+
variable: { kind: "Variable", name: { kind: "Name", value: "filters" } },
|
|
505
|
+
type: { kind: "NamedType", name: { kind: "Name", value: "AssetFiltersInput" } },
|
|
506
|
+
},
|
|
507
|
+
],
|
|
508
|
+
selectionSet: {
|
|
509
|
+
kind: "SelectionSet",
|
|
510
|
+
selections: [
|
|
511
|
+
{
|
|
512
|
+
kind: "Field",
|
|
513
|
+
name: { kind: "Name", value: "assetSummary" },
|
|
514
|
+
arguments: [
|
|
515
|
+
{
|
|
516
|
+
kind: "Argument",
|
|
517
|
+
name: { kind: "Name", value: "filters" },
|
|
518
|
+
value: { kind: "Variable", name: { kind: "Name", value: "filters" } },
|
|
519
|
+
},
|
|
520
|
+
],
|
|
521
|
+
selectionSet: {
|
|
522
|
+
kind: "SelectionSet",
|
|
523
|
+
selections: [
|
|
524
|
+
{
|
|
525
|
+
kind: "Field",
|
|
526
|
+
name: { kind: "Name", value: "fleetHealthCategoriesSummary" },
|
|
527
|
+
selectionSet: {
|
|
528
|
+
kind: "SelectionSet",
|
|
529
|
+
selections: [
|
|
530
|
+
{
|
|
531
|
+
kind: "Field",
|
|
532
|
+
name: { kind: "Name", value: "summary" },
|
|
533
|
+
selectionSet: {
|
|
534
|
+
kind: "SelectionSet",
|
|
535
|
+
selections: [
|
|
536
|
+
{ kind: "Field", name: { kind: "Name", value: "count" } },
|
|
537
|
+
{ kind: "Field", name: { kind: "Name", value: "key" } },
|
|
538
|
+
],
|
|
539
|
+
},
|
|
540
|
+
},
|
|
541
|
+
{ kind: "Field", name: { kind: "Name", value: "total" } },
|
|
542
|
+
],
|
|
543
|
+
},
|
|
544
|
+
},
|
|
545
|
+
],
|
|
546
|
+
},
|
|
547
|
+
},
|
|
548
|
+
],
|
|
549
|
+
},
|
|
550
|
+
},
|
|
551
|
+
],
|
|
552
|
+
};
|
|
553
|
+
const DeviceHealthIssueTypeSummariesDocument = {
|
|
554
|
+
kind: "Document",
|
|
555
|
+
definitions: [
|
|
556
|
+
{
|
|
557
|
+
kind: "OperationDefinition",
|
|
558
|
+
operation: "query",
|
|
559
|
+
name: { kind: "Name", value: "DeviceHealthIssueTypeSummaries" },
|
|
560
|
+
variableDefinitions: [
|
|
561
|
+
{
|
|
562
|
+
kind: "VariableDefinition",
|
|
563
|
+
variable: { kind: "Variable", name: { kind: "Name", value: "filters" } },
|
|
564
|
+
type: { kind: "NamedType", name: { kind: "Name", value: "AssetFiltersInput" } },
|
|
565
|
+
},
|
|
566
|
+
],
|
|
567
|
+
selectionSet: {
|
|
568
|
+
kind: "SelectionSet",
|
|
569
|
+
selections: [
|
|
570
|
+
{
|
|
571
|
+
kind: "Field",
|
|
572
|
+
name: { kind: "Name", value: "assetSummary" },
|
|
573
|
+
arguments: [
|
|
574
|
+
{
|
|
575
|
+
kind: "Argument",
|
|
576
|
+
name: { kind: "Name", value: "filters" },
|
|
577
|
+
value: { kind: "Variable", name: { kind: "Name", value: "filters" } },
|
|
578
|
+
},
|
|
579
|
+
],
|
|
580
|
+
selectionSet: {
|
|
581
|
+
kind: "SelectionSet",
|
|
582
|
+
selections: [
|
|
583
|
+
{
|
|
584
|
+
kind: "Field",
|
|
585
|
+
name: { kind: "Name", value: "fleetHealthTypesSummary" },
|
|
586
|
+
selectionSet: {
|
|
587
|
+
kind: "SelectionSet",
|
|
588
|
+
selections: [
|
|
589
|
+
{
|
|
590
|
+
kind: "Field",
|
|
591
|
+
name: { kind: "Name", value: "summary" },
|
|
592
|
+
selectionSet: {
|
|
593
|
+
kind: "SelectionSet",
|
|
594
|
+
selections: [
|
|
595
|
+
{ kind: "Field", name: { kind: "Name", value: "key" } },
|
|
596
|
+
{ kind: "Field", name: { kind: "Name", value: "count" } },
|
|
597
|
+
],
|
|
598
|
+
},
|
|
599
|
+
},
|
|
600
|
+
{ kind: "Field", name: { kind: "Name", value: "total" } },
|
|
601
|
+
],
|
|
602
|
+
},
|
|
603
|
+
},
|
|
604
|
+
],
|
|
605
|
+
},
|
|
606
|
+
},
|
|
607
|
+
],
|
|
608
|
+
},
|
|
609
|
+
},
|
|
610
|
+
],
|
|
611
|
+
};
|
|
464
612
|
const GetFleetAssetTypesSummaryDocument = {
|
|
465
613
|
kind: "Document",
|
|
466
614
|
definitions: [
|
|
@@ -3074,6 +3222,205 @@ const useCustomerIdsFilter = ({ showInFilterBar, defaultValue, hasCount, persist
|
|
|
3074
3222
|
return result;
|
|
3075
3223
|
};
|
|
3076
3224
|
|
|
3225
|
+
/**
|
|
3226
|
+
* Get the Fleet Data Health Issue Category enum value with fallback
|
|
3227
|
+
*
|
|
3228
|
+
* @param key - The key to get the enum value for
|
|
3229
|
+
* @returns {FleetDataHealthIssueCategory | null} The Fleet Data Health Issue Category enum value or null if not found
|
|
3230
|
+
*/
|
|
3231
|
+
const getHealthCategoryEnumWithFallback = (key) => {
|
|
3232
|
+
try {
|
|
3233
|
+
return sharedUtils.enumFromValue(key, fleetDataHealthIssueCategory);
|
|
3234
|
+
}
|
|
3235
|
+
catch {
|
|
3236
|
+
return null;
|
|
3237
|
+
}
|
|
3238
|
+
};
|
|
3239
|
+
|
|
3240
|
+
/**
|
|
3241
|
+
* Get a record of device health category display names
|
|
3242
|
+
*
|
|
3243
|
+
* @returns {Record<FleetDataHealthIssueCategory, string>} A record of device health category display names
|
|
3244
|
+
*/
|
|
3245
|
+
const useDeviceHealthIssueCategoryDisplayNames = () => {
|
|
3246
|
+
const [t] = useTranslation();
|
|
3247
|
+
return react.useMemo(() => ({
|
|
3248
|
+
[fleetDataHealthIssueCategory.COVERAGE_ISSUES]: t("assetFilters.deviceHealthIssueCategory.coverageIssues"),
|
|
3249
|
+
[fleetDataHealthIssueCategory.DEVICE_BATTERY_ISSUES]: t("assetFilters.deviceHealthIssueCategory.deviceBatteryIssues"),
|
|
3250
|
+
[fleetDataHealthIssueCategory.INSTALL_AND_CONFIGURATION_HEALTH]: t("assetFilters.deviceHealthIssueCategory.installAndConfigurationHealth"),
|
|
3251
|
+
[fleetDataHealthIssueCategory.NON_REPORTING_UNIT]: t("assetFilters.deviceHealthIssueCategory.nonReportingUnit"),
|
|
3252
|
+
}), [t]);
|
|
3253
|
+
};
|
|
3254
|
+
|
|
3255
|
+
/**
|
|
3256
|
+
* Device Health Issue Category Filter component
|
|
3257
|
+
*
|
|
3258
|
+
* @param {FilterViewProps<Array<ValueName>>} props - Filter view props
|
|
3259
|
+
* @returns {ReactElement} React element
|
|
3260
|
+
*/
|
|
3261
|
+
const DeviceHealthIssueCategoryFilter = (props) => {
|
|
3262
|
+
const categoryDisplayNames = useDeviceHealthIssueCategoryDisplayNames();
|
|
3263
|
+
const filters = filtersGraphqlHook.useActiveAssetFilters(props.filterState.values);
|
|
3264
|
+
const { data, loading } = reactGraphqlHooks.useQuery(DeviceHealthIssueCategorySummariesDocument, {
|
|
3265
|
+
variables: {
|
|
3266
|
+
filters: {
|
|
3267
|
+
...filters,
|
|
3268
|
+
activeFilter: true,
|
|
3269
|
+
fleetHealthCategories: undefined,
|
|
3270
|
+
fleetHealthStates: ["OPEN"],
|
|
3271
|
+
},
|
|
3272
|
+
},
|
|
3273
|
+
});
|
|
3274
|
+
const categories = react.useMemo(() => data?.assetSummary?.fleetHealthCategoriesSummary.summary.reduce((acc, category) => {
|
|
3275
|
+
const existingCategory = acc.find(c => c.key === category.key);
|
|
3276
|
+
if (existingCategory) {
|
|
3277
|
+
existingCategory.count += category.count;
|
|
3278
|
+
}
|
|
3279
|
+
else {
|
|
3280
|
+
acc.push(category);
|
|
3281
|
+
}
|
|
3282
|
+
return acc;
|
|
3283
|
+
}, []), [data?.assetSummary?.fleetHealthCategoriesSummary.summary]);
|
|
3284
|
+
const options = react.useMemo(() => {
|
|
3285
|
+
return (categories
|
|
3286
|
+
?.map(issueCategory => {
|
|
3287
|
+
const categoryKey = issueCategory.key;
|
|
3288
|
+
const categoryEnum = getHealthCategoryEnumWithFallback(categoryKey);
|
|
3289
|
+
if (!categoryEnum) {
|
|
3290
|
+
return null;
|
|
3291
|
+
}
|
|
3292
|
+
return {
|
|
3293
|
+
key: categoryKey,
|
|
3294
|
+
label: categoryDisplayNames[categoryEnum],
|
|
3295
|
+
count: issueCategory.count,
|
|
3296
|
+
};
|
|
3297
|
+
})
|
|
3298
|
+
.filter(sharedUtils.nonNullable) ?? []);
|
|
3299
|
+
}, [categories, categoryDisplayNames]);
|
|
3300
|
+
return jsxRuntime.jsx(filtersFilterBar.DefaultCheckboxFilter, { ...props, loading: loading, options: options });
|
|
3301
|
+
};
|
|
3302
|
+
|
|
3303
|
+
/**
|
|
3304
|
+
* Get the Device Health Issue Category filter definition
|
|
3305
|
+
*
|
|
3306
|
+
* @returns {ValueNameArrayFilterDefinition} The Device Health Issue Category filter definition
|
|
3307
|
+
*/
|
|
3308
|
+
const useDeviceHealthIssueCategoryFilter = () => {
|
|
3309
|
+
const [t] = useTranslation();
|
|
3310
|
+
return react.useMemo(() => {
|
|
3311
|
+
return {
|
|
3312
|
+
filterKey: "fleetHealthCategories",
|
|
3313
|
+
type: "valueNameArray",
|
|
3314
|
+
group: "DEVICE_HEALTH",
|
|
3315
|
+
title: t("assetFilters.deviceHealthIssueCategories"),
|
|
3316
|
+
component: props => jsxRuntime.jsx(DeviceHealthIssueCategoryFilter, { ...props }),
|
|
3317
|
+
};
|
|
3318
|
+
}, [t]);
|
|
3319
|
+
};
|
|
3320
|
+
|
|
3321
|
+
/**
|
|
3322
|
+
* Get the Fleet Data Health Issue Type enum value with fallback
|
|
3323
|
+
*
|
|
3324
|
+
* @param {string} key - The key to get the enum value for
|
|
3325
|
+
* @returns {FleetDataHealthIssueType | null} The Fleet Data Health Issue Type enum value or null if not found
|
|
3326
|
+
*/
|
|
3327
|
+
const getHealthTypeEnumWithFallback = (key) => {
|
|
3328
|
+
try {
|
|
3329
|
+
return sharedUtils.enumFromValue(key, fleetDataHealthIssueType);
|
|
3330
|
+
}
|
|
3331
|
+
catch {
|
|
3332
|
+
return null;
|
|
3333
|
+
}
|
|
3334
|
+
};
|
|
3335
|
+
|
|
3336
|
+
/**
|
|
3337
|
+
* Get a record of device health issue type display names
|
|
3338
|
+
*
|
|
3339
|
+
* @returns {Record<FleetDataHealthIssueType, string>} A record of device health issue type display names
|
|
3340
|
+
*/
|
|
3341
|
+
const useDeviceHealthIssueTypeDisplayNames = () => {
|
|
3342
|
+
const [t] = useTranslation();
|
|
3343
|
+
return react.useMemo(() => ({
|
|
3344
|
+
[fleetDataHealthIssueType.DATA_NOT_RECEIVED]: t("assetFilters.deviceHealthIssueType.dataNotReceived"),
|
|
3345
|
+
[fleetDataHealthIssueType.INSTALLATION_VALIDATION_MISSING]: t("assetFilters.deviceHealthIssueType.installationValidationMissing"),
|
|
3346
|
+
[fleetDataHealthIssueType.LOW_CELLULAR_COVERAGE]: t("assetFilters.deviceHealthIssueType.lowCellularCoverage"),
|
|
3347
|
+
[fleetDataHealthIssueType.LOW_DEVICE_BATTERY_VOLTAGE]: t("assetFilters.deviceHealthIssueType.lowDeviceBatteryVoltage"),
|
|
3348
|
+
[fleetDataHealthIssueType.LOW_DEVICE_INPUT_VOLTAGE]: t("assetFilters.deviceHealthIssueType.lowDeviceInputVoltage"),
|
|
3349
|
+
[fleetDataHealthIssueType.LOW_GPS_COVERAGE]: t("assetFilters.deviceHealthIssueType.lowGpsCoverage"),
|
|
3350
|
+
[fleetDataHealthIssueType.NO_CAN_DATA_CONFIGURATION]: t("assetFilters.deviceHealthIssueType.noCanDataConfiguration"),
|
|
3351
|
+
[fleetDataHealthIssueType.OPERATING_HOURS]: t("assetFilters.deviceHealthIssueType.operatingHours"),
|
|
3352
|
+
}), [t]);
|
|
3353
|
+
};
|
|
3354
|
+
|
|
3355
|
+
/**
|
|
3356
|
+
* Device Health Issue Type Filter component
|
|
3357
|
+
*
|
|
3358
|
+
* @param {FilterViewProps<Array<ValueName>>} props - Filter view props
|
|
3359
|
+
* @returns {ReactElement} React element
|
|
3360
|
+
*/
|
|
3361
|
+
const DeviceHealthIssueTypeFilter = (props) => {
|
|
3362
|
+
const issueTypeDisplayNames = useDeviceHealthIssueTypeDisplayNames();
|
|
3363
|
+
const filters = filtersGraphqlHook.useActiveAssetFilters(props.filterState.values);
|
|
3364
|
+
const [searchQuery, setSearchQuery] = react.useState("");
|
|
3365
|
+
const debouncedSearchQuery = reactComponents.useDebounce(searchQuery.trim().toLocaleLowerCase(), { delay: 300 });
|
|
3366
|
+
const { data, loading } = reactGraphqlHooks.useQuery(DeviceHealthIssueTypeSummariesDocument, {
|
|
3367
|
+
variables: {
|
|
3368
|
+
filters: {
|
|
3369
|
+
...filters,
|
|
3370
|
+
activeFilter: true,
|
|
3371
|
+
fleetHealthTypes: undefined,
|
|
3372
|
+
fleetHealthStates: ["OPEN"],
|
|
3373
|
+
},
|
|
3374
|
+
},
|
|
3375
|
+
});
|
|
3376
|
+
const types = react.useMemo(() => data?.assetSummary?.fleetHealthTypesSummary.summary.reduce((acc, type) => {
|
|
3377
|
+
const existingType = acc.find(c => c.key === type.key);
|
|
3378
|
+
if (existingType) {
|
|
3379
|
+
existingType.count += type.count;
|
|
3380
|
+
}
|
|
3381
|
+
else {
|
|
3382
|
+
acc.push(type);
|
|
3383
|
+
}
|
|
3384
|
+
return acc;
|
|
3385
|
+
}, []), [data?.assetSummary?.fleetHealthTypesSummary.summary]);
|
|
3386
|
+
const options = react.useMemo(() => {
|
|
3387
|
+
return (types
|
|
3388
|
+
?.map(issuetype => {
|
|
3389
|
+
const typeKey = issuetype.key;
|
|
3390
|
+
const typeEnum = getHealthTypeEnumWithFallback(typeKey);
|
|
3391
|
+
if (!typeEnum) {
|
|
3392
|
+
return null;
|
|
3393
|
+
}
|
|
3394
|
+
return {
|
|
3395
|
+
key: typeKey,
|
|
3396
|
+
label: issueTypeDisplayNames[typeEnum],
|
|
3397
|
+
count: issuetype.count,
|
|
3398
|
+
};
|
|
3399
|
+
})
|
|
3400
|
+
.filter(sharedUtils.nonNullable)
|
|
3401
|
+
.filter(option => option.label.toLowerCase().includes(debouncedSearchQuery)) ?? []);
|
|
3402
|
+
}, [debouncedSearchQuery, issueTypeDisplayNames, types]);
|
|
3403
|
+
return (jsxRuntime.jsx(filtersFilterBar.DefaultCheckboxFilter, { ...props, customSearch: { value: searchQuery, onChange: setSearchQuery }, loading: loading, options: options }));
|
|
3404
|
+
};
|
|
3405
|
+
|
|
3406
|
+
/**
|
|
3407
|
+
* Get the Device Health Issue Type filter definition
|
|
3408
|
+
*
|
|
3409
|
+
* @returns {ValueNameArrayFilterDefinition} The Device Health Issue Type filter definition
|
|
3410
|
+
*/
|
|
3411
|
+
const useDeviceHealthIssueTypeFilter = () => {
|
|
3412
|
+
const [t] = useTranslation();
|
|
3413
|
+
return react.useMemo(() => {
|
|
3414
|
+
return {
|
|
3415
|
+
filterKey: "fleetHealthTypes",
|
|
3416
|
+
type: "valueNameArray",
|
|
3417
|
+
group: "DEVICE_HEALTH",
|
|
3418
|
+
title: t("assetFilters.deviceHealthIssueTypes"),
|
|
3419
|
+
component: props => jsxRuntime.jsx(DeviceHealthIssueTypeFilter, { ...props }),
|
|
3420
|
+
};
|
|
3421
|
+
}, [t]);
|
|
3422
|
+
};
|
|
3423
|
+
|
|
3077
3424
|
/**
|
|
3078
3425
|
* The `FollowedFiltersView` component displays filter settings for "Followed" and allows the user to select between different values.
|
|
3079
3426
|
*
|
|
@@ -4458,6 +4805,44 @@ const useTypesFilter = () => {
|
|
|
4458
4805
|
return result;
|
|
4459
4806
|
};
|
|
4460
4807
|
|
|
4808
|
+
const mockForDeviceHealthIssueCategorySummariesQuery = (variables, data) => {
|
|
4809
|
+
return reactCoreContextsTest.queryFor(DeviceHealthIssueCategorySummariesDocument, variables, utilities.mergeDeep({
|
|
4810
|
+
__typename: "Query",
|
|
4811
|
+
assetSummary: {
|
|
4812
|
+
__typename: "AssetSummary",
|
|
4813
|
+
fleetHealthCategoriesSummary: {
|
|
4814
|
+
__typename: "MetadataSummary",
|
|
4815
|
+
total: 6273236744536064,
|
|
4816
|
+
summary: [
|
|
4817
|
+
{
|
|
4818
|
+
__typename: "Summary",
|
|
4819
|
+
count: 6273236744536064,
|
|
4820
|
+
key: "subito",
|
|
4821
|
+
},
|
|
4822
|
+
],
|
|
4823
|
+
},
|
|
4824
|
+
},
|
|
4825
|
+
}, data || {}));
|
|
4826
|
+
};
|
|
4827
|
+
const mockForDeviceHealthIssueTypeSummariesQuery = (variables, data) => {
|
|
4828
|
+
return reactCoreContextsTest.queryFor(DeviceHealthIssueTypeSummariesDocument, variables, utilities.mergeDeep({
|
|
4829
|
+
__typename: "Query",
|
|
4830
|
+
assetSummary: {
|
|
4831
|
+
__typename: "AssetSummary",
|
|
4832
|
+
fleetHealthTypesSummary: {
|
|
4833
|
+
__typename: "MetadataSummary",
|
|
4834
|
+
total: 6273236744536064,
|
|
4835
|
+
summary: [
|
|
4836
|
+
{
|
|
4837
|
+
__typename: "Summary",
|
|
4838
|
+
key: "subito",
|
|
4839
|
+
count: 6273236744536064,
|
|
4840
|
+
},
|
|
4841
|
+
],
|
|
4842
|
+
},
|
|
4843
|
+
},
|
|
4844
|
+
}, data || {}));
|
|
4845
|
+
};
|
|
4461
4846
|
const mockForGetFleetAssetTypesSummaryQuery = (variables, data) => {
|
|
4462
4847
|
return reactCoreContextsTest.queryFor(GetFleetAssetTypesSummaryDocument, variables, utilities.mergeDeep({
|
|
4463
4848
|
__typename: "Query",
|
|
@@ -5005,6 +5390,8 @@ const useDefaultAssetFilterBarDefinition = ({ sitesEnabled, owningDepotEnabled,
|
|
|
5005
5390
|
}, [showHiddenAssetsEnabled]);
|
|
5006
5391
|
const activeFilter = useActiveFilterFilter(activeFilterEnabledProps);
|
|
5007
5392
|
const accessManagementMode = useAccessManagementModeFilter();
|
|
5393
|
+
const fleetHealthTypes = useDeviceHealthIssueTypeFilter();
|
|
5394
|
+
const fleetHealthCategories = useDeviceHealthIssueCategoryFilter();
|
|
5008
5395
|
return react.useMemo(() => {
|
|
5009
5396
|
return {
|
|
5010
5397
|
assetType,
|
|
@@ -5029,6 +5416,8 @@ const useDefaultAssetFilterBarDefinition = ({ sitesEnabled, owningDepotEnabled,
|
|
|
5029
5416
|
partner,
|
|
5030
5417
|
search,
|
|
5031
5418
|
accessManagementMode,
|
|
5419
|
+
fleetHealthTypes,
|
|
5420
|
+
fleetHealthCategories,
|
|
5032
5421
|
};
|
|
5033
5422
|
}, [
|
|
5034
5423
|
siteIds,
|
|
@@ -5053,6 +5442,8 @@ const useDefaultAssetFilterBarDefinition = ({ sitesEnabled, owningDepotEnabled,
|
|
|
5053
5442
|
activeFilter,
|
|
5054
5443
|
siteDepotOwnershipIds,
|
|
5055
5444
|
accessManagementMode,
|
|
5445
|
+
fleetHealthTypes,
|
|
5446
|
+
fleetHealthCategories,
|
|
5056
5447
|
]);
|
|
5057
5448
|
};
|
|
5058
5449
|
|
|
@@ -5105,6 +5496,8 @@ exports.mapActivityToLabelId = mapActivityToLabelId;
|
|
|
5105
5496
|
exports.mapMetadataCompletenessToLabelId = mapMetadataCompletenessToLabelId;
|
|
5106
5497
|
exports.metadataCompleteness = metadataCompleteness;
|
|
5107
5498
|
exports.metadataCompletenessOptions = metadataCompletenessOptions;
|
|
5499
|
+
exports.mockForDeviceHealthIssueCategorySummariesQuery = mockForDeviceHealthIssueCategorySummariesQuery;
|
|
5500
|
+
exports.mockForDeviceHealthIssueTypeSummariesQuery = mockForDeviceHealthIssueTypeSummariesQuery;
|
|
5108
5501
|
exports.mockForGetAccessManagementModeDesiredSummaryQuery = mockForGetAccessManagementModeDesiredSummaryQuery;
|
|
5109
5502
|
exports.mockForGetAssetTelematicsDeviceConnectionSummaryQuery = mockForGetAssetTelematicsDeviceConnectionSummaryQuery;
|
|
5110
5503
|
exports.mockForGetCustomFieldSummaryQuery = mockForGetCustomFieldSummaryQuery;
|
|
@@ -5143,6 +5536,8 @@ exports.useBrandFilter = useBrandFilter;
|
|
|
5143
5536
|
exports.useCriticalityFilter = useCriticalityFilter;
|
|
5144
5537
|
exports.useCustomerIdsFilter = useCustomerIdsFilter;
|
|
5145
5538
|
exports.useDefaultAssetFilterBarDefinition = useDefaultAssetFilterBarDefinition;
|
|
5539
|
+
exports.useDeviceHealthIssueCategoryFilter = useDeviceHealthIssueCategoryFilter;
|
|
5540
|
+
exports.useDeviceHealthIssueTypeFilter = useDeviceHealthIssueTypeFilter;
|
|
5146
5541
|
exports.useFollowedFilter = useFollowedFilter;
|
|
5147
5542
|
exports.useGroupIdsFilter = useGroupIdsFilter;
|
|
5148
5543
|
exports.useHourIntervalFilter = useHourIntervalFilter;
|