Skip to content

Commit f7681e1

Browse files
UserAbcd1234Gerrit Code Review
authored andcommitted
Merge "[INTERNAL] VariantManagement: use stable IDs for inner controls"
2 parents ac94e9e + 6d7bf20 commit f7681e1

File tree

2 files changed

+154
-152
lines changed

2 files changed

+154
-152
lines changed

src/sap.m/src/sap/m/VariantManagement.js

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ sap.ui.define([
744744
return;
745745
}
746746

747-
this.oVariantInvisibleText = new InvisibleText();
747+
this.oVariantInvisibleText = new InvisibleText(this.getId() + "-invText");
748748

749749
this.oVariantText = this._createVariantTextControl();
750750

@@ -785,7 +785,7 @@ sap.ui.define([
785785
this.oVariantPopoverTrigger.addAriaLabelledBy(this.oVariantInvisibleText);
786786
this.oVariantPopoverTrigger.addStyleClass("sapMVarMngmtClickable");
787787

788-
this.oVariantLayout = new HorizontalLayout({
788+
this.oVariantLayout = new HorizontalLayout(this.getId() + "-content", {
789789
content: [
790790
this.oVariantText, oVariantModifiedText, this.oVariantPopoverTrigger
791791
]
@@ -1106,18 +1106,18 @@ sap.ui.define([
11061106
var oVBox;
11071107

11081108
if (!this.oErrorVariantPopOver) {
1109-
oVBox = new VBox({
1109+
oVBox = new VBox(this.getId() + "-errorContent", {
11101110
fitContainer: true,
11111111
alignItems: FlexAlignItems.Center,
11121112
items: [
1113-
new Icon({
1113+
new Icon(this.getId() + "-errorIcon", {
11141114
size: "4rem",
11151115
color: "lightgray",
11161116
src: "sap-icon://message-error"
1117-
}), new Title({
1117+
}), new Title(this.getId() + "-errorTitle", {
11181118
titleStyle: TitleLevel.H2,
11191119
text: this._oRb.getText("VARIANT_MANAGEMENT_ERROR_TEXT1")
1120-
}), new Text({
1120+
}), new Text(this.getId() + "-errorText", {
11211121
textAlign: TextAlign.Center,
11221122
text: this._oRb.getText("VARIANT_MANAGEMENT_ERROR_TEXT2")
11231123
})
@@ -1176,7 +1176,7 @@ sap.ui.define([
11761176
VariantManagement.prototype._createIllustratedMessages = function() {
11771177

11781178
if (!this._oNoDataIllustratedMessage || this._oNoDataIllustratedMessage.bIsDestroyed) {
1179-
this._oNoDataIllustratedMessage = new IllustratedMessage({
1179+
this._oNoDataIllustratedMessage = new IllustratedMessage(this.getId() + "-noData", {
11801180
title: this._oRb.getText("VARIANT_MANAGEMENT_NODATA"),
11811181
description: this._oRb.getText("VARIANT_MANAGEMENT_NODATA_DESCR"),
11821182
enableVerticalResponsiveness: true,
@@ -1185,7 +1185,7 @@ sap.ui.define([
11851185
});
11861186
}
11871187
if (!this._oNoDataFoundIllustratedMessage || this._oNoDataFoundIllustratedMessage.bIsDestroyed) {
1188-
this._oNoDataFoundIllustratedMessage = new IllustratedMessage({
1188+
this._oNoDataFoundIllustratedMessage = new IllustratedMessage(this.getId() + "-noDataFound", {
11891189
title: this._oRb.getText("VARIANT_MANAGEMENT_NODATA_FOUND"),
11901190
description: this._oRb.getText("VARIANT_MANAGEMENT_NODATA_FOUND_DESCR"),
11911191
enableVerticalResponsiveness: true,
@@ -1210,7 +1210,7 @@ sap.ui.define([
12101210
press: function() {
12111211
this._openManagementDialog();
12121212
}.bind(this),
1213-
layoutData: new OverflowToolbarLayoutData({
1213+
layoutData: new OverflowToolbarLayoutData(this.getId() + "-manage-layoutData", {
12141214
priority: OverflowToolbarPriority.Low
12151215
})
12161216
});
@@ -1239,7 +1239,7 @@ sap.ui.define([
12391239
}.bind(this)
12401240
},
12411241
type: ButtonType.Emphasized,
1242-
layoutData: new OverflowToolbarLayoutData({
1242+
layoutData: new OverflowToolbarLayoutData(this.getId() + "-mainsave-layoutData", {
12431243
priority: OverflowToolbarPriority.Low
12441244
})
12451245
});
@@ -1253,7 +1253,7 @@ sap.ui.define([
12531253
press: function() {
12541254
this._openSaveAsDialog();
12551255
}.bind(this),
1256-
layoutData: new OverflowToolbarLayoutData({
1256+
layoutData: new OverflowToolbarLayoutData(this.getId() + "-saveas-layoutData", {
12571257
priority: OverflowToolbarPriority.Low
12581258
}),
12591259
visible: {
@@ -1296,7 +1296,7 @@ sap.ui.define([
12961296
}.bind(this)
12971297
});
12981298

1299-
this.oVariantListInvisibleText = new InvisibleText({
1299+
this.oVariantListInvisibleText = new InvisibleText(this.getId() + "-listInvisibleText", {
13001300
text: this._oRb.getText("VARIANT_MANAGEMENT_VIEW_LIST")
13011301
});
13021302

@@ -1312,7 +1312,7 @@ sap.ui.define([
13121312
items: [this._oNoDataFoundIllustratedMessage]
13131313
});
13141314

1315-
var oItemTemplate = new Item({
1315+
var oItemTemplate = new Item(this.getId() + "-list-item", {
13161316
key: "{$mVariants>key}",
13171317
text: "{$mVariants>title}"
13181318
});
@@ -1329,17 +1329,17 @@ sap.ui.define([
13291329
}.bind(this));
13301330

13311331
this.oVariantSelectionPage = new Page(this.getId() + "-selpage", {
1332-
subHeader: new Toolbar({
1332+
subHeader: new Toolbar(this.getId() + "-selpage-header", {
13331333
content: [
13341334
this._oSearchField
13351335
]
13361336
}),
13371337
content: [
13381338
this.oVariantList, this.oNodataTextLayout
13391339
],
1340-
footer: new OverflowToolbar({
1340+
footer: new OverflowToolbar(this.getId() + "-selpage-footer", {
13411341
content: [
1342-
new ToolbarSpacer(this.getId() + "-spacer"), this.oVariantSaveBtn, this.oVariantSaveAsBtn, this.oVariantManageBtn
1342+
new ToolbarSpacer(this.getId() + "-selpage-footer-spacer"), this.oVariantSaveBtn, this.oVariantSaveAsBtn, this.oVariantManageBtn
13431343
]
13441344
}),
13451345
showNavButton: false,
@@ -1608,7 +1608,7 @@ sap.ui.define([
16081608
message: this._getSaveTooltipText("SAVE")
16091609
}, this);
16101610

1611-
var oSaveAsDialogOptionsGrid = new Grid({
1611+
var oSaveAsDialogOptionsGrid = new Grid(this.getId() + "-savedialog-options", {
16121612
defaultSpan: "L12 M12 S12"
16131613
});
16141614

@@ -2094,22 +2094,22 @@ sap.ui.define([
20942094
keyboardMode: ListKeyboardMode.Navigation,
20952095
sticky: [ Sticky.ColumnHeaders ],
20962096
columns: [
2097-
new Column({
2098-
header: new InvisibleText({
2097+
new Column(this.getId() + "-managementTable-col-favorite", {
2098+
header: new InvisibleText(this.getId() + "-managementTable-col-favorite-invText", {
20992099
text: this._oRb.getText("VARIANT_MANAGEMENT_FAVORITE_COLUMN")
21002100
}),
21012101
width: "3rem",
21022102
visible: {
21032103
path: "/supportFavorites",
21042104
model: "$mVariants"
21052105
}
2106-
}), new Column({
2107-
header: new Text({
2106+
}), new Column(this.getId() + "-managementTable-col-name", {
2107+
header: new Text(this.getId() + "-managementTable-col-name-text", {
21082108
text: this._oRb.getText("VARIANT_MANAGEMENT_NAME")
21092109
}),
21102110
width: "16rem"
2111-
}), new Column({
2112-
header: new Text({
2111+
}), new Column(this.getId() + "-managementTable-col-variantType", {
2112+
header: new Text(this.getId() + "-managementTable-col-variantType-text", {
21132113
text: this._oRb.getText("VARIANT_MANAGEMENT_VARIANTTYPE"),
21142114
wrappingType: "Hyphenated"
21152115
}),
@@ -2120,8 +2120,8 @@ sap.ui.define([
21202120
demandPopin: true,
21212121
popinDisplay: PopinDisplay.Inline,
21222122
minScreenWidth: ScreenSize.Tablet
2123-
}), new Column({
2124-
header: new Text({
2123+
}), new Column(this.getId() + "-managementTable-col-default", {
2124+
header: new Text(this.getId() + "-managementTable-col-default-text", {
21252125
text: this._oRb.getText("VARIANT_MANAGEMENT_DEFAULT"),
21262126
wrappingType: "Hyphenated"
21272127
}),
@@ -2133,8 +2133,8 @@ sap.ui.define([
21332133
path: "/supportDefault",
21342134
model: "$mVariants"
21352135
}
2136-
}), new Column({
2137-
header: new Text({
2136+
}), new Column(this.getId() + "-managementTable-col-executeOnSelect", {
2137+
header: new Text(this.getId() + "-managementTable-col-executeOnSelect-text", {
21382138
text: this._oRb.getText("VARIANT_MANAGEMENT_EXECUTEONSELECT"),
21392139
wrappingType: "Hyphenated"
21402140
}),
@@ -2146,8 +2146,8 @@ sap.ui.define([
21462146
path: "/supportApplyAutomatically",
21472147
model: "$mVariants"
21482148
}
2149-
}), new Column({
2150-
header: new Text({
2149+
}), new Column(this.getId() + "-managementTable-col-visibility", {
2150+
header: new Text(this.getId() + "-managementTable-col-visibility-text", {
21512151
text: this._oRb.getText("VARIANT_MANAGEMENT_VISIBILITY"),
21522152
wrappingType: "Hyphenated"
21532153
}),
@@ -2159,20 +2159,20 @@ sap.ui.define([
21592159
path: "/supportContexts",
21602160
model: "$mVariants"
21612161
}
2162-
}), new Column({
2163-
header: new Text({
2162+
}), new Column(this.getId() + "-managementTable-col-author", {
2163+
header: new Text(this.getId() + "-managementTable-col-author-text", {
21642164
text: this._oRb.getText("VARIANT_MANAGEMENT_AUTHOR"),
21652165
wrappingType: "Hyphenated"
21662166
}),
21672167
demandPopin: true,
21682168
popinDisplay: PopinDisplay.Block,
21692169
minScreenWidth: ScreenSize.Tablet
2170-
}), new Column({
2171-
header: new InvisibleText({
2170+
}), new Column(this.getId() + "-managementTable-col-action", {
2171+
header: new InvisibleText(this.getId() + "-managementTable-col-action-invText", {
21722172
text: this._oRb.getText("VARIANT_MANAGEMENT_ACTION_COLUMN")
21732173
}),
21742174
hAlign: TextAlign.Center
2175-
}), new Column({
2175+
}), new Column(this.getId() + "-managementTable-col-last", {
21762176
visible: false
21772177
})
21782178
]
@@ -2231,7 +2231,7 @@ sap.ui.define([
22312231
return false;
22322232
};
22332233

2234-
this._oSearchFieldOnMgmtDialog = new SearchField();
2234+
this._oSearchFieldOnMgmtDialog = new SearchField(this.getId() + "-managementdialog-search");
22352235

22362236
this._oSearchFieldOnMgmtDialog.attachLiveChange(function(oEvent) {
22372237
this._triggerSearchInManageDialog(oEvent, this.oManagementTable);
@@ -2490,7 +2490,7 @@ sap.ui.define([
24902490
}
24912491
}
24922492

2493-
const oListItem = new ColumnListItem({
2493+
const oListItem = new ColumnListItem(sIdPrefix + "-item-" + nPos, {
24942494
cells: [
24952495
oFavoriteIcon,
24962496
oNameControl,
@@ -2513,7 +2513,7 @@ sap.ui.define([
25132513
wrappingType: "Hyphenated"
25142514
}),
25152515
oDeleteButton,
2516-
new Text({
2516+
new Text(sIdPrefix + "-key-" + nPos, {
25172517
text: fnCreateBinding("key")
25182518
})
25192519
]
@@ -3239,11 +3239,11 @@ sap.ui.define([
32393239
this._openRolesDialog(oItem, oEvent.oSource.getParent().getItems()[0]);
32403240
}.bind(this);
32413241

3242+
const nPos = this._determineIndex(oContext.getPath());
32423243
if (this._sStyleClass && this.getSupportContexts() && (oItem.getKey() !== this.getStandardVariantKey())) {
3243-
const nPos = this._determineIndex(oContext.getPath());
3244-
const oText = new Text({ wrapping: false });
3244+
const oText = new Text(sIdPrefix + "-role-" + nPos + "-text", { wrapping: false });
32453245
this._determineRolesSpecificText(oItem, oText);
3246-
var oIcon = new Icon({
3246+
var oIcon = new Icon(sIdPrefix + "-role-" + nPos + "-icon", {
32473247
src: "sap-icon://edit",
32483248
press: fRolesPressed
32493249
});
@@ -3254,7 +3254,7 @@ sap.ui.define([
32543254
});
32553255

32563256
} else {
3257-
return new Text();
3257+
return new Text(sIdPrefix + "-role-" + nPos + "-text");
32583258
}
32593259
};
32603260

0 commit comments

Comments
 (0)