Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[React] Error during entity deletion process #24115

Closed
1 task done
nicolas63 opened this issue Nov 6, 2023 · 6 comments · Fixed by #24320
Closed
1 task done

[React] Error during entity deletion process #24115

nicolas63 opened this issue Nov 6, 2023 · 6 comments · Fixed by #24320

Comments

@nicolas63
Copy link
Member

nicolas63 commented Nov 6, 2023

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
  • Checking this box is mandatory (this is just to show you read everything)
@mshima
Copy link
Member

mshima commented Nov 8, 2023

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

@nicolas63
Copy link
Member Author

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

Copy link
Contributor

github-actions bot commented Nov 11, 2023

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
Copy link
Member Author

Do you have an idea for fixing ?

@mshima
Copy link
Member

mshima commented Nov 21, 2023

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

@mshima
Copy link
Member

mshima commented Nov 22, 2023

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

@deepu105 deepu105 added this to the 8.1.0 milestone Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants