Skip to content

Commit

Permalink
Merge pull request #248 from entando/ENG-4139-fix-duration-uuid-fields
Browse files Browse the repository at this point in the history
ENG-4139 fix Duration and UUID fields from last JHipster's versions
  • Loading branch information
avdev4j authored Jul 13, 2023
2 parents 744135a + c80029b commit aab5316
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
15 changes: 14 additions & 1 deletion generators/entity-microfrontend/lib/jhipster-type.mapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@
*/
function getJHipsterType({ fieldType, fieldIsEnum, fieldTypeBlobContent }) {
if (
['String', 'Integer', 'Long', 'Float', 'Double', 'BigDecimal', 'LocalDate', 'Instant', 'ZonedDateTime', 'Boolean'].includes(fieldType)
[
'String',
'Integer',
'Long',
'Float',
'Double',
'BigDecimal',
'LocalDate',
'Instant',
'ZonedDateTime',
'Boolean',
'Duration',
'UUID',
].includes(fieldType)
) {
return fieldType;
}
Expand Down
2 changes: 2 additions & 0 deletions generators/entity-microfrontend/lib/yup.mapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ function getYupType(field) {
case 'ImageBlob':
case 'BinaryFileBlob':
case 'TextBlob':
case 'UUID':
case 'Duration':
return ['string()'];
default:
return undefined;
Expand Down
1 change: 1 addition & 0 deletions test-integration/samples/.jhipster/BankAccount.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
{ "fieldName": "agencyNumber", "fieldType": "Long" },
{ "fieldName": "lastOperationDuration", "fieldType": "Float" },
{ "fieldName": "meanOperationDuration", "fieldType": "Double" },
{ "fieldName": "operationDuration", "fieldType": "Duration" },
{ "fieldName": "balance", "fieldType": "BigDecimal", "fieldValidateRules": ["required"] },
{ "fieldName": "openingDay", "fieldType": "LocalDate" },
{ "fieldName": "lastOperationDate", "fieldType": "Instant" },
Expand Down
4 changes: 4 additions & 0 deletions test-integration/samples/.jhipster/Operation.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
"fieldName": "amount",
"fieldType": "BigDecimal",
"fieldValidateRules": ["required"]
},
{
"fieldName": "identifier",
"fieldType": "UUID"
}
],
"changelogDate": "20150805125055",
Expand Down

0 comments on commit aab5316

Please sign in to comment.