generator-jhipster-nav-element

Add simple and nested pages to your JHipster app


Keywords
scaffold, angular, react, generator, yeoman-generator, jhipster, jhipster-module, docker, java, open-source, scaffolding, spring-boot
License
Apache-2.0
Install
npm install generator-jhipster-nav-element@4.0.10

Documentation

generator-jhipster-nav-element

NPM version Build Status Dependency Status Coverage Status

Introduction

This is a JHipster module, that is meant to be used in a JHipster application.

This generator scaffolds a new page and creates a corresponding navigation menu item in the your JHipster application. Currently following templates are available:

A simple page with some content

The following (client-side) artifacts are generated:

1. Angular application (assuming your page is called 'about-us'):
  • src/main/webapp/app/app.module.ts (this gets modified)
  • src/main/webapp/app/layouts/navbar/navbar.component.html (this gets modified)
  • src/main/webapp/i18n/{lang}/global.json (these get modified)
  • src/main/webapp/i18n/{lang}/about-us.json (resource is created for i18n)
  • src/main/webapp/app/about-us/about-us.component.html
  • src/main/webapp/app/about-us/about-us.component.ts
  • src/main/webapp/app/about-us/about-us.module.ts
  • src/main/webapp/app/about-us/about-us.route.ts
  • src/main/webapp/app/about-us/about-us.component.[s]css (css/scss is created based on your jhipster config, i.e. useSass in your .yo-rc.json)
  • src/main/webapp/app/about-us/index.ts
  • src/test/javascript/spec/app/about-us/about-us.component.spec.ts
2. React:
  • Not supported currently

Nested Routes Template

This template creates a page with 2 tabs (sub components/pages) accessible via nested routes The following (client-side) artifacts are generated/modified:

1. Angular application (assuming your page is called 'hello-world'):
  • src/main/webapp/app/app.module.ts (this gets modified)
  • src/main/webapp/app/hello-world/navbar.component.html (this gets modified)
  • src/main/webapp/i18n/{lang}/global.json (these get modified)
  • src/main/webapp/i18n/{lang}/hello-world.json (resource is created for i18n)
  • src/main/webapp/i18n/{lang}/page-one.json (resource is created for i18n)
  • src/main/webapp/i18n/{lang}/page-two.json (resource is created for i18n)
  • src/main/webapp/app/hello-world/hello-world.component.html
  • src/main/webapp/app/hello-world/hello-world.component.[s]css (css/scss is created based on your jhipster config, i.e. useSass in your .yo-rc.json)
  • src/main/webapp/app/hello-world/hello-world.component.ts
  • src/main/webapp/app/hello-world/hello-world.module.ts
  • src/main/webapp/app/hello-world/hello-world.route.ts
  • src/main/webapp/app/hello-world/index.ts
  • src/test/javascript/spec/app/hello-world/hello-world.component.spec.ts
  • src/main/webapp/app/hello-world/page-one/page-one.component.html
  • src/main/webapp/app/hello-world/page-one/page-one.component.[s]css (css/scss is created based on your jhipster config, i.e. useSass in your .yo-rc.json)
  • src/main/webapp/app/hello-world/page-one/page-one.component.ts
  • src/main/webapp/app/hello-world/page-one/page-one.route.ts
  • src/test/javascript/spec/app/hello-world/page-one/page-one.component.spec.ts
  • src/main/webapp/app/hello-world/page-two/page-two.component.html
  • src/main/webapp/app/hello-world/page-two/page-two.component.[s]css (css/scss is created based on your jhipster config, i.e. useSass in your .yo-rc.json)
  • src/main/webapp/app/hello-world/page-two/page-two.component.ts
  • src/main/webapp/app/hello-world/page-two/page-two.route.ts
  • src/test/javascript/spec/app/hello-world/page-two/page-two.component.spec.ts
2. React:
  • Not supported currently

Prerequisites

As this is a JHipster module, we expect you have JHipster and its related tools already installed:

Installation

with NPM

To install this module:

npm install -g generator-jhipster-nav-element

To update this module:

npm update -g generator-jhipster-nav-element

with Yarn

To install this module:

yarn global add generator-jhipster-nav-element

To update this module:

yarn global upgrade generator-jhipster-nav-element

Usage

To run the module on a JHipster generated application:

yo jhipster-nav-element

Development Setup

Exclude the following folders from compilation in your favorite IDE (IntelliJ IDEA / WebStorm):

generators/app/templates
test/**/playground
test/**/results

License

Apache-2.0 © [Vivek More]