@rebasepro/admin 0.12.0 → 0.12.1-canary.gdfba2a1
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/{CollectionEditorDialog-Dpc75wIZ.js → CollectionEditorDialog-B8j6HArJ.js} +19 -11
- package/dist/{CollectionEditorDialog-Dpc75wIZ.js.map → CollectionEditorDialog-B8j6HArJ.js.map} +1 -1
- package/dist/{PropertyEditView-DH3XZC2x.js → PropertyEditView-D2b9_nbC.js} +12 -9
- package/dist/{PropertyEditView-DH3XZC2x.js.map → PropertyEditView-D2b9_nbC.js.map} +1 -1
- package/dist/{RouterCollectionsStudioView-BZLq4MGp.js → RouterCollectionsStudioView-CXUtYIc1.js} +4 -4
- package/dist/{RouterCollectionsStudioView-BZLq4MGp.js.map → RouterCollectionsStudioView-CXUtYIc1.js.map} +1 -1
- package/dist/collection_editor_ui.js +4 -4
- package/dist/editor.js +18 -10
- package/dist/editor.js.map +1 -1
- package/dist/{export-BzIpUdSK.js → export-CrDJOGKn.js} +2 -2
- package/dist/{export-BzIpUdSK.js.map → export-CrDJOGKn.js.map} +1 -1
- package/dist/{history-g9688IaK.js → history-s6Nzt7RF.js} +2 -2
- package/dist/{history-g9688IaK.js.map → history-s6Nzt7RF.js.map} +1 -1
- package/dist/{import-BjUG-cIY.js → import-Ci32nU0G.js} +2 -2
- package/dist/{import-BjUG-cIY.js.map → import-Ci32nU0G.js.map} +1 -1
- package/dist/index.js +17 -12
- package/dist/index.js.map +1 -1
- package/dist/markdown-CklalUUk.js.map +1 -1
- package/dist/{util-B5fJm1FA.js → util-BwZuV81o.js} +87 -50
- package/dist/{util-B5fJm1FA.js.map → util-BwZuV81o.js.map} +1 -1
- package/package.json +24 -24
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { $t as CollectionTableBinding, A as getFieldId, Ct as convertDataToEntity, Dt as useImportConfig, Et as getInferenceType, Ft as FieldCaption, In as useCollectionRegistryController, Nt as PropertyConfigBadge, Ot as ImportSaveInProgress, Pt as SearchIconsView, St as DataNewPropertiesMapping, Zt as useSelectionController, _ as useCollectionsConfigController, i as namespaceToPropertiesOrderPath, in as useUrlController, k as getFieldConfig, kt as ImportFileUpload, l as validateCollectionJson, m as toSerializableCollectionConfig, n as getFullIdPath, o as CollectionGenerationApiError, on as useNavigationStateController, r as idToPropertiesPath, t as getFullId, vt as useCollectionEditorController, xt as ImportNewPropertyFieldPreview } from "./util-
|
|
3
|
-
import { a as updatePropertyFromWidget, c as useAIModifiedPaths, i as supportedFields, l as useSafeSnackbarController, n as PropertyForm, o as PropertyTree, r as PropertyFormDialog, s as AIModifiedPathsProvider } from "./PropertyEditView-
|
|
2
|
+
import { $t as CollectionTableBinding, A as getFieldId, Ct as convertDataToEntity, Dt as useImportConfig, Et as getInferenceType, Ft as FieldCaption, In as useCollectionRegistryController, Nt as PropertyConfigBadge, Ot as ImportSaveInProgress, Pt as SearchIconsView, St as DataNewPropertiesMapping, Zt as useSelectionController, _ as useCollectionsConfigController, i as namespaceToPropertiesOrderPath, in as useUrlController, k as getFieldConfig, kt as ImportFileUpload, l as validateCollectionJson, m as toSerializableCollectionConfig, n as getFullIdPath, o as CollectionGenerationApiError, on as useNavigationStateController, r as idToPropertiesPath, t as getFullId, vt as useCollectionEditorController, xt as ImportNewPropertyFieldPreview } from "./util-BwZuV81o.js";
|
|
3
|
+
import { a as updatePropertyFromWidget, c as useAIModifiedPaths, i as supportedFields, l as useSafeSnackbarController, n as PropertyForm, o as PropertyTree, r as PropertyFormDialog, s as AIModifiedPathsProvider } from "./PropertyEditView-D2b9_nbC.js";
|
|
4
4
|
import * as React$1 from "react";
|
|
5
5
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { Alert, AppWindow, ArrowLeftIcon, BooleanSwitchWithLabel, Button, Card, CheckIcon, Chip, CircularProgress, CircularProgressCenter, CodeIcon, ColumnsIcon, Container, CopyIcon, DebouncedTextField, Dialog, DialogActions, DialogContent, DialogTitle, ErrorBoundary, FileIcon, FileSearchIcon, FileTextIcon, IconButton, KanbanIcon, KeyIcon, LayoutGridIcon, ListIcon, LoadingButton, Menu, MultiSelect, MultiSelectItem, PanelLeftIcon, Paper, PlusIcon, Select, SelectItem, ShoppingCartIcon, SquareIcon, Tab, TableIcon, Tabs, TextField, ToggleButtonGroup, Tooltip, Trash2Icon, Typography, UserIcon, XIcon, cls, coolIconKeys, defaultBorderMixin, iconSize } from "@rebasepro/ui";
|
|
@@ -875,7 +875,8 @@ function CollectionPropertiesEditorForm({ showErrors, isNewCollection, propertyE
|
|
|
875
875
|
return currentPropertiesOrderRef.current[namespace] ?? getIn(values, namespaceToPropertiesOrderPath(namespace));
|
|
876
876
|
};
|
|
877
877
|
const updatePropertiesOrder = (newPropertiesOrder, namespace) => {
|
|
878
|
-
|
|
878
|
+
const propertiesOrderPath = namespaceToPropertiesOrderPath(namespace);
|
|
879
|
+
setFieldValue(propertiesOrderPath, newPropertiesOrder, false);
|
|
879
880
|
currentPropertiesOrderRef.current[namespace ?? ""] = newPropertiesOrder;
|
|
880
881
|
};
|
|
881
882
|
const deleteProperty = (propertyKey, namespace) => {
|
|
@@ -884,7 +885,10 @@ function CollectionPropertiesEditorForm({ showErrors, isNewCollection, propertyE
|
|
|
884
885
|
if (!fullId) throw Error("collection editor miss config");
|
|
885
886
|
setFieldValue(idToPropertiesPath(fullId), void 0, false);
|
|
886
887
|
const currentPropertiesOrder = getCurrentPropertiesOrder(namespace);
|
|
887
|
-
if (currentPropertiesOrder)
|
|
888
|
+
if (currentPropertiesOrder) {
|
|
889
|
+
const newPropertiesOrder = currentPropertiesOrder.filter((p) => p !== propertyKey);
|
|
890
|
+
updatePropertiesOrder(newPropertiesOrder, namespace);
|
|
891
|
+
}
|
|
888
892
|
setNewPropertyDialogOpen(false);
|
|
889
893
|
setSelectedPropertyIndex(void 0);
|
|
890
894
|
setSelectedPropertyKey(void 0);
|
|
@@ -1177,7 +1181,8 @@ function CollectionJsonImportDialog({ open, onClose, onImport }) {
|
|
|
1177
1181
|
setErrors([]);
|
|
1178
1182
|
return;
|
|
1179
1183
|
}
|
|
1180
|
-
|
|
1184
|
+
const result = validateCollectionJson(value);
|
|
1185
|
+
setErrors(result.errors);
|
|
1181
1186
|
}, []);
|
|
1182
1187
|
const handleImport = useCallback(() => {
|
|
1183
1188
|
const result = validateCollectionJson(jsonValue);
|
|
@@ -2077,7 +2082,8 @@ function CollectionEditorImportMapping({ importConfig, propertyConfigs }) {
|
|
|
2077
2082
|
return currentPropertiesOrderRef.current[namespace] ?? getIn(values, namespaceToPropertiesOrderPath(namespace));
|
|
2078
2083
|
};
|
|
2079
2084
|
const updatePropertiesOrder = (newPropertiesOrder, namespace) => {
|
|
2080
|
-
|
|
2085
|
+
const propertiesOrderPath = namespaceToPropertiesOrderPath(namespace);
|
|
2086
|
+
setFieldValue(propertiesOrderPath, newPropertiesOrder, false);
|
|
2081
2087
|
currentPropertiesOrderRef.current[namespace ?? ""] = newPropertiesOrder;
|
|
2082
2088
|
};
|
|
2083
2089
|
if (previousId && previousId !== id) {
|
|
@@ -2400,7 +2406,7 @@ function CollectionRLSTab() {
|
|
|
2400
2406
|
if (Array.isArray(res)) return res;
|
|
2401
2407
|
return [];
|
|
2402
2408
|
};
|
|
2403
|
-
|
|
2409
|
+
const policies = extractRows(result).map((p) => {
|
|
2404
2410
|
let parsedRoles = [];
|
|
2405
2411
|
const r = p.roles || p.ROLES;
|
|
2406
2412
|
if (Array.isArray(r)) parsedRoles = r;
|
|
@@ -2414,7 +2420,8 @@ function CollectionRLSTab() {
|
|
|
2414
2420
|
qual: p.qual || p.QUAL || null,
|
|
2415
2421
|
with_check: p.with_check || p.WITH_CHECK || null
|
|
2416
2422
|
};
|
|
2417
|
-
})
|
|
2423
|
+
});
|
|
2424
|
+
setDbPolicies(policies);
|
|
2418
2425
|
} catch (e) {
|
|
2419
2426
|
console.error("Failed to fetch DB policies", e);
|
|
2420
2427
|
} finally {
|
|
@@ -2684,7 +2691,7 @@ function InlinePolicyEditor({ policy, table, availableRoles, rolesUnavailable, o
|
|
|
2684
2691
|
* from what users hold, so a role that is referenced here but assigned to
|
|
2685
2692
|
* nobody would otherwise vanish from its own policy on the next save.
|
|
2686
2693
|
*/
|
|
2687
|
-
const roleOptions = useMemo(() => Array.from(new Set([...availableRoles, ...roles])).sort(), [availableRoles, roles]);
|
|
2694
|
+
const roleOptions = useMemo(() => Array.from(/* @__PURE__ */ new Set([...availableRoles, ...roles])).sort(), [availableRoles, roles]);
|
|
2688
2695
|
const addCustomRole = () => {
|
|
2689
2696
|
const trimmed = customRole.trim();
|
|
2690
2697
|
if (!trimmed || roles.includes(trimmed)) {
|
|
@@ -3371,10 +3378,11 @@ function CollectionEditorInternal({ isNewCollection, configController, editedCol
|
|
|
3371
3378
|
showErrors: submitCount > 0,
|
|
3372
3379
|
isNewCollection,
|
|
3373
3380
|
onPropertyError: (propertyKey, namespace, error) => {
|
|
3374
|
-
|
|
3381
|
+
const current = removeUndefined({
|
|
3375
3382
|
...propertyErrorsRef.current,
|
|
3376
3383
|
[getFullIdPath(propertyKey, namespace)]: removeUndefined(error, true)
|
|
3377
3384
|
}, true);
|
|
3385
|
+
propertyErrorsRef.current = current;
|
|
3378
3386
|
formController.validate();
|
|
3379
3387
|
},
|
|
3380
3388
|
getUser,
|
|
@@ -3537,4 +3545,4 @@ var validateId = (value, isNewCollection, existingPaths, existingIds) => {
|
|
|
3537
3545
|
//#endregion
|
|
3538
3546
|
export { CollectionEditorDialog as n, CollectionEditorDialog_exports as r, CollectionEditor as t };
|
|
3539
3547
|
|
|
3540
|
-
//# sourceMappingURL=CollectionEditorDialog-
|
|
3548
|
+
//# sourceMappingURL=CollectionEditorDialog-B8j6HArJ.js.map
|