@equinor/echo-framework 4.1.0 → 4.2.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 +2 -15
- package/package.json +10 -10
- package/src/lib/components/plantSelector/index.d.ts +1 -0
- package/src/lib/components/plantSelector/plantSelector.d.ts +5 -14
- package/src/lib/components/plantSelector/plantSelector.hooks.d.ts +19 -0
- package/src/lib/components/tagSearchDropDown/tagSearchDropDown.d.ts +1 -1
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/tagFetch.logic.d.ts +1 -1
- package/src/lib/feature/legend/hooks/useFetchNotificationsByWorkOrderId.d.ts +13 -0
- package/src/lib/feature/legend/hooks/useWorkOrdersByTagNos.d.ts +11 -0
- package/src/lib/feature/legend/hooks/useWorkOrdersByTagsQuery.d.ts +15 -0
- package/src/lib/feature/legend/index.d.ts +2 -0
- package/src/lib/feature/legend/legendStrategies/workOrderStrategy/components/WorkOrderPopoverPrimaryRow.d.ts +3 -3
- package/src/lib/feature/legend/legendStrategies/workOrderStrategy/workOrder.utils.d.ts +14 -0
- package/src/lib/feature/legend/legendStrategies/workOrderStrategy/workOrderPopover.types.d.ts +8 -8
- package/src/lib/feature/measuringPoint/components/lastRecordedMeasurement/lastRecordedMeasurement.logic.d.ts +3 -3
- package/src/lib/feature/workOrder/api/api-workOrder-notification.d.ts +12 -0
- package/src/lib/services/api/api-work-orders-by-tag-nos.d.ts +15 -0
- package/src/lib/feature/measuringPoint/components/lastRecordedMeasurement/lastRecordedMeasurement.d.ts +0 -8
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-framework",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@equinor/echo-base": ">= 4.
|
|
6
|
-
"@equinor/echo-components": ">= 4.
|
|
7
|
-
"@equinor/echo-core": ">= 4.
|
|
8
|
-
"@equinor/echo-search": ">= 4.
|
|
9
|
-
"@equinor/echo-utils": ">= 4.
|
|
5
|
+
"@equinor/echo-base": ">= 4.2.0 < 5.0.0",
|
|
6
|
+
"@equinor/echo-components": ">= 4.2.0 < 5.0.0",
|
|
7
|
+
"@equinor/echo-core": ">= 4.2.0 < 5.0.0",
|
|
8
|
+
"@equinor/echo-search": ">= 4.2.0 < 5.0.0",
|
|
9
|
+
"@equinor/echo-utils": ">= 4.2.0 < 5.0.0",
|
|
10
10
|
"@equinor/eds-core-react": "0.49.0",
|
|
11
11
|
"@equinor/eds-icons": "0.22.0",
|
|
12
12
|
"@equinor/eds-tokens": "2.1.0",
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
"@microsoft/signalr": "9.0.6",
|
|
17
17
|
"classnames": "2.5.1",
|
|
18
18
|
"lodash": ">= 4.17.23 < 5",
|
|
19
|
-
"react-router-dom": ">= 6.30.
|
|
19
|
+
"react-router-dom": ">= 6.30.3 < 7",
|
|
20
20
|
"zustand": ">= 4.4.7 < 5",
|
|
21
|
-
"immer": "11.1.
|
|
22
|
-
"msw": "2.12.
|
|
21
|
+
"immer": ">= 11.1.4 < 12.0.0",
|
|
22
|
+
"msw": "2.12.10",
|
|
23
23
|
"date-fns": "4.1.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"dexie": "4.
|
|
26
|
+
"dexie": "4.3.0",
|
|
27
27
|
"mark.js": "8.11.1",
|
|
28
28
|
"ag-charts-community": "12.3.1",
|
|
29
29
|
"ag-charts-react": "12.3.1",
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Dropdown component for displaying a searchable plant selector.
|
|
4
|
-
* @param {PlantSelectorProps} {
|
|
5
|
-
* isDisabled: Flag which decides whether the dropdown should be disabled or not.
|
|
6
|
-
* stayOnPath: Flag which decides if you should stay on your current path after selecting a plant.
|
|
7
|
-
* textSize: Size of the text in the dropdown. Can be 'small', 'medium' or 'large'.
|
|
8
|
-
* noneBackground: Flag which decides if the background of the dropdown should be transparent or not.
|
|
9
|
-
* }
|
|
10
|
-
* @return {*}
|
|
11
|
-
*/
|
|
12
2
|
interface PlantSelectorProps {
|
|
13
|
-
isDisabled?: boolean;
|
|
14
|
-
stayOnPath?: boolean;
|
|
15
|
-
textSize?: 'small' | 'medium' | 'large';
|
|
16
|
-
noneBackground?: boolean;
|
|
3
|
+
readonly isDisabled?: boolean;
|
|
4
|
+
readonly stayOnPath?: boolean;
|
|
5
|
+
readonly textSize?: 'small' | 'medium' | 'large';
|
|
6
|
+
readonly noneBackground?: boolean;
|
|
7
|
+
readonly wrapperClassName?: string;
|
|
17
8
|
}
|
|
18
9
|
export declare const PlantSelector: React.FC<PlantSelectorProps>;
|
|
19
10
|
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Plant } from '@equinor/echo-core';
|
|
2
|
+
interface UsePlantSelectorResult {
|
|
3
|
+
readonly plants: readonly Plant[];
|
|
4
|
+
readonly selectedPlant: Plant | undefined;
|
|
5
|
+
readonly selectedPlantText: string;
|
|
6
|
+
readonly isDisabled: boolean;
|
|
7
|
+
readonly changePlant: (plant: Plant) => void;
|
|
8
|
+
readonly filterPlant: (plant: Plant, inputValue: string) => boolean;
|
|
9
|
+
readonly formatPlantOptionText: (plantName: string, plantId: string | null) => string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Common logic for plant selection, used by multiple components.
|
|
13
|
+
* Handles fetching plants, determining the selected plant,
|
|
14
|
+
* and managing plant-related state and actions.
|
|
15
|
+
*/
|
|
16
|
+
export declare function usePlantSelector(options?: {
|
|
17
|
+
readonly stayOnPath: boolean;
|
|
18
|
+
} | undefined): UsePlantSelectorResult;
|
|
19
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import { type TagSummaryDto } from '@equinor/echo-search';
|
|
|
2
2
|
import type { GlobalSelectionTypes } from '../globalSelectionStore.types';
|
|
3
3
|
export type TagFetchResult = {
|
|
4
4
|
result: {
|
|
5
|
-
values: TagSummaryDto
|
|
5
|
+
values: ReadonlyArray<TagSummaryDto>;
|
|
6
6
|
isSuccess: boolean;
|
|
7
7
|
};
|
|
8
8
|
itemIdsUsed: GlobalSelectionTypes.TagId[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { WorkOrderNotificationStatus } from '../../workOrder/api/api-workOrder-notification';
|
|
2
|
+
/**
|
|
3
|
+
* React Query hook that fetches maintenance record/attachment notification data for a given work order.
|
|
4
|
+
*
|
|
5
|
+
* This hook returns only the resolved `data` value from React Query.
|
|
6
|
+
* Callers that need loading/error state should use `useQuery` directly.
|
|
7
|
+
*
|
|
8
|
+
* @param workOrderId - Unique identifier of the work order for which to fetch notification data.
|
|
9
|
+
* @returns Notification data for the work order, or `undefined` when not yet loaded or when the API returns no data.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useFetchNotificationsByWorkOrderId({ workOrderId }: {
|
|
12
|
+
workOrderId: string;
|
|
13
|
+
}): WorkOrderNotificationStatus | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WorkOrderDto } from '@equinor/echo-search';
|
|
2
|
+
interface TagNoWithWorkOrders {
|
|
3
|
+
readonly tagNo: string;
|
|
4
|
+
readonly openWorkOrders: ReadonlyArray<WorkOrderDto>;
|
|
5
|
+
}
|
|
6
|
+
export declare function useOpenWorkOrdersByTagNos(items: ReadonlyArray<{
|
|
7
|
+
tagNo: string;
|
|
8
|
+
}>): {
|
|
9
|
+
tagNosWithOpenWorkOrders: readonly TagNoWithWorkOrders[];
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { WorkOrderDto } from '@equinor/echo-search';
|
|
2
|
+
/**
|
|
3
|
+
* Fetches work orders for multiple tags using React Query.
|
|
4
|
+
*
|
|
5
|
+
* @param tagNos - Array of tag numbers to search work orders for
|
|
6
|
+
* @returns React Query result with work orders data, loading state, and error state
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const tagNos = ['23-PV-1234', '23-XV-5678'];
|
|
11
|
+
* const { data: workOrders = [], isLoading, error } = useWorkOrdersByTagsQuery(tagNos);
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export declare function useWorkOrdersByTagsQuery(tagNos: string[]): import("@tanstack/react-query").UseQueryResult<readonly WorkOrderDto[], Error>;
|
|
@@ -16,6 +16,8 @@ export type { LegendStrategy } from './types/legendStrategy.type';
|
|
|
16
16
|
export type { LegendId, LegendOptionConfig } from './types/legendType';
|
|
17
17
|
export { useLegendUniqueBadges } from './hooks/useLegendUniqueBadges';
|
|
18
18
|
export { useLegendUniqueMarkers } from './hooks/useLegendUniqueMarkers';
|
|
19
|
+
export { useOpenWorkOrdersByTagNos } from './hooks/useWorkOrdersByTagNos';
|
|
20
|
+
export { useWorkOrdersByTagsQuery } from './hooks/useWorkOrdersByTagsQuery';
|
|
19
21
|
export { COUNT_MODE_KEYWORD } from './logic/normalizeBadges';
|
|
20
22
|
export { useLegendVisibleDataStore } from './stores/legendVisibleDataStore/legendVisibleDataStore';
|
|
21
23
|
export { useLegendUIStore } from './stores/legendUIStore/legendUIStore';
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* a list of unique notification type identifiers resolved for the work order.
|
|
6
6
|
*
|
|
7
7
|
* @param props \- Component props.
|
|
8
|
-
* @param props.
|
|
8
|
+
* @param props.workOrderId \- Work order identifier used for display and for fetching related objects.
|
|
9
9
|
* @param props.isActive \- Whether the work order is active \(`true`\) or completed \(`false`\).
|
|
10
10
|
* @returns A React element containing the primary row content.
|
|
11
11
|
*/
|
|
12
|
-
export declare const WorkOrderPopoverPrimaryRow: ({
|
|
13
|
-
|
|
12
|
+
export declare const WorkOrderPopoverPrimaryRow: ({ workOrderId, isActive }: {
|
|
13
|
+
workOrderId: string;
|
|
14
14
|
isActive: boolean;
|
|
15
15
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
+
import { WorkOrderDto } from '@equinor/echo-search';
|
|
1
2
|
import { PopoverProps, WorkOrderPopover } from './workOrderPopover.types';
|
|
3
|
+
/**
|
|
4
|
+
* Fetches work orders for a given legend data ID and filters them by the provided item IDs.
|
|
5
|
+
* Only supports tag-based lookups; returns undefined for non-tag legend data IDs
|
|
6
|
+
* or when no matching work orders are found.
|
|
7
|
+
*/
|
|
2
8
|
export declare function fetchWorkOrdersByLegendIdType({ legendDataId, itemIds }: PopoverProps): Promise<WorkOrderPopover[] | undefined>;
|
|
9
|
+
type WorkOrderIconSource = Readonly<Pick<WorkOrderDto, 'orderTypeId'>>;
|
|
10
|
+
/**
|
|
11
|
+
* Determines the icon name for a collection of work orders based on their order type IDs.
|
|
12
|
+
* Returns a group icon when multiple distinct order types are present,
|
|
13
|
+
* or a type-specific icon when all work orders share the same order type.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getIconForWorkOrder(workOrders: ReadonlyArray<WorkOrderIconSource>): "workorders_pm01" | "workorders_pm02" | "workorders_pm03" | "workorders_pm04" | "workorders_pm05" | "workorders_pm06" | "workorders_pm10" | "workorders_pm15" | "workorders_pm20" | "workorders_main_group";
|
|
16
|
+
export {};
|
package/src/lib/feature/legend/legendStrategies/workOrderStrategy/workOrderPopover.types.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ export type PopoverProps = {
|
|
|
4
4
|
itemIds?: ReadonlyArray<LegendDataId>;
|
|
5
5
|
};
|
|
6
6
|
export interface WorkOrderPopover {
|
|
7
|
-
workOrderId: string;
|
|
8
|
-
isActive: boolean;
|
|
9
|
-
orderTypeId: string;
|
|
10
|
-
description: string;
|
|
11
|
-
plantNo: string;
|
|
12
|
-
workCenter: string;
|
|
13
|
-
basicFinishDateTime: Date | undefined;
|
|
14
|
-
basicFinishDateStatus: string | undefined;
|
|
7
|
+
readonly workOrderId: string;
|
|
8
|
+
readonly isActive: boolean;
|
|
9
|
+
readonly orderTypeId: string;
|
|
10
|
+
readonly description: string;
|
|
11
|
+
readonly plantNo: string;
|
|
12
|
+
readonly workCenter: string;
|
|
13
|
+
readonly basicFinishDateTime: Date | undefined;
|
|
14
|
+
readonly basicFinishDateStatus: string | undefined;
|
|
15
15
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MeasurementDto } from '../../types/measuringPoint';
|
|
2
2
|
export type LastRecordedMeasurementData = {
|
|
3
|
-
conditionAsText
|
|
4
|
-
measurementDateTime: string |
|
|
5
|
-
codeAsText
|
|
3
|
+
conditionAsText: string | undefined;
|
|
4
|
+
measurementDateTime: string | undefined;
|
|
5
|
+
codeAsText: string | undefined;
|
|
6
6
|
lastRecordedMeasurement: MeasurementDto | undefined;
|
|
7
7
|
};
|
|
8
8
|
export declare const getLastRecordedMeasurement: (measurements: MeasurementDto[]) => LastRecordedMeasurementData;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface WorkOrderNotificationStatus {
|
|
2
|
+
readonly workOrderId: string;
|
|
3
|
+
readonly maintenanceRecordTypes: string[];
|
|
4
|
+
readonly hasB30Document: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Fetches maintenance record types and attachment type information for a work order.
|
|
8
|
+
*
|
|
9
|
+
* @param workOrderId - Unique work order identifier.
|
|
10
|
+
* @returns The notification data for the given work order, or `undefined` if the request returns no data.
|
|
11
|
+
*/
|
|
12
|
+
export declare function fetchNotificationStatusByWorkOrderId(workOrderId: string): Promise<WorkOrderNotificationStatus | undefined>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { WorkOrderDto } from '@equinor/echo-search';
|
|
2
|
+
/**
|
|
3
|
+
* Fetches work orders for multiple tags using echo-search.
|
|
4
|
+
* Wraps the echo-search API call for use with React Query.
|
|
5
|
+
* Throws via `resultHelper.throwIfError` when the search result contains errors.
|
|
6
|
+
*
|
|
7
|
+
* @param tagNos - Array of tag numbers to search work orders for
|
|
8
|
+
* @returns Promise resolving to array of work orders
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const workOrders = await fetchWorkOrdersByTagNos(['23-PV-1234', '23-XV-5678']);
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare function fetchWorkOrdersByTagNos(tagNos: ReadonlyArray<string>): Promise<ReadonlyArray<WorkOrderDto>>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { LastRecordedMeasurementData } from './lastRecordedMeasurement.logic';
|
|
3
|
-
type LastRecordedMeasurementProps = {
|
|
4
|
-
lastRecordedMeasurement: LastRecordedMeasurementData;
|
|
5
|
-
failureMechanismDescription: string;
|
|
6
|
-
};
|
|
7
|
-
export declare const LastRecordedMeasurement: React.FC<LastRecordedMeasurementProps>;
|
|
8
|
-
export {};
|