@everystack/admin 0.2.5 → 0.2.6

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everystack/admin",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Declarative admin dashboard framework for PostgREST APIs",
5
5
  "license": "AGPL-3.0-only",
6
6
  "publishConfig": {
@@ -47,9 +47,15 @@
47
47
  "react-native": "0.83.6"
48
48
  },
49
49
  "peerDependenciesMeta": {
50
- "@tiptap/pm": { "optional": true },
51
- "@tiptap/react": { "optional": true },
52
- "@tiptap/starter-kit": { "optional": true }
50
+ "@tiptap/pm": {
51
+ "optional": true
52
+ },
53
+ "@tiptap/react": {
54
+ "optional": true
55
+ },
56
+ "@tiptap/starter-kit": {
57
+ "optional": true
58
+ }
53
59
  },
54
60
  "devDependencies": {
55
61
  "@everystack/api": "workspace:*",
@@ -138,7 +138,10 @@ export function ResourceList({ resource, onRowPress, onEditPress, onCreatePress,
138
138
  columns={columns}
139
139
  data={data}
140
140
  onSort={handleSort}
141
- onRowPress={onRowPress}
141
+ // A list-only resource (actions.show === false) has no detail screen —
142
+ // don't make rows navigate to a fetchOne that 404s. The row-action menu
143
+ // already hides "Show" via standardRowActions; this gates the whole-row tap.
144
+ onRowPress={resourceConfig?.actions?.show === false ? undefined : onRowPress}
142
145
  />
143
146
  )}
144
147
 
@@ -149,7 +149,9 @@ async function fetchDetail(
149
149
  id: string | number,
150
150
  resourceConfig: ResourceConfig | undefined,
151
151
  ): Promise<DataRecord> {
152
- if (resourceConfig?.dashboard?.detailVia === 'rpc') {
152
+ // detailVia may sit on the resource directly (a plain list with no dashboard,
153
+ // e.g. the audit log) or inside its dashboard (the observability screens).
154
+ if (resourceConfig?.detailVia === 'rpc' || resourceConfig?.dashboard?.detailVia === 'rpc') {
153
155
  if (!adapter.rpc) {
154
156
  throw new Error(`Resource "${resource}" uses detailVia: 'rpc' but the adapter has no rpc()`);
155
157
  }
package/src/types.ts CHANGED
@@ -224,6 +224,11 @@ export interface ResourceConfig {
224
224
  editFields?: string[];
225
225
  /** Primary key field name */
226
226
  primaryKey?: string;
227
+ /** How the show view fetches one record. 'rpc' calls the role-gated
228
+ * {camelResource}EventDetail RPC (the resource stays off the REST surface);
229
+ * 'rest' (default) uses adapter.fetchOne. Lets a plain list (no dashboard) —
230
+ * e.g. the audit log — serve a detail view without a dashboard header. */
231
+ detailVia?: 'rpc' | 'rest';
227
232
  /** Optional observability-style dashboard configuration */
228
233
  dashboard?: ResourceDashboardConfig;
229
234
  /** RPC-backed record actions shown on the show view */