@equinor/mad-dfw 0.5.1 → 0.5.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.
- package/CHANGELOG.md +15 -0
- package/dist/{chunk-4G4367DY.js → chunk-36WMXUZG.js} +12 -3
- package/dist/{chunk-FTG43LBL.js → chunk-5EFVKCUB.js} +5 -5
- package/dist/{chunk-6P3AA5FM.js → chunk-KBFX3MNW.js} +2 -2
- package/dist/{chunk-4IALCT65.js → chunk-KJHXRF5U.js} +2 -2
- package/dist/chunk-SJFZ7LJV.js +74 -0
- package/dist/dfwcomponents/WorkOrderCell/WorkOrderCell.js +3 -3
- package/dist/dfwcomponents/WorkOrderCell/WorkOrderCellNavigation.js +3 -3
- package/dist/dfwcomponents/WorkOrderCell/WorkOrderPropertyList.js +2 -2
- package/dist/dfwcomponents/WorkOrderCell/index.js +5 -5
- package/dist/dfwcomponents/WorkOrderCell/utils.d.ts +0 -1
- package/dist/dfwcomponents/WorkOrderCell/utils.js +1 -3
- package/dist/index.js +5 -5
- package/package.json +1 -1
- package/dist/chunk-GNURJIGB.js +0 -75
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @equinor/mad-dfw
|
|
2
2
|
|
|
3
|
+
## 0.5.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f73c165: Make the text values in the `WorkOrderCell` component selectable
|
|
8
|
+
- f73c165: Fixed validation for when the `not started` icon should be visible in the
|
|
9
|
+
`WorkOrderCell` component
|
|
10
|
+
|
|
11
|
+
## 0.5.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 3388a03: Updated button validation to fix visibility issues on buttons in the `WorkOrderCell`
|
|
16
|
+
component
|
|
17
|
+
|
|
3
18
|
## 0.5.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
formatDate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SJFZ7LJV.js";
|
|
4
4
|
import {
|
|
5
5
|
PropertyRow
|
|
6
6
|
} from "./chunk-DQQOZB3E.js";
|
|
@@ -79,10 +79,19 @@ var WorkOrderPropertyList = ({
|
|
|
79
79
|
key: `${label}-${value}`,
|
|
80
80
|
label,
|
|
81
81
|
value,
|
|
82
|
-
textColor
|
|
82
|
+
textColor,
|
|
83
|
+
selectable: true
|
|
83
84
|
}
|
|
84
85
|
);
|
|
85
|
-
}), additionalPropertyRows.map((item, index) => /* @__PURE__ */ React.createElement(
|
|
86
|
+
}), additionalPropertyRows.map((item, index) => /* @__PURE__ */ React.createElement(
|
|
87
|
+
PropertyRow,
|
|
88
|
+
{
|
|
89
|
+
key: `additional-${index}`,
|
|
90
|
+
label: item.label,
|
|
91
|
+
value: item.value,
|
|
92
|
+
selectable: true
|
|
93
|
+
}
|
|
94
|
+
)));
|
|
86
95
|
};
|
|
87
96
|
|
|
88
97
|
export {
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-VDHOYF7Z.js";
|
|
4
4
|
import {
|
|
5
5
|
WorkOrderPropertyList
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-36WMXUZG.js";
|
|
7
7
|
import {
|
|
8
8
|
getStatusIconsAndLabels
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-SJFZ7LJV.js";
|
|
10
10
|
import {
|
|
11
11
|
__objRest,
|
|
12
12
|
__spreadValues
|
|
@@ -40,11 +40,11 @@ var WorkOrderCell = (_a) => {
|
|
|
40
40
|
"workOrder",
|
|
41
41
|
"additionalPropertyRows"
|
|
42
42
|
]);
|
|
43
|
-
var _a2, _b2;
|
|
43
|
+
var _a2, _b2, _c;
|
|
44
44
|
const breakpoint = useBreakpoint();
|
|
45
45
|
const token = useToken();
|
|
46
46
|
const styles = useStyles(themeStyles);
|
|
47
|
-
const
|
|
47
|
+
const shouldShowActions = ((_a2 = startJobButton == null ? void 0 : startJobButton.visible) != null ? _a2 : false) || ((_b2 = readyForOperationButton == null ? void 0 : readyForOperationButton.visible) != null ? _b2 : false) || ((_c = tecoButton == null ? void 0 : tecoButton.visible) != null ? _c : false);
|
|
48
48
|
const iconsAndLabels = useMemo(
|
|
49
49
|
() => getStatusIconsAndLabels(
|
|
50
50
|
workOrder.activeStatusIds,
|
|
@@ -69,7 +69,7 @@ var WorkOrderCell = (_a) => {
|
|
|
69
69
|
workOrder,
|
|
70
70
|
additionalPropertyRows
|
|
71
71
|
}
|
|
72
|
-
)),
|
|
72
|
+
)), shouldShowActions && /* @__PURE__ */ React.createElement(
|
|
73
73
|
View,
|
|
74
74
|
{
|
|
75
75
|
style: [
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-VDHOYF7Z.js";
|
|
4
4
|
import {
|
|
5
5
|
WorkOrderPropertyList
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-36WMXUZG.js";
|
|
7
7
|
import {
|
|
8
8
|
getStatusIconsAndLabels
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-SJFZ7LJV.js";
|
|
10
10
|
import {
|
|
11
11
|
__objRest,
|
|
12
12
|
__spreadProps,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCell
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5EFVKCUB.js";
|
|
4
4
|
import {
|
|
5
5
|
WorkOrderCellNavigation
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KBFX3MNW.js";
|
|
7
7
|
|
|
8
8
|
// src/dfwcomponents/WorkOrderCell/index.ts
|
|
9
9
|
var WorkOrderCell2 = WorkOrderCell;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// src/dfwcomponents/WorkOrderCell/utils.ts
|
|
2
|
+
var getStatusIconConfig = (status) => {
|
|
3
|
+
const statusMap = {
|
|
4
|
+
notStarted: {
|
|
5
|
+
icon: "circle-outline",
|
|
6
|
+
label: "Not started",
|
|
7
|
+
textColor: "textTertiary",
|
|
8
|
+
iconColor: "textPrimary"
|
|
9
|
+
},
|
|
10
|
+
started: {
|
|
11
|
+
icon: "circle-half-full",
|
|
12
|
+
label: "Started",
|
|
13
|
+
textColor: "textTertiary",
|
|
14
|
+
iconColor: "textPrimary"
|
|
15
|
+
},
|
|
16
|
+
finished: {
|
|
17
|
+
icon: "circle",
|
|
18
|
+
label: "Finished",
|
|
19
|
+
textColor: "textTertiary",
|
|
20
|
+
iconColor: "textPrimary"
|
|
21
|
+
},
|
|
22
|
+
requiredEndOverdue: {
|
|
23
|
+
icon: "alarm",
|
|
24
|
+
label: "Required end overdue",
|
|
25
|
+
textColor: "textTertiary",
|
|
26
|
+
iconColor: "danger"
|
|
27
|
+
},
|
|
28
|
+
hseCritical: {
|
|
29
|
+
icon: "alert-outline",
|
|
30
|
+
label: "HSE critical",
|
|
31
|
+
textColor: "textTertiary",
|
|
32
|
+
iconColor: "danger"
|
|
33
|
+
},
|
|
34
|
+
productionCritical: {
|
|
35
|
+
icon: "water-outline",
|
|
36
|
+
label: "Production critical",
|
|
37
|
+
textColor: "textTertiary",
|
|
38
|
+
iconColor: "danger"
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
return statusMap[status];
|
|
42
|
+
};
|
|
43
|
+
var getStatusIconsAndLabels = (activeStatusIds, requiredEndDate, hseCritical, productionCritical) => {
|
|
44
|
+
var _a;
|
|
45
|
+
const today = /* @__PURE__ */ new Date();
|
|
46
|
+
const iconsAndLabels = [];
|
|
47
|
+
const activeStatuses = (_a = activeStatusIds == null ? void 0 : activeStatusIds.split(" ")) != null ? _a : [];
|
|
48
|
+
if (requiredEndDate && today > new Date(requiredEndDate)) {
|
|
49
|
+
iconsAndLabels.push(getStatusIconConfig("requiredEndOverdue"));
|
|
50
|
+
}
|
|
51
|
+
if (hseCritical) {
|
|
52
|
+
iconsAndLabels.push(getStatusIconConfig("hseCritical"));
|
|
53
|
+
}
|
|
54
|
+
if (productionCritical) {
|
|
55
|
+
iconsAndLabels.push(getStatusIconConfig("productionCritical"));
|
|
56
|
+
}
|
|
57
|
+
if (activeStatuses.includes("RDOP") || activeStatuses.includes("TECO")) {
|
|
58
|
+
iconsAndLabels.push(getStatusIconConfig("finished"));
|
|
59
|
+
} else if (activeStatuses.includes("STRT")) {
|
|
60
|
+
iconsAndLabels.push(getStatusIconConfig("started"));
|
|
61
|
+
} else {
|
|
62
|
+
iconsAndLabels.push(getStatusIconConfig("notStarted"));
|
|
63
|
+
}
|
|
64
|
+
return iconsAndLabels;
|
|
65
|
+
};
|
|
66
|
+
var formatDate = (dateString) => {
|
|
67
|
+
const date = new Date(dateString);
|
|
68
|
+
return date.toLocaleDateString("en-GB").replace(/\//g, ".");
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export {
|
|
72
|
+
getStatusIconsAndLabels,
|
|
73
|
+
formatDate
|
|
74
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCell
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-5EFVKCUB.js";
|
|
4
4
|
import "../../chunk-VDHOYF7Z.js";
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-36WMXUZG.js";
|
|
6
|
+
import "../../chunk-SJFZ7LJV.js";
|
|
7
7
|
import "../../chunk-2JQRYR7Z.js";
|
|
8
8
|
import "../../chunk-DQQOZB3E.js";
|
|
9
9
|
import "../../chunk-G2ADBYYC.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCellNavigation
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-KBFX3MNW.js";
|
|
4
4
|
import "../../chunk-VDHOYF7Z.js";
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-36WMXUZG.js";
|
|
6
|
+
import "../../chunk-SJFZ7LJV.js";
|
|
7
7
|
import "../../chunk-2JQRYR7Z.js";
|
|
8
8
|
import "../../chunk-DQQOZB3E.js";
|
|
9
9
|
import "../../chunk-G2ADBYYC.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderPropertyList
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-36WMXUZG.js";
|
|
4
|
+
import "../../chunk-SJFZ7LJV.js";
|
|
5
5
|
import "../../chunk-2JQRYR7Z.js";
|
|
6
6
|
import "../../chunk-DQQOZB3E.js";
|
|
7
7
|
import "../../chunk-G2ADBYYC.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCell
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-KJHXRF5U.js";
|
|
4
|
+
import "../../chunk-5EFVKCUB.js";
|
|
5
|
+
import "../../chunk-KBFX3MNW.js";
|
|
6
6
|
import "../../chunk-VDHOYF7Z.js";
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-36WMXUZG.js";
|
|
8
|
+
import "../../chunk-SJFZ7LJV.js";
|
|
9
9
|
import "../../chunk-2JQRYR7Z.js";
|
|
10
10
|
import "../../chunk-DQQOZB3E.js";
|
|
11
11
|
import "../../chunk-G2ADBYYC.js";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { StatusConfig } from "./types";
|
|
2
|
-
export declare const getStatusIconConfig: (status: string) => StatusConfig | undefined;
|
|
3
2
|
export declare const getStatusIconsAndLabels: (activeStatusIds?: string, requiredEndDate?: string, hseCritical?: boolean, productionCritical?: boolean) => StatusConfig[];
|
|
4
3
|
export declare const formatDate: (dateString: string) => string;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
formatDate,
|
|
3
|
-
getStatusIconConfig,
|
|
4
3
|
getStatusIconsAndLabels
|
|
5
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-SJFZ7LJV.js";
|
|
6
5
|
import "../../chunk-G2ADBYYC.js";
|
|
7
6
|
export {
|
|
8
7
|
formatDate,
|
|
9
|
-
getStatusIconConfig,
|
|
10
8
|
getStatusIconsAndLabels
|
|
11
9
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkOrderCell
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-KJHXRF5U.js";
|
|
4
|
+
import "./chunk-5EFVKCUB.js";
|
|
5
|
+
import "./chunk-KBFX3MNW.js";
|
|
6
6
|
import "./chunk-VDHOYF7Z.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-36WMXUZG.js";
|
|
8
|
+
import "./chunk-SJFZ7LJV.js";
|
|
9
9
|
import "./chunk-2JQRYR7Z.js";
|
|
10
10
|
import {
|
|
11
11
|
PropertyRow
|
package/package.json
CHANGED
package/dist/chunk-GNURJIGB.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
// src/dfwcomponents/WorkOrderCell/utils.ts
|
|
2
|
-
var getStatusIconConfig = (status) => {
|
|
3
|
-
switch (status) {
|
|
4
|
-
case "STRT":
|
|
5
|
-
return {
|
|
6
|
-
icon: "circle-half-full",
|
|
7
|
-
label: "Started",
|
|
8
|
-
textColor: "textTertiary",
|
|
9
|
-
iconColor: "textPrimary"
|
|
10
|
-
};
|
|
11
|
-
case "RDOP":
|
|
12
|
-
return {
|
|
13
|
-
icon: "circle",
|
|
14
|
-
label: "Ready for operation",
|
|
15
|
-
textColor: "textTertiary",
|
|
16
|
-
iconColor: "textPrimary"
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
return void 0;
|
|
20
|
-
};
|
|
21
|
-
var getStatusIconsAndLabels = (activeStatusIds, requiredEndDate, hseCritical, productionCritical) => {
|
|
22
|
-
const requiredEnd = requiredEndDate ? new Date(requiredEndDate) : null;
|
|
23
|
-
const activeStatuses = activeStatusIds == null ? void 0 : activeStatusIds.split(" ");
|
|
24
|
-
const today = /* @__PURE__ */ new Date();
|
|
25
|
-
const iconsAndLabels = [];
|
|
26
|
-
if (requiredEnd && today > requiredEnd) {
|
|
27
|
-
iconsAndLabels.push({
|
|
28
|
-
icon: "alarm",
|
|
29
|
-
label: "Required end overdue",
|
|
30
|
-
textColor: "textTertiary",
|
|
31
|
-
iconColor: "danger"
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
if (hseCritical) {
|
|
35
|
-
iconsAndLabels.push({
|
|
36
|
-
icon: "alert-outline",
|
|
37
|
-
label: "HSE critical",
|
|
38
|
-
textColor: "textTertiary",
|
|
39
|
-
iconColor: "danger"
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
if (productionCritical) {
|
|
43
|
-
iconsAndLabels.push({
|
|
44
|
-
icon: "water-outline",
|
|
45
|
-
label: "Production critical",
|
|
46
|
-
textColor: "textTertiary",
|
|
47
|
-
iconColor: "danger"
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
if (!(activeStatuses == null ? void 0 : activeStatuses.includes("STRT"))) {
|
|
51
|
-
iconsAndLabels.push({
|
|
52
|
-
icon: "circle-outline",
|
|
53
|
-
label: "Not started",
|
|
54
|
-
textColor: "textTertiary",
|
|
55
|
-
iconColor: "textPrimary"
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
activeStatuses == null ? void 0 : activeStatuses.forEach((status) => {
|
|
59
|
-
const statusConfig = getStatusIconConfig(status);
|
|
60
|
-
if (statusConfig) {
|
|
61
|
-
iconsAndLabels.push(statusConfig);
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
return iconsAndLabels;
|
|
65
|
-
};
|
|
66
|
-
var formatDate = (dateString) => {
|
|
67
|
-
const date = new Date(dateString);
|
|
68
|
-
return date.toLocaleDateString("en-GB").replace(/\//g, ".");
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export {
|
|
72
|
-
getStatusIconConfig,
|
|
73
|
-
getStatusIconsAndLabels,
|
|
74
|
-
formatDate
|
|
75
|
-
};
|