@rebasepro/admin 0.12.1-canary.gdfba2a1 → 0.12.1-canary.gf5f1d39

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.
@@ -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-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";
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-B5fJm1FA.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-DH3XZC2x.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,8 +875,7 @@ function CollectionPropertiesEditorForm({ showErrors, isNewCollection, propertyE
875
875
  return currentPropertiesOrderRef.current[namespace] ?? getIn(values, namespaceToPropertiesOrderPath(namespace));
876
876
  };
877
877
  const updatePropertiesOrder = (newPropertiesOrder, namespace) => {
878
- const propertiesOrderPath = namespaceToPropertiesOrderPath(namespace);
879
- setFieldValue(propertiesOrderPath, newPropertiesOrder, false);
878
+ setFieldValue(namespaceToPropertiesOrderPath(namespace), newPropertiesOrder, false);
880
879
  currentPropertiesOrderRef.current[namespace ?? ""] = newPropertiesOrder;
881
880
  };
882
881
  const deleteProperty = (propertyKey, namespace) => {
@@ -885,10 +884,7 @@ function CollectionPropertiesEditorForm({ showErrors, isNewCollection, propertyE
885
884
  if (!fullId) throw Error("collection editor miss config");
886
885
  setFieldValue(idToPropertiesPath(fullId), void 0, false);
887
886
  const currentPropertiesOrder = getCurrentPropertiesOrder(namespace);
888
- if (currentPropertiesOrder) {
889
- const newPropertiesOrder = currentPropertiesOrder.filter((p) => p !== propertyKey);
890
- updatePropertiesOrder(newPropertiesOrder, namespace);
891
- }
887
+ if (currentPropertiesOrder) updatePropertiesOrder(currentPropertiesOrder.filter((p) => p !== propertyKey), namespace);
892
888
  setNewPropertyDialogOpen(false);
893
889
  setSelectedPropertyIndex(void 0);
894
890
  setSelectedPropertyKey(void 0);
@@ -1181,8 +1177,7 @@ function CollectionJsonImportDialog({ open, onClose, onImport }) {
1181
1177
  setErrors([]);
1182
1178
  return;
1183
1179
  }
1184
- const result = validateCollectionJson(value);
1185
- setErrors(result.errors);
1180
+ setErrors(validateCollectionJson(value).errors);
1186
1181
  }, []);
1187
1182
  const handleImport = useCallback(() => {
1188
1183
  const result = validateCollectionJson(jsonValue);
@@ -2082,8 +2077,7 @@ function CollectionEditorImportMapping({ importConfig, propertyConfigs }) {
2082
2077
  return currentPropertiesOrderRef.current[namespace] ?? getIn(values, namespaceToPropertiesOrderPath(namespace));
2083
2078
  };
2084
2079
  const updatePropertiesOrder = (newPropertiesOrder, namespace) => {
2085
- const propertiesOrderPath = namespaceToPropertiesOrderPath(namespace);
2086
- setFieldValue(propertiesOrderPath, newPropertiesOrder, false);
2080
+ setFieldValue(namespaceToPropertiesOrderPath(namespace), newPropertiesOrder, false);
2087
2081
  currentPropertiesOrderRef.current[namespace ?? ""] = newPropertiesOrder;
2088
2082
  };
2089
2083
  if (previousId && previousId !== id) {
@@ -2406,7 +2400,7 @@ function CollectionRLSTab() {
2406
2400
  if (Array.isArray(res)) return res;
2407
2401
  return [];
2408
2402
  };
2409
- const policies = extractRows(result).map((p) => {
2403
+ setDbPolicies(extractRows(result).map((p) => {
2410
2404
  let parsedRoles = [];
2411
2405
  const r = p.roles || p.ROLES;
2412
2406
  if (Array.isArray(r)) parsedRoles = r;
@@ -2420,8 +2414,7 @@ function CollectionRLSTab() {
2420
2414
  qual: p.qual || p.QUAL || null,
2421
2415
  with_check: p.with_check || p.WITH_CHECK || null
2422
2416
  };
2423
- });
2424
- setDbPolicies(policies);
2417
+ }));
2425
2418
  } catch (e) {
2426
2419
  console.error("Failed to fetch DB policies", e);
2427
2420
  } finally {
@@ -2691,7 +2684,7 @@ function InlinePolicyEditor({ policy, table, availableRoles, rolesUnavailable, o
2691
2684
  * from what users hold, so a role that is referenced here but assigned to
2692
2685
  * nobody would otherwise vanish from its own policy on the next save.
2693
2686
  */
2694
- const roleOptions = useMemo(() => Array.from(/* @__PURE__ */ new Set([...availableRoles, ...roles])).sort(), [availableRoles, roles]);
2687
+ const roleOptions = useMemo(() => Array.from(new Set([...availableRoles, ...roles])).sort(), [availableRoles, roles]);
2695
2688
  const addCustomRole = () => {
2696
2689
  const trimmed = customRole.trim();
2697
2690
  if (!trimmed || roles.includes(trimmed)) {
@@ -3378,11 +3371,10 @@ function CollectionEditorInternal({ isNewCollection, configController, editedCol
3378
3371
  showErrors: submitCount > 0,
3379
3372
  isNewCollection,
3380
3373
  onPropertyError: (propertyKey, namespace, error) => {
3381
- const current = removeUndefined({
3374
+ propertyErrorsRef.current = removeUndefined({
3382
3375
  ...propertyErrorsRef.current,
3383
3376
  [getFullIdPath(propertyKey, namespace)]: removeUndefined(error, true)
3384
3377
  }, true);
3385
- propertyErrorsRef.current = current;
3386
3378
  formController.validate();
3387
3379
  },
3388
3380
  getUser,
@@ -3545,4 +3537,4 @@ var validateId = (value, isNewCollection, existingPaths, existingIds) => {
3545
3537
  //#endregion
3546
3538
  export { CollectionEditorDialog as n, CollectionEditorDialog_exports as r, CollectionEditor as t };
3547
3539
 
3548
- //# sourceMappingURL=CollectionEditorDialog-B8j6HArJ.js.map
3540
+ //# sourceMappingURL=CollectionEditorDialog-Dpc75wIZ.js.map