fix: bugs on error.ftl template
This commit is contained in:
@ -30,6 +30,7 @@ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc};
|
|||||||
</#attempt>
|
</#attempt>
|
||||||
|
|
||||||
"printIfExists": function (fieldName, x) {
|
"printIfExists": function (fieldName, x) {
|
||||||
|
<#if messagesPerField?? >
|
||||||
<#list fieldNames as fieldName>
|
<#list fieldNames as fieldName>
|
||||||
if(fieldName === "${fieldName}" ){
|
if(fieldName === "${fieldName}" ){
|
||||||
<#attempt>
|
<#attempt>
|
||||||
@ -39,8 +40,12 @@ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc};
|
|||||||
}
|
}
|
||||||
</#list>
|
</#list>
|
||||||
throw new Error("There is no " + fieldName + " field");
|
throw new Error("There is no " + fieldName + " field");
|
||||||
|
<#else>
|
||||||
|
return undefined;
|
||||||
|
</#if>
|
||||||
},
|
},
|
||||||
"existsError": function (fieldName) {
|
"existsError": function (fieldName) {
|
||||||
|
<#if messagesPerField?? >
|
||||||
<#list fieldNames as fieldName>
|
<#list fieldNames as fieldName>
|
||||||
if(fieldName === "${fieldName}" ){
|
if(fieldName === "${fieldName}" ){
|
||||||
<#attempt>
|
<#attempt>
|
||||||
@ -50,8 +55,12 @@ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc};
|
|||||||
}
|
}
|
||||||
</#list>
|
</#list>
|
||||||
throw new Error("There is no " + fieldName + " field");
|
throw new Error("There is no " + fieldName + " field");
|
||||||
|
<#else>
|
||||||
|
return false;
|
||||||
|
</#if>
|
||||||
},
|
},
|
||||||
"get": function (fieldName) {
|
"get": function (fieldName) {
|
||||||
|
<#if messagesPerField?? >
|
||||||
<#list fieldNames as fieldName>
|
<#list fieldNames as fieldName>
|
||||||
if(fieldName === "${fieldName}" ){
|
if(fieldName === "${fieldName}" ){
|
||||||
<#attempt>
|
<#attempt>
|
||||||
@ -63,8 +72,12 @@ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc};
|
|||||||
}
|
}
|
||||||
</#list>
|
</#list>
|
||||||
throw new Error("There is no " + fieldName + " field");
|
throw new Error("There is no " + fieldName + " field");
|
||||||
|
<#else>
|
||||||
|
return '';
|
||||||
|
</#if>
|
||||||
},
|
},
|
||||||
"exists": function (fieldName) {
|
"exists": function (fieldName) {
|
||||||
|
<#if messagesPerField?? >
|
||||||
<#list fieldNames as fieldName>
|
<#list fieldNames as fieldName>
|
||||||
if(fieldName === "${fieldName}" ){
|
if(fieldName === "${fieldName}" ){
|
||||||
<#attempt>
|
<#attempt>
|
||||||
@ -74,6 +87,9 @@ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc};
|
|||||||
}
|
}
|
||||||
</#list>
|
</#list>
|
||||||
throw new Error("There is no " + fieldName + " field");
|
throw new Error("There is no " + fieldName + " field");
|
||||||
|
<#else>
|
||||||
|
return false;
|
||||||
|
</#if>
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -137,6 +153,9 @@ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc};
|
|||||||
key == "identityProviderBrokerCtx" &&
|
key == "identityProviderBrokerCtx" &&
|
||||||
are_same_path(path, []) &&
|
are_same_path(path, []) &&
|
||||||
["login-idp-link-confirm.ftl", "login-idp-link-email.ftl" ]?seq_contains(pageId)
|
["login-idp-link-confirm.ftl", "login-idp-link-email.ftl" ]?seq_contains(pageId)
|
||||||
|
) || (
|
||||||
|
["masterAdminClient", "delegateForUpdate", "defaultRole"]?seq_contains(key) &&
|
||||||
|
are_same_path(path, ["realm"])
|
||||||
)
|
)
|
||||||
>
|
>
|
||||||
<#local out_seq += ["/*If you need '" + key + "' on " + pageId + ", please submit an issue to the Keycloakify repo*/"]>
|
<#local out_seq += ["/*If you need '" + key + "' on " + pageId + ", please submit an issue to the Keycloakify repo*/"]>
|
||||||
|
Reference in New Issue
Block a user