oktadev / ionic-jhipster-starter Goto Github PK
View Code? Open in Web Editor NEWStarter 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
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
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!
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 ]
Depends on #6.
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.
@mraible I have a running Ionic 4 with JHipster! PR for Ionic4 support
At the moment I have only support for JWT auth.
Few days ago, we talked a bit about a migration plan. Let me explain my thoughts even if we can't version it.
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
)
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
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 :-)
Look to https://github.com/danielsogl/ionic-super-starter for inspiration.
Is it possible to add support for ionic 4?
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',
...
It generate fields without '?'
after entity
{{nmsDomain.name}}
and it gives an error that can't get name
from undefined
Changed to
{{nmsDomain?.name}}
and is working :-)
Related: jhipster/generator-jhipster-ionic#7
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.