├── .gitattributes
├── .gitignore
├── travis
├── configstore
│ ├── insight-yo.json
│ └── insight-generator-jhipster.json
├── scripts
│ ├── 03-generate-audit.sh
│ ├── 04-tests.sh
│ ├── 01-generate-project.sh
│ ├── 05-run.sh
│ └── 02-generate-entities.sh
├── install
│ ├── 03-checkVersion.sh
│ ├── 04-cache.sh
│ └── 02-install-jhipster-stack.sh
└── samples
│ ├── .jhipster
│ ├── EntityWithDTO.json
│ ├── EntityWithPagination.json
│ ├── EntityWithServiceImpl.json
│ ├── EntityWithServiceClass.json
│ ├── EntityWithPaginationAndDTO.json
│ ├── EntityWithServiceClassAndDTO.json
│ ├── EntityWithServiceImplAndDTO.json
│ ├── EntityWithServiceClassAndPagination.json
│ ├── EntityWithServiceImplAndPagination.json
│ ├── EntityWithServiceImplPaginationAndDTO.json
│ ├── EntityWithServiceClassPaginationAndDTO.json
│ ├── Label.json
│ ├── Operation.json
│ ├── TestPager.json
│ ├── TestMapstruct.json
│ ├── TestPagination.json
│ ├── TestServiceImpl.json
│ ├── TestServiceClass.json
│ ├── TestInfiniteScroll.json
│ ├── TestManyToOne.json
│ ├── TestEntity.json
│ ├── TestCustomTableName.json
│ ├── TestManyToMany.json
│ ├── BankAccount.json
│ ├── TestOneToOne.json
│ ├── FieldTestEntity.json
│ ├── FieldTestPagerEntity.json
│ ├── FieldTestMapstructEntity.json
│ ├── FieldTestPaginationEntity.json
│ ├── FieldTestServiceClassEntity.json
│ ├── FieldTestServiceImplEntity.json
│ └── FieldTestInfiniteScrollEntity.json
│ ├── app-psql-es-noi18n
│ └── .yo-rc.json
│ ├── app-gateway
│ └── .yo-rc.json
│ ├── app-mysql
│ └── .yo-rc.json
│ ├── app-default-from-scratch
│ └── .yo-rc.json
│ └── app-gradle
│ └── .yo-rc.json
├── doc
├── new.png
└── old.png
├── .editorconfig
├── generators
└── app
│ ├── templates
│ └── src
│ │ └── main
│ │ └── webapp
│ │ └── app
│ │ ├── entities
│ │ ├── tpl
│ │ │ ├── _entity-header-template.ejs
│ │ │ └── _entity-box-header-template.ejs
│ │ ├── _entity-management-template.ejs
│ │ ├── _entity-management.controller.ejs
│ │ ├── _entity-management.ejs
│ │ ├── no-pagination-template.ejs
│ │ ├── pagination-template.ejs
│ │ └── infinite-scroll-template.ejs
│ │ └── components
│ │ └── udt
│ │ └── _gui.service.js
│ └── index.js
├── LICENSE
├── package.json
├── .travis.yml
├── README.md
├── .eslintrc
└── gulpfile.js
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | coverage
3 | npm-debug.log
4 | .idea/
5 |
--------------------------------------------------------------------------------
/travis/configstore/insight-yo.json:
--------------------------------------------------------------------------------
1 | {
2 | "clientId": 495049364328,
3 | "optOut": true
4 | }
5 |
--------------------------------------------------------------------------------
/doc/new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hermeslm/generator-jhipster-angular-datatables/HEAD/doc/new.png
--------------------------------------------------------------------------------
/doc/old.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hermeslm/generator-jhipster-angular-datatables/HEAD/doc/old.png
--------------------------------------------------------------------------------
/travis/configstore/insight-generator-jhipster.json:
--------------------------------------------------------------------------------
1 | {
2 | "clientId": 495049364328,
3 | "optOut": true
4 | }
5 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 2
6 | charset = utf-8
7 | trim_trailing_whitespace = true
8 | insert_final_newline = true
9 |
10 | [*.md]
11 | trim_trailing_whitespace = false
12 |
--------------------------------------------------------------------------------
/generators/app/templates/src/main/webapp/app/entities/tpl/_entity-header-template.ejs:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/travis/scripts/03-generate-audit.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -ev
3 | #-------------------------------------------------------------------------------
4 | # Generate the default audit behaviour
5 | #-------------------------------------------------------------------------------
6 | cd "$HOME"/app
7 | yo jhipster-angular-datatables default --force --no-insight
8 |
--------------------------------------------------------------------------------
/travis/scripts/04-tests.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -ev
3 | #--------------------------------------------------
4 | # Launch tests
5 | #--------------------------------------------------
6 | cd "$HOME"/app
7 | if [ -f "mvnw" ]; then
8 | ./mvnw test
9 | elif [ -f "gradlew" ]; then
10 | ./gradlew test
11 | fi
12 | if [ -f "gulpfile.js" ]; then
13 | gulp test --no-notification
14 | fi
15 |
--------------------------------------------------------------------------------
/travis/install/03-checkVersion.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -ev
3 | #-------------------------------------------------------------------------------
4 | # Check all versions
5 | #-------------------------------------------------------------------------------
6 | java -version
7 | git --version
8 | node -v
9 | npm -v
10 | bower -v
11 | yo --version
12 | gulp -v
13 | docker version
14 | docker-compose version
15 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/EntityWithDTO.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [],
4 | "fields": [
5 | {
6 | "fieldName": "name",
7 | "fieldType": "String"
8 | }
9 | ],
10 | "changelogDate": "20160806123735",
11 | "entityTableName": "entity_with_dto",
12 | "dto": "mapstruct",
13 | "pagination": "no",
14 | "service": "no"
15 | }
16 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/EntityWithPagination.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [],
4 | "fields": [
5 | {
6 | "fieldName": "name",
7 | "fieldType": "String"
8 | }
9 | ],
10 | "changelogDate": "20160806123738",
11 | "entityTableName": "entity_with_pagination",
12 | "dto": "no",
13 | "pagination": "pagination",
14 | "service": "no"
15 | }
16 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/EntityWithServiceImpl.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [],
4 | "fields": [
5 | {
6 | "fieldName": "name",
7 | "fieldType": "String"
8 | }
9 | ],
10 | "changelogDate": "20160806123737",
11 | "entityTableName": "entity_with_service_impl",
12 | "dto": "no",
13 | "pagination": "no",
14 | "service": "serviceImpl"
15 | }
16 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/EntityWithServiceClass.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [],
4 | "fields": [
5 | {
6 | "fieldName": "name",
7 | "fieldType": "String"
8 | }
9 | ],
10 | "changelogDate": "20160806123736",
11 | "entityTableName": "entity_with_service_class",
12 | "dto": "no",
13 | "pagination": "no",
14 | "service": "serviceClass"
15 | }
16 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/EntityWithPaginationAndDTO.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [],
4 | "fields": [
5 | {
6 | "fieldName": "name",
7 | "fieldType": "String"
8 | }
9 | ],
10 | "changelogDate": "20160806123743",
11 | "entityTableName": "entity_with_pagination_and_dto",
12 | "dto": "mapstruct",
13 | "pagination": "pagination",
14 | "service": "no"
15 | }
16 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/EntityWithServiceClassAndDTO.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [],
4 | "fields": [
5 | {
6 | "fieldName": "name",
7 | "fieldType": "String"
8 | }
9 | ],
10 | "changelogDate": "20160806123741",
11 | "entityTableName": "entity_with_service_class_and_dto",
12 | "dto": "mapstruct",
13 | "pagination": "no",
14 | "service": "serviceClass"
15 | }
16 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/EntityWithServiceImplAndDTO.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [],
4 | "fields": [
5 | {
6 | "fieldName": "name",
7 | "fieldType": "String"
8 | }
9 | ],
10 | "changelogDate": "20160806123742",
11 | "entityTableName": "entity_with_service_impl_and_dto",
12 | "dto": "mapstruct",
13 | "pagination": "no",
14 | "service": "serviceImpl"
15 | }
16 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/EntityWithServiceClassAndPagination.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [],
4 | "fields": [
5 | {
6 | "fieldName": "name",
7 | "fieldType": "String"
8 | }
9 | ],
10 | "changelogDate": "20160806123739",
11 | "entityTableName": "entity_with_service_class_and_pagination",
12 | "dto": "no",
13 | "pagination": "pagination",
14 | "service": "serviceClass"
15 | }
16 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/EntityWithServiceImplAndPagination.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [],
4 | "fields": [
5 | {
6 | "fieldName": "name",
7 | "fieldType": "String"
8 | }
9 | ],
10 | "changelogDate": "20160806123740",
11 | "entityTableName": "entity_with_service_impl_and_pagination",
12 | "dto": "no",
13 | "pagination": "pagination",
14 | "service": "serviceImpl"
15 | }
16 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/EntityWithServiceImplPaginationAndDTO.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [],
4 | "fields": [
5 | {
6 | "fieldName": "name",
7 | "fieldType": "String"
8 | }
9 | ],
10 | "changelogDate": "20160806123745",
11 | "entityTableName": "entity_with_service_impl_pagination_and_dto",
12 | "dto": "mapstruct",
13 | "pagination": "pagination",
14 | "service": "serviceImpl"
15 | }
16 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/EntityWithServiceClassPaginationAndDTO.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [],
4 | "fields": [
5 | {
6 | "fieldName": "name",
7 | "fieldType": "String"
8 | }
9 | ],
10 | "changelogDate": "20160806123744",
11 | "entityTableName": "entity_with_service_class_pagination_and_dto",
12 | "dto": "mapstruct",
13 | "pagination": "pagination",
14 | "service": "serviceClass"
15 | }
16 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Licensed under the Apache License, Version 2.0 (the "License");
2 | you may not use this file except in compliance with the License.
3 | You may obtain a copy of the License at
4 |
5 | http://www.apache.org/licenses/LICENSE-2.0
6 |
7 | Unless required by applicable law or agreed to in writing, software
8 | distributed under the License is distributed on an "AS IS" BASIS,
9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | See the License for the specific language governing permissions and
11 | limitations under the License.
12 |
--------------------------------------------------------------------------------
/travis/install/04-cache.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -ev
3 | #-------------------------------------------------------------------------------
4 | # Check the cache from Travis
5 | #-------------------------------------------------------------------------------
6 | if [ ! -f "$HOME"/.m2/cache.txt ]; then
7 | echo "No cache.txt, generate one for the next time"
8 | echo "[$(date)] $JHIPSTER" > "$HOME"/.m2/cache.txt
9 | else
10 | echo "Found cache.txt"
11 | cat "$HOME"/.m2/cache.txt
12 | fi
13 |
14 | # no cache for first build
15 | if [ "$JHIPSTER_NODE_CACHE" == 0 ]; then
16 | rm -Rf $HOME/app/node_modules
17 | rm -Rf $HOME/app/node
18 | fi
19 |
--------------------------------------------------------------------------------
/generators/app/templates/src/main/webapp/app/entities/_entity-management-template.ejs:
--------------------------------------------------------------------------------
1 |
2 |
17 |
--------------------------------------------------------------------------------
/travis/scripts/01-generate-project.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -ev
3 | #-------------------------------------------------------------------------------
4 | # Force no insight
5 | #-------------------------------------------------------------------------------
6 | mkdir -p "$HOME"/.config/configstore/
7 | mv "$JHIPSTER_TRAVIS"/configstore/*.json "$HOME"/.config/configstore/
8 |
9 | #-------------------------------------------------------------------------------
10 | # Generate the project with yo jhipster
11 | #-------------------------------------------------------------------------------
12 | mkdir -p "$HOME"/app
13 | mv -f "$JHIPSTER_SAMPLES"/"$JHIPSTER"/.yo-rc.json "$HOME"/app/
14 | cd "$HOME"/app
15 | yo jhipster --force --no-insight
16 | ls -al "$HOME"/app
17 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/Label.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [
4 | {
5 | "relationshipName": "operation",
6 | "otherEntityName": "operation",
7 | "relationshipType": "many-to-many",
8 | "ownerSide": false,
9 | "otherEntityRelationshipName": "label"
10 | }
11 | ],
12 | "fields": [
13 | {
14 | "fieldName": "label",
15 | "fieldType": "String",
16 | "fieldValidateRules": [
17 | "required",
18 | "minlength"
19 | ],
20 | "fieldValidateRulesMinlength": "3"
21 | }
22 | ],
23 | "changelogDate": "20150805124936",
24 | "dto": "no",
25 | "pagination": "pagination",
26 | "service": "serviceClass"
27 | }
28 |
--------------------------------------------------------------------------------
/travis/install/02-install-jhipster-stack.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -ev
3 | #-------------------------------------------------------------------------------
4 | # Update npm
5 | #-------------------------------------------------------------------------------
6 | npm install -g npm
7 | #-------------------------------------------------------------------------------
8 | # Install yeoman, bower and gulp
9 | #-------------------------------------------------------------------------------
10 | npm install -g yo
11 | npm install -g bower
12 | npm install -g gulp-cli
13 | npm install -g generator-jhipster
14 | #-------------------------------------------------------------------------------
15 | # Install the latest version of JHipster
16 | #-------------------------------------------------------------------------------
17 | cd "$TRAVIS_BUILD_DIR"/
18 | npm install
19 | npm link
20 |
--------------------------------------------------------------------------------
/travis/samples/app-psql-es-noi18n/.yo-rc.json:
--------------------------------------------------------------------------------
1 | {
2 | "generator-jhipster": {
3 | "applicationType": "monolith",
4 | "baseName": "travisPsqlEsNoi18n",
5 | "packageName": "com.mycompany.myapp",
6 | "packageFolder": "com/mycompany/myapp",
7 | "authenticationType": "session",
8 | "hibernateCache": "ehcache",
9 | "clusteredHttpSession": "no",
10 | "websocket": "no",
11 | "databaseType": "sql",
12 | "devDatabaseType": "postgresql",
13 | "prodDatabaseType": "postgresql",
14 | "searchEngine": "elasticsearch",
15 | "useSass": true,
16 | "buildTool": "maven",
17 | "enableTranslation": false,
18 | "enableSocialSignIn": false,
19 | "rememberMeKey": "f19f0827c622eb9b81f5227a869ccd44932d78eb",
20 | "testFrameworks": [
21 | "gatling",
22 | "protractor"
23 | ],
24 | "serverPort": "8080",
25 | "jhiPrefix": "jhi",
26 | "travis": true
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/travis/samples/app-gateway/.yo-rc.json:
--------------------------------------------------------------------------------
1 | {
2 | "generator-jhipster": {
3 | "applicationType": "gateway",
4 | "baseName": "travisDefault",
5 | "packageName": "io.github.jhipster.travis",
6 | "packageFolder": "io/github/jhipster/travis",
7 | "authenticationType": "jwt",
8 | "hibernateCache": "ehcache",
9 | "clusteredHttpSession": "no",
10 | "websocket": "no",
11 | "databaseType": "sql",
12 | "devDatabaseType": "h2Disk",
13 | "prodDatabaseType": "mysql",
14 | "searchEngine": "no",
15 | "useSass": false,
16 | "buildTool": "maven",
17 | "enableTranslation": true,
18 | "nativeLanguage": "en",
19 | "languages": ["en", "fr"],
20 | "enableSocialSignIn": false,
21 | "rememberMeKey": "f19f0827c622eb9b81f5227a869ccd44932d78eb",
22 | "testFrameworks": [
23 | "gatling"
24 | ],
25 | "serverPort": "8080",
26 | "jhiPrefix": "jhi",
27 | "travis": true
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/travis/samples/app-mysql/.yo-rc.json:
--------------------------------------------------------------------------------
1 | {
2 | "generator-jhipster": {
3 | "applicationType": "monolith",
4 | "baseName": "travisMysql",
5 | "packageName": "io.github.jhipster.travis",
6 | "packageFolder": "io/github/jhipster/travis",
7 | "authenticationType": "session",
8 | "hibernateCache": "ehcache",
9 | "clusteredHttpSession": "no",
10 | "websocket": "no",
11 | "databaseType": "sql",
12 | "devDatabaseType": "mysql",
13 | "prodDatabaseType": "mysql",
14 | "searchEngine": "no",
15 | "useSass": false,
16 | "buildTool": "maven",
17 | "enableTranslation": true,
18 | "nativeLanguage": "en",
19 | "languages": ["en", "fr"],
20 | "enableSocialSignIn": false,
21 | "rememberMeKey": "f19f0827c622eb9b81f5227a869ccd44932d78eb",
22 | "testFrameworks": [
23 | "gatling",
24 | "protractor"
25 | ],
26 | "serverPort": "8080",
27 | "jhiPrefix": "jhi",
28 | "travis": true
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/travis/samples/app-default-from-scratch/.yo-rc.json:
--------------------------------------------------------------------------------
1 | {
2 | "generator-jhipster": {
3 | "applicationType": "monolith",
4 | "baseName": "jhipsterSampleApplication",
5 | "packageName": "io.github.jhipster.sample",
6 | "packageFolder": "io/github/jhipster/sample",
7 | "authenticationType": "session",
8 | "hibernateCache": "ehcache",
9 | "clusteredHttpSession": "no",
10 | "websocket": "no",
11 | "databaseType": "sql",
12 | "devDatabaseType": "h2Disk",
13 | "prodDatabaseType": "mysql",
14 | "searchEngine": "no",
15 | "useSass": false,
16 | "buildTool": "maven",
17 | "enableTranslation": true,
18 | "nativeLanguage": "en",
19 | "languages": ["en", "fr"],
20 | "enableSocialSignIn": false,
21 | "rememberMeKey": "f19f0827c622eb9b81f5227a869ccd44932d78eb",
22 | "testFrameworks": [
23 | "gatling"
24 | ],
25 | "serverPort": "8080",
26 | "jhiPrefix": "jhi",
27 | "travis": true
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/travis/samples/app-gradle/.yo-rc.json:
--------------------------------------------------------------------------------
1 | {
2 | "generator-jhipster": {
3 | "applicationType": "monolith",
4 | "baseName": "travisGradle",
5 | "packageName": "io.github.jhipster.travis",
6 | "packageFolder": "io/github/jhipster/travis",
7 | "authenticationType": "session",
8 | "hibernateCache": "ehcache",
9 | "clusteredHttpSession": "no",
10 | "websocket": "no",
11 | "databaseType": "sql",
12 | "devDatabaseType": "h2Disk",
13 | "prodDatabaseType": "mysql",
14 | "searchEngine": "no",
15 | "useSass": false,
16 | "buildTool": "gradle",
17 | "enableTranslation": true,
18 | "nativeLanguage": "en",
19 | "languages": ["en", "fr"],
20 | "enableSocialSignIn": false,
21 | "rememberMeKey": "f19f0827c622eb9b81f5227a869ccd44932d78eb",
22 | "testFrameworks": [
23 | "gatling",
24 | "protractor"
25 | ],
26 | "serverPort": "8080",
27 | "jhiPrefix": "jhi",
28 | "travis": true
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/generators/app/templates/src/main/webapp/app/entities/tpl/_entity-box-header-template.ejs:
--------------------------------------------------------------------------------
1 | <%_ var keyPrefix = angularAppName + '.'+ entityTranslationKey + '.'; _%>
2 |
18 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/Operation.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [
4 | {
5 | "relationshipName": "bankAccount",
6 | "otherEntityName": "bankAccount",
7 | "relationshipType": "many-to-one",
8 | "otherEntityField": "name"
9 | },
10 | {
11 | "relationshipName": "label",
12 | "otherEntityName": "label",
13 | "relationshipType": "many-to-many",
14 | "otherEntityField": "label",
15 | "ownerSide": true,
16 | "otherEntityRelationshipName": "operation"
17 | }
18 | ],
19 | "fields": [
20 | {
21 | "fieldName": "date",
22 | "fieldType": "ZonedDateTime",
23 | "fieldValidateRules": [
24 | "required"
25 | ]
26 | },
27 | {
28 | "fieldName": "description",
29 | "fieldType": "String"
30 | },
31 | {
32 | "fieldName": "amount",
33 | "fieldType": "BigDecimal",
34 | "fieldValidateRules": [
35 | "required"
36 | ]
37 | }
38 | ],
39 | "changelogDate": "20150805125054",
40 | "dto": "no",
41 | "service": "no",
42 | "pagination": "infinite-scroll"
43 | }
44 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "generator-jhipster-angular-datatables",
3 | "version": "1.3.11",
4 | "description": "JHipster module to change default grid with Angular DataTables",
5 | "homepage": "https://github.com/hermeslm/generator-jhipster-angular-datatables",
6 | "author": {
7 | "name": "Hermes Lorenzo",
8 | "email": "hermeslm@gmail.com",
9 | "url": "https://www.linkedin.com/in/hermeslm"
10 | },
11 | "files": [
12 | "generators/app"
13 | ],
14 | "main": "generators/app/index.js",
15 | "keywords": [
16 | "yeoman-generator",
17 | "jhipster-module",
18 | "Jhipster",
19 | "Entity",
20 | "Angular",
21 | "DataTables",
22 | "angular-datatables"
23 | ],
24 | "dependencies": {
25 | "chalk": "1.1.1",
26 | "generator-jhipster": "^3.6.0",
27 | "glob": "^7.0.3",
28 | "semver": "5.1.0",
29 | "yeoman-generator": "^0.22.5"
30 | },
31 | "devDependencies": {
32 | "gulp": "^3.9.0",
33 | "gulp-bump": "2.0.1",
34 | "gulp-eslint": "2.0.0",
35 | "gulp-exclude-gitignore": "1.0.0",
36 | "gulp-git": "1.7.0",
37 | "gulp-istanbul": "0.10.3",
38 | "gulp-mocha": "2.2.0",
39 | "gulp-nsp": "2.3.1",
40 | "gulp-plumber": "1.1.0",
41 | "gulp-rename": "^1.2.0",
42 | "gulp-sequence": "0.4.5",
43 | "gulp-shell": "^0.5.1",
44 | "yeoman-assert": "2.1.1"
45 | },
46 | "repository": {
47 | "type": "git",
48 | "url": "git+https://github.com/hermeslm/generator-jhipster-angular-datatables"
49 | },
50 | "license": "Apache-2.0",
51 | "bugs": {
52 | "url": "https://github.com/hermeslm/generator-jhipster-angular-datatables/issues"
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | os:
2 | - linux
3 | services:
4 | - docker
5 | language: node_js
6 | node_js:
7 | - "4.5.0"
8 | jdk:
9 | - oraclejdk8
10 | cache:
11 | directories:
12 | - node_modules
13 | - $HOME/.m2
14 | - $HOME/.gradle
15 | - $HOME/app/node_modules
16 | - $HOME/app/node
17 | env:
18 | global:
19 | - PROFILE=dev
20 | - RUN_APP=1
21 | - PROTRACTOR=0
22 | - JHIPSTER_TRAVIS=$TRAVIS_BUILD_DIR/travis
23 | - JHIPSTER_INSTALL=$JHIPSTER_TRAVIS/install
24 | - JHIPSTER_SAMPLES=$JHIPSTER_TRAVIS/samples
25 | - JHIPSTER_SCRIPTS=$JHIPSTER_TRAVIS/scripts
26 | matrix:
27 | - JHIPSTER=app-default-from-scratch JHIPSTER_NODE_CACHE=0 PROFILE=prod RUN_APP=0
28 | - JHIPSTER=app-gradle PROTRACTOR=1
29 | - JHIPSTER=app-mysql PROFILE=prod PROTRACTOR=1
30 | - JHIPSTER=app-psql-es-noi18n PROFILE=prod PROTRACTOR=1
31 | - JHIPSTER=app-gateway
32 | before_install:
33 | - sudo /etc/init.d/postgresql stop
34 | - export DISPLAY=:99.0
35 | - sh -e /etc/init.d/xvfb start
36 | - chmod +x $JHIPSTER_INSTALL/02-install-jhipster-stack.sh
37 | - chmod +x $JHIPSTER_INSTALL/03-checkVersion.sh
38 | - chmod +x $JHIPSTER_INSTALL/04-cache.sh
39 | install:
40 | - $JHIPSTER_INSTALL/02-install-jhipster-stack.sh
41 | - $JHIPSTER_INSTALL/03-checkVersion.sh
42 | - $JHIPSTER_INSTALL/04-cache.sh
43 | before_script:
44 | - chmod +x $JHIPSTER_SCRIPTS/01-generate-project.sh
45 | - chmod +x $JHIPSTER_SCRIPTS/02-generate-entities.sh
46 | - chmod +x $JHIPSTER_SCRIPTS/03-generate-audit.sh
47 | - chmod +x $JHIPSTER_SCRIPTS/04-tests.sh
48 | - chmod +x $JHIPSTER_SCRIPTS/05-run.sh
49 | script:
50 | - $JHIPSTER_SCRIPTS/01-generate-project.sh
51 | - $JHIPSTER_SCRIPTS/02-generate-entities.sh
52 | - $JHIPSTER_SCRIPTS/03-generate-audit.sh
53 | - $JHIPSTER_SCRIPTS/04-tests.sh
54 | - $JHIPSTER_SCRIPTS/05-run.sh
55 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/TestPager.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [
4 | {
5 | "relationshipName": "testManyToOne",
6 | "otherEntityName": "testManyToOne",
7 | "relationshipType": "one-to-many",
8 | "otherEntityRelationshipName": "testPager"
9 | },
10 | {
11 | "relationshipName": "testManyToMany",
12 | "otherEntityName": "testManyToMany",
13 | "relationshipType": "many-to-many",
14 | "ownerSide": false,
15 | "otherEntityRelationshipName": "testPager"
16 | },
17 | {
18 | "relationshipName": "testOneToOne",
19 | "otherEntityName": "testOneToOne",
20 | "relationshipType": "one-to-one",
21 | "ownerSide": false,
22 | "otherEntityRelationshipName": "testPager"
23 | },
24 | {
25 | "relationshipName": "userOneToMany",
26 | "otherEntityName": "user",
27 | "relationshipType": "many-to-one",
28 | "otherEntityField": "login"
29 | },
30 | {
31 | "relationshipName": "userManyToMany",
32 | "otherEntityName": "user",
33 | "relationshipType": "many-to-many",
34 | "otherEntityField": "login",
35 | "ownerSide": true
36 | },
37 | {
38 | "relationshipName": "userOneToOne",
39 | "otherEntityName": "user",
40 | "relationshipType": "one-to-one",
41 | "otherEntityField": "login",
42 | "ownerSide": true,
43 | "otherEntityRelationshipName": "parent"
44 | }
45 | ],
46 | "fields": [],
47 | "changelogDate": "20160208210109",
48 | "dto": "no",
49 | "service": "no",
50 | "pagination": "pager"
51 | }
52 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/TestMapstruct.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [
4 | {
5 | "relationshipName": "testManyToOne",
6 | "otherEntityName": "testManyToOne",
7 | "relationshipType": "one-to-many",
8 | "otherEntityRelationshipName": "testMapstruct"
9 | },
10 | {
11 | "relationshipName": "testManyToMany",
12 | "otherEntityName": "testManyToMany",
13 | "relationshipType": "many-to-many",
14 | "ownerSide": false,
15 | "otherEntityRelationshipName": "testMapstruct"
16 | },
17 | {
18 | "relationshipName": "testOneToOne",
19 | "otherEntityName": "testOneToOne",
20 | "relationshipType": "one-to-one",
21 | "ownerSide": false,
22 | "otherEntityRelationshipName": "testMapstruct"
23 | },
24 | {
25 | "relationshipName": "userOneToMany",
26 | "otherEntityName": "user",
27 | "relationshipType": "many-to-one",
28 | "otherEntityField": "login"
29 | },
30 | {
31 | "relationshipName": "userManyToMany",
32 | "otherEntityName": "user",
33 | "relationshipType": "many-to-many",
34 | "otherEntityField": "login",
35 | "ownerSide": true
36 | },
37 | {
38 | "relationshipName": "userOneToOne",
39 | "otherEntityName": "user",
40 | "relationshipType": "one-to-one",
41 | "otherEntityField": "login",
42 | "ownerSide": true,
43 | "otherEntityRelationshipName": "parent"
44 | }
45 | ],
46 | "fields": [],
47 | "changelogDate": "20160208210109",
48 | "dto": "mapstruct",
49 | "service": "no",
50 | "pagination": "no"
51 | }
52 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/TestPagination.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [
4 | {
5 | "relationshipName": "testManyToOne",
6 | "otherEntityName": "testManyToOne",
7 | "relationshipType": "one-to-many",
8 | "otherEntityRelationshipName": "testPagination"
9 | },
10 | {
11 | "relationshipName": "testManyToMany",
12 | "otherEntityName": "testManyToMany",
13 | "relationshipType": "many-to-many",
14 | "ownerSide": false,
15 | "otherEntityRelationshipName": "testPagination"
16 | },
17 | {
18 | "relationshipName": "testOneToOne",
19 | "otherEntityName": "testOneToOne",
20 | "relationshipType": "one-to-one",
21 | "ownerSide": false,
22 | "otherEntityRelationshipName": "testPagination"
23 | },
24 | {
25 | "relationshipName": "userOneToMany",
26 | "otherEntityName": "user",
27 | "relationshipType": "many-to-one",
28 | "otherEntityField": "login"
29 | },
30 | {
31 | "relationshipName": "userManyToMany",
32 | "otherEntityName": "user",
33 | "relationshipType": "many-to-many",
34 | "otherEntityField": "login",
35 | "ownerSide": true
36 | },
37 | {
38 | "relationshipName": "userOneToOne",
39 | "otherEntityName": "user",
40 | "relationshipType": "one-to-one",
41 | "otherEntityField": "login",
42 | "ownerSide": true,
43 | "otherEntityRelationshipName": "parent"
44 | }
45 | ],
46 | "fields": [],
47 | "changelogDate": "20160208210109",
48 | "dto": "no",
49 | "service": "no",
50 | "pagination": "pagination"
51 | }
52 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/TestServiceImpl.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [
4 | {
5 | "relationshipName": "testManyToOne",
6 | "otherEntityName": "testManyToOne",
7 | "relationshipType": "one-to-many",
8 | "otherEntityRelationshipName": "testServiceImpl"
9 | },
10 | {
11 | "relationshipName": "testManyToMany",
12 | "otherEntityName": "testManyToMany",
13 | "relationshipType": "many-to-many",
14 | "ownerSide": false,
15 | "otherEntityRelationshipName": "testServiceImpl"
16 | },
17 | {
18 | "relationshipName": "testOneToOne",
19 | "otherEntityName": "testOneToOne",
20 | "relationshipType": "one-to-one",
21 | "ownerSide": false,
22 | "otherEntityRelationshipName": "testServiceImpl"
23 | },
24 | {
25 | "relationshipName": "userOneToMany",
26 | "otherEntityName": "user",
27 | "relationshipType": "many-to-one",
28 | "otherEntityField": "login"
29 | },
30 | {
31 | "relationshipName": "userManyToMany",
32 | "otherEntityName": "user",
33 | "relationshipType": "many-to-many",
34 | "otherEntityField": "login",
35 | "ownerSide": true
36 | },
37 | {
38 | "relationshipName": "userOneToOne",
39 | "otherEntityName": "user",
40 | "relationshipType": "one-to-one",
41 | "otherEntityField": "login",
42 | "ownerSide": true,
43 | "otherEntityRelationshipName": "parent"
44 | }
45 | ],
46 | "fields": [],
47 | "changelogDate": "20160208210109",
48 | "dto": "no",
49 | "service": "serviceImpl",
50 | "pagination": "no"
51 | }
52 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/TestServiceClass.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [
4 | {
5 | "relationshipName": "testManyToOne",
6 | "otherEntityName": "testManyToOne",
7 | "relationshipType": "one-to-many",
8 | "otherEntityRelationshipName": "testServiceClass"
9 | },
10 | {
11 | "relationshipName": "testManyToMany",
12 | "otherEntityName": "testManyToMany",
13 | "relationshipType": "many-to-many",
14 | "ownerSide": false,
15 | "otherEntityRelationshipName": "testServiceClass"
16 | },
17 | {
18 | "relationshipName": "testOneToOne",
19 | "otherEntityName": "testOneToOne",
20 | "relationshipType": "one-to-one",
21 | "ownerSide": false,
22 | "otherEntityRelationshipName": "testServiceClass"
23 | },
24 | {
25 | "relationshipName": "userOneToMany",
26 | "otherEntityName": "user",
27 | "relationshipType": "many-to-one",
28 | "otherEntityField": "login"
29 | },
30 | {
31 | "relationshipName": "userManyToMany",
32 | "otherEntityName": "user",
33 | "relationshipType": "many-to-many",
34 | "otherEntityField": "login",
35 | "ownerSide": true
36 | },
37 | {
38 | "relationshipName": "userOneToOne",
39 | "otherEntityName": "user",
40 | "relationshipType": "one-to-one",
41 | "otherEntityField": "login",
42 | "ownerSide": true,
43 | "otherEntityRelationshipName": "parent"
44 | }
45 | ],
46 | "fields": [],
47 | "changelogDate": "20160208210109",
48 | "dto": "no",
49 | "service": "serviceClass",
50 | "pagination": "no"
51 | }
52 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/TestInfiniteScroll.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [
4 | {
5 | "relationshipName": "testManyToOne",
6 | "otherEntityName": "testManyToOne",
7 | "relationshipType": "one-to-many",
8 | "otherEntityRelationshipName": "testInfiniteScroll"
9 | },
10 | {
11 | "relationshipName": "testManyToMany",
12 | "otherEntityName": "testManyToMany",
13 | "relationshipType": "many-to-many",
14 | "ownerSide": false,
15 | "otherEntityRelationshipName": "testInfiniteScroll"
16 | },
17 | {
18 | "relationshipName": "testOneToOne",
19 | "otherEntityName": "testOneToOne",
20 | "relationshipType": "one-to-one",
21 | "ownerSide": false,
22 | "otherEntityRelationshipName": "testInfiniteScroll"
23 | },
24 | {
25 | "relationshipName": "userOneToMany",
26 | "otherEntityName": "user",
27 | "relationshipType": "many-to-one",
28 | "otherEntityField": "login"
29 | },
30 | {
31 | "relationshipName": "userManyToMany",
32 | "otherEntityName": "user",
33 | "relationshipType": "many-to-many",
34 | "otherEntityField": "login",
35 | "ownerSide": true
36 | },
37 | {
38 | "relationshipName": "userOneToOne",
39 | "otherEntityName": "user",
40 | "relationshipType": "one-to-one",
41 | "otherEntityField": "login",
42 | "ownerSide": true,
43 | "otherEntityRelationshipName": "parent"
44 | }
45 | ],
46 | "fields": [],
47 | "changelogDate": "20160208210109",
48 | "dto": "no",
49 | "service": "no",
50 | "pagination": "infinite-scroll"
51 | }
52 |
--------------------------------------------------------------------------------
/generators/app/templates/src/main/webapp/app/entities/_entity-management.controller.ejs:
--------------------------------------------------------------------------------
1 | (function() {
2 | 'use strict';
3 |
4 | angular
5 | .module('<%=angularAppName%>')
6 | .controller('<%= entityAngularJSName %>Controller', <%= entityAngularJSName %>Controller);
7 |
8 | <%= entityAngularJSName %>Controller.$inject = ['$scope', '$state'<% if (fieldsContainBlob) { %>, 'DataUtils'<% } %>, '<%= entityClass %>'<% if (searchEngine == 'elasticsearch') { %>, '<%= entityClass %>Search'<% } %><% if (pagination != 'no') { %>, 'ParseLinks', 'AlertService', 'paginationConstants'<% } %> <%_ if (pagination == 'pager' || pagination == 'pagination'){ %>, 'pagingParams'<% } %>, '$q', 'DTColumnBuilder' , 'DTOptionsBuilder', 'GUIUtils', '$filter', '$compile'];
9 |
10 | function <%= entityAngularJSName %>Controller ($scope, $state<% if (fieldsContainBlob) { %>, DataUtils<% } %>, <%= entityClass %><% if (searchEngine == 'elasticsearch') { %>, <%= entityClass %>Search<% } %><% if (pagination != 'no') { %>, ParseLinks, AlertService, paginationConstants<% } %> <%_ if (pagination == 'pager' || pagination == 'pagination'){ %>, pagingParams<% } %>, $q, DTColumnBuilder, DTOptionsBuilder, GUIUtils, $filter, $compile ) {
11 | var vm = this;
12 | <%_ if (useTemplate) { _%>
13 | vm.title = '<%= entityClassPluralHumanized %>';
14 | vm.entityClassHumanized = '<%= entityClassHumanized %>';
15 | vm.entityStateName = '<%= entityStateName %>';
16 | <% if (enableTranslation) { %>
17 | vm.searchPlaceHolder = '<%=angularAppName%>.<%= entityInstance %>.home.search';
18 | <% } %>
19 | <%_ }_%>
20 | <%_ if (pagination == 'pagination' || pagination == 'pager') { _%>
21 | <%- include('pagination-template'); -%>
22 | <%_ } else if (pagination == 'infinite-scroll') { _%>
23 | <%- include('infinite-scroll-template'); -%>
24 | <%_ } else { _%>
25 | <%- include('no-pagination-template'); -%>
26 | <%_ } _%>
27 |
28 | }
29 | })();
30 |
--------------------------------------------------------------------------------
/travis/scripts/05-run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #-------------------------------------------------------------------------------
4 | # Functions
5 | #-------------------------------------------------------------------------------
6 | launchProtractor() {
7 | retryCount=1
8 | maxRetry=10
9 | httpUrl="http://localhost:8080"
10 |
11 | rep=$(curl -v "$httpUrl")
12 | status=$?
13 | while [ "$status" -ne 0 ] && [ "$retryCount" -le "$maxRetry" ]; do
14 | echo "[$(date)] Application not reachable yet. Sleep and retry - retryCount =" $retryCount "/" $maxRetry
15 | retryCount=$((retryCount+1))
16 | sleep 10
17 | rep=$(curl -v "$httpUrl")
18 | status=$?
19 | done
20 |
21 | if [ "$status" -ne 0 ]; then
22 | echo "[$(date)] Not connected after" $retryCount " retries. Abort protractor tests."
23 | exit 0
24 | fi
25 |
26 | echo "[$(date)] Connected to application. Start protractor tests."
27 | gulp itest --no-notification
28 | }
29 |
30 | #-------------------------------------------------------------------------------
31 | # Start the application
32 | #-------------------------------------------------------------------------------
33 | cd "$HOME"/app
34 |
35 | if [ -f "mvnw" ]; then
36 | ./mvnw package -DskipTests=true -P"$PROFILE"
37 | mv target/*.war app.war
38 | elif [ -f "gradlew" ]; then
39 | ./gradlew bootRepackage -P"$PROFILE" -x test
40 | mv build/libs/*.war app.war
41 | else
42 | echo "No mvnw or gradlew"
43 | exit 0
44 | fi
45 | if [ $? -ne 0 ]; then
46 | echo "Error when packaging"
47 | exit 1
48 | fi
49 |
50 | if [ "$RUN_APP" == 1 ]; then
51 | java -jar app.war --spring.profiles.active="$PROFILE" &
52 | sleep 20
53 | #-------------------------------------------------------------------------------
54 | # Launch protractor tests
55 | #-------------------------------------------------------------------------------
56 | if [ "$PROTRACTOR" == 1 ]; then
57 | launchProtractor
58 | fi
59 | fi
60 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/TestManyToOne.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [
4 | {
5 | "relationshipName": "testEntity",
6 | "otherEntityName": "testEntity",
7 | "relationshipType": "many-to-one",
8 | "otherEntityField": "id"
9 | },
10 | {
11 | "relationshipName": "testMapstruct",
12 | "otherEntityName": "testMapstruct",
13 | "relationshipType": "many-to-one",
14 | "otherEntityField": "id"
15 | },
16 | {
17 | "relationshipName": "testServiceClass",
18 | "otherEntityName": "testServiceClass",
19 | "relationshipType": "many-to-one",
20 | "otherEntityField": "id"
21 | },
22 | {
23 | "relationshipName": "testServiceImpl",
24 | "otherEntityName": "testServiceImpl",
25 | "relationshipType": "many-to-one",
26 | "otherEntityField": "id"
27 | },
28 | {
29 | "relationshipName": "testInfiniteScroll",
30 | "otherEntityName": "testInfiniteScroll",
31 | "relationshipType": "many-to-one",
32 | "otherEntityField": "id"
33 | },
34 | {
35 | "relationshipName": "testPager",
36 | "otherEntityName": "testPager",
37 | "relationshipType": "many-to-one",
38 | "otherEntityField": "id"
39 | },
40 | {
41 | "relationshipName": "testPagination",
42 | "otherEntityName": "testPagination",
43 | "relationshipType": "many-to-one",
44 | "otherEntityField": "id"
45 | },
46 | {
47 | "relationshipName": "testCustomTableName",
48 | "otherEntityName": "testCustomTableName",
49 | "relationshipType": "many-to-one",
50 | "otherEntityField": "id"
51 | }
52 | ],
53 | "fields": [],
54 | "changelogDate": "20160208211440",
55 | "dto": "no",
56 | "service": "no",
57 | "pagination": "no"
58 | }
59 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/TestEntity.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [
4 | {
5 | "relationshipName": "testManyToOne",
6 | "otherEntityName": "testManyToOne",
7 | "relationshipType": "one-to-many",
8 | "otherEntityRelationshipName": "testEntity"
9 | },
10 | {
11 | "relationshipName": "testManyToMany",
12 | "otherEntityName": "testManyToMany",
13 | "relationshipType": "many-to-many",
14 | "ownerSide": false,
15 | "otherEntityRelationshipName": "testEntity"
16 | },
17 | {
18 | "relationshipName": "testOneToOne",
19 | "otherEntityName": "testOneToOne",
20 | "relationshipType": "one-to-one",
21 | "ownerSide": false,
22 | "otherEntityRelationshipName": "testEntity"
23 | },
24 | {
25 | "relationshipName": "userOneToMany",
26 | "otherEntityName": "user",
27 | "relationshipType": "many-to-one",
28 | "otherEntityField": "login"
29 | },
30 | {
31 | "relationshipName": "userManyToMany",
32 | "otherEntityName": "user",
33 | "relationshipType": "many-to-many",
34 | "otherEntityField": "login",
35 | "ownerSide": true
36 | },
37 | {
38 | "relationshipName": "userOneToOne",
39 | "otherEntityName": "user",
40 | "relationshipType": "one-to-one",
41 | "otherEntityField": "login",
42 | "ownerSide": true,
43 | "otherEntityRelationshipName": "parent"
44 | },
45 | {
46 | "relationshipName": "testCustomTableName",
47 | "otherEntityName": "testCustomTableName",
48 | "relationshipType": "one-to-many",
49 | "otherEntityRelationshipName": "testEntity"
50 | }
51 | ],
52 | "fields": [],
53 | "changelogDate": "20160208210109",
54 | "dto": "no",
55 | "service": "no",
56 | "pagination": "no"
57 | }
58 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/TestCustomTableName.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [
4 | {
5 | "relationshipName": "testManyToOne",
6 | "otherEntityName": "testManyToOne",
7 | "relationshipType": "one-to-many",
8 | "otherEntityRelationshipName": "testCustomTableName"
9 | },
10 | {
11 | "relationshipName": "testManyToMany",
12 | "otherEntityName": "testManyToMany",
13 | "relationshipType": "many-to-many",
14 | "ownerSide": false,
15 | "otherEntityRelationshipName": "testCustomTableName"
16 | },
17 | {
18 | "relationshipName": "testOneToOne",
19 | "otherEntityName": "testOneToOne",
20 | "relationshipType": "one-to-one",
21 | "ownerSide": false,
22 | "otherEntityRelationshipName": "testCustomTableName"
23 | },
24 | {
25 | "relationshipName": "testEntity",
26 | "otherEntityName": "testEntity",
27 | "relationshipType": "many-to-one",
28 | "otherEntityField": "id"
29 | },
30 | {
31 | "relationshipName": "userOneToMany",
32 | "otherEntityName": "user",
33 | "relationshipType": "many-to-one",
34 | "otherEntityField": "login"
35 | },
36 | {
37 | "relationshipName": "userManyToMany",
38 | "otherEntityName": "user",
39 | "relationshipType": "many-to-many",
40 | "otherEntityField": "login",
41 | "ownerSide": true
42 | },
43 | {
44 | "relationshipName": "userOneToOne",
45 | "otherEntityName": "user",
46 | "relationshipType": "one-to-one",
47 | "otherEntityField": "login",
48 | "ownerSide": true,
49 | "otherEntityRelationshipName": "parent"
50 | }
51 | ],
52 | "fields": [],
53 | "changelogDate": "20160208210109",
54 | "dto": "no",
55 | "service": "no",
56 | "entityTableName": "test_custom_table_name_entity",
57 | "pagination": "no"
58 | }
59 |
--------------------------------------------------------------------------------
/generators/app/templates/src/main/webapp/app/entities/_entity-management.ejs:
--------------------------------------------------------------------------------
1 | <%_ var keyPrefix = angularAppName + '.'+ entityTranslationKey + '.'; _%>
2 |
6 |
45 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/TestManyToMany.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [
4 | {
5 | "relationshipName": "testEntity",
6 | "otherEntityName": "testEntity",
7 | "relationshipType": "many-to-many",
8 | "otherEntityField": "id",
9 | "ownerSide": true
10 | },
11 | {
12 | "relationshipName": "testMapstruct",
13 | "otherEntityName": "testMapstruct",
14 | "relationshipType": "many-to-many",
15 | "otherEntityField": "id",
16 | "ownerSide": true
17 | },
18 | {
19 | "relationshipName": "testServiceClass",
20 | "otherEntityName": "testServiceClass",
21 | "relationshipType": "many-to-many",
22 | "otherEntityField": "id",
23 | "ownerSide": true
24 | },
25 | {
26 | "relationshipName": "testServiceImpl",
27 | "otherEntityName": "testServiceImpl",
28 | "relationshipType": "many-to-many",
29 | "otherEntityField": "id",
30 | "ownerSide": true
31 | },
32 | {
33 | "relationshipName": "testInfiniteScroll",
34 | "otherEntityName": "testInfiniteScroll",
35 | "relationshipType": "many-to-many",
36 | "otherEntityField": "id",
37 | "ownerSide": true
38 | },
39 | {
40 | "relationshipName": "testPager",
41 | "otherEntityName": "testPager",
42 | "relationshipType": "many-to-many",
43 | "otherEntityField": "id",
44 | "ownerSide": true
45 | },
46 | {
47 | "relationshipName": "testPagination",
48 | "otherEntityName": "testPagination",
49 | "relationshipType": "many-to-many",
50 | "otherEntityField": "id",
51 | "ownerSide": true
52 | },
53 | {
54 | "relationshipName": "testCustomTableName",
55 | "otherEntityName": "testCustomTableName",
56 | "relationshipType": "many-to-many",
57 | "otherEntityField": "id",
58 | "ownerSide": true
59 | }
60 | ],
61 | "fields": [],
62 | "changelogDate": "20160208210534",
63 | "dto": "no",
64 | "service": "no",
65 | "pagination": "no"
66 | }
67 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/BankAccount.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [
4 | {
5 | "relationshipName": "user",
6 | "otherEntityName": "user",
7 | "relationshipType": "many-to-one",
8 | "otherEntityField": "login"
9 | },
10 | {
11 | "relationshipName": "operation",
12 | "otherEntityName": "operation",
13 | "relationshipType": "one-to-many",
14 | "otherEntityRelationshipName": "bankAccount"
15 | }
16 | ],
17 | "fields": [
18 | {
19 | "fieldName": "name",
20 | "fieldType": "String",
21 | "fieldValidateRules": [
22 | "required"
23 | ]
24 | },
25 | {
26 | "fieldName": "bankNumber",
27 | "fieldType": "Integer"
28 | },
29 | {
30 | "fieldName": "agencyNumber",
31 | "fieldType": "Long"
32 | },
33 | {
34 | "fieldName": "lastOperationDuration",
35 | "fieldType": "Float"
36 | },
37 | {
38 | "fieldName": "meanOperationDuration",
39 | "fieldType": "Double"
40 | },
41 | {
42 | "fieldName": "balance",
43 | "fieldType": "BigDecimal",
44 | "fieldValidateRules": [
45 | "required"
46 | ]
47 | },
48 | {
49 | "fieldName": "openingDay",
50 | "fieldType": "LocalDate"
51 | },
52 | {
53 | "fieldName": "lastOperationDate",
54 | "fieldType": "ZonedDateTime"
55 | },
56 | {
57 | "fieldName": "active",
58 | "fieldType": "Boolean"
59 | },
60 | {
61 | "fieldName": "accountType",
62 | "fieldType": "BankAccountType",
63 | "fieldValues": "CHECKING,SAVINGS,LOAN"
64 | },
65 | {
66 | "fieldName": "attachment",
67 | "fieldType": "byte[]",
68 | "fieldTypeBlobContent": "any"
69 | },
70 | {
71 | "fieldName": "description",
72 | "fieldType": "byte[]",
73 | "fieldTypeBlobContent": "text"
74 | }
75 | ],
76 | "changelogDate": "20150805124838",
77 | "dto": "mapstruct",
78 | "pagination": "no",
79 | "service": "serviceImpl"
80 | }
81 |
--------------------------------------------------------------------------------
/generators/app/templates/src/main/webapp/app/entities/no-pagination-template.ejs:
--------------------------------------------------------------------------------
1 | vm.<%= entityInstancePlural %> = [];
2 | <%_ if (fieldsContainBlob) { _%>
3 | vm.openFile = DataUtils.openFile;
4 | vm.byteSize = DataUtils.byteSize;
5 | <%_ } _%>
6 | <%_ if (searchEngine == 'elasticsearch') { _%>
7 | vm.search = search;
8 | vm.loadAll = loadAll;
9 | vm.dtInstance = {};
10 |
11 | <%_ } _%>
12 |
13 | loadAll();
14 |
15 | vm.dtOptions = DTOptionsBuilder.fromFnPromise(function() {
16 | var defer = $q.defer();
17 | if (!vm.searchQuery || vm.searchQuery == '') {
18 | <%= entityClass %>.query(function(result) {
19 | vm.<%= entityInstancePlural %> = result;
20 | defer.resolve(result);
21 | });
22 | }else {
23 | defer.resolve($filter('filter')(vm.<%= entityInstancePlural %>, vm.searchQuery, undefined));
24 | }
25 | return defer.promise;
26 | }).withPaginationType('full_numbers').withBootstrap().withDOM('tip')/*.withOption('scrollX', '100%')*/
27 | .withOption('fnRowCallback', function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
28 | $compile(nRow)($scope);
29 | });
30 |
31 | vm.dtColumns = [
32 | <%_
33 | for (idx in fields) {
34 | var fieldName = fields[idx].fieldName;
35 | var fieldNameCapitalized = fields[idx].fieldNameCapitalized;
36 | if(idx > 4){
37 | _%>
38 | //DTColumnBuilder.newColumn('<%= fieldName %>').withTitle('<%= fieldNameCapitalized %>'),
39 | <%_
40 | }else{ _%>
41 | DTColumnBuilder.newColumn('<%= fieldName %>').withTitle('<%= fieldNameCapitalized %>'),
42 | <%_ }
43 | } _%>
44 | DTColumnBuilder.newColumn(null).withTitle('Actions').withOption('width', '155px').notSortable()
45 | .renderWith(actionsHtml)
46 | ];
47 |
48 | function loadAll() {
49 | <%= entityClass %>.query(function(result) {
50 | vm.<%= entityInstancePlural %> = result;
51 | vm.searchQuery = null;
52 | });
53 | }
54 |
55 | function actionsHtml(data, type, full, meta){
56 | return GUIUtils.getActionsTemplate(data, $state.current.name, ['all']);
57 | }
58 |
59 | function search() {
60 | vm.dtInstance.reloadData();
61 | }
62 |
--------------------------------------------------------------------------------
/travis/samples/.jhipster/TestOneToOne.json:
--------------------------------------------------------------------------------
1 | {
2 | "fluentMethods": true,
3 | "relationships": [
4 | {
5 | "relationshipName": "testEntity",
6 | "otherEntityName": "testEntity",
7 | "relationshipType": "one-to-one",
8 | "otherEntityField": "id",
9 | "ownerSide": true,
10 | "otherEntityRelationshipName": "testOneToOne"
11 | },
12 | {
13 | "relationshipName": "testMapstruct",
14 | "otherEntityName": "testMapstruct",
15 | "relationshipType": "one-to-one",
16 | "otherEntityField": "id",
17 | "ownerSide": true,
18 | "otherEntityRelationshipName": "testOneToOne"
19 | },
20 | {
21 | "relationshipName": "testServiceClass",
22 | "otherEntityName": "testServiceClass",
23 | "relationshipType": "one-to-one",
24 | "otherEntityField": "id",
25 | "ownerSide": true,
26 | "otherEntityRelationshipName": "testOneToOne"
27 | },
28 | {
29 | "relationshipName": "testServiceImpl",
30 | "otherEntityName": "testServiceImpl",
31 | "relationshipType": "one-to-one",
32 | "otherEntityField": "id",
33 | "ownerSide": true,
34 | "otherEntityRelationshipName": "testOneToOne"
35 | },
36 | {
37 | "relationshipName": "testInfiniteScroll",
38 | "otherEntityName": "testInfiniteScroll",
39 | "relationshipType": "one-to-one",
40 | "otherEntityField": "id",
41 | "ownerSide": true,
42 | "otherEntityRelationshipName": "testOneToOne"
43 | },
44 | {
45 | "relationshipName": "testPager",
46 | "otherEntityName": "testPager",
47 | "relationshipType": "one-to-one",
48 | "otherEntityField": "id",
49 | "ownerSide": true,
50 | "otherEntityRelationshipName": "testOneToOne"
51 | },
52 | {
53 | "relationshipName": "testPagination",
54 | "otherEntityName": "testPagination",
55 | "relationshipType": "one-to-one",
56 | "otherEntityField": "id",
57 | "ownerSide": true,
58 | "otherEntityRelationshipName": "testOneToOne"
59 | },
60 | {
61 | "relationshipName": "testCustomTableName",
62 | "otherEntityName": "testCustomTableName",
63 | "relationshipType": "one-to-one",
64 | "otherEntityField": "id",
65 | "ownerSide": true,
66 | "otherEntityRelationshipName": "testOneToOne"
67 | }
68 | ],
69 | "fields": [],
70 | "changelogDate": "20160208211541",
71 | "dto": "no",
72 | "service": "no",
73 | "pagination": "no"
74 | }
75 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # generator-jhipster-angular-datatables
2 | > JHipster module to change default grid(table) for all or selected entities with angular-datatables.
3 |
4 | ## Usage
5 |
6 | This is a [JHipster](http://jhipster.github.io/) module, that is meant to be used in a JHipster application.
7 |
8 | You can choose to change default grid(table) for all or selected entities with [angular-datatables](https://l-lin.github.io/angular-datatables).
9 |
10 | ### Installation
11 |
12 | As this is a [JHipster](http://jhipster.github.io/) module, we expect you have [JHipster and its related tools already installed](http://jhipster.github.io/installation.html).
13 |
14 | This module requires Jhipster version greater than 3.0 in order to work, and I fixed errors for compatibility and tested with the new Jhipster v4.* but only valid for Angular1.x.
15 |
16 | ```bash
17 | npm install -g generator-jhipster-angular-datatables
18 | ```
19 |
20 | Then run the module on a JHipster generated application:
21 |
22 | ```bash
23 | yo jhipster-angular-datatables
24 | ```
25 |
26 | If you want don't want to answer each question you can use
27 |
28 | ```bash
29 | yo jhipster-angular-datatables default
30 | ```
31 |
32 | ### Style
33 |
34 | All css class used in generator template are based in AdminLTE Template [AdminLTE].
35 |
36 | ```bash
37 |