question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ng2 app not displayed when using specific jhi-prefix with entities

See original GitHub issue
Overview 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

jhi-prefix

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:closed
  • Created 7 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pascalgrimaudcommented, Jan 29, 2017

@ruddell : do you mean the fix I suggested is correct ? <%=jhiPrefix%>SortBy -> jhiSortBy

0reactions
gmarzioucommented, Jul 14, 2018

@sonee123 please don’t post questions in our issue tracker.

Please use gitter or stackoverflow for questions

Read more comments on GitHub >

github_iconTop Results From Across the Web

jhipster 4 access entity without login - Stack Overflow
This is the .yo-rc.json file from the gateway. { "generator-jhipster": { "promptValues": { "packageName": "com.jhipster.
Read more >
jhipster/generator-jhipster - Gitter
I notice that some entity classes are generated with service classes. They are listed after the "except" in the statement "service all with...
Read more >
Develop and Deploy Microservices with JHipster
I have a question, is it possible to manage entities on the microservice app (not the gateway) using JDL? and then do the...
Read more >
JHipster app and DevOps generator – Index - Wilson Mar
Generates all the hippest stacks from just an Entity Model (and default configurations)
Read more >
The JHipster Mini-Book
Building an app with JHipster . ... Warnings are shown using callouts like this. ... e2e/entities/**/*.spec.ts did not match any files.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found