fmt (changelog ignore)

This commit is contained in:
garronej
2021-10-11 04:06:59 +02:00
parent bd403beb5c
commit 4ad3affadb

View File

@ -138,59 +138,59 @@
<#assign fieldNames = ["global", "userLabel", "username", "email", "firstName", "lastName", "password", "password-confirm"]> <#assign fieldNames = ["global", "userLabel", "username", "email", "firstName", "lastName", "password", "password-confirm"]>
<#attempt> <#attempt>
<#list profile.attributes as attribute> <#list profile.attributes as attribute>
<#assign fieldNames += [attribute.name]> <#assign fieldNames += [attribute.name]>
</#list> </#list>
<#recover> <#recover>
</#attempt> </#attempt>
"printIfExists": function (fieldName, x) { "printIfExists": function (fieldName, x) {
<#list fieldNames as fieldName> <#list fieldNames as fieldName>
if(fieldName === "${fieldName}" ){ if(fieldName === "${fieldName}" ){
<#attempt> <#attempt>
return "${messagesPerField.printIfExists(fieldName,'1')}" ? x : undefined; return "${messagesPerField.printIfExists(fieldName,'1')}" ? x : undefined;
<#recover> <#recover>
</#attempt> </#attempt>
} }
</#list> </#list>
throw new Error("There is no " + fieldName " field"); throw new Error("There is no " + fieldName " field");
}, },
"existsError": function (fieldName) { "existsError": function (fieldName) {
<#list fieldNames as fieldName> <#list fieldNames as fieldName>
if(fieldName === "${fieldName}" ){ if(fieldName === "${fieldName}" ){
<#attempt> <#attempt>
return <#if messagesPerField.existsError('${fieldName}')>true<#else>false</#if>; return <#if messagesPerField.existsError('${fieldName}')>true<#else>false</#if>;
<#recover> <#recover>
</#attempt> </#attempt>
} }
</#list> </#list>
throw new Error("There is no " + fieldName " field"); throw new Error("There is no " + fieldName " field");
}, },
"get": function (fieldName) { "get": function (fieldName) {
<#list fieldNames as fieldName> <#list fieldNames as fieldName>
if(fieldName === "${fieldName}" ){ if(fieldName === "${fieldName}" ){
<#attempt> <#attempt>
<#if messagesPerField.existsError('${fieldName}')> <#if messagesPerField.existsError('${fieldName}')>
if(fieldName === "${fieldName}" ){ if(fieldName === "${fieldName}" ){
return "${messagesPerField.get('${fieldName}')?no_esc}"; return "${messagesPerField.get('${fieldName}')?no_esc}";
} }
</#if> </#if>
<#recover> <#recover>
</#attempt> </#attempt>
} }
</#list> </#list>
throw new Error("There is no " + fieldName " field"); throw new Error("There is no " + fieldName " field");
}, },
"exists": function (fieldName) { "exists": function (fieldName) {
<#list fieldNames as fieldName> <#list fieldNames as fieldName>
if(fieldName === "${fieldName}" ){ if(fieldName === "${fieldName}" ){
<#attempt> <#attempt>
return <#if messagesPerField.exists('${fieldName}')>true<#else>false</#if>; return <#if messagesPerField.exists('${fieldName}')>true<#else>false</#if>;
<#recover> <#recover>
</#attempt> </#attempt>
} }
</#list> </#list>
throw new Error("There is no " + fieldName " field"); throw new Error("There is no " + fieldName " field");
} }
}, },
"msg": function(){ throw new Error("use import { useKcMessage } from 'keycloakify'"); }, "msg": function(){ throw new Error("use import { useKcMessage } from 'keycloakify'"); },