@asteby/metacore-runtime-react 28.3.6 → 28.3.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @asteby/metacore-runtime-react
2
2
 
3
+ ## 28.3.7
4
+
5
+ ### Patch Changes
6
+
7
+ - ba40a57: Las columnas de auditoría resueltas como relación (created_by servido como
8
+ `created_by.avatar`) ahora también se ocultan en las sub-tablas del modal: el
9
+ filtro matchea la clave base y sus proyecciones `<key>.<subcampo>`, no solo el
10
+ match exacto.
11
+
3
12
  ## 28.3.6
4
13
 
5
14
  ### Patch Changes
@@ -25,20 +25,6 @@ export declare function isColumnVisibleInModal(col: ColumnDefinition): boolean;
25
25
  * in that context — see {@link isColumnVisibleInLineSubtable}.
26
26
  */
27
27
  export declare const AUDIT_SUBTABLE_COLUMN_KEYS: readonly string[];
28
- /**
29
- * Column visibility decision for a sub-table of lines/relations rendered inside
30
- * the view modal of a parent record. Two rules on top of the modal criterion:
31
- *
32
- * 1. Respect `visibility`: a column scoped to `'table'`/`'list'` never shows
33
- * here (reuses {@link isColumnVisibleInModal}), so a manifest hides a
34
- * redundant column from the sub-table with `visibility: "table"`.
35
- * 2. Audit columns ({@link AUDIT_SUBTABLE_COLUMN_KEYS}) are hidden BY DEFAULT
36
- * — unless the manifest explicitly opts them back in by declaring a
37
- * `visibility` (`'all'`/`'modal'`) on that column.
38
- *
39
- * Only applies to the embedded child-list context; the main `/m/<model>` table
40
- * uses {@link isColumnVisibleInTable} and is unaffected.
41
- */
42
28
  export declare function isColumnVisibleInLineSubtable(col: ColumnDefinition): boolean;
43
29
  /**
44
30
  * Returns the keys of columns that opt into the model's full-text search,
@@ -1 +1 @@
1
- {"version":3,"file":"column-visibility.d.ts","sourceRoot":"","sources":["../src/column-visibility.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE9D;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAKrE;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAKrE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,EAAE,SAAS,MAAM,EAOvD,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAI5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACnC,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,GACzC,MAAM,EAAE,GAAG,IAAI,CAKjB"}
1
+ {"version":3,"file":"column-visibility.d.ts","sourceRoot":"","sources":["../src/column-visibility.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE9D;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAKrE;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAKrE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,EAAE,SAAS,MAAM,EAOvD,CAAA;AA6BD,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAI5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACnC,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,GACzC,MAAM,EAAE,GAAG,IAAI,CAKjB"}
@@ -66,10 +66,20 @@ export const AUDIT_SUBTABLE_COLUMN_KEYS = [
66
66
  * Only applies to the embedded child-list context; the main `/m/<model>` table
67
67
  * uses {@link isColumnVisibleInTable} and is unaffected.
68
68
  */
69
+ /**
70
+ * True when a column key is (or belongs to) an audit column. Matches the plain
71
+ * key AND its resolved-relation projections: a `created_by` user relation is
72
+ * served as `created_by.avatar` / `created_by.name` (avatar+name+email cell),
73
+ * so an exact-match check missed it and the column still showed. We match the
74
+ * base key or any `<key>.<subfield>` projection.
75
+ */
76
+ function isAuditColumnKey(key) {
77
+ return AUDIT_SUBTABLE_COLUMN_KEYS.some((k) => key === k || key.startsWith(k + '.'));
78
+ }
69
79
  export function isColumnVisibleInLineSubtable(col) {
70
80
  if (!isColumnVisibleInModal(col))
71
81
  return false;
72
- if (!col.visibility && AUDIT_SUBTABLE_COLUMN_KEYS.includes(col.key))
82
+ if (!col.visibility && isAuditColumnKey(col.key))
73
83
  return false;
74
84
  return true;
75
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asteby/metacore-runtime-react",
3
- "version": "28.3.6",
3
+ "version": "28.3.7",
4
4
  "description": "React runtime for metacore hosts — renders addon contributions dynamically",
5
5
  "repository": {
6
6
  "type": "git",
@@ -68,9 +68,22 @@ export const AUDIT_SUBTABLE_COLUMN_KEYS: readonly string[] = [
68
68
  * Only applies to the embedded child-list context; the main `/m/<model>` table
69
69
  * uses {@link isColumnVisibleInTable} and is unaffected.
70
70
  */
71
+ /**
72
+ * True when a column key is (or belongs to) an audit column. Matches the plain
73
+ * key AND its resolved-relation projections: a `created_by` user relation is
74
+ * served as `created_by.avatar` / `created_by.name` (avatar+name+email cell),
75
+ * so an exact-match check missed it and the column still showed. We match the
76
+ * base key or any `<key>.<subfield>` projection.
77
+ */
78
+ function isAuditColumnKey(key: string): boolean {
79
+ return AUDIT_SUBTABLE_COLUMN_KEYS.some(
80
+ (k) => key === k || key.startsWith(k + '.'),
81
+ )
82
+ }
83
+
71
84
  export function isColumnVisibleInLineSubtable(col: ColumnDefinition): boolean {
72
85
  if (!isColumnVisibleInModal(col)) return false
73
- if (!col.visibility && AUDIT_SUBTABLE_COLUMN_KEYS.includes(col.key)) return false
86
+ if (!col.visibility && isAuditColumnKey(col.key)) return false
74
87
  return true
75
88
  }
76
89