@sap-ux/ui5-test-writer 1.2.3 → 1.2.4

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.
@@ -135,21 +135,22 @@ function extractObjectPageBodySectionsData(objectPage, convertedMetadata, schema
135
135
  const sectionId = getSectionIdentifier(section) ?? sectionKey;
136
136
  const subSections = extractBodySubSectionsData(section, sectionId);
137
137
  const navigationProperty = getNavigationPropertyFromKey(sectionKey);
138
+ const isTable = isTableSection(section);
138
139
  const sectionData = {
139
140
  id: sectionId,
140
141
  navigationProperty,
141
- isTable: !!section.isTable,
142
+ isTable,
142
143
  custom: !!section.custom,
143
144
  order: section?.order ?? -1,
144
- fields: section.custom || section.isTable ? [] : extractFormFields(section),
145
- tableColumns: section.custom || !section.isTable ? {} : extractTableColumnsFromNode(section),
145
+ fields: section.custom || isTable ? [] : extractFormFields(section),
146
+ tableColumns: section.custom || !isTable ? {} : extractTableColumnsFromNode(section),
146
147
  subSections,
147
148
  actions: !section.custom && convertedMetadata && schemaNamespace
148
149
  ? extractSectionActions(section, convertedMetadata, schemaNamespace)
149
150
  : []
150
151
  };
151
152
  // For table sections, resolve Create/Delete visibility from target entity set
152
- if (section.isTable && navigationProperty && metadata && convertedMetadata) {
153
+ if (isTable && navigationProperty && metadata && convertedMetadata) {
153
154
  const targetEntitySet = resolveNavigationTargetEntitySet(convertedMetadata, objectPage.entitySet, navigationProperty);
154
155
  if (targetEntitySet) {
155
156
  const buttonVisibility = safeCheckButtonVisibility(metadata, targetEntitySet, log);
@@ -192,7 +193,7 @@ function extractHeaderActions(objectPage, convertedMetadata, schemaNamespace) {
192
193
  */
193
194
  function extractSectionActions(section, convertedMetadata, schemaNamespace) {
194
195
  let actionsAgg;
195
- if (section.isTable) {
196
+ if (isTableSection(section)) {
196
197
  const tableAgg = getAggregations(section)['table'];
197
198
  const toolBarAgg = getAggregations(tableAgg)['toolBar'];
198
199
  actionsAgg = getAggregations(toolBarAgg)['actions'];
@@ -222,14 +223,15 @@ function extractBodySubSectionsData(section, parentSectionId) {
222
223
  const subSectionItems = getAggregations(subSectionsAggregation);
223
224
  Object.entries(subSectionItems).forEach(([subSectionKey, subSection]) => {
224
225
  const subSectionId = getSectionIdentifier(subSection) ?? `${parentSectionId}_${subSectionKey}`;
226
+ const isTable = isTableSection(subSection);
225
227
  subSections.push({
226
228
  id: subSectionId,
227
229
  navigationProperty: getNavigationPropertyFromKey(subSectionKey),
228
- isTable: !!subSection.isTable,
230
+ isTable,
229
231
  custom: !!subSection.custom,
230
232
  order: subSection?.order ?? -1, // put a negative order number to signal that order was not in spec
231
- fields: subSection.custom || subSection.isTable ? [] : extractFormFields(subSection),
232
- tableColumns: subSection.custom || !subSection.isTable ? {} : extractTableColumnsFromNode(subSection)
233
+ fields: subSection.custom || isTable ? [] : extractFormFields(subSection),
234
+ tableColumns: subSection.custom || !isTable ? {} : extractTableColumnsFromNode(subSection)
233
235
  });
234
236
  });
235
237
  return subSections;
@@ -392,6 +394,18 @@ function getFieldGroupQualifier(formAggregation) {
392
394
  function isSectionMicroChart(section) {
393
395
  return section?.schema?.dataType === 'ChartDefinition';
394
396
  }
397
+ /**
398
+ * Detects whether a body section represents a table.
399
+ * The spec model exposes the section-level `isTable` flag inconsistently — for OP body sections
400
+ * driven by `_<NavProp>/@UI.LineItem` facets the flag is not set, but the section carries a
401
+ * `table` aggregation. Presence of that aggregation is the authoritative signal.
402
+ *
403
+ * @param section - body section or sub-section entry from ux specification
404
+ * @returns true if the section is a table section
405
+ */
406
+ function isTableSection(section) {
407
+ return !!section.isTable || !!getAggregations(section).table;
408
+ }
395
409
  /**
396
410
  * Checks if the section contains a form based on it's aggregations.
397
411
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/ui5-test-writer",
3
3
  "description": "SAP UI5 tests writer",
4
- "version": "1.2.3",
4
+ "version": "1.2.4",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -28,11 +28,11 @@
28
28
  "@sap/ux-specification": "1.144.0",
29
29
  "@sap-ux/edmx-parser": "0.10.0",
30
30
  "@sap-ux/annotation-converter": "0.10.21",
31
- "@sap-ux/ui5-application-writer": "2.0.4",
31
+ "@sap-ux/ui5-application-writer": "2.0.5",
32
32
  "@sap-ux/logger": "1.0.1",
33
- "@sap-ux/fiori-generator-shared": "1.0.11",
34
- "@sap-ux/project-access": "2.1.2",
35
- "@sap-ux/preview-middleware": "1.0.27"
33
+ "@sap-ux/fiori-generator-shared": "1.0.12",
34
+ "@sap-ux/project-access": "2.1.3",
35
+ "@sap-ux/preview-middleware": "1.0.28"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@jest/globals": "30.3.0",