@equinor/echo-framework 4.1.0 → 4.1.1
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 -2
- package/package.json +4 -4
- 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/feature/legend/hooks/useFetchNotificationsByWorkOrderId.d.ts +13 -0
- package/src/lib/feature/legend/legendStrategies/workOrderStrategy/components/WorkOrderPopoverPrimaryRow.d.ts +3 -3
- 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/feature/measuringPoint/components/lastRecordedMeasurement/lastRecordedMeasurement.d.ts +0 -8
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-framework",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@equinor/echo-base": ">= 4.1.0 < 5.0.0",
|
|
6
|
-
"@equinor/echo-components": ">= 4.1.
|
|
7
|
-
"@equinor/echo-core": ">= 4.1.
|
|
6
|
+
"@equinor/echo-components": ">= 4.1.1 < 5.0.0",
|
|
7
|
+
"@equinor/echo-core": ">= 4.1.1 < 5.0.0",
|
|
8
8
|
"@equinor/echo-search": ">= 4.1.0 < 5.0.0",
|
|
9
9
|
"@equinor/echo-utils": ">= 4.1.0 < 5.0.0",
|
|
10
10
|
"@equinor/eds-core-react": "0.49.0",
|
|
@@ -16,7 +16,7 @@
|
|
|
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
21
|
"immer": "11.1.3",
|
|
22
22
|
"msw": "2.12.7",
|
|
@@ -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 {};
|
|
@@ -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;
|
|
@@ -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;
|
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>;
|
|
@@ -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 {};
|