diff --git a/generators/entity-microfrontend/templates/ui/widgets/entity/detailsWidget/src/components/entity-field-table/EntityFieldTable.js.ejs b/generators/entity-microfrontend/templates/ui/widgets/entity/detailsWidget/src/components/entity-field-table/EntityFieldTable.js.ejs index 598c65d7..aef7ac21 100644 --- a/generators/entity-microfrontend/templates/ui/widgets/entity/detailsWidget/src/components/entity-field-table/EntityFieldTable.js.ejs +++ b/generators/entity-microfrontend/templates/ui/widgets/entity/detailsWidget/src/components/entity-field-table/EntityFieldTable.js.ejs @@ -4,7 +4,7 @@ const fieldType = getJHipsterType(field); switch (fieldType) { case 'Boolean': - return ``; + return ``; case 'LocalDate': return `{${entityInstance}.${field.fieldName} && new Date(${entityInstance}.${field.fieldName}).toLocaleDateString(language)}`; case 'ZonedDateTime': @@ -33,6 +33,10 @@ import Checkbox from '@material-ui/core/Checkbox'; import <%= entityInstance %>Type from 'components/__types__/<%= entityInstance %>'; +<%_ if (fields.find(field => field.fieldType === 'Boolean')) { _%> +const isChecked = booleanField => typeof booleanField !== 'undefined' ? booleanField.valueOf() : false; +<%_ } _%> + const <%= entityClass %>FieldTable = ({ t, <% if (fieldsContainDate) { _%>i18n: { language }, <% } _%><%= entityInstance %> }) => (