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.5k stars 4.02k forks source link

Repetitive code in the entities.ts file after running the import command multiple times #21050

Closed vw98075 closed 9 months ago

vw98075 commented 1 year ago
Overview of the issue

After reimporting the same JDl file with some changes, the entities.ts file contains repetitive code.

...
  {
      path: '/foo/:foo/view',
      name: 'Foo',
      component: FooDetails,
      meta: { authorities: [Authority.USER] },
    },
...

After running the import command three times in addition to the initial one, the section has four repetitive codes. To my memory, I reported this issue more than a year ago.

After running the tests with

./gradlew test

I get multiple errors with the same complaint:

     [vue-router] Duplicate named routes definition: { name: "foo", path: "/foo" }

      18 |
      19 | // prettier-ignore
    > 20 | const router = new Router({
         |                ^
      21 |   mode: 'history',
      22 |   routes: [
      23 |     {

I think the above is a result of the repetitive code.

Also, while walking through the yo-rc.json file, I notice the two languages are listed although I only select one language. And the app only shows one language too. Only one version of the messages.properties file though.

Motivation for or Use Case
Reproduce the error
Related issues
Suggest a Fix
JHipster Version(s)

7.9.3

JHipster configuration
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "jwt",
    "baseName": "xyz",
    "blueprints": [],
    "buildTool": "gradle",
    "cacheProvider": "caffeine",
    "clientFramework": "vue",
    "clientPackageManager": "npm",
    "clientTheme": "spacelab",
    "clientThemeVariant": "light",
    "creationTimestamp": 1675473958704,
    "cypressAudit": true,
    "cypressCoverage": null,
    "databaseType": "sql",
    "devDatabaseType": "h2Memory",
    "devServerPort": 9060,
    "dtoSuffix": "DTO",
    "enableGradleEnterprise": false,
    "enableHibernateCache": true,
    "enableSwaggerCodegen": false,
    "enableTranslation": false,
    "entities": [
...
    ],
    "entitySuffix": "",
    "jhiPrefix": "jhi",
    "jhipsterVersion": "7.9.3",
    "jwtSecretKey": ...
    "languages": ["en", "fr"],
    "lastLiquibaseTimestamp": 1675711058000,
    "messageBroker": false,
    "microfrontend": false,
    "microfrontends": [],
    "monorepository": true,
    "nativeLanguage": "en",
    "otherModules": [],
    "packageName": "com.abc.xyz",
    "pages": [],
    "prodDatabaseType": "postgresql",
    "reactive": false,
    "searchEngine": false,
    "serverPort": "8080",
    "serverSideOptions": [],
    "serviceDiscoveryType": "no",
    "skipCheckLengthOfIdentifier": false,
    "skipClient": false,
    "skipCommitHook": true,
    "skipFakeData": false,
    "skipUserManagement": false,
    "testFrameworks": ["cypress", "cucumber"],
    "websocket": false,
    "withAdminUi": true
  }
}
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
vw98075 commented 1 year ago

These repetitive entries also are found in the entities.components.ts. When I run the app docker image build, I get the following error.

ERROR in ./src/main/webapp/app/entities/entities.component.ts:43:60 TS2300: Duplicate identifier '...'.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for too long without any activity. Due to the moving nature of jhipster generated application, bugs can become invalid. If this issue still applies please comment otherwise it will be closed in 7 days

mshima commented 9 months ago

The reported problem is about jdl but the jdl with reproduction is missing. Closing.