@postgres.ai/shared 4.0.0-pr-695 → 4.0.0-pr-695.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/package.json
CHANGED
|
@@ -119,13 +119,16 @@ export const CreateClone = observer((props) => {
|
|
|
119
119
|
((_d = stores.main.getSnapshotsError) === null || _d === void 0 ? void 0 : _d.message) ||
|
|
120
120
|
((_f = (_e = stores.main) === null || _e === void 0 ? void 0 : _e.snapshots) === null || _f === void 0 ? void 0 : _f.error) })] }));
|
|
121
121
|
const isCloneUnstable = Boolean(stores.main.clone && !stores.main.isCloneStable);
|
|
122
|
-
const isCreatingClone = formik.isSubmitting || isCloneUnstable;
|
|
122
|
+
const isCreatingClone = (formik.isSubmitting || isCloneUnstable) && !stores.main.cloneError;
|
|
123
123
|
return (_jsxs(_Fragment, { children: [headRendered, _jsxs("div", { className: styles.container, children: [_jsxs("div", { className: styles.form, children: [_jsxs("div", { className: styles.section, children: [branchesList && branchesList.length > 0 && (_jsx(Select, { fullWidth: true, label: "Branch", value: formik.values.branch, disabled: !branchesList || isCreatingClone, onChange: handleSelectBranch, error: Boolean(formik.errors.branch), items: (_g = branchesList === null || branchesList === void 0 ? void 0 : branchesList.map((snapshot) => {
|
|
124
124
|
return {
|
|
125
125
|
value: snapshot,
|
|
126
126
|
children: snapshot,
|
|
127
127
|
};
|
|
128
|
-
})) !== null && _g !== void 0 ? _g : [] })), _jsx(TextField, { fullWidth: true, label: "Clone ID", value: formik.values.cloneId, onChange: (e) =>
|
|
128
|
+
})) !== null && _g !== void 0 ? _g : [] })), _jsx(TextField, { fullWidth: true, label: "Clone ID", value: formik.values.cloneId, onChange: (e) => {
|
|
129
|
+
const sanitizedCloneIdValue = e.target.value.replace(/\s/g, '');
|
|
130
|
+
formik.setFieldValue('cloneId', sanitizedCloneIdValue);
|
|
131
|
+
}, error: Boolean(formik.errors.cloneId), disabled: isCreatingClone }), _jsx(Select, { fullWidth: true, label: "Snapshot *", value: formik.values.snapshotId, disabled: !snapshots || isCreatingClone, onChange: (e) => formik.setFieldValue('snapshotId', e.target.value), error: Boolean(formik.errors.snapshotId), items: (_h = snapshots.map((snapshot, i) => {
|
|
129
132
|
const isLatest = i === 0;
|
|
130
133
|
return {
|
|
131
134
|
value: snapshot.id,
|
|
@@ -543,5 +543,5 @@ export const Configuration = observer(({ instanceId, switchActiveTab, reload, is
|
|
|
543
543
|
formik.submitForm().then(() => {
|
|
544
544
|
scrollToField();
|
|
545
545
|
});
|
|
546
|
-
}, disabled: formik.isSubmitting || isConfigurationDisabled, children: ["Apply changes", formik.isSubmitting && (_jsx(Spinner, { size: "sm", className: styles.spinner }))] }), _jsx(Box, { sx: { px: 2 }, children: _jsx(Button, { variant: "outlined", color: "secondary", onClick:
|
|
546
|
+
}, disabled: formik.isSubmitting || isConfigurationDisabled, children: ["Apply changes", formik.isSubmitting && (_jsx(Spinner, { size: "sm", className: styles.spinner }))] }), _jsx(Box, { sx: { px: 2 }, children: _jsx(Button, { variant: "outlined", color: "secondary", onClick: switchTab, children: "Cancel" }) })] }), (submitState.status && submitState.response) || configError ? (_jsx(ResponseMessage, { type: configError ? 'error' : submitState.status, message: configError || submitState.response })) : null] })), _jsx(Modal, { title: _jsx(ModalTitle, {}), onClose: () => setIsModalOpen(false), isOpen: isModalOpen, size: "xl", children: _jsx(Editor, { height: "70vh", width: "100%", defaultLanguage: "yaml", value: getFullConfigError ? getFullConfigError : fullConfig, loading: _jsx(StubSpinner, {}), theme: "vs-light", options: { domReadOnly: true, readOnly: true } }) })] }));
|
|
547
547
|
});
|