jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.52k stars 4.02k forks source link

Missing dot in enums translate #17416

Closed M4jor-Tom closed 2 years ago

M4jor-Tom commented 2 years ago
Overview of the issue

On the entity update menu, a fail of translation with option beacons' translate() function result

Motivation for or Use Case

Upon jdl execution, I can't directly show the execution result to my client, I still have to correct a missing dot for enum translation into entities update screens.

Example jdl:

enum MyEnum {  ONE  TWO  THREE  FOUR }

entity MyEntity {  field Double required  myEnum MyEnum required }

Execute the jdl into a monolithic react project as the pasted "jhipster info" result down there

The frontend after "jhipster jdl jhipster-jdl.jdl": -> In "my-entity-update.tsx"

<option value={myEnum} key={myEnum}>  {translate('myApp.MyEnum[MISSING DOT]' + myEnum)} </option>

Related issues

None found

Suggest a Fix

It's, I think, in the frontend phase of the jdl execution.

JHipster Version(s)

Jhipster 7.3.1

JHipster configuration
.yo-rc.json file
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "baseName": "LappLi",
    "jhipsterVersion": "7.3.1",
    "skipClient": false,
    "skipServer": false,
    "skipUserManagement": false,
    "skipCheckLengthOfIdentifier": false,
    "skipFakeData": false,
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "testFrameworks": [],
    "blueprints": [],
    "otherModules": [],
    "pages": [],
    "creationTimestamp": 1637698315578,
    "serviceDiscoveryType": "no",
    "reactive": false,
    "authenticationType": "jwt",
    "packageName": "com.muller.lappli",
    "serverPort": "8080",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "mysql",
    "buildTool": "maven",
    "serverSideOptions": [],
    "websocket": false,
    "searchEngine": false,
    "messageBroker": false,
    "enableSwaggerCodegen": false,
    "clientFramework": "react",
    "withAdminUi": true,
    "clientTheme": "none",
    "enableTranslation": true,
    "nativeLanguage": "en",
    "jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "devServerPort": 9060,
    "clientPackageManager": "npm",
    "clientThemeVariant": "",
    "languages": ["en", "fr", "de"],
    "enableGradleEnterprise": false,
    "entities": [
      "Element",
      "ElementKind",
      "Copper",
      "Material",
      "ElementSupply",
      "Lifter",
      "LifterRunMeasure",
      "BangleSupply",
      "Bangle",
      "ElementKindEdition",
      "MaterialMarkingStatistic",
      "CustomComponentSupply",
      "CustomComponent",
      "Strand",
      "OneStudySupply",
      "Study",
      "StrandSupply",
      "UserData",
      "CentralAssembly",
      "CoreAssembly",
      "IntersticeAssembly"
    ],
    "lastLiquibaseTimestamp": 1640254762000
  }
}

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
entity Element {
  number Long unique required
  color Color required
}
entity ElementKind {
  designation String unique required
  gramPerMeterLinearMass Double required
  milimeterDiameter Double required
  insulationThickness Double required
}
entity Copper {
  number Long unique required
  designation String unique required
}
entity Material {
  number Long unique required
  designation String unique required
}
entity ElementSupply {
  apparitions Long required
  markingType MarkingType required
  description String
}
entity Lifter {
  index Long unique required
  minimumMilimeterDiameter Double required
  maximumMilimeterDiameter Double required
  supportsSpirallyColoredMarkingType Boolean required
  supportsLongitudinallyColoredMarkingType Boolean required
  supportsNumberedMarkingType Boolean required
  supportsInkJetMarkingTechnique Boolean required
  supportsRsdMarkingTechnique Boolean required
}
entity LifterRunMeasure {
  milimeterDiameter Double
  meterPerSecondSpeed Double
  markingType MarkingType required
  markingTechnique MarkingTechnique required
  hourPreparationTime Double
}
entity BangleSupply {
  apparitions Long required
  description String
}
entity Bangle {
  number Long unique required
  designation String unique required
  gramPerMeterLinearMass Double required
  milimeterDiameter Double required
}
entity ElementKindEdition {
  editionDateTime Instant required
  newGramPerMeterLinearMass Double
  newMilimeterDiameter Double
  newInsulationThickness Double
}
entity MaterialMarkingStatistic {
  markingType MarkingType required
  markingTechnique MarkingTechnique required
  meterPerHourSpeed Long required
}
entity CustomComponentSupply {
  apparitions Long required
  description String
  markingType MarkingType required
}
entity CustomComponent {
  number Long
  designation String
  gramPerMeterLinearMass Double required
  milimeterDiameter Double required
  surfaceColor Color required
}
entity Strand
entity OneStudySupply {
  apparitions Long
  number Long
  designation String
  description String
  markingType MarkingType required
  gramPerMeterLinearMass Double required
  milimeterDiameter Double required
  surfaceColor Color required
}
entity Study {
  number Long
  lastEditionInstant Instant required
}
entity StrandSupply {
  apparitions Long required
  markingType MarkingType required
  description String
}
entity UserData
entity CentralAssembly {
  productionStep Long required
}
entity CoreAssembly {
  productionStep Long required
  assemblyStep Double required
  assemblyMean AssemblyMean required
}
entity IntersticeAssembly {
  productionStep Long required
}
enum Color {
  NATURAL,
  WHITE,
  BROWN,
  GREEN,
  YELLOW,
  GREY,
  PINK,
  BLUE,
  RED,
  BLACK,
  PURPLE,
  PINK_GREY,
  RED_BLUE,
  WHITE_GREEN,
  BROWN_GREEN,
  WHITE_YELLOW,
  YELLOW_BROWN,
  WHITE_GREY,
  GREY_BROWN,
  WHITE_PINK,
  PINK_BROWN,
  WHITE_BLUE,
  BROWN_BLUE,
  WHITE_RED,
  BROWN_RED,
  WHITE_BLACK,
  BROWN_BLACK,
  GREY_GREEN,
  YELLOW_GREY,
  PINK_GREEN,
  YELLOW_PINK,
  GREEN_BLUE,
  YELLOW_BLUE,
  GREEN_RED,
  YELLOW_RED,
  GREEN_BLACK,
  YELLOW_BLACK,
  GREY_BLUE,
  PINK_BLUE,
  GREY_RED,
  PINK_RED,
  GREY_BLACK,
  PINK_BLACK,
  BLUE_BLACK,
  RED_BLACK,
  WHITE_BROWN_BLACK,
  YELLOW_GREEN_BLACK,
  GREY_PINK_BLACK,
  RED_BLUE_BLACK,
  WHITE_GREEN_BLACK,
  BROWN_GREEN_BLACK,
  WHITE_YELLOW_BLACK,
  YELLOW_BROWN_BLACK,
  WHITE_GREY_BLACK,
  GREY_BROWN_BLACK,
  WHITE_PINK_BLACK,
  PINK_BROWN_BLACK,
  WHITE_BLUE_BLACK,
  BROWN_BLUE_BLACK,
  WHITE_RED_BLACK,
  BROWN_RED_BLACK,
  BLACK_WHITE
}
enum MarkingType {
  LIFTING,
  SPIRALLY_COLORED,
  LONGITUDINALLY_COLORED,
  RINGY_COLORED,
  NUMBERED
}
enum MarkingTechnique {
  NONE,
  NONE_SUITABLE,
  INK_JET,
  RSD
}
enum AssemblyMean {
  RIGHT,
  LEFT,
  STRAIGHT
}

relationship OneToOne {
  UserData{user(login) required} to User
  CentralAssembly{strand(designation) required} to Strand{centralAssembly(productionStep)}
}
relationship OneToMany {
  Strand{elementSupplies(designation)} to ElementSupply{strand(designation) required}
  Strand{bangleSupplies(designation)} to BangleSupply{strand(designation) required}
  Material{materialMarkingStatistics(markingType)} to MaterialMarkingStatistic{material(designation) required}
  Strand{customComponentSupplies(designation)} to CustomComponentSupply{strand(designation) required}
  Strand{oneStudySupplies(designation)} to OneStudySupply{strand(designation) required}
  UserData{studies(number)} to Study{author(login) required}
  Study{strandSupplies(designation)} to StrandSupply{study(number) required}
  Strand{coreAssemblies(productionStep)} to CoreAssembly{strand(designation) required}
  Strand{intersticialAssemblies(productionStep)} to IntersticeAssembly{strand(designation) required}
}
relationship ManyToOne {
  Element{elementKind(designation) required} to ElementKind
  ElementKind{copper(designation) required} to Copper
  ElementKind{insulationMaterial(designation) required} to Material
  ElementSupply{element(designationWithColor) required} to Element
  LifterRunMeasure{lifter(name) required} to Lifter
  BangleSupply{bangle(designation) required} to Bangle
  Bangle{material(designation) required} to Material
  ElementKindEdition{editedElementKind(designation) required} to ElementKind
  CustomComponentSupply{customComponent(designation) required} to CustomComponent
  CustomComponent{surfaceMaterial(designation) required} to Material
  OneStudySupply{surfaceMaterial(designation) required} to Material
  StrandSupply{strand(designation) required} to Strand
}

service Element, ElementKind, Copper, Material, ElementSupply, Lifter, LifterRunMeasure, BangleSupply, Bangle, ElementKindEdition, MaterialMarkingStatistic, CustomComponentSupply, CustomComponent, Strand, OneStudySupply, Study, StrandSupply, UserData, CentralAssembly, CoreAssembly, IntersticeAssembly with serviceImpl
filter Copper, Material, Lifter, Bangle, ElementKindEdition, MaterialMarkingStatistic, CustomComponent, Strand, OneStudySupply, Study, StrandSupply, UserData, CentralAssembly, CoreAssembly, IntersticeAssembly

Environment and Tools

java version "16.0.1" 2021-04-20 Java(TM) SE Runtime Environment (build 16.0.1+9-24) Java HotSpot(TM) 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)

git version 2.24.1.windows.2

node: v14.17.6

npm: 6.14.15

Docker version 20.10.10, build b485636

docker-compose version 1.29.2, build 5becea4c

Entity configuration(s) entityName.json files generated in the .jhipster directory

"markingType.json" in my project:

{  "lappLiApp": {   "MarkingType": {    "null": "",    "LIFTING": "LIFTING",    "SPIRALLY_COLORED": "SPIRALLY_COLORED",    "LONGITUDINALLY_COLORED": "LONGITUDINALLY_COLORED",    "RINGY_COLORED": "RINGY_COLORED",    "NUMBERED": "NUMBERED"   }  } }

*This file is good, its usage is bad in some cases

Browsers and Operating System

Windows 10, Google Chrome

mshima commented 2 years ago

Should be fixed at >v7.4.0. See https://github.com/jhipster/generator-jhipster/commit/6351d3fe92fa4df9b0f26f33077965600bee2bf0#diff-11dabdbc0777dcd283b76eea684f0d6eb03dd6a00383bdb2b304589d85e9e7ea

M4jor-Tom commented 2 years ago

Thanks !