@e-llm-studio/instant-learning 1.3.5 → 1.3.7
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/dist/CommonConstants/CommonConstants.js +10 -0
- package/dist/CommonConstants/CommonConstants.js.map +1 -0
- package/dist/ComponentRegistry.js +1 -0
- package/dist/ComponentRegistry.js.map +1 -1
- package/dist/ILMarketplaceWrapper.js +16 -11
- package/dist/ILMarketplaceWrapper.js.map +1 -1
- package/dist/cjs/CommonConstants/CommonConstants.js +15 -0
- package/dist/cjs/CommonConstants/CommonConstants.js.map +1 -0
- package/dist/cjs/ComponentRegistry.js +1 -0
- package/dist/cjs/ComponentRegistry.js.map +1 -1
- package/dist/cjs/ILMarketplaceWrapper.js +16 -11
- package/dist/cjs/ILMarketplaceWrapper.js.map +1 -1
- package/dist/cjs/features/IL-OTJ/ILOTJ.js +1 -1
- package/dist/cjs/features/IL-OTJ/ILOTJ.js.map +1 -1
- package/dist/cjs/features/IL-OTJ/_components/ChatComponents/ChatComponent.js +3 -10
- package/dist/cjs/features/IL-OTJ/_components/ChatComponents/ChatComponent.js.map +1 -1
- package/dist/cjs/features/IL-OTJ/_components/ChatComponents/NormalChat.js +3 -11
- package/dist/cjs/features/IL-OTJ/_components/ChatComponents/NormalChat.js.map +1 -1
- package/dist/cjs/features/IL-marketplace/PromoteFlow/PreflightDetailsPage.js +220 -0
- package/dist/cjs/features/IL-marketplace/PromoteFlow/PreflightDetailsPage.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/PromoteFlow/PreflightDetailsPage.module.css.js +12 -0
- package/dist/cjs/features/IL-marketplace/PromoteFlow/PreflightDetailsPage.module.css.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/PromoteFlow/PromoteFlow.js +240 -183
- package/dist/cjs/features/IL-marketplace/PromoteFlow/PromoteFlow.js.map +1 -1
- package/dist/cjs/features/IL-marketplace/PromoteFlow/PromoteFlow.module.css.js +2 -2
- package/dist/cjs/features/IL-marketplace/PromoteFlow/promote-constants.js +69 -0
- package/dist/cjs/features/IL-marketplace/PromoteFlow/promote-constants.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/PromoteFlow/promote-flow.api.js +52 -12
- package/dist/cjs/features/IL-marketplace/PromoteFlow/promote-flow.api.js.map +1 -1
- package/dist/cjs/features/IL-marketplace/components/ILMarketPlacePublish/PublishToMarketplaceCompnent.js +7 -4
- package/dist/cjs/features/IL-marketplace/components/ILMarketPlacePublish/PublishToMarketplaceCompnent.js.map +1 -1
- package/dist/cjs/features/LearningManagement/LearningManagement.js +1 -4
- package/dist/cjs/features/LearningManagement/LearningManagement.js.map +1 -1
- package/dist/cjs/features/LearningManagement/LearningTemplateLayout.js +25 -2
- package/dist/cjs/features/LearningManagement/LearningTemplateLayout.js.map +1 -1
- package/dist/cjs/features/LearningManagement/Sidebar.js +25 -9
- package/dist/cjs/features/LearningManagement/Sidebar.js.map +1 -1
- package/dist/cjs/features/LearningManagement/SidebarWrapper.js +6 -2
- package/dist/cjs/features/LearningManagement/SidebarWrapper.js.map +1 -1
- package/dist/cjs/features/LearningManagement/components/InstantLearningModalDynamic.js +15 -2
- package/dist/cjs/features/LearningManagement/components/InstantLearningModalDynamic.js.map +1 -1
- package/dist/cjs/features/LearningManagement/store/useLMSConfigStore.js +1 -0
- package/dist/cjs/features/LearningManagement/store/useLMSConfigStore.js.map +1 -1
- package/dist/cjs/features/LearningManagement/styles/LearningTemplateLayout.module.css.js +2 -2
- package/dist/cjs/features/LearningManagement/styles/Sidebar.module.css.js +2 -2
- package/dist/cjs/schema-driven/components/DropdownSectionField.js +26 -2
- package/dist/cjs/schema-driven/components/DropdownSectionField.js.map +1 -1
- package/dist/cjs/schema-driven/components/GroupEditRow.js +11 -5
- package/dist/cjs/schema-driven/components/GroupEditRow.js.map +1 -1
- package/dist/cjs/schema-driven/components/PageRangeInputField.js +91 -0
- package/dist/cjs/schema-driven/components/PageRangeInputField.js.map +1 -0
- package/dist/cjs/schema-driven/components/TableComponent.js +63 -51
- package/dist/cjs/schema-driven/components/TableComponent.js.map +1 -1
- package/dist/cjs/schema-driven/helper.js +69 -3
- package/dist/cjs/schema-driven/helper.js.map +1 -1
- package/dist/cjs/schema-driven/hooks/useSectionEditSession.js +5 -1
- package/dist/cjs/schema-driven/hooks/useSectionEditSession.js.map +1 -1
- package/dist/cjs/schema-driven/types.js.map +1 -1
- package/dist/cjs/schema-driven/utils/PayloadUtils.js +4 -2
- package/dist/cjs/schema-driven/utils/PayloadUtils.js.map +1 -1
- package/dist/features/IL-OTJ/ILOTJ.js +1 -1
- package/dist/features/IL-OTJ/ILOTJ.js.map +1 -1
- package/dist/features/IL-OTJ/_components/ChatComponents/ChatComponent.js +3 -10
- package/dist/features/IL-OTJ/_components/ChatComponents/ChatComponent.js.map +1 -1
- package/dist/features/IL-OTJ/_components/ChatComponents/NormalChat.js +3 -11
- package/dist/features/IL-OTJ/_components/ChatComponents/NormalChat.js.map +1 -1
- package/dist/features/IL-marketplace/PromoteFlow/PreflightDetailsPage.js +216 -0
- package/dist/features/IL-marketplace/PromoteFlow/PreflightDetailsPage.js.map +1 -0
- package/dist/features/IL-marketplace/PromoteFlow/PreflightDetailsPage.module.css.js +8 -0
- package/dist/features/IL-marketplace/PromoteFlow/PreflightDetailsPage.module.css.js.map +1 -0
- package/dist/features/IL-marketplace/PromoteFlow/PromoteFlow.js +238 -177
- package/dist/features/IL-marketplace/PromoteFlow/PromoteFlow.js.map +1 -1
- package/dist/features/IL-marketplace/PromoteFlow/PromoteFlow.module.css.js +2 -2
- package/dist/features/IL-marketplace/PromoteFlow/promote-constants.js +51 -0
- package/dist/features/IL-marketplace/PromoteFlow/promote-constants.js.map +1 -0
- package/dist/features/IL-marketplace/PromoteFlow/promote-flow.api.js +52 -12
- package/dist/features/IL-marketplace/PromoteFlow/promote-flow.api.js.map +1 -1
- package/dist/features/IL-marketplace/components/ILMarketPlacePublish/PublishToMarketplaceCompnent.js +7 -4
- package/dist/features/IL-marketplace/components/ILMarketPlacePublish/PublishToMarketplaceCompnent.js.map +1 -1
- package/dist/features/LearningManagement/LearningManagement.js +1 -4
- package/dist/features/LearningManagement/LearningManagement.js.map +1 -1
- package/dist/features/LearningManagement/LearningTemplateLayout.js +27 -4
- package/dist/features/LearningManagement/LearningTemplateLayout.js.map +1 -1
- package/dist/features/LearningManagement/Sidebar.js +25 -9
- package/dist/features/LearningManagement/Sidebar.js.map +1 -1
- package/dist/features/LearningManagement/SidebarWrapper.js +6 -2
- package/dist/features/LearningManagement/SidebarWrapper.js.map +1 -1
- package/dist/features/LearningManagement/components/InstantLearningModalDynamic.js +15 -2
- package/dist/features/LearningManagement/components/InstantLearningModalDynamic.js.map +1 -1
- package/dist/features/LearningManagement/store/useLMSConfigStore.js +1 -0
- package/dist/features/LearningManagement/store/useLMSConfigStore.js.map +1 -1
- package/dist/features/LearningManagement/styles/LearningTemplateLayout.module.css.js +2 -2
- package/dist/features/LearningManagement/styles/Sidebar.module.css.js +2 -2
- package/dist/schema-driven/components/DropdownSectionField.js +26 -2
- package/dist/schema-driven/components/DropdownSectionField.js.map +1 -1
- package/dist/schema-driven/components/GroupEditRow.js +11 -5
- package/dist/schema-driven/components/GroupEditRow.js.map +1 -1
- package/dist/schema-driven/components/PageRangeInputField.js +87 -0
- package/dist/schema-driven/components/PageRangeInputField.js.map +1 -0
- package/dist/schema-driven/components/TableComponent.js +64 -52
- package/dist/schema-driven/components/TableComponent.js.map +1 -1
- package/dist/schema-driven/helper.js +65 -4
- package/dist/schema-driven/helper.js.map +1 -1
- package/dist/schema-driven/hooks/useSectionEditSession.js +5 -1
- package/dist/schema-driven/hooks/useSectionEditSession.js.map +1 -1
- package/dist/schema-driven/types.js.map +1 -1
- package/dist/schema-driven/utils/PayloadUtils.js +4 -2
- package/dist/schema-driven/utils/PayloadUtils.js.map +1 -1
- package/dist/types/src/CommonConstants/CommonConstants.d.ts +7 -0
- package/dist/types/src/CommonConstants/CommonConstants.d.ts.map +1 -1
- package/dist/types/src/ComponentRegistry.d.ts.map +1 -1
- package/dist/types/src/ILMarketplaceWrapper.d.ts +2 -2
- package/dist/types/src/ILMarketplaceWrapper.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ChatComponents/ChatComponent.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ChatComponents/NormalChat.d.ts.map +1 -1
- package/dist/types/src/features/IL-marketplace/PromoteFlow/PreflightDetailsPage.d.ts +9 -0
- package/dist/types/src/features/IL-marketplace/PromoteFlow/PreflightDetailsPage.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/PromoteFlow/PromoteFlow.d.ts.map +1 -1
- package/dist/types/src/features/IL-marketplace/PromoteFlow/promote-constants.d.ts +23 -0
- package/dist/types/src/features/IL-marketplace/PromoteFlow/promote-constants.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/PromoteFlow/promote-flow.api.d.ts +1 -1
- package/dist/types/src/features/IL-marketplace/PromoteFlow/promote-flow.api.d.ts.map +1 -1
- package/dist/types/src/features/IL-marketplace/PromoteFlow/promote-flow.interfaces.d.ts +26 -0
- package/dist/types/src/features/IL-marketplace/PromoteFlow/promote-flow.interfaces.d.ts.map +1 -1
- package/dist/types/src/features/IL-marketplace/components/ILMarketPlacePublish/PublishToMarketplaceCompnent.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/LearningManagement.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/Sidebar.d.ts +3 -0
- package/dist/types/src/features/LearningManagement/Sidebar.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/SidebarWrapper.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/SidebarWrapper.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/InstantLearningModalDynamic.d.ts +14 -1
- package/dist/types/src/features/LearningManagement/components/InstantLearningModalDynamic.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/store/useLMSConfigStore.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/store/useLMSConfigStore.d.ts.map +1 -1
- package/dist/types/src/schema-driven/components/DropdownSectionField.d.ts.map +1 -1
- package/dist/types/src/schema-driven/components/GroupEditRow.d.ts.map +1 -1
- package/dist/types/src/schema-driven/components/PageRangeInputField.d.ts +8 -0
- package/dist/types/src/schema-driven/components/PageRangeInputField.d.ts.map +1 -0
- package/dist/types/src/schema-driven/components/TableComponent.d.ts.map +1 -1
- package/dist/types/src/schema-driven/helper.d.ts +13 -1
- package/dist/types/src/schema-driven/helper.d.ts.map +1 -1
- package/dist/types/src/schema-driven/hooks/useSectionEditSession.d.ts.map +1 -1
- package/dist/types/src/schema-driven/types.d.ts +11 -0
- package/dist/types/src/schema-driven/types.d.ts.map +1 -1
- package/dist/types/src/schema-driven/utils/PayloadUtils.d.ts.map +1 -1
- package/package.json +5 -4
|
@@ -4,65 +4,47 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var Tooltip = require('@mui/material/Tooltip');
|
|
8
|
-
var styles = require('@mui/material/styles');
|
|
9
7
|
var lucideReact = require('lucide-react');
|
|
10
8
|
var utils = require('../utils.js');
|
|
11
9
|
var EnvironmentConfigurationModal = require('./EnvironmentConfigurationModal.js');
|
|
10
|
+
var PreflightDetailsPage = require('./PreflightDetailsPage.js');
|
|
11
|
+
var promoteConstants = require('./promote-constants.js');
|
|
12
12
|
var promoteFlow_api = require('./promote-flow.api.js');
|
|
13
13
|
var promoteFlow_store = require('./promote-flow.store.js');
|
|
14
14
|
var promoteFlow_utils = require('./promote-flow.utils.js');
|
|
15
15
|
var PromoteFlow_module = require('./PromoteFlow.module.css.js');
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
title: "Overview"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
id: "history",
|
|
45
|
-
title: "Promotion History",
|
|
46
|
-
comingSoon: false
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
id: "database",
|
|
50
|
-
title: "Database Details",
|
|
51
|
-
comingSoon: false
|
|
52
|
-
}
|
|
53
|
-
// {
|
|
54
|
-
// id: 'knowledgebase',
|
|
55
|
-
// title: 'Knowledgebase Details',
|
|
56
|
-
// comingSoon: true,
|
|
57
|
-
// },
|
|
58
|
-
];
|
|
17
|
+
const isTenantEnvironment = (environment) => environment === "tenantSource" || environment === "tenantDestination";
|
|
18
|
+
const isSourceEnvironment = (environment) => environment === "source" || environment === "tenantSource";
|
|
19
|
+
const getLatestPromotion = (history) => history.reduce((latest, entry) => {
|
|
20
|
+
if (!latest) return entry;
|
|
21
|
+
return Date.parse(entry.updated_at) > Date.parse(latest.updated_at) ? entry : latest;
|
|
22
|
+
}, null);
|
|
23
|
+
const getDefaultEnvironmentTier = (environment, selectedEnvironment, permittedDestinationTiers) => {
|
|
24
|
+
var _a;
|
|
25
|
+
return (_a = selectedEnvironment == null ? void 0 : selectedEnvironment.env_tier) != null ? _a : isSourceEnvironment(environment) ? promoteConstants.DEFAULT_SOURCE_ENVIRONMENT_TIER : permittedDestinationTiers[0];
|
|
26
|
+
};
|
|
27
|
+
const getPromotionActionRestriction = (isPromotionInProgress, hasScheduledPromotion) => {
|
|
28
|
+
if (isPromotionInProgress) return promoteConstants.PROMOTION_IN_PROGRESS_TOOLTIP;
|
|
29
|
+
if (hasScheduledPromotion) return promoteConstants.SCHEDULED_PROMOTION_TOOLTIP;
|
|
30
|
+
return null;
|
|
31
|
+
};
|
|
32
|
+
const getHistoryActionLabel = (isPending, canRollback) => {
|
|
33
|
+
if (!isPending) return canRollback ? "Rollback" : "View details";
|
|
34
|
+
return canRollback ? "Rolling back\u2026" : "Loading\u2026";
|
|
35
|
+
};
|
|
36
|
+
const getPreflightResultMessage = ({
|
|
37
|
+
ready,
|
|
38
|
+
items_ready,
|
|
39
|
+
items_checked
|
|
40
|
+
}) => ready ? `Migration is ready (${items_ready}/${items_checked} checks passed).` : `Migration readiness requires attention (${items_ready}/${items_checked} checks passed).`;
|
|
59
41
|
const isMissingPromotionStatus = (error) => {
|
|
60
42
|
var _a;
|
|
61
43
|
if (error instanceof Error && error.message.includes("404")) return true;
|
|
62
44
|
return typeof error === "object" && error !== null && "response" in error && ((_a = error.response) == null ? void 0 : _a.status) === 404;
|
|
63
45
|
};
|
|
64
46
|
function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
65
|
-
var _a, _b, _c, _d
|
|
47
|
+
var _a, _b, _c, _d;
|
|
66
48
|
const [openSections, setOpenSections] = React.useState({
|
|
67
49
|
overview: true
|
|
68
50
|
});
|
|
@@ -83,6 +65,8 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
83
65
|
const [isStatusPollingStopped, setIsStatusPollingStopped] = React.useState(false);
|
|
84
66
|
const [isInitialStatusLoading, setIsInitialStatusLoading] = React.useState(true);
|
|
85
67
|
const [isCheckingPreflight, setIsCheckingPreflight] = React.useState(false);
|
|
68
|
+
const [isViewingPreflightDetails, setIsViewingPreflightDetails] = React.useState(false);
|
|
69
|
+
const [promotionStatusForActions, setPromotionStatusForActions] = React.useState(null);
|
|
86
70
|
const [preflightResult, setPreflightResult] = React.useState(null);
|
|
87
71
|
const sourceEnvironment = promoteFlow_store.usePromoteFlowStore((state) => state.sourceEnvironment);
|
|
88
72
|
const destinationEnvironment = promoteFlow_store.usePromoteFlowStore((state) => state.destinationEnvironment);
|
|
@@ -102,7 +86,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
102
86
|
const resetPromotionSession = promoteFlow_store.usePromoteFlowStore((state) => state.resetPromotionSession);
|
|
103
87
|
const title = utils.getGuidelineTitle(guideline);
|
|
104
88
|
const versionLabel = guideline.version ? `v${guideline.version}` : "v1";
|
|
105
|
-
const statusLabel = (_a = guideline.status) != null ? _a :
|
|
89
|
+
const statusLabel = (_a = guideline.status) != null ? _a : promoteConstants.DEFAULT_GUIDELINE_STATUS;
|
|
106
90
|
const guidelineResourceId = promoteFlow_utils.getPromotionResourceId(guideline);
|
|
107
91
|
const promotionTaskForGuideline = promotionResourceId === guidelineResourceId ? promotionTask : null;
|
|
108
92
|
const errorForGuideline = errorResourceId === guidelineResourceId ? error : null;
|
|
@@ -118,13 +102,43 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
118
102
|
);
|
|
119
103
|
const isPromoting = Boolean(promotionTaskForGuideline);
|
|
120
104
|
const canRetryPromotion = (promotionTaskForGuideline == null ? void 0 : promotionTaskForGuideline.status) === "FAILED";
|
|
121
|
-
const sourceTier = (_b = sourceEnvironment == null ? void 0 : sourceEnvironment.env_tier) != null ? _b :
|
|
105
|
+
const sourceTier = (_b = sourceEnvironment == null ? void 0 : sourceEnvironment.env_tier) != null ? _b : promoteConstants.DEFAULT_SOURCE_ENVIRONMENT_TIER;
|
|
122
106
|
const permittedDestinationTiers = React.useMemo(
|
|
123
107
|
() => promoteFlow_utils.getPermittedDestinationTiers(sourceTier),
|
|
124
108
|
[sourceTier]
|
|
125
109
|
);
|
|
126
|
-
const
|
|
127
|
-
|
|
110
|
+
const environments = {
|
|
111
|
+
source: sourceEnvironment,
|
|
112
|
+
destination: destinationEnvironment,
|
|
113
|
+
tenantSource: tenantSourceEnvironment,
|
|
114
|
+
tenantDestination: tenantDestinationEnvironment
|
|
115
|
+
};
|
|
116
|
+
const selectedEnvironment = configuredEnvironment ? environments[configuredEnvironment] : void 0;
|
|
117
|
+
const configuredEnvironmentDefaultTier = configuredEnvironment ? getDefaultEnvironmentTier(
|
|
118
|
+
configuredEnvironment,
|
|
119
|
+
selectedEnvironment,
|
|
120
|
+
permittedDestinationTiers
|
|
121
|
+
) : promoteConstants.DEFAULT_SOURCE_ENVIRONMENT_TIER;
|
|
122
|
+
const configuredEnvironmentIsSource = configuredEnvironment ? isSourceEnvironment(configuredEnvironment) : true;
|
|
123
|
+
const configuredEnvironmentIsTenant = configuredEnvironment ? isTenantEnvironment(configuredEnvironment) : false;
|
|
124
|
+
const modalInitialConfiguration = selectedEnvironment ? {
|
|
125
|
+
env_name: selectedEnvironment.env_name,
|
|
126
|
+
env_tier: selectedEnvironment.env_tier,
|
|
127
|
+
db_type: selectedEnvironment.db_type,
|
|
128
|
+
host: selectedEnvironment.host,
|
|
129
|
+
port: String(selectedEnvironment.port),
|
|
130
|
+
username: selectedEnvironment.username,
|
|
131
|
+
password: "",
|
|
132
|
+
database_name: selectedEnvironment.database_name,
|
|
133
|
+
is_tenant_db: selectedEnvironment.is_tenant_db
|
|
134
|
+
} : {
|
|
135
|
+
...promoteFlow_utils.EMPTY_ENVIRONMENT_CONFIGURATION,
|
|
136
|
+
env_tier: configuredEnvironmentDefaultTier,
|
|
137
|
+
db_type: !configuredEnvironmentIsSource && configuredEnvironmentDefaultTier === "external" ? "EXTERNAL" : "INTERNAL",
|
|
138
|
+
is_tenant_db: configuredEnvironmentIsTenant
|
|
139
|
+
};
|
|
140
|
+
const modalPermittedTiers = configuredEnvironmentIsSource ? promoteConstants.PERMITTED_SOURCE_TIERS : permittedDestinationTiers;
|
|
141
|
+
const modalPresetTier = configSearchTier != null ? configSearchTier : configuredEnvironmentDefaultTier;
|
|
128
142
|
const latestPromotionForPair = React.useMemo(
|
|
129
143
|
() => promoteFlow_utils.getLatestPromotionForEnvironmentPair(
|
|
130
144
|
promotionHistory,
|
|
@@ -133,18 +147,36 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
133
147
|
),
|
|
134
148
|
[destinationEnvironment, promotionHistory, sourceEnvironment]
|
|
135
149
|
);
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
150
|
+
const latestPromotion = React.useMemo(() => getLatestPromotion(promotionHistory), [promotionHistory]);
|
|
151
|
+
const latestPromotionTaskId = (_c = latestPromotion == null ? void 0 : latestPromotion.promotion_task_id) != null ? _c : null;
|
|
152
|
+
const isPromotionInProgress = promoteConstants.PROMOTION_IN_PROGRESS_STATUSES.some(
|
|
153
|
+
(status) => status === (promotionStatusForActions == null ? void 0 : promotionStatusForActions.status)
|
|
154
|
+
);
|
|
155
|
+
const hasScheduledPromotion = (latestPromotion == null ? void 0 : latestPromotion.status) === "SCHEDULED" || (promotionStatusForActions == null ? void 0 : promotionStatusForActions.status) === "SCHEDULED";
|
|
156
|
+
const promotionActionRestriction = getPromotionActionRestriction(
|
|
157
|
+
isPromotionInProgress,
|
|
158
|
+
hasScheduledPromotion
|
|
159
|
+
);
|
|
160
|
+
const canCheckPromotionReadiness = canPromote && !promotionActionRestriction;
|
|
161
|
+
const canPromoteNow = canPromote && !promotionActionRestriction;
|
|
162
|
+
const canPromoteLater = canPromote && !isPromotionInProgress;
|
|
163
|
+
const readinessAndNowTooltip = promotionActionRestriction != null ? promotionActionRestriction : promoteConstants.ENVIRONMENT_CONFIGURATION_TOOLTIP;
|
|
164
|
+
const promoteLaterTooltip = isPromotionInProgress ? promotionActionRestriction : promoteConstants.ENVIRONMENT_CONFIGURATION_TOOLTIP;
|
|
147
165
|
const promoteActionLabel = (latestPromotionForPair == null ? void 0 : latestPromotionForPair.status) === "SUCCESS" ? "Sync" : "Promote Now";
|
|
166
|
+
const createPromotionRequest = () => {
|
|
167
|
+
if (!sourceEnvironment || !destinationEnvironment) return null;
|
|
168
|
+
return {
|
|
169
|
+
resource_id: guidelineResourceId,
|
|
170
|
+
resource_type: "PACKAGE",
|
|
171
|
+
target_version: "latest",
|
|
172
|
+
global_source_env_id: sourceEnvironment.env_id,
|
|
173
|
+
global_target_env_id: destinationEnvironment.env_id,
|
|
174
|
+
...tenantSourceEnvironment && tenantDestinationEnvironment ? {
|
|
175
|
+
tenant_source_env_id: tenantSourceEnvironment.env_id,
|
|
176
|
+
tenant_target_env_id: tenantDestinationEnvironment.env_id
|
|
177
|
+
} : {}
|
|
178
|
+
};
|
|
179
|
+
};
|
|
148
180
|
const toggleSection = (id) => {
|
|
149
181
|
setOpenSections((current) => ({ ...current, [id]: !current[id] }));
|
|
150
182
|
};
|
|
@@ -154,9 +186,11 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
154
186
|
setIsInitialStatusLoading(true);
|
|
155
187
|
setError(null);
|
|
156
188
|
setPromotionTask(null);
|
|
189
|
+
setPromotionStatusForActions(null);
|
|
157
190
|
const refreshInitialPromotionState = async () => {
|
|
158
191
|
try {
|
|
159
|
-
await promoteFlow_api.getPromotionStatus(guidelineResourceId);
|
|
192
|
+
const status = await promoteFlow_api.getPromotionStatus(guidelineResourceId);
|
|
193
|
+
if (isCurrent) setPromotionStatusForActions(status);
|
|
160
194
|
} catch (statusError) {
|
|
161
195
|
if (isCurrent && !isMissingPromotionStatus(statusError)) {
|
|
162
196
|
setError(
|
|
@@ -192,14 +226,20 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
192
226
|
promoteFlow_api.getSchemaPreview(guidelineResourceId).then((preview) => {
|
|
193
227
|
if (!isCurrent) return;
|
|
194
228
|
setSchemaPreview(
|
|
195
|
-
Object.entries(preview != null ? preview : {}).reduce(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
229
|
+
Object.entries(preview != null ? preview : {}).reduce(
|
|
230
|
+
(groups, [key, value]) => {
|
|
231
|
+
if (value && Array.isArray(value.tables)) groups[key] = value;
|
|
232
|
+
return groups;
|
|
233
|
+
},
|
|
234
|
+
{}
|
|
235
|
+
)
|
|
199
236
|
);
|
|
200
237
|
}).catch((schemaError) => {
|
|
201
238
|
if (isCurrent) {
|
|
202
|
-
console.error("Failed to load schema preview", {
|
|
239
|
+
console.error("Failed to load schema preview", {
|
|
240
|
+
resourceId: guidelineResourceId,
|
|
241
|
+
schemaError
|
|
242
|
+
});
|
|
203
243
|
setSchemaPreview({});
|
|
204
244
|
}
|
|
205
245
|
}).finally(() => {
|
|
@@ -210,18 +250,20 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
210
250
|
};
|
|
211
251
|
}, [guidelineResourceId]);
|
|
212
252
|
React.useEffect(() => {
|
|
213
|
-
var _a2, _b2, _c2, _d2;
|
|
214
253
|
if (!configuredEnvironment) return;
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
254
|
+
const defaultTier = getDefaultEnvironmentTier(
|
|
255
|
+
configuredEnvironment,
|
|
256
|
+
environments[configuredEnvironment],
|
|
257
|
+
permittedDestinationTiers
|
|
258
|
+
);
|
|
259
|
+
const environmentTier = configSearchTier != null ? configSearchTier : defaultTier;
|
|
218
260
|
let isCurrent = true;
|
|
219
261
|
setIsLoadingConfigs(true);
|
|
220
262
|
setPromotionConfigs([]);
|
|
221
263
|
promoteFlow_api.searchEnvironmentConfigs({
|
|
222
|
-
env_tier:
|
|
223
|
-
db_type:
|
|
224
|
-
is_tenant: configuredEnvironment
|
|
264
|
+
env_tier: environmentTier,
|
|
265
|
+
db_type: environmentTier === "external" ? "EXTERNAL" : "INTERNAL",
|
|
266
|
+
is_tenant: isTenantEnvironment(configuredEnvironment)
|
|
225
267
|
}).then((configs) => {
|
|
226
268
|
if (isCurrent) setPromotionConfigs(configs);
|
|
227
269
|
}).catch(() => {
|
|
@@ -263,12 +305,15 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
263
305
|
};
|
|
264
306
|
}, [promotionTaskForGuideline == null ? void 0 : promotionTaskForGuideline.created_by, promotionTaskForGuideline == null ? void 0 : promotionTaskForGuideline.promotion_task_id]);
|
|
265
307
|
React.useEffect(() => {
|
|
266
|
-
|
|
308
|
+
const promotionStatusToPoll = promotionTaskForGuideline != null ? promotionTaskForGuideline : promotionStatusForActions;
|
|
309
|
+
if (!promotionStatusToPoll || isStatusPollingStopped || !promoteConstants.PROMOTION_IN_PROGRESS_STATUSES.some((status) => status === promotionStatusToPoll.status)) {
|
|
267
310
|
return;
|
|
268
311
|
}
|
|
269
312
|
const pollStatus = async () => {
|
|
270
313
|
try {
|
|
271
|
-
|
|
314
|
+
const status = await promoteFlow_api.getPromotionStatus(guidelineResourceId);
|
|
315
|
+
if (promotionTaskForGuideline) setPromotionTask(status, guidelineResourceId);
|
|
316
|
+
setPromotionStatusForActions(status);
|
|
272
317
|
} catch (pollError) {
|
|
273
318
|
setIsStatusPollingStopped(true);
|
|
274
319
|
setError(
|
|
@@ -277,30 +322,31 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
277
322
|
);
|
|
278
323
|
}
|
|
279
324
|
};
|
|
280
|
-
const intervalId = window.setInterval(pollStatus,
|
|
325
|
+
const intervalId = window.setInterval(pollStatus, promoteConstants.PROMOTION_POLL_INTERVAL_MS);
|
|
281
326
|
return () => window.clearInterval(intervalId);
|
|
282
|
-
}, [
|
|
327
|
+
}, [
|
|
328
|
+
guidelineResourceId,
|
|
329
|
+
isStatusPollingStopped,
|
|
330
|
+
promotionStatusForActions,
|
|
331
|
+
promotionTaskForGuideline,
|
|
332
|
+
setError,
|
|
333
|
+
setPromotionTask
|
|
334
|
+
]);
|
|
283
335
|
const handlePromoteNow = async () => {
|
|
284
|
-
|
|
336
|
+
const promotionRequest = createPromotionRequest();
|
|
337
|
+
if (!canPromoteNow || !promotionRequest) return;
|
|
285
338
|
setSubmitting(true);
|
|
286
339
|
setSubmittingAction("now");
|
|
287
340
|
setError(null);
|
|
288
341
|
try {
|
|
289
|
-
const task = await promoteFlow_api.startPromotion(
|
|
290
|
-
resource_id: promoteFlow_utils.getPromotionResourceId(guideline),
|
|
291
|
-
resource_type: "PACKAGE",
|
|
292
|
-
target_version: "latest",
|
|
293
|
-
global_source_env_id: sourceEnvironment.env_id,
|
|
294
|
-
global_target_env_id: destinationEnvironment.env_id,
|
|
295
|
-
...tenantSourceEnvironment && tenantDestinationEnvironment ? {
|
|
296
|
-
tenant_source_env_id: tenantSourceEnvironment.env_id,
|
|
297
|
-
tenant_target_env_id: tenantDestinationEnvironment.env_id
|
|
298
|
-
} : {}
|
|
299
|
-
});
|
|
342
|
+
const task = await promoteFlow_api.startPromotion(promotionRequest);
|
|
300
343
|
setIsStatusPollingStopped(false);
|
|
301
344
|
setPromotionTask(task, guidelineResourceId);
|
|
345
|
+
setPromotionStatusForActions(task);
|
|
302
346
|
try {
|
|
303
|
-
|
|
347
|
+
const status = await promoteFlow_api.getPromotionStatus(guidelineResourceId);
|
|
348
|
+
setPromotionTask(status, guidelineResourceId);
|
|
349
|
+
setPromotionStatusForActions(status);
|
|
304
350
|
} catch (e) {
|
|
305
351
|
}
|
|
306
352
|
onPromote == null ? void 0 : onPromote(guideline);
|
|
@@ -315,27 +361,15 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
315
361
|
}
|
|
316
362
|
};
|
|
317
363
|
const handlePreflightCheck = async () => {
|
|
318
|
-
|
|
364
|
+
const promotionRequest = createPromotionRequest();
|
|
365
|
+
if (!canCheckPromotionReadiness || !promotionRequest || isCheckingPreflight) return;
|
|
319
366
|
setIsCheckingPreflight(true);
|
|
320
367
|
setPreflightResult(null);
|
|
368
|
+
setIsViewingPreflightDetails(false);
|
|
321
369
|
setError(null);
|
|
322
370
|
try {
|
|
323
|
-
const result = await promoteFlow_api.checkPromotionPreflight(
|
|
324
|
-
|
|
325
|
-
resource_type: "PACKAGE",
|
|
326
|
-
target_version: "latest",
|
|
327
|
-
global_source_env_id: sourceEnvironment.env_id,
|
|
328
|
-
global_target_env_id: destinationEnvironment.env_id,
|
|
329
|
-
...tenantSourceEnvironment && tenantDestinationEnvironment ? {
|
|
330
|
-
tenant_source_env_id: tenantSourceEnvironment.env_id,
|
|
331
|
-
tenant_target_env_id: tenantDestinationEnvironment.env_id
|
|
332
|
-
} : {}
|
|
333
|
-
});
|
|
334
|
-
setPreflightResult({
|
|
335
|
-
ready: result.ready,
|
|
336
|
-
itemsChecked: result.items_checked,
|
|
337
|
-
itemsReady: result.items_ready
|
|
338
|
-
});
|
|
371
|
+
const result = await promoteFlow_api.checkPromotionPreflight(promotionRequest);
|
|
372
|
+
setPreflightResult(result);
|
|
339
373
|
} catch (preflightError) {
|
|
340
374
|
setError(
|
|
341
375
|
preflightError instanceof Error ? preflightError.message : "Unable to complete pre-flight check.",
|
|
@@ -346,10 +380,9 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
346
380
|
}
|
|
347
381
|
};
|
|
348
382
|
const handleSaveEnvironment = async (environment, configuration) => {
|
|
349
|
-
const isTenantEnvironment = environment === "tenantSource" || environment === "tenantDestination";
|
|
350
383
|
const configurationToSave = {
|
|
351
384
|
...configuration,
|
|
352
|
-
is_tenant_db: isTenantEnvironment
|
|
385
|
+
is_tenant_db: isTenantEnvironment(environment)
|
|
353
386
|
};
|
|
354
387
|
const response = await promoteFlow_api.createEnvironmentConfig(
|
|
355
388
|
promoteFlow_utils.toCreateEnvironmentConfigRequest(configurationToSave)
|
|
@@ -357,31 +390,20 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
357
390
|
setEnvironment(environment, promoteFlow_utils.toRegistryRecord(response.env_id, configurationToSave));
|
|
358
391
|
};
|
|
359
392
|
const openEnvironmentConfiguration = (environment) => {
|
|
360
|
-
var _a2;
|
|
361
|
-
const selected = environment === "source" ? sourceEnvironment : environment === "destination" ? destinationEnvironment : environment === "tenantSource" ? tenantSourceEnvironment : tenantDestinationEnvironment;
|
|
362
393
|
setConfigSearchTier(
|
|
363
|
-
(
|
|
394
|
+
getDefaultEnvironmentTier(environment, environments[environment], permittedDestinationTiers)
|
|
364
395
|
);
|
|
365
396
|
setConfiguredEnvironment(environment);
|
|
366
397
|
};
|
|
367
398
|
const handlePromoteLater = async () => {
|
|
368
399
|
var _a2, _b2;
|
|
369
|
-
|
|
400
|
+
const promotionRequest = createPromotionRequest();
|
|
401
|
+
if (!canPromoteLater || !promotionRequest) return;
|
|
370
402
|
setSubmitting(true);
|
|
371
403
|
setSubmittingAction("later");
|
|
372
404
|
setError(null);
|
|
373
405
|
try {
|
|
374
|
-
const scheduledPromotion = await promoteFlow_api.schedulePromotion(
|
|
375
|
-
resource_id: guidelineResourceId,
|
|
376
|
-
resource_type: "PACKAGE",
|
|
377
|
-
target_version: "latest",
|
|
378
|
-
global_source_env_id: sourceEnvironment.env_id,
|
|
379
|
-
global_target_env_id: destinationEnvironment.env_id,
|
|
380
|
-
...tenantSourceEnvironment && tenantDestinationEnvironment ? {
|
|
381
|
-
tenant_source_env_id: tenantSourceEnvironment.env_id,
|
|
382
|
-
tenant_target_env_id: tenantDestinationEnvironment.env_id
|
|
383
|
-
} : {}
|
|
384
|
-
});
|
|
406
|
+
const scheduledPromotion = await promoteFlow_api.schedulePromotion(promotionRequest);
|
|
385
407
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
386
408
|
setPromotionTask(
|
|
387
409
|
{
|
|
@@ -396,6 +418,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
396
418
|
},
|
|
397
419
|
guidelineResourceId
|
|
398
420
|
);
|
|
421
|
+
setPromotionStatusForActions(scheduledPromotion);
|
|
399
422
|
onPromote == null ? void 0 : onPromote(guideline);
|
|
400
423
|
} catch (promotionError) {
|
|
401
424
|
setError(
|
|
@@ -417,8 +440,11 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
417
440
|
const task = await promoteFlow_api.triggerScheduledPromotion(triggerUrl);
|
|
418
441
|
setIsStatusPollingStopped(false);
|
|
419
442
|
setPromotionTask(task, guidelineResourceId);
|
|
443
|
+
setPromotionStatusForActions(task);
|
|
420
444
|
try {
|
|
421
|
-
|
|
445
|
+
const status = await promoteFlow_api.getPromotionStatus(guidelineResourceId);
|
|
446
|
+
setPromotionTask(status, guidelineResourceId);
|
|
447
|
+
setPromotionStatusForActions(status);
|
|
422
448
|
} catch (e) {
|
|
423
449
|
}
|
|
424
450
|
onPromote == null ? void 0 : onPromote(guideline);
|
|
@@ -463,9 +489,29 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
463
489
|
setHistoryActionTaskId(null);
|
|
464
490
|
}
|
|
465
491
|
};
|
|
466
|
-
const handleBack = () => {
|
|
492
|
+
const handleBack = async () => {
|
|
467
493
|
if (promotionTaskForGuideline) {
|
|
468
494
|
setPromotionTask(null);
|
|
495
|
+
setIsInitialStatusLoading(true);
|
|
496
|
+
setIsLoadingHistory(true);
|
|
497
|
+
try {
|
|
498
|
+
const [status, history] = await Promise.all([
|
|
499
|
+
promoteFlow_api.getPromotionStatus(guidelineResourceId),
|
|
500
|
+
promoteFlow_api.getPromotionHistory(guidelineResourceId)
|
|
501
|
+
]);
|
|
502
|
+
setPromotionStatusForActions(status);
|
|
503
|
+
setPromotionHistory(history);
|
|
504
|
+
} catch (refreshError) {
|
|
505
|
+
if (!isMissingPromotionStatus(refreshError)) {
|
|
506
|
+
setError(
|
|
507
|
+
refreshError instanceof Error ? refreshError.message : "Unable to refresh promotion details.",
|
|
508
|
+
guidelineResourceId
|
|
509
|
+
);
|
|
510
|
+
}
|
|
511
|
+
} finally {
|
|
512
|
+
setIsInitialStatusLoading(false);
|
|
513
|
+
setIsLoadingHistory(false);
|
|
514
|
+
}
|
|
469
515
|
return;
|
|
470
516
|
}
|
|
471
517
|
handleGoToMarketplace();
|
|
@@ -605,7 +651,10 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
605
651
|
),
|
|
606
652
|
onClick: () => canRollback ? handleRollbackPromotion(row.promotion_task_id) : handleViewPromotionDetails(row.promotion_task_id),
|
|
607
653
|
disabled: isInitialStatusLoading || historyActionTaskId !== null,
|
|
608
|
-
children:
|
|
654
|
+
children: getHistoryActionLabel(
|
|
655
|
+
historyActionTaskId === row.promotion_task_id,
|
|
656
|
+
canRollback
|
|
657
|
+
)
|
|
609
658
|
}
|
|
610
659
|
)
|
|
611
660
|
] })
|
|
@@ -614,9 +663,11 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
614
663
|
] }) }) });
|
|
615
664
|
}
|
|
616
665
|
if (id === "database") {
|
|
617
|
-
if (isLoadingSchemaPreview)
|
|
666
|
+
if (isLoadingSchemaPreview)
|
|
667
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: PromoteFlow_module["default"].emptyBody, children: "Loading database details\u2026" });
|
|
618
668
|
const groups = Object.entries(schemaPreview);
|
|
619
|
-
if (groups.length === 0)
|
|
669
|
+
if (groups.length === 0)
|
|
670
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: PromoteFlow_module["default"].emptyBody, children: "No database details available." });
|
|
620
671
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: PromoteFlow_module["default"].databaseGrid, children: groups.flatMap(
|
|
621
672
|
([groupName, group]) => ["Source", "Destination"].map((environment) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: PromoteFlow_module["default"].databaseCard, children: [
|
|
622
673
|
/* @__PURE__ */ jsxRuntime.jsxs("h3", { children: [
|
|
@@ -639,6 +690,15 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
639
690
|
}
|
|
640
691
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: PromoteFlow_module["default"].emptyBody, children: "No details available yet." });
|
|
641
692
|
};
|
|
693
|
+
if (isViewingPreflightDetails && preflightResult) {
|
|
694
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils.cx(PromoteFlow_module["default"].root, className), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
695
|
+
PreflightDetailsPage.PreflightDetailsPage,
|
|
696
|
+
{
|
|
697
|
+
result: preflightResult,
|
|
698
|
+
onBack: () => setIsViewingPreflightDetails(false)
|
|
699
|
+
}
|
|
700
|
+
) });
|
|
701
|
+
}
|
|
642
702
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: utils.cx(PromoteFlow_module["default"].root, className), children: [
|
|
643
703
|
/* @__PURE__ */ jsxRuntime.jsxs("main", { className: PromoteFlow_module["default"].body, children: [
|
|
644
704
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: PromoteFlow_module["default"].topRow, children: [
|
|
@@ -652,35 +712,28 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
652
712
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: PromoteFlow_module["default"].ctaRow, children: [
|
|
653
713
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: PromoteFlow_module["default"].preflightAction, children: [
|
|
654
714
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
655
|
-
StyledPromoteTooltip,
|
|
715
|
+
promoteConstants.StyledPromoteTooltip,
|
|
656
716
|
{
|
|
657
|
-
title:
|
|
717
|
+
title: canCheckPromotionReadiness ? "Optionally check that this migration is ready before promoting." : readinessAndNowTooltip,
|
|
718
|
+
disableHoverListener: canCheckPromotionReadiness,
|
|
658
719
|
placement: "top",
|
|
659
720
|
arrow: true,
|
|
660
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
721
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
661
722
|
"button",
|
|
662
723
|
{
|
|
663
724
|
type: "button",
|
|
664
725
|
className: PromoteFlow_module["default"].secondaryButton,
|
|
665
726
|
onClick: handlePreflightCheck,
|
|
666
|
-
disabled: !
|
|
727
|
+
disabled: !canCheckPromotionReadiness || isCheckingPreflight,
|
|
667
728
|
children: [
|
|
668
729
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheck, { className: PromoteFlow_module["default"].buttonIcon, strokeWidth: 2.2 }),
|
|
669
730
|
isCheckingPreflight ? "Checking readiness\u2026" : "Check promotion readiness"
|
|
670
731
|
]
|
|
671
732
|
}
|
|
672
|
-
)
|
|
733
|
+
) })
|
|
673
734
|
}
|
|
674
735
|
),
|
|
675
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
676
|
-
StyledPromoteTooltip,
|
|
677
|
-
{
|
|
678
|
-
title: "Runs a safe validation of the selected source and destination environments. It does not start a migration.",
|
|
679
|
-
placement: "top",
|
|
680
|
-
arrow: true,
|
|
681
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: PromoteFlow_module["default"].preflightInfo, "aria-label": "About the pre-flight check", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Info, { className: PromoteFlow_module["default"].helpIcon, strokeWidth: 2.2, "aria-hidden": "true" }) })
|
|
682
|
-
}
|
|
683
|
-
)
|
|
736
|
+
/* @__PURE__ */ jsxRuntime.jsx(promoteConstants.StyledPromoteTooltip, { title: promoteConstants.PREFLIGHT_TOOLTIP, placement: "top", arrow: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: PromoteFlow_module["default"].preflightInfo, "aria-label": "About the pre-flight check", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Info, { className: PromoteFlow_module["default"].helpIcon, strokeWidth: 2.2, "aria-hidden": "true" }) }) })
|
|
684
737
|
] }),
|
|
685
738
|
isPromoting ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
686
739
|
canRetryPromotion && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -689,7 +742,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
689
742
|
type: "button",
|
|
690
743
|
className: PromoteFlow_module["default"].primaryButton,
|
|
691
744
|
onClick: handlePromoteNow,
|
|
692
|
-
disabled: !
|
|
745
|
+
disabled: !canPromoteNow,
|
|
693
746
|
children: [
|
|
694
747
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUpRight, { className: PromoteFlow_module["default"].buttonIcon, strokeWidth: 2.2 }),
|
|
695
748
|
isSubmitting ? "Starting promotion\u2026" : promoteActionLabel
|
|
@@ -709,55 +762,74 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
709
762
|
}
|
|
710
763
|
)
|
|
711
764
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
712
|
-
submittingAction !== "now" && /* @__PURE__ */ jsxRuntime.
|
|
713
|
-
|
|
765
|
+
submittingAction !== "now" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
766
|
+
promoteConstants.StyledPromoteTooltip,
|
|
714
767
|
{
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
children:
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
768
|
+
title: canPromoteLater ? "" : promoteLaterTooltip,
|
|
769
|
+
disableHoverListener: canPromoteLater,
|
|
770
|
+
placement: "top",
|
|
771
|
+
arrow: true,
|
|
772
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
773
|
+
"button",
|
|
774
|
+
{
|
|
775
|
+
type: "button",
|
|
776
|
+
className: PromoteFlow_module["default"].secondaryButton,
|
|
777
|
+
onClick: handlePromoteLater,
|
|
778
|
+
disabled: !canPromoteLater,
|
|
779
|
+
children: [
|
|
780
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Calendar, { className: PromoteFlow_module["default"].buttonIcon, strokeWidth: 2.2 }),
|
|
781
|
+
submittingAction === "later" ? "Scheduling\u2026" : "Promote later"
|
|
782
|
+
]
|
|
783
|
+
}
|
|
784
|
+
) })
|
|
723
785
|
}
|
|
724
786
|
),
|
|
725
787
|
submittingAction !== "later" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
726
|
-
StyledPromoteTooltip,
|
|
788
|
+
promoteConstants.StyledPromoteTooltip,
|
|
727
789
|
{
|
|
728
|
-
title:
|
|
729
|
-
disableHoverListener:
|
|
790
|
+
title: canPromoteNow ? "" : readinessAndNowTooltip,
|
|
791
|
+
disableHoverListener: canPromoteNow,
|
|
730
792
|
placement: "top",
|
|
731
793
|
arrow: true,
|
|
732
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
794
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
733
795
|
"button",
|
|
734
796
|
{
|
|
735
797
|
type: "button",
|
|
736
798
|
className: PromoteFlow_module["default"].primaryButton,
|
|
737
799
|
onClick: handlePromoteNow,
|
|
738
|
-
disabled: !
|
|
800
|
+
disabled: !canPromoteNow,
|
|
739
801
|
children: [
|
|
740
802
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUpRight, { className: PromoteFlow_module["default"].buttonIcon, strokeWidth: 2.2 }),
|
|
741
803
|
submittingAction === "now" ? "Starting promotion\u2026" : promoteActionLabel
|
|
742
804
|
]
|
|
743
805
|
}
|
|
744
|
-
)
|
|
806
|
+
) })
|
|
745
807
|
}
|
|
746
808
|
)
|
|
747
809
|
] })
|
|
748
810
|
] })
|
|
749
811
|
] }),
|
|
750
812
|
preflightResult && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: PromoteFlow_module["default"].preflightSuccess, role: "status", children: [
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
813
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
814
|
+
"Pre-flight check completed successfully. ",
|
|
815
|
+
getPreflightResultMessage(preflightResult)
|
|
816
|
+
] }),
|
|
817
|
+
preflightResult.ready && /* @__PURE__ */ jsxRuntime.jsx(
|
|
818
|
+
"button",
|
|
819
|
+
{
|
|
820
|
+
type: "button",
|
|
821
|
+
className: PromoteFlow_module["default"].preflightDetailsButton,
|
|
822
|
+
onClick: () => setIsViewingPreflightDetails(true),
|
|
823
|
+
children: "View preflight details"
|
|
824
|
+
}
|
|
825
|
+
)
|
|
754
826
|
] }),
|
|
755
827
|
isPromoting ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: PromoteFlow_module["default"].promotionStatusBox, children: [
|
|
756
828
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: PromoteFlow_module["default"].promotionStatusRow, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: PromoteFlow_module["default"].promotionStatusRowHeader, children: [
|
|
757
829
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: PromoteFlow_module["default"].promotionStatusField, children: [
|
|
758
830
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: PromoteFlow_module["default"].metaLabel, children: "Promotion Status" }),
|
|
759
831
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: PromoteFlow_module["default"].statusWithPill, children: [
|
|
760
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: PromoteFlow_module["default"].statusValue, children: (
|
|
832
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: PromoteFlow_module["default"].statusValue, children: (_d = promotionTaskForGuideline == null ? void 0 : promotionTaskForGuideline.status) != null ? _d : "In Progress" }),
|
|
761
833
|
(promotionTaskForGuideline == null ? void 0 : promotionTaskForGuideline.status) === "MIGRATING" && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: PromoteFlow_module["default"].ingestingPill, children: [
|
|
762
834
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.LoaderCircle, { className: PromoteFlow_module["default"].migrationLoader, "aria-hidden": "true" }),
|
|
763
835
|
"Migration in progress"
|
|
@@ -858,7 +930,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
858
930
|
errorForGuideline && /* @__PURE__ */ jsxRuntime.jsx("p", { className: PromoteFlow_module["default"].promotionError, role: "alert", children: errorForGuideline })
|
|
859
931
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
860
932
|
errorForGuideline && /* @__PURE__ */ jsxRuntime.jsx("p", { className: PromoteFlow_module["default"].promotionError, role: "alert", children: errorForGuideline }),
|
|
861
|
-
/* @__PURE__ */ jsxRuntime.jsx("section", { className: PromoteFlow_module["default"].accordionList, "aria-label": "Promotion details", children: ACCORDIONS.map((item) => {
|
|
933
|
+
/* @__PURE__ */ jsxRuntime.jsx("section", { className: PromoteFlow_module["default"].accordionList, "aria-label": "Promotion details", children: promoteConstants.ACCORDIONS.map((item) => {
|
|
862
934
|
const isOpen = Boolean(openSections[item.id]);
|
|
863
935
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: PromoteFlow_module["default"].accordion, children: [
|
|
864
936
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -894,27 +966,12 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
894
966
|
EnvironmentConfigurationModal.EnvironmentConfigurationModal,
|
|
895
967
|
{
|
|
896
968
|
environment: configuredEnvironment,
|
|
897
|
-
initialConfiguration:
|
|
898
|
-
|
|
899
|
-
env_tier: selectedEnvironment.env_tier,
|
|
900
|
-
db_type: selectedEnvironment.db_type,
|
|
901
|
-
host: selectedEnvironment.host,
|
|
902
|
-
port: String(selectedEnvironment.port),
|
|
903
|
-
username: selectedEnvironment.username,
|
|
904
|
-
password: "",
|
|
905
|
-
database_name: selectedEnvironment.database_name,
|
|
906
|
-
is_tenant_db: selectedEnvironment.is_tenant_db
|
|
907
|
-
} : {
|
|
908
|
-
...promoteFlow_utils.EMPTY_ENVIRONMENT_CONFIGURATION,
|
|
909
|
-
env_tier: configuredEnvironment === "source" || configuredEnvironment === "tenantSource" ? "dev" : permittedDestinationTiers[0],
|
|
910
|
-
db_type: (configuredEnvironment === "destination" || configuredEnvironment === "tenantDestination") && permittedDestinationTiers[0] === "external" ? "EXTERNAL" : "INTERNAL",
|
|
911
|
-
is_tenant_db: configuredEnvironment === "tenantSource" || configuredEnvironment === "tenantDestination"
|
|
912
|
-
},
|
|
913
|
-
permittedTiers: configuredEnvironment === "source" || configuredEnvironment === "tenantSource" ? permittedSourceTiers : permittedDestinationTiers,
|
|
969
|
+
initialConfiguration: modalInitialConfiguration,
|
|
970
|
+
permittedTiers: modalPermittedTiers,
|
|
914
971
|
onSave: handleSaveEnvironment,
|
|
915
972
|
onSelectPreset: setEnvironment,
|
|
916
973
|
onPresetTierChange: setConfigSearchTier,
|
|
917
|
-
presetTier:
|
|
974
|
+
presetTier: modalPresetTier,
|
|
918
975
|
onClose: () => {
|
|
919
976
|
setConfiguredEnvironment(null);
|
|
920
977
|
setConfigSearchTier(null);
|