@e-llm-studio/instant-learning 1.3.6 → 1.3.8
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/ILMarketplaceWrapper.js +16 -11
- package/dist/ILMarketplaceWrapper.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-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 +188 -178
- 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 +62 -1
- package/dist/cjs/features/IL-marketplace/PromoteFlow/promote-flow.api.js.map +1 -1
- package/dist/cjs/features/IL-marketplace/PromoteFlow/promote-flow.utils.js +23 -7
- package/dist/cjs/features/IL-marketplace/PromoteFlow/promote-flow.utils.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/features/IL-OTJ/ILOTJ.js +1 -1
- package/dist/features/IL-OTJ/ILOTJ.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 +186 -172
- 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 +60 -2
- package/dist/features/IL-marketplace/PromoteFlow/promote-flow.api.js.map +1 -1
- package/dist/features/IL-marketplace/PromoteFlow/promote-flow.utils.js +23 -8
- package/dist/features/IL-marketplace/PromoteFlow/promote-flow.utils.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/types/src/ILMarketplaceWrapper.d.ts +2 -2
- package/dist/types/src/ILMarketplaceWrapper.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 +4 -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 +56 -2
- package/dist/types/src/features/IL-marketplace/PromoteFlow/promote-flow.interfaces.d.ts.map +1 -1
- package/dist/types/src/features/IL-marketplace/PromoteFlow/promote-flow.utils.d.ts +3 -2
- package/dist/types/src/features/IL-marketplace/PromoteFlow/promote-flow.utils.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/package.json +5 -5
|
@@ -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
|
});
|
|
@@ -80,9 +62,11 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
80
62
|
const [configSearchTier, setConfigSearchTier] = React.useState(null);
|
|
81
63
|
const [submittingAction, setSubmittingAction] = React.useState(null);
|
|
82
64
|
const [historyActionTaskId, setHistoryActionTaskId] = React.useState(null);
|
|
65
|
+
const [viewedHistoryTaskId, setViewedHistoryTaskId] = React.useState(null);
|
|
83
66
|
const [isStatusPollingStopped, setIsStatusPollingStopped] = React.useState(false);
|
|
84
67
|
const [isInitialStatusLoading, setIsInitialStatusLoading] = React.useState(true);
|
|
85
68
|
const [isCheckingPreflight, setIsCheckingPreflight] = React.useState(false);
|
|
69
|
+
const [isViewingPreflightDetails, setIsViewingPreflightDetails] = React.useState(false);
|
|
86
70
|
const [promotionStatusForActions, setPromotionStatusForActions] = React.useState(null);
|
|
87
71
|
const [preflightResult, setPreflightResult] = React.useState(null);
|
|
88
72
|
const sourceEnvironment = promoteFlow_store.usePromoteFlowStore((state) => state.sourceEnvironment);
|
|
@@ -103,7 +87,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
103
87
|
const resetPromotionSession = promoteFlow_store.usePromoteFlowStore((state) => state.resetPromotionSession);
|
|
104
88
|
const title = utils.getGuidelineTitle(guideline);
|
|
105
89
|
const versionLabel = guideline.version ? `v${guideline.version}` : "v1";
|
|
106
|
-
const statusLabel = (_a = guideline.status) != null ? _a :
|
|
90
|
+
const statusLabel = (_a = guideline.status) != null ? _a : promoteConstants.DEFAULT_GUIDELINE_STATUS;
|
|
107
91
|
const guidelineResourceId = promoteFlow_utils.getPromotionResourceId(guideline);
|
|
108
92
|
const promotionTaskForGuideline = promotionResourceId === guidelineResourceId ? promotionTask : null;
|
|
109
93
|
const errorForGuideline = errorResourceId === guidelineResourceId ? error : null;
|
|
@@ -119,13 +103,43 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
119
103
|
);
|
|
120
104
|
const isPromoting = Boolean(promotionTaskForGuideline);
|
|
121
105
|
const canRetryPromotion = (promotionTaskForGuideline == null ? void 0 : promotionTaskForGuideline.status) === "FAILED";
|
|
122
|
-
const sourceTier = (_b = sourceEnvironment == null ? void 0 : sourceEnvironment.env_tier) != null ? _b :
|
|
106
|
+
const sourceTier = (_b = sourceEnvironment == null ? void 0 : sourceEnvironment.env_tier) != null ? _b : promoteConstants.DEFAULT_SOURCE_ENVIRONMENT_TIER;
|
|
123
107
|
const permittedDestinationTiers = React.useMemo(
|
|
124
108
|
() => promoteFlow_utils.getPermittedDestinationTiers(sourceTier),
|
|
125
109
|
[sourceTier]
|
|
126
110
|
);
|
|
127
|
-
const
|
|
128
|
-
|
|
111
|
+
const environments = {
|
|
112
|
+
source: sourceEnvironment,
|
|
113
|
+
destination: destinationEnvironment,
|
|
114
|
+
tenantSource: tenantSourceEnvironment,
|
|
115
|
+
tenantDestination: tenantDestinationEnvironment
|
|
116
|
+
};
|
|
117
|
+
const selectedEnvironment = configuredEnvironment ? environments[configuredEnvironment] : void 0;
|
|
118
|
+
const configuredEnvironmentDefaultTier = configuredEnvironment ? getDefaultEnvironmentTier(
|
|
119
|
+
configuredEnvironment,
|
|
120
|
+
selectedEnvironment,
|
|
121
|
+
permittedDestinationTiers
|
|
122
|
+
) : promoteConstants.DEFAULT_SOURCE_ENVIRONMENT_TIER;
|
|
123
|
+
const configuredEnvironmentIsSource = configuredEnvironment ? isSourceEnvironment(configuredEnvironment) : true;
|
|
124
|
+
const configuredEnvironmentIsTenant = configuredEnvironment ? isTenantEnvironment(configuredEnvironment) : false;
|
|
125
|
+
const modalInitialConfiguration = selectedEnvironment ? {
|
|
126
|
+
env_name: selectedEnvironment.env_name,
|
|
127
|
+
env_tier: selectedEnvironment.env_tier,
|
|
128
|
+
db_type: selectedEnvironment.db_type,
|
|
129
|
+
host: selectedEnvironment.host,
|
|
130
|
+
port: String(selectedEnvironment.port),
|
|
131
|
+
username: selectedEnvironment.username,
|
|
132
|
+
password: "",
|
|
133
|
+
database_name: selectedEnvironment.database_name,
|
|
134
|
+
is_tenant_db: selectedEnvironment.is_tenant_db
|
|
135
|
+
} : {
|
|
136
|
+
...promoteFlow_utils.EMPTY_ENVIRONMENT_CONFIGURATION,
|
|
137
|
+
env_tier: configuredEnvironmentDefaultTier,
|
|
138
|
+
db_type: !configuredEnvironmentIsSource && configuredEnvironmentDefaultTier === "external" ? "EXTERNAL" : "INTERNAL",
|
|
139
|
+
is_tenant_db: configuredEnvironmentIsTenant
|
|
140
|
+
};
|
|
141
|
+
const modalPermittedTiers = configuredEnvironmentIsSource ? promoteConstants.PERMITTED_SOURCE_TIERS : permittedDestinationTiers;
|
|
142
|
+
const modalPresetTier = configSearchTier != null ? configSearchTier : configuredEnvironmentDefaultTier;
|
|
129
143
|
const latestPromotionForPair = React.useMemo(
|
|
130
144
|
() => promoteFlow_utils.getLatestPromotionForEnvironmentPair(
|
|
131
145
|
promotionHistory,
|
|
@@ -134,36 +148,36 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
134
148
|
),
|
|
135
149
|
[destinationEnvironment, promotionHistory, sourceEnvironment]
|
|
136
150
|
);
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
if (!latest) return entry;
|
|
142
|
-
return Date.parse(entry.updated_at) > Date.parse(latest.updated_at) ? entry : latest;
|
|
143
|
-
},
|
|
144
|
-
null
|
|
145
|
-
);
|
|
146
|
-
return (_a2 = latestPromotion2 == null ? void 0 : latestPromotion2.promotion_task_id) != null ? _a2 : null;
|
|
147
|
-
}, [promotionHistory]);
|
|
148
|
-
const latestPromotion = React.useMemo(
|
|
149
|
-
() => promotionHistory.reduce((latest, entry) => {
|
|
150
|
-
if (!latest) return entry;
|
|
151
|
-
return Date.parse(entry.updated_at) > Date.parse(latest.updated_at) ? entry : latest;
|
|
152
|
-
}, null),
|
|
153
|
-
[promotionHistory]
|
|
151
|
+
const latestPromotion = React.useMemo(() => getLatestPromotion(promotionHistory), [promotionHistory]);
|
|
152
|
+
const latestPromotionTaskId = (_c = latestPromotion == null ? void 0 : latestPromotion.promotion_task_id) != null ? _c : null;
|
|
153
|
+
const isPromotionInProgress = promoteConstants.PROMOTION_IN_PROGRESS_STATUSES.some(
|
|
154
|
+
(status) => status === (promotionStatusForActions == null ? void 0 : promotionStatusForActions.status)
|
|
154
155
|
);
|
|
155
|
-
const
|
|
156
|
-
|
|
156
|
+
const hasScheduledPromotion = (latestPromotion == null ? void 0 : latestPromotion.status) === "SCHEDULED" || (promotionStatusForActions == null ? void 0 : promotionStatusForActions.status) === "SCHEDULED";
|
|
157
|
+
const promotionActionRestriction = getPromotionActionRestriction(
|
|
158
|
+
isPromotionInProgress,
|
|
159
|
+
hasScheduledPromotion
|
|
157
160
|
);
|
|
158
|
-
const latestHistoryIsScheduled = (latestPromotion == null ? void 0 : latestPromotion.status) === "SCHEDULED" || (promotionStatusForActions == null ? void 0 : promotionStatusForActions.status) === "SCHEDULED";
|
|
159
|
-
const promotionActionRestriction = isPromotionInProgress ? "A promotion is currently in progress. Wait for it to complete before taking another promotion action." : latestHistoryIsScheduled ? "The latest promotion is scheduled. You may schedule another promotion, but cannot check readiness or promote now." : null;
|
|
160
161
|
const canCheckPromotionReadiness = canPromote && !promotionActionRestriction;
|
|
161
162
|
const canPromoteNow = canPromote && !promotionActionRestriction;
|
|
162
163
|
const canPromoteLater = canPromote && !isPromotionInProgress;
|
|
163
|
-
const
|
|
164
|
-
const
|
|
165
|
-
const promoteLaterTooltip = isPromotionInProgress ? promotionActionRestriction : environmentConfigurationTooltip;
|
|
164
|
+
const readinessAndNowTooltip = promotionActionRestriction != null ? promotionActionRestriction : promoteConstants.ENVIRONMENT_CONFIGURATION_TOOLTIP;
|
|
165
|
+
const promoteLaterTooltip = isPromotionInProgress ? promotionActionRestriction : promoteConstants.ENVIRONMENT_CONFIGURATION_TOOLTIP;
|
|
166
166
|
const promoteActionLabel = (latestPromotionForPair == null ? void 0 : latestPromotionForPair.status) === "SUCCESS" ? "Sync" : "Promote Now";
|
|
167
|
+
const createPromotionRequest = () => {
|
|
168
|
+
if (!sourceEnvironment || !destinationEnvironment) return null;
|
|
169
|
+
return {
|
|
170
|
+
resource_id: guidelineResourceId,
|
|
171
|
+
resource_type: "PACKAGE",
|
|
172
|
+
target_version: "latest",
|
|
173
|
+
global_source_env_id: sourceEnvironment.env_id,
|
|
174
|
+
global_target_env_id: destinationEnvironment.env_id,
|
|
175
|
+
...tenantSourceEnvironment && tenantDestinationEnvironment ? {
|
|
176
|
+
tenant_source_env_id: tenantSourceEnvironment.env_id,
|
|
177
|
+
tenant_target_env_id: tenantDestinationEnvironment.env_id
|
|
178
|
+
} : {}
|
|
179
|
+
};
|
|
180
|
+
};
|
|
167
181
|
const toggleSection = (id) => {
|
|
168
182
|
setOpenSections((current) => ({ ...current, [id]: !current[id] }));
|
|
169
183
|
};
|
|
@@ -174,6 +188,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
174
188
|
setError(null);
|
|
175
189
|
setPromotionTask(null);
|
|
176
190
|
setPromotionStatusForActions(null);
|
|
191
|
+
setViewedHistoryTaskId(null);
|
|
177
192
|
const refreshInitialPromotionState = async () => {
|
|
178
193
|
try {
|
|
179
194
|
const status = await promoteFlow_api.getPromotionStatus(guidelineResourceId);
|
|
@@ -213,14 +228,20 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
213
228
|
promoteFlow_api.getSchemaPreview(guidelineResourceId).then((preview) => {
|
|
214
229
|
if (!isCurrent) return;
|
|
215
230
|
setSchemaPreview(
|
|
216
|
-
Object.entries(preview != null ? preview : {}).reduce(
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
231
|
+
Object.entries(preview != null ? preview : {}).reduce(
|
|
232
|
+
(groups, [key, value]) => {
|
|
233
|
+
if (value && Array.isArray(value.tables)) groups[key] = value;
|
|
234
|
+
return groups;
|
|
235
|
+
},
|
|
236
|
+
{}
|
|
237
|
+
)
|
|
220
238
|
);
|
|
221
239
|
}).catch((schemaError) => {
|
|
222
240
|
if (isCurrent) {
|
|
223
|
-
console.error("Failed to load schema preview", {
|
|
241
|
+
console.error("Failed to load schema preview", {
|
|
242
|
+
resourceId: guidelineResourceId,
|
|
243
|
+
schemaError
|
|
244
|
+
});
|
|
224
245
|
setSchemaPreview({});
|
|
225
246
|
}
|
|
226
247
|
}).finally(() => {
|
|
@@ -231,18 +252,20 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
231
252
|
};
|
|
232
253
|
}, [guidelineResourceId]);
|
|
233
254
|
React.useEffect(() => {
|
|
234
|
-
var _a2, _b2, _c2, _d2;
|
|
235
255
|
if (!configuredEnvironment) return;
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
256
|
+
const defaultTier = getDefaultEnvironmentTier(
|
|
257
|
+
configuredEnvironment,
|
|
258
|
+
environments[configuredEnvironment],
|
|
259
|
+
permittedDestinationTiers
|
|
260
|
+
);
|
|
261
|
+
const environmentTier = configSearchTier != null ? configSearchTier : defaultTier;
|
|
239
262
|
let isCurrent = true;
|
|
240
263
|
setIsLoadingConfigs(true);
|
|
241
264
|
setPromotionConfigs([]);
|
|
242
265
|
promoteFlow_api.searchEnvironmentConfigs({
|
|
243
|
-
env_tier:
|
|
244
|
-
db_type:
|
|
245
|
-
is_tenant: configuredEnvironment
|
|
266
|
+
env_tier: environmentTier,
|
|
267
|
+
db_type: environmentTier === "external" ? "EXTERNAL" : "INTERNAL",
|
|
268
|
+
is_tenant: isTenantEnvironment(configuredEnvironment)
|
|
246
269
|
}).then((configs) => {
|
|
247
270
|
if (isCurrent) setPromotionConfigs(configs);
|
|
248
271
|
}).catch(() => {
|
|
@@ -285,7 +308,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
285
308
|
}, [promotionTaskForGuideline == null ? void 0 : promotionTaskForGuideline.created_by, promotionTaskForGuideline == null ? void 0 : promotionTaskForGuideline.promotion_task_id]);
|
|
286
309
|
React.useEffect(() => {
|
|
287
310
|
const promotionStatusToPoll = promotionTaskForGuideline != null ? promotionTaskForGuideline : promotionStatusForActions;
|
|
288
|
-
if (!promotionStatusToPoll || isStatusPollingStopped || !
|
|
311
|
+
if (viewedHistoryTaskId || !promotionStatusToPoll || isStatusPollingStopped || !promoteConstants.PROMOTION_IN_PROGRESS_STATUSES.some((status) => status === promotionStatusToPoll.status)) {
|
|
289
312
|
return;
|
|
290
313
|
}
|
|
291
314
|
const pollStatus = async () => {
|
|
@@ -301,7 +324,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
301
324
|
);
|
|
302
325
|
}
|
|
303
326
|
};
|
|
304
|
-
const intervalId = window.setInterval(pollStatus,
|
|
327
|
+
const intervalId = window.setInterval(pollStatus, promoteConstants.PROMOTION_POLL_INTERVAL_MS);
|
|
305
328
|
return () => window.clearInterval(intervalId);
|
|
306
329
|
}, [
|
|
307
330
|
guidelineResourceId,
|
|
@@ -309,25 +332,18 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
309
332
|
promotionStatusForActions,
|
|
310
333
|
promotionTaskForGuideline,
|
|
311
334
|
setError,
|
|
312
|
-
setPromotionTask
|
|
335
|
+
setPromotionTask,
|
|
336
|
+
viewedHistoryTaskId
|
|
313
337
|
]);
|
|
314
338
|
const handlePromoteNow = async () => {
|
|
315
|
-
|
|
339
|
+
const promotionRequest = createPromotionRequest();
|
|
340
|
+
if (!canPromoteNow || !promotionRequest) return;
|
|
316
341
|
setSubmitting(true);
|
|
317
342
|
setSubmittingAction("now");
|
|
318
343
|
setError(null);
|
|
344
|
+
setViewedHistoryTaskId(null);
|
|
319
345
|
try {
|
|
320
|
-
const task = await promoteFlow_api.startPromotion(
|
|
321
|
-
resource_id: promoteFlow_utils.getPromotionResourceId(guideline),
|
|
322
|
-
resource_type: "PACKAGE",
|
|
323
|
-
target_version: "latest",
|
|
324
|
-
global_source_env_id: sourceEnvironment.env_id,
|
|
325
|
-
global_target_env_id: destinationEnvironment.env_id,
|
|
326
|
-
...tenantSourceEnvironment && tenantDestinationEnvironment ? {
|
|
327
|
-
tenant_source_env_id: tenantSourceEnvironment.env_id,
|
|
328
|
-
tenant_target_env_id: tenantDestinationEnvironment.env_id
|
|
329
|
-
} : {}
|
|
330
|
-
});
|
|
346
|
+
const task = await promoteFlow_api.startPromotion(promotionRequest);
|
|
331
347
|
setIsStatusPollingStopped(false);
|
|
332
348
|
setPromotionTask(task, guidelineResourceId);
|
|
333
349
|
setPromotionStatusForActions(task);
|
|
@@ -349,28 +365,15 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
349
365
|
}
|
|
350
366
|
};
|
|
351
367
|
const handlePreflightCheck = async () => {
|
|
352
|
-
|
|
353
|
-
|
|
368
|
+
const promotionRequest = createPromotionRequest();
|
|
369
|
+
if (!canCheckPromotionReadiness || !promotionRequest || isCheckingPreflight) return;
|
|
354
370
|
setIsCheckingPreflight(true);
|
|
355
371
|
setPreflightResult(null);
|
|
372
|
+
setIsViewingPreflightDetails(false);
|
|
356
373
|
setError(null);
|
|
357
374
|
try {
|
|
358
|
-
const result = await promoteFlow_api.checkPromotionPreflight(
|
|
359
|
-
|
|
360
|
-
resource_type: "PACKAGE",
|
|
361
|
-
target_version: "latest",
|
|
362
|
-
global_source_env_id: sourceEnvironment.env_id,
|
|
363
|
-
global_target_env_id: destinationEnvironment.env_id,
|
|
364
|
-
...tenantSourceEnvironment && tenantDestinationEnvironment ? {
|
|
365
|
-
tenant_source_env_id: tenantSourceEnvironment.env_id,
|
|
366
|
-
tenant_target_env_id: tenantDestinationEnvironment.env_id
|
|
367
|
-
} : {}
|
|
368
|
-
});
|
|
369
|
-
setPreflightResult({
|
|
370
|
-
ready: result.ready,
|
|
371
|
-
itemsChecked: result.items_checked,
|
|
372
|
-
itemsReady: result.items_ready
|
|
373
|
-
});
|
|
375
|
+
const result = await promoteFlow_api.checkPromotionPreflight(promotionRequest);
|
|
376
|
+
setPreflightResult(result);
|
|
374
377
|
} catch (preflightError) {
|
|
375
378
|
setError(
|
|
376
379
|
preflightError instanceof Error ? preflightError.message : "Unable to complete pre-flight check.",
|
|
@@ -381,42 +384,44 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
381
384
|
}
|
|
382
385
|
};
|
|
383
386
|
const handleSaveEnvironment = async (environment, configuration) => {
|
|
384
|
-
const isTenantEnvironment = environment === "tenantSource" || environment === "tenantDestination";
|
|
385
387
|
const configurationToSave = {
|
|
386
388
|
...configuration,
|
|
387
|
-
is_tenant_db: isTenantEnvironment
|
|
389
|
+
is_tenant_db: isTenantEnvironment(environment)
|
|
388
390
|
};
|
|
389
|
-
const
|
|
390
|
-
promoteFlow_utils.
|
|
391
|
+
const credential = await promoteFlow_api.addAlloyDbCredential(
|
|
392
|
+
promoteFlow_utils.toAddAlloyDbCredentialRequest(configurationToSave)
|
|
393
|
+
);
|
|
394
|
+
await promoteFlow_api.createEnvironmentConfig(
|
|
395
|
+
promoteFlow_utils.toCreateEnvironmentConfigRequest(
|
|
396
|
+
configurationToSave,
|
|
397
|
+
credential.credId,
|
|
398
|
+
credential.credName
|
|
399
|
+
)
|
|
400
|
+
);
|
|
401
|
+
setEnvironment(
|
|
402
|
+
environment,
|
|
403
|
+
promoteFlow_utils.toRegistryRecord(credential.credId, {
|
|
404
|
+
...configurationToSave,
|
|
405
|
+
env_name: credential.credName
|
|
406
|
+
})
|
|
391
407
|
);
|
|
392
|
-
setEnvironment(environment, promoteFlow_utils.toRegistryRecord(response.env_id, configurationToSave));
|
|
393
408
|
};
|
|
394
409
|
const openEnvironmentConfiguration = (environment) => {
|
|
395
|
-
var _a2;
|
|
396
|
-
const selected = environment === "source" ? sourceEnvironment : environment === "destination" ? destinationEnvironment : environment === "tenantSource" ? tenantSourceEnvironment : tenantDestinationEnvironment;
|
|
397
410
|
setConfigSearchTier(
|
|
398
|
-
(
|
|
411
|
+
getDefaultEnvironmentTier(environment, environments[environment], permittedDestinationTiers)
|
|
399
412
|
);
|
|
400
413
|
setConfiguredEnvironment(environment);
|
|
401
414
|
};
|
|
402
415
|
const handlePromoteLater = async () => {
|
|
403
416
|
var _a2, _b2;
|
|
404
|
-
|
|
417
|
+
const promotionRequest = createPromotionRequest();
|
|
418
|
+
if (!canPromoteLater || !promotionRequest) return;
|
|
405
419
|
setSubmitting(true);
|
|
406
420
|
setSubmittingAction("later");
|
|
407
421
|
setError(null);
|
|
422
|
+
setViewedHistoryTaskId(null);
|
|
408
423
|
try {
|
|
409
|
-
const scheduledPromotion = await promoteFlow_api.schedulePromotion(
|
|
410
|
-
resource_id: guidelineResourceId,
|
|
411
|
-
resource_type: "PACKAGE",
|
|
412
|
-
target_version: "latest",
|
|
413
|
-
global_source_env_id: sourceEnvironment.env_id,
|
|
414
|
-
global_target_env_id: destinationEnvironment.env_id,
|
|
415
|
-
...tenantSourceEnvironment && tenantDestinationEnvironment ? {
|
|
416
|
-
tenant_source_env_id: tenantSourceEnvironment.env_id,
|
|
417
|
-
tenant_target_env_id: tenantDestinationEnvironment.env_id
|
|
418
|
-
} : {}
|
|
419
|
-
});
|
|
424
|
+
const scheduledPromotion = await promoteFlow_api.schedulePromotion(promotionRequest);
|
|
420
425
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
421
426
|
setPromotionTask(
|
|
422
427
|
{
|
|
@@ -449,6 +454,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
449
454
|
setSubmitting(true);
|
|
450
455
|
setSubmittingAction("trigger");
|
|
451
456
|
setError(null);
|
|
457
|
+
setViewedHistoryTaskId(null);
|
|
452
458
|
try {
|
|
453
459
|
const task = await promoteFlow_api.triggerScheduledPromotion(triggerUrl);
|
|
454
460
|
setIsStatusPollingStopped(false);
|
|
@@ -475,8 +481,9 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
475
481
|
setHistoryActionTaskId(promotionTaskId);
|
|
476
482
|
setError(null);
|
|
477
483
|
try {
|
|
478
|
-
|
|
479
|
-
|
|
484
|
+
const task = await promoteFlow_api.getPromotionTaskDetails(promotionTaskId);
|
|
485
|
+
setViewedHistoryTaskId(promotionTaskId);
|
|
486
|
+
setPromotionTask(task, guidelineResourceId);
|
|
480
487
|
} catch (statusError) {
|
|
481
488
|
setError(
|
|
482
489
|
statusError instanceof Error ? statusError.message : "Unable to load promotion details.",
|
|
@@ -489,6 +496,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
489
496
|
const handleRollbackPromotion = async (promotionTaskId) => {
|
|
490
497
|
setHistoryActionTaskId(promotionTaskId);
|
|
491
498
|
setError(null);
|
|
499
|
+
setViewedHistoryTaskId(null);
|
|
492
500
|
try {
|
|
493
501
|
const task = await promoteFlow_api.rollbackPromotion(promotionTaskId);
|
|
494
502
|
setIsStatusPollingStopped(false);
|
|
@@ -505,6 +513,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
505
513
|
const handleBack = async () => {
|
|
506
514
|
if (promotionTaskForGuideline) {
|
|
507
515
|
setPromotionTask(null);
|
|
516
|
+
setViewedHistoryTaskId(null);
|
|
508
517
|
setIsInitialStatusLoading(true);
|
|
509
518
|
setIsLoadingHistory(true);
|
|
510
519
|
try {
|
|
@@ -664,7 +673,10 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
664
673
|
),
|
|
665
674
|
onClick: () => canRollback ? handleRollbackPromotion(row.promotion_task_id) : handleViewPromotionDetails(row.promotion_task_id),
|
|
666
675
|
disabled: isInitialStatusLoading || historyActionTaskId !== null,
|
|
667
|
-
children:
|
|
676
|
+
children: getHistoryActionLabel(
|
|
677
|
+
historyActionTaskId === row.promotion_task_id,
|
|
678
|
+
canRollback
|
|
679
|
+
)
|
|
668
680
|
}
|
|
669
681
|
)
|
|
670
682
|
] })
|
|
@@ -673,9 +685,11 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
673
685
|
] }) }) });
|
|
674
686
|
}
|
|
675
687
|
if (id === "database") {
|
|
676
|
-
if (isLoadingSchemaPreview)
|
|
688
|
+
if (isLoadingSchemaPreview)
|
|
689
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: PromoteFlow_module["default"].emptyBody, children: "Loading database details\u2026" });
|
|
677
690
|
const groups = Object.entries(schemaPreview);
|
|
678
|
-
if (groups.length === 0)
|
|
691
|
+
if (groups.length === 0)
|
|
692
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: PromoteFlow_module["default"].emptyBody, children: "No database details available." });
|
|
679
693
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: PromoteFlow_module["default"].databaseGrid, children: groups.flatMap(
|
|
680
694
|
([groupName, group]) => ["Source", "Destination"].map((environment) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: PromoteFlow_module["default"].databaseCard, children: [
|
|
681
695
|
/* @__PURE__ */ jsxRuntime.jsxs("h3", { children: [
|
|
@@ -698,6 +712,15 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
698
712
|
}
|
|
699
713
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: PromoteFlow_module["default"].emptyBody, children: "No details available yet." });
|
|
700
714
|
};
|
|
715
|
+
if (isViewingPreflightDetails && preflightResult) {
|
|
716
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils.cx(PromoteFlow_module["default"].root, className), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
717
|
+
PreflightDetailsPage.PreflightDetailsPage,
|
|
718
|
+
{
|
|
719
|
+
result: preflightResult,
|
|
720
|
+
onBack: () => setIsViewingPreflightDetails(false)
|
|
721
|
+
}
|
|
722
|
+
) });
|
|
723
|
+
}
|
|
701
724
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: utils.cx(PromoteFlow_module["default"].root, className), children: [
|
|
702
725
|
/* @__PURE__ */ jsxRuntime.jsxs("main", { className: PromoteFlow_module["default"].body, children: [
|
|
703
726
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: PromoteFlow_module["default"].topRow, children: [
|
|
@@ -711,7 +734,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
711
734
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: PromoteFlow_module["default"].ctaRow, children: [
|
|
712
735
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: PromoteFlow_module["default"].preflightAction, children: [
|
|
713
736
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
714
|
-
StyledPromoteTooltip,
|
|
737
|
+
promoteConstants.StyledPromoteTooltip,
|
|
715
738
|
{
|
|
716
739
|
title: canCheckPromotionReadiness ? "Optionally check that this migration is ready before promoting." : readinessAndNowTooltip,
|
|
717
740
|
disableHoverListener: canCheckPromotionReadiness,
|
|
@@ -732,15 +755,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
732
755
|
) })
|
|
733
756
|
}
|
|
734
757
|
),
|
|
735
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
736
|
-
StyledPromoteTooltip,
|
|
737
|
-
{
|
|
738
|
-
title: "Runs a safe validation of the selected source and destination environments. It does not start a migration.",
|
|
739
|
-
placement: "top",
|
|
740
|
-
arrow: true,
|
|
741
|
-
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" }) })
|
|
742
|
-
}
|
|
743
|
-
)
|
|
758
|
+
/* @__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" }) }) })
|
|
744
759
|
] }),
|
|
745
760
|
isPromoting ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
746
761
|
canRetryPromotion && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -770,7 +785,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
770
785
|
)
|
|
771
786
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
772
787
|
submittingAction !== "now" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
773
|
-
StyledPromoteTooltip,
|
|
788
|
+
promoteConstants.StyledPromoteTooltip,
|
|
774
789
|
{
|
|
775
790
|
title: canPromoteLater ? "" : promoteLaterTooltip,
|
|
776
791
|
disableHoverListener: canPromoteLater,
|
|
@@ -792,7 +807,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
792
807
|
}
|
|
793
808
|
),
|
|
794
809
|
submittingAction !== "later" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
795
|
-
StyledPromoteTooltip,
|
|
810
|
+
promoteConstants.StyledPromoteTooltip,
|
|
796
811
|
{
|
|
797
812
|
title: canPromoteNow ? "" : readinessAndNowTooltip,
|
|
798
813
|
disableHoverListener: canPromoteNow,
|
|
@@ -817,9 +832,19 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
817
832
|
] })
|
|
818
833
|
] }),
|
|
819
834
|
preflightResult && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: PromoteFlow_module["default"].preflightSuccess, role: "status", children: [
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
835
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
836
|
+
"Pre-flight check completed successfully. ",
|
|
837
|
+
getPreflightResultMessage(preflightResult)
|
|
838
|
+
] }),
|
|
839
|
+
preflightResult.ready && /* @__PURE__ */ jsxRuntime.jsx(
|
|
840
|
+
"button",
|
|
841
|
+
{
|
|
842
|
+
type: "button",
|
|
843
|
+
className: PromoteFlow_module["default"].preflightDetailsButton,
|
|
844
|
+
onClick: () => setIsViewingPreflightDetails(true),
|
|
845
|
+
children: "View preflight details"
|
|
846
|
+
}
|
|
847
|
+
)
|
|
823
848
|
] }),
|
|
824
849
|
isPromoting ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: PromoteFlow_module["default"].promotionStatusBox, children: [
|
|
825
850
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: PromoteFlow_module["default"].promotionStatusRow, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: PromoteFlow_module["default"].promotionStatusRowHeader, children: [
|
|
@@ -844,7 +869,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
844
869
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: PromoteFlow_module["default"].metaValue, children: promoteFlow_utils.formatPromotionDate(promotionTaskForGuideline == null ? void 0 : promotionTaskForGuideline.created_at) })
|
|
845
870
|
] }),
|
|
846
871
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
847
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: PromoteFlow_module["default"].metaLabel, children: "Promoted by" }),
|
|
872
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: PromoteFlow_module["default"].metaLabel, children: (promotionTaskForGuideline == null ? void 0 : promotionTaskForGuideline.status) === "SCHEDULED" ? "Scheduled by" : "Promoted by" }),
|
|
848
873
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: PromoteFlow_module["default"].metaValue, children: promotedByName != null ? promotedByName : "\u2014" })
|
|
849
874
|
] }),
|
|
850
875
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
@@ -927,7 +952,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
927
952
|
errorForGuideline && /* @__PURE__ */ jsxRuntime.jsx("p", { className: PromoteFlow_module["default"].promotionError, role: "alert", children: errorForGuideline })
|
|
928
953
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
929
954
|
errorForGuideline && /* @__PURE__ */ jsxRuntime.jsx("p", { className: PromoteFlow_module["default"].promotionError, role: "alert", children: errorForGuideline }),
|
|
930
|
-
/* @__PURE__ */ jsxRuntime.jsx("section", { className: PromoteFlow_module["default"].accordionList, "aria-label": "Promotion details", children: ACCORDIONS.map((item) => {
|
|
955
|
+
/* @__PURE__ */ jsxRuntime.jsx("section", { className: PromoteFlow_module["default"].accordionList, "aria-label": "Promotion details", children: promoteConstants.ACCORDIONS.map((item) => {
|
|
931
956
|
const isOpen = Boolean(openSections[item.id]);
|
|
932
957
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: PromoteFlow_module["default"].accordion, children: [
|
|
933
958
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -963,27 +988,12 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
963
988
|
EnvironmentConfigurationModal.EnvironmentConfigurationModal,
|
|
964
989
|
{
|
|
965
990
|
environment: configuredEnvironment,
|
|
966
|
-
initialConfiguration:
|
|
967
|
-
|
|
968
|
-
env_tier: selectedEnvironment.env_tier,
|
|
969
|
-
db_type: selectedEnvironment.db_type,
|
|
970
|
-
host: selectedEnvironment.host,
|
|
971
|
-
port: String(selectedEnvironment.port),
|
|
972
|
-
username: selectedEnvironment.username,
|
|
973
|
-
password: "",
|
|
974
|
-
database_name: selectedEnvironment.database_name,
|
|
975
|
-
is_tenant_db: selectedEnvironment.is_tenant_db
|
|
976
|
-
} : {
|
|
977
|
-
...promoteFlow_utils.EMPTY_ENVIRONMENT_CONFIGURATION,
|
|
978
|
-
env_tier: configuredEnvironment === "source" || configuredEnvironment === "tenantSource" ? "dev" : permittedDestinationTiers[0],
|
|
979
|
-
db_type: (configuredEnvironment === "destination" || configuredEnvironment === "tenantDestination") && permittedDestinationTiers[0] === "external" ? "EXTERNAL" : "INTERNAL",
|
|
980
|
-
is_tenant_db: configuredEnvironment === "tenantSource" || configuredEnvironment === "tenantDestination"
|
|
981
|
-
},
|
|
982
|
-
permittedTiers: configuredEnvironment === "source" || configuredEnvironment === "tenantSource" ? permittedSourceTiers : permittedDestinationTiers,
|
|
991
|
+
initialConfiguration: modalInitialConfiguration,
|
|
992
|
+
permittedTiers: modalPermittedTiers,
|
|
983
993
|
onSave: handleSaveEnvironment,
|
|
984
994
|
onSelectPreset: setEnvironment,
|
|
985
995
|
onPresetTierChange: setConfigSearchTier,
|
|
986
|
-
presetTier:
|
|
996
|
+
presetTier: modalPresetTier,
|
|
987
997
|
onClose: () => {
|
|
988
998
|
setConfiguredEnvironment(null);
|
|
989
999
|
setConfigSearchTier(null);
|