@equinor/echo-framework 4.1.1 → 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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "4.1.1",
3
+ "version": "4.2.0",
4
4
  "peerDependencies": {
5
- "@equinor/echo-base": ">= 4.1.0 < 5.0.0",
6
- "@equinor/echo-components": ">= 4.1.1 < 5.0.0",
7
- "@equinor/echo-core": ">= 4.1.1 < 5.0.0",
8
- "@equinor/echo-search": ">= 4.1.0 < 5.0.0",
9
- "@equinor/echo-utils": ">= 4.1.0 < 5.0.0",
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",
@@ -18,12 +18,12 @@
18
18
  "lodash": ">= 4.17.23 < 5",
19
19
  "react-router-dom": ">= 6.30.3 < 7",
20
20
  "zustand": ">= 4.4.7 < 5",
21
- "immer": "11.1.3",
22
- "msw": "2.12.7",
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.2.1",
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,7 +1,7 @@
1
1
  import type { TagSummaryDto } from '@equinor/echo-search';
2
2
  import React from 'react';
3
3
  interface TagsDropdownProps {
4
- tags: TagSummaryDto[];
4
+ tags: ReadonlyArray<TagSummaryDto>;
5
5
  onTagSelected: (tag: TagSummaryDto) => void;
6
6
  loadingTags?: boolean;
7
7
  }
@@ -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,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';
@@ -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 {};
@@ -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>>;