Skip to content

Commit d6096ce

Browse files
izaerabrianchandotcom
authored andcommitted
LPD-52709 Add hashes to import maps
This should fix most of the failing tests for build liferay-frontend#5112 (comment)
1 parent ffcd106 commit d6096ce

File tree

2 files changed

+10
-53
lines changed

2 files changed

+10
-53
lines changed

modules/apps/portal-url-builder/portal-url-builder-impl/src/main/java/com/liferay/portal/url/builder/internal/AbsolutePortalURLBuilderImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ public ESModuleAbsolutePortalURLBuilder forESModule(
9696
String webContextPath, String esModulePath) {
9797

9898
return new ESModuleAbsolutePortalURLBuilderImpl(
99-
esModulePath, _getCDNHost(_httpServletRequest), _pathModule,
100-
_pathProxy, webContextPath);
99+
_getCDNHost(_httpServletRequest), esModulePath,
100+
_hashedFilesRegistry, _pathModule, _pathProxy, webContextPath);
101101
}
102102

103103
@Override

modules/apps/portal-url-builder/portal-url-builder-impl/src/main/java/com/liferay/portal/url/builder/internal/ESModuleAbsolutePortalURLBuilderImpl.java

Lines changed: 8 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,68 +5,25 @@
55

66
package com.liferay.portal.url.builder.internal;
77

8-
import com.liferay.petra.string.StringBundler;
9-
import com.liferay.petra.string.StringPool;
8+
import com.liferay.portal.kernel.frontend.hashed.files.HashedFilesRegistry;
109
import com.liferay.portal.url.builder.ESModuleAbsolutePortalURLBuilder;
11-
import com.liferay.portal.url.builder.internal.util.URLUtil;
1210

1311
/**
1412
* @author Iván Zaera Avellón
1513
*/
1614
public class ESModuleAbsolutePortalURLBuilderImpl
15+
extends BaseWebContextResourceAbsolutePortalURLBuilderImpl
16+
<ESModuleAbsolutePortalURLBuilder>
1717
implements ESModuleAbsolutePortalURLBuilder {
1818

1919
public ESModuleAbsolutePortalURLBuilderImpl(
20-
String esModulePath, String cdnHost, String pathModule,
20+
String cdnHost, String esModulePath,
21+
HashedFilesRegistry hashedFilesRegistry, String pathModule,
2122
String pathProxy, String webContextPath) {
2223

23-
if (!esModulePath.startsWith(StringPool.SLASH)) {
24-
esModulePath = StringPool.SLASH + esModulePath;
25-
}
26-
27-
if (!webContextPath.startsWith(StringPool.SLASH)) {
28-
webContextPath = StringPool.SLASH + webContextPath;
29-
}
30-
31-
_esModulePath = esModulePath;
32-
_cdnHost = cdnHost;
33-
_pathModule = pathModule;
34-
_pathProxy = pathProxy;
35-
_webContextPath = webContextPath;
24+
super(
25+
cdnHost, hashedFilesRegistry, pathModule, pathProxy,
26+
"/__liferay__/" + esModulePath, webContextPath);
3627
}
3728

38-
@Override
39-
public String build() {
40-
StringBundler sb = new StringBundler();
41-
42-
URLUtil.appendURL(
43-
sb, _cdnHost, _ignoreCDNHost, _ignorePathProxy,
44-
_pathModule + _webContextPath + "/__liferay__", _pathProxy,
45-
_esModulePath);
46-
47-
return sb.toString();
48-
}
49-
50-
@Override
51-
public ESModuleAbsolutePortalURLBuilder ignoreCDNHost() {
52-
_ignoreCDNHost = true;
53-
54-
return this;
55-
}
56-
57-
@Override
58-
public ESModuleAbsolutePortalURLBuilder ignorePathProxy() {
59-
_ignorePathProxy = true;
60-
61-
return this;
62-
}
63-
64-
private final String _cdnHost;
65-
private final String _esModulePath;
66-
private boolean _ignoreCDNHost;
67-
private boolean _ignorePathProxy;
68-
private final String _pathModule;
69-
private final String _pathProxy;
70-
private final String _webContextPath;
71-
7229
}

0 commit comments

Comments
 (0)