Skip to content

Commit 9b0acbb

Browse files
ThoddGerrit Code Review
authored andcommitted
Merge "[INTERNAL] Clean-up: Usage of deprecated themes"
2 parents d155309 + ff57fc3 commit 9b0acbb

File tree

6 files changed

+55
-89
lines changed

6 files changed

+55
-89
lines changed

src/sap.m/test/sap/m/demokit/theming/webapp/controller/Overview.controller.js

Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -54,30 +54,6 @@ sap.ui.define([
5454
},
5555
"sap_fiori_3_hcw": {
5656
"text": "Quartz High Contrast White"
57-
},
58-
"sap_belize": {
59-
"text": "Belize",
60-
"deprecated": true
61-
},
62-
"sap_belize_plus": {
63-
"text": "Belize Deep",
64-
"deprecated": true
65-
},
66-
"sap_belize_hcb": {
67-
"text": "Belize High Contrast Black",
68-
"deprecated": true
69-
},
70-
"sap_belize_hcw": {
71-
"text": "Belize High Contrast White",
72-
"deprecated": true
73-
},
74-
"sap_bluecrystal": {
75-
"text": "Blue Crystal",
76-
"deprecated": true
77-
},
78-
"sap_hcb": {
79-
"text": "High Contrast Black",
80-
"deprecated": true
8157
}
8258
};
8359

@@ -663,54 +639,33 @@ sap.ui.define([
663639
this.onAction();
664640
oCore.applyTheme(theme);
665641
this.byId("title").setText(`Details for ''${themeName}''`);
666-
var isDeprecated = mThemes[theme].deprecated;
667-
if (isDeprecated) {
668-
this.byId("tbLessParam").setPressed();
669-
this.byId("tbLessParam").setEnabled(false);
670-
this.byId("colCP").setVisible(false);
671-
this.byId("colTP").setVisible(true);
672-
this._oTableFilterState.aCPFilter = [];
673-
} else {
674-
this.byId("tbLessParam").setEnabled(true);
675-
this.byId("colCP").setVisible(true);
676-
this.byId("colTP").setVisible(false);
677-
this._oTableFilterState.aCPFilter = [
678-
new Filter("cp", FilterOperator.EQ, true)
679-
];
680-
}
681-
this._applyFilterSearch();
682642
},
683643
// Event handler for pressing the copy to clipboard button
684-
// Copies the UI5 parameter to the clipboard
644+
// Copies the CSS Custom Property to the clipboard
685645
onCopyCodeToClipboard: function (oEvt) {
686-
var sTheme = sap.ui.getCore().getConfiguration().getTheme(),
687-
isDeprecated = mThemes[sTheme].deprecated,
688-
sString = oEvt.getSource().getParent().getCells()[isDeprecated ? 3 : 2].getText(),
646+
var sString = oEvt.getSource().getParent().getCells()[2].getText(),
689647
$temp = jQuery("<input>");
690648
if (!sString) {
691-
MessageToast.show("No UI5 Parameter to copy to clipboard");
649+
MessageToast.show("No CSS Custom Property to copy to clipboard");
692650
return;
693651
}
694652
try {
695653
jQuery("body").append($temp);
696654
$temp.val(sString).trigger("select");
697655
document.execCommand("copy");
698656
$temp.remove();
699-
MessageToast.show("UI5 Parameter " + sString + " copied to clipboard");
657+
MessageToast.show("CSS Custom Property " + sString + " copied to clipboard");
700658
} catch (oException) {
701-
MessageToast.show("UI5 Parameter " + sString + " not copied to clipboard");
659+
MessageToast.show("CSS Custom Property " + sString + " not copied to clipboard");
702660
}
703661
},
704662

705663
//Event handler for the Search Field
706664
onSearch: function (oEvt) {
707665
var sQuery = oEvt.getSource().getValue();
708666
if (sQuery && sQuery.length > 0) {
709-
var sTheme = sap.ui.getCore().getConfiguration().getTheme(),
710-
isDeprecated = mThemes[sTheme].deprecated;
711667
this._oTableFilterState.aFilter = [
712-
new Filter(isDeprecated ? "nameTP" : "nameCP", FilterOperator.Contains, sQuery)
713-
//new Filter("nameTP", FilterOperator.Contains, sQuery) // TODO: support filter of Custom Prop and Theme Param
668+
new Filter("nameCP", FilterOperator.Contains, sQuery)
714669
];
715670
} else {
716671
this._oTableFilterState.aFilter = [];

src/sap.m/test/sap/m/demokit/theming/webapp/view/Overview.view.xml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,17 @@
116116
text="{i18n>ToggleButtonQuickText}"
117117
ariaLabelledBy="textFilter"
118118
tooltip="{i18n>TooltipQuick}"/>
119-
<ToolbarSeparator
120-
visible="{= ${device>/system/desktop} }"/>
121-
<ToggleButton
122-
type="Transparent"
123-
id="tbLessParam"
124-
press=".onPressLessParam"
125-
icon="sap-icon://vds-file"
126-
text="{i18n>ToggleButtonLessParamText}"
127-
ariaLabelledBy="textFilter"
128-
tooltip="{i18n>TooltipLessParam}"/>
119+
<ToolbarSeparator
120+
visible="{= ${device>/system/desktop} }"/>
121+
<ToggleButton
122+
type="Transparent"
123+
id="tbLessParam"
124+
press=".onPressLessParam"
125+
icon="sap-icon://vds-file"
126+
text="{i18n>ToggleButtonLessParamText}"
127+
ariaLabelledBy="textFilter"
128+
tooltip="{i18n>TooltipLessParam}"/>
129+
129130
</OverflowToolbar>
130131
</headerToolbar>
131132
</Panel>

src/sap.ui.core/src/sap/ui/core/Core.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,21 +1226,21 @@ sap.ui.define([
12261226
* </pre>
12271227
*
12281228
* If parts of the theme are at different locations (e.g. because you provide a standard theme
1229-
* like "sap_belize" for a custom control library and this self-made part of the standard theme is at a
1229+
* like "sap_horizon" for a custom control library and this self-made part of the standard theme is at a
12301230
* different location than the UI5 resources), you can also specify for which control libraries the setting
12311231
* should be used, by giving an array with the names of the respective control libraries as second parameter:
12321232
* <pre>
1233-
* sap.ui.getCore().setThemeRoot("sap_belize", ["my.own.library"], "https://mythemeserver.com/allThemes");
1233+
* sap.ui.getCore().setThemeRoot("sap_horizon", ["my.own.library"], "https://mythemeserver.com/allThemes");
12341234
* </pre>
12351235
*
1236-
* This will cause the Belize theme to be loaded from the UI5 location for all standard libraries.
1236+
* This will cause the Horizon theme to be loaded from the UI5 location for all standard libraries.
12371237
* Resources for styling the <code>my.own.library</code> controls will be loaded from the configured
12381238
* location:
12391239
* <pre>
1240-
* https://sdk.openui5.org/resources/sap/ui/core/themes/sap_belize/library.css
1241-
* https://sdk.openui5.org/resources/sap/ui/layout/themes/sap_belize/library.css
1242-
* https://sdk.openui5.org/resources/sap/m/themes/sap_belize/library.css
1243-
* https://mythemeserver.com/allThemes/my/own/library/themes/sap_belize/library.css
1240+
* https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/library.css
1241+
* https://sdk.openui5.org/resources/sap/ui/layout/themes/sap_horizon/library.css
1242+
* https://sdk.openui5.org/resources/sap/m/themes/sap_horizon/library.css
1243+
* https://mythemeserver.com/allThemes/my/own/library/themes/sap_horizon/library.css
12441244
* </pre>
12451245
*
12461246
* If the custom theme should be loaded initially (via bootstrap attribute), the <code>themeRoots</code>

src/sap.ui.core/src/sap/ui/core/Theming.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,21 +162,21 @@ sap.ui.define([
162162
* </pre>
163163
*
164164
* If parts of the theme are at different locations (e.g. because you provide a standard theme
165-
* like "sap_belize" for a custom control library and this self-made part of the standard theme is at a
165+
* like "sap_horizon" for a custom control library and this self-made part of the standard theme is at a
166166
* different location than the UI5 resources), you can also specify for which control libraries the setting
167167
* should be used, by giving an array with the names of the respective control libraries as second parameter:
168168
* <pre>
169-
* Theming.setThemeRoot("sap_belize", ["my.own.library"], "https://mythemeserver.com/allThemes");
169+
* Theming.setThemeRoot("sap_horizon", ["my.own.library"], "https://mythemeserver.com/allThemes");
170170
* </pre>
171171
*
172-
* This will cause the Belize theme to be loaded from the UI5 location for all standard libraries.
172+
* This will cause the Horizon theme to be loaded from the UI5 location for all standard libraries.
173173
* Resources for styling the <code>my.own.library</code> controls will be loaded from the configured
174174
* location:
175175
* <pre>
176-
* https://openui5.hana.ondemand.com/resources/sap/ui/core/themes/sap_belize/library.css
177-
* https://openui5.hana.ondemand.com/resources/sap/ui/layout/themes/sap_belize/library.css
178-
* https://openui5.hana.ondemand.com/resources/sap/m/themes/sap_belize/library.css
179-
* https://mythemeserver.com/allThemes/my/own/library/themes/sap_belize/library.css
176+
* https://openui5.hana.ondemand.com/resources/sap/ui/core/themes/sap_horizon/library.css
177+
* https://openui5.hana.ondemand.com/resources/sap/ui/layout/themes/sap_horizon/library.css
178+
* https://openui5.hana.ondemand.com/resources/sap/m/themes/sap_horizon/library.css
179+
* https://mythemeserver.com/allThemes/my/own/library/themes/sap_horizon/library.css
180180
* </pre>
181181
*
182182
* If the custom theme should be loaded initially (via bootstrap attribute), the <code>themeRoots</code>

src/sap.ui.core/test/sap/ui/core/getComputedStyle.html

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,19 @@
55

66
<title>Just a Button</title>
77

8-
<script src="../../../../resources/sap-ui-core.js"
9-
id="sap-ui-bootstrap"
10-
data-sap-ui-libs="sap.m"
11-
data-sap-ui-theme="sap_belize"></script>
8+
<script id="sap-ui-bootstrap"
9+
src="../../../../resources/sap-ui-core.js"
10+
data-sap-ui-libs="sap.m"
11+
data-sap-ui-on-init="module:local/getComputedStyle"
12+
data-sap-ui-resource-roots='{
13+
"local": "./"
14+
}'
15+
></script>
1216
<!-- only load the main library "sap.m" and the Belize theme -->
1317

14-
<script>
15-
var style = window.getComputedStyle(document.documentElement);
16-
//eslint-disable-next-line no-console -- there's no alternative in <head>
17-
console.log("style >> " + style);
18-
var oCarousel = new sap.m.Carousel();
19-
oCarousel.placeAt("content");
20-
oCarousel.setHeight("300px");
21-
oCarousel.setWidth("300px");
22-
</script>
18+
2319
</head>
2420
<body id="content" class="sapUiBody">
2521
invisible body content
2622
</body>
27-
</html>
23+
</html>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
sap.ui.define([
2+
"sap/m/Carousel"
3+
], function (Carousel) {
4+
"use strict";
5+
// Note: the HTML page 'getComputedStyle.html' loads this module via data-sap-ui-on-init
6+
7+
var style = window.getComputedStyle(document.documentElement);
8+
//eslint-disable-next-line no-console -- there's no alternative in <head>
9+
console.log("style >> " + style);
10+
var oCarousel = new Carousel();
11+
oCarousel.placeAt("content");
12+
oCarousel.setHeight("300px");
13+
oCarousel.setWidth("300px");
14+
});

0 commit comments

Comments
 (0)