ng2 app not displayed when using specific jhi-prefix with entities
See original GitHub issueOverview of the issue
The current build which use a specific jhi-prefix failed: https://travis-ci.org/jhipster/generator-jhipster/jobs/196399903
See in the .yo-rc.json
file: "jhiPrefix": "custom"
: https://github.com/jhipster/generator-jhipster/blob/master/travis/samples/app-ng2-default/.yo-rc.json#L25
Related to this dicussion https://github.com/jhipster/generator-jhipster/issues/4985#issuecomment-275939086 Ping @deepu105
Reproduce the error
Simply go into http://localhost:8080 Nothing is displayed
Suggest a Fix
In some entity.html files
Instead of:
<tr customSort [(predicate)]="predicate" [(ascending)]="reverse" [callback]="transition.bind(this)">
<th customSortBy="id"><span jhiTranslate="global.field.id">ID</span> <span class="fa fa-sort"></span></th>
<th customSortBy="label"><span jhiTranslate="travisNg2App.label.label">Label</span> <span class="fa fa-sort"></span></th>
I use:
<tr jhiSort [(predicate)]="predicate" [(ascending)]="reverse" [callback]="transition.bind(this)">
<th jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <span class="fa fa-sort"></span></th>
<th jhiSortBy="label"><span jhiTranslate="travisNg2App.label.label">Label</span> <span class="fa fa-sort"></span></th>
And it works.
So probably something to do here with jhiPrefix: https://github.com/jhipster/generator-jhipster/blob/master/generators/entity/templates/client/angular/src/main/webapp/app/entities/_entity-management.component.html#L39-L49
JHipster Version(s)
travis-ng-2@0.0.0 /home/pgrimaud/tmp/18-toto
└── generator-jhipster@3.12.2 -> /home/pgrimaud/projects/jhipster/generator-jhipster
JHipster configuration, a .yo-rc.json
file generated in the root folder
{
"generator-jhipster": {
"baseName": "travisNg2",
"packageName": "io.github.jhipster.travis",
"packageFolder": "io/github/jhipster/travis",
"serverPort": "8080",
"authenticationType": "session",
"hibernateCache": "ehcache",
"clusteredHttpSession": false,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "mysql",
"searchEngine": false,
"messageBroker": false,
"buildTool": "maven",
"enableSocialSignIn": false,
"rememberMeKey": "448f9a67a8a292c4905a733ec22cc3b78e493c56",
"useSass": false,
"applicationType": "monolith",
"testFrameworks": [
"gatling",
"protractor"
],
"jhiPrefix": "custom",
"enableTranslation": true,
"nativeLanguage": "en",
"languages": [
"en"
],
"travis": true,
"serviceDiscoveryType": false,
"clientPackageManager": "yarn",
"jhipsterVersion": "3.12.2",
"clientFramework": "angular2"
}
}
Entity configuration(s) entityName.json
files generated in the .jhipster
directory
BankAccount.json
{
"fluentMethods": true,
"relationships": [
{
"relationshipName": "user",
"otherEntityName": "user",
"relationshipType": "many-to-one",
"otherEntityField": "login"
},
{
"relationshipName": "operation",
"otherEntityName": "operation",
"relationshipType": "one-to-many",
"otherEntityRelationshipName": "bankAccount"
}
],
"fields": [
{
"fieldName": "name",
"fieldType": "String",
"fieldValidateRules": [
"required"
]
},
{
"fieldName": "bankNumber",
"fieldType": "Integer"
},
{
"fieldName": "agencyNumber",
"fieldType": "Long"
},
{
"fieldName": "lastOperationDuration",
"fieldType": "Float"
},
{
"fieldName": "meanOperationDuration",
"fieldType": "Double"
},
{
"fieldName": "balance",
"fieldType": "BigDecimal",
"fieldValidateRules": [
"required"
]
},
{
"fieldName": "openingDay",
"fieldType": "LocalDate"
},
{
"fieldName": "lastOperationDate",
"fieldType": "ZonedDateTime"
},
{
"fieldName": "active",
"fieldType": "Boolean"
},
{
"fieldName": "accountType",
"fieldType": "BankAccountType",
"fieldValues": "CHECKING,SAVINGS,LOAN"
},
{
"fieldName": "attachment",
"fieldType": "byte[]",
"fieldTypeBlobContent": "any"
},
{
"fieldName": "description",
"fieldType": "byte[]",
"fieldTypeBlobContent": "text"
}
],
"changelogDate": "20150805124838",
"dto": "mapstruct",
"pagination": "no",
"service": "serviceImpl"
}
Label.json
{
"fluentMethods": true,
"relationships": [
{
"relationshipName": "operation",
"otherEntityName": "operation",
"relationshipType": "many-to-many",
"ownerSide": false,
"otherEntityRelationshipName": "label"
}
],
"fields": [
{
"fieldName": "label",
"fieldType": "String",
"fieldValidateRules": [
"required",
"minlength"
],
"fieldValidateRulesMinlength": "3"
}
],
"changelogDate": "20150805124936",
"dto": "no",
"pagination": "pagination",
"service": "serviceClass"
}
Operation.json
{
"fluentMethods": true,
"relationships": [
{
"relationshipName": "bankAccount",
"otherEntityName": "bankAccount",
"relationshipType": "many-to-one",
"otherEntityField": "name"
},
{
"relationshipName": "label",
"otherEntityName": "label",
"relationshipType": "many-to-many",
"otherEntityField": "label",
"ownerSide": true,
"otherEntityRelationshipName": "operation"
}
],
"fields": [
{
"fieldName": "date",
"fieldType": "ZonedDateTime",
"fieldValidateRules": [
"required"
]
},
{
"fieldName": "description",
"fieldType": "String"
},
{
"fieldName": "amount",
"fieldType": "BigDecimal",
"fieldValidateRules": [
"required"
]
}
],
"changelogDate": "20150805125054",
"dto": "no",
"service": "no",
"pagination": "infinite-scroll"
}
Browsers and Operating System
java version “1.8.0_111” Java™ SE Runtime Environment (build 1.8.0_111-b14) Java HotSpot™ 64-Bit Server VM (build 25.111-b14, mixed mode)
git version 2.9.3
node: v6.9.4
npm: 4.1.1
bower: 1.8.0
gulp: [22:18:07] CLI version 1.2.2
yeoman: 1.8.5
yarn: 0.19.1
Docker version 1.13.0, build 49bf474
docker-compose version 1.10.0, build 4bd6f1a
- Checking this box is mandatory (this is just to show you read everything)
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (6 by maintainers)
@ruddell : do you mean the fix I suggested is correct ?
<%=jhiPrefix%>SortBy
->jhiSortBy
@sonee123 please don’t post questions in our issue tracker.
Please use gitter or stackoverflow for questions