Code Monkey home page Code Monkey logo

generator-jhipster-ionic's Introduction

Ionic for JHipster

A JHipster Blueprint that generates an Ionic Client

NPM version Generator Integration Test

Introduction

This is a JHipster blueprint. You can use it to generate an Ionic app that talks to a JHipster backend.

Installation

To install or update this blueprint:

npm install -g generator-jhipster-ionic

To update this blueprint:

npm update -g generator-jhipster-ionic

Usage

Create a JHipster app using jhipster, or a backend-only with jhipster --skip-client. Choose JWT or OAuth 2.0 as the authentication type.

Create a directory alongside your JHipster app, and run jhipster-ionic in it.

- jhipster-app
- ionic-app

You can also create a JHipster app and an Ionic app at the same time using the following command:

jhipster jdl bug-tracker.jh --blueprints ionic

For available options, you can run:

jhipster-ionic app --help

See your project's generated README for iOS, Android, OpenID Connect, and testing instructions.

Add PWA Support

To add PWA support to your Ionic app, run:

ng add @angular/pwa

Watch use the Angular CLI to transform your Ionic app into a PWA to learn more.

Pre-release

To use an unreleased version, install it using npm + git repository.

npm install -g jhipster/generator-jhipster-ionic
jhipster-ionic --skip-jhipster-dependencies

Updated (or pre-release) generator-jhipster

This blueprint embeds a compatible generator-jhipster version, but it's possible to use an updated generator-jhipster by running the jhipster cli with blueprints option instead of the builtin jhipster-ionic, like:

npm install -g generator-jhipster@latest
jhipster --blueprints ionic

Contributing

Please read our guidelines before submitting an issue. If your issue is a bug, please use the bug template pre populated here. For feature requests and queries you can use this template.

License

Apache 2.0, see LICENSE.

generator-jhipster-ionic's People

Contributors

danielfran avatar dependabot-preview[bot] avatar dependabot[bot] avatar github-actions[bot] avatar hawkurane avatar jhipster-bot avatar mraible avatar mshima avatar pascalgrimaud avatar pmverma avatar snyk-bot avatar zhyd1997 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

generator-jhipster-ionic's Issues

yo jhipster-ionic:entity <Entity> error

Hi,
Like this issue #59 I'm unable to create a new ionic entity also after renaming my ionic directory by "ionic4j".

The error log :

Found the .jhipster/Country.json configuration file, entity can be automatically generated!

? Do you want to update the entity? This will replace the existing files for this entity, all your custom code will be overwritten Yes, re generate the entity
events.js:167
      throw er; // Unhandled 'error' event
      ^

TypeError: this.insight is not a function
    at module.exports.insight (/usr/lib/node_modules/generator-jhipster-ionic/generators/entity/index.js:630:38)
    at Object.<anonymous> (/usr/lib/node_modules/generator-jhipster-ionic/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:418:27)
    at /usr/lib/node_modules/generator-jhipster-ionic/node_modules/run-async/index.js:25:25
    at new Promise (<anonymous>)
    at /usr/lib/node_modules/generator-jhipster-ionic/node_modules/run-async/index.js:24:19
    at self.env.runLoop.add.completed (/usr/lib/node_modules/generator-jhipster-ionic/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:419:13)
    at processImmediate (timers.js:632:19)
Emitted 'error' event at:
    at Immediate.setImmediate (/usr/lib/node_modules/generator-jhipster-ionic/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:427:22)
    at processImmediate (timers.js:632:19)

Country.json file :

{
    "name": "Country",
    "fields": [
        {
            "fieldName": "countryName",
            "fieldType": "String"
        }
    ],
    "relationships": [],
    "changelogDate": "20181217152023",
    "entityTableName": "country",
    "dto": "no",
    "pagination": "no",
    "service": "no",
    "jpaMetamodelFiltering": false,
    "fluentMethods": true,
    "clientRootFolder": "",
    "applications": "*"
}

Support for social login

Hi

First of all congratulations for this great work. This is very useful for me, the only thing I am missing in this is social login. Any plans for social login.

Your backend project must be a monolith or a gateway-issue

yo jhipster:server creates backend spring boot project (monolithic)

yo jhipster-ionic when trying to create checks for server application, and app-type and gives error:

"ERROR!
Your backend project must be a monolith or a gateway to work with this module! Found application type: undefined."
so i manually updated it like adding
"applicationType": "monolith",
to .yo-rc.json.
I think jhipster:server should do it itself or sth related should be done in ionic starter side.
such a little bug! Faced with updtodate version in Windows 10.
Thanks for such a helpful project!

/assets/i18n/nb.json not found

:8100/assets/i18n/nb.json Failed to load resource: the server responded with a status of 404 (Not Found)
Was originally nb_NO.json

changed to correct filename worked..

stuck on jhipster-ionic generator

The generator gets stuck after asking whether you'd like to integrate with Cordova. Doesn't matter if you answer yes or no.

Capture

It actually gets stuck after any of the questions:
Capture

Generator Doesn't Generate Existing Entities

I run "yo jhipster-ionic" command and ionic app is created. But my entities which already locate in my existing jhipster project doesn't be generated. Also, when i try to run "yo jhipster-ionic:entity" command console says


Just found a `.yo-rc.json` in a parent directory.
Setting the project root at: /home/can

Found the .jhipster/Course.json configuration file, entity can be automatically generated!


The entity Course is being updated.

Error jhipster-ionic:entity Course 

ERROR! 
The entity configuration file could not be read!

Add support for microservices in entity generator

If you point to a gateway when generating an entity, the JSON file is not found. You have to specify the path to the microservice app to find the JSON file. For a monolith, the path to the API is /api/{entityName}. For a microservice, the path to the API is /api/{microserviceName}/{entityName}.

Can't run a simple Ionic app after generating it with `yo jhipster-ionic`

Hi! 👋

I always encounter this problem while running a fresh new generated Ionic app.

Overview of the issue - if an error is being thrown a stack trace helps

After generating my Ionic app as specified in the README.md it can't run it without error.
It says:

Typescript Error
Subsequent variable declarations must have the same type. Variable 'process' must be of type '{ env: { [key: string]: string; }; }', but here has type 'Process'.
node_modules/@types/node/index.d.ts

Screenshot

screen shot 2018-08-29 at 14 20 52

My environment

Ionic Framework: 3.9.2
Ionic App Scripts: 3.1.9
Angular Core: 5.2.10
Angular Compiler CLI: 5.2.10
Node: 8.11.3
OS Platform: macOS High Sierra
Navigator Platform: MacIntel
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36

jhipster info

##### **JHipster Version(s)**

[email protected] /Users/crivasgomez/jhipster/myapp/ionic4j
├── [email protected]
└─┬ [email protected]
└── [email protected] deduped


cat: no such file or directory: .yo-rc.json

##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**


<details>
<summary>.yo-rc.json file</summary>
<pre>

</pre>
</details>


##### **JDL for the Entity configuration(s) `entityName.json` files generated in the `.jhipster` directory**

<details>
<summary>JDL entity definitions</summary>

<pre>




</pre>
</details>


##### **Environment and Tools**

java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

git version 2.15.2 (Apple Git-101.1)

node: v8.11.3

npm: 6.4.0

gulp:
[14:23:14] CLI version 2.0.1

yeoman: 2.0.5

yarn: 1.7.0

Docker version 18.06.0-ce, build 0ffa825

docker-compose version 1.22.0, build f46880f

Congratulations, JHipster execution is complete!

Motivation for or Use Case - explain why this is a bug for you

I can't generate runnable Ionic apps from JHipster generated runnable apps.

Reproduce the error - an unambiguous set of steps to reproduce the error. If you have a JavaScript error, maybe you can provide a live example with JSFiddle?

mkdir -p myapp/backend
cd myapp/backend
jhipster
(...)
cd ..
yo jhipster-ionic
(...)
cd ionic4j
ionic serve

Related issues - has a similar issue been reported before?

No.

Suggest a Fix - if you can't fix the bug yourself, perhaps you can point to what might be causing the problem (line of code or commit)

The screenshot shows a suspicious part of code inside node_modules/@types/node/index.d.ts.

JHipster Version(s) - is it a regression?
4.14.5

JHipster configuration, a .yo-rc.json file generated in the root folder - this will help us to replicate the scenario, you can remove the rememberMe key.

{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.mycompany.myapp",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "5.1.0",
    "applicationType": "monolith",
    "baseName": "backend",
    "packageName": "com.mycompany.myapp",
    "packageFolder": "com/mycompany/myapp",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "mysql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "******************************************",
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": [
      "en"
    ]
  }
}

yo jhipster-ionic:entity <Entity> error

Great to integrate JHipster with Ionic !!!
I created JHipster nms (Monolithic dev: MySQL) & ionic4j, but gave it another name ionms .
When I run
cd nms && ./gradlew
cd ionms && ionic serve.

Works fine and I can login and even change settings.

But when I try to create an entity that is running fine in nms app
an error ...
$ yo jhipster-ionic:entity hospital

If I create ionic4j. It generates the entities

ImageBlob not working in android

I can upload a new photo in Web environment, but when I generate the apk and tried to save a photo in android device it gives this error.

o.z.problem.spring.common.AdviceTrait : Bad Request: JSON parse error: Cannot deserialize value of type byte[] from String "image/jpg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBA....

The above exception comes in when the property is of type byte[] and json content is represented in String. Jackson thinks that in this case the json data is represented as base64 encoded and tries to decode it to a byte[]. If the string present in data field isn't a properly encoded base64 string, jackson raises the above exception.

Do I have to change something in the Spring class ? Like ...
return (Base64.getEncoder().encode(jsonParser.getText().getBytes()))

or

write images as text in database and send base64 string to server. Like described here
stackoverflow.com angular-5-how-can-i-save-a-user-with-a-blob-avatar

or save just the name of the avatar and get the image to show after like described here?
brianflove.com/2017/11/02/angular-http-client-blob/

All suggestions are very welcome :-)

Error when creating JHipster ionic app

Hi,

I have a standard JHipster v5.8.1 app generated called "eMedic". I then tried to generate the ionic app alongside the eMedic app. However, I'm getting the error as seen in the screenshot.

screenshot 2019-01-31 at 4 49 33 pm

Note: I'm running the "yo jhipster-ionic" command from /Users/john/workspace/temp

JHipster info:

`
INFO! Using JHipster version installed locally in current project's node_modules
INFO! Executing jhipster:info
INFO! Options: from-cli: true
Welcome to the JHipster Information Sub-Generator

JHipster Version(s)
[email protected] /Users/john/workspace/temp/eMedic
└── [email protected]

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
    "generator-jhipster": {
        "promptValues": {
            "packageName": "com.test",
            "nativeLanguage": "en"
        },
        "jhipsterVersion": "5.8.1",
        "applicationType": "monolith",
        "baseName": "eMedic",
        "packageName": "com.test",
        "packageFolder": "com.test",
        "serverPort": "8080",
        "authenticationType": "jwt",
        "cacheProvider": "ehcache",
        "enableHibernateCache": true,
        "websocket": false,
        "databaseType": "sql",
        "devDatabaseType": "h2Disk",
        "prodDatabaseType": "postgresql",
        "searchEngine": "elasticsearch",
        "messageBroker": false,
        "serviceDiscoveryType": false,
        "buildTool": "maven",
        "enableSwaggerCodegen": false,
        "jwtSecretKey": "bXktc2VjcmV0LXRva2VuLXRvLWNoYW5nZS1pbi1wcm9kdWN0aW9uLWFuZC10by1rZWVwLWluLWEtc2VjdXJlLXBsYWNl",
        "clientFramework": "angularX",
        "useSass": true,
        "clientPackageManager": "npm",
        "testFrameworks": ["gatling", "cucumber", "protractor"],
        "jhiPrefix": "jhi",
        "entitySuffix": "",
        "dtoSuffix": "DTO",
        "otherModules": [],
        "enableTranslation": true,
        "nativeLanguage": "en",
        "languages": ["en", "zh-cn"]
    }
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions

Environment and Tools

java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

git version 2.17.2 (Apple Git-113)

node: v8.12.0

npm: 6.4.1

yeoman: 2.0.5

Docker version 18.09.1, build 4c52b90

docker-compose version 1.23.2, build 1110ad01

INFO! Congratulations, JHipster execution is complete!
`

Authentication failed using Ionic DevApp

Hello,

First of all thanks for this amazing work.
I was trying to test my jhipster-ionic app on my phone using the new Ionic DevApp but I wasn't able to log in.

Is there some extra configuration (proxy, CORS) to add in order to have HTTP requests working on a real device?

A JHipster App with Ionic + OIDC can't render its own Angular client

I added OIDC Support to the Ionic module in #20. Along the way, I discovered that I wasn't able to use a cookie-based solution for storing the access token. With a basic JHipster monolith, cookies work because the Angular client is either embedded in the Spring Boot app (when running on 8080), or webpack proxies the request to the server (when using yarn start), carrying the cookies with it along the way.

Ionic runs on port 8100 when developing locally. We could configure its server to proxy as well, but in production, Ionic will most likely be deployed on a phone and it won't be able to leverage the cookies. Or, in other words, I was unable to make it work.

The solution I came up with is to add two classes to the backend JHipster app:

  • ResourceServerConfiguration: This class has an EnableResourceServer annotation that makes JHipster capable of receiving and parsing access tokens for authentication. Unfortunately, this also seems to override the EnableOAuth2Sso annotation in SecurityConfiguration, so the JHipster app will no longer be able to serve up its Angular client.
  • AuthInfoResource: This class exposes the OAuth settings for Spring Security at an api/auth-info endpoint, which allows the angular-oauth2-oidc library to configure its settings from the server's settings.

In Ionic, I added angular-oauth2-oidc to handle authentication with OAuth's implicit flow (when running in a browser). Since you can't redirect to a website when running in Cordova, I used its Inappbrowser plugin.

I made some updates to the default realm in Keycloak to add Ionic's URI (http://localhost:8100) as an allowed redirect uri, and to enable implicit flow in the web_app client.

To fix this bug, I think one of the following needs to happen:

  1. At a minimum, this project should document the steps needed to configure the Angular client in JHipster to use angular-oauth2-oidc. Currently, I'm printing the following message after installation:
if (this.jhipsterAppConfig.authenticationType === 'oauth2') {
    let resourceServerWarning = `${chalk.yellow('NOTE:')} To integrate OIDC into Ionic, I added a ResourceServerConfiguration class `;
    resourceServerWarning += `to your ${this.directoryPath} project. This will cause the Angular client on your server to stop `;
    resourceServerWarning += 'functioning. Please check this project\'s documentation to learn more: ';
    resourceServerWarning += `${chalk.bold('https://github.com/oktadeveloper/generator-jhipster-ionic\n')}`;
    this.log(resourceServerWarning);
}
  1. A better solution would be to automatically update the Angular client in the backend app to use angular-oauth2-oidc.
  2. The ideal solution would be to figure out how to use EnableOAuth2Sso and EnableResourceServer in the same project. I tried this solution, but was unable to make it work. I also thought it might be possible to enable the resource server on /mobile endpoints and then proxy those requests to /api, but I'm guessing Spring Security would still intercept those requests; causing it to fail.

/cc @bdemers @jhipster/developers @danielpetisme @deepu105 @jdubois @xetys @ruddell

Run yo jhipster-ionic command fails on Windows 10

Welcome to the Ionic JHipster generator! v3.0.0

? What do you want to name your Ionic application? ionic4j
? Enter the directory where your JHipster app is located: backend
fromPath backend/.yo-rc.json

Creating Ionic app with command: ionic start ionic4j oktadeveloper/jhipster
events.js:183
throw er; // Unhandled 'error' event
^

Error: spawnSync ionic ENOENT
at _errnoException (util.js:1024:11)
at spawnSync (child_process.js:579:20)
at execFileSync (child_process.js:616:13)
at module.exports.writing (C:\Users\Thomas Rabelo\AppData\Roaming\npm\node_modules\generator-jhipster-ionic\generators\app\index.js:67:9)
at Object. (C:\Users\Thomas Rabelo\AppData\Roaming\npm\node_modules\generator-jhipster-ionic\node_modules\generator-jhipster\node_modules\yeoman-generator\lib\index.js:399:25)
at C:\Users\Thomas Rabelo\AppData\Roaming\npm\node_modules\generator-jhipster-ionic\node_modules\generator-jhipster\node_modules\run-async\index.js:25:25
at new Promise ()
at C:\Users\Thomas Rabelo\AppData\Roaming\npm\node_modules\generator-jhipster-ionic\node_modules\generator-jhipster\node_modules\run-async\index.js:24:19
at self.env.runLoop.add.completed (C:\Users\Thomas Rabelo\AppData\Roaming\npm\node_modules\generator-jhipster-ionic\node_modules\generator-jhipster\node_modules\yeoman-generator\lib\index.js:400:11)
at runCallback (timers.js:789:20)
at tryOnImmediate (timers.js:751:5)
at processImmediate [as _immediateCallback] (timers.js:722:5)

Launching the module with "yo jhipster-ionic" is not starting

With latest jhipster version 6.0.0, yo jhipster-ionic fail with following error.

MacBookPro:pmverma sierra$ yo jhipster-ionic
events.js:167
      throw er; // Unhandled 'error' event
      ^

TypeError: this.getJhipsterAppConfig is not a function
    at module.exports.readConfig (/usr/local/lib/node_modules/generator-jhipster-ionic/generators/app/index.js:63:47)
    at Object.<anonymous> (/usr/local/lib/node_modules/generator-jhipster-ionic/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:424:27)
    at /usr/local/lib/node_modules/generator-jhipster-ionic/node_modules/run-async/index.js:25:25
    at new Promise (<anonymous>)
    at /usr/local/lib/node_modules/generator-jhipster-ionic/node_modules/run-async/index.js:24:19
    at self.env.runLoop.add.completed (/usr/local/lib/node_modules/generator-jhipster-ionic/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:425:13)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
Emitted 'error' event at:
    at Immediate.setImmediate (/usr/local/lib/node_modules/generator-jhipster-ionic/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:433:22)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
INFO! Using JHipster version installed globally
INFO! Executing jhipster:info
INFO! Options: from-cli: true
Welcome to the JHipster Information Sub-Generator
JHipster Version(s)
/Users/sierra/gitlab/pmverma
└── (empty)

cat: no such file or directory: .yo-rc.json

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions

Environment and Tools

java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)

git version 2.20.1 (Apple Git-117)

node: v10.14.2

npm: 6.7.0

yeoman: 2.0.6

Docker version 18.09.1, build 4c52b90

docker-compose version 1.23.2, build 1110ad01

run yo jhipster-ionic command Error

Hi,
module.js:487
throw err;
^

Error: Cannot find module '/usr/local/lib/node_modules/generator-jhipster-ionic/generators/app/../../node_modules/generator-jhipster/generators/util.js'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object. (/usr/local/lib/node_modules/generator-jhipster-ionic/generators/app/index.js:8:21)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)

bug: entity-dialog - otherEntityName vs. relationshipName

Hi,

it look's like there is a small bug in _entity-dialog.ts [131].
I have a entity with the relationships:

 "relationships": [
        {
            "relationshipName": "creator",
            "otherEntityName": "user",
            "relationshipType": "many-to-one",
            "relationshipValidateRules": [
                "required"
            ],
            "otherEntityField": "login",
            "ownerSide": true,
            "otherEntityRelationshipName": "group"
        }
    ]

and I get an exception:

 typescript: src/pages/entities/group/group-dialog.ts, line: 38 
            Property 'user' does not exist on type 'Group'. 

      L37:      name: [params.get('item') ? this.group.name : null,  Validators.required],
      L38:      user: [params.get('item') ? this.group.user : '',Validators.required],
      L39:  });

but it should be this.group.creator !
fix:

const relatedFieldName = (uniqueRel.relationshipType === 'many-to-many') ?
                uniqueRel.otherEntityNamePlural : uniqueRel.otherEntityName;

uniqueRel.otherEntityName should be uniqueRel.relationshipName.

Add support for Ionic 4

Hi,
i have installed this generator but when i select ionic 4 I have this error:
[INFO] You are about to create an Ionic 3 app. Would you like to try Ionic 4 (beta)?

   Ionic 4 uses the power of the modern Web and embraces the Angular CLI and Angular Router to bring you the best
   version of Ionic ever. See our blog announcement[1] and documentation[2] for more information. We'd love to hear
   your feedback on our latest version!

   [1]: https://blog.ionicframework.com/announcing-ionic-4-beta/
   [2]: https://beta.ionicframework.com/docs/

? Try Ionic 4? Yes
√ Preparing directory .\ionic4j - done!

  • Looking up starter
    [ERROR] Unable to find starter template for oktadeveloper/jhipster

      If this is not a typo, please make sure it is a valid starter template within the starters repo:
      https://github.com/ionic-team/starters
    

events.js:183
throw er; // Unhandled 'error' event
^

TypeError: Cannot set property 'author' of undefined
at module.exports.install (C:\Users\user\AppData\Roaming\npm\node_modules\generator-jhipster-ionic\generators\app\index.js:153:28)
at Object. (C:\Users\user\AppData\Roaming\npm\node_modules\generator-jhipster-ionic\node_modules\generator-jhipster\node_modules\yeoman-generator\lib\index.js:418:27)
at C:\Users\user\AppData\Roaming\npm\node_modules\generator-jhipster-ionic\node_modules\run-async\index.js:25:25
at new Promise ()
at C:\Users\user\AppData\Roaming\npm\node_modules\generator-jhipster-ionic\node_modules\run-async\index.js:24:19
at self.env.runLoop.add.completed (C:\Users\user\AppData\Roaming\npm\node_modules\generator-jhipster-ionic\node_modules\generator-jhipster\node_modules\yeoman-generator\lib\index.js:419:13)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)

Can you help me?
Thank you!!

All options from ion-select are being selected

Overview

All options from ion-select are being selected for options created from relationship.

Reproduce

  • Create an entity and add relationship to user, many -> 1 user.
  • Run app, try selecting a user from list - all users will be selected.

Suggested Fix

Not sure if it breaks other thing but removing [compareWith] from respective ion-select works for me.

Cannot read property 'readJSON' of undefined (app\index.js)

I followed temporary steps to run at #4 on Windows :

git clone [email protected]:oktadeveloper/generator-jhipster-ionic.git
cd generator-jhipster-ionic
npm link
cd ~
yo jhipster-ionic

What might be the cause of the problem? Thank you.

E:\project\generator-jhipster-ionic\generators\app\index.js:55
this.jhipsterAppConfig = this.fs.readJSON(fromPath)['generator-jhipster'
];
^

TypeError: Cannot read property 'readJSON' of undefined
at get writing [as writing] (E:\project\generator-jhipster-i
onic\generators\app\index.js:55:41)
at addInQueue (E:\project\generator-jhipster-ionic\node_modu
les\generator-jhipster\node_modules\yeoman-generator\lib\index.js:414:47)
at Array.forEach (native)
at run (E:\project\generator-jhipster-ionic\node_modules\gen
erator-jhipster\node_modules\yeoman-generator\lib\index.js:437:18)
at Environment.run (C:\Users\Laboratory\AppData\Roaming\npm\node_modules\yo
node_modules\yeoman-environment\lib\environment.js:451:22)
at env.lookup (C:\Users\Laboratory\AppData\Roaming\npm\node_modules\yo\lib\c
li.js:156:11)
at Environment.resolver.lookup (C:\Users\Laboratory\AppData\Roaming\npm\node
_modules\yo\node_modules\yeoman-environment\lib\resolver.js:51:12)
at init (C:\Users\Laboratory\AppData\Roaming\npm\node_modules\yo\lib\cli.js:
117:7)
at pre (C:\Users\Laboratory\AppData\Roaming\npm\node_modules\yo\lib\cli.js:7
6:3)
at Object. (C:\Users\Laboratory\AppData\Roaming\npm\node_modules
yo\lib\cli.js:205:3)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)

Sign up displays error, even though it works

For some reason, this code never calls the success callback:

  this.user.signup(this.account).subscribe((resp) => {
    this.navCtrl.push(MainPage);
  }, (err) => {
    //console.log('error in signup', err);
    // ^^ results in 'You provided 'undefined' where a stream was expected'
    //this.navCtrl.push(MainPage);

    // Unable to sign up
    let toast = this.toastCtrl.create({
      message: this.signupErrorString,
      duration: 3000,
      position: 'top'
    });
    toast.present();
  });

user.signup() is here. It calls api.post(), which is here.

Ionic App can't login to the backend jHipster OAuth 2.0/Keycloak

Hi,

I create a jHipster web monolithic/OAuth 2.0/OIDC Keycloak application with jHipster 4.14.4 version, see attachment.
And the application works fine.

After i create a jHipster Ionic app basead on my web monolithic backend.

And i cant login from ionic app.

Backend dont have ResourceServerConfiguration class, and the class SecurityConfiguration have a method below:

@Override
    protected void configure(HttpSecurity http) throws Exception {
        http
            .csrf()
            .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse())
        .and()
            .addFilterBefore(corsFilter, CsrfFilter.class)
            .exceptionHandling()
            .authenticationEntryPoint(problemSupport)
            .accessDeniedHandler(problemSupport)
        .and()
            .logout()
            .logoutUrl("/api/logout")
            .logoutSuccessHandler(ajaxLogoutSuccessHandler())
            .permitAll()
        .and()
            .headers()
            .frameOptions()
            .disable()
        .and()
            .authorizeRequests()
            .antMatchers("/api/profile-info").permitAll()
            .antMatchers("/api/**").authenticated()
            .antMatchers("/management/health").permitAll()
            .antMatchers("/management/**").hasAuthority(AuthoritiesConstants.ADMIN)
            .antMatchers("/v2/api-docs/**").permitAll()
            .antMatchers("/swagger-resources/configuration/ui").permitAll()
            .antMatchers("/swagger-ui/index.html").hasAuthority(AuthoritiesConstants.ADMIN);

    }

My Ionic app try access (in login) the endpoint:
POST http://localhost:8080/api/authenticate

The result in chrome for Ionic is: 403 (Forbidden)

The log in application is:
2018-05-28 18:56:35.000 DEBUG 14454 --- [ XNIO-16 task-2] o.s.b.w.f.OrderedRequestContextFilter : Bound request context to thread: HttpServletRequestImpl [ POST /api/authenticate ]
2018-05-28 18:56:35.001 WARN 14454 --- [ XNIO-16 task-2] o.z.p.spring.web.advice.AdviceTrait : Forbidden: Invalid CSRF Token 'null' was found on the request parameter '_csrf' or header 'X-XSRF-TOKEN'.
2018-05-28 18:56:35.004 WARN 14454 --- [ XNIO-16 task-2] .m.m.a.ExceptionHandlerExceptionResolver : Resolved exception caused by Handler execution: org.springframework.security.web.csrf.InvalidCsrfTokenException: Invalid CSRF Token 'null' was found on the request parameter '_csrf' or header 'X-XSRF-TOKEN'.
2018-05-28 18:56:35.004 DEBUG 14454 --- [ XNIO-16 task-2] o.s.b.w.f.OrderedRequestContextFilter : Cleared thread-bound request context: HttpServletRequestImpl [ POST /api/authenticate ]

captura de tela 2018-05-28 as 15 34 20

Improve Entity Generator Support

  • Make it possible to run yo jhipster:entity
  • Finish Entity Template
  • Finish Entity View Template
  • Finish Edit/Add Dialog Template

yo jhipster-ionic:entity <entity> events.js:167 throw er; // Unhandled 'error' event

With jhipster version 6.1.1, yo jhipster-ionic:entity NmsAlertLog fail with following error:

events.js:167
throw er; // Unhandled 'error' event
^

TypeError: this.insight is not a function
at module.exports.insight (/Users/mirg/Workspace/ionic4j/node_modules/generator-jhipster-ionic/generators/entity/index.js:630:38)
at Object. (/Users/mirg/Workspace/ionic4j/node_modules/yeoman-generator/lib/index.js:424:27)
at /Users/mirg/Workspace/ionic4j/node_modules/run-async/index.js:25:25
at new Promise ()
at /Users/mirg/Workspace/ionic4j/node_modules/run-async/index.js:24:19
at self.env.runLoop.add.completed (/Users/mirg/Workspace/ionic4j/node_modules/yeoman-generator/lib/index.js:425:13)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
Emitted 'error' event at:
at Immediate.setImmediate (/Users/mirg/Workspace/ionic4j/node_modules/yeoman-generator/lib/index.js:433:22)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)

===

I created a new Jhispter app and

new Ionic4 app with
$yo jhipster-ionic
WARNING! This method is deprecated. Use getAllJhipsterConfig

Entity

entity NmsAlertLog {
logTime ZonedDateTime,
text String maxlength(255),
aceptedBy String,
comment String,
status String maxlength(16)
}

Environment and Tools
(MacOS Monjave 10.14.5)
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

git version 2.20.1 (Apple Git-117)

node: v10.14.2

npm: 6.9.0

yeoman: 2.0.6

yarn: 1.12.3

Formatting consistency

Since the jhipster ionic starter supports ionic V4, the formatting is 2 spaces for all files (see .editorconfig file).

Whereas the generator uses 4 spaces for indentation.
We have to align both starter and generator.

@mraible I think we should use 2 spaces also for the generator. I checked .editorconfig from popular project on github (Angular, React, VueJS, JHipster, ...) and all uses this config. WDYT?

Form name in entity dialog is incorrect

Add support for environment feature

Ionic app scripts 3.2.0 introduced configuration via process.env.VAR.

Currently the oktadeveloper/jhipster starter add ionic app scripts 3.1.9 dependency.

I've already done it on my JH Ionic app for the API_URL variable (fleboulch/fast-msg-heroku@26b960d).

I could submit a PR to use this feature but I don't know how to update the oktadeveloper/jhipster starter

Add support for dates

If you create a blog.jh app using JDL, saving entries doesn't work.

Request payload:

{
   "id":null,
   "title":"First",
   "content":"post",
   "date":"2018-03-20",
   "blog":{
      "id":1,
      "name":"New blog",
      "handle":"new",
      "user":{
         "id":4,
         "login":"user",
         "firstName":"User",
         "lastName":"User",
         "email":"user@localhost",
         "activated":true,
         "langKey":"en",
         "imageUrl":""
      }
   },
   "tags":""
}

Response:

{
  "type" : "http://www.jhipster.tech/problem/problem-with-message",
  "title" : "Bad Request",
  "status" : 400,
  "detail" : "JSON parse error: Can not deserialize value of type java.time.ZonedDateTime from String \"2018-03-20\": Text '2018-03-20' could not be parsed at index 10; nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not deserialize value of type java.time.ZonedDateTime from String \"2018-03-20\": Text '2018-03-20' could not be parsed at index 10\n at [Source: java.io.PushbackInputStream@53ce1cec; line: 1, column: 52] (through reference chain: com.mycompany.myapp.domain.Entry[\"date\"])",
  "path" : "/api/entries",
  "message" : "error.http.400"
}

Run yo jhipster-ionic command encountered the following problems

Error: Cannot find module 'C:\Users\Zeral\AppData\Roaming\npm\node_modules\generator-jhipster-ionic\generators\app/../../node_modules/generator-jhipster/generators/util.js'
at Function.Module._resolveFilename (module.js:489:15)
at Function.Module._load (module.js:439:25)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at Object. (C:\Users\Zeral\AppData\Roaming\npm\node_modules\generator-jhipster-ionic\generators\app\index.js:8:21)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)

This is my environment :
Node: v8.4.0
npm: v5.3.0
yarn : v1.3.2
jhipster generator: v4.10.2

ionic

  • Overview of the request
  • Motivation for or Use Case
  • Browsers and Operating System
  • Related issues
  • Suggest a Fix

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.