@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
|
@@ -1,60 +1,46 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useState, useMemo, useEffect } from 'react';
|
|
3
|
-
import Tooltip, { tooltipClasses } from '@mui/material/Tooltip';
|
|
4
|
-
import { styled } from '@mui/material/styles';
|
|
5
3
|
import { ArrowLeft, CircleCheck, Info, ArrowUpRight, ArrowDownUp, Calendar, LoaderCircle, Bell, Copy, ExternalLink, ChevronDown, Settings2 } from 'lucide-react';
|
|
6
4
|
import { getGuidelineTitle, cx } from '../utils.js';
|
|
7
5
|
import { EnvironmentConfigurationModal } from './EnvironmentConfigurationModal.js';
|
|
6
|
+
import { PreflightDetailsPage } from './PreflightDetailsPage.js';
|
|
7
|
+
import { DEFAULT_GUIDELINE_STATUS, DEFAULT_SOURCE_ENVIRONMENT_TIER, PERMITTED_SOURCE_TIERS, PROMOTION_IN_PROGRESS_STATUSES, ENVIRONMENT_CONFIGURATION_TOOLTIP, PROMOTION_POLL_INTERVAL_MS, StyledPromoteTooltip, PREFLIGHT_TOOLTIP, ACCORDIONS, PROMOTION_IN_PROGRESS_TOOLTIP, SCHEDULED_PROMOTION_TOOLTIP } from './promote-constants.js';
|
|
8
8
|
import { getSchemaPreview, searchEnvironmentConfigs, getCWUser, getPromotionStatus, getPromotionHistory, startPromotion, checkPromotionPreflight, createEnvironmentConfig, schedulePromotion, triggerScheduledPromotion, rollbackPromotion } from './promote-flow.api.js';
|
|
9
9
|
import { usePromoteFlowStore } from './promote-flow.store.js';
|
|
10
|
-
import { getPromotionResourceId, getEnvironmentDisplayName, getPermittedDestinationTiers, getLatestPromotionForEnvironmentPair, formatPromotionDate,
|
|
10
|
+
import { getPromotionResourceId, getEnvironmentDisplayName, getPermittedDestinationTiers, EMPTY_ENVIRONMENT_CONFIGURATION, getLatestPromotionForEnvironmentPair, formatPromotionDate, toCreateEnvironmentConfigRequest, toRegistryRecord } from './promote-flow.utils.js';
|
|
11
11
|
import cssStyles from './PromoteFlow.module.css.js';
|
|
12
12
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
title: "Promotion History",
|
|
38
|
-
comingSoon: false
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
id: "database",
|
|
42
|
-
title: "Database Details",
|
|
43
|
-
comingSoon: false
|
|
44
|
-
}
|
|
45
|
-
// {
|
|
46
|
-
// id: 'knowledgebase',
|
|
47
|
-
// title: 'Knowledgebase Details',
|
|
48
|
-
// comingSoon: true,
|
|
49
|
-
// },
|
|
50
|
-
];
|
|
13
|
+
const isTenantEnvironment = (environment) => environment === "tenantSource" || environment === "tenantDestination";
|
|
14
|
+
const isSourceEnvironment = (environment) => environment === "source" || environment === "tenantSource";
|
|
15
|
+
const getLatestPromotion = (history) => history.reduce((latest, entry) => {
|
|
16
|
+
if (!latest) return entry;
|
|
17
|
+
return Date.parse(entry.updated_at) > Date.parse(latest.updated_at) ? entry : latest;
|
|
18
|
+
}, null);
|
|
19
|
+
const getDefaultEnvironmentTier = (environment, selectedEnvironment, permittedDestinationTiers) => {
|
|
20
|
+
var _a;
|
|
21
|
+
return (_a = selectedEnvironment == null ? void 0 : selectedEnvironment.env_tier) != null ? _a : isSourceEnvironment(environment) ? DEFAULT_SOURCE_ENVIRONMENT_TIER : permittedDestinationTiers[0];
|
|
22
|
+
};
|
|
23
|
+
const getPromotionActionRestriction = (isPromotionInProgress, hasScheduledPromotion) => {
|
|
24
|
+
if (isPromotionInProgress) return PROMOTION_IN_PROGRESS_TOOLTIP;
|
|
25
|
+
if (hasScheduledPromotion) return SCHEDULED_PROMOTION_TOOLTIP;
|
|
26
|
+
return null;
|
|
27
|
+
};
|
|
28
|
+
const getHistoryActionLabel = (isPending, canRollback) => {
|
|
29
|
+
if (!isPending) return canRollback ? "Rollback" : "View details";
|
|
30
|
+
return canRollback ? "Rolling back\u2026" : "Loading\u2026";
|
|
31
|
+
};
|
|
32
|
+
const getPreflightResultMessage = ({
|
|
33
|
+
ready,
|
|
34
|
+
items_ready,
|
|
35
|
+
items_checked
|
|
36
|
+
}) => ready ? `Migration is ready (${items_ready}/${items_checked} checks passed).` : `Migration readiness requires attention (${items_ready}/${items_checked} checks passed).`;
|
|
51
37
|
const isMissingPromotionStatus = (error) => {
|
|
52
38
|
var _a;
|
|
53
39
|
if (error instanceof Error && error.message.includes("404")) return true;
|
|
54
40
|
return typeof error === "object" && error !== null && "response" in error && ((_a = error.response) == null ? void 0 : _a.status) === 404;
|
|
55
41
|
};
|
|
56
42
|
function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
57
|
-
var _a, _b, _c, _d
|
|
43
|
+
var _a, _b, _c, _d;
|
|
58
44
|
const [openSections, setOpenSections] = useState({
|
|
59
45
|
overview: true
|
|
60
46
|
});
|
|
@@ -75,6 +61,8 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
75
61
|
const [isStatusPollingStopped, setIsStatusPollingStopped] = useState(false);
|
|
76
62
|
const [isInitialStatusLoading, setIsInitialStatusLoading] = useState(true);
|
|
77
63
|
const [isCheckingPreflight, setIsCheckingPreflight] = useState(false);
|
|
64
|
+
const [isViewingPreflightDetails, setIsViewingPreflightDetails] = useState(false);
|
|
65
|
+
const [promotionStatusForActions, setPromotionStatusForActions] = useState(null);
|
|
78
66
|
const [preflightResult, setPreflightResult] = useState(null);
|
|
79
67
|
const sourceEnvironment = usePromoteFlowStore((state) => state.sourceEnvironment);
|
|
80
68
|
const destinationEnvironment = usePromoteFlowStore((state) => state.destinationEnvironment);
|
|
@@ -94,7 +82,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
94
82
|
const resetPromotionSession = usePromoteFlowStore((state) => state.resetPromotionSession);
|
|
95
83
|
const title = getGuidelineTitle(guideline);
|
|
96
84
|
const versionLabel = guideline.version ? `v${guideline.version}` : "v1";
|
|
97
|
-
const statusLabel = (_a = guideline.status) != null ? _a :
|
|
85
|
+
const statusLabel = (_a = guideline.status) != null ? _a : DEFAULT_GUIDELINE_STATUS;
|
|
98
86
|
const guidelineResourceId = getPromotionResourceId(guideline);
|
|
99
87
|
const promotionTaskForGuideline = promotionResourceId === guidelineResourceId ? promotionTask : null;
|
|
100
88
|
const errorForGuideline = errorResourceId === guidelineResourceId ? error : null;
|
|
@@ -110,13 +98,43 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
110
98
|
);
|
|
111
99
|
const isPromoting = Boolean(promotionTaskForGuideline);
|
|
112
100
|
const canRetryPromotion = (promotionTaskForGuideline == null ? void 0 : promotionTaskForGuideline.status) === "FAILED";
|
|
113
|
-
const sourceTier = (_b = sourceEnvironment == null ? void 0 : sourceEnvironment.env_tier) != null ? _b :
|
|
101
|
+
const sourceTier = (_b = sourceEnvironment == null ? void 0 : sourceEnvironment.env_tier) != null ? _b : DEFAULT_SOURCE_ENVIRONMENT_TIER;
|
|
114
102
|
const permittedDestinationTiers = useMemo(
|
|
115
103
|
() => getPermittedDestinationTiers(sourceTier),
|
|
116
104
|
[sourceTier]
|
|
117
105
|
);
|
|
118
|
-
const
|
|
119
|
-
|
|
106
|
+
const environments = {
|
|
107
|
+
source: sourceEnvironment,
|
|
108
|
+
destination: destinationEnvironment,
|
|
109
|
+
tenantSource: tenantSourceEnvironment,
|
|
110
|
+
tenantDestination: tenantDestinationEnvironment
|
|
111
|
+
};
|
|
112
|
+
const selectedEnvironment = configuredEnvironment ? environments[configuredEnvironment] : void 0;
|
|
113
|
+
const configuredEnvironmentDefaultTier = configuredEnvironment ? getDefaultEnvironmentTier(
|
|
114
|
+
configuredEnvironment,
|
|
115
|
+
selectedEnvironment,
|
|
116
|
+
permittedDestinationTiers
|
|
117
|
+
) : DEFAULT_SOURCE_ENVIRONMENT_TIER;
|
|
118
|
+
const configuredEnvironmentIsSource = configuredEnvironment ? isSourceEnvironment(configuredEnvironment) : true;
|
|
119
|
+
const configuredEnvironmentIsTenant = configuredEnvironment ? isTenantEnvironment(configuredEnvironment) : false;
|
|
120
|
+
const modalInitialConfiguration = selectedEnvironment ? {
|
|
121
|
+
env_name: selectedEnvironment.env_name,
|
|
122
|
+
env_tier: selectedEnvironment.env_tier,
|
|
123
|
+
db_type: selectedEnvironment.db_type,
|
|
124
|
+
host: selectedEnvironment.host,
|
|
125
|
+
port: String(selectedEnvironment.port),
|
|
126
|
+
username: selectedEnvironment.username,
|
|
127
|
+
password: "",
|
|
128
|
+
database_name: selectedEnvironment.database_name,
|
|
129
|
+
is_tenant_db: selectedEnvironment.is_tenant_db
|
|
130
|
+
} : {
|
|
131
|
+
...EMPTY_ENVIRONMENT_CONFIGURATION,
|
|
132
|
+
env_tier: configuredEnvironmentDefaultTier,
|
|
133
|
+
db_type: !configuredEnvironmentIsSource && configuredEnvironmentDefaultTier === "external" ? "EXTERNAL" : "INTERNAL",
|
|
134
|
+
is_tenant_db: configuredEnvironmentIsTenant
|
|
135
|
+
};
|
|
136
|
+
const modalPermittedTiers = configuredEnvironmentIsSource ? PERMITTED_SOURCE_TIERS : permittedDestinationTiers;
|
|
137
|
+
const modalPresetTier = configSearchTier != null ? configSearchTier : configuredEnvironmentDefaultTier;
|
|
120
138
|
const latestPromotionForPair = useMemo(
|
|
121
139
|
() => getLatestPromotionForEnvironmentPair(
|
|
122
140
|
promotionHistory,
|
|
@@ -125,18 +143,36 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
125
143
|
),
|
|
126
144
|
[destinationEnvironment, promotionHistory, sourceEnvironment]
|
|
127
145
|
);
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
146
|
+
const latestPromotion = useMemo(() => getLatestPromotion(promotionHistory), [promotionHistory]);
|
|
147
|
+
const latestPromotionTaskId = (_c = latestPromotion == null ? void 0 : latestPromotion.promotion_task_id) != null ? _c : null;
|
|
148
|
+
const isPromotionInProgress = PROMOTION_IN_PROGRESS_STATUSES.some(
|
|
149
|
+
(status) => status === (promotionStatusForActions == null ? void 0 : promotionStatusForActions.status)
|
|
150
|
+
);
|
|
151
|
+
const hasScheduledPromotion = (latestPromotion == null ? void 0 : latestPromotion.status) === "SCHEDULED" || (promotionStatusForActions == null ? void 0 : promotionStatusForActions.status) === "SCHEDULED";
|
|
152
|
+
const promotionActionRestriction = getPromotionActionRestriction(
|
|
153
|
+
isPromotionInProgress,
|
|
154
|
+
hasScheduledPromotion
|
|
155
|
+
);
|
|
156
|
+
const canCheckPromotionReadiness = canPromote && !promotionActionRestriction;
|
|
157
|
+
const canPromoteNow = canPromote && !promotionActionRestriction;
|
|
158
|
+
const canPromoteLater = canPromote && !isPromotionInProgress;
|
|
159
|
+
const readinessAndNowTooltip = promotionActionRestriction != null ? promotionActionRestriction : ENVIRONMENT_CONFIGURATION_TOOLTIP;
|
|
160
|
+
const promoteLaterTooltip = isPromotionInProgress ? promotionActionRestriction : ENVIRONMENT_CONFIGURATION_TOOLTIP;
|
|
139
161
|
const promoteActionLabel = (latestPromotionForPair == null ? void 0 : latestPromotionForPair.status) === "SUCCESS" ? "Sync" : "Promote Now";
|
|
162
|
+
const createPromotionRequest = () => {
|
|
163
|
+
if (!sourceEnvironment || !destinationEnvironment) return null;
|
|
164
|
+
return {
|
|
165
|
+
resource_id: guidelineResourceId,
|
|
166
|
+
resource_type: "PACKAGE",
|
|
167
|
+
target_version: "latest",
|
|
168
|
+
global_source_env_id: sourceEnvironment.env_id,
|
|
169
|
+
global_target_env_id: destinationEnvironment.env_id,
|
|
170
|
+
...tenantSourceEnvironment && tenantDestinationEnvironment ? {
|
|
171
|
+
tenant_source_env_id: tenantSourceEnvironment.env_id,
|
|
172
|
+
tenant_target_env_id: tenantDestinationEnvironment.env_id
|
|
173
|
+
} : {}
|
|
174
|
+
};
|
|
175
|
+
};
|
|
140
176
|
const toggleSection = (id) => {
|
|
141
177
|
setOpenSections((current) => ({ ...current, [id]: !current[id] }));
|
|
142
178
|
};
|
|
@@ -146,9 +182,11 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
146
182
|
setIsInitialStatusLoading(true);
|
|
147
183
|
setError(null);
|
|
148
184
|
setPromotionTask(null);
|
|
185
|
+
setPromotionStatusForActions(null);
|
|
149
186
|
const refreshInitialPromotionState = async () => {
|
|
150
187
|
try {
|
|
151
|
-
await getPromotionStatus(guidelineResourceId);
|
|
188
|
+
const status = await getPromotionStatus(guidelineResourceId);
|
|
189
|
+
if (isCurrent) setPromotionStatusForActions(status);
|
|
152
190
|
} catch (statusError) {
|
|
153
191
|
if (isCurrent && !isMissingPromotionStatus(statusError)) {
|
|
154
192
|
setError(
|
|
@@ -184,14 +222,20 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
184
222
|
getSchemaPreview(guidelineResourceId).then((preview) => {
|
|
185
223
|
if (!isCurrent) return;
|
|
186
224
|
setSchemaPreview(
|
|
187
|
-
Object.entries(preview != null ? preview : {}).reduce(
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
225
|
+
Object.entries(preview != null ? preview : {}).reduce(
|
|
226
|
+
(groups, [key, value]) => {
|
|
227
|
+
if (value && Array.isArray(value.tables)) groups[key] = value;
|
|
228
|
+
return groups;
|
|
229
|
+
},
|
|
230
|
+
{}
|
|
231
|
+
)
|
|
191
232
|
);
|
|
192
233
|
}).catch((schemaError) => {
|
|
193
234
|
if (isCurrent) {
|
|
194
|
-
console.error("Failed to load schema preview", {
|
|
235
|
+
console.error("Failed to load schema preview", {
|
|
236
|
+
resourceId: guidelineResourceId,
|
|
237
|
+
schemaError
|
|
238
|
+
});
|
|
195
239
|
setSchemaPreview({});
|
|
196
240
|
}
|
|
197
241
|
}).finally(() => {
|
|
@@ -202,18 +246,20 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
202
246
|
};
|
|
203
247
|
}, [guidelineResourceId]);
|
|
204
248
|
useEffect(() => {
|
|
205
|
-
var _a2, _b2, _c2, _d2;
|
|
206
249
|
if (!configuredEnvironment) return;
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
|
|
250
|
+
const defaultTier = getDefaultEnvironmentTier(
|
|
251
|
+
configuredEnvironment,
|
|
252
|
+
environments[configuredEnvironment],
|
|
253
|
+
permittedDestinationTiers
|
|
254
|
+
);
|
|
255
|
+
const environmentTier = configSearchTier != null ? configSearchTier : defaultTier;
|
|
210
256
|
let isCurrent = true;
|
|
211
257
|
setIsLoadingConfigs(true);
|
|
212
258
|
setPromotionConfigs([]);
|
|
213
259
|
searchEnvironmentConfigs({
|
|
214
|
-
env_tier:
|
|
215
|
-
db_type:
|
|
216
|
-
is_tenant: configuredEnvironment
|
|
260
|
+
env_tier: environmentTier,
|
|
261
|
+
db_type: environmentTier === "external" ? "EXTERNAL" : "INTERNAL",
|
|
262
|
+
is_tenant: isTenantEnvironment(configuredEnvironment)
|
|
217
263
|
}).then((configs) => {
|
|
218
264
|
if (isCurrent) setPromotionConfigs(configs);
|
|
219
265
|
}).catch(() => {
|
|
@@ -255,12 +301,15 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
255
301
|
};
|
|
256
302
|
}, [promotionTaskForGuideline == null ? void 0 : promotionTaskForGuideline.created_by, promotionTaskForGuideline == null ? void 0 : promotionTaskForGuideline.promotion_task_id]);
|
|
257
303
|
useEffect(() => {
|
|
258
|
-
|
|
304
|
+
const promotionStatusToPoll = promotionTaskForGuideline != null ? promotionTaskForGuideline : promotionStatusForActions;
|
|
305
|
+
if (!promotionStatusToPoll || isStatusPollingStopped || !PROMOTION_IN_PROGRESS_STATUSES.some((status) => status === promotionStatusToPoll.status)) {
|
|
259
306
|
return;
|
|
260
307
|
}
|
|
261
308
|
const pollStatus = async () => {
|
|
262
309
|
try {
|
|
263
|
-
|
|
310
|
+
const status = await getPromotionStatus(guidelineResourceId);
|
|
311
|
+
if (promotionTaskForGuideline) setPromotionTask(status, guidelineResourceId);
|
|
312
|
+
setPromotionStatusForActions(status);
|
|
264
313
|
} catch (pollError) {
|
|
265
314
|
setIsStatusPollingStopped(true);
|
|
266
315
|
setError(
|
|
@@ -269,30 +318,31 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
269
318
|
);
|
|
270
319
|
}
|
|
271
320
|
};
|
|
272
|
-
const intervalId = window.setInterval(pollStatus,
|
|
321
|
+
const intervalId = window.setInterval(pollStatus, PROMOTION_POLL_INTERVAL_MS);
|
|
273
322
|
return () => window.clearInterval(intervalId);
|
|
274
|
-
}, [
|
|
323
|
+
}, [
|
|
324
|
+
guidelineResourceId,
|
|
325
|
+
isStatusPollingStopped,
|
|
326
|
+
promotionStatusForActions,
|
|
327
|
+
promotionTaskForGuideline,
|
|
328
|
+
setError,
|
|
329
|
+
setPromotionTask
|
|
330
|
+
]);
|
|
275
331
|
const handlePromoteNow = async () => {
|
|
276
|
-
|
|
332
|
+
const promotionRequest = createPromotionRequest();
|
|
333
|
+
if (!canPromoteNow || !promotionRequest) return;
|
|
277
334
|
setSubmitting(true);
|
|
278
335
|
setSubmittingAction("now");
|
|
279
336
|
setError(null);
|
|
280
337
|
try {
|
|
281
|
-
const task = await startPromotion(
|
|
282
|
-
resource_id: getPromotionResourceId(guideline),
|
|
283
|
-
resource_type: "PACKAGE",
|
|
284
|
-
target_version: "latest",
|
|
285
|
-
global_source_env_id: sourceEnvironment.env_id,
|
|
286
|
-
global_target_env_id: destinationEnvironment.env_id,
|
|
287
|
-
...tenantSourceEnvironment && tenantDestinationEnvironment ? {
|
|
288
|
-
tenant_source_env_id: tenantSourceEnvironment.env_id,
|
|
289
|
-
tenant_target_env_id: tenantDestinationEnvironment.env_id
|
|
290
|
-
} : {}
|
|
291
|
-
});
|
|
338
|
+
const task = await startPromotion(promotionRequest);
|
|
292
339
|
setIsStatusPollingStopped(false);
|
|
293
340
|
setPromotionTask(task, guidelineResourceId);
|
|
341
|
+
setPromotionStatusForActions(task);
|
|
294
342
|
try {
|
|
295
|
-
|
|
343
|
+
const status = await getPromotionStatus(guidelineResourceId);
|
|
344
|
+
setPromotionTask(status, guidelineResourceId);
|
|
345
|
+
setPromotionStatusForActions(status);
|
|
296
346
|
} catch (e) {
|
|
297
347
|
}
|
|
298
348
|
onPromote == null ? void 0 : onPromote(guideline);
|
|
@@ -307,27 +357,15 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
307
357
|
}
|
|
308
358
|
};
|
|
309
359
|
const handlePreflightCheck = async () => {
|
|
310
|
-
|
|
360
|
+
const promotionRequest = createPromotionRequest();
|
|
361
|
+
if (!canCheckPromotionReadiness || !promotionRequest || isCheckingPreflight) return;
|
|
311
362
|
setIsCheckingPreflight(true);
|
|
312
363
|
setPreflightResult(null);
|
|
364
|
+
setIsViewingPreflightDetails(false);
|
|
313
365
|
setError(null);
|
|
314
366
|
try {
|
|
315
|
-
const result = await checkPromotionPreflight(
|
|
316
|
-
|
|
317
|
-
resource_type: "PACKAGE",
|
|
318
|
-
target_version: "latest",
|
|
319
|
-
global_source_env_id: sourceEnvironment.env_id,
|
|
320
|
-
global_target_env_id: destinationEnvironment.env_id,
|
|
321
|
-
...tenantSourceEnvironment && tenantDestinationEnvironment ? {
|
|
322
|
-
tenant_source_env_id: tenantSourceEnvironment.env_id,
|
|
323
|
-
tenant_target_env_id: tenantDestinationEnvironment.env_id
|
|
324
|
-
} : {}
|
|
325
|
-
});
|
|
326
|
-
setPreflightResult({
|
|
327
|
-
ready: result.ready,
|
|
328
|
-
itemsChecked: result.items_checked,
|
|
329
|
-
itemsReady: result.items_ready
|
|
330
|
-
});
|
|
367
|
+
const result = await checkPromotionPreflight(promotionRequest);
|
|
368
|
+
setPreflightResult(result);
|
|
331
369
|
} catch (preflightError) {
|
|
332
370
|
setError(
|
|
333
371
|
preflightError instanceof Error ? preflightError.message : "Unable to complete pre-flight check.",
|
|
@@ -338,10 +376,9 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
338
376
|
}
|
|
339
377
|
};
|
|
340
378
|
const handleSaveEnvironment = async (environment, configuration) => {
|
|
341
|
-
const isTenantEnvironment = environment === "tenantSource" || environment === "tenantDestination";
|
|
342
379
|
const configurationToSave = {
|
|
343
380
|
...configuration,
|
|
344
|
-
is_tenant_db: isTenantEnvironment
|
|
381
|
+
is_tenant_db: isTenantEnvironment(environment)
|
|
345
382
|
};
|
|
346
383
|
const response = await createEnvironmentConfig(
|
|
347
384
|
toCreateEnvironmentConfigRequest(configurationToSave)
|
|
@@ -349,31 +386,20 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
349
386
|
setEnvironment(environment, toRegistryRecord(response.env_id, configurationToSave));
|
|
350
387
|
};
|
|
351
388
|
const openEnvironmentConfiguration = (environment) => {
|
|
352
|
-
var _a2;
|
|
353
|
-
const selected = environment === "source" ? sourceEnvironment : environment === "destination" ? destinationEnvironment : environment === "tenantSource" ? tenantSourceEnvironment : tenantDestinationEnvironment;
|
|
354
389
|
setConfigSearchTier(
|
|
355
|
-
(
|
|
390
|
+
getDefaultEnvironmentTier(environment, environments[environment], permittedDestinationTiers)
|
|
356
391
|
);
|
|
357
392
|
setConfiguredEnvironment(environment);
|
|
358
393
|
};
|
|
359
394
|
const handlePromoteLater = async () => {
|
|
360
395
|
var _a2, _b2;
|
|
361
|
-
|
|
396
|
+
const promotionRequest = createPromotionRequest();
|
|
397
|
+
if (!canPromoteLater || !promotionRequest) return;
|
|
362
398
|
setSubmitting(true);
|
|
363
399
|
setSubmittingAction("later");
|
|
364
400
|
setError(null);
|
|
365
401
|
try {
|
|
366
|
-
const scheduledPromotion = await schedulePromotion(
|
|
367
|
-
resource_id: guidelineResourceId,
|
|
368
|
-
resource_type: "PACKAGE",
|
|
369
|
-
target_version: "latest",
|
|
370
|
-
global_source_env_id: sourceEnvironment.env_id,
|
|
371
|
-
global_target_env_id: destinationEnvironment.env_id,
|
|
372
|
-
...tenantSourceEnvironment && tenantDestinationEnvironment ? {
|
|
373
|
-
tenant_source_env_id: tenantSourceEnvironment.env_id,
|
|
374
|
-
tenant_target_env_id: tenantDestinationEnvironment.env_id
|
|
375
|
-
} : {}
|
|
376
|
-
});
|
|
402
|
+
const scheduledPromotion = await schedulePromotion(promotionRequest);
|
|
377
403
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
378
404
|
setPromotionTask(
|
|
379
405
|
{
|
|
@@ -388,6 +414,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
388
414
|
},
|
|
389
415
|
guidelineResourceId
|
|
390
416
|
);
|
|
417
|
+
setPromotionStatusForActions(scheduledPromotion);
|
|
391
418
|
onPromote == null ? void 0 : onPromote(guideline);
|
|
392
419
|
} catch (promotionError) {
|
|
393
420
|
setError(
|
|
@@ -409,8 +436,11 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
409
436
|
const task = await triggerScheduledPromotion(triggerUrl);
|
|
410
437
|
setIsStatusPollingStopped(false);
|
|
411
438
|
setPromotionTask(task, guidelineResourceId);
|
|
439
|
+
setPromotionStatusForActions(task);
|
|
412
440
|
try {
|
|
413
|
-
|
|
441
|
+
const status = await getPromotionStatus(guidelineResourceId);
|
|
442
|
+
setPromotionTask(status, guidelineResourceId);
|
|
443
|
+
setPromotionStatusForActions(status);
|
|
414
444
|
} catch (e) {
|
|
415
445
|
}
|
|
416
446
|
onPromote == null ? void 0 : onPromote(guideline);
|
|
@@ -455,9 +485,29 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
455
485
|
setHistoryActionTaskId(null);
|
|
456
486
|
}
|
|
457
487
|
};
|
|
458
|
-
const handleBack = () => {
|
|
488
|
+
const handleBack = async () => {
|
|
459
489
|
if (promotionTaskForGuideline) {
|
|
460
490
|
setPromotionTask(null);
|
|
491
|
+
setIsInitialStatusLoading(true);
|
|
492
|
+
setIsLoadingHistory(true);
|
|
493
|
+
try {
|
|
494
|
+
const [status, history] = await Promise.all([
|
|
495
|
+
getPromotionStatus(guidelineResourceId),
|
|
496
|
+
getPromotionHistory(guidelineResourceId)
|
|
497
|
+
]);
|
|
498
|
+
setPromotionStatusForActions(status);
|
|
499
|
+
setPromotionHistory(history);
|
|
500
|
+
} catch (refreshError) {
|
|
501
|
+
if (!isMissingPromotionStatus(refreshError)) {
|
|
502
|
+
setError(
|
|
503
|
+
refreshError instanceof Error ? refreshError.message : "Unable to refresh promotion details.",
|
|
504
|
+
guidelineResourceId
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
} finally {
|
|
508
|
+
setIsInitialStatusLoading(false);
|
|
509
|
+
setIsLoadingHistory(false);
|
|
510
|
+
}
|
|
461
511
|
return;
|
|
462
512
|
}
|
|
463
513
|
handleGoToMarketplace();
|
|
@@ -597,7 +647,10 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
597
647
|
),
|
|
598
648
|
onClick: () => canRollback ? handleRollbackPromotion(row.promotion_task_id) : handleViewPromotionDetails(row.promotion_task_id),
|
|
599
649
|
disabled: isInitialStatusLoading || historyActionTaskId !== null,
|
|
600
|
-
children:
|
|
650
|
+
children: getHistoryActionLabel(
|
|
651
|
+
historyActionTaskId === row.promotion_task_id,
|
|
652
|
+
canRollback
|
|
653
|
+
)
|
|
601
654
|
}
|
|
602
655
|
)
|
|
603
656
|
] })
|
|
@@ -606,9 +659,11 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
606
659
|
] }) }) });
|
|
607
660
|
}
|
|
608
661
|
if (id === "database") {
|
|
609
|
-
if (isLoadingSchemaPreview)
|
|
662
|
+
if (isLoadingSchemaPreview)
|
|
663
|
+
return /* @__PURE__ */ jsx("div", { className: cssStyles.emptyBody, children: "Loading database details\u2026" });
|
|
610
664
|
const groups = Object.entries(schemaPreview);
|
|
611
|
-
if (groups.length === 0)
|
|
665
|
+
if (groups.length === 0)
|
|
666
|
+
return /* @__PURE__ */ jsx("div", { className: cssStyles.emptyBody, children: "No database details available." });
|
|
612
667
|
return /* @__PURE__ */ jsx("div", { className: cssStyles.databaseGrid, children: groups.flatMap(
|
|
613
668
|
([groupName, group]) => ["Source", "Destination"].map((environment) => /* @__PURE__ */ jsxs("div", { className: cssStyles.databaseCard, children: [
|
|
614
669
|
/* @__PURE__ */ jsxs("h3", { children: [
|
|
@@ -631,6 +686,15 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
631
686
|
}
|
|
632
687
|
return /* @__PURE__ */ jsx("div", { className: cssStyles.emptyBody, children: "No details available yet." });
|
|
633
688
|
};
|
|
689
|
+
if (isViewingPreflightDetails && preflightResult) {
|
|
690
|
+
return /* @__PURE__ */ jsx("div", { className: cx(cssStyles.root, className), children: /* @__PURE__ */ jsx(
|
|
691
|
+
PreflightDetailsPage,
|
|
692
|
+
{
|
|
693
|
+
result: preflightResult,
|
|
694
|
+
onBack: () => setIsViewingPreflightDetails(false)
|
|
695
|
+
}
|
|
696
|
+
) });
|
|
697
|
+
}
|
|
634
698
|
return /* @__PURE__ */ jsxs("div", { className: cx(cssStyles.root, className), children: [
|
|
635
699
|
/* @__PURE__ */ jsxs("main", { className: cssStyles.body, children: [
|
|
636
700
|
/* @__PURE__ */ jsxs("div", { className: cssStyles.topRow, children: [
|
|
@@ -646,33 +710,26 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
646
710
|
/* @__PURE__ */ jsx(
|
|
647
711
|
StyledPromoteTooltip,
|
|
648
712
|
{
|
|
649
|
-
title:
|
|
713
|
+
title: canCheckPromotionReadiness ? "Optionally check that this migration is ready before promoting." : readinessAndNowTooltip,
|
|
714
|
+
disableHoverListener: canCheckPromotionReadiness,
|
|
650
715
|
placement: "top",
|
|
651
716
|
arrow: true,
|
|
652
|
-
children: /* @__PURE__ */ jsxs(
|
|
717
|
+
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsxs(
|
|
653
718
|
"button",
|
|
654
719
|
{
|
|
655
720
|
type: "button",
|
|
656
721
|
className: cssStyles.secondaryButton,
|
|
657
722
|
onClick: handlePreflightCheck,
|
|
658
|
-
disabled: !
|
|
723
|
+
disabled: !canCheckPromotionReadiness || isCheckingPreflight,
|
|
659
724
|
children: [
|
|
660
725
|
/* @__PURE__ */ jsx(CircleCheck, { className: cssStyles.buttonIcon, strokeWidth: 2.2 }),
|
|
661
726
|
isCheckingPreflight ? "Checking readiness\u2026" : "Check promotion readiness"
|
|
662
727
|
]
|
|
663
728
|
}
|
|
664
|
-
)
|
|
729
|
+
) })
|
|
665
730
|
}
|
|
666
731
|
),
|
|
667
|
-
/* @__PURE__ */ jsx(
|
|
668
|
-
StyledPromoteTooltip,
|
|
669
|
-
{
|
|
670
|
-
title: "Runs a safe validation of the selected source and destination environments. It does not start a migration.",
|
|
671
|
-
placement: "top",
|
|
672
|
-
arrow: true,
|
|
673
|
-
children: /* @__PURE__ */ jsx("span", { className: cssStyles.preflightInfo, "aria-label": "About the pre-flight check", children: /* @__PURE__ */ jsx(Info, { className: cssStyles.helpIcon, strokeWidth: 2.2, "aria-hidden": "true" }) })
|
|
674
|
-
}
|
|
675
|
-
)
|
|
732
|
+
/* @__PURE__ */ jsx(StyledPromoteTooltip, { title: PREFLIGHT_TOOLTIP, placement: "top", arrow: true, children: /* @__PURE__ */ jsx("span", { className: cssStyles.preflightInfo, "aria-label": "About the pre-flight check", children: /* @__PURE__ */ jsx(Info, { className: cssStyles.helpIcon, strokeWidth: 2.2, "aria-hidden": "true" }) }) })
|
|
676
733
|
] }),
|
|
677
734
|
isPromoting ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
678
735
|
canRetryPromotion && /* @__PURE__ */ jsxs(
|
|
@@ -681,7 +738,7 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
681
738
|
type: "button",
|
|
682
739
|
className: cssStyles.primaryButton,
|
|
683
740
|
onClick: handlePromoteNow,
|
|
684
|
-
disabled: !
|
|
741
|
+
disabled: !canPromoteNow,
|
|
685
742
|
children: [
|
|
686
743
|
/* @__PURE__ */ jsx(ArrowUpRight, { className: cssStyles.buttonIcon, strokeWidth: 2.2 }),
|
|
687
744
|
isSubmitting ? "Starting promotion\u2026" : promoteActionLabel
|
|
@@ -701,55 +758,74 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
701
758
|
}
|
|
702
759
|
)
|
|
703
760
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
704
|
-
submittingAction !== "now" && /* @__PURE__ */
|
|
705
|
-
|
|
761
|
+
submittingAction !== "now" && /* @__PURE__ */ jsx(
|
|
762
|
+
StyledPromoteTooltip,
|
|
706
763
|
{
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
children:
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
764
|
+
title: canPromoteLater ? "" : promoteLaterTooltip,
|
|
765
|
+
disableHoverListener: canPromoteLater,
|
|
766
|
+
placement: "top",
|
|
767
|
+
arrow: true,
|
|
768
|
+
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsxs(
|
|
769
|
+
"button",
|
|
770
|
+
{
|
|
771
|
+
type: "button",
|
|
772
|
+
className: cssStyles.secondaryButton,
|
|
773
|
+
onClick: handlePromoteLater,
|
|
774
|
+
disabled: !canPromoteLater,
|
|
775
|
+
children: [
|
|
776
|
+
/* @__PURE__ */ jsx(Calendar, { className: cssStyles.buttonIcon, strokeWidth: 2.2 }),
|
|
777
|
+
submittingAction === "later" ? "Scheduling\u2026" : "Promote later"
|
|
778
|
+
]
|
|
779
|
+
}
|
|
780
|
+
) })
|
|
715
781
|
}
|
|
716
782
|
),
|
|
717
783
|
submittingAction !== "later" && /* @__PURE__ */ jsx(
|
|
718
784
|
StyledPromoteTooltip,
|
|
719
785
|
{
|
|
720
|
-
title:
|
|
721
|
-
disableHoverListener:
|
|
786
|
+
title: canPromoteNow ? "" : readinessAndNowTooltip,
|
|
787
|
+
disableHoverListener: canPromoteNow,
|
|
722
788
|
placement: "top",
|
|
723
789
|
arrow: true,
|
|
724
|
-
children: /* @__PURE__ */ jsxs(
|
|
790
|
+
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsxs(
|
|
725
791
|
"button",
|
|
726
792
|
{
|
|
727
793
|
type: "button",
|
|
728
794
|
className: cssStyles.primaryButton,
|
|
729
795
|
onClick: handlePromoteNow,
|
|
730
|
-
disabled: !
|
|
796
|
+
disabled: !canPromoteNow,
|
|
731
797
|
children: [
|
|
732
798
|
/* @__PURE__ */ jsx(ArrowUpRight, { className: cssStyles.buttonIcon, strokeWidth: 2.2 }),
|
|
733
799
|
submittingAction === "now" ? "Starting promotion\u2026" : promoteActionLabel
|
|
734
800
|
]
|
|
735
801
|
}
|
|
736
|
-
)
|
|
802
|
+
) })
|
|
737
803
|
}
|
|
738
804
|
)
|
|
739
805
|
] })
|
|
740
806
|
] })
|
|
741
807
|
] }),
|
|
742
808
|
preflightResult && /* @__PURE__ */ jsxs("div", { className: cssStyles.preflightSuccess, role: "status", children: [
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
809
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
810
|
+
"Pre-flight check completed successfully. ",
|
|
811
|
+
getPreflightResultMessage(preflightResult)
|
|
812
|
+
] }),
|
|
813
|
+
preflightResult.ready && /* @__PURE__ */ jsx(
|
|
814
|
+
"button",
|
|
815
|
+
{
|
|
816
|
+
type: "button",
|
|
817
|
+
className: cssStyles.preflightDetailsButton,
|
|
818
|
+
onClick: () => setIsViewingPreflightDetails(true),
|
|
819
|
+
children: "View preflight details"
|
|
820
|
+
}
|
|
821
|
+
)
|
|
746
822
|
] }),
|
|
747
823
|
isPromoting ? /* @__PURE__ */ jsxs("div", { className: cssStyles.promotionStatusBox, children: [
|
|
748
824
|
/* @__PURE__ */ jsx("div", { className: cssStyles.promotionStatusRow, children: /* @__PURE__ */ jsxs("div", { className: cssStyles.promotionStatusRowHeader, children: [
|
|
749
825
|
/* @__PURE__ */ jsxs("div", { className: cssStyles.promotionStatusField, children: [
|
|
750
826
|
/* @__PURE__ */ jsx("span", { className: cssStyles.metaLabel, children: "Promotion Status" }),
|
|
751
827
|
/* @__PURE__ */ jsxs("div", { className: cssStyles.statusWithPill, children: [
|
|
752
|
-
/* @__PURE__ */ jsx("span", { className: cssStyles.statusValue, children: (
|
|
828
|
+
/* @__PURE__ */ jsx("span", { className: cssStyles.statusValue, children: (_d = promotionTaskForGuideline == null ? void 0 : promotionTaskForGuideline.status) != null ? _d : "In Progress" }),
|
|
753
829
|
(promotionTaskForGuideline == null ? void 0 : promotionTaskForGuideline.status) === "MIGRATING" && /* @__PURE__ */ jsxs("span", { className: cssStyles.ingestingPill, children: [
|
|
754
830
|
/* @__PURE__ */ jsx(LoaderCircle, { className: cssStyles.migrationLoader, "aria-hidden": "true" }),
|
|
755
831
|
"Migration in progress"
|
|
@@ -886,27 +962,12 @@ function PromoteFlow({ guideline, onBack, onPromote, className }) {
|
|
|
886
962
|
EnvironmentConfigurationModal,
|
|
887
963
|
{
|
|
888
964
|
environment: configuredEnvironment,
|
|
889
|
-
initialConfiguration:
|
|
890
|
-
|
|
891
|
-
env_tier: selectedEnvironment.env_tier,
|
|
892
|
-
db_type: selectedEnvironment.db_type,
|
|
893
|
-
host: selectedEnvironment.host,
|
|
894
|
-
port: String(selectedEnvironment.port),
|
|
895
|
-
username: selectedEnvironment.username,
|
|
896
|
-
password: "",
|
|
897
|
-
database_name: selectedEnvironment.database_name,
|
|
898
|
-
is_tenant_db: selectedEnvironment.is_tenant_db
|
|
899
|
-
} : {
|
|
900
|
-
...EMPTY_ENVIRONMENT_CONFIGURATION,
|
|
901
|
-
env_tier: configuredEnvironment === "source" || configuredEnvironment === "tenantSource" ? "dev" : permittedDestinationTiers[0],
|
|
902
|
-
db_type: (configuredEnvironment === "destination" || configuredEnvironment === "tenantDestination") && permittedDestinationTiers[0] === "external" ? "EXTERNAL" : "INTERNAL",
|
|
903
|
-
is_tenant_db: configuredEnvironment === "tenantSource" || configuredEnvironment === "tenantDestination"
|
|
904
|
-
},
|
|
905
|
-
permittedTiers: configuredEnvironment === "source" || configuredEnvironment === "tenantSource" ? permittedSourceTiers : permittedDestinationTiers,
|
|
965
|
+
initialConfiguration: modalInitialConfiguration,
|
|
966
|
+
permittedTiers: modalPermittedTiers,
|
|
906
967
|
onSave: handleSaveEnvironment,
|
|
907
968
|
onSelectPreset: setEnvironment,
|
|
908
969
|
onPresetTierChange: setConfigSearchTier,
|
|
909
|
-
presetTier:
|
|
970
|
+
presetTier: modalPresetTier,
|
|
910
971
|
onClose: () => {
|
|
911
972
|
setConfiguredEnvironment(null);
|
|
912
973
|
setConfigSearchTier(null);
|