@kosdev-code/kos-ddk-model-components 3.1.1 → 3.1.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/components/holders/holder-card.d.ts.map +1 -1
- package/components/holders/macro-holder-card.d.ts.map +1 -1
- package/components/state-experience/state-experience.d.ts.map +1 -1
- package/extensions/cui-extension.d.ts +7 -1
- package/extensions/cui-extension.d.ts.map +1 -1
- package/extensions/dashboard-detail-extension.d.ts +2 -0
- package/extensions/dashboard-detail-extension.d.ts.map +1 -1
- package/extensions/dashboard-pump-summary-extension.d.ts +40 -0
- package/extensions/dashboard-pump-summary-extension.d.ts.map +1 -0
- package/extensions/index.d.ts +1 -0
- package/extensions/index.d.ts.map +1 -1
- package/extensions/nav-view-extension.d.ts.map +1 -1
- package/extensions/setup-extension.d.ts +9 -1
- package/extensions/setup-extension.d.ts.map +1 -1
- package/hooks/extensions/use-view-extensions.d.ts.map +1 -1
- package/hooks/trouble-action/use-trouble-action.d.ts.map +1 -1
- package/index.cjs +127 -65
- package/index.cjs.map +1 -1
- package/index.js +129 -67
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/utils/registration/registration-utils.d.ts.map +1 -1
package/index.js
CHANGED
|
@@ -3,11 +3,11 @@ import { jsx, jsxs, Fragment } from "@emotion/react/jsx-runtime";
|
|
|
3
3
|
import styled from "@emotion/styled";
|
|
4
4
|
import { useComponentConfigurationContext, Modal, Header, BackButton, Content as Content$1, InfoCard, Footer as Footer$6, Button, CloseButton, ProgressBar, LabelInformation, BodyMediumInformation, InputCard, WorkflowModal, StatusIndicator, InputRangeCard, ToggleCard, PickerCard, Card, SwitchCard, MultiPickerCard, LabelDate, Table, LabelInformationExtraSmall, getItemData, TapAndHoldButton, ComponentConfigurationProvider, useAbbreviation, getFillColor, HolderDashboardCard, FuelGauge, UtilityModalHeading, FrameContainer, FrameBody, TabContainer, SettingsSubheading, StatusCard, NotificationCard, TabViewLayout, TabRouter, Tabs, CompactCloseButton, QuestionIconStyle, CancelProceedFooter, ErrorInputCard, StatusBar, ModalContainer, InfoContainer, FailureCard, useNavigate, Sidebar, HeadingExtraLarge, InfoMessage, InstructionCard, SwitchPickerCard } from "@kosdev-code/kos-ddk-components";
|
|
5
5
|
import React, { useState, useEffect, useCallback, useMemo, createContext, useContext, useRef, useLayoutEffect, Suspense } from "react";
|
|
6
|
-
import { AgitationControl, toTimeComponents, toSeconds, Animation, Application, CarbWater, CopyLogs, DashboardOperations, DispenserInfo, Door, IngredientSummary, MacroAssignment, NetworkTest, NetworkTestContainer, NutritiveSweetener, PlainWater, Lockout, TroubleActionManager, DDKModels, Reboot, Settings, SetupStep, SetupStepContainer, Start, Utilities, UtilitiesContainer, troubleVisibilityFilter } from "@kosdev-code/kos-ddk-models";
|
|
6
|
+
import { AgitationControl, toTimeComponents, toSeconds, Animation, Application, CarbWater, CopyLogs, DashboardOperations, DispenserInfo, Door, IngredientSummary, MacroAssignment, NetworkTest, NetworkTestContainer, NutritiveSweetener, PlainWater, registerDdkMock, Lockout, TroubleActionManager, DDKModels, Reboot, Settings, SetupStep, SetupStepContainer, Start, Utilities, UtilitiesContainer, troubleVisibilityFilter } from "@kosdev-code/kos-ddk-models";
|
|
7
7
|
import { SuccessIcon, MessageErrorIcon, TimeIcon, CalendarIcon, MessageInformationIconWithBackground } from "@kosdev-code/kos-ddk-styles";
|
|
8
8
|
import { DispenseExtensionManager, Assembly, Pump, useBoardContainer, withAssembly } from "@kosdev-code/kos-dispense-sdk";
|
|
9
9
|
import { FcmPump, SpmPump, CgpPump, LfcvPump, KosModelRegistry, CarbAgitator, KosExtensionManager, FreestyleAssembly, FreestyleHolder, useFreestyleAssemblyContext, FreestylePump } from "@kosdev-code/kos-freestyle-sdk";
|
|
10
|
-
import { useKosPluginsContext, useReactiveExtensionRegistry, useExtensionComponent, DynamicComponent } from "@kosdev-code/kos-ui-plugin";
|
|
10
|
+
import { useKosPluginsContext, buildRankedExtensionMap, useReactiveExtensionRegistry, useExtensionComponent, DynamicComponent } from "@kosdev-code/kos-ui-plugin";
|
|
11
11
|
import { createExtensionSchema, extensionPointId, defineExtensionPoint, createViewAwareTransform, validateWithSchema, validateRankIfPresent, validateDescriptorFormat } from "@kosdev-code/kos-ui-plugin/utilities";
|
|
12
12
|
import { useLocation, useSearchParams } from "react-router-dom";
|
|
13
13
|
class IntentAction {
|
|
@@ -5397,9 +5397,9 @@ const DashboardSummarySchema = createExtensionSchema(
|
|
|
5397
5397
|
},
|
|
5398
5398
|
{ rankable: true }
|
|
5399
5399
|
);
|
|
5400
|
-
const EXTENSION_ID$
|
|
5400
|
+
const EXTENSION_ID$9 = extensionPointId("ddk", "dashboard", "summary");
|
|
5401
5401
|
const DashboardSummaryExtension = defineExtensionPoint({
|
|
5402
|
-
id: EXTENSION_ID$
|
|
5402
|
+
id: EXTENSION_ID$9,
|
|
5403
5403
|
contributionKey: "dashboardSummary",
|
|
5404
5404
|
displayName: "Dashboard Summary",
|
|
5405
5405
|
description: "Extension point for dashboard summary plugin configurations with view support",
|
|
@@ -5419,9 +5419,9 @@ const DashboardSummaryExtension = defineExtensionPoint({
|
|
|
5419
5419
|
},
|
|
5420
5420
|
transform: createViewAwareTransform()
|
|
5421
5421
|
});
|
|
5422
|
-
const EXTENSION_POINT_DASHBOARD_SUMMARY = EXTENSION_ID$
|
|
5423
|
-
const EXTENSION_POINT_DASHBOARD_SUMMARY_DEF = `${EXTENSION_ID$
|
|
5424
|
-
const EXTENSION_POINT_DASHBOARD_SUMMARY_VIEW = `${EXTENSION_ID$
|
|
5422
|
+
const EXTENSION_POINT_DASHBOARD_SUMMARY = EXTENSION_ID$9;
|
|
5423
|
+
const EXTENSION_POINT_DASHBOARD_SUMMARY_DEF = `${EXTENSION_ID$9}.def`;
|
|
5424
|
+
const EXTENSION_POINT_DASHBOARD_SUMMARY_VIEW = `${EXTENSION_ID$9}.view`;
|
|
5425
5425
|
const DashboardDetailSchema = createExtensionSchema(
|
|
5426
5426
|
{
|
|
5427
5427
|
type: literalType("dashboard.detail").describe("Extension type, must be 'dashboard.detail'"),
|
|
@@ -5429,9 +5429,9 @@ const DashboardDetailSchema = createExtensionSchema(
|
|
|
5429
5429
|
},
|
|
5430
5430
|
{ rankable: true }
|
|
5431
5431
|
);
|
|
5432
|
-
const EXTENSION_ID$
|
|
5432
|
+
const EXTENSION_ID$8 = extensionPointId("ddk", "dashboard", "detail");
|
|
5433
5433
|
const DashboardDetailExtension = defineExtensionPoint({
|
|
5434
|
-
id: EXTENSION_ID$
|
|
5434
|
+
id: EXTENSION_ID$8,
|
|
5435
5435
|
contributionKey: "dashboardDetail",
|
|
5436
5436
|
displayName: "Dashboard Detail",
|
|
5437
5437
|
description: "Extension point for dashboard detail plugin configurations with view support",
|
|
@@ -5451,9 +5451,9 @@ const DashboardDetailExtension = defineExtensionPoint({
|
|
|
5451
5451
|
},
|
|
5452
5452
|
transform: createViewAwareTransform()
|
|
5453
5453
|
});
|
|
5454
|
-
const EXTENSION_POINT_DASHBOARD_DETAIL = EXTENSION_ID$
|
|
5455
|
-
const EXTENSION_POINT_DASHBOARD_DETAIL_DEF = `${EXTENSION_ID$
|
|
5456
|
-
const EXTENSION_POINT_DASHBOARD_DETAIL_VIEW = `${EXTENSION_ID$
|
|
5454
|
+
const EXTENSION_POINT_DASHBOARD_DETAIL = EXTENSION_ID$8;
|
|
5455
|
+
const EXTENSION_POINT_DASHBOARD_DETAIL_DEF = `${EXTENSION_ID$8}.def`;
|
|
5456
|
+
const EXTENSION_POINT_DASHBOARD_DETAIL_VIEW = `${EXTENSION_ID$8}.view`;
|
|
5457
5457
|
const DashboardPumpDetailSchema = createExtensionSchema(
|
|
5458
5458
|
{
|
|
5459
5459
|
type: literalType("dashboard.detail.pump").describe("Extension type, must be 'dashboard.detail.pump'"),
|
|
@@ -5463,9 +5463,9 @@ const DashboardPumpDetailSchema = createExtensionSchema(
|
|
|
5463
5463
|
},
|
|
5464
5464
|
{ rankable: true }
|
|
5465
5465
|
);
|
|
5466
|
-
const EXTENSION_ID$
|
|
5466
|
+
const EXTENSION_ID$7 = extensionPointId("ddk", "dashboard", "pump-detail");
|
|
5467
5467
|
const DashboardPumpDetailExtension = defineExtensionPoint({
|
|
5468
|
-
id: EXTENSION_ID$
|
|
5468
|
+
id: EXTENSION_ID$7,
|
|
5469
5469
|
contributionKey: "dashboardPumpDetail",
|
|
5470
5470
|
displayName: "Dashboard Pump Detail",
|
|
5471
5471
|
description: "Extension point for dashboard pump detail plugin configurations with view support",
|
|
@@ -5483,9 +5483,42 @@ const DashboardPumpDetailExtension = defineExtensionPoint({
|
|
|
5483
5483
|
},
|
|
5484
5484
|
transform: createViewAwareTransform()
|
|
5485
5485
|
});
|
|
5486
|
-
const EXTENSION_POINT_DASHBOARD_PUMP_DETAIL = EXTENSION_ID$
|
|
5487
|
-
const EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_DEF = `${EXTENSION_ID$
|
|
5488
|
-
const EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_VIEW = `${EXTENSION_ID$
|
|
5486
|
+
const EXTENSION_POINT_DASHBOARD_PUMP_DETAIL = EXTENSION_ID$7;
|
|
5487
|
+
const EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_DEF = `${EXTENSION_ID$7}.def`;
|
|
5488
|
+
const EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_VIEW = `${EXTENSION_ID$7}.view`;
|
|
5489
|
+
const DashboardPumpSummarySchema = createExtensionSchema(
|
|
5490
|
+
{
|
|
5491
|
+
type: literalType("dashboard.summary.pump").describe("Extension type, must be 'dashboard.summary.pump'"),
|
|
5492
|
+
dashboardKey: stringType().min(1, "Dashboard key is required").describe(
|
|
5493
|
+
"Key used to match this extension with dashboard pumps: the holder's dashboard key, by default its first pump's type (e.g. 'cgp', 'lfcv')."
|
|
5494
|
+
)
|
|
5495
|
+
},
|
|
5496
|
+
{ rankable: true }
|
|
5497
|
+
);
|
|
5498
|
+
const EXTENSION_ID$6 = extensionPointId("ddk", "dashboard", "pump-summary");
|
|
5499
|
+
const DashboardPumpSummaryExtension = defineExtensionPoint({
|
|
5500
|
+
id: EXTENSION_ID$6,
|
|
5501
|
+
contributionKey: "dashboardPumpSummary",
|
|
5502
|
+
displayName: "Dashboard Pump Summary",
|
|
5503
|
+
description: "Extension point for the body of a holder's dashboard card by pump type; the card keeps its default body when none matches",
|
|
5504
|
+
hasView: true,
|
|
5505
|
+
isRankable: true,
|
|
5506
|
+
schema: DashboardPumpSummarySchema,
|
|
5507
|
+
metadata: {
|
|
5508
|
+
exportName: "DashboardPumpSummaryExtension",
|
|
5509
|
+
category: "Dashboard"
|
|
5510
|
+
},
|
|
5511
|
+
validate: (data, context) => {
|
|
5512
|
+
if (!validateWithSchema(DashboardPumpSummarySchema, data, context)) {
|
|
5513
|
+
return;
|
|
5514
|
+
}
|
|
5515
|
+
validateRankIfPresent(data, context);
|
|
5516
|
+
},
|
|
5517
|
+
transform: createViewAwareTransform()
|
|
5518
|
+
});
|
|
5519
|
+
const EXTENSION_POINT_DASHBOARD_PUMP_SUMMARY = EXTENSION_ID$6;
|
|
5520
|
+
const EXTENSION_POINT_DASHBOARD_PUMP_SUMMARY_DEF = `${EXTENSION_ID$6}.def`;
|
|
5521
|
+
const EXTENSION_POINT_DASHBOARD_PUMP_SUMMARY_VIEW = `${EXTENSION_ID$6}.view`;
|
|
5489
5522
|
const DashboardMacroSummarySchema = createExtensionSchema(
|
|
5490
5523
|
{
|
|
5491
5524
|
type: literalType("dashboard.macro.summary").describe("Extension type, must be 'dashboard.macro.summary'"),
|
|
@@ -5551,11 +5584,14 @@ const CuiExtension = defineExtensionPoint({
|
|
|
5551
5584
|
const EXTENSION_POINT_CUI = EXTENSION_ID$4;
|
|
5552
5585
|
const EXTENSION_POINT_CUI_DEF = `${EXTENSION_ID$4}.def`;
|
|
5553
5586
|
const EXTENSION_POINT_CUI_VIEW = `${EXTENSION_ID$4}.view`;
|
|
5554
|
-
const NavViewSchema = createExtensionSchema(
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5587
|
+
const NavViewSchema = createExtensionSchema(
|
|
5588
|
+
{
|
|
5589
|
+
navDescriptor: stringType().min(1, "Navigation descriptor is required").describe(
|
|
5590
|
+
"Descriptor used to identify and map the navigation functionality"
|
|
5591
|
+
)
|
|
5592
|
+
},
|
|
5593
|
+
{ rankable: true }
|
|
5594
|
+
);
|
|
5559
5595
|
const EXTENSION_ID$3 = extensionPointId("ddk", "nav", "view");
|
|
5560
5596
|
const NavViewExtension = defineExtensionPoint({
|
|
5561
5597
|
id: EXTENSION_ID$3,
|
|
@@ -5563,7 +5599,7 @@ const NavViewExtension = defineExtensionPoint({
|
|
|
5563
5599
|
displayName: "Navigation Views",
|
|
5564
5600
|
description: "Extension point for navigation view plugin configurations with view support",
|
|
5565
5601
|
hasView: true,
|
|
5566
|
-
isRankable:
|
|
5602
|
+
isRankable: true,
|
|
5567
5603
|
schema: NavViewSchema,
|
|
5568
5604
|
metadata: {
|
|
5569
5605
|
exportName: "NavViewExtension",
|
|
@@ -5579,6 +5615,7 @@ const NavViewExtension = defineExtensionPoint({
|
|
|
5579
5615
|
data.navDescriptor,
|
|
5580
5616
|
context
|
|
5581
5617
|
);
|
|
5618
|
+
validateRankIfPresent(data, context);
|
|
5582
5619
|
},
|
|
5583
5620
|
transform: createViewAwareTransform()
|
|
5584
5621
|
});
|
|
@@ -5716,7 +5753,10 @@ const useViewExtensions = ({
|
|
|
5716
5753
|
const setupStepsExt = getExtensions(extensionPoint);
|
|
5717
5754
|
const namespaces = setupStepsExt.map((ext) => ext.data.namespace) || [];
|
|
5718
5755
|
const { t } = useKosTranslation([defaultNamespace, ...new Set(namespaces)]);
|
|
5719
|
-
const
|
|
5756
|
+
const rankedSteps = Object.values(
|
|
5757
|
+
buildRankedExtensionMap(setupStepsExt, EXT_KEY[extensionPoint])
|
|
5758
|
+
);
|
|
5759
|
+
const contributionMap = rankedSteps.reduce(
|
|
5720
5760
|
(acc, _step) => {
|
|
5721
5761
|
const step = _step;
|
|
5722
5762
|
const data = step.data;
|
|
@@ -5730,7 +5770,7 @@ const useViewExtensions = ({
|
|
|
5730
5770
|
},
|
|
5731
5771
|
{}
|
|
5732
5772
|
);
|
|
5733
|
-
const labelMap =
|
|
5773
|
+
const labelMap = rankedSteps.reduce((acc, _step) => {
|
|
5734
5774
|
const step = _step;
|
|
5735
5775
|
const data = step.data;
|
|
5736
5776
|
acc[data[EXT_KEY[extensionPoint]]] = `${data.namespace}:${data.title}`;
|
|
@@ -5976,6 +6016,7 @@ const UTILITIES_EXTENSION_ID = EXTENSION_POINT_IDS.UTILITIES;
|
|
|
5976
6016
|
DashboardSummaryExtension.register();
|
|
5977
6017
|
DashboardDetailExtension.register();
|
|
5978
6018
|
DashboardPumpDetailExtension.register();
|
|
6019
|
+
DashboardPumpSummaryExtension.register();
|
|
5979
6020
|
DashboardMacroSummaryExtension.register();
|
|
5980
6021
|
CuiExtension.register();
|
|
5981
6022
|
NavViewExtension.register();
|
|
@@ -5995,6 +6036,10 @@ console.log(
|
|
|
5995
6036
|
`Registered DashboardPumpDetailExtension:`,
|
|
5996
6037
|
DashboardPumpDetailExtension.id
|
|
5997
6038
|
);
|
|
6039
|
+
console.log(
|
|
6040
|
+
`Registered DashboardPumpSummaryExtension:`,
|
|
6041
|
+
DashboardPumpSummaryExtension.id
|
|
6042
|
+
);
|
|
5998
6043
|
console.log(
|
|
5999
6044
|
`Registered DashboardMacroSummaryExtension:`,
|
|
6000
6045
|
DashboardMacroSummaryExtension.id
|
|
@@ -6005,6 +6050,7 @@ console.log(`Registered SetupExtension:`, SetupExtension.id);
|
|
|
6005
6050
|
console.log(`Registered TroubleActionExtension:`, TroubleActionExtension.id);
|
|
6006
6051
|
console.log(`Registered ViewExtension:`, ViewExtension.id);
|
|
6007
6052
|
const initDDKRegistration = () => {
|
|
6053
|
+
registerDdkMock();
|
|
6008
6054
|
KosModelRegistry.freestyle.models().model(Lockout).model(Device).model(TroubleActionManager).model(CopyLogs).model(Door).model(AgitationControl).companion(Assembly.type, () => {
|
|
6009
6055
|
if (KosFeatureFlags.isFeatureEnabled("carbTank")) {
|
|
6010
6056
|
return CarbAgitator.type;
|
|
@@ -6033,8 +6079,7 @@ const initDDKRegistration = () => {
|
|
|
6033
6079
|
return true;
|
|
6034
6080
|
};
|
|
6035
6081
|
const remoteNNSVisibilityMapper = (id, context) => {
|
|
6036
|
-
if (id !== "settings.
|
|
6037
|
-
return true;
|
|
6082
|
+
if (id !== "settings.remote-nns") return true;
|
|
6038
6083
|
if (!context) return true;
|
|
6039
6084
|
const { assembly } = context;
|
|
6040
6085
|
if (!assembly) return true;
|
|
@@ -6197,9 +6242,12 @@ function withStart(WrappedComponent) {
|
|
|
6197
6242
|
const useTroubleActionState = () => {
|
|
6198
6243
|
const modelId = TroubleActionManager.type;
|
|
6199
6244
|
const { getExtensions } = usePluginExtensions();
|
|
6200
|
-
const troubleActionExtensions =
|
|
6201
|
-
(
|
|
6202
|
-
|
|
6245
|
+
const troubleActionExtensions = Object.values(
|
|
6246
|
+
buildRankedExtensionMap(
|
|
6247
|
+
getExtensions(TroubleActionExtension.id),
|
|
6248
|
+
"troubleType"
|
|
6249
|
+
)
|
|
6250
|
+
).map((ext) => ext.data);
|
|
6203
6251
|
const result = useKosModel({
|
|
6204
6252
|
modelId,
|
|
6205
6253
|
modelType: TroubleActionManager.type,
|
|
@@ -6877,6 +6925,9 @@ const useVisibleTroubles = (holder) => {
|
|
|
6877
6925
|
return { visibleTroubles, initialized };
|
|
6878
6926
|
};
|
|
6879
6927
|
const log$2 = KosLog.createLogger({ name: "holder-group-view" });
|
|
6928
|
+
const rankedByDashboardKey = (exts) => Object.fromEntries(
|
|
6929
|
+
Object.entries(buildRankedExtensionMap(exts, "dashboardKey")).filter(([, ext]) => !!ext.data).map(([dashboardKey, ext]) => [dashboardKey, ext.data])
|
|
6930
|
+
);
|
|
6880
6931
|
log$2.debug("holder-group-view component loaded");
|
|
6881
6932
|
const CardTitle$1 = styled.div`
|
|
6882
6933
|
align-items: start;
|
|
@@ -6961,7 +7012,26 @@ const HolderCard = kosComponent(
|
|
|
6961
7012
|
" ",
|
|
6962
7013
|
ingredientName
|
|
6963
7014
|
] });
|
|
6964
|
-
const
|
|
7015
|
+
const key = ExtensionManager.executeDashboardKeyFactory(holder) || "";
|
|
7016
|
+
const summaryExts = useMemo(
|
|
7017
|
+
() => getExtensions(DashboardPumpSummaryExtension.id),
|
|
7018
|
+
[getExtensions]
|
|
7019
|
+
);
|
|
7020
|
+
const summaries = useMemo(
|
|
7021
|
+
() => rankedByDashboardKey(summaryExts),
|
|
7022
|
+
[summaryExts]
|
|
7023
|
+
);
|
|
7024
|
+
const DashboardPumpSummaryComponent = useExtensionComponent(
|
|
7025
|
+
DashboardPumpSummaryExtension
|
|
7026
|
+
);
|
|
7027
|
+
const pumpSummary = !summaryBody && summaries[key] && DashboardPumpSummaryComponent ? /* @__PURE__ */ jsx(
|
|
7028
|
+
DashboardPumpSummaryComponent,
|
|
7029
|
+
{
|
|
7030
|
+
module: summaries[key]?.id,
|
|
7031
|
+
holder
|
|
7032
|
+
}
|
|
7033
|
+
) : void 0;
|
|
7034
|
+
const body = assigned && !hasTroubles && initialized && pumpSummary ? pumpSummary : assigned && hasFuelGuage && !hasTroubles && initialized ? summaryBody ?? /* @__PURE__ */ jsx(
|
|
6965
7035
|
FuelGauge,
|
|
6966
7036
|
{
|
|
6967
7037
|
color: hasTroubles ? "var(--ddk-generic-color-white)" : void 0,
|
|
@@ -6970,19 +7040,11 @@ const HolderCard = kosComponent(
|
|
|
6970
7040
|
}
|
|
6971
7041
|
) : null;
|
|
6972
7042
|
const indicatorColor = assigned && hasFuelGuage && !hasTroubles && initialized && getFillColor(fillPercent) || void 0;
|
|
6973
|
-
const key = ExtensionManager.executeDashboardKeyFactory(holder) || "";
|
|
6974
7043
|
const exts = useMemo(
|
|
6975
7044
|
() => getExtensions(DashboardPumpDetailExtension.id),
|
|
6976
7045
|
[getExtensions]
|
|
6977
7046
|
);
|
|
6978
|
-
const details = useMemo(
|
|
6979
|
-
() => exts.filter((ext) => !!ext.data).reduce((acc, ext) => {
|
|
6980
|
-
const data2 = ext.data;
|
|
6981
|
-
acc[data2.dashboardKey] = ext.data;
|
|
6982
|
-
return acc;
|
|
6983
|
-
}, {}),
|
|
6984
|
-
[exts]
|
|
6985
|
-
);
|
|
7047
|
+
const details = useMemo(() => rankedByDashboardKey(exts), [exts]);
|
|
6986
7048
|
const hasExtension = !!details[key];
|
|
6987
7049
|
const { HolderContent, modalOptions } = useHolderContent(holder);
|
|
6988
7050
|
const DashboardPumpDetailComponent = useExtensionComponent(
|
|
@@ -7173,10 +7235,8 @@ const MacroSummaryBody = kosComponent(
|
|
|
7173
7235
|
({ holder, dashboardKey, fallbackStatus }) => {
|
|
7174
7236
|
const { getExtensions } = usePluginExtensions();
|
|
7175
7237
|
const exts = getExtensions(DashboardMacroSummaryExtension.id);
|
|
7176
|
-
const
|
|
7177
|
-
|
|
7178
|
-
return data?.dashboardKey === k;
|
|
7179
|
-
});
|
|
7238
|
+
const ranked = buildRankedExtensionMap(exts, "dashboardKey");
|
|
7239
|
+
const findByKey = (k) => k ? ranked[k] : void 0;
|
|
7180
7240
|
const match = findByKey(holder.name) ?? findByKey(dashboardKey);
|
|
7181
7241
|
const Component = useExtensionComponent(DashboardMacroSummaryExtension);
|
|
7182
7242
|
if (match && Component) {
|
|
@@ -7225,11 +7285,9 @@ const MacroHolderCard = kosComponent(
|
|
|
7225
7285
|
const modalTitle = /* @__PURE__ */ jsx(CardTitle, { children: titleText });
|
|
7226
7286
|
const key = ExtensionManager.executeDashboardKeyFactory(holder) || "";
|
|
7227
7287
|
const exts = getExtensions(DashboardPumpDetailExtension.id);
|
|
7228
|
-
const details =
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
return acc;
|
|
7232
|
-
}, {});
|
|
7288
|
+
const details = Object.fromEntries(
|
|
7289
|
+
Object.entries(buildRankedExtensionMap(exts, "dashboardKey")).filter(([, ext]) => !!ext.data).map(([dashboardKey, ext]) => [dashboardKey, ext.data])
|
|
7290
|
+
);
|
|
7233
7291
|
const hasExtension = !!details[key];
|
|
7234
7292
|
const { HolderContent, modalOptions } = useHolderContent(holder);
|
|
7235
7293
|
const DashboardPumpDetailComponent = useExtensionComponent(
|
|
@@ -9206,28 +9264,28 @@ const StateExperience = kosComponent(
|
|
|
9206
9264
|
useEffect(() => {
|
|
9207
9265
|
const dispose = kosAutoEffect(() => {
|
|
9208
9266
|
const ext = getExtensions(TroubleActionExtension.id);
|
|
9267
|
+
const byTroubleType = buildRankedExtensionMap(ext, "troubleType");
|
|
9209
9268
|
const getStateKeyForTroubleType = (troubleType) => {
|
|
9210
|
-
const extension =
|
|
9211
|
-
(e) => e.data.troubleType === troubleType
|
|
9212
|
-
);
|
|
9269
|
+
const extension = byTroubleType[troubleType];
|
|
9213
9270
|
const data = extension?.data;
|
|
9214
9271
|
return extension ? data.stateKey ?? data.troubleType : void 0;
|
|
9215
9272
|
};
|
|
9216
|
-
const
|
|
9217
|
-
|
|
9218
|
-
|
|
9219
|
-
|
|
9220
|
-
|
|
9221
|
-
|
|
9222
|
-
|
|
9223
|
-
|
|
9224
|
-
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
|
|
9273
|
+
const byStateKey = buildRankedExtensionMap(ext, (extension) => {
|
|
9274
|
+
const data = extension.data;
|
|
9275
|
+
return data.stateKey ?? data.troubleType;
|
|
9276
|
+
});
|
|
9277
|
+
const experienceMap = Object.values(byStateKey).reduce((acc, extension) => {
|
|
9278
|
+
const data = extension.data;
|
|
9279
|
+
const mapKey = data.stateKey ?? data.troubleType;
|
|
9280
|
+
acc[mapKey] = {
|
|
9281
|
+
extension: TroubleActionExtension.id,
|
|
9282
|
+
module: extension.id,
|
|
9283
|
+
namespace: data.namespace,
|
|
9284
|
+
title: data.title,
|
|
9285
|
+
stateValue: data.stateValue ?? data.troubleType
|
|
9286
|
+
};
|
|
9287
|
+
return acc;
|
|
9288
|
+
}, {});
|
|
9231
9289
|
const currentTroubleType = troubleAction?.activeTroubleType;
|
|
9232
9290
|
const currentTrouble = troubleAction?.activeTrouble;
|
|
9233
9291
|
const currentStateKey = currentTroubleType ? getStateKeyForTroubleType(currentTroubleType) : void 0;
|
|
@@ -9536,6 +9594,7 @@ export {
|
|
|
9536
9594
|
DashboardOperationsContext,
|
|
9537
9595
|
DashboardOperationsProvider,
|
|
9538
9596
|
DashboardPumpDetailExtension,
|
|
9597
|
+
DashboardPumpSummaryExtension,
|
|
9539
9598
|
DashboardSummaryExtension,
|
|
9540
9599
|
DatePickerCard,
|
|
9541
9600
|
DiagnosticsModal,
|
|
@@ -9557,6 +9616,9 @@ export {
|
|
|
9557
9616
|
EXTENSION_POINT_DASHBOARD_PUMP_DETAIL,
|
|
9558
9617
|
EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_DEF,
|
|
9559
9618
|
EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_VIEW,
|
|
9619
|
+
EXTENSION_POINT_DASHBOARD_PUMP_SUMMARY,
|
|
9620
|
+
EXTENSION_POINT_DASHBOARD_PUMP_SUMMARY_DEF,
|
|
9621
|
+
EXTENSION_POINT_DASHBOARD_PUMP_SUMMARY_VIEW,
|
|
9560
9622
|
EXTENSION_POINT_DASHBOARD_SUMMARY,
|
|
9561
9623
|
EXTENSION_POINT_DASHBOARD_SUMMARY_DEF,
|
|
9562
9624
|
EXTENSION_POINT_DASHBOARD_SUMMARY_VIEW,
|