Skip to content

Commit ec32e96

Browse files
authored
Fix link to built in entity user in blazor side (jhipster#1560)
* Fix link to built in entity in blazor side * sample jdl change
1 parent a6ee06b commit ec32e96

File tree

8 files changed

+394
-22
lines changed

8 files changed

+394
-22
lines changed

.blueprint/generate-sample/generator.mjs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,16 @@ export default class extends BaseGenerator {
6262
async jdlEntities() {
6363
if (this.withEntities) {
6464
if (this.sampleName.includes('-mongo-')) {
65-
this.jdlSample = 'app_mongo.jdl';
65+
this.jdlSample = 'app_mongo';
6666
} else if (this.sampleName.includes('-react-')) {
67-
this.jdlSample = 'app-react.jdl';
67+
this.jdlSample = 'app-react';
6868
} else {
69-
this.jdlSample = 'app.jdl';
69+
this.jdlSample = 'app';
7070
}
71+
if (this.sampleName.includes('jwt-')) {
72+
this.jdlSample = `${this.jdlSample}_withUserRelation`;
73+
}
74+
this.jdlSample = `${this.jdlSample}.jdl`;
7175
this.copyTemplate(`samples/jdl-default/${this.jdlSample}`, this.jdlSample, { noGlob: true });
7276
}
7377
},

.blueprint/generate-sample/templates/samples/jdl-default/app-react.jdl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ enum Language {
6060
FRENCH, ENGLISH, SPANISH
6161
}
6262

63-
64-
6563
relationship OneToOne {
6664
Country{region} to Region
6765
}
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
entity Region {
2+
regionName String
3+
}
4+
5+
entity Country {
6+
countryName String
7+
}
8+
9+
// an ignored comment
10+
/** not an ignored comment */
11+
entity Location {
12+
streetAddress String,
13+
postalCode String,
14+
city String,
15+
stateProvince String
16+
}
17+
18+
entity Department {
19+
departmentName String required
20+
}
21+
22+
/**
23+
* PieceOfWork entity.
24+
* @author The JHipster team.
25+
*/
26+
entity PieceOfWork {
27+
title String,
28+
description String
29+
}
30+
31+
/**
32+
* The Employee entity.
33+
*/
34+
entity Employee {
35+
/**
36+
* The firstname attribute.
37+
*/
38+
firstName String,
39+
lastName String,
40+
email String,
41+
phoneNumber String,
42+
hireDate Instant,
43+
salary Long,
44+
commissionPct Long
45+
}
46+
47+
entity Job {
48+
jobTitle String,
49+
minSalary Long,
50+
maxSalary Long
51+
}
52+
53+
entity JobHistory {
54+
startDate Instant,
55+
endDate Instant,
56+
language Language
57+
}
58+
59+
enum Language {
60+
FRENCH, ENGLISH, SPANISH
61+
}
62+
63+
relationship OneToOne {
64+
Employee{internalUser} to User with builtInEntity
65+
}
66+
67+
relationship OneToOne {
68+
Country{region} to Region
69+
}
70+
71+
relationship OneToOne {
72+
Location{country} to Country
73+
}
74+
75+
relationship OneToOne {
76+
Department{location} to Location
77+
}
78+
79+
// defining multiple OneToMany relationships with comments
80+
relationship OneToMany {
81+
Employee to Job{employee},
82+
/**
83+
* A relationship
84+
*/
85+
Department to
86+
/**
87+
* Another side of the same relationship
88+
*/
89+
Employee{department}
90+
}
91+
92+
relationship ManyToOne {
93+
Employee{manager} to Employee
94+
}
95+
96+
// defining multiple oneToOne relationships
97+
relationship OneToOne {
98+
JobHistory{job} to Job,
99+
JobHistory{department} to Department,
100+
JobHistory{employee} to Employee
101+
}
102+
103+
relationship ManyToMany {
104+
Job{chore(title)} to PieceOfWork{job}
105+
}
106+
107+
// Set pagination options
108+
// .Net does not generates link header for pagination.
109+
// paginate JobHistory, Employee with infinite-scroll
110+
// paginate Job with pagination
111+
112+
// Use Data Transfert Objects (DTO)
113+
dto * with mapstruct
114+
115+
// Set service options to all except few
116+
service all with serviceImpl except Employee, Job
117+
118+
// Set an angular suffix
119+
// angularSuffix * with mySuffix

.blueprint/generate-sample/templates/samples/jdl-default/app_mongo.jdl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ enum Language {
6060
FRENCH, ENGLISH, SPANISH
6161
}
6262

63-
64-
6563
relationship OneToOne {
6664
Country{region} to Region
6765
}
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
entity Region {
2+
regionName String
3+
}
4+
5+
entity Country {
6+
countryName String
7+
}
8+
9+
// an ignored comment
10+
/** not an ignored comment */
11+
entity Location {
12+
streetAddress String,
13+
postalCode String,
14+
city String,
15+
stateProvince String
16+
}
17+
18+
entity Department {
19+
departmentName String required
20+
}
21+
22+
/**
23+
* PieceOfWork entity.
24+
* @author The JHipster team.
25+
*/
26+
entity PieceOfWork {
27+
title String,
28+
description String
29+
}
30+
31+
/**
32+
* The Employee entity.
33+
*/
34+
entity Employee {
35+
/**
36+
* The firstname attribute.
37+
*/
38+
firstName String,
39+
lastName String,
40+
email String,
41+
phoneNumber String,
42+
hireDate Instant,
43+
salary Long,
44+
commissionPct Long
45+
}
46+
47+
entity Job {
48+
jobTitle String,
49+
minSalary Long,
50+
maxSalary Long
51+
}
52+
53+
entity JobHistory {
54+
startDate Instant,
55+
endDate Instant,
56+
language Language
57+
}
58+
59+
enum Language {
60+
FRENCH, ENGLISH, SPANISH
61+
}
62+
63+
relationship OneToOne {
64+
Employee{internalUser} to User with builtInEntity
65+
}
66+
67+
relationship OneToOne {
68+
Country{region} to Region
69+
}
70+
71+
relationship OneToOne {
72+
Location{country} to Country
73+
}
74+
75+
relationship OneToOne {
76+
Department{location} to Location
77+
}
78+
79+
// defining multiple OneToMany relationships with comments
80+
relationship OneToMany {
81+
Employee to Job{employee},
82+
/**
83+
* A relationship
84+
*/
85+
Department to
86+
/**
87+
* Another side of the same relationship
88+
*/
89+
Employee{department}
90+
}
91+
92+
relationship ManyToOne {
93+
Employee{manager} to Employee
94+
}
95+
96+
// defining multiple oneToOne relationships
97+
relationship OneToOne {
98+
JobHistory{job} to Job,
99+
JobHistory{department} to Department,
100+
JobHistory{employee} to Employee
101+
}
102+
103+
relationship ManyToMany {
104+
Job{chore(title)} to PieceOfWork{job}
105+
}
106+
107+
// Set pagination options
108+
paginate * with pagination
109+
110+
// Use Data Transfert Objects (DTO)
111+
dto * with mapstruct
112+
113+
// Set service options to all except few
114+
service all with serviceImpl except Employee, Job
115+
116+
// Set an angular suffix
117+
// angularSuffix * with mySuffix

0 commit comments

Comments
 (0)