diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index d909a0c..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ab9da5d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,35 @@ +[*] +charset=utf-8 +end_of_line=lf +insert_final_newline=false +indent_style=space +indent_size=4 + +[{.babelrc,.stylelintrc,.eslintrc,jest.config,*.bowerrc,*.jsb3,*.jsb2,*.json}] +indent_style=space +indent_size=2 + +[{jshint.json,*.jshintrc}] +indent_style=space +indent_size=2 + +[{*.ddl,*.sql}] +indent_style=space +indent_size=2 + +[*.less] +indent_style=space +indent_size=2 + +[*.scss] +indent_style=space +indent_size=2 + +[{*.yml,*.yaml}] +indent_style=space +indent_size=2 + +[tslint.json] +indent_style=space +indent_size=2 + diff --git a/.gitignore b/.gitignore index 9cf0ed7..9fe8f23 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Created by .ignore support plugin (hsz.mobi) .idea/ build/ +.DS_Store #src/main/resources/application-dev.properties *.iml /classes @@ -31,10 +32,14 @@ conf/test.conf /*.log /work /src/main/resources/application-dev.properties +/src/main/resources/application-test.properties +/application-test1.properties /src/main/resources/keycloak-dev.json /src/main/resources/keycloak.json # Wercker _builds/ _cache/ _projects/ -_steps/ \ No newline at end of file +_steps/ +.wercker/ +src/main/webapp/ \ No newline at end of file diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml new file mode 100644 index 0000000..412b6d7 --- /dev/null +++ b/.idea/codeStyleSettings.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..1beadde --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..8740e17 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# Audit View + +[![wercker status](https://app.wercker.com/status/5116f2ef82779fbea92e5ca1803c39ab/s/master "wercker status")](https://app.wercker.com/project/byKey/5116f2ef82779fbea92e5ca1803c39ab) + +This project use [keycloak](http://keycloak.org) for authentication. +The **AUDIT_VIEW_ACCESS** role is necessary to have access \ No newline at end of file diff --git a/build.gradle b/build.gradle index ae7d4a0..c1320c7 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ buildscript { ext { - springBootVersion = '1.3.5.RELEASE' + springBootVersion = '1.4.0.RELEASE' } repositories { mavenCentral() @@ -11,17 +11,17 @@ buildscript { } apply plugin: 'java' -apply plugin: 'eclipse' apply plugin: 'spring-boot' apply plugin: 'idea' -jar { - baseName = 'audit-view' - version = '0.0.1-SNAPSHOT' -// from ("${projectDir}/src/main/webapp") { -// -// } +idea { + module { + excludeDirs += file('.wercker') + excludeDirs += file('client/dist') + } } + + sourceCompatibility = 1.8 targetCompatibility = 1.8 @@ -34,12 +34,15 @@ repositories { dependencies { + + runtime(project(":client")) + compile('org.springframework.boot:spring-boot-starter-data-jpa') compile('org.springframework.boot:spring-boot-starter-data-rest') compile('org.springframework.boot:spring-boot-starter-web') - compile('org.springframework.boot:spring-boot-starter-thymeleaf') +// compile('org.springframework.boot:spring-boot-starter-thymeleaf') // Thymeleaf legacy html - runtime group: 'net.sourceforge.nekohtml', name: 'nekohtml', version: '1.9.22' +// runtime group: 'net.sourceforge.nekohtml', name: 'nekohtml', version: '1.9.22' compile('com.zaxxer:HikariCP:2.4.4')//JPA HikariCP compile('com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.7.3') @@ -47,21 +50,26 @@ dependencies { compile('org.apache.httpcomponents:httpclient:4.5.2') - compile group: 'org.keycloak', name: 'keycloak-spring-security-adapter', version: '1.9.4.Final' + compile group: 'org.keycloak', name: 'keycloak-spring-security-adapter', version: '2.5.5.Final' + compile group: 'org.keycloak', name: 'keycloak-spring-boot-adapter', version: '2.5.5.Final' + compile group: 'org.keycloak', name: 'keycloak-tomcat8-adapter', version: '2.5.5.Final' compile('org.codehaus.jackson:jackson-mapper-asl:1.9.13') + compile group: 'org.apache.poi', name: 'poi', version: '3.16' + + compile group: 'info.atende.audition', name: 'audit-model', version: '1.0.0-SNAPSHOT', changing: true + compile group: 'commons-lang', name: 'commons-lang', version: '2.6' runtime('org.postgresql:postgresql') testCompile('org.springframework.boot:spring-boot-starter-test') } -task bowerInstall(type: Exec) { - workingDir "${projectDir}/src/main/webapp" - commandLine 'bower', 'install', '--allow-root' +test { + testLogging { + exceptionFormat = 'full' + } } -jar.dependsOn(bowerInstall) - task wrapper(type: Wrapper) { - gradleVersion = '2.13' + gradleVersion = '3.4.1' } diff --git a/client/.angular-cli.json b/client/.angular-cli.json new file mode 100644 index 0000000..e1734a9 --- /dev/null +++ b/client/.angular-cli.json @@ -0,0 +1,63 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "project": { + "name": "audit-view" + }, + "apps": [ + { + "root": "src", + "outDir": "dist", + "assets": [ + "assets", + "favicon.ico" + ], + "index": "index.html", + "main": "main.ts", + "polyfills": "polyfills.ts", + "test": "test.ts", + "tsconfig": "tsconfig.app.json", + "testTsconfig": "tsconfig.spec.json", + "prefix": "app", + "styles": [ + "../node_modules/bootstrap/dist/css/bootstrap.css", + "../node_modules/primeng/resources/primeng.min.css", + "../node_modules/primeng/resources/themes/omega/theme.css", + "../node_modules/font-awesome/css/font-awesome.min.css", + "styles.css" + ], + "scripts": [ + "../node_modules/keycloak-js/dist/keycloak.min.js" + ], + "environmentSource": "environments/environment.ts", + "environments": { + "dev": "environments/environment.ts", + "prod": "environments/environment.prod.ts" + } + } + ], + "e2e": { + "protractor": { + "config": "./protractor.conf.js" + } + }, + "lint": [ + { + "project": "src/tsconfig.app.json" + }, + { + "project": "src/tsconfig.spec.json" + }, + { + "project": "e2e/tsconfig.e2e.json" + } + ], + "test": { + "karma": { + "config": "./karma.conf.js" + } + }, + "defaults": { + "styleExt": "css", + "component": {} + } +} diff --git a/client/.editorconfig b/client/.editorconfig new file mode 100644 index 0000000..6e87a00 --- /dev/null +++ b/client/.editorconfig @@ -0,0 +1,13 @@ +# Editor configuration, see http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/client/.gitignore b/client/.gitignore new file mode 100644 index 0000000..97523f0 --- /dev/null +++ b/client/.gitignore @@ -0,0 +1,45 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/tmp + +# dependencies +/node_modules + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# misc +/.sass-cache +/connect.lock +/coverage/* +/libpeerconnection.log +npm-debug.log +testem.log +/typings + +# e2e +/e2e/*.js +/e2e/*.map + +#System Files +.DS_Store +Thumbs.db + +# Because will change for the team + +src/environments/environment.prod.ts +src/environments/environment.ts diff --git a/client/README.md b/client/README.md new file mode 100644 index 0000000..ba22e50 --- /dev/null +++ b/client/README.md @@ -0,0 +1,31 @@ +# Client2 + +This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.15. + +## Development server +Run `ng serve --proxy proxy.conf.json` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. + +## Code scaffolding + +Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class`. + +## Build + +Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build. + +## Running unit tests + +Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). + +## Running end-to-end tests + +Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). +Before running the tests make sure you are serving the app via `ng serve`. + +## Deploying to Github Pages + +Run `ng github-pages:deploy` to deploy to Github Pages. + +## Further help + +To get more help on the `angular-cli` use `ng --help` or go check out the [Angular-CLI README](https://github.com/angular/angular-cli/blob/master/README.md). diff --git a/client/build.gradle b/client/build.gradle new file mode 100644 index 0000000..ec29d74 --- /dev/null +++ b/client/build.gradle @@ -0,0 +1,44 @@ +buildscript { + repositories { + maven { + url "https://plugins.gradle.org/m2/" + } + } + dependencies { + classpath "com.moowork.gradle:gradle-node-plugin:0.13" + } +} +apply plugin: "com.moowork.node" +apply plugin: "java" + +jar { + baseName 'client' + from 'dist/' + eachFile { details -> + details.path = details.path.startsWith('META-INF') ?: 'static/'+details.path + } + // Jar contains duplicate empty folders, see Gradle issue: + // http://issues.gradle.org/browse/GRADLE-1830 + // so we need to set includeEmptyDirs to false + includeEmptyDirs = false + +} + +task npmBuildProd(dependsOn: npmInstall, type: NpmTask) { + inputs.dir "src" + inputs.file "packages.json" + outputs.dir "dist" + args = ['run', 'build.prod'] +} + +task testJS(type: NpmTask) { + inputs.dir "src" + inputs.file "packages.json" + outputs.dir "dist" + args = ['run', 'test:ci'] +} + +test.dependsOn testJS + +jar.dependsOn npmBuildProd + diff --git a/client/e2e/app.component.e2e-spec.ts b/client/e2e/app.component.e2e-spec.ts new file mode 100644 index 0000000..f3fab60 --- /dev/null +++ b/client/e2e/app.component.e2e-spec.ts @@ -0,0 +1,23 @@ +describe('App', () => { + + beforeEach( () => { + browser.get('/'); + }); + + it('should have a title', () => { + expect(browser.getTitle()).toEqual('Welcome to angular2-seed!'); + }); + + it('should have