jhipster / generator-jhipster-micronaut

Micronaut blueprint for JHipster
Apache License 2.0
100 stars 29 forks source link

"skipUserManagement" option is not working #214

Open CoderYellow opened 3 years ago

CoderYellow commented 3 years ago
Overview of the issue

Support for skipUserManagement option

Reproduce the error
mhipster jdl  --skip-user-management  --inline \
"application {
  config {
    applicationType monolith
    authenticationType jwt
    baseName test
    blueprints [generator-jhipster-micronaut]
    skipUserManagement true
  }
  entities BankAccount,User
}

entity User {
    name String
}

entity BankAccount {
  name String required,
  balance BigDecimal required
}

relationship OneToMany {
  User to BankAccount
}

paginate Operation with infinite-scroll"

error:

Error: Relationships from the User entity is not supported in the declaration between 'User' and 'BankAccount'. You can have this by using the 'skipUserManagement' option.
Error while parsing applications and entities from the JDL Error: Relationships from the User entity is not supported in the declaration between 'User' and 'BankAccount'. You can have this by using the 'skipUserManagement' option.
Error: Relationships from the User entity is not supported in the declaration between 'User' and 'BankAccount'. You can have this by using the 'skipUserManagement' option.
    at checkForForbiddenUseOfUserAsSource (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/jhipster-core/lib/validators/relationship_validator.js:89:11)
    at checkForInvalidUseOfTheUserEntity (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/jhipster-core/lib/validators/relationship_validator.js:83:3)
    at RelationshipValidator.validate (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/jhipster-core/lib/validators/relationship_validator.js:37:5)
    at /home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/jhipster-core/lib/validators/business_error_checker.js:158:17
    at /home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/jhipster-core/lib/core/jdl_object.js:202:7
    at /home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/jhipster-core/lib/core/jdl_relationships.js:90:7
    at Array.forEach (<anonymous>)
    at JDLRelationships.forEach (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/jhipster-core/lib/core/jdl_relationships.js:89:20)
    at JDLObject.forEachRelationship (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/jhipster-core/lib/core/jdl_object.js:201:24)
    at BusinessErrorChecker.checkForRelationshipErrors (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/jhipster-core/lib/validators/business_error_checker.js:157:20)
Error during import-jdl: Relationships from the User entity is not supported in the declaration between 'User' and 'BankAccount'. You can have this by using the 'skipUserManagement' option.
Error: Relationships from the User entity is not supported in the declaration between 'User' and 'BankAccount'. You can have this by using the 'skipUserManagement' option.
    at checkForForbiddenUseOfUserAsSource (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/jhipster-core/lib/validators/relationship_validator.js:89:11)
    at checkForInvalidUseOfTheUserEntity (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/jhipster-core/lib/validators/relationship_validator.js:83:3)
    at RelationshipValidator.validate (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/jhipster-core/lib/validators/relationship_validator.js:37:5)
    at /home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/jhipster-core/lib/validators/business_error_checker.js:158:17
    at /home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/jhipster-core/lib/core/jdl_object.js:202:7
    at /home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/jhipster-core/lib/core/jdl_relationships.js:90:7
    at Array.forEach (<anonymous>)
    at JDLRelationships.forEach (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/jhipster-core/lib/core/jdl_relationships.js:89:20)
    at JDLObject.forEachRelationship (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/jhipster-core/lib/core/jdl_object.js:201:24)
    at BusinessErrorChecker.checkForRelationshipErrors (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/jhipster-core/lib/validators/business_error_checker.js:157:20)
Error: Error during import-jdl: Relationships from the User entity is not supported in the declaration between 'User' and 'BankAccount'. You can have this by using the 'skipUserManagement' option.
    at module.exports (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/generator-jhipster/cli/import-jdl.js:428:31)
    at module.exports (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/generator-jhipster/cli/jdl.js:70:16)
    at Command.<anonymous> (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/generator-jhipster/cli/cli.js:174:36)
    at Command.listener [as _actionHandler] (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/generator-jhipster/node_modules/commander/index.js:413:31)
    at Command._parseCommand (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/generator-jhipster/node_modules/commander/index.js:914:14)
    at Command._dispatchSubcommand (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/generator-jhipster/node_modules/commander/index.js:865:18)
    at Command._parseCommand (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/generator-jhipster/node_modules/commander/index.js:882:12)
    at Command.parse (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/generator-jhipster/node_modules/commander/index.js:717:10)
    at Object.<anonymous> (/home/coder/.nvm/versions/node/v14.15.1/lib/node_modules/generator-jhipster-micronaut/node_modules/generator-jhipster/cli/cli.js:195:9)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
Related issues
Suggest a Fix

jhispter-core

    const skippedUserManagement =
      this.applicationSettings.skippedUserManagement ||
      this.jdlObject.getOptionsForName(OptionNames.SKIP_USER_MANAGEMENT)[0];

this.applicationSettings.skippedUserManagement being undefined is releated to generator-jhipster and here It seems that skipUserManagement is not the jdl scope option.

Project configuration
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
JasonTypesCodes commented 3 years ago

Need to dig into this a bit, but I'm not aware of us changing the way that option is parsed from the jdl. It could be that this is an issue with the upstream generator