@equinor/echo-framework 6.1.0 → 6.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 -2
- package/package.json +8 -8
- package/src/index.d.ts +1 -1
- package/src/lib/components/panel/panelNavigation.helper.d.ts +1 -2
- package/src/lib/feature/globalSelection/selectionMenu/hooks/useFetchSelectionHistory.d.ts +1 -1
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/colorConflictHandling/SelectionColorConflictDialog.d.ts +1 -1
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendColoredMarkerIcon.d.ts +6 -9
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/MarkerWithPopover.d.ts +6 -7
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/components/MultipleMarkersBySingleLegend/multipleMarkersBySingleLegend.logic.d.ts +5 -7
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/components/MultipleMarkersBySingleLegend/useStalePopoverMarkers.d.ts +3 -3
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/hooks/useMarkerPopover.d.ts +2 -2
- package/src/lib/feature/legend/components/pdfMarkers/utils/markerId.utils.d.ts +11 -3
- package/src/lib/feature/legend/components/popover/LegendPopoverContent.logic.d.ts +14 -21
- package/src/lib/feature/legend/components/selectionLegend/hooks/useAllMarkerItemIdsForEnabledLegends.d.ts +4 -4
- package/src/lib/feature/legend/components/selectionLegend/selectionLegend.utils.d.ts +9 -9
- package/src/lib/feature/legend/hooks/useLegendBadgeChips.d.ts +7 -0
- package/src/lib/feature/legend/hooks/useLegendHiddenItemsSubscription.d.ts +4 -14
- package/src/lib/feature/legend/hooks/useLegendMarkerChips.d.ts +7 -0
- package/src/lib/feature/legend/hooks/useLegendMarkers/useLegendMarkers.d.ts +17 -0
- package/src/lib/feature/legend/hooks/useLegendMarkers/useLegendMarkers.logic.d.ts +65 -0
- package/src/lib/feature/legend/hooks/useLegendMarkers/useLegendMarkers.utils.d.ts +14 -0
- package/src/lib/feature/legend/hooks/useWorkOrdersByTagsQuery.d.ts +1 -1
- package/src/lib/feature/legend/index.d.ts +8 -6
- package/src/lib/feature/legend/legendFacade.d.ts +9 -15
- package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/api/iocAnnotationLegend.api.d.ts +3 -0
- package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/hooks/useIocAnnotationMarkers.d.ts +3 -0
- package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/hooks/useIocAnnotationMarkers.utils.d.ts +21 -0
- package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/iocAnnotationStrategy.d.ts +1 -0
- package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/iocAnnotationStrategy.types.d.ts +25 -0
- package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/optionConfigs/iocAnnotationBadgeLegendOptionConfig.d.ts +3 -0
- package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/optionConfigs/iocAnnotationMarkerLegendOptionConfig.d.ts +3 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/hooks/useNotificationDetailsByIds.d.ts +1 -1
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/hooks/useNotificationRawMarkers.d.ts +10 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/logic/notificationLegend.logic.d.ts +5 -5
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/utils/getNotificationTitlesByPropertyName.d.ts +1 -1
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/utils/notificationLegend.utils.d.ts +2 -4
- package/src/lib/feature/legend/legendStrategies/workOrderStrategy/useCreateWorkOrderMarkers.d.ts +7 -4
- package/src/lib/feature/legend/logic/displayKeys.logic.d.ts +11 -0
- package/src/lib/feature/legend/logic/legendChips.logic.d.ts +8 -0
- package/src/lib/feature/legend/logic/propertyAccessor.utils.d.ts +5 -16
- package/src/lib/feature/legend/stores/legendUIStore/legendUIStore.d.ts +2 -2
- package/src/lib/feature/legend/stores/legendUIStore/legendUIStore.types.d.ts +25 -12
- package/src/lib/feature/legend/types/legendMarkerBadge.type.d.ts +74 -11
- package/src/lib/feature/legend/types/legendStrategy.type.d.ts +10 -5
- package/src/lib/feature/legend/types/legendType.d.ts +17 -6
- package/src/lib/feature/measuringPoint/components/lastRecordedMeasurement/lastRecordedMeasurement.logic.d.ts +1 -6
- package/src/lib/feature/measuringPoint/components/lastRecordedMeasurement/lastRecordedMeasurement.types.d.ts +5 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointImageList.logic.d.ts +6 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/type/attachment.d.ts +4 -4
- package/src/lib/feature/measuringPoint/components/measuringPoints.utils.d.ts +2 -0
- package/src/lib/feature/measuringPoint/hooks/useDocumentRelationships.d.ts +1 -1
- package/src/lib/feature/measuringPoint/types/documentRelationships.d.ts +7 -7
- package/src/lib/feature/measuringPoint/types/measuringPoint.d.ts +14 -14
- package/src/lib/types/hookLibrary.d.ts +34 -22
- package/src/lib/feature/legend/components/basicLegendRenderer.logic.d.ts +0 -5
- package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByColor.d.ts +0 -34
- package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByColor.types.d.ts +0 -37
- package/src/lib/feature/legend/hooks/useGroupedMarkers.d.ts +0 -23
- package/src/lib/feature/legend/hooks/useGroupedMarkers.utils.d.ts +0 -9
- package/src/lib/feature/legend/hooks/useLegendMarker/useLegendMarker.d.ts +0 -19
- package/src/lib/feature/legend/hooks/useLegendMarker/useLegendMarker.utils.d.ts +0 -21
- package/src/lib/feature/legend/hooks/useLegendUniqueBadges.d.ts +0 -7
- package/src/lib/feature/legend/hooks/useLegendUniqueMarkers.d.ts +0 -7
- package/src/lib/feature/legend/hooks/useUniqueSelectionOnlyBadgeIdStrings.d.ts +0 -8
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/hooks/useNotificationMarkers.d.ts +0 -10
- package/src/lib/feature/legend/logic/hiddenLegendChips.logic.d.ts +0 -6
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { IocAnnotationData } from '@equinor/echo-search';
|
|
2
|
+
import { LegendStatus } from '../../../legacyLegend/legend';
|
|
3
|
+
import { type LegendId } from '../../types/legendType';
|
|
4
|
+
export declare const iocAnnotationLegendId: LegendId;
|
|
5
|
+
export type IocAnnotationDto = IocAnnotationData;
|
|
6
|
+
export type InstCode = string;
|
|
7
|
+
export type TagNo = string;
|
|
8
|
+
export type FunctionalLocation = string;
|
|
9
|
+
export type IocAnnotationTagKey = string;
|
|
10
|
+
export type IocAnnotationMarkerOptions = 'status';
|
|
11
|
+
export type IocAnnotationBadgeOptions = 'count';
|
|
12
|
+
export interface IocAnnotationTagLookup {
|
|
13
|
+
readonly tagNo: TagNo;
|
|
14
|
+
readonly instCode: InstCode;
|
|
15
|
+
}
|
|
16
|
+
export interface IocAnnotationFunctionalLocationLookup extends IocAnnotationTagLookup {
|
|
17
|
+
readonly functionalLocation: FunctionalLocation;
|
|
18
|
+
}
|
|
19
|
+
export type IocAnnotationState = LegendStatus.OnWatch | LegendStatus.InProgress | LegendStatus.IocAnnotationError | LegendStatus.Note | LegendStatus.Archived | LegendStatus.Unknown;
|
|
20
|
+
export interface IocAnnotationMarkerData {
|
|
21
|
+
readonly status: IocAnnotationState;
|
|
22
|
+
readonly tagNo: TagNo;
|
|
23
|
+
readonly iocAnnotations: ReadonlyArray<IocAnnotationDto>;
|
|
24
|
+
}
|
|
25
|
+
export type IocAnnotationMarkerDataByTagKey = ReadonlyMap<IocAnnotationTagKey, IocAnnotationMarkerData>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type LegendBadgeOptionConfig } from '../../../types/legendType';
|
|
2
|
+
import type { IocAnnotationBadgeOptions } from '../iocAnnotationStrategy.types';
|
|
3
|
+
export declare const IOC_ANNOTATION_LEGEND_BADGE_OPTIONS: ReadonlyArray<LegendBadgeOptionConfig<IocAnnotationBadgeOptions>>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { LegendMarkerOptionConfig } from '../../../types/legendType';
|
|
2
|
+
import type { IocAnnotationMarkerOptions } from '../iocAnnotationStrategy.types';
|
|
3
|
+
export declare const IOC_ANNOTATION_LEGEND_MARKER_OPTIONS: ReadonlyArray<LegendMarkerOptionConfig<IocAnnotationMarkerOptions>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { LegendDataId } from '../../../types/legendType';
|
|
2
|
-
export declare const useNotificationDetailsByIds: (itemIds: ReadonlyArray<LegendDataId>, isEnabled: boolean) => import("@tanstack/react-query").UseQueryResult<readonly import("@equinor/echo-search").NotificationDetails[]
|
|
2
|
+
export declare const useNotificationDetailsByIds: (itemIds: ReadonlyArray<LegendDataId>, isEnabled: boolean) => import("@tanstack/react-query").UseQueryResult<NoInfer<readonly import("@equinor/echo-search").NotificationDetails[]>, Error>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RawMarkerData } from '../../../types/legendMarkerBadge.type';
|
|
2
|
+
import { type LegendDataId } from '../../../types/legendType';
|
|
3
|
+
/**
|
|
4
|
+
* Creates raw notification marker data from two sources:
|
|
5
|
+
* 1. Tag-based: fetches open notifications for selected tags
|
|
6
|
+
* 2. ID-based: fetches notification details by direct notification IDs
|
|
7
|
+
*
|
|
8
|
+
* Both sources are merged into a single raw marker array.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useNotificationRawMarkers: (itemIds: ReadonlyArray<LegendDataId>) => ReadonlyArray<RawMarkerData>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RawItemAppearance, RawMarkerData } from '../../../types/legendMarkerBadge.type';
|
|
2
2
|
import type { LegendBadgeOptionConfig, LegendMarkerOptionConfig } from '../../../types/legendType';
|
|
3
3
|
import type { NotificationLegendData } from '../notificationStrategy.types';
|
|
4
|
-
interface
|
|
4
|
+
interface CreateRawMarkersFromNotificationsArgs {
|
|
5
5
|
readonly notifications: ReadonlyArray<NotificationLegendData>;
|
|
6
6
|
readonly selectedMarkerOption: LegendMarkerOptionConfig;
|
|
7
7
|
readonly selectedBadgeOption: LegendBadgeOptionConfig;
|
|
8
8
|
}
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
9
|
+
export declare const createRawMarkersFromNotifications: ({ notifications, selectedMarkerOption, selectedBadgeOption }: CreateRawMarkersFromNotificationsArgs) => ReadonlyArray<RawMarkerData>;
|
|
10
|
+
export declare const createMarkerAppearances: (titles: ReadonlyArray<string>, selectedMarkerOption: LegendMarkerOptionConfig) => ReadonlyArray<RawItemAppearance>;
|
|
11
|
+
export declare const createBadgeAppearances: (notification: NotificationLegendData, selectedBadgeOption: LegendBadgeOptionConfig) => ReadonlyArray<RawItemAppearance>;
|
|
12
12
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { NotificationLegendData } from '../notificationStrategy.types';
|
|
2
|
-
export declare function getNotificationTitlesByPropertyName(propertyName: string, notification: NotificationLegendData
|
|
2
|
+
export declare function getNotificationTitlesByPropertyName(propertyName: string, notification: NotificationLegendData): ReadonlyArray<string>;
|
|
@@ -6,11 +6,9 @@ import type { EndDateStatusText, NotificationLegendData } from '../notificationS
|
|
|
6
6
|
*/
|
|
7
7
|
export declare const isNotificationDataId: (dataId: LegendDataId) => dataId is LegendNotificationId;
|
|
8
8
|
/**
|
|
9
|
-
* Determines the appropriate icon name for a marker based on the record
|
|
10
|
-
* If there are multiple record types or no notifications, it returns a generic icon.
|
|
11
|
-
* Otherwise, it returns a specific icon based on the record type.
|
|
9
|
+
* Determines the appropriate icon name for a marker based on the record type
|
|
12
10
|
*/
|
|
13
|
-
export declare const getIconForMarker: (
|
|
11
|
+
export declare const getIconForMarker: (notification: NotificationLegendData) => string;
|
|
14
12
|
/**
|
|
15
13
|
* Returns user-friendly end date status text based on the required end date of a notification.
|
|
16
14
|
*/
|
package/src/lib/feature/legend/legendStrategies/workOrderStrategy/useCreateWorkOrderMarkers.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RawMarkerData } from '../../types/legendMarkerBadge.type';
|
|
2
2
|
import { LegendDataId } from '../../types/legendType';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* // TODO: #426625 - Fix marker and badge appearances to be based on work order properties instead of hardcoded values.
|
|
5
|
+
*
|
|
6
|
+
* Creates raw legend marker data for work orders grouped by `tagId`.
|
|
5
7
|
*
|
|
6
8
|
* The hook:
|
|
7
9
|
* \- filters `itemIds` to tag selections,
|
|
@@ -10,8 +12,9 @@ import { LegendDataId } from '../../types/legendType';
|
|
|
10
12
|
* \- maps each group to a purple marker with orange badges (one per work order).
|
|
11
13
|
*
|
|
12
14
|
* Badge titles are derived from `workOrderId` using `removeLeadingZeros`.
|
|
15
|
+
* DisplayKeys and highlight colors are computed in useLegendMarker.
|
|
13
16
|
*
|
|
14
17
|
* @param itemIds \- Current legend selection ids.
|
|
15
|
-
* @returns An array of `
|
|
18
|
+
* @returns An array of `RawMarkerData` objects, or an empty array when no data is available.
|
|
16
19
|
*/
|
|
17
|
-
export declare const useCreateWorkOrderMarkers: (itemIds: ReadonlyArray<LegendDataId>) =>
|
|
20
|
+
export declare const useCreateWorkOrderMarkers: (itemIds: ReadonlyArray<LegendDataId>) => ReadonlyArray<RawMarkerData>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LegendDisplayKey } from '../stores/legendUIStore/legendUIStore.types';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a display key for a legend item from title and color.
|
|
4
|
+
* Plain-label markers use 'transparent' instead of actual color so toggling is color-independent.
|
|
5
|
+
*/
|
|
6
|
+
export declare const createDisplayKey: (title: string, color: string, showAsPlainLabel?: boolean) => LegendDisplayKey;
|
|
7
|
+
/**
|
|
8
|
+
* Creates a combined display key from multiple display keys.
|
|
9
|
+
* Used when multiple markers are combined into one.
|
|
10
|
+
*/
|
|
11
|
+
export declare const createCombinedDisplayKey: (displayKeys: ReadonlyArray<LegendDisplayKey>) => LegendDisplayKey;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LegendChipProps } from '@equinor/echo-components';
|
|
2
|
+
import type { LegendChipData, RawMarkerData, ToggleableItem } from '../types/legendMarkerBadge.type';
|
|
3
|
+
import type { LegendId } from '../types/legendType';
|
|
4
|
+
export declare const toChipProps: (chip: LegendChipData, hiddenItems: ReadonlyArray<string>, legendId: LegendId) => LegendChipProps;
|
|
5
|
+
export declare const toMarkerChipData: (rawMarker: RawMarkerData) => ReadonlyArray<LegendChipData>;
|
|
6
|
+
export declare const toBadgeChipData: (rawMarker: RawMarkerData) => ReadonlyArray<LegendChipData>;
|
|
7
|
+
export declare function isHiddenItem(item: ToggleableItem, hiddenItems: ReadonlyArray<string>): boolean;
|
|
8
|
+
export declare const setHiddenItem: (item: ToggleableItem, isHidden: boolean, legendId: LegendId) => void;
|
|
@@ -2,35 +2,24 @@
|
|
|
2
2
|
* Property accessor function type that returns all values as an array.
|
|
3
3
|
* Takes an item and optional context (like a collection) and returns string values.
|
|
4
4
|
*/
|
|
5
|
-
export type PropertyAccessor<TItem
|
|
5
|
+
export type PropertyAccessor<TItem> = (item: TItem) => ReadonlyArray<string>;
|
|
6
6
|
/**
|
|
7
7
|
* Creates an accessor that extracts a string property value as a single-element array.
|
|
8
8
|
* Returns empty array if the value is empty or not a string.
|
|
9
9
|
*/
|
|
10
|
-
export declare function createStringAccessor<TItem>(property: keyof TItem): PropertyAccessor<TItem
|
|
10
|
+
export declare function createStringAccessor<TItem>(property: keyof TItem): PropertyAccessor<TItem>;
|
|
11
11
|
/**
|
|
12
12
|
* Creates an accessor that returns all elements from an array property.
|
|
13
13
|
* Returns empty array if the property is not an array.
|
|
14
14
|
*/
|
|
15
|
-
export declare function createArrayAccessor<TItem>(property: keyof TItem): PropertyAccessor<TItem
|
|
15
|
+
export declare function createArrayAccessor<TItem>(property: keyof TItem): PropertyAccessor<TItem>;
|
|
16
16
|
/**
|
|
17
17
|
* Creates an accessor that converts a Date property to ISO string as a single-element array.
|
|
18
18
|
* Returns empty array if the value is not a Date.
|
|
19
19
|
*/
|
|
20
|
-
export declare function createDateAccessor<TItem>(property: keyof TItem): PropertyAccessor<TItem
|
|
21
|
-
/**
|
|
22
|
-
* Creates a count accessor that returns the size of the context collection.
|
|
23
|
-
*/
|
|
24
|
-
export declare function createCountAccessor<TItem>(): PropertyAccessor<TItem, ReadonlyArray<TItem>>;
|
|
20
|
+
export declare function createDateAccessor<TItem>(property: keyof TItem): PropertyAccessor<TItem>;
|
|
25
21
|
/**
|
|
26
22
|
* Looks up property values using a map of accessors.
|
|
27
23
|
* Returns empty array if the property is not found in the accessor map.
|
|
28
24
|
*/
|
|
29
|
-
export declare function getPropertyValues<TItem
|
|
30
|
-
/**
|
|
31
|
-
* Normalizes an array of values to a single display title:
|
|
32
|
-
* - Empty array → "Unknown"
|
|
33
|
-
* - Single unique value → that value
|
|
34
|
-
* - Multiple unique values → "Multiple"
|
|
35
|
-
*/
|
|
36
|
-
export declare function toSingleTitle(values: ReadonlyArray<string>): string;
|
|
25
|
+
export declare function getPropertyValues<TItem>(item: TItem, propertyName: string, accessors: Readonly<Record<string, PropertyAccessor<TItem>>>): ReadonlyArray<string>;
|
|
@@ -21,9 +21,9 @@ export declare const useLegendUIStore: UseBoundStore<StoreApi<LegendUIStore>>;
|
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* // Watch multiple specific properties:
|
|
24
|
-
* const { isAccordionExpanded,
|
|
24
|
+
* const { isAccordionExpanded, hiddenItems } = useLegendUIById('Tag Legend', useShallow((legend) => ({
|
|
25
25
|
* isAccordionExpanded: legend?.isAccordionExpanded,
|
|
26
|
-
*
|
|
26
|
+
* hiddenItems: legend?.hiddenItems
|
|
27
27
|
* })));
|
|
28
28
|
*/
|
|
29
29
|
export declare function useLegendUIById(legendId: LegendId): LegendUIState | undefined;
|
|
@@ -1,18 +1,36 @@
|
|
|
1
|
+
import type { Brand } from '@equinor/echo-utils';
|
|
1
2
|
import type { MarkerId } from '../../../shared/markerId.types';
|
|
2
3
|
import { LegendId } from '../../types/legendType';
|
|
3
4
|
export type { SelectionBarFeedbackType } from '@equinor/echo-components';
|
|
4
5
|
export type LegendFeedbackVariant = 'error' | 'info' | 'warning';
|
|
6
|
+
/**
|
|
7
|
+
* Identifies a marker/badge appearance in the legend list.
|
|
8
|
+
* Produced by `createDisplayKey` / `createCombinedDisplayKey`.
|
|
9
|
+
* Format: `title-color`, `title-transparent`, or pipe-joined combinations.
|
|
10
|
+
*/
|
|
11
|
+
export type LegendDisplayKey = Brand<string, 'LegendDisplayKey'>;
|
|
12
|
+
/**
|
|
13
|
+
* Identifies a selection group row in the Selection Legend.
|
|
14
|
+
* Produced by `createSelectionGroupKey` (plus the `NOT_IN_SELECTION_GROUP_KEY` sentinel).
|
|
15
|
+
* Format: `group_<guid>_<color>` (optionally with `_<itemType>` for Local Selection).
|
|
16
|
+
*/
|
|
17
|
+
export type LegendSelectionGroupKey = Brand<string, 'LegendSelectionGroupKey'>;
|
|
18
|
+
/**
|
|
19
|
+
* Any key that can be stored in `LegendUIState.hiddenItems` to toggle visibility.
|
|
20
|
+
* The legend store is format-agnostic; specific producers/consumers should use
|
|
21
|
+
* the narrower `LegendDisplayKey` or `LegendSelectionGroupKey` types instead.
|
|
22
|
+
*/
|
|
23
|
+
export type ToggleableLegend = LegendDisplayKey | LegendSelectionGroupKey;
|
|
24
|
+
export type MarkersOutsideSelectionVisibility = 'show' | 'ghost' | 'hide';
|
|
5
25
|
export interface LegendUIState {
|
|
6
26
|
readonly accordionFeedback?: {
|
|
7
27
|
message: string;
|
|
8
28
|
variant?: LegendFeedbackVariant;
|
|
9
29
|
};
|
|
10
30
|
readonly isAccordionExpanded: boolean;
|
|
11
|
-
readonly
|
|
12
|
-
readonly hiddenBadges: string[];
|
|
31
|
+
readonly hiddenItems: ToggleableLegend[];
|
|
13
32
|
}
|
|
14
33
|
export type LegendUIDictionary = Record<LegendId, LegendUIState>;
|
|
15
|
-
export type MarkersOutsideSelectionVisibility = 'show' | 'ghost' | 'hide';
|
|
16
34
|
export type LegendUIStoreValues = {
|
|
17
35
|
readonly legends: LegendUIDictionary;
|
|
18
36
|
readonly activePopover: {
|
|
@@ -26,21 +44,16 @@ export type LegendUIStoreValues = {
|
|
|
26
44
|
};
|
|
27
45
|
export interface LegendUIStoreActions {
|
|
28
46
|
toggleAccordion: (legendId: LegendId, newValue: boolean) => void;
|
|
29
|
-
|
|
47
|
+
setHiddenLegendItem: (args: {
|
|
30
48
|
legendId: LegendId;
|
|
31
|
-
|
|
49
|
+
item: ToggleableLegend;
|
|
32
50
|
isHidden: boolean;
|
|
33
51
|
}) => void;
|
|
34
|
-
|
|
52
|
+
setHiddenLegendItemsBatch: (updates: Array<{
|
|
35
53
|
legendId: LegendId;
|
|
36
|
-
|
|
54
|
+
item: ToggleableLegend;
|
|
37
55
|
isHidden: boolean;
|
|
38
56
|
}>) => void;
|
|
39
|
-
setHiddenBadge: (args: {
|
|
40
|
-
legendId: LegendId;
|
|
41
|
-
badge: string;
|
|
42
|
-
isHidden: boolean;
|
|
43
|
-
}) => void;
|
|
44
57
|
setMarkersOutsideSelectionVisibility: (visibility: MarkersOutsideSelectionVisibility) => void;
|
|
45
58
|
initializeLegendInStore: (legendId: LegendId) => void;
|
|
46
59
|
setSelectionLegendIsHighlightVisible: (visible: boolean) => void;
|
|
@@ -1,24 +1,87 @@
|
|
|
1
|
+
import type { LegendDisplayKey, LegendSelectionGroupKey } from '../stores/legendUIStore/legendUIStore.types';
|
|
1
2
|
import type { LegendDataId } from './legendType';
|
|
2
|
-
export interface
|
|
3
|
+
export interface RawItemAppearance {
|
|
4
|
+
readonly getTitle: () => string;
|
|
5
|
+
readonly getColor: () => string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Raw marker data from strategy. Contains the source information and marker data.
|
|
9
|
+
*/
|
|
10
|
+
export interface RawMarkerData {
|
|
11
|
+
readonly getIcon: () => string;
|
|
12
|
+
/**
|
|
13
|
+
* Possible appearances for marker fill, based on selectedMarkerOption.
|
|
14
|
+
*/
|
|
15
|
+
readonly markerAppearances: ReadonlyArray<RawItemAppearance>;
|
|
16
|
+
/**
|
|
17
|
+
* Possible appearances for badges, based on selectedBadgeOption.
|
|
18
|
+
*/
|
|
19
|
+
readonly badgeAppearances: ReadonlyArray<RawItemAppearance>;
|
|
20
|
+
/** The specific item ID this marker represents - used for popover content and selection lookup */
|
|
21
|
+
readonly itemId: LegendDataId;
|
|
22
|
+
/**
|
|
23
|
+
* When true, renders as plain text instead of a colored chip in the legend panel.
|
|
24
|
+
* Typically used to display informational messages to the user, such as enable syncing.
|
|
25
|
+
*/
|
|
26
|
+
readonly showAsPlainLabel?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Minimal interface for items that can be toggled (hidden/shown) in the legend panel.
|
|
30
|
+
*/
|
|
31
|
+
export interface ToggleableItem {
|
|
32
|
+
readonly getDisplayKey: () => LegendDisplayKey;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Lightweight data for rendering a legend chip and tracking toggle state.
|
|
36
|
+
*/
|
|
37
|
+
export interface LegendChipData extends ToggleableItem {
|
|
38
|
+
readonly title: string;
|
|
39
|
+
readonly color: string;
|
|
40
|
+
readonly showAsPlainLabel?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Processed badge with computed displayKey.
|
|
44
|
+
* Created from RawItemAppearance in useLegendMarker.
|
|
45
|
+
* All properties are getter functions for consistent API with Marker.
|
|
46
|
+
*/
|
|
47
|
+
export interface Badge extends ToggleableItem {
|
|
48
|
+
getTitle(): string;
|
|
49
|
+
getColor(): string;
|
|
50
|
+
/**
|
|
51
|
+
* Item ID shared from original raw marker. Needed for display options (mode=ID)
|
|
52
|
+
*/
|
|
53
|
+
getItemId(): LegendDataId;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Final marker output consumed by rendering. Contains only display-relevant data.
|
|
57
|
+
* Created from RawMarkerData in useLegendMarker, potentially split by highlight color.
|
|
58
|
+
*/
|
|
59
|
+
export interface CombinedMarker extends ToggleableItem {
|
|
3
60
|
getTitle: () => string;
|
|
4
61
|
getColor: () => string;
|
|
5
62
|
getIcon: () => string;
|
|
6
|
-
|
|
63
|
+
/** Selection highlight color */
|
|
7
64
|
getHighlightColor: () => string;
|
|
8
|
-
|
|
65
|
+
/** Badges merged from raw markers data */
|
|
66
|
+
getBadges: () => ReadonlyArray<Badge>;
|
|
67
|
+
/** The item IDs this combined marker represents - used for popover content */
|
|
68
|
+
getItemIds: () => ReadonlyArray<LegendDataId>;
|
|
9
69
|
/**
|
|
10
70
|
* When true, renders as plain text instead of a colored chip in the legend panel.
|
|
11
71
|
* Typically used to display informational messages to the user, such as enable syncing.
|
|
12
72
|
*/
|
|
13
|
-
showAsPlainLabel?: boolean;
|
|
73
|
+
readonly showAsPlainLabel?: boolean;
|
|
14
74
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Intermediate marker used during pipeline processing.
|
|
77
|
+
* Extends CombinedMarker with appearance data needed for per-appearance counting and grouping.
|
|
78
|
+
*/
|
|
79
|
+
export interface ProcessedMarker extends CombinedMarker {
|
|
80
|
+
/** Individual marker appearances used for per-appearance counting */
|
|
81
|
+
getMarkerAppearances: () => ReadonlyArray<RawItemAppearance>;
|
|
18
82
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
83
|
+
* Selection group key for toggle tracking (selection legend toggles).
|
|
84
|
+
* Used to determine if this marker should be hidden when a selection group is toggled off.
|
|
21
85
|
*/
|
|
22
|
-
|
|
23
|
-
getItemId: () => LegendDataId;
|
|
86
|
+
getSelectionGroupKey: () => LegendSelectionGroupKey;
|
|
24
87
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RawMarkerData } from './legendMarkerBadge.type';
|
|
2
2
|
import { LegendBadgeOptionConfig, LegendDataId, LegendId, LegendMarkerOptionConfig } from './legendType';
|
|
3
3
|
/**
|
|
4
4
|
* A general interface for the legend strategy. This enables us to automatically render all the legend ui parts: the ui with selectable options, the markers & the badges.
|
|
@@ -20,13 +20,13 @@ export interface LegendStrategy {
|
|
|
20
20
|
*/
|
|
21
21
|
badgeOptions?: ReadonlyArray<LegendBadgeOptionConfig>;
|
|
22
22
|
/**
|
|
23
|
-
* Returns
|
|
24
|
-
*
|
|
23
|
+
* Returns raw marker data for each incoming itemId.
|
|
24
|
+
* Contains the source information and marker data needed to render markers and badges, as well as popover content.
|
|
25
25
|
*
|
|
26
26
|
* @param itemIds - The legend data IDs to create markers for
|
|
27
|
-
* @returns Array of
|
|
27
|
+
* @returns Array of raw marker data, one per incoming itemId
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
useRawMarkers: (itemIds: ReadonlyArray<LegendDataId>) => ReadonlyArray<RawMarkerData>;
|
|
30
30
|
/**
|
|
31
31
|
* Returns popover content that supports pagination for the given legendDataId.
|
|
32
32
|
* One legendDataId can have multiple items associated with it, for example a tag can have multiple work orders.
|
|
@@ -43,4 +43,9 @@ export interface LegendStrategy {
|
|
|
43
43
|
* Returns the custom legend component for the legend, if this is omitted the default basicLegendRenderer will be used
|
|
44
44
|
*/
|
|
45
45
|
customLegendComponent?: () => React.JSX.Element;
|
|
46
|
+
/**
|
|
47
|
+
* When rendering multiple markers for a single legend item (eg. when a tag has multiple work orders), we show a combined marker instead of multiple individual markers to avoid clutter.
|
|
48
|
+
* This property defines the icon to use for the combined marker. If not provided, a default icon will be used.
|
|
49
|
+
*/
|
|
50
|
+
readonly combinedMarkerIcon: string;
|
|
46
51
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { NotificationDto } from '@equinor/echo-search';
|
|
2
2
|
import { Brand } from '@equinor/echo-utils';
|
|
3
3
|
import { GlobalSelectionTypes } from '../../globalSelection';
|
|
4
|
-
export type KnownLegendIds = 'Equipment Legend' | 'Tag Legend' | 'Work Order Legend' | 'Notification Legend';
|
|
4
|
+
export type KnownLegendIds = 'Equipment Legend' | 'Tag Legend' | 'Work Order Legend' | 'Notification Legend' | 'IOC Annotation Legend';
|
|
5
5
|
export type LegendId = KnownLegendIds | Brand<string, 'LegendId'>;
|
|
6
6
|
export type LegendDataIdString = Brand<string, 'LegendDataIdString'>;
|
|
7
7
|
export declare const knownLegendIds: {
|
|
8
|
-
equipmentLegendId:
|
|
9
|
-
tagLegendId:
|
|
10
|
-
workOrderLegendId:
|
|
11
|
-
notificationLegendId:
|
|
8
|
+
equipmentLegendId: "Equipment Legend";
|
|
9
|
+
tagLegendId: "Tag Legend";
|
|
10
|
+
workOrderLegendId: "Work Order Legend";
|
|
11
|
+
notificationLegendId: "Notification Legend";
|
|
12
|
+
iocAnnotationLegendId: "IOC Annotation Legend";
|
|
12
13
|
};
|
|
13
14
|
export interface LegendState<MarkerOptionType = string, BadgeOptionType = string> {
|
|
14
15
|
readonly legendId: LegendId;
|
|
@@ -21,6 +22,10 @@ export type LegendTagId = GlobalSelectionTypes.TagId;
|
|
|
21
22
|
export type LegendEquipmentId = GlobalSelectionTypes.EquipmentId;
|
|
22
23
|
export type LegendWorkOrderId = GlobalSelectionTypes.WorkOrderId;
|
|
23
24
|
export type LegendNotificationId = Pick<NotificationDto, 'maintenanceRecordId'>;
|
|
25
|
+
export type LegendIocAnnotationId = {
|
|
26
|
+
readonly iocAnnotationId: number;
|
|
27
|
+
readonly tagNo: string;
|
|
28
|
+
};
|
|
24
29
|
/**
|
|
25
30
|
* Union of LegendDataId types that correspond to global selection item IDs.
|
|
26
31
|
* These can be safely used with globalSelectionUtils.
|
|
@@ -30,7 +35,7 @@ export type LegendNotificationId = Pick<NotificationDto, 'maintenanceRecordId'>;
|
|
|
30
35
|
* 2. Go to legendDataId.utils.ts and update selectionGuards (this will cause a compile error until you add a guard for the new type)
|
|
31
36
|
*/
|
|
32
37
|
export type GlobalSelectionLegendDataId = LegendTagId | LegendEquipmentId | LegendWorkOrderId;
|
|
33
|
-
export type NonGlobalSelectionLegendDataId = LegendNotificationId;
|
|
38
|
+
export type NonGlobalSelectionLegendDataId = LegendNotificationId | LegendIocAnnotationId;
|
|
34
39
|
export type LegendDataId = GlobalSelectionLegendDataId | NonGlobalSelectionLegendDataId;
|
|
35
40
|
/**
|
|
36
41
|
* Base configuration for legend options (markers and badges).
|
|
@@ -41,6 +46,7 @@ interface LegendOptionConfigBase<T = string> {
|
|
|
41
46
|
readonly showChipsInViewportOnly?: boolean;
|
|
42
47
|
}
|
|
43
48
|
export type LegendMarkerOptionConfig<T = string> = LegendOptionConfigBase<T>;
|
|
49
|
+
export type LegendBadgeColorMode = 'status' | 'marker';
|
|
44
50
|
/**
|
|
45
51
|
* Configuration for badge options. Badges can have display options to control
|
|
46
52
|
* how badge text is rendered (displayName, id, or count).
|
|
@@ -48,6 +54,11 @@ export type LegendMarkerOptionConfig<T = string> = LegendOptionConfigBase<T>;
|
|
|
48
54
|
export interface LegendBadgeOptionConfig<T = string> extends LegendOptionConfigBase<T> {
|
|
49
55
|
readonly enableDisplayOptions?: boolean;
|
|
50
56
|
readonly displayOption?: LegendOptionDisplayOption;
|
|
57
|
+
/**
|
|
58
|
+
* Controls how badge color is determined. 'status' uses the same status color resolver as markers, while 'marker' inherits the marker color.
|
|
59
|
+
* When set to 'marker', the generic processRawBadges resolves badge color from marker appearances automatically.
|
|
60
|
+
*/
|
|
61
|
+
readonly badgeColorMode?: LegendBadgeColorMode;
|
|
51
62
|
}
|
|
52
63
|
export type LegendOptionConfig<T = string> = LegendMarkerOptionConfig<T> | LegendBadgeOptionConfig<T>;
|
|
53
64
|
export declare const ID_MODE_KEYWORD = "id";
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import { MeasurementDto } from '../../types/measuringPoint';
|
|
2
|
-
|
|
3
|
-
conditionAsText: string | undefined;
|
|
4
|
-
measurementDateTime: string | undefined;
|
|
5
|
-
codeAsText: string | undefined;
|
|
6
|
-
lastRecordedMeasurement: MeasurementDto | undefined;
|
|
7
|
-
};
|
|
2
|
+
import type { LastRecordedMeasurementData } from './lastRecordedMeasurement.types';
|
|
8
3
|
export declare const getLastRecordedMeasurement: (measurements: MeasurementDto[]) => LastRecordedMeasurementData;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LastRecordedMeasurementInfo } from '@equinor/echo-components';
|
|
2
|
+
import type { MeasurementDto } from '../../types/measuringPoint';
|
|
3
|
+
export type LastRecordedMeasurementData = LastRecordedMeasurementInfo & {
|
|
4
|
+
readonly lastRecordedMeasurement: MeasurementDto | undefined;
|
|
5
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DocumentRelationships } from '../../types/documentRelationships';
|
|
2
|
+
import type { Attachment } from './type/attachment';
|
|
3
|
+
export declare function extractValidAttachmentsFromDocumentRelationships(documentRelationships: DocumentRelationships[]): {
|
|
4
|
+
documentId: string;
|
|
5
|
+
attachments: Attachment[];
|
|
6
|
+
}[];
|
package/src/lib/feature/measuringPoint/components/measuringPointDetails/type/attachment.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export interface Attachment {
|
|
2
|
-
attachmentImageUri
|
|
3
|
-
createdDateTime
|
|
4
|
-
quantitativeReading: number;
|
|
5
|
-
quantitativeReadingUnitId: string;
|
|
2
|
+
readonly attachmentImageUri: string | undefined;
|
|
3
|
+
readonly createdDateTime: string | undefined;
|
|
4
|
+
readonly quantitativeReading: number | undefined;
|
|
5
|
+
readonly quantitativeReadingUnitId: string | undefined;
|
|
6
6
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MeasurementDto, MeasuringPointDto } from '../types/measuringPoint';
|
|
2
|
+
import type { Attachment } from './measuringPointDetails/type/attachment';
|
|
2
3
|
type FailureMechanismIdAndValue = {
|
|
3
4
|
id: string;
|
|
4
5
|
value: string;
|
|
@@ -16,4 +17,5 @@ export declare function getFailureMechanismConfigValues({ measurement, quantitat
|
|
|
16
17
|
export declare function getFailureMechanismIdAndValue({ measurement, quantitativeCharacteristicId }: FailureMechanismParams): FailureMechanismIdAndValue | undefined;
|
|
17
18
|
export declare const getLatestMeasurementDate: (point: MeasuringPointDto) => Date | undefined;
|
|
18
19
|
export declare const sortMeasuringPointsByMeasurementDate: (a: MeasuringPointDto, b: MeasuringPointDto) => number;
|
|
20
|
+
export declare function getReportedConditionValueFromAttachment(attachment: Attachment): string;
|
|
19
21
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare function useDocumentRelationships(measuringPointId: string): {
|
|
2
2
|
status: "error" | "success" | "pending";
|
|
3
|
-
documentRelationships: import("..").DocumentRelationships[]
|
|
3
|
+
documentRelationships: NoInfer<import("..").DocumentRelationships[]>;
|
|
4
4
|
error: Error | null;
|
|
5
5
|
totalAttachments: string;
|
|
6
6
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export interface DocumentRelationships {
|
|
2
2
|
readonly documentId: string;
|
|
3
|
-
readonly characteristics
|
|
4
|
-
readonly attachments
|
|
3
|
+
readonly characteristics: DocumentRelationshipsCharacteristics[] | undefined;
|
|
4
|
+
readonly attachments: DocumentRelationshipsAttachment[] | undefined;
|
|
5
5
|
}
|
|
6
6
|
interface DocumentRelationshipsAttachment {
|
|
7
7
|
readonly attachmentId: string;
|
|
8
|
-
readonly attachmentImageUri
|
|
9
|
-
readonly createdDateTime
|
|
10
|
-
readonly quantitativeReading: number;
|
|
11
|
-
readonly quantitativeReadingUnitId: string;
|
|
8
|
+
readonly attachmentImageUri: string | undefined;
|
|
9
|
+
readonly createdDateTime: string | undefined;
|
|
10
|
+
readonly quantitativeReading: number | undefined;
|
|
11
|
+
readonly quantitativeReadingUnitId: string | undefined;
|
|
12
12
|
}
|
|
13
13
|
interface DocumentRelationshipsCharacteristics {
|
|
14
|
-
readonly valueId
|
|
14
|
+
readonly valueId: string | undefined;
|
|
15
15
|
}
|
|
16
16
|
export {};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { MeasuringPointData } from '@equinor/echo-search';
|
|
2
2
|
export interface MeasurementDto {
|
|
3
|
-
measurementId: string;
|
|
4
|
-
measuringPointId: string;
|
|
5
|
-
measurementDateTime
|
|
6
|
-
measurementTitle
|
|
7
|
-
longTextExists
|
|
8
|
-
createdDateTime
|
|
9
|
-
maintenanceRecordId
|
|
10
|
-
workOrderId
|
|
11
|
-
quantitativeReadingInSIUnit
|
|
12
|
-
quantitativeReading
|
|
13
|
-
quantitativeReadingUnitId
|
|
14
|
-
qualitativeCodeGroupId
|
|
15
|
-
qualitativeCodeId
|
|
16
|
-
longText
|
|
3
|
+
readonly measurementId: string;
|
|
4
|
+
readonly measuringPointId: string;
|
|
5
|
+
readonly measurementDateTime: string | undefined;
|
|
6
|
+
readonly measurementTitle: string | undefined;
|
|
7
|
+
readonly longTextExists: string | undefined;
|
|
8
|
+
readonly createdDateTime: string | undefined;
|
|
9
|
+
readonly maintenanceRecordId: string | undefined;
|
|
10
|
+
readonly workOrderId: string | undefined;
|
|
11
|
+
readonly quantitativeReadingInSIUnit: number | undefined;
|
|
12
|
+
readonly quantitativeReading: number | undefined;
|
|
13
|
+
readonly quantitativeReadingUnitId: string | undefined;
|
|
14
|
+
readonly qualitativeCodeGroupId: string | undefined;
|
|
15
|
+
readonly qualitativeCodeId: string | undefined;
|
|
16
|
+
readonly longText: object | undefined;
|
|
17
17
|
}
|
|
18
18
|
export interface MeasuringPointDto extends MeasuringPointData {
|
|
19
19
|
readonly measurements: MeasurementDto[];
|