@solidxai/core-ui 0.1.20-beta.0 → 0.1.20-beta.1
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/components/common/Link.d.ts.map +1 -1
- package/dist/components/common/Link.js +2 -1
- package/dist/components/common/Link.js.map +1 -1
- package/dist/components/common/Link.tsx +2 -1
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.d.ts +1 -0
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.d.ts.map +1 -1
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.js +109 -23
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.js.map +1 -1
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.tsx +155 -34
- package/dist/components/core/chatter/SolidChatter.js +2 -2
- package/dist/components/core/chatter/SolidChatter.js.map +1 -1
- package/dist/components/core/chatter/SolidChatter.tsx +2 -2
- package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.js +20 -19
- package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.js.map +1 -1
- package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.tsx +16 -16
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.js +36 -9
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.js.map +1 -1
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.tsx +78 -7
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.d.ts +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.js +1 -1
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.js.map +1 -1
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.tsx +1 -1
- package/dist/components/core/extension/solid-core/moduleMetadata/list/RestoreModulePackageRowAction.d.ts +4 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/RestoreModulePackageRowAction.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/RestoreModulePackageRowAction.js +131 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/RestoreModulePackageRowAction.js.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/RestoreModulePackageRowAction.tsx +151 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/UpdateModulePackageRowAction.d.ts +4 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/UpdateModulePackageRowAction.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/UpdateModulePackageRowAction.js +13 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/UpdateModulePackageRowAction.js.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/UpdateModulePackageRowAction.tsx +20 -0
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +4 -0
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +4 -0
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +50 -15
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +22 -3
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +16 -3
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +16 -2
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +4 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.tsx +4 -1
- package/dist/components/core/module/ModulePackageDialog.css +102 -0
- package/dist/components/core/module/ModulePackageDialog.d.ts +2 -1
- package/dist/components/core/module/ModulePackageDialog.d.ts.map +1 -1
- package/dist/components/core/module/ModulePackageDialog.js +216 -68
- package/dist/components/core/module/ModulePackageDialog.js.map +1 -1
- package/dist/components/core/module/ModulePackageDialog.tsx +356 -76
- package/dist/components/core/solid-agent/SolidAgentChat.d.ts.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentChat.js +9 -3
- package/dist/components/core/solid-agent/SolidAgentChat.js.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentChat.tsx +9 -4
- package/dist/components/core/solid-agent/SolidAgentMarkdown.d.ts.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentMarkdown.js +25 -6
- package/dist/components/core/solid-agent/SolidAgentMarkdown.js.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentMarkdown.tsx +15 -1
- package/dist/components/core/solid-agent/client/agentRuntime.d.ts +5 -0
- package/dist/components/core/solid-agent/client/agentRuntime.d.ts.map +1 -1
- package/dist/components/core/solid-agent/client/agentRuntime.js +77 -20
- package/dist/components/core/solid-agent/client/agentRuntime.js.map +1 -1
- package/dist/components/core/solid-agent/client/agentRuntime.ts +29 -1
- package/dist/components/core/solid-agent/client/agentSocket.d.ts +5 -1
- package/dist/components/core/solid-agent/client/agentSocket.d.ts.map +1 -1
- package/dist/components/core/solid-agent/client/agentSocket.js +27 -4
- package/dist/components/core/solid-agent/client/agentSocket.js.map +1 -1
- package/dist/components/core/solid-agent/client/agentSocket.ts +14 -3
- package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.js +2 -2
- package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.js.map +1 -1
- package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.tsx +5 -5
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.d.ts +2 -0
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.d.ts.map +1 -1
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.js +2 -2
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.js.map +1 -1
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.ts +4 -4
- package/dist/components/core/solid-agent/thread/AgentThread.d.ts.map +1 -1
- package/dist/components/core/solid-agent/thread/AgentThread.js +61 -26
- package/dist/components/core/solid-agent/thread/AgentThread.js.map +1 -1
- package/dist/components/core/solid-agent/thread/AgentThread.tsx +74 -40
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.d.ts +2 -1
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.d.ts.map +1 -1
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.js +2 -1
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.js.map +1 -1
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.tsx +3 -1
- package/dist/components/core/solid-agent/types.d.ts +3 -0
- package/dist/components/core/solid-agent/types.d.ts.map +1 -1
- package/dist/components/core/solid-agent/types.js +0 -9
- package/dist/components/core/solid-agent/types.js.map +1 -1
- package/dist/components/core/solid-agent/types.ts +4 -2
- package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.d.ts +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.d.ts.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.js +5 -2
- package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.tsx +11 -5
- package/dist/components/core/solid-agent/widgets/DefaultErrorChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/DefaultErrorChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultErrorChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/DefaultThinkingChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/DefaultThinkingChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultThinkingChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/DefaultUnknownChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/DefaultUnknownChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultUnknownChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidChecklistChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidChecklistChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidChecklistChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidCodeChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidCodeChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidCodeChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidDiffListChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidDiffListChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidDiffListChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidGalleryChatWidget.js +19 -0
- package/dist/components/core/solid-agent/widgets/SolidGalleryChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidGalleryChatWidget.tsx +20 -0
- package/dist/components/core/solid-agent/widgets/SolidJsonChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidJsonChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidJsonChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidLinkCardChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidLinkCardChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidLinkCardChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidMarkdownChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidMarkdownChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidMarkdownChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/solidChatWidgets.module.css +9 -1
- package/dist/components/core/users/CreateUser.d.ts.map +1 -1
- package/dist/components/core/users/CreateUser.js +23 -8
- package/dist/components/core/users/CreateUser.js.map +1 -1
- package/dist/components/core/users/CreateUser.tsx +10 -6
- package/dist/components/layout/AdminTopHeader.js +2 -2
- package/dist/components/layout/AdminTopHeader.js.map +1 -1
- package/dist/components/layout/AdminTopHeader.tsx +2 -2
- package/dist/components/layout/AppSidebar.d.ts.map +1 -1
- package/dist/components/layout/AppSidebar.js +21 -5
- package/dist/components/layout/AppSidebar.js.map +1 -1
- package/dist/components/layout/AppSidebar.tsx +24 -6
- package/dist/components/layout/SolidAiStudioLayout.d.ts.map +1 -1
- package/dist/components/layout/SolidAiStudioLayout.js +3 -4
- package/dist/components/layout/SolidAiStudioLayout.js.map +1 -1
- package/dist/components/layout/SolidAiStudioLayout.tsx +3 -4
- package/dist/components/layout/user-profile-menu.js +10 -10
- package/dist/components/layout/user-profile-menu.js.map +1 -1
- package/dist/components/layout/user-profile-menu.tsx +3 -3
- package/dist/components/shad-cn-ui/SolidLightbox.d.ts +2 -1
- package/dist/components/shad-cn-ui/SolidLightbox.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidLightbox.js +11 -4
- package/dist/components/shad-cn-ui/SolidLightbox.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidLightbox.tsx +14 -1
- package/dist/helpers/modelViewPersistence.d.ts +2 -0
- package/dist/helpers/modelViewPersistence.d.ts.map +1 -1
- package/dist/helpers/modelViewPersistence.js +72 -0
- package/dist/helpers/modelViewPersistence.js.map +1 -1
- package/dist/helpers/modelViewPersistence.ts +79 -0
- package/dist/helpers/registry.d.ts +6 -2
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +68 -3
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +62 -4
- package/dist/hooks/useModelsDevModels.d.ts +43 -0
- package/dist/hooks/useModelsDevModels.d.ts.map +1 -0
- package/dist/hooks/useModelsDevModels.js +81 -0
- package/dist/hooks/useModelsDevModels.js.map +1 -0
- package/dist/hooks/useModelsDevModels.ts +106 -0
- package/dist/hooks/useRouter.d.ts.map +1 -1
- package/dist/hooks/useRouter.js +3 -2
- package/dist/hooks/useRouter.js.map +1 -1
- package/dist/hooks/useRouter.ts +3 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.ts +4 -1
- package/dist/modules/solidUiModule.d.ts +3 -2
- package/dist/modules/solidUiModule.d.ts.map +1 -1
- package/dist/modules/solidUiModule.js +1 -1
- package/dist/modules/solidUiModule.js.map +1 -1
- package/dist/modules/solidUiModule.ts +5 -1
- package/dist/redux/api/moduleApi.d.ts +12 -2
- package/dist/redux/api/moduleApi.d.ts.map +1 -1
- package/dist/redux/api/moduleApi.js +33 -3
- package/dist/redux/api/moduleApi.js.map +1 -1
- package/dist/redux/api/moduleApi.ts +17 -2
- package/dist/redux/api/solidChatterMessageApi.d.ts +3 -1
- package/dist/redux/api/solidChatterMessageApi.d.ts.map +1 -1
- package/dist/redux/api/solidChatterMessageApi.js +9 -1
- package/dist/redux/api/solidChatterMessageApi.js.map +1 -1
- package/dist/redux/api/solidChatterMessageApi.ts +9 -1
- package/dist/redux/store/defaultStoreConfig.d.ts +9 -1
- package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
- package/dist/resources/globals.css +30 -0
- package/dist/resources/solid-custom.css +10 -6
- package/dist/resources/solid-tailwind-generated.css +1 -1
- package/dist/routes/AppEventListener.js +1 -1
- package/dist/routes/AppEventListener.js.map +1 -1
- package/dist/routes/AppEventListener.tsx +1 -1
- package/dist/routes/pages/admin/core/AgentPersonaHistory.css +130 -0
- package/dist/routes/pages/admin/core/AgentPersonaHistory.d.ts +7 -0
- package/dist/routes/pages/admin/core/AgentPersonaHistory.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/AgentPersonaHistory.js +228 -0
- package/dist/routes/pages/admin/core/AgentPersonaHistory.js.map +1 -0
- package/dist/routes/pages/admin/core/AgentPersonaHistory.tsx +234 -0
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.css +6 -14
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js +186 -146
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.tsx +170 -118
- package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.d.ts +2 -0
- package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.js +108 -0
- package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.js.map +1 -0
- package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.tsx +96 -0
- package/dist/routes/solidRoutes.d.ts.map +1 -1
- package/dist/routes/solidRoutes.js +2 -0
- package/dist/routes/solidRoutes.js.map +1 -1
- package/dist/routes/solidRoutes.tsx +2 -0
- package/dist/types/extension-registry.d.ts +12 -0
- package/dist/types/extension-registry.d.ts.map +1 -1
- package/dist/types/extension-registry.js.map +1 -1
- package/dist/types/extension-registry.ts +15 -0
- package/dist/types/solid-core.d.ts +2 -0
- package/package.json +2 -1
|
@@ -48,23 +48,53 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
48
48
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
49
49
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
50
50
|
import { useDropzone } from "react-dropzone";
|
|
51
|
-
import { FileArchive, FolderTree, RefreshCw, Sparkles, UploadCloud, X } from "lucide-react";
|
|
52
|
-
import { useConfirmModulePackageImportMutation, useDismissModulePackageImportMutation, useLazyGetModulePackageImportStatusQuery, useRunModulePackageBuildMutation, useRunModulePackageSeedMutation, useValidateModulePackageImportMutation, } from "../../../redux/api/moduleApi";
|
|
51
|
+
import { ArrowRight, FileArchive, FolderTree, RefreshCw, RotateCcw, Sparkles, UploadCloud, X } from "lucide-react";
|
|
52
|
+
import { useConfirmModulePackageImportMutation, useDismissModulePackageImportMutation, useLazyGetModulePackageImportStatusQuery, useRestoreModulePackageImportMutation, useRunModulePackageBuildMutation, useRunModulePackageSeedMutation, useValidateModulePackageImportMutation, } from "../../../redux/api/moduleApi";
|
|
53
53
|
import { showToast } from "../../../redux/features/toastSlice";
|
|
54
54
|
import { useDispatch } from "react-redux";
|
|
55
55
|
import { SolidButton, SolidCheckbox, SolidDialog, SolidDialogBody, SolidDialogDescription, SolidDialogHeader, SolidDialogSeparator, SolidDialogTitle, SolidIcon, SolidSpinner, } from "../../shad-cn-ui";
|
|
56
56
|
import "./ModulePackageDialog.css";
|
|
57
57
|
var STEP_ORDER = ["preview", "import", "build", "seed"];
|
|
58
|
-
|
|
58
|
+
var VERSION_COMPARISONS = {
|
|
59
|
+
new: { label: "New install", tone: "neutral" },
|
|
60
|
+
upgrade: { label: "Upgrade", tone: "neutral" },
|
|
61
|
+
first_version: { label: "First versioned release", tone: "neutral" },
|
|
62
|
+
same: { label: "Reinstall", tone: "warning" },
|
|
63
|
+
downgrade: { label: "Downgrade", tone: "danger" },
|
|
64
|
+
legacy_package: { label: "Unversioned package", tone: "danger" },
|
|
65
|
+
};
|
|
66
|
+
function formatVersionLabel(version) {
|
|
67
|
+
return version ? "v".concat(version) : "unversioned";
|
|
68
|
+
}
|
|
69
|
+
function getPackageMode(transaction, fallbackMode) {
|
|
70
|
+
var _a, _b, _c;
|
|
71
|
+
if (fallbackMode === void 0) { fallbackMode = "install"; }
|
|
72
|
+
return (_c = (_a = transaction === null || transaction === void 0 ? void 0 : transaction.mode) !== null && _a !== void 0 ? _a : (_b = transaction === null || transaction === void 0 ? void 0 : transaction.preview) === null || _b === void 0 ? void 0 : _b.mode) !== null && _c !== void 0 ? _c : fallbackMode;
|
|
73
|
+
}
|
|
74
|
+
function getWorkflowLabels(transaction, fallbackMode) {
|
|
75
|
+
if (fallbackMode === void 0) { fallbackMode = "install"; }
|
|
76
|
+
if (transaction === null || transaction === void 0 ? void 0 : transaction.restoredFromBackup)
|
|
77
|
+
return { noun: "restore", past: "restored" };
|
|
78
|
+
return getPackageMode(transaction, fallbackMode) === "update"
|
|
79
|
+
? { noun: "update", past: "updated" }
|
|
80
|
+
: { noun: "import", past: "imported" };
|
|
81
|
+
}
|
|
82
|
+
function createInitialSteps(mode) {
|
|
83
|
+
if (mode === void 0) { mode = "install"; }
|
|
84
|
+
var isUpdate = mode === "update";
|
|
59
85
|
return {
|
|
60
86
|
preview: {
|
|
61
87
|
title: "Preview",
|
|
62
|
-
description:
|
|
88
|
+
description: isUpdate
|
|
89
|
+
? "Upload a `.sldx` archive of the new version to compare it with the installed module."
|
|
90
|
+
: "Upload a `.sldx` archive to validate it and preview its contents automatically.",
|
|
63
91
|
status: "pending",
|
|
64
92
|
},
|
|
65
93
|
import: {
|
|
66
|
-
title: "Import",
|
|
67
|
-
description:
|
|
94
|
+
title: isUpdate ? "Update" : "Import",
|
|
95
|
+
description: isUpdate
|
|
96
|
+
? "Replace the module folders with the new version. The current folders are backed up first. This may restart the UI and API, dismiss the popup, and require a page refresh before you continue."
|
|
97
|
+
: "Import the files locally. This may restart the UI and API, dismiss the popup, and require a page refresh before you continue.",
|
|
68
98
|
status: "pending",
|
|
69
99
|
},
|
|
70
100
|
build: {
|
|
@@ -74,7 +104,9 @@ function createInitialSteps() {
|
|
|
74
104
|
},
|
|
75
105
|
seed: {
|
|
76
106
|
title: "Seed",
|
|
77
|
-
description:
|
|
107
|
+
description: isUpdate
|
|
108
|
+
? "Seed the updated module after the build step completes."
|
|
109
|
+
: "Seed the imported module after the build step completes.",
|
|
78
110
|
status: "pending",
|
|
79
111
|
},
|
|
80
112
|
};
|
|
@@ -110,6 +142,7 @@ function isResumableModulePackageStatus(status) {
|
|
|
110
142
|
"build_succeeded",
|
|
111
143
|
"seed_running",
|
|
112
144
|
"seed_failed",
|
|
145
|
+
"restore_running",
|
|
113
146
|
].includes(String(status !== null && status !== void 0 ? status : ""));
|
|
114
147
|
}
|
|
115
148
|
function getBuildStepStatusFromTransaction(transaction) {
|
|
@@ -121,18 +154,27 @@ function getBuildStepStatusFromTransaction(transaction) {
|
|
|
121
154
|
}
|
|
122
155
|
return "pending";
|
|
123
156
|
}
|
|
124
|
-
function hydrateStepsFromTransaction(transaction) {
|
|
125
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
126
|
-
|
|
157
|
+
function hydrateStepsFromTransaction(transaction, fallbackMode) {
|
|
158
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
159
|
+
if (fallbackMode === void 0) { fallbackMode = "install"; }
|
|
160
|
+
var mode = getPackageMode(transaction, fallbackMode);
|
|
161
|
+
var nextSteps = createInitialSteps(mode);
|
|
127
162
|
var status = String((_a = transaction === null || transaction === void 0 ? void 0 : transaction.status) !== null && _a !== void 0 ? _a : "");
|
|
163
|
+
var noun = getWorkflowLabels(transaction, fallbackMode).noun;
|
|
128
164
|
if ((transaction === null || transaction === void 0 ? void 0 : transaction.preview) || (transaction === null || transaction === void 0 ? void 0 : transaction.validation)) {
|
|
129
165
|
nextSteps.preview = __assign(__assign({}, nextSteps.preview), { status: ((_b = transaction === null || transaction === void 0 ? void 0 : transaction.validation) === null || _b === void 0 ? void 0 : _b.valid) ? "success" : "warning", description: ((_c = transaction === null || transaction === void 0 ? void 0 : transaction.validation) === null || _c === void 0 ? void 0 : _c.valid)
|
|
130
166
|
? "Archive validated and ready for import."
|
|
131
167
|
: "Archive preview loaded, but the package has validation issues to fix first." });
|
|
132
168
|
}
|
|
133
|
-
if (
|
|
134
|
-
|
|
135
|
-
|
|
169
|
+
if (status !== "restore_running" &&
|
|
170
|
+
(((_d = transaction === null || transaction === void 0 ? void 0 : transaction.outputs) === null || _d === void 0 ? void 0 : _d.import) ||
|
|
171
|
+
["awaiting_restart", "build_running", "build_failed", "build_succeeded", "seed_running", "seed_failed", "completed"].includes(status))) {
|
|
172
|
+
nextSteps.import = __assign(__assign({}, nextSteps.import), { status: "success", description: (transaction === null || transaction === void 0 ? void 0 : transaction.restoredFromBackup)
|
|
173
|
+
? "Previous version restored. Wait for the UI and API to finish restarting, then refresh this page to continue."
|
|
174
|
+
: "Archive extracted. Wait for the UI and API to finish restarting, then refresh this page to continue.", output: [(_e = transaction === null || transaction === void 0 ? void 0 : transaction.outputs) === null || _e === void 0 ? void 0 : _e.import, (_f = transaction === null || transaction === void 0 ? void 0 : transaction.outputs) === null || _f === void 0 ? void 0 : _f.restore].filter(Boolean).join("\n\n") || undefined });
|
|
175
|
+
}
|
|
176
|
+
else if (status === "restore_running") {
|
|
177
|
+
nextSteps.import = __assign(__assign({}, nextSteps.import), { status: "warning", description: "Restoring the previous version did not finish. Use Restore again to complete it.", output: (_h = (_g = transaction === null || transaction === void 0 ? void 0 : transaction.outputs) === null || _g === void 0 ? void 0 : _g.import) !== null && _h !== void 0 ? _h : undefined });
|
|
136
178
|
}
|
|
137
179
|
var buildStatus = getBuildStepStatusFromTransaction(transaction);
|
|
138
180
|
if (buildStatus !== "pending") {
|
|
@@ -140,19 +182,19 @@ function hydrateStepsFromTransaction(transaction) {
|
|
|
140
182
|
? "Build was previously started. Use Build Now to run it again once you are ready."
|
|
141
183
|
: buildStatus === "warning"
|
|
142
184
|
? (transaction === null || transaction === void 0 ? void 0 : transaction.errorMessage) || "The build step completed with warnings."
|
|
143
|
-
: "Both build targets completed successfully.", output: (
|
|
185
|
+
: "Both build targets completed successfully.", output: (_k = (_j = transaction === null || transaction === void 0 ? void 0 : transaction.outputs) === null || _j === void 0 ? void 0 : _j.build) !== null && _k !== void 0 ? _k : undefined });
|
|
144
186
|
}
|
|
145
187
|
else if (status === "awaiting_restart") {
|
|
146
|
-
nextSteps.build = __assign(__assign({}, nextSteps.build), { status: "pending", description: "
|
|
188
|
+
nextSteps.build = __assign(__assign({}, nextSteps.build), { status: "pending", description: "".concat(noun.charAt(0).toUpperCase()).concat(noun.slice(1), " completed. Once the UI and API are back, refresh this module list page and continue with Build Now.") });
|
|
147
189
|
}
|
|
148
190
|
if (status === "seed_running") {
|
|
149
|
-
nextSteps.seed = __assign(__assign({}, nextSteps.seed), { status: "warning", description: "Seed was previously started. Use Seed to run it again once you are ready.", output: (
|
|
191
|
+
nextSteps.seed = __assign(__assign({}, nextSteps.seed), { status: "warning", description: "Seed was previously started. Use Seed to run it again once you are ready.", output: (_m = (_l = transaction === null || transaction === void 0 ? void 0 : transaction.outputs) === null || _l === void 0 ? void 0 : _l.seed) !== null && _m !== void 0 ? _m : undefined });
|
|
150
192
|
}
|
|
151
193
|
else if (status === "seed_failed") {
|
|
152
|
-
nextSteps.seed = __assign(__assign({}, nextSteps.seed), { status: "warning", description: (transaction === null || transaction === void 0 ? void 0 : transaction.errorMessage) || "The seed step finished with warnings.", output: (
|
|
194
|
+
nextSteps.seed = __assign(__assign({}, nextSteps.seed), { status: "warning", description: (transaction === null || transaction === void 0 ? void 0 : transaction.errorMessage) || "The seed step finished with warnings.", output: (_p = (_o = transaction === null || transaction === void 0 ? void 0 : transaction.outputs) === null || _o === void 0 ? void 0 : _o.seed) !== null && _p !== void 0 ? _p : undefined });
|
|
153
195
|
}
|
|
154
196
|
else if (status === "completed") {
|
|
155
|
-
nextSteps.seed = __assign(__assign({}, nextSteps.seed), { status: "success", description: "Module metadata seeding completed successfully.", output: (
|
|
197
|
+
nextSteps.seed = __assign(__assign({}, nextSteps.seed), { status: "success", description: "Module metadata seeding completed successfully.", output: (_r = (_q = transaction === null || transaction === void 0 ? void 0 : transaction.outputs) === null || _q === void 0 ? void 0 : _q.seed) !== null && _r !== void 0 ? _r : undefined });
|
|
156
198
|
}
|
|
157
199
|
return nextSteps;
|
|
158
200
|
}
|
|
@@ -190,24 +232,30 @@ export function ModulePackageDialog(_a) {
|
|
|
190
232
|
}
|
|
191
233
|
export function ModulePackageImportContent(_a) {
|
|
192
234
|
var _this = this;
|
|
193
|
-
var _b, _c, _d, _e;
|
|
194
|
-
var onClose = _a.onClose, onImported = _a.onImported,
|
|
235
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
236
|
+
var onClose = _a.onClose, onImported = _a.onImported, _u = _a.initialTransactionKey, initialTransactionKey = _u === void 0 ? null : _u, _v = _a.autoResume, autoResume = _v === void 0 ? false : _v, _w = _a.targetModuleName, targetModuleName = _w === void 0 ? null : _w;
|
|
195
237
|
var dispatch = useDispatch();
|
|
196
|
-
var
|
|
197
|
-
var
|
|
198
|
-
var
|
|
199
|
-
var
|
|
200
|
-
var
|
|
201
|
-
var
|
|
202
|
-
var
|
|
203
|
-
var
|
|
204
|
-
var
|
|
238
|
+
var fallbackMode = targetModuleName ? "update" : "install";
|
|
239
|
+
var _x = useState(null), selectedFile = _x[0], setSelectedFile = _x[1];
|
|
240
|
+
var _y = useState(null), previewResponse = _y[0], setPreviewResponse = _y[1];
|
|
241
|
+
var _z = useState(null), transactionKey = _z[0], setTransactionKey = _z[1];
|
|
242
|
+
var _0 = useState(false), overwriteExisting = _0[0], setOverwriteExisting = _0[1];
|
|
243
|
+
var _1 = useState(false), acknowledgeVersionChange = _1[0], setAcknowledgeVersionChange = _1[1];
|
|
244
|
+
var _2 = useState(false), pruneOnSeed = _2[0], setPruneOnSeed = _2[1];
|
|
245
|
+
var _3 = useState(false), showAllFiles = _3[0], setShowAllFiles = _3[1];
|
|
246
|
+
var _4 = useState(false), isRestoreConfirmOpen = _4[0], setRestoreConfirmOpen = _4[1];
|
|
247
|
+
var _5 = useState(function () { return createInitialSteps(fallbackMode); }), steps = _5[0], setSteps = _5[1];
|
|
248
|
+
var _6 = useState("preview"), selectedStep = _6[0], setSelectedStep = _6[1];
|
|
249
|
+
var _7 = useState(null), finalSummary = _7[0], setFinalSummary = _7[1];
|
|
250
|
+
var _8 = useState(false), isPreviewing = _8[0], setIsPreviewing = _8[1];
|
|
251
|
+
var _9 = useState(false), isProcessing = _9[0], setIsProcessing = _9[1];
|
|
205
252
|
var validateModulePackageImport = useValidateModulePackageImportMutation()[0];
|
|
206
253
|
var confirmModulePackageImport = useConfirmModulePackageImportMutation()[0];
|
|
207
254
|
var dismissModulePackageImport = useDismissModulePackageImportMutation()[0];
|
|
208
255
|
var fetchModulePackageImportStatus = useLazyGetModulePackageImportStatusQuery()[0];
|
|
209
256
|
var runModulePackageBuild = useRunModulePackageBuildMutation()[0];
|
|
210
257
|
var runModulePackageSeed = useRunModulePackageSeedMutation()[0];
|
|
258
|
+
var restoreModulePackageImport = useRestoreModulePackageImportMutation()[0];
|
|
211
259
|
var hasResumedTransactionRef = useRef(false);
|
|
212
260
|
var lastAutoPreviewFileRef = useRef(null);
|
|
213
261
|
var updateStep = useCallback(function (key, nextState) {
|
|
@@ -216,7 +264,7 @@ export function ModulePackageImportContent(_a) {
|
|
|
216
264
|
return (__assign(__assign({}, current), (_a = {}, _a[key] = __assign(__assign({}, current[key]), nextState), _a)));
|
|
217
265
|
});
|
|
218
266
|
}, []);
|
|
219
|
-
var
|
|
267
|
+
var _10 = useDropzone({
|
|
220
268
|
accept: {
|
|
221
269
|
"application/octet-stream": [".sldx"],
|
|
222
270
|
"application/x-zip-compressed": [".sldx"],
|
|
@@ -230,11 +278,24 @@ export function ModulePackageImportContent(_a) {
|
|
|
230
278
|
setSelectedFile(acceptedFiles[0]);
|
|
231
279
|
}
|
|
232
280
|
},
|
|
233
|
-
}), getRootProps =
|
|
281
|
+
}), getRootProps = _10.getRootProps, getInputProps = _10.getInputProps, openFilePicker = _10.open, isDragActive = _10.isDragActive;
|
|
234
282
|
var isArchiveValid = Boolean((_b = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.validation) === null || _b === void 0 ? void 0 : _b.valid);
|
|
235
283
|
var hasConflicts = ((_d = (_c = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.conflicts) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0;
|
|
236
284
|
var suggestedStep = getSuggestedStepFromSteps(steps, Boolean(previewResponse), isArchiveValid);
|
|
237
|
-
var
|
|
285
|
+
var packageMode = getPackageMode(previewResponse, fallbackMode);
|
|
286
|
+
var isUpdate = packageMode === "update";
|
|
287
|
+
var workflowLabels = getWorkflowLabels(previewResponse, fallbackMode);
|
|
288
|
+
var packageModuleName = ((_f = (_e = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _e === void 0 ? void 0 : _e.module) === null || _f === void 0 ? void 0 : _f.name) || (previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.moduleName) || targetModuleName || "this module";
|
|
289
|
+
var installedVersion = (_j = (_g = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.installedVersion) !== null && _g !== void 0 ? _g : (_h = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _h === void 0 ? void 0 : _h.installedVersion) !== null && _j !== void 0 ? _j : null;
|
|
290
|
+
var incomingVersion = (_m = (_k = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.incomingVersion) !== null && _k !== void 0 ? _k : (_l = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _l === void 0 ? void 0 : _l.incomingVersion) !== null && _m !== void 0 ? _m : null;
|
|
291
|
+
var versionComparison = (_q = (_o = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.versionComparison) !== null && _o !== void 0 ? _o : (_p = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _p === void 0 ? void 0 : _p.versionComparison) !== null && _q !== void 0 ? _q : null;
|
|
292
|
+
var requiresVersionAcknowledgement = Boolean((_r = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _r === void 0 ? void 0 : _r.requiresVersionAcknowledgement);
|
|
293
|
+
// Clicking the Update button approves the shown version; risky updates also need an explicit acknowledgement.
|
|
294
|
+
var isUpdateApproved = !isUpdate || !requiresVersionAcknowledgement || acknowledgeVersionChange;
|
|
295
|
+
var backup = (_s = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.backup) !== null && _s !== void 0 ? _s : null;
|
|
296
|
+
var canImport = steps.preview.status !== "pending" && isArchiveValid && isUpdateApproved && steps.import.status !== "success" && !isProcessing && !isPreviewing;
|
|
297
|
+
var canRestore = Boolean(backup && transactionKey) && steps.import.status !== "pending" && !isProcessing;
|
|
298
|
+
var isRestoreInterrupted = (previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.status) === "restore_running";
|
|
238
299
|
var canRunBuild = steps.import.status === "success" && !isProcessing;
|
|
239
300
|
var canRunSeed = (steps.build.status === "success" || steps.build.status === "warning") && !isProcessing;
|
|
240
301
|
var canContinueFromPreview = Boolean(previewResponse) && isArchiveValid && !isPreviewing;
|
|
@@ -278,6 +339,9 @@ export function ModulePackageImportContent(_a) {
|
|
|
278
339
|
}
|
|
279
340
|
formData = new FormData();
|
|
280
341
|
formData.append("modulePackage", selectedFile);
|
|
342
|
+
if (targetModuleName) {
|
|
343
|
+
formData.append("expectedModuleName", targetModuleName);
|
|
344
|
+
}
|
|
281
345
|
_e.label = 1;
|
|
282
346
|
case 1:
|
|
283
347
|
_e.trys.push([1, 3, 4, 5]);
|
|
@@ -288,15 +352,17 @@ export function ModulePackageImportContent(_a) {
|
|
|
288
352
|
setPreviewResponse(response);
|
|
289
353
|
setTransactionKey((_a = response === null || response === void 0 ? void 0 : response.transactionKey) !== null && _a !== void 0 ? _a : null);
|
|
290
354
|
setOverwriteExisting(false);
|
|
355
|
+
setAcknowledgeVersionChange(false);
|
|
356
|
+
setShowAllFiles(false);
|
|
291
357
|
setFinalSummary(null);
|
|
292
|
-
setSteps(hydrateStepsFromTransaction(response));
|
|
358
|
+
setSteps(hydrateStepsFromTransaction(response, fallbackMode));
|
|
293
359
|
setSelectedStep("preview");
|
|
294
360
|
dispatch(showToast({
|
|
295
361
|
severity: ((_b = response === null || response === void 0 ? void 0 : response.validation) === null || _b === void 0 ? void 0 : _b.valid) ? "success" : "warn",
|
|
296
362
|
summary: ((_c = response === null || response === void 0 ? void 0 : response.validation) === null || _c === void 0 ? void 0 : _c.valid) ? "Archive validated" : "Archive needs attention",
|
|
297
363
|
detail: ((_d = response === null || response === void 0 ? void 0 : response.validation) === null || _d === void 0 ? void 0 : _d.valid)
|
|
298
|
-
? "Review the preview and continue with the
|
|
299
|
-
: "The uploaded archive
|
|
364
|
+
? "Review the preview and continue with the ".concat(getWorkflowLabels(response, fallbackMode).noun, " when you are ready.")
|
|
365
|
+
: "The uploaded archive has validation issues. Review them below.",
|
|
300
366
|
}));
|
|
301
367
|
return [3 /*break*/, 5];
|
|
302
368
|
case 3:
|
|
@@ -309,7 +375,7 @@ export function ModulePackageImportContent(_a) {
|
|
|
309
375
|
case 5: return [2 /*return*/];
|
|
310
376
|
}
|
|
311
377
|
});
|
|
312
|
-
}); }, [dispatch, selectedFile, validateModulePackageImport]);
|
|
378
|
+
}); }, [dispatch, fallbackMode, selectedFile, targetModuleName, validateModulePackageImport]);
|
|
313
379
|
useEffect(function () {
|
|
314
380
|
if (!selectedFile) {
|
|
315
381
|
lastAutoPreviewFileRef.current = null;
|
|
@@ -359,11 +425,12 @@ export function ModulePackageImportContent(_a) {
|
|
|
359
425
|
case 0:
|
|
360
426
|
updateStep("seed", {
|
|
361
427
|
status: "running",
|
|
362
|
-
description: "Running `solidctl seed --modules-to-seed` for the
|
|
428
|
+
description: "Running `solidctl seed --modules-to-seed".concat(pruneOnSeed ? " --prune" : "", "` for the ").concat(workflowLabels.past, " module."),
|
|
363
429
|
});
|
|
364
430
|
return [4 /*yield*/, runModulePackageSeed({
|
|
365
431
|
transactionKey: activeTransactionKey,
|
|
366
432
|
seedGlobalMetadata: false,
|
|
433
|
+
prune: pruneOnSeed,
|
|
367
434
|
}).unwrap()];
|
|
368
435
|
case 1:
|
|
369
436
|
seedResponse = _b.sent();
|
|
@@ -378,7 +445,7 @@ export function ModulePackageImportContent(_a) {
|
|
|
378
445
|
return [2 /*return*/, seedResponse];
|
|
379
446
|
}
|
|
380
447
|
});
|
|
381
|
-
}); }, [runModulePackageSeed, updateStep]);
|
|
448
|
+
}); }, [pruneOnSeed, runModulePackageSeed, updateStep, workflowLabels.past]);
|
|
382
449
|
var handleRunBuild = useCallback(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
383
450
|
var buildResponse, error_2;
|
|
384
451
|
return __generator(this, function (_a) {
|
|
@@ -440,14 +507,14 @@ export function ModulePackageImportContent(_a) {
|
|
|
440
507
|
onImported === null || onImported === void 0 ? void 0 : onImported();
|
|
441
508
|
}
|
|
442
509
|
if (buildFailed && !seedFailed) {
|
|
443
|
-
setFinalSummary("Module
|
|
510
|
+
setFinalSummary("Module ".concat(workflowLabels.past, " and seeded successfully, but the build step reported errors."));
|
|
444
511
|
return [2 /*return*/];
|
|
445
512
|
}
|
|
446
513
|
if (seedFailed) {
|
|
447
|
-
setFinalSummary("Module
|
|
514
|
+
setFinalSummary("Module ".concat(workflowLabels.past, ", but the seed step needs attention."));
|
|
448
515
|
return [2 /*return*/];
|
|
449
516
|
}
|
|
450
|
-
setFinalSummary("Module
|
|
517
|
+
setFinalSummary("Module ".concat(workflowLabels.noun, " completed successfully."));
|
|
451
518
|
return [3 /*break*/, 4];
|
|
452
519
|
case 3:
|
|
453
520
|
error_3 = _c.sent();
|
|
@@ -461,14 +528,14 @@ export function ModulePackageImportContent(_a) {
|
|
|
461
528
|
case 4: return [2 /*return*/];
|
|
462
529
|
}
|
|
463
530
|
});
|
|
464
|
-
}); }, [dispatch, executeSeedStep, onImported, (
|
|
531
|
+
}); }, [dispatch, executeSeedStep, onImported, (_t = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.outputs) === null || _t === void 0 ? void 0 : _t.build, steps.build.status, transactionKey, updateStep, workflowLabels.noun, workflowLabels.past]);
|
|
465
532
|
useEffect(function () {
|
|
466
533
|
if (!initialTransactionKey || hasResumedTransactionRef.current) {
|
|
467
534
|
return;
|
|
468
535
|
}
|
|
469
536
|
hasResumedTransactionRef.current = true;
|
|
470
537
|
var loadTransaction = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
471
|
-
var transaction, hydratedSteps, error_4;
|
|
538
|
+
var transaction, hydratedSteps, labels, error_4;
|
|
472
539
|
var _a, _b;
|
|
473
540
|
return __generator(this, function (_c) {
|
|
474
541
|
switch (_c.label) {
|
|
@@ -477,17 +544,19 @@ export function ModulePackageImportContent(_a) {
|
|
|
477
544
|
return [4 /*yield*/, fetchModulePackageImportStatus({ transactionKey: initialTransactionKey }).unwrap()];
|
|
478
545
|
case 1:
|
|
479
546
|
transaction = _c.sent();
|
|
480
|
-
hydratedSteps = hydrateStepsFromTransaction(transaction);
|
|
547
|
+
hydratedSteps = hydrateStepsFromTransaction(transaction, fallbackMode);
|
|
548
|
+
labels = getWorkflowLabels(transaction, fallbackMode);
|
|
481
549
|
setPreviewResponse(transaction);
|
|
482
550
|
setTransactionKey((_a = transaction === null || transaction === void 0 ? void 0 : transaction.transactionKey) !== null && _a !== void 0 ? _a : null);
|
|
483
551
|
setSteps(hydratedSteps);
|
|
552
|
+
setPruneOnSeed(Boolean(transaction === null || transaction === void 0 ? void 0 : transaction.restoredFromBackup));
|
|
484
553
|
setSelectedStep(getSuggestedStepFromSteps(hydratedSteps, Boolean((transaction === null || transaction === void 0 ? void 0 : transaction.preview) || (transaction === null || transaction === void 0 ? void 0 : transaction.validation)), Boolean((_b = transaction === null || transaction === void 0 ? void 0 : transaction.validation) === null || _b === void 0 ? void 0 : _b.valid)));
|
|
485
554
|
if ((transaction === null || transaction === void 0 ? void 0 : transaction.status) === "completed") {
|
|
486
|
-
setFinalSummary("Module
|
|
555
|
+
setFinalSummary("Module ".concat(labels.noun, " completed successfully."));
|
|
487
556
|
return [2 /*return*/];
|
|
488
557
|
}
|
|
489
558
|
if ((transaction === null || transaction === void 0 ? void 0 : transaction.status) === "seed_failed") {
|
|
490
|
-
setFinalSummary("Module
|
|
559
|
+
setFinalSummary("Module ".concat(labels.past, ", but the seed step needs attention."));
|
|
491
560
|
return [2 /*return*/];
|
|
492
561
|
}
|
|
493
562
|
if (!autoResume || !isResumableModulePackageStatus(transaction === null || transaction === void 0 ? void 0 : transaction.status)) {
|
|
@@ -503,7 +572,7 @@ export function ModulePackageImportContent(_a) {
|
|
|
503
572
|
});
|
|
504
573
|
}); };
|
|
505
574
|
void loadTransaction();
|
|
506
|
-
}, [autoResume, dispatch, fetchModulePackageImportStatus, initialTransactionKey]);
|
|
575
|
+
}, [autoResume, dispatch, fallbackMode, fetchModulePackageImportStatus, initialTransactionKey]);
|
|
507
576
|
var handleStartImport = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
508
577
|
var response, error_5;
|
|
509
578
|
var _a;
|
|
@@ -521,12 +590,13 @@ export function ModulePackageImportContent(_a) {
|
|
|
521
590
|
setFinalSummary(null);
|
|
522
591
|
updateStep("import", {
|
|
523
592
|
status: "running",
|
|
524
|
-
description:
|
|
593
|
+
description: isUpdate
|
|
594
|
+
? "Backing up the current module folders and placing the new version into `solid-api` and `solid-ui`."
|
|
595
|
+
: "Extracting the archive and placing files into `solid-api` and `solid-ui`.",
|
|
525
596
|
});
|
|
526
|
-
return [4 /*yield*/, confirmModulePackageImport(
|
|
527
|
-
transactionKey: transactionKey,
|
|
528
|
-
overwriteExisting: overwriteExisting
|
|
529
|
-
}).unwrap()];
|
|
597
|
+
return [4 /*yield*/, confirmModulePackageImport(isUpdate
|
|
598
|
+
? { transactionKey: transactionKey, confirmedVersion: incomingVersion, acknowledgeVersionChange: acknowledgeVersionChange }
|
|
599
|
+
: { transactionKey: transactionKey, overwriteExisting: overwriteExisting }).unwrap()];
|
|
530
600
|
case 2:
|
|
531
601
|
response = _b.sent();
|
|
532
602
|
updateStep("import", {
|
|
@@ -538,8 +608,10 @@ export function ModulePackageImportContent(_a) {
|
|
|
538
608
|
setIsProcessing(false);
|
|
539
609
|
dispatch(showToast({
|
|
540
610
|
severity: "success",
|
|
541
|
-
summary: "Module imported",
|
|
542
|
-
detail:
|
|
611
|
+
summary: isUpdate ? "Module updated" : "Module imported",
|
|
612
|
+
detail: isUpdate
|
|
613
|
+
? "".concat(packageModuleName, " was updated to ").concat(formatVersionLabel(incomingVersion), ". Wait for the UI and API to restart, then refresh this module list page to continue with build and seed.")
|
|
614
|
+
: "The module files were placed locally. Wait for the UI and API to restart, then refresh this module list page to continue with build and seed.",
|
|
543
615
|
}));
|
|
544
616
|
onClose();
|
|
545
617
|
return [3 /*break*/, 4];
|
|
@@ -549,13 +621,50 @@ export function ModulePackageImportContent(_a) {
|
|
|
549
621
|
status: "error",
|
|
550
622
|
description: getErrorMessage(error_5),
|
|
551
623
|
});
|
|
552
|
-
setFinalSummary("The module
|
|
624
|
+
setFinalSummary("The module ".concat(workflowLabels.noun, " could not be completed."));
|
|
553
625
|
setIsProcessing(false);
|
|
554
626
|
return [3 /*break*/, 4];
|
|
555
627
|
case 4: return [2 /*return*/];
|
|
556
628
|
}
|
|
557
629
|
});
|
|
558
630
|
}); };
|
|
631
|
+
var handleRestore = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
632
|
+
var response, error_6;
|
|
633
|
+
return __generator(this, function (_a) {
|
|
634
|
+
switch (_a.label) {
|
|
635
|
+
case 0:
|
|
636
|
+
if (!transactionKey || !backup) {
|
|
637
|
+
return [2 /*return*/];
|
|
638
|
+
}
|
|
639
|
+
_a.label = 1;
|
|
640
|
+
case 1:
|
|
641
|
+
_a.trys.push([1, 3, , 4]);
|
|
642
|
+
setIsProcessing(true);
|
|
643
|
+
setFinalSummary(null);
|
|
644
|
+
return [4 /*yield*/, restoreModulePackageImport({ transactionKey: transactionKey }).unwrap()];
|
|
645
|
+
case 2:
|
|
646
|
+
response = _a.sent();
|
|
647
|
+
setPreviewResponse(response);
|
|
648
|
+
setSteps(hydrateStepsFromTransaction(response, fallbackMode));
|
|
649
|
+
setPruneOnSeed(true);
|
|
650
|
+
setRestoreConfirmOpen(false);
|
|
651
|
+
setIsProcessing(false);
|
|
652
|
+
dispatch(showToast({
|
|
653
|
+
severity: "success",
|
|
654
|
+
summary: "Previous version restored",
|
|
655
|
+
detail: "".concat(packageModuleName, " ").concat(formatVersionLabel(backup.version), " was put back. Wait for the UI and API to restart, then refresh this module list page to continue with build and seed."),
|
|
656
|
+
}));
|
|
657
|
+
onClose();
|
|
658
|
+
return [3 /*break*/, 4];
|
|
659
|
+
case 3:
|
|
660
|
+
error_6 = _a.sent();
|
|
661
|
+
setIsProcessing(false);
|
|
662
|
+
dispatch(showToast({ severity: "error", summary: "Restore failed", detail: getErrorMessage(error_6) }));
|
|
663
|
+
return [3 /*break*/, 4];
|
|
664
|
+
case 4: return [2 /*return*/];
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
}); };
|
|
559
668
|
var handleClose = function () {
|
|
560
669
|
if (isProcessing)
|
|
561
670
|
return;
|
|
@@ -564,8 +673,37 @@ export function ModulePackageImportContent(_a) {
|
|
|
564
673
|
}
|
|
565
674
|
onClose();
|
|
566
675
|
};
|
|
676
|
+
var renderVersionApproval = function () {
|
|
677
|
+
var _a, _b;
|
|
678
|
+
var comparison = (_a = VERSION_COMPARISONS[versionComparison !== null && versionComparison !== void 0 ? versionComparison : ""]) !== null && _a !== void 0 ? _a : { label: "Update", tone: "neutral" };
|
|
679
|
+
var identicalContent = Boolean((_b = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _b === void 0 ? void 0 : _b.identicalContent);
|
|
680
|
+
var acknowledgementLabel = identicalContent
|
|
681
|
+
? "Reinstall anyway, even though the content is identical"
|
|
682
|
+
: versionComparison === "same"
|
|
683
|
+
? "I understand this reinstalls ".concat(formatVersionLabel(installedVersion))
|
|
684
|
+
: versionComparison === "downgrade"
|
|
685
|
+
? "I understand this downgrades ".concat(packageModuleName, " to ").concat(formatVersionLabel(incomingVersion))
|
|
686
|
+
: "I understand this package has no version";
|
|
687
|
+
return (_jsxs("div", { className: "solid-module-package-notice".concat(comparison.tone === "danger" ? " is-danger" : comparison.tone === "warning" ? " is-warning" : ""), children: [_jsx("div", { className: "solid-module-package-notice__title", children: "Version change" }), _jsxs("div", { className: "solid-module-package-version", children: [_jsx("span", { className: "solid-module-package-version__value", children: formatVersionLabel(installedVersion) }), _jsx(ArrowRight, { size: 14, "aria-label": "to" }), _jsx("span", { className: "solid-module-package-version__value", children: formatVersionLabel(incomingVersion) }), _jsx("span", { className: "solid-module-package-version__badge is-".concat(comparison.tone), children: comparison.label })] }), isArchiveValid && requiresVersionAcknowledgement ? (_jsx(SolidCheckbox, { checked: acknowledgeVersionChange, onChange: function (event) { return setAcknowledgeVersionChange(event.currentTarget.checked); }, label: acknowledgementLabel })) : null] }));
|
|
688
|
+
};
|
|
689
|
+
var renderChangeSummary = function () {
|
|
690
|
+
var _a, _b;
|
|
691
|
+
var changeSet = (_a = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _a === void 0 ? void 0 : _a.changeSet;
|
|
692
|
+
if (!changeSet)
|
|
693
|
+
return null;
|
|
694
|
+
var sides = [["solid-api", changeSet.solidApi], ["solid-ui", changeSet.solidUi]];
|
|
695
|
+
return (_jsxs("div", { className: "solid-module-package-checklist__section", children: [_jsx("div", { className: "solid-module-package-checklist__title", children: "Files that will change" }), ((_b = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _b === void 0 ? void 0 : _b.identicalContent) ? (_jsx("p", { className: "solid-module-package-diff__empty", children: "No file changes. The package content matches the installed module." })) : null, sides.map(function (_a) {
|
|
696
|
+
var _b, _c, _d, _e;
|
|
697
|
+
var label = _a[0], diff = _a[1];
|
|
698
|
+
var added = (_b = diff === null || diff === void 0 ? void 0 : diff.added) !== null && _b !== void 0 ? _b : [];
|
|
699
|
+
var modified = (_c = diff === null || diff === void 0 ? void 0 : diff.modified) !== null && _c !== void 0 ? _c : [];
|
|
700
|
+
var removed = (_d = diff === null || diff === void 0 ? void 0 : diff.removed) !== null && _d !== void 0 ? _d : [];
|
|
701
|
+
var hasChanges = added.length + modified.length + removed.length > 0;
|
|
702
|
+
return (_jsxs("details", { className: "solid-module-package-diff", children: [_jsxs("summary", { children: [_jsx("span", { className: "solid-module-package-diff__side", children: label }), _jsxs("span", { className: "is-added", children: ["+", added.length] }), _jsxs("span", { className: "is-modified", children: ["~", modified.length] }), _jsxs("span", { className: "is-removed", children: ["\u2212", removed.length] }), _jsxs("span", { className: "solid-module-package-diff__unchanged", children: [(_e = diff === null || diff === void 0 ? void 0 : diff.unchangedCount) !== null && _e !== void 0 ? _e : 0, " unchanged"] })] }), _jsxs("ul", { className: "solid-module-package-diff__list", children: [added.map(function (file) { return _jsxs("li", { className: "is-added", children: ["+ ", file] }, "a:".concat(file)); }), modified.map(function (file) { return _jsxs("li", { className: "is-modified", children: ["~ ", file] }, "m:".concat(file)); }), removed.map(function (file) { return _jsxs("li", { className: "is-removed", children: ["\u2212 ", file] }, "r:".concat(file)); }), !hasChanges ? _jsx("li", { children: "No changes" }) : null] })] }, label));
|
|
703
|
+
})] }));
|
|
704
|
+
};
|
|
567
705
|
var renderPreviewContent = function () {
|
|
568
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
706
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
569
707
|
return (_jsxs("div", { className: "solid-module-package-preview", children: [!selectedFile ? (_jsxs("div", __assign({}, getRootProps({
|
|
570
708
|
className: "solid-module-package-dropzone".concat(isDragActive ? " is-active" : ""),
|
|
571
709
|
}), { children: [_jsx("input", __assign({}, getInputProps())), _jsx("div", { className: "solid-module-package-dropzone__icon", children: _jsx(UploadCloud, { size: 22 }) }), _jsxs("div", { className: "solid-module-package-dropzone__copy", children: [_jsx("div", { className: "solid-module-package-dropzone__title", children: "Upload `.sldx` archive" }), _jsx("p", { children: "Choose a packaged SolidX module archive from the local file system. Preview starts automatically after upload." })] }), _jsx("div", { className: "solid-module-package-dropzone__actions", children: _jsx(SolidButton, { type: "button", size: "small", variant: "outline", onClick: function (event) {
|
|
@@ -576,25 +714,30 @@ export function ModulePackageImportContent(_a) {
|
|
|
576
714
|
setPreviewResponse(null);
|
|
577
715
|
setTransactionKey(null);
|
|
578
716
|
setOverwriteExisting(false);
|
|
717
|
+
setAcknowledgeVersionChange(false);
|
|
579
718
|
setFinalSummary(null);
|
|
580
719
|
setSelectedStep("preview");
|
|
581
|
-
setSteps(createInitialSteps());
|
|
720
|
+
setSteps(createInitialSteps(fallbackMode));
|
|
582
721
|
}, disabled: isProcessing, children: "Remove" })] })), !previewResponse ? (_jsxs("div", { className: "solid-module-package-empty", children: [isPreviewing ? _jsx(SolidSpinner, { size: 18 }) : _jsx(FolderTree, { size: 18 }), _jsx("p", { children: isPreviewing
|
|
583
722
|
? "Reading the archive and validating the SolidX markers."
|
|
584
|
-
: "Upload an archive to start the automatic preview and validation flow." })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "solid-module-package-metrics", children: [_jsxs("div", { className: "solid-module-package-metric", children: [_jsx("span", { className: "solid-module-package-metric__label", children: "Module" }), _jsx("span", { className: "solid-module-package-metric__value", children: ((_b = (_a = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _a === void 0 ? void 0 : _a.module) === null || _b === void 0 ? void 0 : _b.name) || "Unknown" })] }), _jsxs("div", { className: "solid-module-package-metric", children: [_jsx("span", { className: "solid-module-package-metric__label", children: "solid-api files" }), _jsx("span", { className: "solid-module-package-metric__value", children: (_e = (_d = (_c = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _c === void 0 ? void 0 : _c.contentsSummary) === null || _d === void 0 ? void 0 : _d.solidApiEntries) !== null && _e !== void 0 ? _e : 0 })] }), _jsxs("div", { className: "solid-module-package-metric", children: [_jsx("span", { className: "solid-module-package-metric__label", children: "solid-ui files" }), _jsx("span", { className: "solid-module-package-metric__value", children: (_h = (_g = (_f = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _f === void 0 ? void 0 : _f.contentsSummary) === null || _g === void 0 ? void 0 : _g.solidUiEntries) !== null && _h !== void 0 ? _h : 0 })] })] }), _jsxs("div", { className: "solid-module-package-checklist", children: [_jsxs("div", { className: "solid-module-package-checklist__section", children: [_jsx("div", { className: "solid-module-package-checklist__title", children: "Required markers" }), _jsxs("ul", { className: "solid-module-package-inline-list", children: [_jsx("li", { children: (_k = (_j = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _j === void 0 ? void 0 : _j.requiredPaths) === null || _k === void 0 ? void 0 : _k.metadataPath }), _jsx("li", { children: (_m = (_l = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _l === void 0 ? void 0 : _l.requiredPaths) === null || _m === void 0 ? void 0 : _m.apiModulePath }), _jsx("li", { children: (_p = (_o = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _o === void 0 ? void 0 : _o.requiredPaths) === null || _p === void 0 ? void 0 : _p.uiModulePath })] })] }), ((_s = (_r = (_q = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.validation) === null || _q === void 0 ? void 0 : _q.warnings) === null || _r === void 0 ? void 0 : _r.length) !== null && _s !== void 0 ? _s : 0) > 0 ? (_jsxs("div", { className: "solid-module-package-notice is-warning", children: [_jsx("div", { className: "solid-module-package-notice__title", children: "Warnings" }), _jsx("ul", { className: "solid-module-package-inline-list", children: previewResponse.validation.warnings.map(function (warning) { return (_jsx("li", { children: warning }, warning)); }) })] })) : null, ((_v = (_u = (_t = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.validation) === null || _t === void 0 ? void 0 : _t.errors) === null || _u === void 0 ? void 0 : _u.length) !== null && _v !== void 0 ? _v : 0) > 0 ? (_jsxs("div", { className: "solid-module-package-notice is-danger", children: [_jsx("div", { className: "solid-module-package-notice__title", children: "Validation issues" }), _jsx("ul", { className: "solid-module-package-inline-list", children: previewResponse.validation.errors.map(function (error) { return (_jsx("li", { children: error }, error)); }) })] })) : null, hasConflicts ? (_jsxs("div", { className: "solid-module-package-notice is-warning", children: [_jsx("div", { className: "solid-module-package-notice__title", children: "Existing files detected" }), _jsx("ul", { className: "solid-module-package-inline-list", children: previewResponse.conflicts.map(function (conflict) { return (_jsx("li", { children: conflict }, conflict)); }) }), _jsx(SolidCheckbox, { checked: overwriteExisting, onChange: function (event) { return setOverwriteExisting(event.currentTarget.checked); }, label: "Overwrite the existing module folders during import" })] })) : null] }), _jsx("div", { className: "solid-module-package-tree", children: ((
|
|
723
|
+
: "Upload an archive to start the automatic preview and validation flow." })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "solid-module-package-metrics", children: [_jsxs("div", { className: "solid-module-package-metric", children: [_jsx("span", { className: "solid-module-package-metric__label", children: "Module" }), _jsx("span", { className: "solid-module-package-metric__value", children: ((_b = (_a = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _a === void 0 ? void 0 : _a.module) === null || _b === void 0 ? void 0 : _b.name) || "Unknown" })] }), _jsxs("div", { className: "solid-module-package-metric", children: [_jsx("span", { className: "solid-module-package-metric__label", children: "solid-api files" }), _jsx("span", { className: "solid-module-package-metric__value", children: (_e = (_d = (_c = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _c === void 0 ? void 0 : _c.contentsSummary) === null || _d === void 0 ? void 0 : _d.solidApiEntries) !== null && _e !== void 0 ? _e : 0 })] }), _jsxs("div", { className: "solid-module-package-metric", children: [_jsx("span", { className: "solid-module-package-metric__label", children: "solid-ui files" }), _jsx("span", { className: "solid-module-package-metric__value", children: (_h = (_g = (_f = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _f === void 0 ? void 0 : _f.contentsSummary) === null || _g === void 0 ? void 0 : _g.solidUiEntries) !== null && _h !== void 0 ? _h : 0 })] })] }), _jsxs("div", { className: "solid-module-package-checklist", children: [isUpdate ? renderVersionApproval() : null, isUpdate ? renderChangeSummary() : null, _jsxs("div", { className: "solid-module-package-checklist__section", children: [_jsx("div", { className: "solid-module-package-checklist__title", children: "Required markers" }), _jsxs("ul", { className: "solid-module-package-inline-list", children: [_jsx("li", { children: (_k = (_j = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _j === void 0 ? void 0 : _j.requiredPaths) === null || _k === void 0 ? void 0 : _k.metadataPath }), _jsx("li", { children: (_m = (_l = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _l === void 0 ? void 0 : _l.requiredPaths) === null || _m === void 0 ? void 0 : _m.apiModulePath }), _jsx("li", { children: (_p = (_o = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _o === void 0 ? void 0 : _o.requiredPaths) === null || _p === void 0 ? void 0 : _p.uiModulePath })] })] }), ((_s = (_r = (_q = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.validation) === null || _q === void 0 ? void 0 : _q.warnings) === null || _r === void 0 ? void 0 : _r.length) !== null && _s !== void 0 ? _s : 0) > 0 ? (_jsxs("div", { className: "solid-module-package-notice is-warning", children: [_jsx("div", { className: "solid-module-package-notice__title", children: "Warnings" }), _jsx("ul", { className: "solid-module-package-inline-list", children: previewResponse.validation.warnings.map(function (warning) { return (_jsx("li", { children: warning }, warning)); }) })] })) : null, ((_v = (_u = (_t = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.validation) === null || _t === void 0 ? void 0 : _t.errors) === null || _u === void 0 ? void 0 : _u.length) !== null && _v !== void 0 ? _v : 0) > 0 ? (_jsxs("div", { className: "solid-module-package-notice is-danger", children: [_jsx("div", { className: "solid-module-package-notice__title", children: "Validation issues" }), _jsx("ul", { className: "solid-module-package-inline-list", children: previewResponse.validation.errors.map(function (error) { return (_jsx("li", { children: error }, error)); }) })] })) : null, hasConflicts && !isUpdate ? (_jsxs("div", { className: "solid-module-package-notice is-warning", children: [_jsx("div", { className: "solid-module-package-notice__title", children: "Existing files detected" }), _jsx("ul", { className: "solid-module-package-inline-list", children: previewResponse.conflicts.map(function (conflict) { return (_jsx("li", { children: conflict }, conflict)); }) }), _jsx(SolidCheckbox, { checked: overwriteExisting, onChange: function (event) { return setOverwriteExisting(event.currentTarget.checked); }, label: "Overwrite the existing module folders during import" })] })) : null] }), isUpdate ? (_jsx("div", { children: _jsx(SolidButton, { type: "button", size: "small", variant: "ghost", onClick: function () { return setShowAllFiles(function (current) { return !current; }); }, children: showAllFiles ? "Hide package files" : "Show all package files (".concat((_y = (_x = (_w = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _w === void 0 ? void 0 : _w.fileTree) === null || _x === void 0 ? void 0 : _x.length) !== null && _y !== void 0 ? _y : 0, ")") }) })) : null, !isUpdate || showAllFiles ? (_jsx("div", { className: "solid-module-package-tree", children: ((_0 = (_z = previewResponse === null || previewResponse === void 0 ? void 0 : previewResponse.preview) === null || _z === void 0 ? void 0 : _z.fileTree) !== null && _0 !== void 0 ? _0 : []).map(function (entry) { return (_jsx("div", { className: "solid-module-package-tree__row", children: entry }, entry)); }) })) : null] }))] }));
|
|
585
724
|
};
|
|
586
725
|
var renderActiveStepCta = function () {
|
|
587
726
|
if (activeStep === "preview") {
|
|
588
|
-
return (_jsx(SolidButton, { type: "button", size: "small", onClick: function () { return setSelectedStep("import"); }, disabled: !canContinueFromPreview, rightIcon: _jsx(Sparkles, { size: 14 }), children: "Continue to import" }));
|
|
727
|
+
return (_jsx(SolidButton, { type: "button", size: "small", onClick: function () { return setSelectedStep("import"); }, disabled: !canContinueFromPreview || !isUpdateApproved, rightIcon: _jsx(Sparkles, { size: 14 }), children: isUpdate ? "Continue to update" : "Continue to import" }));
|
|
728
|
+
}
|
|
729
|
+
var restoreButton = backup && !isRestoreConfirmOpen ? (_jsxs(SolidButton, { type: "button", size: "small", variant: "ghost", onClick: function () { return setRestoreConfirmOpen(true); }, disabled: !canRestore, leftIcon: _jsx(RotateCcw, { size: 14 }), children: ["Restore ", formatVersionLabel(backup.version)] })) : null;
|
|
730
|
+
if (activeStep === "import" && isRestoreInterrupted) {
|
|
731
|
+
return restoreButton;
|
|
589
732
|
}
|
|
590
733
|
if (activeStep === "import") {
|
|
591
|
-
return (_jsx(SolidButton, { type: "button", size: "small", onClick: handleStartImport, disabled: !canImport, loading: isProcessing && steps.import.status === "running", leftIcon: _jsx(Sparkles, { size: 14 }), children: "Import Module" }));
|
|
734
|
+
return (_jsx(SolidButton, { type: "button", size: "small", onClick: handleStartImport, disabled: !canImport, loading: isProcessing && steps.import.status === "running", leftIcon: _jsx(Sparkles, { size: 14 }), children: isUpdate ? "Update to ".concat(formatVersionLabel(incomingVersion)) : "Import Module" }));
|
|
592
735
|
}
|
|
593
736
|
if (activeStep === "build") {
|
|
594
|
-
return (_jsx(SolidButton, { type: "button", size: "small", variant: "outline", onClick: handleRunBuild, disabled: !canRunBuild, loading: isProcessing && steps.build.status === "running", children: steps.build.status === "success" || steps.build.status === "warning" ? "Build Again" : "Build Now" }));
|
|
737
|
+
return (_jsxs(_Fragment, { children: [restoreButton, _jsx(SolidButton, { type: "button", size: "small", variant: "outline", onClick: handleRunBuild, disabled: !canRunBuild, loading: isProcessing && steps.build.status === "running", children: steps.build.status === "success" || steps.build.status === "warning" ? "Build Again" : "Build Now" })] }));
|
|
595
738
|
}
|
|
596
739
|
if (activeStep === "seed") {
|
|
597
|
-
return (_jsx(SolidButton, { type: "button", size: "small", variant: "outline", onClick: handleRunSeed, disabled: !canRunSeed, loading: isProcessing && steps.seed.status === "running", children: steps.seed.status === "success" || steps.seed.status === "warning" ? "Seed Again" : "Seed" }));
|
|
740
|
+
return (_jsxs(_Fragment, { children: [restoreButton, _jsx(SolidButton, { type: "button", size: "small", variant: "outline", onClick: handleRunSeed, disabled: !canRunSeed, loading: isProcessing && steps.seed.status === "running", children: steps.seed.status === "success" || steps.seed.status === "warning" ? "Seed Again" : "Seed" })] }));
|
|
598
741
|
}
|
|
599
742
|
return null;
|
|
600
743
|
};
|
|
@@ -602,18 +745,23 @@ export function ModulePackageImportContent(_a) {
|
|
|
602
745
|
if (activeStep === "preview") {
|
|
603
746
|
return renderPreviewContent();
|
|
604
747
|
}
|
|
748
|
+
var restoreConfirm = isRestoreConfirmOpen && backup ? (_jsxs("div", { className: "solid-module-package-notice is-danger", children: [_jsxs("div", { className: "solid-module-package-notice__title", children: ["Restore ", formatVersionLabel(backup.version), "?"] }), _jsxs("ul", { className: "solid-module-package-inline-list", children: [_jsxs("li", { children: ["This puts back the ", packageModuleName, " folders from before this update (", formatVersionLabel(backup.version), ")."] }), _jsx("li", { children: "When the API restarts, the database schema is synced to that code: columns added by the newer version are dropped along with their data, and tables it added are left in place." }), _jsx("li", { children: "Back up the database first if this module has data you care about." }), _jsx("li", { children: "After the restart, refresh this page and run build and seed again. Prune is turned on for that seed." })] }), _jsxs("div", { className: "solid-module-package-notice__actions", children: [_jsx(SolidButton, { type: "button", size: "small", variant: "ghost", onClick: function () { return setRestoreConfirmOpen(false); }, disabled: isProcessing, children: "Cancel" }), _jsxs(SolidButton, { type: "button", size: "small", variant: "destructive", onClick: handleRestore, disabled: !canRestore, loading: isProcessing, leftIcon: _jsx(RotateCcw, { size: 14 }), children: ["Restore ", formatVersionLabel(backup.version)] })] })] })) : null;
|
|
605
749
|
if (activeStep === "import") {
|
|
606
|
-
return (_jsxs("div", { className: "solid-module-package-step-stack", children: [_jsxs("div", { className: "solid-module-package-notice is-warning", children: [_jsx("div", { className: "solid-module-package-notice__title", children: "What happens after import" }), _jsxs("ul", { className: "solid-module-package-inline-list", children: [_jsx("li", { children: "Depending on the files in this archive, both the UI and API services may restart immediately." }), _jsx("li", { children: "This popup may get dismissed as part of that restart." }), _jsx("li", { children: "Wait for both services to come back, then refresh this module list page to continue with build and seed." })] })] }), steps.import.output ? _jsx("pre", { className: "solid-module-package-step__output", children: steps.import.output }) : null] }));
|
|
750
|
+
return (_jsxs("div", { className: "solid-module-package-step-stack", children: [_jsxs("div", { className: "solid-module-package-notice is-warning", children: [_jsx("div", { className: "solid-module-package-notice__title", children: isUpdate ? "What happens during the update" : "What happens after import" }), _jsxs("ul", { className: "solid-module-package-inline-list", children: [isUpdate ? (_jsxs(_Fragment, { children: [_jsxs("li", { children: ["The current ", packageModuleName, " folders in solid-api and solid-ui are backed up, then replaced with ", formatVersionLabel(incomingVersion), ". Files the new version no longer has are removed."] }), _jsx("li", { children: "Local changes made inside these folders are kept only in the backup." })] })) : null, _jsx("li", { children: "Depending on the files in this archive, both the UI and API services may restart immediately." }), _jsx("li", { children: "This popup may get dismissed as part of that restart." }), _jsx("li", { children: "Wait for both services to come back, then refresh this module list page to continue with build and seed." })] })] }), restoreConfirm, steps.import.output ? _jsx("pre", { className: "solid-module-package-step__output", children: steps.import.output }) : null] }));
|
|
607
751
|
}
|
|
608
|
-
if (activeStep === "build"
|
|
609
|
-
|
|
752
|
+
if (activeStep === "build") {
|
|
753
|
+
if (!restoreConfirm && !steps.build.output)
|
|
754
|
+
return null;
|
|
755
|
+
return (_jsxs("div", { className: "solid-module-package-step-stack", children: [restoreConfirm, steps.build.output ? _jsx("pre", { className: "solid-module-package-step__output", children: steps.build.output }) : null] }));
|
|
610
756
|
}
|
|
611
|
-
if (activeStep === "seed"
|
|
612
|
-
return _jsx("pre", { className: "solid-module-package-step__output", children: steps.seed.output });
|
|
757
|
+
if (activeStep === "seed") {
|
|
758
|
+
return (_jsxs("div", { className: "solid-module-package-step-stack", children: [restoreConfirm, isUpdate ? (_jsx(SolidCheckbox, { checked: pruneOnSeed, onChange: function (event) { return setPruneOnSeed(event.currentTarget.checked); }, disabled: isProcessing, label: "Remove metadata this module no longer defines (prune). This also removes permissions for endpoints that no longer exist." })) : null, steps.seed.output ? _jsx("pre", { className: "solid-module-package-step__output", children: steps.seed.output }) : null] }));
|
|
613
759
|
}
|
|
614
760
|
return null;
|
|
615
761
|
};
|
|
616
|
-
return (_jsxs(_Fragment, { children: [_jsxs(SolidDialogHeader, { className: "solid-filter-dialog-head solid-module-package-dialog__header", children: [_jsxs("div", { children: [_jsx(SolidDialogTitle, { className: "solid-filter-dialog-title m-0", children:
|
|
762
|
+
return (_jsxs(_Fragment, { children: [_jsxs(SolidDialogHeader, { className: "solid-filter-dialog-head solid-module-package-dialog__header", children: [_jsxs("div", { children: [_jsx(SolidDialogTitle, { className: "solid-filter-dialog-title m-0", children: isUpdate ? "Update ".concat(targetModuleName || packageModuleName) : "Import Module Package" }), _jsx(SolidDialogDescription, { className: "solid-filter-dialog-subtitle m-0", children: isUpdate
|
|
763
|
+
? "Upload a `.sldx` archive of the new version, review the version change and the files that will change, then move through update, build, and seed."
|
|
764
|
+
: "Upload a `.sldx` archive, let SolidX preview it automatically, then move through import, build, and seed." })] }), !isProcessing ? (_jsx("button", { type: "button", className: "solid-filter-dialog-close solid-radix-dialog-close", "aria-label": "Close", onClick: handleClose, children: _jsx(X, { size: 16 }) })) : null] }), _jsx(SolidDialogSeparator, { className: "solid-filter-dialog-sep" }), _jsx(SolidDialogBody, { className: "solid-filter-dialog-body solid-module-package-dialog__body", children: _jsx("section", { className: "solid-module-package-shell", children: _jsxs("div", { className: "solid-module-package-panel solid-module-package-panel--wizard", children: [_jsx("div", { className: "solid-module-package-stepper", children: STEP_ORDER.map(function (stepKey, index) {
|
|
617
765
|
var step = steps[stepKey];
|
|
618
766
|
var isCurrent = activeStep === stepKey;
|
|
619
767
|
var isDone = step.status === "success";
|