KEYCLOAK-14163 Common resources are not loaded from common path

This commit is contained in:
stianst 2020-05-13 20:14:25 +02:00 committed by Stian Thorgersen
parent 87dd143452
commit d99d65eb92
24 changed files with 85 additions and 55 deletions

View file

@ -95,4 +95,8 @@ public class UrlBean {
return uri.getPath() + "/" + theme.getType().toString().toLowerCase() +"/" + theme.getName();
}
public String getResourcesCommonPath() {
URI uri = Urls.themeRoot(baseURI);
return uri.getPath() + "/common/keycloak";
}
}

View file

@ -109,4 +109,9 @@ public class UrlBean {
URI uri = Urls.themeRoot(baseURI);
return uri.getPath() + "/" + theme.getType().toString().toLowerCase() +"/" + theme.getName();
}
public String getResourcesCommonPath() {
URI uri = Urls.themeRoot(baseURI);
return uri.getPath() + "/common/keycloak";
}
}

View file

@ -183,6 +183,7 @@ public class WelcomeResource {
map.put("adminUrl", session.getContext().getUri(UrlType.ADMIN).getBaseUriBuilder().path("/admin/").build());
map.put("resourcesPath", "resources/" + Version.RESOURCES_VERSION + "/" + theme.getType().toString().toLowerCase() +"/" + theme.getName());
map.put("resourcesCommonPath", "resources/" + Version.RESOURCES_VERSION + "/common/keycloak");
boolean bootstrap = shouldBootstrap();
map.put("bootstrap", bootstrap);

View file

@ -298,6 +298,7 @@ public class AdminConsole {
map.put("authUrl", adminBaseUrl);
map.put("consoleBaseUrl", Urls.adminConsoleRoot(adminBaseUri, realm.getName()).getPath());
map.put("resourceUrl", Urls.themeRoot(adminBaseUri).getPath() + "/admin/" + theme.getName());
map.put("resourceCommonUrl", Urls.themeRoot(adminBaseUri).getPath() + "/common/keycloak");
map.put("masterRealm", Config.getAdminRealm());
map.put("resourceVersion", Version.RESOURCES_VERSION);
map.put("properties", theme.getProperties());

View file

@ -1,4 +1,4 @@
parent=keycloak
import=common/rh-sso
styles=node_modules/rcue/dist/css/rcue.min.css node_modules/rcue/dist/css/rcue-additions.min.css css/account.css
styles=css/account.css
stylesCommon=node_modules/rcue/dist/css/rcue.min.css node_modules/rcue/dist/css/rcue-additions.min.css

View file

@ -1,3 +1,4 @@
parent=keycloak
import=common/rh-sso
styles=node_modules/rcue/dist/css/rcue.min.css node_modules/rcue/dist/css/rcue-additions.min.css node_modules/select2/select2.css css/styles.css lib/angular/treeview/css/angular.treeview.css node_modules/text-security/text-security.css
styles=css/styles.css
stylesCommon=node_modules/rcue/dist/css/rcue.min.css node_modules/rcue/dist/css/rcue-additions.min.css node_modules/select2/select2.css lib/angular/treeview/css/angular.treeview.css node_modules/text-security/text-security.css

View file

@ -1,4 +1,4 @@
parent=keycloak
import=common/rh-sso
styles=node_modules/rcue/dist/css/rcue.min.css node_modules/rcue/dist/css/rcue-additions.min.css lib/zocial/zocial.css css/login.css css/login-rhsso.css
styles=css/login.css css/login-rhsso.css
stylesCommon=node_modules/rcue/dist/css/rcue.min.css node_modules/rcue/dist/css/rcue-additions.min.css lib/zocial/zocial.css

View file

@ -1,7 +1,7 @@
parent=keycloak
import=common/rh-sso
styles=node_modules/rcue/dist/css/rcue.min.css node_modules/rcue/dist/css/rcue-additions.min.css css/welcome.css css/welcome-rhsso.css
styles=css/welcome.css css/welcome-rhsso.css
stylesCommon=node_modules/rcue/dist/css/rcue.min.css node_modules/rcue/dist/css/rcue-additions.min.css
documentationUrl=https://access.redhat.com/documentation/en/red-hat-single-sign-on/
displayCommunityLinks=false

View file

@ -7,7 +7,12 @@
<meta name="robots" content="noindex, nofollow">
<title>${msg("accountManagementTitle")}</title>
<link rel="icon" href="${url.resourcesPath}/img/favicon.ico">
<link rel="icon" href="${url.resourcesCommonPath}/img/favicon.ico">
<#if properties.stylesCommon?has_content>
<#list properties.stylesCommon?split(' ') as style>
<link href="${url.resourcesCommonPath}/${style}" rel="stylesheet" />
</#list>
</#if>
<#if properties.styles?has_content>
<#list properties.styles?split(' ') as style>
<link href="${url.resourcesPath}/${style}" rel="stylesheet" />

View file

@ -8,8 +8,11 @@
<meta name="robots" content="noindex, nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="${resourceUrl}/img/favicon.ico">
<#if properties.styles?has_content>
<link rel="shortcut icon" href="${resourceCommonUrl}/img/favicon.ico">
<#if properties.stylesCommon?has_content>
<#list properties.stylesCommon?split(' ') as style>
<link href="${resourceCommonUrl}/${style}" rel="stylesheet" />
</#list>
<#list properties.styles?split(' ') as style>
<link href="${resourceUrl}/${style}" rel="stylesheet" />
</#list>
@ -25,40 +28,40 @@
</script>
<!-- Minimized versions (for those that have one) -->
<script src="${resourceUrl}/node_modules/jquery/dist/jquery.min.js" type="text/javascript"></script>
<script src="${resourceUrl}/node_modules/select2/select2.js" type="text/javascript"></script>
<script src="${resourceUrl}/node_modules/angular/angular.min.js"></script>
<script src="${resourceUrl}/node_modules/angular-resource/angular-resource.min.js"></script>
<script src="${resourceUrl}/node_modules/angular-route/angular-route.min.js"></script>
<script src="${resourceUrl}/node_modules/angular-cookies/angular-cookies.min.js"></script>
<script src="${resourceUrl}/node_modules/angular-sanitize/angular-sanitize.min.js"></script>
<script src="${resourceUrl}/node_modules/angular-translate/dist/angular-translate.min.js"></script>
<script src="${resourceUrl}/node_modules/angular-translate-loader-url/angular-translate-loader-url.min.js"></script>
<script src="${resourceUrl}/node_modules/angular-ui-select2/src/select2.js" type="text/javascript"></script>
<script src="${resourceUrl}/node_modules/autofill-event/autofill-event.js"></script>
<script src="${resourceCommonUrl}/node_modules/jquery/dist/jquery.min.js" type="text/javascript"></script>
<script src="${resourceCommonUrl}/node_modules/select2/select2.js" type="text/javascript"></script>
<script src="${resourceCommonUrl}/node_modules/angular/angular.min.js"></script>
<script src="${resourceCommonUrl}/node_modules/angular-resource/angular-resource.min.js"></script>
<script src="${resourceCommonUrl}/node_modules/angular-route/angular-route.min.js"></script>
<script src="${resourceCommonUrl}/node_modules/angular-cookies/angular-cookies.min.js"></script>
<script src="${resourceCommonUrl}/node_modules/angular-sanitize/angular-sanitize.min.js"></script>
<script src="${resourceCommonUrl}/node_modules/angular-translate/dist/angular-translate.min.js"></script>
<script src="${resourceCommonUrl}/node_modules/angular-translate-loader-url/angular-translate-loader-url.min.js"></script>
<script src="${resourceCommonUrl}/node_modules/angular-ui-select2/src/select2.js" type="text/javascript"></script>
<script src="${resourceCommonUrl}/node_modules/autofill-event/autofill-event.js"></script>
<!-- Unminimized versions
<script src="${resourceUrl}/node_modules/jquery/dist/jquery.js" type="text/javascript"></script>
<script src="${resourceUrl}/node_modules/select2/select2.js" type="text/javascript"></script>
<script src="${resourceUrl}/node_modules/angular/angular.js"></script>
<script src="${resourceUrl}/node_modules/angular-resource/angular-resource.js"></script>
<script src="${resourceUrl}/node_modules/angular-route/angular-route.js"></script>
<script src="${resourceUrl}/node_modules/angular-cookies/angular-cookies.js"></script>
<script src="${resourceUrl}/node_modules/angular-sanitize/angular-sanitize.js"></script>
<script src="${resourceUrl}/node_modules/angular-translate/dist/angular-translate.js"></script>
<script src="${resourceUrl}/node_modules/angular-translate-loader-url/angular-translate-loader-url.js"></script>
<script src="${resourceUrl}/node_modules/angular-ui-select2/src/select2.js" type="text/javascript"></script>
<script src="${resourceUrl}/node_modules/autofill-event/autofill-event.js"></script>
<script src="${resourceCommonUrl}/node_modules/jquery/dist/jquery.js" type="text/javascript"></script>
<script src="${resourceCommonUrl}/node_modules/select2/select2.js" type="text/javascript"></script>
<script src="${resourceCommonUrl}/node_modules/angular/angular.js"></script>
<script src="${resourceCommonUrl}/node_modules/angular-resource/angular-resource.js"></script>
<script src="${resourceCommonUrl}/node_modules/angular-route/angular-route.js"></script>
<script src="${resourceCommonUrl}/node_modules/angular-cookies/angular-cookies.js"></script>
<script src="${resourceCommonUrl}/node_modules/angular-sanitize/angular-sanitize.js"></script>
<script src="${resourceCommonUrl}/node_modules/angular-translate/dist/angular-translate.js"></script>
<script src="${resourceCommonUrl}/node_modules/angular-translate-loader-url/angular-translate-loader-url.js"></script>
<script src="${resourceCommonUrl}/node_modules/angular-ui-select2/src/select2.js" type="text/javascript"></script>
<script src="${resourceCommonUrl}/node_modules/autofill-event/autofill-event.js"></script>
-->
<!-- Libraries not managed by yarn -->
<script src="${resourceUrl}/lib/angular/ui-bootstrap-tpls-0.11.0.js"></script>
<script src="${resourceUrl}/lib/angular/treeview/angular.treeview.js"></script>
<script src="${resourceUrl}/lib/fileupload/angular-file-upload.min.js"></script>
<script src="${resourceUrl}/lib/filesaver/FileSaver.js"></script>
<script src="${resourceUrl}/lib/ui-ace/min/ace.js"></script>
<script src="${resourceUrl}/lib/ui-ace/ui-ace.min.js"></script>
<script src="${resourceCommonUrl}/lib/angular/ui-bootstrap-tpls-0.11.0.js"></script>
<script src="${resourceCommonUrl}/lib/angular/treeview/angular.treeview.js"></script>
<script src="${resourceCommonUrl}/lib/fileupload/angular-file-upload.min.js"></script>
<script src="${resourceCommonUrl}/lib/filesaver/FileSaver.js"></script>
<script src="${resourceCommonUrl}/lib/ui-ace/min/ace.js"></script>
<script src="${resourceCommonUrl}/lib/ui-ace/ui-ace.min.js"></script>
<script src="${authUrl}/js/keycloak.js?version=${resourceVersion}" type="text/javascript"></script>

View file

@ -1 +0,0 @@
import=common/keycloak

View file

@ -47,7 +47,7 @@
</div>
</div>
</form>
<script type="text/javascript" src="${url.resourcesPath}/node_modules/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="${url.resourcesCommonPath}/node_modules/jquery/dist/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
// Card Single Select

View file

@ -13,7 +13,12 @@
</#list>
</#if>
<title>${msg("loginTitle",(realm.displayName!''))}</title>
<link rel="icon" href="${url.resourcesPath}/img/favicon.ico" />
<link rel="icon" href="${url.resourcesCommonPath}/img/favicon.ico" />
<#if properties.stylesCommon?has_content>
<#list properties.stylesCommon?split(' ') as style>
<link href="${url.resourcesCommonPath}/${style}" rel="stylesheet" />
</#list>
</#if>
<#if properties.styles?has_content>
<#list properties.styles?split(' ') as style>
<link href="${url.resourcesPath}/${style}" rel="stylesheet" />

View file

@ -25,8 +25,8 @@
</form>
</#if>
<script type="text/javascript" src="${url.resourcesPath}/node_modules/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="${url.resourcesPath}/js/base64url.js"></script>
<script type="text/javascript" src="${url.resourcesCommonPath}/node_modules/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="${url.resourcesCommonPath}/js/base64url.js"></script>
<script type="text/javascript">
window.onload = () => {

View file

@ -17,8 +17,8 @@
</div>
</form>
<script type="text/javascript" src="${url.resourcesPath}/node_modules/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="${url.resourcesPath}/js/base64url.js"></script>
<script type="text/javascript" src="${url.resourcesCommonPath}/node_modules/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="${url.resourcesCommonPath}/js/base64url.js"></script>
<script type="text/javascript">
function registerSecurityKey() {

View file

@ -1,7 +1,7 @@
parent=base
import=common/keycloak
styles=node_modules/patternfly/dist/css/patternfly.min.css node_modules/patternfly/dist/css/patternfly-additions.min.css css/account.css
styles=css/account.css
stylesCommon=node_modules/patternfly/dist/css/patternfly.min.css node_modules/patternfly/dist/css/patternfly-additions.min.css
##### css classes for form buttons
# main class used for all buttons

Binary file not shown.

Before

Width:  |  Height:  |  Size: 627 B

View file

@ -1,2 +1,3 @@
parent=base
styles=node_modules/patternfly/dist/css/patternfly.min.css node_modules/patternfly/dist/css/patternfly-additions.min.css node_modules/select2/select2.css css/styles.css lib/angular/treeview/css/angular.treeview.css node_modules/text-security/text-security.css
styles=css/styles.css
stylesCommon=node_modules/patternfly/dist/css/patternfly.min.css node_modules/patternfly/dist/css/patternfly-additions.min.css node_modules/select2/select2.css lib/angular/treeview/css/angular.treeview.css node_modules/text-security/text-security.css

Binary file not shown.

Before

Width:  |  Height:  |  Size: 627 B

View file

@ -1,7 +1,8 @@
parent=base
import=common/keycloak
styles=node_modules/patternfly/dist/css/patternfly.min.css node_modules/patternfly/dist/css/patternfly-additions.min.css lib/zocial/zocial.css css/login.css
styles=css/login.css
stylesCommon=node_modules/patternfly/dist/css/patternfly.min.css node_modules/patternfly/dist/css/patternfly-additions.min.css lib/zocial/zocial.css
meta=viewport==width=device-width,initial-scale=1
kcHtmlClass=login-pf

View file

@ -29,8 +29,13 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="noindex, nofollow">
<link rel="shortcut icon" href="welcome-content/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="${resourcesCommonPath}/img/favicon.ico" />
<#if properties.stylesCommon?has_content>
<#list properties.stylesCommon?split(' ') as style>
<link href="${resourcesCommonPath}/${style}" rel="stylesheet" />
</#list>
</#if>
<#if properties.styles?has_content>
<#list properties.styles?split(' ') as style>
<link href="${resourcesPath}/${style}" rel="stylesheet" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 627 B

View file

@ -1,6 +1,5 @@
import=common/keycloak
styles=node_modules/patternfly/dist/css/patternfly.css node_modules/patternfly/dist/css/patternfly-additions.css css/welcome.css
styles=css/welcome.css
stylesCommon=node_modules/patternfly/dist/css/patternfly.css node_modules/patternfly/dist/css/patternfly-additions.css
documentationUrl=https://www.keycloak.org/documentation.html
displayCommunityLinks=true