@rebasepro/admin 0.9.1-canary.fd3754b → 0.9.1-canary.ff338b5
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-DKGlYDPc.js → CollectionEditorDialog-DbPpDDwb.js} +29 -7
- package/dist/{CollectionEditorDialog-DKGlYDPc.js.map → CollectionEditorDialog-DbPpDDwb.js.map} +1 -1
- package/dist/{PropertyEditView-h0N-AMCY.js → PropertyEditView-DfJbZ67t.js} +2 -2
- package/dist/{PropertyEditView-h0N-AMCY.js.map → PropertyEditView-DfJbZ67t.js.map} +1 -1
- package/dist/{RouterCollectionsStudioView-DdEStpFk.js → RouterCollectionsStudioView-C6XQ7Il5.js} +4 -4
- package/dist/{RouterCollectionsStudioView-DdEStpFk.js.map → RouterCollectionsStudioView-C6XQ7Il5.js.map} +1 -1
- package/dist/collection_editor_ui.js +4 -4
- package/dist/{history-C0FdqGNz.js → history-GSa4BgDt.js} +4 -4
- package/dist/history-GSa4BgDt.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/{src-DLAFyeZI.js → src-B8WuGSPZ.js} +15 -11
- package/dist/src-B8WuGSPZ.js.map +1 -0
- package/package.json +12 -17
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +35 -4
- package/src/components/CollectionViewBinding/FiltersDialog.tsx +18 -0
- package/src/components/CollectionViewBinding/useBoardDataController.tsx +9 -3
- package/src/components/RebaseNavigation.tsx +16 -1
- package/src/components/field_configs.tsx +1 -1
- package/src/components/history/EntityHistoryView.tsx +2 -2
- package/src/hooks/useResolvedNavigationFrom.tsx +4 -2
- package/dist/history-C0FdqGNz.js.map +0 -1
- package/dist/src-DLAFyeZI.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { At as useImportConfig, Bn as useUrlController, Bt as getFieldId, Ct as useCollectionEditorController, Et as convertDataToEntity, Ft as PropertyConfigBadge, Hn as useNavigationStateController, Mt as ImportFileUpload, Qn as CollectionTableBinding, Tt as DataNewPropertiesMapping, Wn as useCollectionRegistryController, Xn as useSelectionController, dn as SearchIconsView, fn as FieldCaption, h as toSerializableCollectionConfig, i as namespaceToPropertiesOrderPath, jt as ImportSaveInProgress, kt as getInferenceType, n as getFullIdPath, r as idToPropertiesPath, s as CollectionGenerationApiError, t as getFullId, u as validateCollectionJson, v as useCollectionsConfigController, wt as ImportNewPropertyFieldPreview, zt as getFieldConfig } from "./src-
|
|
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 { At as useImportConfig, Bn as useUrlController, Bt as getFieldId, Ct as useCollectionEditorController, Et as convertDataToEntity, Ft as PropertyConfigBadge, Hn as useNavigationStateController, Mt as ImportFileUpload, Qn as CollectionTableBinding, Tt as DataNewPropertiesMapping, Wn as useCollectionRegistryController, Xn as useSelectionController, dn as SearchIconsView, fn as FieldCaption, h as toSerializableCollectionConfig, i as namespaceToPropertiesOrderPath, jt as ImportSaveInProgress, kt as getInferenceType, n as getFullIdPath, r as idToPropertiesPath, s as CollectionGenerationApiError, t as getFullId, u as validateCollectionJson, v as useCollectionsConfigController, wt as ImportNewPropertyFieldPreview, zt as getFieldConfig } from "./src-B8WuGSPZ.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-DfJbZ67t.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";
|
|
7
|
-
import { getSubcollections, getTableName, isPropertyBuilder, removeInitialAndTrailingSlashes } from "@rebasepro/common";
|
|
7
|
+
import { getEffectiveSecurityRules, getSubcollections, getTableName, isPropertyBuilder, removeInitialAndTrailingSlashes } from "@rebasepro/common";
|
|
8
8
|
import { AIIcon, ConfirmationDialog, ErrorView, IconForView, UnsavedChangesDialog, useAuthController, useCustomizationController, useLargeLayout, useRebaseContext, useUnsavedChangesDialog } from "@rebasepro/app";
|
|
9
9
|
import { Field, Formex, clone, getIn, useCreateFormex, useFormex } from "@rebasepro/forms";
|
|
10
10
|
import { z } from "zod";
|
|
11
|
-
import { camelCase, isEmptyObject, mergeDeep, prettifyIdentifier, randomString, removeUndefined, singular, slugify, toSnakeCase, unslugify } from "@rebasepro/utils";
|
|
11
|
+
import { camelCase, getPolicyNamesForRule, getPolicyNamesForRules, isEmptyObject, mergeDeep, prettifyIdentifier, randomString, removeUndefined, singular, slugify, toSnakeCase, unslugify } from "@rebasepro/utils";
|
|
12
12
|
import { getDataSourceCapabilities } from "@rebasepro/types";
|
|
13
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { Highlight, themes } from "prism-react-renderer";
|
|
@@ -2381,7 +2381,29 @@ function CollectionRLSTab() {
|
|
|
2381
2381
|
values.table,
|
|
2382
2382
|
values.alias
|
|
2383
2383
|
]);
|
|
2384
|
-
const
|
|
2384
|
+
const tableName = values.id || values.table || values.alias;
|
|
2385
|
+
/**
|
|
2386
|
+
* Every policy name `rebase db push` would write for this collection.
|
|
2387
|
+
*
|
|
2388
|
+
* Two things make this more than `rules.map(r => r.name)`:
|
|
2389
|
+
* - a rule without an explicit `name` becomes `<table>_<op>_<hash>`, so
|
|
2390
|
+
* comparing `rule.name` to `policyname` never matches for it;
|
|
2391
|
+
* - the generator also injects the safe-by-default baseline
|
|
2392
|
+
* (`<table>_default_admin_*`), which is in no collection's `securityRules`.
|
|
2393
|
+
*
|
|
2394
|
+
* Missing either made Rebase's own policies look hand-written, and offered to
|
|
2395
|
+
* import them back into the codebase that produced them.
|
|
2396
|
+
*/
|
|
2397
|
+
const generatedPolicyNames = useMemo(() => {
|
|
2398
|
+
if (!tableName) return /* @__PURE__ */ new Set();
|
|
2399
|
+
const effectiveRules = getEffectiveSecurityRules(values);
|
|
2400
|
+
return getPolicyNamesForRules([...rules, ...effectiveRules], tableName);
|
|
2401
|
+
}, [
|
|
2402
|
+
rules,
|
|
2403
|
+
tableName,
|
|
2404
|
+
values
|
|
2405
|
+
]);
|
|
2406
|
+
const unmappedPolicies = dbPolicies.filter((dp) => !generatedPolicyNames.has(dp.policyname));
|
|
2385
2407
|
const handleSave = async (newPolicy) => {
|
|
2386
2408
|
const rule = {
|
|
2387
2409
|
name: newPolicy.policyname ?? "",
|
|
@@ -2437,7 +2459,7 @@ function CollectionRLSTab() {
|
|
|
2437
2459
|
}), /* @__PURE__ */ jsx(Typography, {
|
|
2438
2460
|
variant: "subtitle2",
|
|
2439
2461
|
className: "truncate",
|
|
2440
|
-
children: rule.name
|
|
2462
|
+
children: rule.name || (tableName ? getPolicyNamesForRule(rule, tableName).join(", ") : "Unnamed policy")
|
|
2441
2463
|
})]
|
|
2442
2464
|
}), /* @__PURE__ */ jsxs("div", {
|
|
2443
2465
|
className: "flex gap-2 text-xs pl-6 overflow-x-auto hide-scrollbar",
|
|
@@ -3627,4 +3649,4 @@ var validateId = (value, isNewCollection, existingPaths, existingIds) => {
|
|
|
3627
3649
|
//#endregion
|
|
3628
3650
|
export { CollectionEditorDialog as n, CollectionEditorDialog_exports as r, CollectionEditor as t };
|
|
3629
3651
|
|
|
3630
|
-
//# sourceMappingURL=CollectionEditorDialog-
|
|
3652
|
+
//# sourceMappingURL=CollectionEditorDialog-DbPpDDwb.js.map
|