@equinor/echo-framework 0.10.1 → 0.10.3

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.
Files changed (100) hide show
  1. package/dist/__tests__/prepviewUtils.test.d.ts +1 -0
  2. package/dist/components/containers/layouts.d.ts +1 -1
  3. package/dist/components/index.d.ts +1 -0
  4. package/dist/components/prepview/Prepview.d.ts +10 -0
  5. package/dist/components/prepview/api/api.d.ts +4 -0
  6. package/dist/components/prepview/api/index.d.ts +1 -0
  7. package/dist/components/prepview/api/resources.d.ts +2 -0
  8. package/dist/components/prepview/api/workorder.d.ts +2 -0
  9. package/dist/components/prepview/common/access/handler/StatusHandler.d.ts +8 -0
  10. package/dist/components/prepview/common/access/handler/index.d.ts +1 -0
  11. package/dist/components/prepview/common/access/index.d.ts +2 -0
  12. package/dist/components/prepview/common/access/request/RequestAccess.d.ts +6 -0
  13. package/dist/components/prepview/common/access/request/index.d.ts +1 -0
  14. package/dist/components/prepview/common/collapsiblePanel/CollapsiblePanel.d.ts +10 -0
  15. package/dist/components/prepview/common/collapsiblePanel/index.d.ts +1 -0
  16. package/dist/components/prepview/common/details/accordion/DetailsAccordion.d.ts +8 -0
  17. package/dist/components/prepview/common/details/accordion/index.d.ts +1 -0
  18. package/dist/components/prepview/common/details/index.d.ts +3 -0
  19. package/dist/components/prepview/common/details/loader/DetailsLoader.d.ts +3 -0
  20. package/dist/components/prepview/common/details/loader/index.d.ts +1 -0
  21. package/dist/components/prepview/common/details/panel/DetailsPanel.d.ts +9 -0
  22. package/dist/components/prepview/common/details/panel/EmptyDetailsPanel.d.ts +6 -0
  23. package/dist/components/prepview/common/details/panel/description/PanelDescription.d.ts +6 -0
  24. package/dist/components/prepview/common/details/panel/description/index.d.ts +1 -0
  25. package/dist/components/prepview/common/details/panel/index.d.ts +3 -0
  26. package/dist/components/prepview/common/fileSizeDisplay/FileSizeDisplay.d.ts +11 -0
  27. package/dist/components/prepview/common/fileSizeDisplay/index.d.ts +1 -0
  28. package/dist/components/prepview/common/index.d.ts +5 -0
  29. package/dist/components/prepview/common/info/block/InfoBlock.d.ts +8 -0
  30. package/dist/components/prepview/common/info/block/index.d.ts +1 -0
  31. package/dist/components/prepview/common/info/index.d.ts +2 -0
  32. package/dist/components/prepview/common/info/section/InfoSection.d.ts +6 -0
  33. package/dist/components/prepview/common/info/section/index.d.ts +2 -0
  34. package/dist/components/prepview/common/info/section/longText/LongTextSection.d.ts +6 -0
  35. package/dist/components/prepview/common/info/section/longText/index.d.ts +1 -0
  36. package/dist/components/prepview/hooks/index.d.ts +2 -0
  37. package/dist/components/prepview/hooks/useFetch.d.ts +4 -0
  38. package/dist/components/prepview/hooks/useOnClickDownload.d.ts +9 -0
  39. package/dist/components/prepview/index.d.ts +1 -0
  40. package/dist/components/prepview/panels/attachments/Attachments.d.ts +9 -0
  41. package/dist/components/prepview/panels/attachments/index.d.ts +1 -0
  42. package/dist/components/prepview/panels/history/TagHistory.d.ts +9 -0
  43. package/dist/components/prepview/panels/history/group/TagHistoryGroup.d.ts +10 -0
  44. package/dist/components/prepview/panels/history/group/index.d.ts +1 -0
  45. package/dist/components/prepview/panels/history/index.d.ts +1 -0
  46. package/dist/components/prepview/panels/history/items/Items.d.ts +11 -0
  47. package/dist/components/prepview/panels/history/items/NotificationItem.d.ts +7 -0
  48. package/dist/components/prepview/panels/history/items/PunchItem.d.ts +7 -0
  49. package/dist/components/prepview/panels/history/items/WorkOrderItem.d.ts +7 -0
  50. package/dist/components/prepview/panels/history/items/index.d.ts +1 -0
  51. package/dist/components/prepview/panels/index.d.ts +7 -0
  52. package/dist/components/prepview/panels/objects/Objects.d.ts +7 -0
  53. package/dist/components/prepview/panels/objects/index.d.ts +1 -0
  54. package/dist/components/prepview/panels/operations/Operations.d.ts +7 -0
  55. package/dist/components/prepview/panels/operations/index.d.ts +1 -0
  56. package/dist/components/prepview/panels/risk/Risk.d.ts +8 -0
  57. package/dist/components/prepview/panels/risk/actions/RiskActions.d.ts +6 -0
  58. package/dist/components/prepview/panels/risk/actions/index.d.ts +1 -0
  59. package/dist/components/prepview/panels/risk/index.d.ts +1 -0
  60. package/dist/components/prepview/panels/risk/item/RiskItem.d.ts +7 -0
  61. package/dist/components/prepview/panels/risk/item/index.d.ts +1 -0
  62. package/dist/components/prepview/panels/risk/trafficLight/TrafficLight.d.ts +7 -0
  63. package/dist/components/prepview/panels/risk/trafficLight/index.d.ts +1 -0
  64. package/dist/components/prepview/panels/tagDocumentRefs/TagDocumentGroup.d.ts +10 -0
  65. package/dist/components/prepview/panels/tagDocumentRefs/TagDocumentItem.d.ts +9 -0
  66. package/dist/components/prepview/panels/tagDocumentRefs/TagDocumentRefs.d.ts +9 -0
  67. package/dist/components/prepview/panels/tagDocumentRefs/index.d.ts +1 -0
  68. package/dist/components/prepview/panels/tagInformation/TagInformation.d.ts +11 -0
  69. package/dist/components/prepview/panels/tagInformation/UnsafeFailure.d.ts +7 -0
  70. package/dist/components/prepview/panels/tagInformation/index.d.ts +1 -0
  71. package/dist/components/prepview/types/attachment.d.ts +7 -0
  72. package/dist/components/prepview/types/document.d.ts +13 -0
  73. package/dist/components/prepview/types/index.d.ts +8 -0
  74. package/dist/components/prepview/types/notification.d.ts +10 -0
  75. package/dist/components/prepview/types/operation.d.ts +12 -0
  76. package/dist/components/prepview/types/punch.d.ts +8 -0
  77. package/dist/components/prepview/types/safety.d.ts +21 -0
  78. package/dist/components/prepview/types/tag.d.ts +24 -0
  79. package/dist/components/prepview/types/workorder.d.ts +80 -0
  80. package/dist/components/prepview/utils/date.d.ts +5 -0
  81. package/dist/components/prepview/utils/documents.d.ts +1 -0
  82. package/dist/components/prepview/utils/dom.d.ts +1 -0
  83. package/dist/components/prepview/utils/enums/documents.d.ts +14 -0
  84. package/dist/components/prepview/utils/enums/index.d.ts +2 -0
  85. package/dist/components/prepview/utils/enums/tagHistoryItem.d.ts +5 -0
  86. package/dist/components/prepview/utils/index.d.ts +8 -0
  87. package/dist/components/prepview/utils/logger.d.ts +71 -0
  88. package/dist/components/prepview/utils/object.d.ts +1 -0
  89. package/dist/components/prepview/utils/url.d.ts +8 -0
  90. package/dist/components/prepview/utils/workorder.d.ts +1 -0
  91. package/dist/components/prepview/workorder/additionalDetails/AdditionalDetails.d.ts +9 -0
  92. package/dist/components/prepview/workorder/additionalDetails/index.d.ts +1 -0
  93. package/dist/components/prepview/workorder/details/Details.d.ts +9 -0
  94. package/dist/components/prepview/workorder/details/index.d.ts +1 -0
  95. package/dist/components/prepview/workorder/index.d.ts +8 -0
  96. package/dist/index.js +3 -3
  97. package/dist/services/api/api-manager.d.ts +10 -2
  98. package/dist/utils/index.d.ts +1 -0
  99. package/dist/utils/searchUtil.d.ts +1 -0
  100. package/package.json +3 -2
@@ -0,0 +1,80 @@
1
+ import { PrepviewAttachment } from './attachment';
2
+ import { PrepviewDocumentGroup } from './document';
3
+ import { PrepviewNotification } from './notification';
4
+ import { PrepviewOperation } from './operation';
5
+ import { PrepviewPunch } from './punch';
6
+ import { PrepviewSafety } from './safety';
7
+ import { PrepviewRelatedTag, PrepviewTagInformation } from './tag';
8
+ export declare type PrepviewWorkOrderDto = {
9
+ details: WorkOrderDetails;
10
+ additionalDetails?: WorkOrderAdditionalDetails;
11
+ };
12
+ export declare type FetchStatus = {
13
+ statusCode?: 'Forbidden' | string;
14
+ };
15
+ export declare type WorkOrderDetails = FetchStatus & {
16
+ basicFinishDateTime: Date;
17
+ basicStartDateTime: Date;
18
+ changedDateTime: Date;
19
+ createdDateTime: Date;
20
+ activeStatusIds: string;
21
+ description: string;
22
+ equipmentId: string;
23
+ id: string;
24
+ locationId: string;
25
+ longText: string;
26
+ tagId: string;
27
+ workCenterId: string;
28
+ personResponsible?: string;
29
+ revisionId?: string;
30
+ orderType: string;
31
+ plannerGroupId: string;
32
+ systemId: string;
33
+ system: string;
34
+ priority: string;
35
+ priorityId: string;
36
+ plantId: string;
37
+ };
38
+ export declare type WorkOrderAdditionalDetails = {
39
+ attachments: FetchStatus & {
40
+ attachments: Array<PrepviewAttachment>;
41
+ };
42
+ documents: FetchStatus & {
43
+ documentGroups: Array<PrepviewDocumentGroup>;
44
+ };
45
+ history: FetchStatus & {
46
+ notificationGroups: FetchStatus & {
47
+ groups: PrepviewTagHistoryGroup<PrepviewNotification>[];
48
+ };
49
+ punchGroups: FetchStatus & {
50
+ groups: PrepviewTagHistoryGroup<PrepviewPunch>[];
51
+ };
52
+ workOrderGroups: FetchStatus & {
53
+ groups: PrepviewTagHistoryGroup<PrepviewWorkOrder>[];
54
+ };
55
+ };
56
+ objects: FetchStatus & {
57
+ objects: Array<PrepviewRelatedTag>;
58
+ };
59
+ operations: FetchStatus & {
60
+ operations: Array<PrepviewOperation>;
61
+ };
62
+ safetyCards: FetchStatus & {
63
+ safetyCards: Array<PrepviewSafety>;
64
+ };
65
+ tagInformation: FetchStatus & PrepviewTagInformation;
66
+ };
67
+ export declare type PrepviewTagHistoryGroup<T = PrepviewNotification | PrepviewWorkOrder | PrepviewPunch> = {
68
+ type: string;
69
+ items: Array<T>;
70
+ };
71
+ export declare type PrepviewWorkOrder = {
72
+ type: string;
73
+ title: string;
74
+ mainWorkCenterId?: string;
75
+ id: string;
76
+ createdDateTime: Date;
77
+ changedDateTime: Date;
78
+ activeStatusIds: string;
79
+ tagNo: string;
80
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Returns a date as a friendly readable string. If the date is undefined, it returns empty string.
3
+ * @param date The date to convert to friendly string format.
4
+ */
5
+ export declare function dateToStringOrEmpty(date: Date | string | undefined): string;
@@ -0,0 +1 @@
1
+ export declare function setFileIcon(fileExtension: string | undefined): string;
@@ -0,0 +1 @@
1
+ export declare function escapeSpecialCharacters(text: string): string[];
@@ -0,0 +1,14 @@
1
+ export declare enum DocType {
2
+ pid = "pid",
3
+ iso = "iso",
4
+ did = "did",
5
+ scd = "scd",
6
+ causeEffect = "causeEffect",
7
+ fpds = "fpds",
8
+ layout = "layout",
9
+ loop = "loop",
10
+ blockDiagram = "blockDiagram",
11
+ wire = "wire",
12
+ detail = "detail",
13
+ other = "other"
14
+ }
@@ -0,0 +1,2 @@
1
+ export * from './documents';
2
+ export * from './tagHistoryItem';
@@ -0,0 +1,5 @@
1
+ export declare enum WorkItemType {
2
+ Notifications = 0,
3
+ WorkOrders = 1,
4
+ Punches = 2
5
+ }
@@ -0,0 +1,8 @@
1
+ export * from './enums';
2
+ export * from './date';
3
+ export * from './documents';
4
+ export * from './dom';
5
+ export * from './workorder';
6
+ export * from './logger';
7
+ export * from './object';
8
+ export * from './url';
@@ -0,0 +1,71 @@
1
+ import { AnalyticsEvent, AnalyticsModule } from '@equinor/echo-core';
2
+ export declare enum ObjectName {
3
+ Module = "Module",
4
+ Synergi = "Synergi",
5
+ SafeX = "SafeX"
6
+ }
7
+ declare type ActionNames = {
8
+ [ObjectName.Module]: ModuleActions;
9
+ [ObjectName.Synergi]: SynergiActions;
10
+ [ObjectName.SafeX]: SafeXActions;
11
+ };
12
+ declare type ActionProperties = {
13
+ [ObjectName.Module]: ModuleActionProperties;
14
+ [ObjectName.Synergi]: SynergiActionProperties;
15
+ [ObjectName.SafeX]: SafeXActionProperties;
16
+ };
17
+ declare type ModuleActions = 'Started';
18
+ declare type ModuleActionProperties = {
19
+ message?: string;
20
+ };
21
+ declare type SynergiActions = 'Application opened';
22
+ declare type SynergiActionProperties = {
23
+ synergiUrl: string;
24
+ };
25
+ declare type SafeXActions = 'Application opened';
26
+ declare type SafeXActionProperties = {
27
+ searchValue?: string;
28
+ };
29
+ declare enum LogLevel {
30
+ Invalid = 0,
31
+ LocalDevelopment = 1,
32
+ EchoDevelopment = 2,
33
+ QA = 3,
34
+ Prod = 4
35
+ }
36
+ declare type LogLevelKeys = keyof typeof LogLevel;
37
+ interface BaseLoggerProps {
38
+ moduleName: string;
39
+ analytics: AnalyticsModule;
40
+ /**
41
+ * LogLevelOverride can be set in localstorage as "[moduleShortName].logOverride"
42
+ * and should be a number between 0 and 5.
43
+ */
44
+ logLevelOverride?: LogLevel;
45
+ }
46
+ declare class BaseLogger {
47
+ protected _moduleName: string;
48
+ protected _logLevel: LogLevel;
49
+ protected _logLevelOverride?: LogLevel;
50
+ protected _analytics: AnalyticsModule;
51
+ constructor({ moduleName, analytics, logLevelOverride }: BaseLoggerProps);
52
+ set overrideLogLevel(override: LogLevelKeys);
53
+ getLogLevelOverride(): number;
54
+ track(event: AnalyticsEvent): void;
55
+ trackError(error: Error): void;
56
+ log(level: LogLevelKeys, callback: () => void): void;
57
+ /**
58
+ * @returns LogLevel for current hosting environment.
59
+ */
60
+ protected setInitialLogLevel(): LogLevel;
61
+ }
62
+ declare type PrepviewLoggerProps = BaseLoggerProps;
63
+ declare class PrepviewLogger extends BaseLogger {
64
+ constructor({ ...baseProps }: PrepviewLoggerProps);
65
+ trackEvent<Name extends ObjectName = ObjectName, Action extends ActionNames[Name] = ActionNames[Name], Properties extends ActionProperties[Name] = ActionProperties[Name]>(objectName: Name, actionName: Action, properties: Properties): void;
66
+ moduleStarted(): void;
67
+ synergiOpened(props: SynergiActionProperties): void;
68
+ openSafeX(props: SafeXActionProperties): void;
69
+ }
70
+ declare const logger: PrepviewLogger;
71
+ export { logger };
@@ -0,0 +1 @@
1
+ export declare const toStringOrDefault: <T, K extends keyof T>(target: T, key: K, defaultValue?: string) => string;
@@ -0,0 +1,8 @@
1
+ export declare function combineUrls(base: string, ...parts: string[]): string;
2
+ export declare type Params = Record<string, string | number | boolean>;
3
+ /**
4
+ * Takes a url as input and adds the specified parameters to it.
5
+ * @param url The url to extend.
6
+ * @param params The params to add.
7
+ */
8
+ export declare const addParams: (url: string, params: Params) => string;
@@ -0,0 +1 @@
1
+ export declare const MaintenanceApiNameForWorkOrders: Record<string, string>;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { WorkOrderAdditionalDetails, WorkOrderDetails } from '../../types';
3
+ interface Props {
4
+ instCode: string;
5
+ details: WorkOrderDetails;
6
+ additionalDetails: WorkOrderAdditionalDetails;
7
+ }
8
+ declare function AdditionalDetails({ instCode, details, additionalDetails }: Props): JSX.Element;
9
+ export { AdditionalDetails };
@@ -0,0 +1 @@
1
+ export * from './AdditionalDetails';
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { WorkOrderDetails } from '../../types';
3
+ export interface Props {
4
+ details: WorkOrderDetails;
5
+ instCode: string;
6
+ isLoading?: boolean;
7
+ }
8
+ declare function Details({ details, instCode, isLoading }: Props): JSX.Element;
9
+ export { Details };
@@ -0,0 +1 @@
1
+ export * from './Details';
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { PrepviewWorkOrderDto } from '../types';
3
+ interface WorkOrderProps {
4
+ instCode: string;
5
+ workOrder: PrepviewWorkOrderDto;
6
+ }
7
+ declare function WorkOrder(props: WorkOrderProps): JSX.Element | null;
8
+ export { WorkOrder };