Skip to content

Commit 3e163a8

Browse files
committed
Migrate dashboard widgets to Web Components #1760
1 parent 6ea6de7 commit 3e163a8

36 files changed

+440
-383
lines changed

src/main/resources/admin/extensions/launcher/launcher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ exports.get = function(req) {
4646
adminTools[i].cls = adminTools[i].appId === config.appName ? 'active' : '';
4747
}
4848

49-
const userIconUrl = assetLib.assetUrl({ path: 'icons/widgets/user.svg' });
49+
const userIconUrl = assetLib.assetUrl({ path: 'icons/extensions/user.svg' });
5050
const logoutUrl = portal.logoutUrl({
5151
redirect: admin.getHomeToolUrl({ type: 'absolute' })
5252
});
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<widget id="widget-shortcuts">
1+
<div id="extension-shortcuts">
22
<script type="module" src="{{jsUrl}}" data-config-script-id="{{configScriptId}}"></script>
33
<link rel="stylesheet" href="{{stylesUrl}}" type="text/css" media="all"/>
4-
<div class="widget-shortcuts-container">
4+
<div class="extension-shortcuts-container">
55
{{#dashboardIcons}}
6-
<div class="{{cls}} widget-shortcuts-item" tabindex="0">
6+
<div class="{{cls}} extension-shortcuts-item" tabindex="0">
77
{{#link}}
88
<a href="{{link}}" target="_blank" tabindex="-1">
99
{{/link}}
@@ -15,4 +15,4 @@
1515
</div>
1616
{{/dashboardIcons}}
1717
</div>
18-
</widget>
18+
</div>

src/main/resources/admin/extensions/shortcuts/shortcuts.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const configLib = require('/lib/config');
55
const assetLib = require('/lib/enonic/asset');
66

77
function handleGet(req) {
8-
const iconsPath = 'icons/widgets/';
8+
const iconsPath = 'icons/extensions/';
99
const infoIconUrl = assetLib.assetUrl({ path: `${iconsPath}info-with-circle.svg` });
1010
const devIconUrl = assetLib.assetUrl({ path: `${iconsPath}developer.svg` });
1111
const forumIconUrl = assetLib.assetUrl({ path: `${iconsPath}discuss.svg` });
@@ -16,7 +16,7 @@ function handleGet(req) {
1616
const dashboardIcons = [
1717
{
1818
src: infoIconUrl,
19-
cls: 'widget-shortcuts-xp-about',
19+
cls: 'extension-shortcuts-xp-about',
2020
caption: i18n.localize({
2121
key: 'home.dashboard.widget.shortcuts.about',
2222
bundles: ['i18n/phrases'],
@@ -58,10 +58,10 @@ function handleGet(req) {
5858
const params = {
5959
dashboardIcons: dashboardIcons,
6060
stylesUrl: assetLib.assetUrl({
61-
path: 'styles/widgets/shortcuts.css'
61+
path: 'styles/extensions/shortcuts.css'
6262
}),
6363
jsUrl: assetLib.assetUrl({
64-
path: 'js/widgets/shortcuts.js'
64+
path: 'js/extensions/shortcuts.js'
6565
}),
6666
configScriptId: configLib.configScriptId
6767
};

src/main/resources/assets/icons/widgets/developer.svg renamed to src/main/resources/assets/icons/extensions/developer.svg

File renamed without changes.
File renamed without changes.

src/main/resources/assets/icons/widgets/icon-white.svg renamed to src/main/resources/assets/icons/extensions/icon-white.svg

File renamed without changes.

src/main/resources/assets/icons/widgets/info-with-circle.svg renamed to src/main/resources/assets/icons/extensions/info-with-circle.svg

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)