@sap-ux/ui5-test-writer 1.17.0 → 1.18.0
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/types.d.ts +10 -6
- package/dist/utils/listReportUtils.d.ts +33 -11
- package/dist/utils/listReportUtils.js +139 -45
- package/dist/utils/tableUtils.d.ts +18 -3
- package/dist/utils/tableUtils.js +42 -7
- package/package.json +2 -2
- package/templates/v4/1.152/integration/ListReportJourney.js +21 -13
- package/templates/v4/1.152/integration/ListReportJourney.ts +19 -13
- package/templates/v4/latest/integration/ListReportJourney.js +40 -5
- package/templates/v4/latest/integration/ListReportJourney.ts +39 -4
package/dist/types.d.ts
CHANGED
|
@@ -76,6 +76,7 @@ export type FEV4ManifestTarget = {
|
|
|
76
76
|
paths?: Array<{
|
|
77
77
|
key?: string;
|
|
78
78
|
entitySet?: string;
|
|
79
|
+
annotationPath?: string;
|
|
79
80
|
template?: string;
|
|
80
81
|
primary?: unknown[];
|
|
81
82
|
secondary?: unknown[];
|
|
@@ -133,16 +134,17 @@ export type ContactCardField = {
|
|
|
133
134
|
property: string;
|
|
134
135
|
};
|
|
135
136
|
/**
|
|
136
|
-
* A table column whose bound property carries a `Common.Text` annotation. `
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
137
|
+
* A table column whose bound property carries a `Common.Text` annotation. `columnProperty` is the
|
|
138
|
+
* column's own (code) property; `textProperty` is the text target. Both are asserted independently.
|
|
139
|
+
* When columns share one text target, only the first emits the text-property test; the rest set
|
|
140
|
+
* `skipTextPropertyTest` but still assert their own code column. `textPropertyNotSortable` marks a
|
|
141
|
+
* nav-path target in an AnalyticalTable view (cannot sort across a navigation); skipped in the sort test only.
|
|
141
142
|
*/
|
|
142
143
|
export type TextAnnotationColumn = {
|
|
143
|
-
columnProperty
|
|
144
|
+
columnProperty: string;
|
|
144
145
|
textProperty: string;
|
|
145
146
|
skipTextPropertyTest?: boolean;
|
|
147
|
+
textPropertyNotSortable?: boolean;
|
|
146
148
|
};
|
|
147
149
|
export type BodySubSectionFeatureData = {
|
|
148
150
|
id: string;
|
|
@@ -209,6 +211,8 @@ export type ListReportTab = {
|
|
|
209
211
|
visible?: boolean;
|
|
210
212
|
dynamicPath?: string;
|
|
211
213
|
};
|
|
214
|
+
textAnnotationColumns: TextAnnotationColumn[];
|
|
215
|
+
columnPersonalizationSupported?: boolean;
|
|
212
216
|
};
|
|
213
217
|
export type ListReportFeatures = {
|
|
214
218
|
name?: string;
|
|
@@ -2,6 +2,7 @@ import type { Logger } from '@sap-ux/logger';
|
|
|
2
2
|
import type { TreeAggregation, TreeAggregations, TreeModel } from '@sap/ux-specification/dist/types/src/parser/index.js';
|
|
3
3
|
import type { ActionButtonsResult, ActionButtonState, ButtonState, FEV4ManifestTarget, ListReportFeatures, ListReportTab } from '../types.js';
|
|
4
4
|
import { type I18nLabelResolver } from './i18nUtils.js';
|
|
5
|
+
import type { TextAnnotationColumnCandidate } from './tableUtils.js';
|
|
5
6
|
import type { ConvertedMetadata } from '@sap-ux/vocabularies-types';
|
|
6
7
|
import { safeCheckButtonVisibility } from './actionUtils.js';
|
|
7
8
|
import type { PageWithModelV4 } from '@sap/ux-specification/dist/types/src/parser/application.js';
|
|
@@ -56,6 +57,17 @@ export declare function isALPManifestTarget(target: FEV4ManifestTarget): boolean
|
|
|
56
57
|
* @returns true if the target (or any ListReport target) is an ALP
|
|
57
58
|
*/
|
|
58
59
|
export declare function isALPFromManifest(manifest: Manifest, targetKey?: string): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Derives text-annotation candidates for a view by reading each bound column's `Common.Text` target off
|
|
62
|
+
* the shared entity type. Fallback for secondary multi-tab views, where `@sap/ux-specification` resolves
|
|
63
|
+
* `properties.text` only on the primary view but the annotation is in metadata for every view.
|
|
64
|
+
*
|
|
65
|
+
* @param columnProperties - the view's bound column property names (in column order)
|
|
66
|
+
* @param convertedMetadata - converted OData metadata, source of the `Common.Text` target
|
|
67
|
+
* @param entitySet - entity set backing the view (undefined yields no candidates)
|
|
68
|
+
* @returns candidate columns with their bound property and the text annotation target property
|
|
69
|
+
*/
|
|
70
|
+
export declare function extractTextAnnotationCandidatesFromMetadata(columnProperties: string[], convertedMetadata: ConvertedMetadata, entitySet: string | undefined): TextAnnotationColumnCandidate[];
|
|
59
71
|
/**
|
|
60
72
|
* Gets List Report features from the page model using ux-specification.
|
|
61
73
|
*
|
|
@@ -155,6 +167,26 @@ export declare function getCustomFilterFieldProperties(manifest: Manifest | unde
|
|
|
155
167
|
* @returns true if the column-adaptation dialog is available for the table
|
|
156
168
|
*/
|
|
157
169
|
export declare function isColumnPersonalizationEnabled(manifest: Manifest | undefined, targetKey: string | undefined, contextPath?: string): boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Resolves column personalization for a single multi-tab view, selecting the LineItem entry by the
|
|
172
|
+
* view's `annotationPath` qualifier and falling back to the unqualified `@…UI.v1.LineItem`.
|
|
173
|
+
*
|
|
174
|
+
* @param manifest - the application manifest (may be undefined)
|
|
175
|
+
* @param targetKey - routing target key of the List Report page
|
|
176
|
+
* @param annotationPath - the view's `annotationPath` (its SV/SPV qualifier source)
|
|
177
|
+
* @returns true if the column-adaptation dialog is available for that view's table
|
|
178
|
+
*/
|
|
179
|
+
export declare function isViewColumnPersonalizationEnabled(manifest: Manifest | undefined, targetKey: string | undefined, annotationPath?: string): boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Resolves a view's MDC table type (e.g. `GridTable`, `AnalyticalTable`, `ResponsiveTable`) from the
|
|
182
|
+
* manifest, using the same qualifier matching as {@link isViewColumnPersonalizationEnabled}.
|
|
183
|
+
*
|
|
184
|
+
* @param manifest - the application manifest (may be undefined)
|
|
185
|
+
* @param targetKey - routing target key of the List Report page
|
|
186
|
+
* @param annotationPath - the view's `annotationPath` (its SV/SPV qualifier source)
|
|
187
|
+
* @returns the configured table type, or undefined when none is set (MDC default is ResponsiveTable)
|
|
188
|
+
*/
|
|
189
|
+
export declare function getViewTableType(manifest: Manifest | undefined, targetKey: string | undefined, annotationPath?: string): string | undefined;
|
|
158
190
|
/**
|
|
159
191
|
* Determines the non-custom tab keys for a multi-tab List Report, used to target a specific
|
|
160
192
|
* table via `onTable("<key>")`. Custom tabs (backed by an app fragment) are skipped as they
|
|
@@ -180,6 +212,7 @@ export declare function getTableIdentifiers(manifest: Manifest | undefined, targ
|
|
|
180
212
|
export declare function getListReportViews(manifest: Manifest | undefined, targetKey: string | undefined): {
|
|
181
213
|
key: string;
|
|
182
214
|
entitySet?: string;
|
|
215
|
+
annotationPath?: string;
|
|
183
216
|
}[];
|
|
184
217
|
/**
|
|
185
218
|
* Retrieves the value of `@com.sap.vocabularies.Common.v1.Label` for a specific property
|
|
@@ -207,17 +240,6 @@ export declare function getPropertyLabelFromMetadata(convertedMetadata: Converte
|
|
|
207
240
|
* @returns true if the property is hidden from the filter adaptation dialog
|
|
208
241
|
*/
|
|
209
242
|
export declare function isHiddenFilter(convertedMetadata: ConvertedMetadata, entitySetName: string | undefined, propertyName: string): boolean;
|
|
210
|
-
/**
|
|
211
|
-
* Returns true if the property's `UI.TextArrangement` is `TextOnly`, checking both the nested
|
|
212
|
-
* (`Common.Text`) and sibling (property-level) locations. Under `TextOnly` the code property is not
|
|
213
|
-
* sortable, so its sort test must be skipped.
|
|
214
|
-
*
|
|
215
|
-
* @param convertedMetadata - converted OData metadata (metadata merged with local annotations)
|
|
216
|
-
* @param entitySetName - entity set owning the property (undefined → false)
|
|
217
|
-
* @param propertyName - property to inspect
|
|
218
|
-
* @returns true if the text arrangement is TextOnly
|
|
219
|
-
*/
|
|
220
|
-
export declare function isTextOnlyArrangement(convertedMetadata: ConvertedMetadata, entitySetName: string | undefined, propertyName: string): boolean;
|
|
221
243
|
/**
|
|
222
244
|
* Checks the state of action buttons defined in UI.LineItem annotations for a given entity set.
|
|
223
245
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getFilterFields, getSelectionFieldItems, getSelectionFieldItemsWithLabels, getTableColumnData, getAggregations } from './modelUtils.js';
|
|
2
2
|
import { passthroughLabelResolver } from './i18nUtils.js';
|
|
3
|
-
import { extractContactCardColumnsFromNode, extractContactCardColumnsFromTableNode, extractTableColumnsFromTableNode, extractTextAnnotationColumnsFromNode, resolvePrimaryTableNode, resolveViewTableNodes } from './tableUtils.js';
|
|
3
|
+
import { extractContactCardColumnsFromNode, extractContactCardColumnsFromTableNode, extractTableColumnsFromTableNode, extractTextAnnotationColumnsFromNode, extractTextAnnotationColumnsFromTableNode, extractBoundColumnPropertiesFromTableNode, resolvePrimaryTableNode, resolveViewTableNodes } from './tableUtils.js';
|
|
4
4
|
import { parse, merge } from '@sap-ux/edmx-parser';
|
|
5
5
|
import { convert } from '@sap-ux/annotation-converter';
|
|
6
6
|
import { extractActionMethodName, buildActionButtonState, buildMenuActionState, isMenuActionItem, collectCriticalActionNames, safeCheckButtonVisibility, safeCheckButtonVisibilityFromMetadata } from './actionUtils.js';
|
|
@@ -86,6 +86,65 @@ export function isALPFromManifest(manifest, targetKey) {
|
|
|
86
86
|
return target?.name === 'sap.fe.templates.ListReport' && isALPManifestTarget(target);
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Resolves raw text-annotation candidates into the template shape, deduplicating the text-property test
|
|
91
|
+
* per text target. Each candidate asserts its own code column and text target independently; when columns
|
|
92
|
+
* share a text target, only the first emits the text-property test (the rest set `skipTextPropertyTest`).
|
|
93
|
+
*
|
|
94
|
+
* @param candidates - raw candidates (one table or one tab)
|
|
95
|
+
* @param isAnalyticalTable - true when the view renders an AnalyticalTable, which cannot sort nav-path targets
|
|
96
|
+
* @returns the text-annotation columns to emit tests for
|
|
97
|
+
*/
|
|
98
|
+
function buildTextAnnotationColumns(candidates, isAnalyticalTable = false) {
|
|
99
|
+
const seenTextProperties = new Set();
|
|
100
|
+
return candidates.map((candidate) => {
|
|
101
|
+
const skipTextPropertyTest = seenTextProperties.has(candidate.textProperty);
|
|
102
|
+
seenTextProperties.add(candidate.textProperty);
|
|
103
|
+
// An AnalyticalTable can only sort properties of the aggregated entity, not a nav-path target.
|
|
104
|
+
const textPropertyNotSortable = isAnalyticalTable && candidate.textProperty.includes('/');
|
|
105
|
+
return {
|
|
106
|
+
columnProperty: candidate.columnProperty,
|
|
107
|
+
textProperty: candidate.textProperty,
|
|
108
|
+
skipTextPropertyTest,
|
|
109
|
+
textPropertyNotSortable
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Derives text-annotation candidates for a view by reading each bound column's `Common.Text` target off
|
|
115
|
+
* the shared entity type. Fallback for secondary multi-tab views, where `@sap/ux-specification` resolves
|
|
116
|
+
* `properties.text` only on the primary view but the annotation is in metadata for every view.
|
|
117
|
+
*
|
|
118
|
+
* @param columnProperties - the view's bound column property names (in column order)
|
|
119
|
+
* @param convertedMetadata - converted OData metadata, source of the `Common.Text` target
|
|
120
|
+
* @param entitySet - entity set backing the view (undefined yields no candidates)
|
|
121
|
+
* @returns candidate columns with their bound property and the text annotation target property
|
|
122
|
+
*/
|
|
123
|
+
export function extractTextAnnotationCandidatesFromMetadata(columnProperties, convertedMetadata, entitySet) {
|
|
124
|
+
if (!entitySet) {
|
|
125
|
+
return [];
|
|
126
|
+
}
|
|
127
|
+
const resolvedEntitySet = convertedMetadata.entitySets.find((es) => es.name === entitySet);
|
|
128
|
+
const entityProperties = resolvedEntitySet?.entityType?.entityProperties;
|
|
129
|
+
if (!entityProperties) {
|
|
130
|
+
return [];
|
|
131
|
+
}
|
|
132
|
+
const candidates = [];
|
|
133
|
+
for (const columnProperty of columnProperties) {
|
|
134
|
+
const property = entityProperties.find((p) => p.name === columnProperty);
|
|
135
|
+
const text = property?.annotations?.Common?.Text;
|
|
136
|
+
// `Common.Text` is a path expression at runtime; vocabularies-types widens it, so narrow via a guard.
|
|
137
|
+
const textPath = text && typeof text === 'object' && 'type' in text && text.type === 'Path' && typeof text.path === 'string'
|
|
138
|
+
? text.path
|
|
139
|
+
: undefined;
|
|
140
|
+
// "None" (any casing) is the spec-model sentinel for "no text annotation".
|
|
141
|
+
if (!textPath || textPath.toLowerCase() === 'none') {
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
candidates.push({ columnProperty, textProperty: textPath });
|
|
145
|
+
}
|
|
146
|
+
return candidates;
|
|
147
|
+
}
|
|
89
148
|
/**
|
|
90
149
|
* Gets List Report features from the page model using ux-specification.
|
|
91
150
|
*
|
|
@@ -157,23 +216,11 @@ export function getListReportFeatures(listReportPage, log, metadata, manifest, r
|
|
|
157
216
|
// `@UI.HiddenFilter` properties cannot be added via the adaptation dialog; skip the check when metadata is missing.
|
|
158
217
|
.filter((key) => !convertedMetadata || !isHiddenFilter(convertedMetadata, listReportPage.entitySet, key))
|
|
159
218
|
: undefined;
|
|
160
|
-
// A maintained text annotation emits
|
|
161
|
-
// required). The code column is also sorted, except under TextOnly where it is not sortable.
|
|
219
|
+
// A maintained text annotation emits sort tests for both the code column and its text target.
|
|
162
220
|
const meta = convertedMetadata;
|
|
163
|
-
const
|
|
221
|
+
const isAnalyticalTable = getViewTableType(manifest, listReportPage.name) === 'AnalyticalTable';
|
|
164
222
|
const textAnnotationColumns = meta
|
|
165
|
-
? extractTextAnnotationColumnsFromNode(listReportPage.model.root)
|
|
166
|
-
// Dedupe the text-property sort test per text target; each code column keeps its own.
|
|
167
|
-
const skipTextPropertyTest = seenTextProperties.has(candidate.textProperty);
|
|
168
|
-
seenTextProperties.add(candidate.textProperty);
|
|
169
|
-
return {
|
|
170
|
-
columnProperty: isTextOnlyArrangement(meta, listReportPage.entitySet, candidate.columnProperty)
|
|
171
|
-
? undefined
|
|
172
|
-
: candidate.columnProperty,
|
|
173
|
-
textProperty: candidate.textProperty,
|
|
174
|
-
skipTextPropertyTest
|
|
175
|
-
};
|
|
176
|
-
})
|
|
223
|
+
? buildTextAnnotationColumns(extractTextAnnotationColumnsFromNode(listReportPage.model.root), isAnalyticalTable)
|
|
177
224
|
: [];
|
|
178
225
|
return {
|
|
179
226
|
name: listReportPage.name,
|
|
@@ -316,6 +363,17 @@ export function getListReportTabs(listReportPage, convertedMetadata, manifest, r
|
|
|
316
363
|
deleteButton = buildButtonState(buttonVisibility?.delete);
|
|
317
364
|
}
|
|
318
365
|
toolBarActions = toolBarActions.concat(extractCustomToolBarActionsFromTableNode(tableNode, resolveLabel, convertedMetadata));
|
|
366
|
+
// Secondary tabs yield no spec-model candidates (only the primary view resolves `properties.text`),
|
|
367
|
+
// so fall back to the shared entity type's `Common.Text` metadata.
|
|
368
|
+
let textAnnotationColumns = [];
|
|
369
|
+
if (convertedMetadata) {
|
|
370
|
+
let candidates = extractTextAnnotationColumnsFromTableNode(tableNode);
|
|
371
|
+
if (candidates.length === 0) {
|
|
372
|
+
candidates = extractTextAnnotationCandidatesFromMetadata(extractBoundColumnPropertiesFromTableNode(tableNode), convertedMetadata, entitySet);
|
|
373
|
+
}
|
|
374
|
+
const isAnalyticalTable = getViewTableType(manifest, listReportPage.name, view.annotationPath) === 'AnalyticalTable';
|
|
375
|
+
textAnnotationColumns = buildTextAnnotationColumns(candidates, isAnalyticalTable);
|
|
376
|
+
}
|
|
319
377
|
tabs.push({
|
|
320
378
|
key: view.key,
|
|
321
379
|
entitySet,
|
|
@@ -323,7 +381,9 @@ export function getListReportTabs(listReportPage, convertedMetadata, manifest, r
|
|
|
323
381
|
contactCardColumns: extractContactCardColumnsFromTableNode(tableNode),
|
|
324
382
|
toolBarActions,
|
|
325
383
|
createButton,
|
|
326
|
-
deleteButton
|
|
384
|
+
deleteButton,
|
|
385
|
+
textAnnotationColumns,
|
|
386
|
+
columnPersonalizationSupported: isViewColumnPersonalizationEnabled(manifest, listReportPage.name, view.annotationPath)
|
|
327
387
|
});
|
|
328
388
|
});
|
|
329
389
|
return tabs;
|
|
@@ -456,10 +516,16 @@ export function isColumnPersonalizationEnabled(manifest, targetKey, contextPath)
|
|
|
456
516
|
return true;
|
|
457
517
|
}
|
|
458
518
|
const lineItemConfig = findDefaultTableLineItemConfig(controlConfiguration, contextPath);
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
519
|
+
return interpretColumnPersonalization(lineItemConfig?.tableSettings?.personalization);
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Interprets a `tableSettings.personalization` manifest value: a boolean is used directly; an object
|
|
523
|
+
* enables personalization only when `column === true`; `null`/`undefined` is the Fiori elements default (enabled).
|
|
524
|
+
*
|
|
525
|
+
* @param personalization - the raw `tableSettings.personalization` value
|
|
526
|
+
* @returns true if column personalization is enabled
|
|
527
|
+
*/
|
|
528
|
+
function interpretColumnPersonalization(personalization) {
|
|
463
529
|
if (typeof personalization === 'boolean') {
|
|
464
530
|
return personalization;
|
|
465
531
|
}
|
|
@@ -468,6 +534,57 @@ export function isColumnPersonalizationEnabled(manifest, targetKey, contextPath)
|
|
|
468
534
|
}
|
|
469
535
|
return true;
|
|
470
536
|
}
|
|
537
|
+
/**
|
|
538
|
+
* Resolves column personalization for a single multi-tab view, selecting the LineItem entry by the
|
|
539
|
+
* view's `annotationPath` qualifier and falling back to the unqualified `@…UI.v1.LineItem`.
|
|
540
|
+
*
|
|
541
|
+
* @param manifest - the application manifest (may be undefined)
|
|
542
|
+
* @param targetKey - routing target key of the List Report page
|
|
543
|
+
* @param annotationPath - the view's `annotationPath` (its SV/SPV qualifier source)
|
|
544
|
+
* @returns true if the column-adaptation dialog is available for that view's table
|
|
545
|
+
*/
|
|
546
|
+
export function isViewColumnPersonalizationEnabled(manifest, targetKey, annotationPath) {
|
|
547
|
+
if (!manifest || !targetKey) {
|
|
548
|
+
return true;
|
|
549
|
+
}
|
|
550
|
+
const target = manifest['sap.ui5']?.routing?.targets?.[targetKey];
|
|
551
|
+
const controlConfiguration = target?.options?.settings?.controlConfiguration;
|
|
552
|
+
if (!controlConfiguration || typeof controlConfiguration !== 'object') {
|
|
553
|
+
return true;
|
|
554
|
+
}
|
|
555
|
+
const lineItemTerm = '@com.sap.vocabularies.UI.v1.LineItem';
|
|
556
|
+
const hashIndex = annotationPath?.indexOf('#') ?? -1;
|
|
557
|
+
const qualifier = hashIndex >= 0 ? annotationPath?.slice(hashIndex + 1) : undefined;
|
|
558
|
+
const entry = (qualifier && controlConfiguration[`${lineItemTerm}#${qualifier}`]) || controlConfiguration[lineItemTerm];
|
|
559
|
+
const tableSettings = entry
|
|
560
|
+
?.tableSettings;
|
|
561
|
+
return interpretColumnPersonalization(tableSettings?.personalization);
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Resolves a view's MDC table type (e.g. `GridTable`, `AnalyticalTable`, `ResponsiveTable`) from the
|
|
565
|
+
* manifest, using the same qualifier matching as {@link isViewColumnPersonalizationEnabled}.
|
|
566
|
+
*
|
|
567
|
+
* @param manifest - the application manifest (may be undefined)
|
|
568
|
+
* @param targetKey - routing target key of the List Report page
|
|
569
|
+
* @param annotationPath - the view's `annotationPath` (its SV/SPV qualifier source)
|
|
570
|
+
* @returns the configured table type, or undefined when none is set (MDC default is ResponsiveTable)
|
|
571
|
+
*/
|
|
572
|
+
export function getViewTableType(manifest, targetKey, annotationPath) {
|
|
573
|
+
if (!manifest || !targetKey) {
|
|
574
|
+
return undefined;
|
|
575
|
+
}
|
|
576
|
+
const target = manifest['sap.ui5']?.routing?.targets?.[targetKey];
|
|
577
|
+
const controlConfiguration = target?.options?.settings?.controlConfiguration;
|
|
578
|
+
if (!controlConfiguration || typeof controlConfiguration !== 'object') {
|
|
579
|
+
return undefined;
|
|
580
|
+
}
|
|
581
|
+
const lineItemTerm = '@com.sap.vocabularies.UI.v1.LineItem';
|
|
582
|
+
const hashIndex = annotationPath?.indexOf('#') ?? -1;
|
|
583
|
+
const qualifier = hashIndex >= 0 ? annotationPath?.slice(hashIndex + 1) : undefined;
|
|
584
|
+
const entry = (qualifier && controlConfiguration[`${lineItemTerm}#${qualifier}`]) || controlConfiguration[lineItemTerm];
|
|
585
|
+
const type = entry?.tableSettings?.type;
|
|
586
|
+
return typeof type === 'string' ? type : undefined;
|
|
587
|
+
}
|
|
471
588
|
/**
|
|
472
589
|
* Determines the non-custom tab keys for a multi-tab List Report, used to target a specific
|
|
473
590
|
* table via `onTable("<key>")`. Custom tabs (backed by an app fragment) are skipped as they
|
|
@@ -528,7 +645,7 @@ export function getListReportViews(manifest, targetKey) {
|
|
|
528
645
|
typeof path.key === 'string' &&
|
|
529
646
|
path.key.length > 0 &&
|
|
530
647
|
!(typeof path.template === 'string' && path.template.length > 0)) {
|
|
531
|
-
views.push({ key: path.key, entitySet: path.entitySet });
|
|
648
|
+
views.push({ key: path.key, entitySet: path.entitySet, annotationPath: path.annotationPath });
|
|
532
649
|
}
|
|
533
650
|
}
|
|
534
651
|
return views;
|
|
@@ -575,29 +692,6 @@ export function isHiddenFilter(convertedMetadata, entitySetName, propertyName) {
|
|
|
575
692
|
// `HiddenFilter: false` as hidden. Coerce via `valueOf()` to read the underlying boolean.
|
|
576
693
|
return property?.annotations?.UI?.HiddenFilter?.valueOf() === true;
|
|
577
694
|
}
|
|
578
|
-
/**
|
|
579
|
-
* Returns true if the property's `UI.TextArrangement` is `TextOnly`, checking both the nested
|
|
580
|
-
* (`Common.Text`) and sibling (property-level) locations. Under `TextOnly` the code property is not
|
|
581
|
-
* sortable, so its sort test must be skipped.
|
|
582
|
-
*
|
|
583
|
-
* @param convertedMetadata - converted OData metadata (metadata merged with local annotations)
|
|
584
|
-
* @param entitySetName - entity set owning the property (undefined → false)
|
|
585
|
-
* @param propertyName - property to inspect
|
|
586
|
-
* @returns true if the text arrangement is TextOnly
|
|
587
|
-
*/
|
|
588
|
-
export function isTextOnlyArrangement(convertedMetadata, entitySetName, propertyName) {
|
|
589
|
-
if (!entitySetName) {
|
|
590
|
-
return false;
|
|
591
|
-
}
|
|
592
|
-
const entitySet = convertedMetadata.entitySets.find((es) => es.name === entitySetName);
|
|
593
|
-
const property = entitySet?.entityType?.entityProperties?.find((p) => p.name === propertyName);
|
|
594
|
-
// The converter also populates TextArrangement as a property-level sibling of Common.Text, a
|
|
595
|
-
// shape vocabularies-types does not declare — hence the indexed access.
|
|
596
|
-
const siblingArrangement = property?.annotations?.UI?.['TextArrangement'];
|
|
597
|
-
const textArrangement = property?.annotations?.Common?.Text?.annotations?.UI?.TextArrangement ?? siblingArrangement;
|
|
598
|
-
// The converted enum value stringifies to e.g. "UI.TextArrangementType/TextOnly".
|
|
599
|
-
return textArrangement !== undefined && String(textArrangement).endsWith('/TextOnly');
|
|
600
|
-
}
|
|
601
695
|
/**
|
|
602
696
|
* Checks the state of action buttons defined in UI.LineItem annotations for a given entity set.
|
|
603
697
|
*
|
|
@@ -20,9 +20,8 @@ type ColumnModelItem = {
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
|
-
* A column
|
|
24
|
-
*
|
|
25
|
-
* OData metadata); `textProperty` is the `Common.Text` target property (used as the sort name).
|
|
23
|
+
* A column carrying a `Common.Text` annotation. `columnProperty` is the column's own bound property;
|
|
24
|
+
* `textProperty` is the text target. A nav-path text target is valid; only a nav-path `columnProperty` is excluded.
|
|
26
25
|
*/
|
|
27
26
|
export type TextAnnotationColumnCandidate = {
|
|
28
27
|
columnProperty: string;
|
|
@@ -110,5 +109,21 @@ export declare function extractContactCardColumnsFromNode(node: TreeAggregation)
|
|
|
110
109
|
* @returns candidate columns with their bound property and the text annotation target property
|
|
111
110
|
*/
|
|
112
111
|
export declare function extractTextAnnotationColumnsFromNode(node: TreeAggregation): TextAnnotationColumnCandidate[];
|
|
112
|
+
/**
|
|
113
|
+
* Returns the bound property names of a resolved table node's default-available columns, omitting
|
|
114
|
+
* nav-path and unidentifiable columns. Per-view column source for the metadata text-annotation fallback
|
|
115
|
+
* (only the primary view carries `properties.text`).
|
|
116
|
+
*
|
|
117
|
+
* @param tableNode - resolved 'table' aggregation node
|
|
118
|
+
* @returns ordered, de-duplicated list of bound column property names
|
|
119
|
+
*/
|
|
120
|
+
export declare function extractBoundColumnPropertiesFromTableNode(tableNode: TreeAggregation): string[];
|
|
121
|
+
/**
|
|
122
|
+
* Extracts text-annotation columns from a resolved 'table' node (a single table or one multi-tab view).
|
|
123
|
+
*
|
|
124
|
+
* @param tableNode - resolved 'table' aggregation node
|
|
125
|
+
* @returns candidate columns with their bound property and the text annotation target property
|
|
126
|
+
*/
|
|
127
|
+
export declare function extractTextAnnotationColumnsFromTableNode(tableNode: TreeAggregation): TextAnnotationColumnCandidate[];
|
|
113
128
|
export {};
|
|
114
129
|
//# sourceMappingURL=tableUtils.d.ts.map
|
package/dist/utils/tableUtils.js
CHANGED
|
@@ -190,6 +190,44 @@ export function extractTextAnnotationColumnsFromNode(node) {
|
|
|
190
190
|
if (!tableNode) {
|
|
191
191
|
return [];
|
|
192
192
|
}
|
|
193
|
+
return extractTextAnnotationColumnsFromTableNode(tableNode);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Returns the bound property names of a resolved table node's default-available columns, omitting
|
|
197
|
+
* nav-path and unidentifiable columns. Per-view column source for the metadata text-annotation fallback
|
|
198
|
+
* (only the primary view carries `properties.text`).
|
|
199
|
+
*
|
|
200
|
+
* @param tableNode - resolved 'table' aggregation node
|
|
201
|
+
* @returns ordered, de-duplicated list of bound column property names
|
|
202
|
+
*/
|
|
203
|
+
export function extractBoundColumnPropertiesFromTableNode(tableNode) {
|
|
204
|
+
const columnsAggregation = getAggregations(tableNode)['columns'];
|
|
205
|
+
if (!columnsAggregation) {
|
|
206
|
+
return [];
|
|
207
|
+
}
|
|
208
|
+
const columnItems = getAggregations(columnsAggregation);
|
|
209
|
+
const properties = [];
|
|
210
|
+
const seen = new Set();
|
|
211
|
+
Object.entries(columnItems).forEach(([columnKey, column]) => {
|
|
212
|
+
if (!isDefaultAvailableColumn(column)) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
const columnProperty = getColumnIdentifier(column, columnKey);
|
|
216
|
+
if (!columnProperty || columnProperty.includes('/') || seen.has(columnProperty)) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
seen.add(columnProperty);
|
|
220
|
+
properties.push(columnProperty);
|
|
221
|
+
});
|
|
222
|
+
return properties;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Extracts text-annotation columns from a resolved 'table' node (a single table or one multi-tab view).
|
|
226
|
+
*
|
|
227
|
+
* @param tableNode - resolved 'table' aggregation node
|
|
228
|
+
* @returns candidate columns with their bound property and the text annotation target property
|
|
229
|
+
*/
|
|
230
|
+
export function extractTextAnnotationColumnsFromTableNode(tableNode) {
|
|
193
231
|
const columnsAggregation = getAggregations(tableNode)['columns'];
|
|
194
232
|
if (!columnsAggregation) {
|
|
195
233
|
return [];
|
|
@@ -202,18 +240,15 @@ export function extractTextAnnotationColumnsFromNode(node) {
|
|
|
202
240
|
return;
|
|
203
241
|
}
|
|
204
242
|
const text = column.properties?.text;
|
|
205
|
-
//
|
|
206
|
-
// maintained" — such columns must not produce a sort test.
|
|
243
|
+
// Spec-model sentinel "None" (any casing) means no text annotation is maintained.
|
|
207
244
|
if (text?.artifactType !== 'Annotation' || !text.value || text.value.toLowerCase() === 'none') {
|
|
208
245
|
return;
|
|
209
246
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
if (text.value.includes('/')) {
|
|
247
|
+
const columnProperty = getColumnIdentifier(column, columnKey);
|
|
248
|
+
if (columnProperty?.includes('/')) {
|
|
213
249
|
return;
|
|
214
250
|
}
|
|
215
|
-
|
|
216
|
-
// Deduplicate by code column: distinct columns may share one text target.
|
|
251
|
+
// Distinct columns may share one text target; dedupe by code column.
|
|
217
252
|
if (!columnProperty || seenColumnProperties.has(columnProperty)) {
|
|
218
253
|
return;
|
|
219
254
|
}
|
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.
|
|
4
|
+
"version": "1.18.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"@sap-ux/annotation-converter": "0.10.22",
|
|
31
31
|
"@sap-ux/ui5-application-writer": "2.1.5",
|
|
32
32
|
"@sap-ux/logger": "1.0.3",
|
|
33
|
-
"@sap-ux/fiori-generator-shared": "1.2.20",
|
|
34
33
|
"@sap-ux/project-access": "2.3.0",
|
|
34
|
+
"@sap-ux/fiori-generator-shared": "1.2.20",
|
|
35
35
|
"@sap-ux/preview-middleware": "1.2.25"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
@@ -17,9 +17,8 @@
|
|
|
17
17
|
|
|
18
18
|
sap.ui.define([
|
|
19
19
|
"sap/ui/test/opaQunit",
|
|
20
|
-
"./pages/JourneyRunner"
|
|
21
|
-
|
|
22
|
-
], function (opaTest, runner<% if (textAnnotationColumns && textAnnotationColumns.length > 0) { %>, coreLibrary<% } %>) {
|
|
20
|
+
"./pages/JourneyRunner"
|
|
21
|
+
], function (opaTest, runner) {
|
|
23
22
|
"use strict";
|
|
24
23
|
|
|
25
24
|
function journey() {
|
|
@@ -198,6 +197,22 @@ sap.ui.define([
|
|
|
198
197
|
Then.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iCheckColumns(undefined, <%- JSON.stringify(tab.tableColumns) %>);
|
|
199
198
|
});
|
|
200
199
|
|
|
200
|
+
<%_ } -%>
|
|
201
|
+
<%_ if (tab.textAnnotationColumns && tab.textAnnotationColumns.length > 0) { -%>
|
|
202
|
+
<%_ if (tab.columnPersonalizationSupported !== false) { -%>
|
|
203
|
+
opaTest(<%- JSON.stringify("Check the presence of the text columns for columns with a Text annotation in view " + tab.key) %>, function (Given, When, Then) {
|
|
204
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
205
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iOpenColumnAdaptation();
|
|
206
|
+
<%_ tab.textAnnotationColumns.forEach(function(column) { _%>
|
|
207
|
+
<%_ if (!column.skipTextPropertyTest) { _%>
|
|
208
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iAddAdaptationColumn({ name: "<%- column.textProperty %>" });
|
|
209
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAdaptationColumn({ name: "<%- column.textProperty %>" });
|
|
210
|
+
<%_ } _%>
|
|
211
|
+
<%_ }); -%>
|
|
212
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iConfirmColumnAdaptation();
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
<%_ } -%>
|
|
201
216
|
<%_ } -%>
|
|
202
217
|
opaTest(<%- JSON.stringify("Check table rows in view " + tab.key) %>, function (Given, When, Then) {
|
|
203
218
|
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
@@ -335,22 +350,15 @@ sap.ui.define([
|
|
|
335
350
|
Then.onThe<%- startLR %>Generated.onTable(defaultTableId).iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
|
|
336
351
|
});
|
|
337
352
|
|
|
338
|
-
<%_ } -%>
|
|
339
|
-
<%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
|
|
340
|
-
opaTest("Check text annotation for columns", function (Given, When, Then) {
|
|
341
|
-
<%_ textAnnotationColumns.forEach(function(column) { _%>
|
|
342
|
-
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.Ascending);
|
|
343
|
-
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.Ascending, true);
|
|
344
|
-
<%_ }); -%>
|
|
345
|
-
});
|
|
346
|
-
|
|
347
353
|
<%_ } -%>
|
|
348
354
|
<%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0 && columnPersonalizationSupported !== false) { -%>
|
|
349
|
-
opaTest("Check columns
|
|
355
|
+
opaTest("Check the presence of the text columns for columns with a Text annotation", function (Given, When, Then) {
|
|
350
356
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iOpenColumnAdaptation();
|
|
351
357
|
<%_ textAnnotationColumns.forEach(function(column) { _%>
|
|
358
|
+
<%_ if (!column.skipTextPropertyTest) { _%>
|
|
352
359
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iAddAdaptationColumn({ name: "<%- column.textProperty %>" });
|
|
353
360
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAdaptationColumn({ name: "<%- column.textProperty %>" });
|
|
361
|
+
<%_ } _%>
|
|
354
362
|
<%_ }); -%>
|
|
355
363
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iConfirmColumnAdaptation();
|
|
356
364
|
});
|
|
@@ -25,9 +25,6 @@ const usesFilterFieldIdentifier =
|
|
|
25
25
|
import type { FilterFieldIdentifier } from "sap/fe/test/api/FilterBarAPI";
|
|
26
26
|
<% } -%>
|
|
27
27
|
import runner from "./pages/JourneyRunner";
|
|
28
|
-
<%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
|
|
29
|
-
import { SortOrder } from "sap/ui/core/library";
|
|
30
|
-
<%_ } -%>
|
|
31
28
|
|
|
32
29
|
function journey() {
|
|
33
30
|
QUnit.module("<%- name%>ListReport journey");
|
|
@@ -205,6 +202,22 @@ function journey() {
|
|
|
205
202
|
Then.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iCheckColumns(undefined, <%- JSON.stringify(tab.tableColumns) %>);
|
|
206
203
|
});
|
|
207
204
|
|
|
205
|
+
<%_ } -%>
|
|
206
|
+
<%_ if (tab.textAnnotationColumns && tab.textAnnotationColumns.length > 0) { -%>
|
|
207
|
+
<%_ if (tab.columnPersonalizationSupported !== false) { -%>
|
|
208
|
+
opaTest(<%- JSON.stringify("Check the presence of the text columns for columns with a Text annotation in view " + tab.key) %>, function (_Given: Given, When: When, Then: Then) {
|
|
209
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
210
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iOpenColumnAdaptation();
|
|
211
|
+
<%_ tab.textAnnotationColumns.forEach(function(column) { _%>
|
|
212
|
+
<%_ if (!column.skipTextPropertyTest) { _%>
|
|
213
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iAddAdaptationColumn({ name: "<%- column.textProperty %>" });
|
|
214
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAdaptationColumn({ name: "<%- column.textProperty %>" });
|
|
215
|
+
<%_ } _%>
|
|
216
|
+
<%_ }); -%>
|
|
217
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iConfirmColumnAdaptation();
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
<%_ } -%>
|
|
208
221
|
<%_ } -%>
|
|
209
222
|
opaTest(<%- JSON.stringify("Check table rows in view " + tab.key) %>, function (_Given: Given, When: When, Then: Then) {
|
|
210
223
|
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
@@ -343,22 +356,15 @@ function journey() {
|
|
|
343
356
|
Then.onThe<%- startLR %>Generated.onTable(defaultTableId).iCheckColumns(undefined, <%- JSON.stringify(tableColumns) %>);
|
|
344
357
|
});
|
|
345
358
|
|
|
346
|
-
<%_ } -%>
|
|
347
|
-
<%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
|
|
348
|
-
opaTest("Check text annotation for columns", function (_Given: Given, When: When, Then: Then) {
|
|
349
|
-
<%_ textAnnotationColumns.forEach(function(column) { _%>
|
|
350
|
-
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.textProperty %>" }, SortOrder.Ascending);
|
|
351
|
-
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.textProperty %>" }, SortOrder.Ascending, true);
|
|
352
|
-
<%_ }); -%>
|
|
353
|
-
});
|
|
354
|
-
|
|
355
359
|
<%_ } -%>
|
|
356
360
|
<%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0 && columnPersonalizationSupported !== false) { -%>
|
|
357
|
-
opaTest("Check columns
|
|
361
|
+
opaTest("Check the presence of the text columns for columns with a Text annotation", function (_Given: Given, When: When, Then: Then) {
|
|
358
362
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iOpenColumnAdaptation();
|
|
359
363
|
<%_ textAnnotationColumns.forEach(function(column) { _%>
|
|
364
|
+
<%_ if (!column.skipTextPropertyTest) { _%>
|
|
360
365
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iAddAdaptationColumn({ name: "<%- column.textProperty %>" });
|
|
361
366
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAdaptationColumn({ name: "<%- column.textProperty %>" });
|
|
367
|
+
<%_ } _%>
|
|
362
368
|
<%_ }); -%>
|
|
363
369
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iConfirmColumnAdaptation();
|
|
364
370
|
});
|
|
@@ -15,11 +15,12 @@
|
|
|
15
15
|
* ╚═══════════════════════════════════════════════════════════════════════╝ *
|
|
16
16
|
******************************************************************************/
|
|
17
17
|
|
|
18
|
+
<%_ const needsSortOrder = startLR && ((textAnnotationColumns && textAnnotationColumns.length > 0) || (tabs && tabs.some(function(tab) { return tab.textAnnotationColumns && tab.textAnnotationColumns.length > 0; }))); -%>
|
|
18
19
|
sap.ui.define([
|
|
19
20
|
"sap/ui/test/opaQunit",
|
|
20
|
-
"./pages/JourneyRunner"<% if (
|
|
21
|
+
"./pages/JourneyRunner"<% if (needsSortOrder) { %>,
|
|
21
22
|
"sap/ui/core/library"<% } %>
|
|
22
|
-
], function (opaTest, runner<% if (
|
|
23
|
+
], function (opaTest, runner<% if (needsSortOrder) { %>, coreLibrary<% } %>) {
|
|
23
24
|
"use strict";
|
|
24
25
|
|
|
25
26
|
function journey() {
|
|
@@ -198,6 +199,38 @@ sap.ui.define([
|
|
|
198
199
|
Then.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iCheckColumns(undefined, <%- JSON.stringify(tab.tableColumns) %>);
|
|
199
200
|
});
|
|
200
201
|
|
|
202
|
+
<%_ } -%>
|
|
203
|
+
<%_ if (tab.textAnnotationColumns && tab.textAnnotationColumns.length > 0) { -%>
|
|
204
|
+
opaTest(<%- JSON.stringify("Check the Sort options for columns with a Text annotation in view " + tab.key) %>, function (Given, When, Then) {
|
|
205
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
206
|
+
<%_ tab.textAnnotationColumns.forEach(function(column) { _%>
|
|
207
|
+
<%_ if (column.columnProperty) { _%>
|
|
208
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iChangeSortOrder({ name: "<%- column.columnProperty %>" }, coreLibrary.SortOrder.Ascending);
|
|
209
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckSortOrder({ name: "<%- column.columnProperty %>" }, coreLibrary.SortOrder.Ascending, true);
|
|
210
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iChangeSortOrder({ name: "<%- column.columnProperty %>" }, coreLibrary.SortOrder.None);
|
|
211
|
+
<%_ } _%>
|
|
212
|
+
<%_ if (!column.skipTextPropertyTest && !column.textPropertyNotSortable) { _%>
|
|
213
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iChangeSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.Ascending);
|
|
214
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.Ascending, true);
|
|
215
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iChangeSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.None);
|
|
216
|
+
<%_ } _%>
|
|
217
|
+
<%_ }); -%>
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
<%_ if (tab.columnPersonalizationSupported !== false) { -%>
|
|
221
|
+
opaTest(<%- JSON.stringify("Check the presence of the text columns for columns with a Text annotation in view " + tab.key) %>, function (Given, When, Then) {
|
|
222
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
223
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iOpenColumnAdaptation();
|
|
224
|
+
<%_ tab.textAnnotationColumns.forEach(function(column) { _%>
|
|
225
|
+
<%_ if (!column.skipTextPropertyTest) { _%>
|
|
226
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iAddAdaptationColumn({ name: "<%- column.textProperty %>" });
|
|
227
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAdaptationColumn({ name: "<%- column.textProperty %>" });
|
|
228
|
+
<%_ } _%>
|
|
229
|
+
<%_ }); -%>
|
|
230
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iConfirmColumnAdaptation();
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
<%_ } -%>
|
|
201
234
|
<%_ } -%>
|
|
202
235
|
opaTest(<%- JSON.stringify("Check table rows in view " + tab.key) %>, function (Given, When, Then) {
|
|
203
236
|
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
@@ -337,14 +370,14 @@ sap.ui.define([
|
|
|
337
370
|
|
|
338
371
|
<%_ } -%>
|
|
339
372
|
<%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
|
|
340
|
-
opaTest("Check
|
|
373
|
+
opaTest("Check the Sort options for columns with a Text annotation", function (Given, When, Then) {
|
|
341
374
|
<%_ textAnnotationColumns.forEach(function(column) { _%>
|
|
342
375
|
<%_ if (column.columnProperty) { _%>
|
|
343
376
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.columnProperty %>" }, coreLibrary.SortOrder.Ascending);
|
|
344
377
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.columnProperty %>" }, coreLibrary.SortOrder.Ascending, true);
|
|
345
378
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.columnProperty %>" }, coreLibrary.SortOrder.None);
|
|
346
379
|
<%_ } _%>
|
|
347
|
-
<%_ if (!column.skipTextPropertyTest) { _%>
|
|
380
|
+
<%_ if (!column.skipTextPropertyTest && !column.textPropertyNotSortable) { _%>
|
|
348
381
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.Ascending);
|
|
349
382
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.Ascending, true);
|
|
350
383
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.None);
|
|
@@ -354,11 +387,13 @@ sap.ui.define([
|
|
|
354
387
|
|
|
355
388
|
<%_ } -%>
|
|
356
389
|
<%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0 && columnPersonalizationSupported !== false) { -%>
|
|
357
|
-
opaTest("Check columns
|
|
390
|
+
opaTest("Check the presence of the text columns for columns with a Text annotation", function (Given, When, Then) {
|
|
358
391
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iOpenColumnAdaptation();
|
|
359
392
|
<%_ textAnnotationColumns.forEach(function(column) { _%>
|
|
393
|
+
<%_ if (!column.skipTextPropertyTest) { _%>
|
|
360
394
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iAddAdaptationColumn({ name: "<%- column.textProperty %>" });
|
|
361
395
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAdaptationColumn({ name: "<%- column.textProperty %>" });
|
|
396
|
+
<%_ } _%>
|
|
362
397
|
<%_ }); -%>
|
|
363
398
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iConfirmColumnAdaptation();
|
|
364
399
|
});
|
|
@@ -25,7 +25,8 @@ const usesFilterFieldIdentifier =
|
|
|
25
25
|
import type { FilterFieldIdentifier } from "sap/fe/test/api/FilterBarAPI";
|
|
26
26
|
<% } -%>
|
|
27
27
|
import runner from "./pages/JourneyRunner";
|
|
28
|
-
<%_
|
|
28
|
+
<%_ const needsSortOrder = startLR && ((textAnnotationColumns && textAnnotationColumns.length > 0) || (tabs && tabs.some(function(tab) { return tab.textAnnotationColumns && tab.textAnnotationColumns.length > 0; }))); -%>
|
|
29
|
+
<%_ if (needsSortOrder) { -%>
|
|
29
30
|
import { SortOrder } from "sap/ui/core/library";
|
|
30
31
|
<%_ } -%>
|
|
31
32
|
|
|
@@ -205,6 +206,38 @@ function journey() {
|
|
|
205
206
|
Then.onThe<%- startLR %>Generated.onTable("<%- tab.key %>").iCheckColumns(undefined, <%- JSON.stringify(tab.tableColumns) %>);
|
|
206
207
|
});
|
|
207
208
|
|
|
209
|
+
<%_ } -%>
|
|
210
|
+
<%_ if (tab.textAnnotationColumns && tab.textAnnotationColumns.length > 0) { -%>
|
|
211
|
+
opaTest(<%- JSON.stringify("Check the Sort options for columns with a Text annotation in view " + tab.key) %>, function (_Given: Given, When: When, Then: Then) {
|
|
212
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
213
|
+
<%_ tab.textAnnotationColumns.forEach(function(column) { _%>
|
|
214
|
+
<%_ if (column.columnProperty) { _%>
|
|
215
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iChangeSortOrder({ name: "<%- column.columnProperty %>" }, SortOrder.Ascending);
|
|
216
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckSortOrder({ name: "<%- column.columnProperty %>" }, SortOrder.Ascending, true);
|
|
217
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iChangeSortOrder({ name: "<%- column.columnProperty %>" }, SortOrder.None);
|
|
218
|
+
<%_ } _%>
|
|
219
|
+
<%_ if (!column.skipTextPropertyTest && !column.textPropertyNotSortable) { _%>
|
|
220
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iChangeSortOrder({ name: "<%- column.textProperty %>" }, SortOrder.Ascending);
|
|
221
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckSortOrder({ name: "<%- column.textProperty %>" }, SortOrder.Ascending, true);
|
|
222
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iChangeSortOrder({ name: "<%- column.textProperty %>" }, SortOrder.None);
|
|
223
|
+
<%_ } _%>
|
|
224
|
+
<%_ }); -%>
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
<%_ if (tab.columnPersonalizationSupported !== false) { -%>
|
|
228
|
+
opaTest(<%- JSON.stringify("Check the presence of the text columns for columns with a Text annotation in view " + tab.key) %>, function (_Given: Given, When: When, Then: Then) {
|
|
229
|
+
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
230
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iOpenColumnAdaptation();
|
|
231
|
+
<%_ tab.textAnnotationColumns.forEach(function(column) { _%>
|
|
232
|
+
<%_ if (!column.skipTextPropertyTest) { _%>
|
|
233
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iAddAdaptationColumn({ name: "<%- column.textProperty %>" });
|
|
234
|
+
Then.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iCheckAdaptationColumn({ name: "<%- column.textProperty %>" });
|
|
235
|
+
<%_ } _%>
|
|
236
|
+
<%_ }); -%>
|
|
237
|
+
When.onThe<%- startLR%>Generated.onTable("<%- tab.key %>").iConfirmColumnAdaptation();
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
<%_ } -%>
|
|
208
241
|
<%_ } -%>
|
|
209
242
|
opaTest(<%- JSON.stringify("Check table rows in view " + tab.key) %>, function (_Given: Given, When: When, Then: Then) {
|
|
210
243
|
When.onThe<%- startLR%>Generated.iGoToView({ key: "<%- tab.key %>" });
|
|
@@ -345,14 +378,14 @@ function journey() {
|
|
|
345
378
|
|
|
346
379
|
<%_ } -%>
|
|
347
380
|
<%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
|
|
348
|
-
opaTest("Check
|
|
381
|
+
opaTest("Check the Sort options for columns with a Text annotation", function (_Given: Given, When: When, Then: Then) {
|
|
349
382
|
<%_ textAnnotationColumns.forEach(function(column) { _%>
|
|
350
383
|
<%_ if (column.columnProperty) { _%>
|
|
351
384
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.columnProperty %>" }, SortOrder.Ascending);
|
|
352
385
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.columnProperty %>" }, SortOrder.Ascending, true);
|
|
353
386
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.columnProperty %>" }, SortOrder.None);
|
|
354
387
|
<%_ } _%>
|
|
355
|
-
<%_ if (!column.skipTextPropertyTest) { _%>
|
|
388
|
+
<%_ if (!column.skipTextPropertyTest && !column.textPropertyNotSortable) { _%>
|
|
356
389
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.textProperty %>" }, SortOrder.Ascending);
|
|
357
390
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.textProperty %>" }, SortOrder.Ascending, true);
|
|
358
391
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.textProperty %>" }, SortOrder.None);
|
|
@@ -362,11 +395,13 @@ function journey() {
|
|
|
362
395
|
|
|
363
396
|
<%_ } -%>
|
|
364
397
|
<%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0 && columnPersonalizationSupported !== false) { -%>
|
|
365
|
-
opaTest("Check columns
|
|
398
|
+
opaTest("Check the presence of the text columns for columns with a Text annotation", function (_Given: Given, When: When, Then: Then) {
|
|
366
399
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iOpenColumnAdaptation();
|
|
367
400
|
<%_ textAnnotationColumns.forEach(function(column) { _%>
|
|
401
|
+
<%_ if (!column.skipTextPropertyTest) { _%>
|
|
368
402
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iAddAdaptationColumn({ name: "<%- column.textProperty %>" });
|
|
369
403
|
Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckAdaptationColumn({ name: "<%- column.textProperty %>" });
|
|
404
|
+
<%_ } _%>
|
|
370
405
|
<%_ }); -%>
|
|
371
406
|
When.onThe<%- startLR%>Generated.onTable(defaultTableId).iConfirmColumnAdaptation();
|
|
372
407
|
});
|