Coder Social home page Coder Social logo

oktadev / ionic-jhipster-starter Goto Github PK

View Code? Open in Web Editor NEW
27.0 11.0 18.0 589 KB

Starter Template for Ionic Apps with JHipster

Home Page: https://developer.okta.com/blog/2019/06/24/ionic-4-angular-spring-boot-jhipster

License: Apache License 2.0

TypeScript 87.96% HTML 7.35% JavaScript 2.07% SCSS 2.63%
jhipster ionic ionic-starter

ionic-jhipster-starter's Issues

Upgrade to Angular 8

From the Ionic 4.7.2 Release Notes:

With this version comes support for Angular 8! Follow the below steps to update.

Update @ionic/angular and @ionic/angular-toolkit to the latest releases:

$ npm install @ionic/[email protected]
$ npm install @ionic/[email protected] -D

Update @angular/core and @angular/cli:

$ npx ng update @angular/core @angular/cli

Update @angular-devkit dependencies:

$ npm i @angular-devkit/architect@latest @angular-devkit/build-angular@latest @angular-devkit/core@latest @angular-devkit/schematics@latest

View our Angular 8 Update Guide for tips on potential issues!

[npm ERR]Unexpected end of JSON input while parsing near '..."size":326897,"noatta'

I run into npm ERR when run npm install command ,

commands :
ionic start ionic4j oktadeveloper/jhipster
cd ionic4j/
npm i

error:

✖ Running command - failed!
[ERROR] An error occurred while running npm i (exit code 1):

        
        npm WARN deprecated [email protected]: 1.2.0 should have been a major version bump
        npm ERR! Unexpected end of JSON input while parsing near '..."size":326897,"noatta'

MacBook-Air:ionic4j tony$ npm i
npm WARN deprecated [email protected]: 1.2.0 should have been a major version bump
npm ERR! Unexpected end of JSON input while parsing near '..."size":326897,"noatta'

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/tony/.npm/_logs/2018-06-24T16_04_44_917Z-debug.log


/.npm/_logs/2018-06-24T16_04_44_917Z-debug.log

2301 silly saveTree ├── [email protected]
2301 silly saveTree └── [email protected]
2302 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '..."size":326897,"noatta'
2302 verbose stack     at JSON.parse (<anonymous>)
2302 verbose stack     at parseJson (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-better-errors/index.js:7:17)
2302 verbose stack     at consumeBody.call.then.buffer (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/body.js:96:50)
2302 verbose stack     at <anonymous>
2302 verbose stack     at process._tickCallback (internal/process/next_tick.js:188:7)
2303 verbose cwd /Users/tony/dev/ionic/ionic4j
2304 verbose Darwin 17.6.0
2305 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "i"
2306 verbose node v8.11.3
2307 verbose npm  v5.6.0
2308 error Unexpected end of JSON input while parsing near '..."size":326897,"noatta'
2309 verbose exit [ 1, true ]

Easy query params for GET requests won't work

From api.ts, following reqOpts.params is immutable and setting a value without reassigning will not work.

    // Support easy query params for GET requests
    if (params) {
      reqOpts.params = new HttpParams();
      for (let k in params) {
        reqOpts.params.set(k, params[k]); // here
      }
    }
    // Support easy query params for GET requests
    if (params) {
      reqOpts.params = new HttpParams();
      for (let k in params) {
         reqOpts.params = reqOpts.params.set(k, params[k]); // corrected here
      }
    }

I am doing a PR for this.

Ionic 4 support PR

@mraible I have a running Ionic 4 with JHipster! PR for Ionic4 support
At the moment I have only support for JWT auth.

Migration plan

Few days ago, we talked a bit about a migration plan. Let me explain my thoughts even if we can't version it.

Ionic 3 support will be kept

We need to replace
ionic start ${this.ionicAppName} oktadeveloper/jhipster
by
ionic start ${this.ionicAppName} oktadeveloper/jhipster --type ionic-angular
on the generator-jhipster-ionic repo.

The starter path should stay the same on the ionic-team/starters project (ionic-angular/community/oktadeveloper/jhipster)

Ionic 4 support added

The starter path need to be different as the base starter from Ionic 4 apps has been rewritten.
Now the community starter has to be in angular/community.
I propose, if you are ok with that, to create a new path on the ionic-team/starters like angular/community/XXX/jhipster.
And in the generator-jhipster-ionic project we can call it easily with the ionic start command

I will do a PR on the generator repo once you have validated my PR on the starter

Note: I didn't create my PR directly on your project because we should not merge it inside

entity to User JDL

I have this Jdl

entity NmsAlert {
  alertBegin ZonedDateTime,
  alertSent ZonedDateTime,
  alertAnswered ZonedDateTime,
  text String
}

relationship ManyToOne {
    NmsAlert{userAttended} to User, 
}

And It generates
import { User } from '../../../services/user/user.model';
That doesn't exist

============
I replaced with
import { JhiUser } from '../../../../model/jhi-user';

and created this class in src/model

export class JhiUser {
    constructor(
        public id?: number,
        public login?: string,
        public activated?: boolean,
        public authorities?: any[],
        public email?: string,
        public firstName?: string,
        public langKey?: string,
        public lastName?: string,
        public imageUrl?: string,
        public createdBy?: string,
        public createdDate?: Date,
        public lastModifiedBy?: string,
        public lastModifiedDate?: Date,
        public password?: string
    ) 
    {
        this.id = id ? id : null;
        this.login = login ? login : null;
        this.firstName = firstName ? firstName : null;
        this.lastName = lastName ? lastName : null;
        this.email = email ? email : null;
        this.activated = activated ? activated : false;
        this.langKey = langKey ? langKey : 'en';
        this.authorities = authorities ? authorities : null;
        this.createdBy = createdBy ? createdBy : null;
        this.createdDate = createdDate ? createdDate : null;
        this.lastModifiedBy = lastModifiedBy ? lastModifiedBy : null;
        this.lastModifiedDate = lastModifiedDate ? lastModifiedDate : null;
        this.password = password ? password : null;
    }
}

=====

And is working :-)

In README.md Tips section add webpack/webpack.dev.js to files containing PORT 8080

webpack/webpack.dev.js change devServer.target property:

    module.exports = webpackMerge(commonConfig({ env: ENV }), {
    devtool: 'eval-source-map',
    devServer: {
        contentBase: './target/www',
        proxy: [{
            context: [
                /* jhipster-needle-add-entity-to-webpack - JHipster will add entity api paths here */
                '/api',
                '/management',
                '/swagger-resources',
                '/v2/api-docs',
                '/h2-console',
                '/auth'
            ],
            target: 'http://127.0.0.1:8080',
...

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.