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

[React] Error during entity deletion process #24115

Closed nicolas63 closed 11 months ago

nicolas63 commented 11 months ago
Overview of the issue

Since the update from JHipster v8.0.0-rc.1 to JHipster 8.0.0 on the dotnet blueprint, I've encountered an error in the e2e tests.

My entity is failing during the deletion process, and I believe it's due to this modification. I have retried with the old code, and it works well

Reproduce the error

I'm not sure why only this entity is experiencing the problem

Suggest a Fix
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "namespace": "JhipsterSampleApplication",
    "databaseType": "sql",
    "prodDatabaseType": "mysql",
    "authenticationType": "jwt",
    "serverPort": "5000",
    "jhipsterVersion": "7.9.3",
    "applicationType": "monolith",
    "baseName": "JhipsterSampleApplication",
    "useSass": true,
    "clientPackageManager": "npm",
    "clientFramework": "react",
    "clientTheme": "none",
    "clientThemeVariant": "",
    "creationTimestamp": 1587112984699,
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "testFrameworks": ["cypress"],
    "enableTranslation": false
  },
  "generator-jhipster-dotnetcore": {
    "ciType": "Github"
  }
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions

entity Region {
    regionName String
}

entity Country {
    countryName String
}

// an ignored comment
/** not an ignored comment */
entity Location {
    streetAddress String,
    postalCode String,
    city String,
    stateProvince String
}

entity Department {
    departmentName String required
}

/**
 * PieceOfWork entity.
 * @author The JHipster team.
 */
entity PieceOfWork {
    title String,
    description String
}

/**
 * The Employee entity.
 */
entity Employee {
    /**
    * The firstname attribute.
    */
    firstName String,
    lastName String,
    email String,
    phoneNumber String,
    hireDate Instant,
    salary Long,
    commissionPct Long
}

entity Job {
    jobTitle String,
    minSalary Long,
    maxSalary Long
}

entity JobHistory {
    startDate Instant,
    endDate Instant,
    language Language
}

enum Language {
    FRENCH, ENGLISH, SPANISH
}

relationship OneToOne {
    Country{region} to Region
}

relationship OneToOne {
    Location{country} to Country
}

relationship OneToOne {
    Department{location} to Location
}

// defining multiple OneToMany relationships with comments
relationship OneToMany {
    Employee to Job{employee},
    /**
    * A relationship
    */
    Department to
    /**
    * Another side of the same relationship
    */
    Employee{department}
}

relationship ManyToOne {
    Employee{manager} to Employee
}

// defining multiple oneToOne relationships
relationship OneToOne {
    JobHistory{job} to Job,
    JobHistory{department} to Department,
    JobHistory{employee} to Employee
}

relationship ManyToMany {
    Job{chore(title)} to PieceOfWork{job}
}

// Set pagination options
// .Net does not generates link header for pagination.
// paginate JobHistory, Employee with infinite-scroll
// paginate Job with pagination

// Use Data Transfert Objects (DTO)
dto * with mapstruct

// Set service options to all except few
service all with serviceImpl except Employee, Job

// Set an angular suffix
// angularSuffix * with mySuffix

Browsers and Operating System
mshima commented 11 months ago

If this is a blocker, we can easily revert at the blueprint for now.

nicolas63 commented 11 months ago

It's not a blocker but in the blueprint we don't change this code, so i think you have the same problem in the main generator

github-actions[bot] commented 11 months ago

JHipster has completed the sample check .yo-rc.json: valid Entities JDL: valid Application: successfully generated Frontend check: success Backend check: success E2E check: failure

nicolas63 commented 11 months ago

Do you have an idea for fixing ?

mshima commented 11 months ago

This bug is interesting. Location entity instance is matching location from location.href.

mshima commented 11 months ago

The correct fix would be to generate a tsEntityInstance prefixed with jhiPrefix.