├── .angular-cli.json ├── .circleci └── config.yml ├── .editorconfig ├── .gitattributes ├── .gitignore ├── .jhipster ├── RfbEvent.json ├── RfbEventAttendance.json ├── RfbLocation.json └── RfbUser.json ├── .yo-rc.json ├── README.md ├── build.gradle ├── gradle.properties ├── gradle ├── docker.gradle ├── graphite.gradle ├── liquibase.gradle ├── mapstruct.gradle ├── profile_dev.gradle ├── profile_prod.gradle ├── prometheus.gradle ├── sonar.gradle ├── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties └── zipkin.gradle ├── gradlew ├── gradlew.bat ├── package.json ├── proxy.conf.json ├── settings.gradle ├── src ├── main │ ├── docker │ │ ├── .dockerignore │ │ ├── Dockerfile │ │ ├── app.yml │ │ ├── mysql.yml │ │ └── sonar.yml │ ├── java │ │ └── com │ │ │ └── rfb │ │ │ ├── ApplicationWebXml.java │ │ │ ├── RfbloyaltyApp.java │ │ │ ├── aop │ │ │ └── logging │ │ │ │ └── LoggingAspect.java │ │ │ ├── bootstrap │ │ │ └── RfbBootstrap.java │ │ │ ├── config │ │ │ ├── ApplicationProperties.java │ │ │ ├── AsyncConfiguration.java │ │ │ ├── CacheConfiguration.java │ │ │ ├── CloudDatabaseConfiguration.java │ │ │ ├── Constants.java │ │ │ ├── DatabaseConfiguration.java │ │ │ ├── DateTimeFormatConfiguration.java │ │ │ ├── DefaultProfileUtil.java │ │ │ ├── JacksonConfiguration.java │ │ │ ├── LocaleConfiguration.java │ │ │ ├── LoggingAspectConfiguration.java │ │ │ ├── LoggingConfiguration.java │ │ │ ├── MetricsConfiguration.java │ │ │ ├── SecurityConfiguration.java │ │ │ ├── ThymeleafConfiguration.java │ │ │ ├── WebConfigurer.java │ │ │ ├── audit │ │ │ │ ├── AuditEventConverter.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ └── social │ │ │ │ └── SocialConfiguration.java │ │ │ ├── domain │ │ │ ├── AbstractAuditingEntity.java │ │ │ ├── Authority.java │ │ │ ├── PersistentAuditEvent.java │ │ │ ├── PersistentToken.java │ │ │ ├── RfbEvent.java │ │ │ ├── RfbEventAttendance.java │ │ │ ├── RfbLocation.java │ │ │ ├── SocialUserConnection.java │ │ │ ├── User.java │ │ │ └── package-info.java │ │ │ ├── repository │ │ │ ├── AuthorityRepository.java │ │ │ ├── CustomAuditEventRepository.java │ │ │ ├── CustomSocialConnectionRepository.java │ │ │ ├── CustomSocialUsersConnectionRepository.java │ │ │ ├── PersistenceAuditEventRepository.java │ │ │ ├── PersistentTokenRepository.java │ │ │ ├── RfbEventAttendanceRepository.java │ │ │ ├── RfbEventRepository.java │ │ │ ├── RfbLocationRepository.java │ │ │ ├── SocialUserConnectionRepository.java │ │ │ ├── UserRepository.java │ │ │ └── package-info.java │ │ │ ├── security │ │ │ ├── AuthenticationFailureEventListener.java │ │ │ ├── AuthenticationSuccessEventListener.java │ │ │ ├── AuthoritiesConstants.java │ │ │ ├── DomainUserDetailsService.java │ │ │ ├── LoginAttemptService.java │ │ │ ├── PersistentTokenRememberMeServices.java │ │ │ ├── RfbAjaxAuthenticationFailureHandler.java │ │ │ ├── SecurityUtils.java │ │ │ ├── SpringSecurityAuditorAware.java │ │ │ ├── UserNotActivatedException.java │ │ │ ├── package-info.java │ │ │ └── social │ │ │ │ ├── CustomSignInAdapter.java │ │ │ │ └── package-info.java │ │ │ ├── service │ │ │ ├── AuditEventService.java │ │ │ ├── MailService.java │ │ │ ├── RfbEventAttendanceService.java │ │ │ ├── RfbEventCodeService.java │ │ │ ├── RfbEventService.java │ │ │ ├── RfbLocationService.java │ │ │ ├── SocialService.java │ │ │ ├── UserService.java │ │ │ ├── dto │ │ │ │ ├── RfbEventAttendanceDTO.java │ │ │ │ ├── RfbEventDTO.java │ │ │ │ ├── RfbLocationDTO.java │ │ │ │ ├── RfbUserDTO.java │ │ │ │ ├── UserDTO.java │ │ │ │ └── package-info.java │ │ │ ├── impl │ │ │ │ ├── RfbEventAttendanceServiceImpl.java │ │ │ │ ├── RfbEventServiceImpl.java │ │ │ │ └── RfbLocationServiceImpl.java │ │ │ ├── mapper │ │ │ │ ├── EntityMapper.java │ │ │ │ ├── RfbEventAttendanceMapper.java │ │ │ │ ├── RfbEventMapper.java │ │ │ │ ├── RfbLocationMapper.java │ │ │ │ ├── UserMapper.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ └── util │ │ │ │ └── RandomUtil.java │ │ │ └── web │ │ │ └── rest │ │ │ ├── AccountResource.java │ │ │ ├── AuditResource.java │ │ │ ├── LogsResource.java │ │ │ ├── ProfileInfoResource.java │ │ │ ├── RfbEventAttendanceResource.java │ │ │ ├── RfbEventResource.java │ │ │ ├── RfbLocationResource.java │ │ │ ├── SocialController.java │ │ │ ├── UserResource.java │ │ │ ├── errors │ │ │ ├── CustomParameterizedException.java │ │ │ ├── ErrorConstants.java │ │ │ ├── ExceptionTranslator.java │ │ │ └── FieldErrorVM.java │ │ │ ├── package-info.java │ │ │ ├── util │ │ │ ├── HeaderUtil.java │ │ │ └── PaginationUtil.java │ │ │ └── vm │ │ │ ├── KeyAndPasswordVM.java │ │ │ ├── LoggerVM.java │ │ │ ├── ManagedUserVM.java │ │ │ └── package-info.java │ ├── resources │ │ ├── .h2.server.properties │ │ ├── banner.txt │ │ ├── config │ │ │ ├── application-dev.yml │ │ │ ├── application-prod.yml │ │ │ ├── application.yml │ │ │ └── liquibase │ │ │ │ ├── authorities.csv │ │ │ │ ├── changelog │ │ │ │ ├── 00000000000000_initial_schema.xml │ │ │ │ ├── 20171014184113_added_entity_RfbLocation.xml │ │ │ │ ├── 20171014184114_added_entity_RfbEvent.xml │ │ │ │ ├── 20171014184114_added_entity_constraints_RfbEvent.xml │ │ │ │ ├── 20171014184115_added_entity_RfbEventAttendance.xml │ │ │ │ ├── 20171014184115_added_entity_constraints_RfbEventAttendance.xml │ │ │ │ ├── 20171014184116_added_entity_RfbUser.xml │ │ │ │ └── 20171014184116_added_entity_constraints_RfbUser.xml │ │ │ │ ├── master.xml │ │ │ │ ├── users.csv │ │ │ │ └── users_authorities.csv │ │ ├── i18n │ │ │ └── messages.properties │ │ ├── logback-spring.xml │ │ ├── mails │ │ │ ├── activationEmail.html │ │ │ ├── creationEmail.html │ │ │ ├── passwordResetEmail.html │ │ │ └── socialRegistrationValidationEmail.html │ │ └── templates │ │ │ └── error.html │ ├── scripts │ │ └── rfbtables.jh │ └── webapp │ │ ├── 404.html │ │ ├── app │ │ ├── account │ │ │ ├── account.module.ts │ │ │ ├── account.route.ts │ │ │ ├── activate │ │ │ │ ├── activate.component.html │ │ │ │ ├── activate.component.ts │ │ │ │ ├── activate.route.ts │ │ │ │ └── activate.service.ts │ │ │ ├── index.ts │ │ │ ├── password-reset │ │ │ │ ├── finish │ │ │ │ │ ├── password-reset-finish.component.html │ │ │ │ │ ├── password-reset-finish.component.ts │ │ │ │ │ ├── password-reset-finish.route.ts │ │ │ │ │ └── password-reset-finish.service.ts │ │ │ │ └── init │ │ │ │ │ ├── password-reset-init.component.html │ │ │ │ │ ├── password-reset-init.component.ts │ │ │ │ │ ├── password-reset-init.route.ts │ │ │ │ │ └── password-reset-init.service.ts │ │ │ ├── password │ │ │ │ ├── password-strength-bar.component.ts │ │ │ │ ├── password-strength-bar.css │ │ │ │ ├── password.component.html │ │ │ │ ├── password.component.ts │ │ │ │ ├── password.route.ts │ │ │ │ └── password.service.ts │ │ │ ├── register │ │ │ │ ├── register.component.html │ │ │ │ ├── register.component.ts │ │ │ │ ├── register.route.ts │ │ │ │ └── register.service.ts │ │ │ ├── sessions │ │ │ │ ├── session.model.ts │ │ │ │ ├── sessions.component.html │ │ │ │ ├── sessions.component.ts │ │ │ │ ├── sessions.route.ts │ │ │ │ └── sessions.service.ts │ │ │ ├── settings │ │ │ │ ├── settings.component.html │ │ │ │ ├── settings.component.ts │ │ │ │ └── settings.route.ts │ │ │ └── social │ │ │ │ ├── social-register.component.html │ │ │ │ ├── social-register.component.ts │ │ │ │ └── social.route.ts │ │ ├── admin │ │ │ ├── admin.module.ts │ │ │ ├── admin.route.ts │ │ │ ├── audits │ │ │ │ ├── audit-data.model.ts │ │ │ │ ├── audit.model.ts │ │ │ │ ├── audits.component.html │ │ │ │ ├── audits.component.ts │ │ │ │ ├── audits.route.ts │ │ │ │ └── audits.service.ts │ │ │ ├── configuration │ │ │ │ ├── configuration.component.html │ │ │ │ ├── configuration.component.ts │ │ │ │ ├── configuration.route.ts │ │ │ │ └── configuration.service.ts │ │ │ ├── docs │ │ │ │ ├── docs.component.html │ │ │ │ ├── docs.component.ts │ │ │ │ └── docs.route.ts │ │ │ ├── health │ │ │ │ ├── health-modal.component.html │ │ │ │ ├── health-modal.component.ts │ │ │ │ ├── health.component.html │ │ │ │ ├── health.component.ts │ │ │ │ ├── health.route.ts │ │ │ │ └── health.service.ts │ │ │ ├── index.ts │ │ │ ├── logs │ │ │ │ ├── log.model.ts │ │ │ │ ├── logs.component.html │ │ │ │ ├── logs.component.ts │ │ │ │ ├── logs.route.ts │ │ │ │ └── logs.service.ts │ │ │ ├── metrics │ │ │ │ ├── metrics-modal.component.html │ │ │ │ ├── metrics-modal.component.ts │ │ │ │ ├── metrics.component.html │ │ │ │ ├── metrics.component.ts │ │ │ │ ├── metrics.route.ts │ │ │ │ └── metrics.service.ts │ │ │ └── user-management │ │ │ │ ├── user-management-delete-dialog.component.html │ │ │ │ ├── user-management-delete-dialog.component.ts │ │ │ │ ├── user-management-detail.component.html │ │ │ │ ├── user-management-detail.component.ts │ │ │ │ ├── user-management-dialog.component.html │ │ │ │ ├── user-management-dialog.component.ts │ │ │ │ ├── user-management.component.html │ │ │ │ ├── user-management.component.ts │ │ │ │ ├── user-management.route.ts │ │ │ │ └── user-modal.service.ts │ │ ├── app.constants.ts │ │ ├── app.main-aot.ts │ │ ├── app.main.ts │ │ ├── app.module.ts │ │ ├── app.route.ts │ │ ├── blocks │ │ │ ├── config │ │ │ │ ├── prod.config.ts │ │ │ │ └── uib-pagination.config.ts │ │ │ └── interceptor │ │ │ │ ├── auth-expired.interceptor.ts │ │ │ │ ├── errorhandler.interceptor.ts │ │ │ │ ├── http.provider.ts │ │ │ │ └── notification.interceptor.ts │ │ ├── entities │ │ │ ├── entity.module.ts │ │ │ ├── rfb-event-attendance │ │ │ │ ├── index.ts │ │ │ │ ├── rfb-event-attendance-delete-dialog.component.html │ │ │ │ ├── rfb-event-attendance-delete-dialog.component.ts │ │ │ │ ├── rfb-event-attendance-detail.component.html │ │ │ │ ├── rfb-event-attendance-detail.component.ts │ │ │ │ ├── rfb-event-attendance-dialog.component.html │ │ │ │ ├── rfb-event-attendance-dialog.component.ts │ │ │ │ ├── rfb-event-attendance-popup.service.ts │ │ │ │ ├── rfb-event-attendance.component.html │ │ │ │ ├── rfb-event-attendance.component.ts │ │ │ │ ├── rfb-event-attendance.model.ts │ │ │ │ ├── rfb-event-attendance.module.ts │ │ │ │ ├── rfb-event-attendance.route.ts │ │ │ │ └── rfb-event-attendance.service.ts │ │ │ ├── rfb-event │ │ │ │ ├── index.ts │ │ │ │ ├── rfb-event-delete-dialog.component.html │ │ │ │ ├── rfb-event-delete-dialog.component.ts │ │ │ │ ├── rfb-event-detail.component.html │ │ │ │ ├── rfb-event-detail.component.ts │ │ │ │ ├── rfb-event-dialog.component.html │ │ │ │ ├── rfb-event-dialog.component.ts │ │ │ │ ├── rfb-event-popup.service.ts │ │ │ │ ├── rfb-event.component.html │ │ │ │ ├── rfb-event.component.ts │ │ │ │ ├── rfb-event.model.ts │ │ │ │ ├── rfb-event.module.ts │ │ │ │ ├── rfb-event.route.ts │ │ │ │ └── rfb-event.service.ts │ │ │ └── rfb-location │ │ │ │ ├── index.ts │ │ │ │ ├── rfb-location-delete-dialog.component.html │ │ │ │ ├── rfb-location-delete-dialog.component.ts │ │ │ │ ├── rfb-location-detail.component.html │ │ │ │ ├── rfb-location-detail.component.ts │ │ │ │ ├── rfb-location-dialog.component.html │ │ │ │ ├── rfb-location-dialog.component.ts │ │ │ │ ├── rfb-location-popup.service.ts │ │ │ │ ├── rfb-location.component.html │ │ │ │ ├── rfb-location.component.ts │ │ │ │ ├── rfb-location.model.ts │ │ │ │ ├── rfb-location.module.ts │ │ │ │ ├── rfb-location.route.ts │ │ │ │ └── rfb-location.service.ts │ │ ├── home │ │ │ ├── home.component.html │ │ │ ├── home.component.ts │ │ │ ├── home.css │ │ │ ├── home.module.ts │ │ │ ├── home.route.ts │ │ │ └── index.ts │ │ ├── layouts │ │ │ ├── error │ │ │ │ ├── error.component.html │ │ │ │ ├── error.component.ts │ │ │ │ └── error.route.ts │ │ │ ├── footer │ │ │ │ ├── footer.component.html │ │ │ │ └── footer.component.ts │ │ │ ├── index.ts │ │ │ ├── layout-routing.module.ts │ │ │ ├── main │ │ │ │ ├── main.component.html │ │ │ │ └── main.component.ts │ │ │ ├── navbar │ │ │ │ ├── navbar.component.html │ │ │ │ ├── navbar.component.ts │ │ │ │ └── navbar.css │ │ │ └── profiles │ │ │ │ ├── page-ribbon.component.ts │ │ │ │ ├── page-ribbon.css │ │ │ │ ├── profile-info.model.ts │ │ │ │ └── profile.service.ts │ │ ├── polyfills.ts │ │ ├── shared │ │ │ ├── alert │ │ │ │ ├── alert-error.component.ts │ │ │ │ └── alert.component.ts │ │ │ ├── auth │ │ │ │ ├── account.service.ts │ │ │ │ ├── auth-session.service.ts │ │ │ │ ├── csrf.service.ts │ │ │ │ ├── has-any-authority.directive.ts │ │ │ │ ├── principal.service.ts │ │ │ │ ├── state-storage.service.ts │ │ │ │ └── user-route-access-service.ts │ │ │ ├── constants │ │ │ │ └── pagination.constants.ts │ │ │ ├── index.ts │ │ │ ├── login │ │ │ │ ├── login-modal.service.ts │ │ │ │ ├── login.component.html │ │ │ │ ├── login.component.ts │ │ │ │ └── login.service.ts │ │ │ ├── model │ │ │ │ ├── base-entity.ts │ │ │ │ ├── request-util.ts │ │ │ │ └── response-wrapper.model.ts │ │ │ ├── shared-common.module.ts │ │ │ ├── shared-libs.module.ts │ │ │ ├── shared.module.ts │ │ │ ├── social │ │ │ │ ├── social.component.html │ │ │ │ ├── social.component.ts │ │ │ │ └── social.service.ts │ │ │ └── user │ │ │ │ ├── account.model.ts │ │ │ │ ├── user.model.ts │ │ │ │ └── user.service.ts │ │ └── vendor.ts │ │ ├── content │ │ ├── css │ │ │ ├── documentation.css │ │ │ ├── global.css │ │ │ └── vendor.css │ │ └── images │ │ │ ├── beer-light.jpg │ │ │ ├── hipster.png │ │ │ ├── hipster2x.png │ │ │ ├── kevincover.jpg │ │ │ ├── logo-jhipster.png │ │ │ └── rfb_logo_small.png │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── manifest.webapp │ │ ├── robots.txt │ │ ├── sw.js │ │ └── swagger-ui │ │ ├── dist │ │ └── images │ │ │ └── throbber.gif │ │ └── index.html └── test │ ├── java │ └── com │ │ └── rfb │ │ ├── config │ │ ├── WebConfigurerTest.java │ │ └── WebConfigurerTestController.java │ │ ├── repository │ │ ├── AbstractRepositoryTest.java │ │ ├── CustomAuditEventRepositoryIntTest.java │ │ ├── CustomSocialUsersConnectionRepositoryIntTest.java │ │ ├── RfbEventRepositoryTest.java │ │ └── RfbLocationRepositoryTest.java │ │ ├── security │ │ └── SecurityUtilsUnitTest.java │ │ ├── service │ │ ├── MailServiceIntTest.java │ │ ├── SocialServiceIntTest.java │ │ └── UserServiceIntTest.java │ │ └── web │ │ └── rest │ │ ├── AccountResourceIntTest.java │ │ ├── AuditResourceIntTest.java │ │ ├── LogsResourceIntTest.java │ │ ├── ProfileInfoResourceIntTest.java │ │ ├── RfbEventAttendanceResourceIntTest.java │ │ ├── RfbEventResourceIntTest.java │ │ ├── RfbLocationResourceIntTest.java │ │ ├── TestUtil.java │ │ ├── UserResourceIntTest.java │ │ ├── errors │ │ ├── ExceptionTranslatorIntTest.java │ │ └── ExceptionTranslatorTestController.java │ │ └── util │ │ └── PaginationUtilUnitTest.java │ ├── javascript │ ├── karma.conf.js │ └── spec │ │ ├── app │ │ ├── account │ │ │ ├── activate │ │ │ │ └── activate.component.spec.ts │ │ │ ├── password-reset │ │ │ │ ├── finish │ │ │ │ │ └── password-reset-finish.component.spec.ts │ │ │ │ └── init │ │ │ │ │ └── password-reset-init.component.spec.ts │ │ │ ├── password │ │ │ │ ├── password-strength-bar.component.spec.ts │ │ │ │ └── password.component.spec.ts │ │ │ ├── register │ │ │ │ └── register.component.spec.ts │ │ │ ├── sessions │ │ │ │ └── sessions.component.spec.ts │ │ │ └── settings │ │ │ │ └── settings.component.spec.ts │ │ ├── admin │ │ │ ├── audits │ │ │ │ └── audits.component.spec.ts │ │ │ └── health │ │ │ │ └── health.component.spec.ts │ │ └── entities │ │ │ ├── rfb-event-attendance │ │ │ └── rfb-event-attendance-detail.component.spec.ts │ │ │ ├── rfb-event │ │ │ └── rfb-event-detail.component.spec.ts │ │ │ └── rfb-location │ │ │ └── rfb-location-detail.component.spec.ts │ │ ├── entry.ts │ │ ├── helpers │ │ ├── mock-account.service.ts │ │ ├── mock-principal.service.ts │ │ ├── mock-route.service.ts │ │ └── spyobject.ts │ │ └── test.module.ts │ └── resources │ ├── config │ └── application.yml │ ├── i18n │ └── messages_en.properties │ ├── logback.xml │ └── mails │ └── testEmail.html ├── tsconfig-aot.json ├── tsconfig.json ├── tslint.json ├── webpack ├── logo-jhipster.png ├── utils.js ├── webpack.common.js ├── webpack.dev.js ├── webpack.prod.js └── webpack.test.js └── yarn.lock /.angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "name": "rfbloyalty" 5 | }, 6 | "apps": [{ 7 | "root": "src/main/webapp/", 8 | "outDir": "build/www/app", 9 | "assets": [ 10 | "content", 11 | "favicon.ico" 12 | ], 13 | "index": "index.html", 14 | "main": "app/app.main.ts", 15 | "polyfills": "app/polyfills.ts", 16 | "test": "", 17 | "tsconfig": "../../../tsconfig.json", 18 | "prefix": "jhi", 19 | "mobile": false, 20 | "styles": [ 21 | "content/css/vendor.css", 22 | "content/css/global.css" 23 | ], 24 | "scripts": [] 25 | }], 26 | "lint": [{ 27 | "project": "../../../tsconfig.json" 28 | }, 29 | { 30 | "project": "../../../tsconfig-aot.json" 31 | } 32 | ], 33 | "test": { 34 | "karma": { 35 | "config": "src/test/javascript/karma.conf.js" 36 | } 37 | }, 38 | "defaults": { 39 | "styleExt": "css", 40 | "prefixInterfaces": false, 41 | "component" : { 42 | "inlineStyle" : true, 43 | "inlineTemplate": false 44 | }, 45 | "spec": { 46 | "component": false, 47 | "directive": false, 48 | "pipe": false, 49 | "service": false 50 | } 51 | }, 52 | "packageManager": "yarn" 53 | } 54 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | 9 | # Change these settings to your own preference 10 | indent_style = space 11 | indent_size = 4 12 | 13 | # We recommend you to keep these unchanged 14 | end_of_line = lf 15 | charset = utf-8 16 | trim_trailing_whitespace = true 17 | insert_final_newline = true 18 | 19 | [*.md] 20 | trim_trailing_whitespace = false 21 | 22 | [{package,bower}.json] 23 | indent_style = space 24 | indent_size = 2 25 | -------------------------------------------------------------------------------- /.jhipster/RfbEvent.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "rfbLocation", 6 | "otherEntityName": "rfbLocation", 7 | "relationshipType": "many-to-one", 8 | "otherEntityField": "id" 9 | }, 10 | { 11 | "relationshipType": "one-to-many", 12 | "relationshipName": "rfbEventAttendance", 13 | "otherEntityName": "rfbEventAttendance", 14 | "otherEntityRelationshipName": "rfbEvent" 15 | } 16 | ], 17 | "fields": [ 18 | { 19 | "fieldName": "eventDate", 20 | "fieldType": "LocalDate" 21 | }, 22 | { 23 | "fieldName": "eventCode", 24 | "fieldType": "String" 25 | } 26 | ], 27 | "changelogDate": "20171014184114", 28 | "entityTableName": "rfb_event", 29 | "dto": "mapstruct", 30 | "pagination": "pagination", 31 | "service": "serviceImpl" 32 | } -------------------------------------------------------------------------------- /.jhipster/RfbEventAttendance.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "rfbEvent", 6 | "otherEntityName": "rfbEvent", 7 | "relationshipType": "many-to-one", 8 | "otherEntityField": "id" 9 | }, 10 | { 11 | "relationshipName": "rfbUser", 12 | "otherEntityName": "rfbUser", 13 | "relationshipType": "many-to-one", 14 | "otherEntityField": "id" 15 | } 16 | ], 17 | "fields": [ 18 | { 19 | "fieldName": "attendanceDate", 20 | "fieldType": "LocalDate" 21 | } 22 | ], 23 | "changelogDate": "20171014184115", 24 | "entityTableName": "rfb_event_attendance", 25 | "dto": "mapstruct", 26 | "pagination": "infinite-scroll", 27 | "service": "serviceImpl" 28 | } -------------------------------------------------------------------------------- /.jhipster/RfbLocation.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipType": "one-to-many", 6 | "relationshipName": "rvbEvent", 7 | "otherEntityName": "rfbEvent", 8 | "otherEntityRelationshipName": "rfbLocation" 9 | } 10 | ], 11 | "fields": [ 12 | { 13 | "fieldName": "locationName", 14 | "fieldType": "String" 15 | }, 16 | { 17 | "fieldName": "runDayOfWeek", 18 | "fieldType": "Integer" 19 | } 20 | ], 21 | "changelogDate": "20171014184113", 22 | "entityTableName": "rfb_location", 23 | "dto": "mapstruct", 24 | "pagination": "pagination", 25 | "service": "serviceImpl" 26 | } -------------------------------------------------------------------------------- /.jhipster/RfbUser.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipType": "one-to-one", 6 | "relationshipName": "homeLocation", 7 | "otherEntityName": "rfbLocation", 8 | "otherEntityField": "id", 9 | "ownerSide": true, 10 | "otherEntityRelationshipName": "rfbUser" 11 | }, 12 | { 13 | "relationshipType": "one-to-many", 14 | "relationshipName": "rfbEventAttendance", 15 | "otherEntityName": "rfbEventAttendance", 16 | "otherEntityRelationshipName": "rfbUser" 17 | } 18 | ], 19 | "fields": [ 20 | { 21 | "fieldName": "username", 22 | "fieldType": "String" 23 | } 24 | ], 25 | "changelogDate": "20171014184116", 26 | "entityTableName": "rfb_user", 27 | "dto": "mapstruct", 28 | "pagination": "no", 29 | "service": "serviceImpl" 30 | } -------------------------------------------------------------------------------- /.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "promptValues": { 4 | "packageName": "com.rfb" 5 | }, 6 | "jhipsterVersion": "4.8.2", 7 | "baseName": "rfbloyalty", 8 | "packageName": "com.rfb", 9 | "packageFolder": "com/rfb", 10 | "serverPort": "8080", 11 | "authenticationType": "session", 12 | "hibernateCache": "ehcache", 13 | "clusteredHttpSession": false, 14 | "websocket": false, 15 | "databaseType": "sql", 16 | "devDatabaseType": "h2Memory", 17 | "prodDatabaseType": "mysql", 18 | "searchEngine": false, 19 | "messageBroker": false, 20 | "serviceDiscoveryType": false, 21 | "buildTool": "gradle", 22 | "enableSocialSignIn": true, 23 | "enableSwaggerCodegen": false, 24 | "rememberMeKey": "6502974dc68c39295f86f41c6a971220553ea298", 25 | "clientFramework": "angularX", 26 | "useSass": false, 27 | "clientPackageManager": "yarn", 28 | "applicationType": "monolith", 29 | "testFrameworks": [], 30 | "jhiPrefix": "jhi", 31 | "enableTranslation": false 32 | } 33 | } -------------------------------------------------------------------------------- /gradle/graphite.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile "io.dropwizard.metrics:metrics-graphite" 3 | } 4 | -------------------------------------------------------------------------------- /gradle/mapstruct.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "net.ltgt.apt" 2 | 3 | dependencies { 4 | apt "org.mapstruct:mapstruct-processor:${mapstruct_version}" 5 | apt "org.hibernate:hibernate-jpamodelgen:${hibernate_version}" 6 | } 7 | -------------------------------------------------------------------------------- /gradle/profile_dev.gradle: -------------------------------------------------------------------------------- 1 | import org.gradle.internal.os.OperatingSystem 2 | 3 | apply plugin: 'org.springframework.boot' 4 | apply plugin: 'com.moowork.node' 5 | 6 | ext { 7 | logbackLoglevel = "DEBUG" 8 | } 9 | 10 | dependencies { 11 | compile "org.springframework.boot:spring-boot-devtools" 12 | } 13 | 14 | def profiles = 'dev' 15 | if (project.hasProperty('no-liquibase')) { 16 | profiles += ',no-liquibase' 17 | } 18 | 19 | bootRun { 20 | args = [] 21 | } 22 | 23 | task webpackBuildDev(type: YarnTask) { 24 | args = ["run", "webpack:build"] 25 | } 26 | 27 | war { 28 | webAppDirName = 'build/www/' 29 | } 30 | 31 | processResources { 32 | filesMatching('**/logback-spring.xml') { 33 | filter { 34 | it.replace('#logback.loglevel#', logbackLoglevel) 35 | } 36 | } 37 | filesMatching('**/application.yml') { 38 | filter { 39 | it.replace('#project.version#', version) 40 | } 41 | filter { 42 | it.replace('#spring.profiles.active#', profiles) 43 | } 44 | } 45 | } 46 | 47 | processResources.dependsOn webpackBuildDev 48 | webpackBuildDev.onlyIf { project.hasProperty('webpack') } 49 | -------------------------------------------------------------------------------- /gradle/profile_prod.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.springframework.boot' 2 | apply plugin: 'com.moowork.node' 3 | 4 | ext { 5 | logbackLoglevel = "INFO" 6 | } 7 | 8 | dependencies { 9 | 10 | } 11 | 12 | def profiles = 'prod' 13 | if (project.hasProperty('no-liquibase')) { 14 | profiles += ',no-liquibase' 15 | } 16 | 17 | if (project.hasProperty('swagger')) { 18 | profiles += ',swagger' 19 | } 20 | 21 | bootRun { 22 | args = [] 23 | } 24 | 25 | 26 | task webpack_test(type: YarnTask, dependsOn: 'yarn_install') { 27 | args = ["run", "webpack:test"] 28 | } 29 | 30 | task webpack(type: YarnTask, dependsOn: 'yarn_install') { 31 | args = ["run", "webpack:prod"] 32 | } 33 | 34 | war { 35 | webAppDirName = 'build/www/' 36 | } 37 | 38 | processResources { 39 | filesMatching('**/logback-spring.xml') { 40 | filter { 41 | it.replace('#logback.loglevel#', logbackLoglevel) 42 | } 43 | } 44 | filesMatching('**/application.yml') { 45 | filter { 46 | it.replace('#project.version#', version) 47 | } 48 | filter { 49 | it.replace('#spring.profiles.active#', profiles) 50 | } 51 | } 52 | } 53 | 54 | test.dependsOn webpack_test 55 | processResources.dependsOn webpack 56 | -------------------------------------------------------------------------------- /gradle/prometheus.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile "io.prometheus:simpleclient:${prometheus_simpleclient_version}" 3 | compile "io.prometheus:simpleclient_servlet:${prometheus_simpleclient_version}" 4 | compile "io.prometheus:simpleclient_dropwizard:${prometheus_simpleclient_version}" 5 | } 6 | -------------------------------------------------------------------------------- /gradle/sonar.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "org.sonarqube" 2 | apply plugin: 'jacoco' 3 | 4 | jacoco { 5 | toolVersion = '0.7.9' 6 | } 7 | 8 | jacocoTestReport { 9 | reports { 10 | xml.enabled true 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Angular4JavaDevelopers/rfb-loyalty/84478d7675a6601bdcd83e3fcc636c12dc73c7b8/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Oct 15 09:24:06 EDT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip 7 | -------------------------------------------------------------------------------- /gradle/zipkin.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile "org.springframework.cloud:spring-cloud-starter-zipkin" 3 | } 4 | -------------------------------------------------------------------------------- /proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "*": { 3 | "target": "http://localhost:8080", 4 | "secure": false, 5 | "loglevel": "debug" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'rfbloyalty' 2 | -------------------------------------------------------------------------------- /src/main/docker/.dockerignore: -------------------------------------------------------------------------------- 1 | # https://docs.docker.com/engine/reference/builder/#dockerignore-file 2 | # by default ignore everything except the jar file 3 | **/* 4 | !*.jar 5 | !*.war 6 | -------------------------------------------------------------------------------- /src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jre-alpine 2 | 3 | ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \ 4 | JHIPSTER_SLEEP=0 \ 5 | JAVA_OPTS="" 6 | 7 | ADD *.war /app.war 8 | 9 | EXPOSE 8080 10 | CMD echo "The application will start in ${JHIPSTER_SLEEP}s..." && \ 11 | sleep ${JHIPSTER_SLEEP} && \ 12 | java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /app.war 13 | -------------------------------------------------------------------------------- /src/main/docker/app.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | rfbloyalty-app: 4 | image: springframeworkguru/rfbloyalty 5 | environment: 6 | - SPRING_PROFILES_ACTIVE=prod,swagger 7 | - SPRING_DATASOURCE_URL=jdbc:mysql://rfbloyalty-mysql:3306/rfbloyalty?useUnicode=true&characterEncoding=utf8&useSSL=false 8 | - SPRING_JPA_HIBERNATE_DDL_AUTO=update 9 | - SPRING_DATASOURCE_USERNAME= 10 | - SPRING_DATASOURCE_PASSWORD= 11 | ports: 12 | - 8080:8080 13 | rfbloyalty-mysql: 14 | extends: 15 | file: mysql.yml 16 | service: rfbloyalty-mysql 17 | -------------------------------------------------------------------------------- /src/main/docker/mysql.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | rfbloyalty-mysql: 4 | image: mysql:5.7.19 5 | # volumes: 6 | # - ~/volumes/jhipster/rfbloyalty/mysql/:/var/lib/mysql/ 7 | environment: 8 | - MYSQL_USER=root 9 | - MYSQL_ALLOW_EMPTY_PASSWORD=yes 10 | - MYSQL_DATABASE=rfbloyalty 11 | ports: 12 | - 3306:3306 13 | command: mysqld --lower_case_table_names=1 --skip-ssl --character_set_server=utf8 --explicit_defaults_for_timestamp 14 | -------------------------------------------------------------------------------- /src/main/docker/sonar.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | rfbloyalty-sonar: 4 | image: sonarqube:6.4-alpine 5 | ports: 6 | - 9000:9000 7 | - 9092:9092 8 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/ApplicationWebXml.java: -------------------------------------------------------------------------------- 1 | package com.rfb; 2 | 3 | import com.rfb.config.DefaultProfileUtil; 4 | import org.springframework.boot.builder.SpringApplicationBuilder; 5 | import org.springframework.boot.web.support.SpringBootServletInitializer; 6 | 7 | /** 8 | * This is a helper Java class that provides an alternative to creating a web.xml. 9 | * This will be invoked only when the application is deployed to a servlet container like Tomcat, JBoss etc. 10 | */ 11 | public class ApplicationWebXml extends SpringBootServletInitializer { 12 | 13 | @Override 14 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 15 | /** 16 | * set a default to use when no profile is configured. 17 | */ 18 | DefaultProfileUtil.addDefaultProfile(application.application()); 19 | return application.sources(RfbloyaltyApp.class); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/config/ApplicationProperties.java: -------------------------------------------------------------------------------- 1 | package com.rfb.config; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | 5 | /** 6 | * Properties specific to JHipster. 7 | *

8 | * Properties are configured in the application.yml file. 9 | */ 10 | @ConfigurationProperties(prefix = "application", ignoreUnknownFields = false) 11 | public class ApplicationProperties { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/config/CloudDatabaseConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.rfb.config; 2 | 3 | import io.github.jhipster.config.JHipsterConstants; 4 | 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | import org.springframework.cloud.config.java.AbstractCloudConfig; 8 | import org.springframework.context.annotation.*; 9 | 10 | import javax.sql.DataSource; 11 | 12 | @Configuration 13 | @Profile(JHipsterConstants.SPRING_PROFILE_CLOUD) 14 | public class CloudDatabaseConfiguration extends AbstractCloudConfig { 15 | 16 | private final Logger log = LoggerFactory.getLogger(CloudDatabaseConfiguration.class); 17 | 18 | @Bean 19 | public DataSource dataSource() { 20 | log.info("Configuring JDBC datasource from a cloud provider"); 21 | return connectionFactory().dataSource(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/config/Constants.java: -------------------------------------------------------------------------------- 1 | package com.rfb.config; 2 | 3 | /** 4 | * Application constants. 5 | */ 6 | public final class Constants { 7 | 8 | //Regex for acceptable logins 9 | public static final String LOGIN_REGEX = "^[_'.@A-Za-z0-9-]*$"; 10 | 11 | public static final String SYSTEM_ACCOUNT = "system"; 12 | public static final String ANONYMOUS_USER = "anonymoususer"; 13 | 14 | private Constants() { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/config/DateTimeFormatConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.rfb.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.format.FormatterRegistry; 5 | import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; 6 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 7 | 8 | @Configuration 9 | public class DateTimeFormatConfiguration extends WebMvcConfigurerAdapter { 10 | 11 | @Override 12 | public void addFormatters(FormatterRegistry registry) { 13 | DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar(); 14 | registrar.setUseIsoFormat(true); 15 | registrar.registerFormatters(registry); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/config/JacksonConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.rfb.config; 2 | 3 | import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module; 4 | import com.fasterxml.jackson.module.afterburner.AfterburnerModule; 5 | 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.zalando.problem.ProblemModule; 9 | import org.zalando.problem.validation.ConstraintViolationProblemModule; 10 | 11 | @Configuration 12 | public class JacksonConfiguration { 13 | 14 | /* 15 | * Support for Hibernate types in Jackson. 16 | */ 17 | @Bean 18 | public Hibernate5Module hibernate5Module() { 19 | return new Hibernate5Module(); 20 | } 21 | 22 | /* 23 | * Jackson Afterburner module to speed up serialization/deserialization. 24 | */ 25 | @Bean 26 | public AfterburnerModule afterburnerModule() { 27 | return new AfterburnerModule(); 28 | } 29 | 30 | /* 31 | * Module for serialization/deserialization of RFC7807 Problem. 32 | */ 33 | @Bean 34 | ProblemModule problemModule() { 35 | return new ProblemModule(); 36 | } 37 | 38 | /* 39 | * Module for serialization/deserialization of ConstraintViolationProblem. 40 | */ 41 | @Bean 42 | ConstraintViolationProblemModule constraintViolationProblemModule() { 43 | return new ConstraintViolationProblemModule(); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/config/LocaleConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.rfb.config; 2 | 3 | import io.github.jhipster.config.locale.AngularCookieLocaleResolver; 4 | 5 | import org.springframework.context.EnvironmentAware; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.core.env.Environment; 9 | import org.springframework.web.servlet.LocaleResolver; 10 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 11 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 12 | import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; 13 | 14 | @Configuration 15 | public class LocaleConfiguration extends WebMvcConfigurerAdapter implements EnvironmentAware { 16 | 17 | @Override 18 | public void setEnvironment(Environment environment) { 19 | // unused 20 | } 21 | 22 | @Bean(name = "localeResolver") 23 | public LocaleResolver localeResolver() { 24 | AngularCookieLocaleResolver cookieLocaleResolver = new AngularCookieLocaleResolver(); 25 | cookieLocaleResolver.setCookieName("NG_TRANSLATE_LANG_KEY"); 26 | return cookieLocaleResolver; 27 | } 28 | 29 | @Override 30 | public void addInterceptors(InterceptorRegistry registry) { 31 | LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor(); 32 | localeChangeInterceptor.setParamName("language"); 33 | registry.addInterceptor(localeChangeInterceptor); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/config/LoggingAspectConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.rfb.config; 2 | 3 | import com.rfb.aop.logging.LoggingAspect; 4 | 5 | import io.github.jhipster.config.JHipsterConstants; 6 | 7 | import org.springframework.context.annotation.*; 8 | import org.springframework.core.env.Environment; 9 | 10 | @Configuration 11 | @EnableAspectJAutoProxy 12 | public class LoggingAspectConfiguration { 13 | 14 | @Bean 15 | @Profile(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) 16 | public LoggingAspect loggingAspect(Environment env) { 17 | return new LoggingAspect(env); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/config/ThymeleafConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.rfb.config; 2 | 3 | import org.apache.commons.lang3.CharEncoding; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | import org.springframework.context.annotation.*; 7 | import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver; 8 | 9 | @Configuration 10 | public class ThymeleafConfiguration { 11 | 12 | @SuppressWarnings("unused") 13 | private final Logger log = LoggerFactory.getLogger(ThymeleafConfiguration.class); 14 | 15 | @Bean 16 | @Description("Thymeleaf template resolver serving HTML 5 emails") 17 | public ClassLoaderTemplateResolver emailTemplateResolver() { 18 | ClassLoaderTemplateResolver emailTemplateResolver = new ClassLoaderTemplateResolver(); 19 | emailTemplateResolver.setPrefix("mails/"); 20 | emailTemplateResolver.setSuffix(".html"); 21 | emailTemplateResolver.setTemplateMode("HTML5"); 22 | emailTemplateResolver.setCharacterEncoding(CharEncoding.UTF_8); 23 | emailTemplateResolver.setOrder(1); 24 | return emailTemplateResolver; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/config/audit/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Audit specific code. 3 | */ 4 | package com.rfb.config.audit; 5 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/config/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring Framework configuration files. 3 | */ 4 | package com.rfb.config; 5 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/domain/Authority.java: -------------------------------------------------------------------------------- 1 | package com.rfb.domain; 2 | 3 | import org.hibernate.annotations.Cache; 4 | import org.hibernate.annotations.CacheConcurrencyStrategy; 5 | import javax.persistence.Entity; 6 | import javax.persistence.Id; 7 | import javax.persistence.Table; 8 | import javax.persistence.Column; 9 | import javax.validation.constraints.NotNull; 10 | import javax.validation.constraints.Size; 11 | import java.io.Serializable; 12 | 13 | /** 14 | * An authority (a security role) used by Spring Security. 15 | */ 16 | @Entity 17 | @Table(name = "jhi_authority") 18 | @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) 19 | public class Authority implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | @NotNull 24 | @Size(min = 0, max = 50) 25 | @Id 26 | @Column(length = 50) 27 | private String name; 28 | 29 | public String getName() { 30 | return name; 31 | } 32 | 33 | public void setName(String name) { 34 | this.name = name; 35 | } 36 | 37 | @Override 38 | public boolean equals(Object o) { 39 | if (this == o) { 40 | return true; 41 | } 42 | if (o == null || getClass() != o.getClass()) { 43 | return false; 44 | } 45 | 46 | Authority authority = (Authority) o; 47 | 48 | return !(name != null ? !name.equals(authority.name) : authority.name != null); 49 | } 50 | 51 | @Override 52 | public int hashCode() { 53 | return name != null ? name.hashCode() : 0; 54 | } 55 | 56 | @Override 57 | public String toString() { 58 | return "Authority{" + 59 | "name='" + name + '\'' + 60 | "}"; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/domain/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * JPA domain objects. 3 | */ 4 | package com.rfb.domain; 5 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/repository/AuthorityRepository.java: -------------------------------------------------------------------------------- 1 | package com.rfb.repository; 2 | 3 | import com.rfb.domain.Authority; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | /** 8 | * Spring Data JPA repository for the Authority entity. 9 | */ 10 | public interface AuthorityRepository extends JpaRepository { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/repository/PersistenceAuditEventRepository.java: -------------------------------------------------------------------------------- 1 | package com.rfb.repository; 2 | 3 | import com.rfb.domain.PersistentAuditEvent; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.Pageable; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | 8 | import java.time.Instant; 9 | import java.util.List; 10 | 11 | /** 12 | * Spring Data JPA repository for the PersistentAuditEvent entity. 13 | */ 14 | public interface PersistenceAuditEventRepository extends JpaRepository { 15 | 16 | List findByPrincipal(String principal); 17 | 18 | List findByAuditEventDateAfter(Instant after); 19 | 20 | List findByPrincipalAndAuditEventDateAfter(String principal, Instant after); 21 | 22 | List findByPrincipalAndAuditEventDateAfterAndAuditEventType(String principle, Instant after, String type); 23 | 24 | Page findAllByAuditEventDateBetween(Instant fromDate, Instant toDate, Pageable pageable); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/repository/PersistentTokenRepository.java: -------------------------------------------------------------------------------- 1 | package com.rfb.repository; 2 | 3 | import com.rfb.domain.PersistentToken; 4 | import com.rfb.domain.User; 5 | import java.time.LocalDate; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Spring Data JPA repository for the PersistentToken entity. 12 | */ 13 | public interface PersistentTokenRepository extends JpaRepository { 14 | 15 | List findByUser(User user); 16 | 17 | List findByTokenDateBefore(LocalDate localDate); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/repository/RfbEventAttendanceRepository.java: -------------------------------------------------------------------------------- 1 | package com.rfb.repository; 2 | 3 | import com.rfb.domain.RfbEventAttendance; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | 8 | /** 9 | * Spring Data JPA repository for the RfbEventAttendance entity. 10 | */ 11 | @SuppressWarnings("unused") 12 | @Repository 13 | public interface RfbEventAttendanceRepository extends JpaRepository { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/repository/RfbEventRepository.java: -------------------------------------------------------------------------------- 1 | package com.rfb.repository; 2 | 3 | import com.rfb.domain.RfbEvent; 4 | import com.rfb.domain.RfbLocation; 5 | import com.rfb.service.dto.RfbEventDTO; 6 | import com.rfb.service.dto.RfbLocationDTO; 7 | import org.springframework.data.jpa.repository.JpaRepository; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import java.time.LocalDate; 11 | import java.util.List; 12 | 13 | 14 | /** 15 | * Spring Data JPA repository for the RfbEvent entity. 16 | */ 17 | @SuppressWarnings("unused") 18 | @Repository 19 | public interface RfbEventRepository extends JpaRepository { 20 | 21 | RfbEvent findByRfbLocationAndEventDate(RfbLocation location, LocalDate date); 22 | 23 | RfbEvent findByEventCodeEqualsAndEventDateEqualsAndRfbLocationEquals(String eventCode, LocalDate eventDate, RfbLocation location); 24 | 25 | RfbEvent findByEventDateEqualsAndRfbLocationEquals(LocalDate eventDate, RfbLocation location); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/repository/RfbLocationRepository.java: -------------------------------------------------------------------------------- 1 | package com.rfb.repository; 2 | 3 | import com.rfb.domain.RfbLocation; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | 10 | /** 11 | * Spring Data JPA repository for the RfbLocation entity. 12 | */ 13 | @SuppressWarnings("unused") 14 | @Repository 15 | public interface RfbLocationRepository extends JpaRepository { 16 | 17 | List findAllByRunDayOfWeek(Integer dayOfWeek); 18 | 19 | RfbLocation findByLocationName(String name); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/repository/SocialUserConnectionRepository.java: -------------------------------------------------------------------------------- 1 | package com.rfb.repository; 2 | 3 | import com.rfb.domain.SocialUserConnection; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import java.util.List; 7 | import java.util.Set; 8 | 9 | /** 10 | * Spring Data JPA repository for the Social User Connection entity. 11 | */ 12 | public interface SocialUserConnectionRepository extends JpaRepository { 13 | 14 | List findAllByProviderIdAndProviderUserId(String providerId, String providerUserId); 15 | 16 | List findAllByProviderIdAndProviderUserIdIn(String providerId, Set providerUserIds); 17 | 18 | List findAllByUserIdOrderByProviderIdAscRankAsc(String userId); 19 | 20 | List findAllByUserIdAndProviderIdOrderByRankAsc(String userId, String providerId); 21 | 22 | List findAllByUserIdAndProviderIdAndProviderUserIdIn(String userId, String providerId, List provideUserId); 23 | 24 | SocialUserConnection findOneByUserIdAndProviderIdAndProviderUserId(String userId, String providerId, String providerUserId); 25 | 26 | void deleteByUserIdAndProviderId(String userId, String providerId); 27 | 28 | void deleteByUserIdAndProviderIdAndProviderUserId(String userId, String providerId, String providerUserId); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.rfb.repository; 2 | 3 | import com.rfb.domain.Authority; 4 | import com.rfb.domain.User; 5 | import org.springframework.cache.annotation.Cacheable; 6 | import org.springframework.data.domain.Page; 7 | import org.springframework.data.domain.Pageable; 8 | import org.springframework.data.jpa.repository.EntityGraph; 9 | import org.springframework.data.jpa.repository.JpaRepository; 10 | import org.springframework.stereotype.Repository; 11 | import java.util.List; 12 | import java.util.Optional; 13 | import java.time.Instant; 14 | import java.util.Set; 15 | 16 | /** 17 | * Spring Data JPA repository for the User entity. 18 | */ 19 | @Repository 20 | public interface UserRepository extends JpaRepository { 21 | 22 | Optional findOneByActivationKey(String activationKey); 23 | 24 | List findAllByActivatedIsFalseAndCreatedDateBefore(Instant dateTime); 25 | 26 | Optional findOneByResetKey(String resetKey); 27 | 28 | Optional findOneByEmail(String email); 29 | 30 | Optional findOneByLogin(String login); 31 | 32 | @EntityGraph(attributePaths = "authorities") 33 | User findOneWithAuthoritiesById(Long id); 34 | 35 | @EntityGraph(attributePaths = "authorities") 36 | @Cacheable(cacheNames="users") 37 | Optional findOneWithAuthoritiesByLogin(String login); 38 | 39 | Page findAllByLoginNot(Pageable pageable, String login); 40 | 41 | Page findAllByAuthoritiesEquals(Pageable pageable, Authority authority); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/repository/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring Data JPA repositories. 3 | */ 4 | package com.rfb.repository; 5 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/security/AuthenticationFailureEventListener.java: -------------------------------------------------------------------------------- 1 | package com.rfb.security; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.context.ApplicationListener; 5 | import org.springframework.security.authentication.event.AuthenticationFailureBadCredentialsEvent; 6 | import org.springframework.security.web.authentication.WebAuthenticationDetails; 7 | import org.springframework.stereotype.Component; 8 | 9 | @Component 10 | public class AuthenticationFailureEventListener implements ApplicationListener { 11 | 12 | @Autowired 13 | private LoginAttemptService loginAttemptService; 14 | 15 | public void onApplicationEvent(AuthenticationFailureBadCredentialsEvent event) { 16 | WebAuthenticationDetails webAuthenticationDetails = (WebAuthenticationDetails) event.getAuthentication().getDetails(); 17 | loginAttemptService.loginFailed(webAuthenticationDetails.getRemoteAddress()); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/security/AuthenticationSuccessEventListener.java: -------------------------------------------------------------------------------- 1 | package com.rfb.security; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.context.ApplicationListener; 5 | import org.springframework.security.authentication.event.AuthenticationSuccessEvent; 6 | import org.springframework.security.web.authentication.WebAuthenticationDetails; 7 | import org.springframework.stereotype.Component; 8 | 9 | @Component 10 | public class AuthenticationSuccessEventListener 11 | implements ApplicationListener { 12 | 13 | @Autowired 14 | private LoginAttemptService loginAttemptService; 15 | 16 | public void onApplicationEvent(AuthenticationSuccessEvent e) { 17 | WebAuthenticationDetails auth = (WebAuthenticationDetails) e.getAuthentication().getDetails(); 18 | 19 | loginAttemptService.loginSucceeded(auth.getRemoteAddress()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/security/AuthoritiesConstants.java: -------------------------------------------------------------------------------- 1 | package com.rfb.security; 2 | 3 | /** 4 | * Constants for Spring Security authorities. 5 | */ 6 | public final class AuthoritiesConstants { 7 | 8 | public static final String ADMIN = "ROLE_ADMIN"; 9 | 10 | public static final String ORGANIZER = "ROLE_ORGANIZER"; 11 | 12 | public static final String RUNNER = "ROLE_RUNNER"; 13 | 14 | public static final String ANONYMOUS = "ROLE_ANONYMOUS"; 15 | 16 | private AuthoritiesConstants() { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/security/LoginAttemptService.java: -------------------------------------------------------------------------------- 1 | package com.rfb.security; 2 | 3 | import com.google.common.cache.CacheBuilder; 4 | import com.google.common.cache.CacheLoader; 5 | import com.google.common.cache.LoadingCache; 6 | import org.springframework.stereotype.Service; 7 | 8 | import java.util.concurrent.ExecutionException; 9 | import java.util.concurrent.TimeUnit; 10 | 11 | @Service 12 | public class LoginAttemptService { 13 | 14 | private final int MAX_ATTEMPT = 10; 15 | private LoadingCache attemptsCache; 16 | 17 | public LoginAttemptService() { 18 | super(); 19 | attemptsCache = CacheBuilder.newBuilder() 20 | .expireAfterWrite(10, TimeUnit.MINUTES) 21 | .build(new CacheLoader() { 22 | public Integer load(String key) { 23 | return 0; 24 | } 25 | }); 26 | } 27 | 28 | public void loginSucceeded(String key) { 29 | attemptsCache.invalidate(key); 30 | } 31 | 32 | public void loginFailed(String key) { 33 | int attempts = 0; 34 | try { 35 | attempts = attemptsCache.get(key); 36 | } catch (ExecutionException e) { 37 | attempts = 0; 38 | } 39 | attempts++; 40 | attemptsCache.put(key, attempts); 41 | } 42 | 43 | public boolean isBlocked(String key) { 44 | try { 45 | return attemptsCache.get(key) >= MAX_ATTEMPT; 46 | } catch (ExecutionException e) { 47 | return false; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/security/RfbAjaxAuthenticationFailureHandler.java: -------------------------------------------------------------------------------- 1 | package com.rfb.security; 2 | 3 | import org.springframework.security.core.AuthenticationException; 4 | import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | import java.io.IOException; 10 | 11 | public class RfbAjaxAuthenticationFailureHandler extends SimpleUrlAuthenticationFailureHandler { 12 | 13 | @Override 14 | public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { 15 | String errorMessage = "Failed to sign in! Please check your credentials and try again."; 16 | 17 | if( exception.getMessage().equalsIgnoreCase("blocked") ) { 18 | errorMessage = "You have been blocked from our system for 10 invalid login attempts"; 19 | } 20 | 21 | response.sendError(401, errorMessage); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/security/SpringSecurityAuditorAware.java: -------------------------------------------------------------------------------- 1 | package com.rfb.security; 2 | 3 | import com.rfb.config.Constants; 4 | 5 | import org.springframework.data.domain.AuditorAware; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | * Implementation of AuditorAware based on Spring Security. 10 | */ 11 | @Component 12 | public class SpringSecurityAuditorAware implements AuditorAware { 13 | 14 | @Override 15 | public String getCurrentAuditor() { 16 | String userName = SecurityUtils.getCurrentUserLogin(); 17 | return userName != null ? userName : Constants.SYSTEM_ACCOUNT; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/security/UserNotActivatedException.java: -------------------------------------------------------------------------------- 1 | package com.rfb.security; 2 | 3 | import org.springframework.security.core.AuthenticationException; 4 | 5 | /** 6 | * This exception is thrown in case of a not activated user trying to authenticate. 7 | */ 8 | public class UserNotActivatedException extends AuthenticationException { 9 | 10 | private static final long serialVersionUID = 1L; 11 | 12 | public UserNotActivatedException(String message) { 13 | super(message); 14 | } 15 | 16 | public UserNotActivatedException(String message, Throwable t) { 17 | super(message, t); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/security/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring Security configuration. 3 | */ 4 | package com.rfb.security; 5 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/security/social/CustomSignInAdapter.java: -------------------------------------------------------------------------------- 1 | package com.rfb.security.social; 2 | 3 | import io.github.jhipster.config.JHipsterProperties; 4 | 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | 8 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 9 | import org.springframework.security.core.Authentication; 10 | import org.springframework.security.core.context.SecurityContextHolder; 11 | import org.springframework.security.core.userdetails.UserDetails; 12 | import org.springframework.security.core.userdetails.UserDetailsService; 13 | import org.springframework.social.connect.Connection; 14 | import org.springframework.social.connect.web.SignInAdapter; 15 | import org.springframework.web.context.request.NativeWebRequest; 16 | 17 | public class CustomSignInAdapter implements SignInAdapter { 18 | 19 | @SuppressWarnings("unused") 20 | private final Logger log = LoggerFactory.getLogger(CustomSignInAdapter.class); 21 | 22 | private final UserDetailsService userDetailsService; 23 | 24 | private final JHipsterProperties jHipsterProperties; 25 | 26 | public CustomSignInAdapter(UserDetailsService userDetailsService, JHipsterProperties jHipsterProperties) { 27 | this.userDetailsService = userDetailsService; 28 | this.jHipsterProperties = jHipsterProperties; 29 | } 30 | @Override 31 | public String signIn(String userId, Connection connection, NativeWebRequest request) { 32 | UserDetails user = userDetailsService.loadUserByUsername(userId); 33 | Authentication newAuth = new UsernamePasswordAuthenticationToken( 34 | user, 35 | null, 36 | user.getAuthorities()); 37 | SecurityContextHolder.getContext().setAuthentication(newAuth); 38 | return jHipsterProperties.getSocial().getRedirectAfterSignIn(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/security/social/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring social configuration. 3 | */ 4 | package com.rfb.security.social; 5 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/service/RfbEventAttendanceService.java: -------------------------------------------------------------------------------- 1 | package com.rfb.service; 2 | 3 | import com.rfb.service.dto.RfbEventAttendanceDTO; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.Pageable; 6 | 7 | /** 8 | * Service Interface for managing RfbEventAttendance. 9 | */ 10 | public interface RfbEventAttendanceService { 11 | 12 | /** 13 | * Save a rfbEventAttendance. 14 | * 15 | * @param rfbEventAttendanceDTO the entity to save 16 | * @return the persisted entity 17 | */ 18 | RfbEventAttendanceDTO save(RfbEventAttendanceDTO rfbEventAttendanceDTO); 19 | 20 | /** 21 | * Get all the rfbEventAttendances. 22 | * 23 | * @param pageable the pagination information 24 | * @return the list of entities 25 | */ 26 | Page findAll(Pageable pageable); 27 | 28 | /** 29 | * Get the "id" rfbEventAttendance. 30 | * 31 | * @param id the id of the entity 32 | * @return the entity 33 | */ 34 | RfbEventAttendanceDTO findOne(Long id); 35 | 36 | /** 37 | * Delete the "id" rfbEventAttendance. 38 | * 39 | * @param id the id of the entity 40 | */ 41 | void delete(Long id); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/service/RfbEventService.java: -------------------------------------------------------------------------------- 1 | package com.rfb.service; 2 | 3 | import com.rfb.domain.RfbEvent; 4 | import com.rfb.service.dto.RfbEventDTO; 5 | import org.springframework.data.domain.Page; 6 | import org.springframework.data.domain.Pageable; 7 | 8 | import java.time.LocalDate; 9 | import java.util.List; 10 | 11 | /** 12 | * Service Interface for managing RfbEvent. 13 | */ 14 | public interface RfbEventService { 15 | 16 | /** 17 | * Save a rfbEvent. 18 | * 19 | * @param rfbEventDTO the entity to save 20 | * @return the persisted entity 21 | */ 22 | RfbEventDTO save(RfbEventDTO rfbEventDTO); 23 | 24 | /** 25 | * Get all the rfbEvents. 26 | * 27 | * @param pageable the pagination information 28 | * @return the list of entities 29 | */ 30 | Page findAll(Pageable pageable); 31 | 32 | /** 33 | * Get the "id" rfbEvent. 34 | * 35 | * @param id the id of the entity 36 | * @return the entity 37 | */ 38 | RfbEventDTO findOne(Long id); 39 | 40 | /** 41 | * Delete the "id" rfbEvent. 42 | * 43 | * @param id the id of the entity 44 | */ 45 | void delete(Long id); 46 | 47 | RfbEventDTO findByTodayAndLocation(Long locationID); 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/service/RfbLocationService.java: -------------------------------------------------------------------------------- 1 | package com.rfb.service; 2 | 3 | import com.rfb.service.dto.RfbLocationDTO; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.Pageable; 6 | 7 | /** 8 | * Service Interface for managing RfbLocation. 9 | */ 10 | public interface RfbLocationService { 11 | 12 | /** 13 | * Save a rfbLocation. 14 | * 15 | * @param rfbLocationDTO the entity to save 16 | * @return the persisted entity 17 | */ 18 | RfbLocationDTO save(RfbLocationDTO rfbLocationDTO); 19 | 20 | /** 21 | * Get all the rfbLocations. 22 | * 23 | * @param pageable the pagination information 24 | * @return the list of entities 25 | */ 26 | Page findAll(Pageable pageable); 27 | 28 | /** 29 | * Get the "id" rfbLocation. 30 | * 31 | * @param id the id of the entity 32 | * @return the entity 33 | */ 34 | RfbLocationDTO findOne(Long id); 35 | 36 | /** 37 | * Delete the "id" rfbLocation. 38 | * 39 | * @param id the id of the entity 40 | */ 41 | void delete(Long id); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/service/dto/RfbLocationDTO.java: -------------------------------------------------------------------------------- 1 | package com.rfb.service.dto; 2 | 3 | 4 | import java.io.Serializable; 5 | import java.util.Objects; 6 | 7 | /** 8 | * A DTO for the RfbLocation entity. 9 | */ 10 | public class RfbLocationDTO implements Serializable { 11 | 12 | private Long id; 13 | 14 | private String locationName; 15 | 16 | private Integer runDayOfWeek; 17 | 18 | public Long getId() { 19 | return id; 20 | } 21 | 22 | public void setId(Long id) { 23 | this.id = id; 24 | } 25 | 26 | public String getLocationName() { 27 | return locationName; 28 | } 29 | 30 | public void setLocationName(String locationName) { 31 | this.locationName = locationName; 32 | } 33 | 34 | public Integer getRunDayOfWeek() { 35 | return runDayOfWeek; 36 | } 37 | 38 | public void setRunDayOfWeek(Integer runDayOfWeek) { 39 | this.runDayOfWeek = runDayOfWeek; 40 | } 41 | 42 | @Override 43 | public boolean equals(Object o) { 44 | if (this == o) { 45 | return true; 46 | } 47 | if (o == null || getClass() != o.getClass()) { 48 | return false; 49 | } 50 | 51 | RfbLocationDTO rfbLocationDTO = (RfbLocationDTO) o; 52 | if(rfbLocationDTO.getId() == null || getId() == null) { 53 | return false; 54 | } 55 | return Objects.equals(getId(), rfbLocationDTO.getId()); 56 | } 57 | 58 | @Override 59 | public int hashCode() { 60 | return Objects.hashCode(getId()); 61 | } 62 | 63 | @Override 64 | public String toString() { 65 | return "RfbLocationDTO{" + 66 | "id=" + getId() + 67 | ", locationName='" + getLocationName() + "'" + 68 | ", runDayOfWeek='" + getRunDayOfWeek() + "'" + 69 | "}"; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/service/dto/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Data Transfer Objects. 3 | */ 4 | package com.rfb.service.dto; 5 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/service/mapper/EntityMapper.java: -------------------------------------------------------------------------------- 1 | package com.rfb.service.mapper; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Contract for a generic dto to entity mapper. 7 | * 8 | * @param - DTO type parameter. 9 | * @param - Entity type parameter. 10 | */ 11 | 12 | public interface EntityMapper { 13 | 14 | public E toEntity(D dto); 15 | 16 | public D toDto(E entity); 17 | 18 | public List toEntity(List dtoList); 19 | 20 | public List toDto(List entityList); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/service/mapper/RfbEventAttendanceMapper.java: -------------------------------------------------------------------------------- 1 | package com.rfb.service.mapper; 2 | 3 | import com.rfb.domain.RfbEventAttendance; 4 | import com.rfb.service.dto.RfbEventAttendanceDTO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.Mapping; 7 | 8 | /** 9 | * Mapper for the entity RfbEventAttendance and its DTO RfbEventAttendanceDTO. 10 | */ 11 | @Mapper(componentModel = "spring", uses = {RfbEventMapper.class, UserMapper.class, }) 12 | public interface RfbEventAttendanceMapper extends EntityMapper { 13 | 14 | @Mapping(source = "rfbEvent", target = "rfbEventDTO") 15 | @Mapping(source = "user", target = "userDTO") 16 | RfbEventAttendanceDTO toDto(RfbEventAttendance rfbEventAttendance); 17 | 18 | @Mapping(source = "rfbEventDTO", target = "rfbEvent") 19 | @Mapping(source = "userDTO", target = "user") 20 | RfbEventAttendance toEntity(RfbEventAttendanceDTO rfbEventAttendanceDTO); 21 | default RfbEventAttendance fromId(Long id) { 22 | if (id == null) { 23 | return null; 24 | } 25 | RfbEventAttendance rfbEventAttendance = new RfbEventAttendance(); 26 | rfbEventAttendance.setId(id); 27 | return rfbEventAttendance; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/service/mapper/RfbEventMapper.java: -------------------------------------------------------------------------------- 1 | package com.rfb.service.mapper; 2 | 3 | import com.rfb.domain.RfbEvent; 4 | import com.rfb.service.dto.RfbEventDTO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.Mapping; 7 | 8 | /** 9 | * Mapper for the entity RfbEvent and its DTO RfbEventDTO. 10 | */ 11 | @Mapper(componentModel = "spring", uses = {RfbLocationMapper.class, }) 12 | public interface RfbEventMapper extends EntityMapper { 13 | 14 | @Mapping(source = "rfbLocation", target = "rfbLocationDTO") 15 | RfbEventDTO toDto(RfbEvent rfbEvent); 16 | 17 | @Mapping(source = "rfbLocationDTO", target = "rfbLocation") 18 | @Mapping(target = "rfbEventAttendances", ignore = true) 19 | RfbEvent toEntity(RfbEventDTO rfbEventDTO); 20 | default RfbEvent fromId(Long id) { 21 | if (id == null) { 22 | return null; 23 | } 24 | RfbEvent rfbEvent = new RfbEvent(); 25 | rfbEvent.setId(id); 26 | return rfbEvent; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/service/mapper/RfbLocationMapper.java: -------------------------------------------------------------------------------- 1 | package com.rfb.service.mapper; 2 | 3 | import com.rfb.domain.RfbLocation; 4 | import com.rfb.service.dto.RfbLocationDTO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.Mapping; 7 | 8 | /** 9 | * Mapper for the entity RfbLocation and its DTO RfbLocationDTO. 10 | */ 11 | @Mapper(componentModel = "spring", uses = {}) 12 | public interface RfbLocationMapper extends EntityMapper { 13 | 14 | @Mapping(target = "rvbEvents", ignore = true) 15 | RfbLocation toEntity(RfbLocationDTO rfbLocationDTO); 16 | default RfbLocation fromId(Long id) { 17 | if (id == null) { 18 | return null; 19 | } 20 | RfbLocation rfbLocation = new RfbLocation(); 21 | rfbLocation.setId(id); 22 | return rfbLocation; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/service/mapper/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MapStruct mappers for mapping domain objects and Data Transfer Objects. 3 | */ 4 | package com.rfb.service.mapper; 5 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/service/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Service layer beans. 3 | */ 4 | package com.rfb.service; 5 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/service/util/RandomUtil.java: -------------------------------------------------------------------------------- 1 | package com.rfb.service.util; 2 | 3 | import org.apache.commons.lang3.RandomStringUtils; 4 | 5 | /** 6 | * Utility class for generating random Strings. 7 | */ 8 | public final class RandomUtil { 9 | 10 | private static final int DEF_COUNT = 20; 11 | 12 | private RandomUtil() { 13 | } 14 | 15 | /** 16 | * Generate a password. 17 | * 18 | * @return the generated password 19 | */ 20 | public static String generatePassword() { 21 | return RandomStringUtils.randomAlphanumeric(DEF_COUNT); 22 | } 23 | 24 | /** 25 | * Generate an activation key. 26 | * 27 | * @return the generated activation key 28 | */ 29 | public static String generateActivationKey() { 30 | return RandomStringUtils.randomNumeric(DEF_COUNT); 31 | } 32 | 33 | /** 34 | * Generate a reset key. 35 | * 36 | * @return the generated reset key 37 | */ 38 | public static String generateResetKey() { 39 | return RandomStringUtils.randomNumeric(DEF_COUNT); 40 | } 41 | 42 | /** 43 | * Generate a unique series to validate a persistent token, used in the 44 | * authentication remember-me mechanism. 45 | * 46 | * @return the generated series data 47 | */ 48 | public static String generateSeriesData() { 49 | return RandomStringUtils.randomAlphanumeric(DEF_COUNT); 50 | } 51 | 52 | /** 53 | * Generate a persistent token, used in the authentication remember-me mechanism. 54 | * 55 | * @return the generated token data 56 | */ 57 | public static String generateTokenData() { 58 | return RandomStringUtils.randomAlphanumeric(DEF_COUNT); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/web/rest/LogsResource.java: -------------------------------------------------------------------------------- 1 | package com.rfb.web.rest; 2 | 3 | import com.rfb.web.rest.vm.LoggerVM; 4 | 5 | import ch.qos.logback.classic.Level; 6 | import ch.qos.logback.classic.LoggerContext; 7 | import com.codahale.metrics.annotation.Timed; 8 | import org.slf4j.LoggerFactory; 9 | import org.springframework.http.HttpStatus; 10 | import org.springframework.web.bind.annotation.*; 11 | 12 | import java.util.List; 13 | import java.util.stream.Collectors; 14 | 15 | /** 16 | * Controller for view and managing Log Level at runtime. 17 | */ 18 | @RestController 19 | @RequestMapping("/management") 20 | public class LogsResource { 21 | 22 | @GetMapping("/logs") 23 | @Timed 24 | public List getList() { 25 | LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); 26 | return context.getLoggerList() 27 | .stream() 28 | .map(LoggerVM::new) 29 | .collect(Collectors.toList()); 30 | } 31 | 32 | @PutMapping("/logs") 33 | @ResponseStatus(HttpStatus.NO_CONTENT) 34 | @Timed 35 | public void changeLevel(@RequestBody LoggerVM jsonLogger) { 36 | LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); 37 | context.getLogger(jsonLogger.getName()).setLevel(Level.valueOf(jsonLogger.getLevel())); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/web/rest/errors/ErrorConstants.java: -------------------------------------------------------------------------------- 1 | package com.rfb.web.rest.errors; 2 | 3 | import java.net.URI; 4 | 5 | public final class ErrorConstants { 6 | 7 | public static final String ERR_CONCURRENCY_FAILURE = "error.concurrencyFailure"; 8 | public static final String ERR_VALIDATION = "error.validation"; 9 | public static final URI DEFAULT_TYPE = URI.create("http://www.jhipster.tech/problem/problem-with-message"); 10 | public static final URI CONSTRAINT_VIOLATION_TYPE = URI.create("http://www.jhipster.tech/problem/contraint-violation"); 11 | public static final URI PARAMETERIZED_TYPE = URI.create("http://www.jhipster.tech/problem/parameterized"); 12 | 13 | private ErrorConstants() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/web/rest/errors/FieldErrorVM.java: -------------------------------------------------------------------------------- 1 | package com.rfb.web.rest.errors; 2 | 3 | import java.io.Serializable; 4 | 5 | public class FieldErrorVM implements Serializable { 6 | 7 | private static final long serialVersionUID = 1L; 8 | 9 | private final String objectName; 10 | 11 | private final String field; 12 | 13 | private final String message; 14 | 15 | public FieldErrorVM(String dto, String field, String message) { 16 | this.objectName = dto; 17 | this.field = field; 18 | this.message = message; 19 | } 20 | 21 | public String getObjectName() { 22 | return objectName; 23 | } 24 | 25 | public String getField() { 26 | return field; 27 | } 28 | 29 | public String getMessage() { 30 | return message; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/web/rest/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring MVC REST controllers. 3 | */ 4 | package com.rfb.web.rest; 5 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/web/rest/util/HeaderUtil.java: -------------------------------------------------------------------------------- 1 | package com.rfb.web.rest.util; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.http.HttpHeaders; 6 | /** 7 | * Utility class for HTTP headers creation. 8 | */ 9 | public final class HeaderUtil { 10 | 11 | private static final Logger log = LoggerFactory.getLogger(HeaderUtil.class); 12 | 13 | private HeaderUtil() { 14 | } 15 | 16 | public static HttpHeaders createAlert(String message, String param) { 17 | HttpHeaders headers = new HttpHeaders(); 18 | headers.add("X-rfbloyaltyApp-alert", message); 19 | headers.add("X-rfbloyaltyApp-params", param); 20 | return headers; 21 | } 22 | 23 | public static HttpHeaders createEntityCreationAlert(String entityName, String param) { 24 | return createAlert("A new " + entityName + " is created with identifier " + param, param); 25 | } 26 | 27 | public static HttpHeaders createEntityUpdateAlert(String entityName, String param) { 28 | return createAlert("A " + entityName + " is updated with identifier " + param, param); 29 | } 30 | 31 | public static HttpHeaders createEntityDeletionAlert(String entityName, String param) { 32 | return createAlert("A " + entityName + " is deleted with identifier " + param, param); 33 | } 34 | 35 | public static HttpHeaders createFailureAlert(String entityName, String errorKey, String defaultMessage) { 36 | log.error("Entity processing failed, {}", defaultMessage); 37 | HttpHeaders headers = new HttpHeaders(); 38 | headers.add("X-rfbloyaltyApp-error", defaultMessage); 39 | headers.add("X-rfbloyaltyApp-params", entityName); 40 | return headers; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/web/rest/vm/KeyAndPasswordVM.java: -------------------------------------------------------------------------------- 1 | package com.rfb.web.rest.vm; 2 | 3 | /** 4 | * View Model object for storing the user's key and password. 5 | */ 6 | public class KeyAndPasswordVM { 7 | 8 | private String key; 9 | 10 | private String newPassword; 11 | 12 | public String getKey() { 13 | return key; 14 | } 15 | 16 | public void setKey(String key) { 17 | this.key = key; 18 | } 19 | 20 | public String getNewPassword() { 21 | return newPassword; 22 | } 23 | 24 | public void setNewPassword(String newPassword) { 25 | this.newPassword = newPassword; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/web/rest/vm/LoggerVM.java: -------------------------------------------------------------------------------- 1 | package com.rfb.web.rest.vm; 2 | 3 | import ch.qos.logback.classic.Logger; 4 | 5 | /** 6 | * View Model object for storing a Logback logger. 7 | */ 8 | public class LoggerVM { 9 | 10 | private String name; 11 | 12 | private String level; 13 | 14 | public LoggerVM(Logger logger) { 15 | this.name = logger.getName(); 16 | this.level = logger.getEffectiveLevel().toString(); 17 | } 18 | 19 | public LoggerVM() { 20 | // Empty public constructor used by Jackson. 21 | } 22 | 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | public void setName(String name) { 28 | this.name = name; 29 | } 30 | 31 | public String getLevel() { 32 | return level; 33 | } 34 | 35 | public void setLevel(String level) { 36 | this.level = level; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return "LoggerVM{" + 42 | "name='" + name + '\'' + 43 | ", level='" + level + '\'' + 44 | '}'; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/web/rest/vm/ManagedUserVM.java: -------------------------------------------------------------------------------- 1 | package com.rfb.web.rest.vm; 2 | 3 | import com.rfb.service.dto.UserDTO; 4 | import javax.validation.constraints.Size; 5 | 6 | import java.time.Instant; 7 | import java.util.Set; 8 | 9 | /** 10 | * View Model extending the UserDTO, which is meant to be used in the user management UI. 11 | */ 12 | public class ManagedUserVM extends UserDTO { 13 | 14 | public static final int PASSWORD_MIN_LENGTH = 4; 15 | 16 | public static final int PASSWORD_MAX_LENGTH = 100; 17 | 18 | @Size(min = PASSWORD_MIN_LENGTH, max = PASSWORD_MAX_LENGTH) 19 | private String password; 20 | 21 | public ManagedUserVM() { 22 | // Empty constructor needed for Jackson. 23 | } 24 | 25 | public ManagedUserVM(Long id, String login, String password, String firstName, String lastName, 26 | String email, boolean activated, String imageUrl, String langKey, 27 | String createdBy, Instant createdDate, String lastModifiedBy, Instant lastModifiedDate, 28 | Long homeLocation, Set authorities) { 29 | 30 | super(id, login, firstName, lastName, email, activated, imageUrl, langKey, 31 | createdBy, createdDate, lastModifiedBy, lastModifiedDate, homeLocation, authorities); 32 | 33 | this.password = password; 34 | } 35 | 36 | public String getPassword() { 37 | return password; 38 | } 39 | 40 | @Override 41 | public String toString() { 42 | return "ManagedUserVM{" + 43 | "} " + super.toString(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/rfb/web/rest/vm/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * View Models used by Spring MVC REST controllers. 3 | */ 4 | package com.rfb.web.rest.vm; 5 | -------------------------------------------------------------------------------- /src/main/resources/.h2.server.properties: -------------------------------------------------------------------------------- 1 | #H2 Server Properties 2 | #Sat Nov 04 14:07:31 EDT 2017 3 | 0=JHipster H2 (Memory)|org.h2.Driver|jdbc\:h2\:mem\:rfbloyalty|rfbloyalty 4 | webAllowOthers=true 5 | webPort=8082 6 | webSSL=false 7 | -------------------------------------------------------------------------------- /src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | 2 | ${AnsiColor.GREEN} ██╗${AnsiColor.RED} ██╗ ██╗ ████████╗ ███████╗ ██████╗ ████████╗ ████████╗ ███████╗ 3 | ${AnsiColor.GREEN} ██║${AnsiColor.RED} ██║ ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗ 4 | ${AnsiColor.GREEN} ██║${AnsiColor.RED} ████████║ ██║ ███████╔╝ ╚█████╗ ██║ ██████╗ ███████╔╝ 5 | ${AnsiColor.GREEN}██╗ ██║${AnsiColor.RED} ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║ 6 | ${AnsiColor.GREEN}╚██████╔╝${AnsiColor.RED} ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗ 7 | ${AnsiColor.GREEN} ╚═════╝ ${AnsiColor.RED} ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝ 8 | 9 | ${AnsiColor.BRIGHT_BLUE}:: JHipster 🤓 :: Running Spring Boot ${spring-boot.version} :: 10 | :: http://www.jhipster.tech ::${AnsiColor.DEFAULT} 11 | -------------------------------------------------------------------------------- /src/main/resources/config/liquibase/authorities.csv: -------------------------------------------------------------------------------- 1 | name 2 | ROLE_ADMIN 3 | ROLE_ORGANIZER 4 | ROLE_RUNNER 5 | -------------------------------------------------------------------------------- /src/main/resources/config/liquibase/changelog/20171014184113_added_entity_RfbLocation.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/main/resources/config/liquibase/changelog/20171014184114_added_entity_RfbEvent.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/main/resources/config/liquibase/changelog/20171014184114_added_entity_constraints_RfbEvent.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 9 | 10 | 11 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/resources/config/liquibase/changelog/20171014184115_added_entity_RfbEventAttendance.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/main/resources/config/liquibase/changelog/20171014184115_added_entity_constraints_RfbEventAttendance.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 9 | 10 | 11 | 16 | 17 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/resources/config/liquibase/changelog/20171014184116_added_entity_RfbUser.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/config/liquibase/changelog/20171014184116_added_entity_constraints_RfbUser.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 9 | 10 | 11 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/resources/config/liquibase/master.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/resources/config/liquibase/users.csv: -------------------------------------------------------------------------------- 1 | id;login;password_hash;first_name;last_name;email;image_url;activated;lang_key;created_by;last_modified_by 2 | 1;system;$2a$10$mE.qmcV0mFU5NcKh73TZx.z4ueI/.bDWbj0T1BYyqP481kGGarKLG;System;System;system@localhost;;true;en;system;system 3 | 2;anonymoususer;$2a$10$j8S5d7Sr7.8VTOYNviDPOeWX8KcYILUVJBsYV83Y5NtECayypx9lO;Anonymous;User;anonymous@localhost;;true;en;system;system 4 | 3;admin;$2a$10$gSAhZrxMllrbgj/kkK9UceBPpChGWJA7SYIb1Mqo.n5aNLq1/oRrC;Administrator;Administrator;admin@localhost;;true;en;system;system 5 | 4;runner;$2a$10$i/qlbLZY6hU/WrSq2NL9yeZR9MQpw73SFT8qnvhwNX9trzQeY7O2W;Runner;Runner;runner@runningforbrews.com;;true;en;system;system 6 | 5;organizer;$2a$10$HIEHA5nYqs8BPLpA8vLYpewdpmWgFDWqdyGhoKVAbvDRyR2zqq2o.;Organizer;Organizer;organizer@runningforbrews.com;;true;en;system;system 7 | -------------------------------------------------------------------------------- /src/main/resources/config/liquibase/users_authorities.csv: -------------------------------------------------------------------------------- 1 | user_id;authority_name 2 | 1;ROLE_ADMIN 3 | 3;ROLE_ADMIN 4 | 4;ROLE_RUNNER 5 | 5;ROLE_ORGANIZER 6 | -------------------------------------------------------------------------------- /src/main/resources/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | # Error page 2 | error.title=Your request cannot be processed 3 | error.subtitle=Sorry, an error has occurred. 4 | error.status=Status: 5 | error.message=Message: 6 | 7 | # Activation email 8 | email.activation.title=rfbloyalty account activation 9 | email.activation.greeting=Dear {0} 10 | email.activation.text1=Your rfbloyalty account has been created, please click on the URL below to activate it: 11 | email.activation.text2=Regards, 12 | email.signature=rfbloyalty Team. 13 | 14 | # Creation email 15 | email.creation.text1=Your rfbloyalty account has been created, please click on the URL below to access it: 16 | 17 | # Reset email 18 | email.reset.title=rfbloyalty password reset 19 | email.reset.greeting=Dear {0} 20 | email.reset.text1=For your rfbloyalty account a password reset was requested, please click on the URL below to reset it: 21 | email.reset.text2=Regards, 22 | 23 | # Social validation email 24 | email.social.registration.title=rfbloyalty account activation 25 | email.social.registration.greeting=Dear {0} 26 | email.social.registration.text1=Your rfbloyalty account has been created with a {0} connection. 27 | email.social.registration.text2=Regards, 28 | -------------------------------------------------------------------------------- /src/main/resources/mails/activationEmail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | JHipster activation 5 | 6 | 7 | 8 | 9 |

10 | Dear 11 |

12 |

13 | Your JHipster account has been created, please click on the URL below to activate it: 14 |

15 |

16 | Activation Link 18 |

19 |

20 | Regards, 21 |
22 | JHipster. 23 |

24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/mails/creationEmail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | JHipster creation 5 | 6 | 7 | 8 | 9 |

10 | Dear 11 |

12 |

13 | Your JHipster account has been created, please click on the URL below to access it: 14 |

15 |

16 | Login link 18 |

19 |

20 | Regards, 21 |
22 | JHipster. 23 |

24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/mails/passwordResetEmail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | JHipster password reset 5 | 6 | 7 | 8 | 9 |

10 | Dear 11 |

12 |

13 | For your JHipster account a password reset was requested, please click on the URL below to reset it: 14 |

15 |

16 | Reset Link 18 |

19 |

20 | Regards, 21 |
22 | JHipster. 23 |

24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/mails/socialRegistrationValidationEmail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | JHipster activation 5 | 6 | 7 | 8 | 9 |

10 | Dear 11 |

12 |

13 | Your JHipster account has been created with the social connection: Provider. 14 |

15 |

16 | Regards, 17 |
18 | JHipster. 19 |

20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/scripts/rfbtables.jh: -------------------------------------------------------------------------------- 1 | entity RfbLocation { 2 | locationName String, 3 | runDayOfWeek Integer 4 | } 5 | 6 | entity RfbEvent { 7 | eventDate LocalDate, 8 | eventCode String 9 | } 10 | 11 | entity RfbEventAttendance { 12 | attendanceDate LocalDate 13 | } 14 | 15 | entity RfbUser { 16 | username String 17 | } 18 | 19 | relationship OneToMany { 20 | RfbLocation{rvbEvent} to RfbEvent, 21 | RfbEvent{rfbEventAttendance} to RfbEventAttendance, 22 | RfbUser{rfbEventAttendance} to RfbEventAttendance 23 | } 24 | 25 | relationship OneToOne { 26 | RfbUser{homeLocation} to RfbLocation 27 | } 28 | 29 | dto * with mapstruct 30 | 31 | service all with serviceImpl 32 | 33 | paginate RfbLocation, RfbEvent with pagination 34 | paginate RfbEventAttendance with infinite-scroll 35 | -------------------------------------------------------------------------------- /src/main/webapp/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Page Not Found 6 | 7 | 8 | 55 | 56 | 57 |

Page Not Found

58 |

Sorry, but the page you were trying to view does not exist.

59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/account.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; 2 | import { RouterModule } from '@angular/router'; 3 | 4 | import { RfbloyaltySharedModule } from '../shared'; 5 | 6 | import { 7 | Register, 8 | ActivateService, 9 | PasswordService, 10 | PasswordResetInitService, 11 | PasswordResetFinishService, 12 | SessionsService, 13 | SessionsComponent, 14 | PasswordStrengthBarComponent, 15 | RegisterComponent, 16 | ActivateComponent, 17 | PasswordComponent, 18 | PasswordResetInitComponent, 19 | PasswordResetFinishComponent, 20 | SettingsComponent, 21 | SocialRegisterComponent, 22 | accountState 23 | } from './'; 24 | 25 | @NgModule({ 26 | imports: [ 27 | RfbloyaltySharedModule, 28 | RouterModule.forRoot(accountState, { useHash: true }) 29 | ], 30 | declarations: [ 31 | SocialRegisterComponent, 32 | ActivateComponent, 33 | RegisterComponent, 34 | PasswordComponent, 35 | PasswordStrengthBarComponent, 36 | PasswordResetInitComponent, 37 | PasswordResetFinishComponent, 38 | SessionsComponent, 39 | SettingsComponent 40 | ], 41 | providers: [ 42 | SessionsService, 43 | Register, 44 | ActivateService, 45 | PasswordService, 46 | PasswordResetInitService, 47 | PasswordResetFinishService 48 | ], 49 | schemas: [CUSTOM_ELEMENTS_SCHEMA] 50 | }) 51 | export class RfbloyaltyAccountModule {} 52 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/account.route.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | 3 | import { 4 | activateRoute, 5 | passwordRoute, 6 | passwordResetFinishRoute, 7 | passwordResetInitRoute, 8 | registerRoute, 9 | sessionsRoute, 10 | socialRegisterRoute, 11 | settingsRoute 12 | } from './'; 13 | 14 | const ACCOUNT_ROUTES = [ 15 | activateRoute, 16 | passwordRoute, 17 | passwordResetFinishRoute, 18 | passwordResetInitRoute, 19 | registerRoute, 20 | sessionsRoute, 21 | socialRegisterRoute, 22 | settingsRoute 23 | ]; 24 | 25 | export const accountState: Routes = [{ 26 | path: '', 27 | children: ACCOUNT_ROUTES 28 | }]; 29 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/activate/activate.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

Activation

5 | 6 |
7 | Your user account has been activated. Please 8 | sign in. 9 |
10 | 11 |
12 | Your user could not be activated. Please use the registration form to sign up. 13 |
14 | 15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/activate/activate.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; 3 | import { ActivatedRoute } from '@angular/router'; 4 | 5 | import { ActivateService } from './activate.service'; 6 | import { LoginModalService } from '../../shared'; 7 | 8 | @Component({ 9 | selector: 'jhi-activate', 10 | templateUrl: './activate.component.html' 11 | }) 12 | export class ActivateComponent implements OnInit { 13 | error: string; 14 | success: string; 15 | modalRef: NgbModalRef; 16 | 17 | constructor( 18 | private activateService: ActivateService, 19 | private loginModalService: LoginModalService, 20 | private route: ActivatedRoute 21 | ) { 22 | } 23 | 24 | ngOnInit() { 25 | this.route.queryParams.subscribe((params) => { 26 | this.activateService.get(params['key']).subscribe(() => { 27 | this.error = null; 28 | this.success = 'OK'; 29 | }, () => { 30 | this.success = null; 31 | this.error = 'ERROR'; 32 | }); 33 | }); 34 | } 35 | 36 | login() { 37 | this.modalRef = this.loginModalService.open(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/activate/activate.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { UserRouteAccessService } from '../../shared'; 4 | import { ActivateComponent } from './activate.component'; 5 | 6 | export const activateRoute: Route = { 7 | path: 'activate', 8 | component: ActivateComponent, 9 | data: { 10 | authorities: [], 11 | pageTitle: 'Activation' 12 | }, 13 | canActivate: [UserRouteAccessService] 14 | }; 15 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/activate/activate.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http, Response, URLSearchParams } from '@angular/http'; 3 | import { Observable } from 'rxjs/Rx'; 4 | import { SERVER_API_URL } from '../../app.constants'; 5 | 6 | @Injectable() 7 | export class ActivateService { 8 | 9 | constructor(private http: Http) {} 10 | 11 | get(key: string): Observable { 12 | const params: URLSearchParams = new URLSearchParams(); 13 | params.set('key', key); 14 | 15 | return this.http.get(SERVER_API_URL + 'api/activate', { 16 | search: params 17 | }).map((res: Response) => res); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/index.ts: -------------------------------------------------------------------------------- 1 | export * from './activate/activate.component'; 2 | export * from './activate/activate.service'; 3 | export * from './activate/activate.route'; 4 | export * from './password/password.component'; 5 | export * from './password/password-strength-bar.component'; 6 | export * from './password/password.service'; 7 | export * from './password/password.route'; 8 | export * from './password-reset/finish/password-reset-finish.component'; 9 | export * from './password-reset/finish/password-reset-finish.service'; 10 | export * from './password-reset/finish/password-reset-finish.route'; 11 | export * from './password-reset/init/password-reset-init.component'; 12 | export * from './password-reset/init/password-reset-init.service'; 13 | export * from './password-reset/init/password-reset-init.route'; 14 | export * from './register/register.component'; 15 | export * from './register/register.service'; 16 | export * from './register/register.route'; 17 | export * from './sessions/sessions.component'; 18 | export * from './sessions/sessions.service'; 19 | export * from './sessions/sessions.route'; 20 | export * from './sessions/session.model'; 21 | export * from './settings/settings.component'; 22 | export * from './settings/settings.route'; 23 | export * from './social/social-register.component'; 24 | export * from './social/social.route'; 25 | export * from './account.route'; 26 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/password-reset/finish/password-reset-finish.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { UserRouteAccessService } from '../../../shared'; 4 | import { PasswordResetFinishComponent } from './password-reset-finish.component'; 5 | 6 | export const passwordResetFinishRoute: Route = { 7 | path: 'reset/finish', 8 | component: PasswordResetFinishComponent, 9 | data: { 10 | authorities: [], 11 | pageTitle: 'Password' 12 | }, 13 | canActivate: [UserRouteAccessService] 14 | }; 15 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/password-reset/finish/password-reset-finish.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http } from '@angular/http'; 3 | import { Observable } from 'rxjs/Rx'; 4 | import { SERVER_API_URL } from '../../../app.constants'; 5 | 6 | @Injectable() 7 | export class PasswordResetFinishService { 8 | 9 | constructor(private http: Http) {} 10 | 11 | save(keyAndPassword: any): Observable { 12 | return this.http.post(SERVER_API_URL + 'api/account/reset-password/finish', keyAndPassword); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/password-reset/init/password-reset-init.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, AfterViewInit, Renderer, ElementRef } from '@angular/core'; 2 | 3 | import { PasswordResetInitService } from './password-reset-init.service'; 4 | 5 | @Component({ 6 | selector: 'jhi-password-reset-init', 7 | templateUrl: './password-reset-init.component.html' 8 | }) 9 | export class PasswordResetInitComponent implements OnInit, AfterViewInit { 10 | error: string; 11 | errorEmailNotExists: string; 12 | resetAccount: any; 13 | success: string; 14 | 15 | constructor( 16 | private passwordResetInitService: PasswordResetInitService, 17 | private elementRef: ElementRef, 18 | private renderer: Renderer 19 | ) { 20 | } 21 | 22 | ngOnInit() { 23 | this.resetAccount = {}; 24 | } 25 | 26 | ngAfterViewInit() { 27 | this.renderer.invokeElementMethod(this.elementRef.nativeElement.querySelector('#email'), 'focus', []); 28 | } 29 | 30 | requestReset() { 31 | this.error = null; 32 | this.errorEmailNotExists = null; 33 | 34 | this.passwordResetInitService.save(this.resetAccount.email).subscribe(() => { 35 | this.success = 'OK'; 36 | }, (response) => { 37 | this.success = null; 38 | if (response.status === 400 && response._body === 'email address not registered') { 39 | this.errorEmailNotExists = 'ERROR'; 40 | } else { 41 | this.error = 'ERROR'; 42 | } 43 | }); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/password-reset/init/password-reset-init.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { UserRouteAccessService } from '../../../shared'; 4 | import { PasswordResetInitComponent } from './password-reset-init.component'; 5 | 6 | export const passwordResetInitRoute: Route = { 7 | path: 'reset/request', 8 | component: PasswordResetInitComponent, 9 | data: { 10 | authorities: [], 11 | pageTitle: 'Password' 12 | }, 13 | canActivate: [UserRouteAccessService] 14 | }; 15 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/password-reset/init/password-reset-init.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http } from '@angular/http'; 3 | import { Observable } from 'rxjs/Rx'; 4 | import { SERVER_API_URL } from '../../../app.constants'; 5 | 6 | @Injectable() 7 | export class PasswordResetInitService { 8 | 9 | constructor(private http: Http) {} 10 | 11 | save(mail: string): Observable { 12 | return this.http.post(SERVER_API_URL + 'api/account/reset-password/init', mail); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/password/password-strength-bar.css: -------------------------------------------------------------------------------- 1 | /* ========================================================================== 2 | start Password strength bar style 3 | ========================================================================== */ 4 | ul#strengthBar { 5 | display:inline; 6 | list-style:none; 7 | margin:0; 8 | margin-left:15px; 9 | padding:0; 10 | vertical-align:2px; 11 | } 12 | 13 | .point:last { 14 | margin:0 !important; 15 | } 16 | .point { 17 | background:#DDD; 18 | border-radius:2px; 19 | display:inline-block; 20 | height:5px; 21 | margin-right:1px; 22 | width:20px; 23 | } 24 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/password/password.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | import { Principal } from '../../shared'; 4 | import { PasswordService } from './password.service'; 5 | 6 | @Component({ 7 | selector: 'jhi-password', 8 | templateUrl: './password.component.html' 9 | }) 10 | export class PasswordComponent implements OnInit { 11 | doNotMatch: string; 12 | error: string; 13 | success: string; 14 | account: any; 15 | password: string; 16 | confirmPassword: string; 17 | 18 | constructor( 19 | private passwordService: PasswordService, 20 | private principal: Principal 21 | ) { 22 | } 23 | 24 | ngOnInit() { 25 | this.principal.identity().then((account) => { 26 | this.account = account; 27 | }); 28 | } 29 | 30 | changePassword() { 31 | if (this.password !== this.confirmPassword) { 32 | this.error = null; 33 | this.success = null; 34 | this.doNotMatch = 'ERROR'; 35 | } else { 36 | this.doNotMatch = null; 37 | this.passwordService.save(this.password).subscribe(() => { 38 | this.error = null; 39 | this.success = 'OK'; 40 | }, () => { 41 | this.success = null; 42 | this.error = 'ERROR'; 43 | }); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/password/password.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { UserRouteAccessService } from '../../shared'; 4 | import { PasswordComponent } from './password.component'; 5 | 6 | export const passwordRoute: Route = { 7 | path: 'password', 8 | component: PasswordComponent, 9 | data: { 10 | authorities: ['ROLE_RUNNER', 'ROLE_ORGANIZER'], 11 | pageTitle: 'Password' 12 | }, 13 | canActivate: [UserRouteAccessService] 14 | }; 15 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/password/password.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http } from '@angular/http'; 3 | import { Observable } from 'rxjs/Rx'; 4 | import { SERVER_API_URL } from '../../app.constants'; 5 | 6 | @Injectable() 7 | export class PasswordService { 8 | 9 | constructor(private http: Http) {} 10 | 11 | save(newPassword: string): Observable { 12 | return this.http.post(SERVER_API_URL + 'api/account/change-password', newPassword); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/register/register.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { UserRouteAccessService } from '../../shared'; 4 | import { RegisterComponent } from './register.component'; 5 | 6 | export const registerRoute: Route = { 7 | path: 'register', 8 | component: RegisterComponent, 9 | data: { 10 | authorities: [], 11 | pageTitle: 'Registration' 12 | }, 13 | canActivate: [UserRouteAccessService] 14 | }; 15 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/register/register.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http } from '@angular/http'; 3 | import { Observable } from 'rxjs/Rx'; 4 | import { SERVER_API_URL } from '../../app.constants'; 5 | 6 | @Injectable() 7 | export class Register { 8 | 9 | constructor(private http: Http) {} 10 | 11 | save(account: any): Observable { 12 | return this.http.post(SERVER_API_URL + 'api/register', account); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/sessions/session.model.ts: -------------------------------------------------------------------------------- 1 | export class Session { 2 | constructor( 3 | public series: string, 4 | public tokenDate: Date, 5 | public ipAddress: string, 6 | public userAgent: string 7 | ) { } 8 | } 9 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/sessions/sessions.component.html: -------------------------------------------------------------------------------- 1 |
2 |

Active sessions for [{{account.login}}]

3 | 4 |
5 | Session invalidated! 6 |
7 |
8 | An error has occured! The session could not be invalidated. 9 |
10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 33 | 34 | 35 |
IP AddressUser agentDate
{{session.ipAddress}}{{session.userAgent}}{{session.tokenDate | date:'longDate'}} 27 | 32 |
36 |
37 |
38 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/sessions/sessions.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | import { Session } from './session.model'; 4 | import { SessionsService } from './sessions.service'; 5 | import { Principal } from '../../shared'; 6 | 7 | @Component({ 8 | selector: 'jhi-sessions', 9 | templateUrl: './sessions.component.html' 10 | }) 11 | export class SessionsComponent implements OnInit { 12 | 13 | account: any; 14 | error: string; 15 | success: string; 16 | sessions: Session[]; 17 | 18 | constructor( 19 | private sessionsService: SessionsService, 20 | private principal: Principal 21 | ) { 22 | } 23 | 24 | ngOnInit() { 25 | this.sessionsService.findAll().subscribe((sessions) => this.sessions = sessions); 26 | 27 | this.principal.identity().then((account) => { 28 | this.account = account; 29 | }); 30 | } 31 | 32 | invalidate(series) { 33 | this.sessionsService.delete(encodeURIComponent(series)).subscribe( 34 | (response) => { 35 | if (response.status === 200) { 36 | this.error = null; 37 | this.success = 'OK'; 38 | this.sessionsService.findAll().subscribe((sessions) => this.sessions = sessions); 39 | } else { 40 | this.success = null; 41 | this.error = 'ERROR'; 42 | } 43 | }); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/sessions/sessions.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { UserRouteAccessService } from '../../shared'; 4 | import { SessionsComponent } from './sessions.component'; 5 | 6 | export const sessionsRoute: Route = { 7 | path: 'sessions', 8 | component: SessionsComponent, 9 | data: { 10 | authorities: ['ROLE_RUNNER', 'ROLE_ORGANIZER'], 11 | pageTitle: 'Sessions' 12 | }, 13 | canActivate: [UserRouteAccessService] 14 | }; 15 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/sessions/sessions.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http, Response } from '@angular/http'; 3 | import { Observable } from 'rxjs/Rx'; 4 | 5 | import { Session } from './session.model'; 6 | 7 | import { SERVER_API_URL } from '../../app.constants'; 8 | 9 | @Injectable() 10 | export class SessionsService { 11 | 12 | private resourceUrl = SERVER_API_URL + 'api/account/sessions/'; 13 | constructor(private http: Http) { } 14 | 15 | findAll(): Observable { 16 | return this.http.get(this.resourceUrl).map((res: Response) => res.json()); 17 | } 18 | 19 | delete(series: string): Observable { 20 | return this.http.delete(`${this.resourceUrl}${series}`); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/settings/settings.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { UserRouteAccessService } from '../../shared'; 4 | import { SettingsComponent } from './settings.component'; 5 | 6 | export const settingsRoute: Route = { 7 | path: 'settings', 8 | component: SettingsComponent, 9 | data: { 10 | authorities: ['ROLE_RUNNER', 'ROLE_ORGANIZER', 'ROLE_ADMIN'], 11 | pageTitle: 'Settings' 12 | }, 13 | canActivate: [UserRouteAccessService] 14 | }; 15 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/social/social-register.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

Registration with

5 |

Registration

6 | 7 |
8 | Registration saved! Please check your email for confirmation. 9 |
10 | 11 |
12 | Registration failed! Please try again later. 13 |
14 | 15 | 16 |
17 |
18 | If you want to 19 | sign in, you can try the default accounts:
- Administrator (login="admin" and password="admin")
- User (login="user" and password="user").
20 |
21 |
22 |
23 |
24 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/social/social-register.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ActivatedRoute } from '@angular/router'; 3 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; 4 | 5 | import { LoginModalService } from '../../shared'; 6 | 7 | @Component({ 8 | selector: 'jhi-register', 9 | templateUrl: './social-register.component.html' 10 | }) 11 | export class SocialRegisterComponent implements OnInit { 12 | success: boolean; 13 | error: boolean; 14 | provider: string; 15 | providerLabel: string; 16 | modalRef: NgbModalRef; 17 | 18 | constructor( 19 | private route: ActivatedRoute, 20 | private loginModalService: LoginModalService 21 | ) { 22 | } 23 | 24 | ngOnInit() { 25 | this.route.queryParams.subscribe((queryParams) => { 26 | this.success = queryParams['success']; 27 | }); 28 | this.route.params.subscribe((params) => { 29 | this.provider = params['provider?{success:boolean}']; 30 | }); 31 | this.error = !this.success; 32 | this.providerLabel = this.provider.charAt(0).toUpperCase() + this.provider.slice(1); 33 | } 34 | 35 | login() { 36 | this.modalRef = this.loginModalService.open(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/webapp/app/account/social/social.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { UserRouteAccessService } from '../../shared'; 4 | import { SocialRegisterComponent } from './social-register.component'; 5 | 6 | export const socialRegisterRoute: Route = { 7 | path: 'social-register/:provider?{success:boolean}', 8 | component: SocialRegisterComponent, 9 | data: { 10 | authorities: [], 11 | pageTitle: 'Register with {{ label }}' 12 | }, 13 | canActivate: [UserRouteAccessService] 14 | }; 15 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/admin.route.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | 3 | import { 4 | auditsRoute, 5 | configurationRoute, 6 | docsRoute, 7 | healthRoute, 8 | logsRoute, 9 | metricsRoute, 10 | userMgmtRoute, 11 | userDialogRoute 12 | } from './'; 13 | 14 | import { UserRouteAccessService } from '../shared'; 15 | 16 | const ADMIN_ROUTES = [ 17 | auditsRoute, 18 | configurationRoute, 19 | docsRoute, 20 | healthRoute, 21 | logsRoute, 22 | ...userMgmtRoute, 23 | metricsRoute 24 | ]; 25 | 26 | export const adminState: Routes = [{ 27 | path: '', 28 | data: { 29 | authorities: ['ROLE_ADMIN'] 30 | }, 31 | canActivate: [UserRouteAccessService], 32 | children: ADMIN_ROUTES 33 | }, 34 | ...userDialogRoute 35 | ]; 36 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/audits/audit-data.model.ts: -------------------------------------------------------------------------------- 1 | export class AuditData { 2 | constructor( 3 | public remoteAddress: string, 4 | public sessionId: string 5 | ) { } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/audits/audit.model.ts: -------------------------------------------------------------------------------- 1 | import { AuditData } from './audit-data.model'; 2 | 3 | export class Audit { 4 | constructor( 5 | public data: AuditData, 6 | public principal: string, 7 | public timestamp: string, 8 | public type: string 9 | ) { } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/audits/audits.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { AuditsComponent } from './audits.component'; 4 | 5 | export const auditsRoute: Route = { 6 | path: 'audits', 7 | component: AuditsComponent, 8 | data: { 9 | pageTitle: 'Audits' 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/audits/audits.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http, Response, URLSearchParams } from '@angular/http'; 3 | import { Observable } from 'rxjs/Rx'; 4 | 5 | @Injectable() 6 | export class AuditsService { 7 | constructor(private http: Http) { } 8 | 9 | query(req: any): Observable { 10 | const params: URLSearchParams = new URLSearchParams(); 11 | params.set('fromDate', req.fromDate); 12 | params.set('toDate', req.toDate); 13 | params.set('page', req.page); 14 | params.set('size', req.size); 15 | params.set('sort', req.sort); 16 | 17 | const options = { 18 | search: params 19 | }; 20 | 21 | return this.http.get('management/audits', options); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/configuration/configuration.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | import { JhiConfigurationService } from './configuration.service'; 4 | 5 | @Component({ 6 | selector: 'jhi-configuration', 7 | templateUrl: './configuration.component.html' 8 | }) 9 | export class JhiConfigurationComponent implements OnInit { 10 | allConfiguration: any = null; 11 | configuration: any = null; 12 | configKeys: any[]; 13 | filter: string; 14 | orderProp: string; 15 | reverse: boolean; 16 | 17 | constructor( 18 | private configurationService: JhiConfigurationService 19 | ) { 20 | this.configKeys = []; 21 | this.filter = ''; 22 | this.orderProp = 'prefix'; 23 | this.reverse = false; 24 | } 25 | 26 | keys(dict): Array { 27 | return (dict === undefined) ? [] : Object.keys(dict); 28 | } 29 | 30 | ngOnInit() { 31 | this.configurationService.get().subscribe((configuration) => { 32 | this.configuration = configuration; 33 | 34 | for (const config of configuration) { 35 | if (config.properties !== undefined) { 36 | this.configKeys.push(Object.keys(config.properties)); 37 | } 38 | } 39 | }); 40 | 41 | this.configurationService.getEnv().subscribe((configuration) => { 42 | this.allConfiguration = configuration; 43 | }); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/configuration/configuration.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { JhiConfigurationComponent } from './configuration.component'; 4 | 5 | export const configurationRoute: Route = { 6 | path: 'jhi-configuration', 7 | component: JhiConfigurationComponent, 8 | data: { 9 | pageTitle: 'Configuration' 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/docs/docs.component.html: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/docs/docs.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'jhi-docs', 5 | templateUrl: './docs.component.html' 6 | }) 7 | export class JhiDocsComponent { 8 | constructor( 9 | ) { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/docs/docs.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { JhiDocsComponent } from './docs.component'; 4 | 5 | export const docsRoute: Route = { 6 | path: 'docs', 7 | component: JhiDocsComponent, 8 | data: { 9 | pageTitle: 'API' 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/health/health-modal.component.html: -------------------------------------------------------------------------------- 1 | 8 | 33 | 36 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/health/health-modal.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; 3 | 4 | import { JhiHealthService } from './health.service'; 5 | 6 | @Component({ 7 | selector: 'jhi-health-modal', 8 | templateUrl: './health-modal.component.html' 9 | }) 10 | export class JhiHealthModalComponent { 11 | 12 | currentHealth: any; 13 | 14 | constructor(private healthService: JhiHealthService, public activeModal: NgbActiveModal) {} 15 | 16 | baseName(name) { 17 | return this.healthService.getBaseName(name); 18 | } 19 | 20 | subSystemName(name) { 21 | return this.healthService.getSubSystemName(name); 22 | } 23 | 24 | readableValue(value: number) { 25 | if (this.currentHealth.name !== 'diskSpace') { 26 | return value.toString(); 27 | } 28 | 29 | // Should display storage space in an human readable unit 30 | const val = value / 1073741824; 31 | if (val > 1) { // Value 32 | return val.toFixed(2) + ' GB'; 33 | } else { 34 | return (value / 1048576).toFixed(2) + ' MB'; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/health/health.component.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | Health Checks 4 | 7 |

8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 25 | 30 | 31 | 32 |
Service NameStatusDetails
{{ baseName(health.name) }} {{subSystemName(health.name)}} 21 | 22 | {{health.status}} 23 | 24 | 26 | 27 | 28 | 29 |
33 |
34 |
35 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/health/health.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { JhiHealthCheckComponent } from './health.component'; 4 | 5 | export const healthRoute: Route = { 6 | path: 'jhi-health', 7 | component: JhiHealthCheckComponent, 8 | data: { 9 | pageTitle: 'Health Checks' 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/index.ts: -------------------------------------------------------------------------------- 1 | export * from './audits/audits.component'; 2 | export * from './audits/audits.service'; 3 | export * from './audits/audits.route'; 4 | export * from './audits/audit.model'; 5 | export * from './audits/audit-data.model'; 6 | export * from './configuration/configuration.component'; 7 | export * from './configuration/configuration.service'; 8 | export * from './configuration/configuration.route'; 9 | export * from './docs/docs.component'; 10 | export * from './docs/docs.route'; 11 | export * from './health/health.component'; 12 | export * from './health/health-modal.component'; 13 | export * from './health/health.service'; 14 | export * from './health/health.route'; 15 | export * from './logs/logs.component'; 16 | export * from './logs/logs.service'; 17 | export * from './logs/logs.route'; 18 | export * from './logs/log.model'; 19 | export * from './metrics/metrics.component'; 20 | export * from './metrics/metrics-modal.component'; 21 | export * from './metrics/metrics.service'; 22 | export * from './metrics/metrics.route'; 23 | export * from './user-management/user-management-dialog.component'; 24 | export * from './user-management/user-management-delete-dialog.component'; 25 | export * from './user-management/user-management-detail.component'; 26 | export * from './user-management/user-management.component'; 27 | export * from './user-management/user-management.route'; 28 | export * from './user-management/user-modal.service'; 29 | export * from './admin.route'; 30 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/logs/log.model.ts: -------------------------------------------------------------------------------- 1 | export class Log { 2 | constructor( 3 | public name: string, 4 | public level: string 5 | ) { } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/logs/logs.component.html: -------------------------------------------------------------------------------- 1 |
2 |

Logs

3 | 4 |

There are {{ loggers.length }} loggers.

5 | 6 | Filter 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 25 | 26 |
NameLevel
{{logger.name | slice:0:140}} 19 | 20 | 21 | 22 | 23 | 24 |
27 |
28 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/logs/logs.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | import { Log } from './log.model'; 4 | import { LogsService } from './logs.service'; 5 | 6 | @Component({ 7 | selector: 'jhi-logs', 8 | templateUrl: './logs.component.html', 9 | }) 10 | export class LogsComponent implements OnInit { 11 | 12 | loggers: Log[]; 13 | filter: string; 14 | orderProp: string; 15 | reverse: boolean; 16 | 17 | constructor( 18 | private logsService: LogsService 19 | ) { 20 | this.filter = ''; 21 | this.orderProp = 'name'; 22 | this.reverse = false; 23 | } 24 | 25 | ngOnInit() { 26 | this.logsService.findAll().subscribe((loggers) => this.loggers = loggers); 27 | } 28 | 29 | changeLevel(name: string, level: string) { 30 | const log = new Log(name, level); 31 | this.logsService.changeLevel(log).subscribe(() => { 32 | this.logsService.findAll().subscribe((loggers) => this.loggers = loggers); 33 | }); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/logs/logs.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { LogsComponent } from './logs.component'; 4 | 5 | export const logsRoute: Route = { 6 | path: 'logs', 7 | component: LogsComponent, 8 | data: { 9 | pageTitle: 'Logs' 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/logs/logs.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http, Response } from '@angular/http'; 3 | import { Observable } from 'rxjs/Rx'; 4 | 5 | import { Log } from './log.model'; 6 | 7 | @Injectable() 8 | export class LogsService { 9 | constructor(private http: Http) { } 10 | 11 | changeLevel(log: Log): Observable { 12 | return this.http.put('management/logs', log); 13 | } 14 | 15 | findAll(): Observable { 16 | return this.http.get('management/logs').map((res: Response) => res.json()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/metrics/metrics-modal.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; 3 | 4 | @Component({ 5 | selector: 'jhi-metrics-modal', 6 | templateUrl: './metrics-modal.component.html' 7 | }) 8 | export class JhiMetricsMonitoringModalComponent implements OnInit { 9 | 10 | threadDumpFilter: any; 11 | threadDump: any; 12 | threadDumpAll = 0; 13 | threadDumpBlocked = 0; 14 | threadDumpRunnable = 0; 15 | threadDumpTimedWaiting = 0; 16 | threadDumpWaiting = 0; 17 | 18 | constructor(public activeModal: NgbActiveModal) {} 19 | 20 | ngOnInit() { 21 | this.threadDump.forEach((value) => { 22 | if (value.threadState === 'RUNNABLE') { 23 | this.threadDumpRunnable += 1; 24 | } else if (value.threadState === 'WAITING') { 25 | this.threadDumpWaiting += 1; 26 | } else if (value.threadState === 'TIMED_WAITING') { 27 | this.threadDumpTimedWaiting += 1; 28 | } else if (value.threadState === 'BLOCKED') { 29 | this.threadDumpBlocked += 1; 30 | } 31 | }); 32 | 33 | this.threadDumpAll = this.threadDumpRunnable + this.threadDumpWaiting + 34 | this.threadDumpTimedWaiting + this.threadDumpBlocked; 35 | } 36 | 37 | getBadgeClass(threadState) { 38 | if (threadState === 'RUNNABLE') { 39 | return 'badge-success'; 40 | } else if (threadState === 'WAITING') { 41 | return 'badge-info'; 42 | } else if (threadState === 'TIMED_WAITING') { 43 | return 'badge-warning'; 44 | } else if (threadState === 'BLOCKED') { 45 | return 'badge-danger'; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/metrics/metrics.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { JhiMetricsMonitoringComponent } from './metrics.component'; 4 | 5 | export const metricsRoute: Route = { 6 | path: 'jhi-metrics', 7 | component: JhiMetricsMonitoringComponent, 8 | data: { 9 | pageTitle: 'Application Metrics' 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/metrics/metrics.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http, Response } from '@angular/http'; 3 | import { Observable } from 'rxjs/Rx'; 4 | 5 | @Injectable() 6 | export class JhiMetricsService { 7 | 8 | constructor(private http: Http) {} 9 | 10 | getMetrics(): Observable { 11 | return this.http.get('management/metrics').map((res: Response) => res.json()); 12 | } 13 | 14 | threadDump(): Observable { 15 | return this.http.get('management/dump').map((res: Response) => res.json()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/user-management/user-management-delete-dialog.component.html: -------------------------------------------------------------------------------- 1 |
2 | 7 | 11 | 19 |
20 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/user-management/user-management-detail.component.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | User [{{user.login}}] 4 |

5 |
6 |
Login
7 |
8 | {{user.login}} 9 | Deactivated 11 | Activated 13 |
14 |
First Name
15 |
{{user.firstName}}
16 |
Last Name
17 |
{{user.lastName}}
18 |
Email
19 |
{{user.email}}
20 |
Created By
21 |
{{user.createdBy}}
22 |
Created Date
23 |
{{user.createdDate | date:'dd/MM/yy HH:mm' }}
24 |
Last Modified By
25 |
{{user.lastModifiedBy}}
26 |
Last Modified Date
27 |
{{user.lastModifiedDate | date:'dd/MM/yy HH:mm'}}
28 |
Profiles
29 |
30 |
    31 |
  • 32 | {{authority}} 33 |
  • 34 |
35 |
36 |
37 | 42 |
43 | -------------------------------------------------------------------------------- /src/main/webapp/app/admin/user-management/user-management-detail.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, OnDestroy } from '@angular/core'; 2 | import { ActivatedRoute } from '@angular/router'; 3 | import { Subscription } from 'rxjs/Rx'; 4 | 5 | import { User, UserService } from '../../shared'; 6 | 7 | @Component({ 8 | selector: 'jhi-user-mgmt-detail', 9 | templateUrl: './user-management-detail.component.html' 10 | }) 11 | export class UserMgmtDetailComponent implements OnInit, OnDestroy { 12 | 13 | user: User; 14 | private subscription: Subscription; 15 | 16 | constructor( 17 | private userService: UserService, 18 | private route: ActivatedRoute 19 | ) { 20 | } 21 | 22 | ngOnInit() { 23 | this.subscription = this.route.params.subscribe((params) => { 24 | this.load(params['login']); 25 | }); 26 | } 27 | 28 | load(login) { 29 | this.userService.find(login).subscribe((user) => { 30 | this.user = user; 31 | console.log(this.user[0]); 32 | }); 33 | } 34 | 35 | ngOnDestroy() { 36 | this.subscription.unsubscribe(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/webapp/app/app.constants.ts: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT THIS FILE, EDIT THE WEBPACK COMMON CONFIG INSTEAD, WHICH WILL MODIFY THIS FILE 2 | /* tslint:disable */ 3 | let _VERSION = '0.0.1-SNAPSHOT'; // This value will be overwritten by Webpack 4 | let _DEBUG_INFO_ENABLED = true; // This value will be overwritten by Webpack 5 | let _SERVER_API_URL = '/'; // This value will be overwritten by Webpack 6 | /* @toreplace VERSION */ 7 | /* @toreplace DEBUG_INFO_ENABLED */ 8 | /* @toreplace SERVER_API_URL */ 9 | /* tslint:enable */ 10 | export const VERSION = _VERSION; 11 | export const DEBUG_INFO_ENABLED = _DEBUG_INFO_ENABLED; 12 | export const SERVER_API_URL = _SERVER_API_URL; 13 | -------------------------------------------------------------------------------- /src/main/webapp/app/app.main-aot.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowser } from '@angular/platform-browser'; 2 | import { ProdConfig } from './blocks/config/prod.config'; 3 | import { RfbloyaltyAppModuleNgFactory } from '../../../../build/aot/src/main/webapp/app/app.module.ngfactory'; 4 | 5 | ProdConfig(); 6 | 7 | platformBrowser().bootstrapModuleFactory(RfbloyaltyAppModuleNgFactory) 8 | .then((success) => console.log(`Application started`)) 9 | .catch((err) => console.error(err)); 10 | -------------------------------------------------------------------------------- /src/main/webapp/app/app.main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | import { ProdConfig } from './blocks/config/prod.config'; 3 | import { RfbloyaltyAppModule } from './app.module'; 4 | 5 | ProdConfig(); 6 | 7 | if (module['hot']) { 8 | module['hot'].accept(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(RfbloyaltyAppModule) 12 | .then((success) => console.log(`Application started`)) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /src/main/webapp/app/app.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { NavbarComponent } from './layouts'; 4 | 5 | export const navbarRoute: Route = { 6 | path: '', 7 | component: NavbarComponent, 8 | outlet: 'navbar' 9 | }; 10 | -------------------------------------------------------------------------------- /src/main/webapp/app/blocks/config/prod.config.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { DEBUG_INFO_ENABLED } from '../../app.constants'; 3 | 4 | export function ProdConfig() { 5 | // disable debug data on prod profile to improve performance 6 | if (!DEBUG_INFO_ENABLED) { 7 | enableProdMode(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/webapp/app/blocks/config/uib-pagination.config.ts: -------------------------------------------------------------------------------- 1 | import { ITEMS_PER_PAGE } from '../../shared'; 2 | import { Injectable } from '@angular/core'; 3 | import { NgbPaginationConfig} from '@ng-bootstrap/ng-bootstrap'; 4 | 5 | @Injectable() 6 | export class PaginationConfig { 7 | constructor(private config: NgbPaginationConfig) { 8 | config.boundaryLinks = true; 9 | config.maxSize = 5; 10 | config.pageSize = ITEMS_PER_PAGE; 11 | config.size = 'sm'; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/webapp/app/blocks/interceptor/errorhandler.interceptor.ts: -------------------------------------------------------------------------------- 1 | import { JhiHttpInterceptor, JhiEventManager } from 'ng-jhipster'; 2 | import { RequestOptionsArgs, Response } from '@angular/http'; 3 | import { Observable } from 'rxjs/Observable'; 4 | 5 | export class ErrorHandlerInterceptor extends JhiHttpInterceptor { 6 | 7 | constructor(private eventManager: JhiEventManager) { 8 | super(); 9 | } 10 | 11 | requestIntercept(options?: RequestOptionsArgs): RequestOptionsArgs { 12 | return options; 13 | } 14 | 15 | responseIntercept(observable: Observable): Observable { 16 | return > observable.catch((error) => { 17 | if (!(error.status === 401 && (error.text() === '' || 18 | (error.json().path && error.json().path.indexOf('/api/account') === 0 )))) { 19 | if (this.eventManager !== undefined) { 20 | this.eventManager.broadcast( {name: 'rfbloyaltyApp.httpError', content: error}); 21 | } 22 | } 23 | return Observable.throw(error); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/webapp/app/blocks/interceptor/http.provider.ts: -------------------------------------------------------------------------------- 1 | import { JhiEventManager, JhiInterceptableHttp } from 'ng-jhipster'; 2 | import { Injector } from '@angular/core'; 3 | import { Http, XHRBackend, RequestOptions } from '@angular/http'; 4 | import { Router } from '@angular/router/router'; 5 | 6 | import { StateStorageService } from '../../shared/auth/state-storage.service'; 7 | import { AuthExpiredInterceptor } from './auth-expired.interceptor'; 8 | import { ErrorHandlerInterceptor } from './errorhandler.interceptor'; 9 | import { NotificationInterceptor } from './notification.interceptor'; 10 | 11 | export function interceptableFactory( 12 | backend: XHRBackend, 13 | defaultOptions: RequestOptions, 14 | injector: Injector, 15 | stateStorageService: StateStorageService, 16 | router: Router, 17 | eventManager: JhiEventManager 18 | ) { 19 | return new JhiInterceptableHttp( 20 | backend, 21 | defaultOptions, 22 | [ 23 | new AuthExpiredInterceptor(injector, stateStorageService, router), 24 | // Other interceptors can be added here 25 | new ErrorHandlerInterceptor(eventManager), 26 | new NotificationInterceptor(injector) 27 | ] 28 | ); 29 | } 30 | 31 | export function customHttpProvider() { 32 | return { 33 | provide: Http, 34 | useFactory: interceptableFactory, 35 | deps: [ 36 | XHRBackend, 37 | RequestOptions, 38 | Injector, 39 | StateStorageService, 40 | JhiEventManager 41 | ] 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /src/main/webapp/app/blocks/interceptor/notification.interceptor.ts: -------------------------------------------------------------------------------- 1 | import { JhiAlertService, JhiHttpInterceptor } from 'ng-jhipster'; 2 | import { RequestOptionsArgs, Response } from '@angular/http'; 3 | import { Injector } from '@angular/core'; 4 | import { Observable } from 'rxjs/Observable'; 5 | 6 | export class NotificationInterceptor extends JhiHttpInterceptor { 7 | 8 | private alertService: JhiAlertService; 9 | 10 | constructor(private injector: Injector) { 11 | super(); 12 | setTimeout(() => this.alertService = injector.get(JhiAlertService)); 13 | } 14 | 15 | requestIntercept(options?: RequestOptionsArgs): RequestOptionsArgs { 16 | return options; 17 | } 18 | 19 | responseIntercept(observable: Observable): Observable { 20 | return observable.map((response: Response) => { 21 | const headers = []; 22 | response.headers.forEach((value, name) => { 23 | if (name.toLowerCase().endsWith('app-alert') || name.toLowerCase().endsWith('app-params')) { 24 | headers.push(name); 25 | } 26 | }); 27 | if (headers.length > 1) { 28 | headers.sort(); 29 | const alertKey = response.headers.get(headers[ 0 ]); 30 | if (typeof alertKey === 'string') { 31 | if (this.alertService) { 32 | this.alertService.success(alertKey, null, null); 33 | } 34 | } 35 | } 36 | return response; 37 | }).catch((error) => { 38 | return Observable.throw(error); // here, response is an error 39 | }); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/entity.module.ts: -------------------------------------------------------------------------------- 1 | import {CUSTOM_ELEMENTS_SCHEMA, NgModule} from '@angular/core'; 2 | 3 | import {RfbloyaltyRfbLocationModule} from './rfb-location/rfb-location.module'; 4 | import {RfbloyaltyRfbEventModule} from './rfb-event/rfb-event.module'; 5 | import {RfbloyaltyRfbEventAttendanceModule} from './rfb-event-attendance/rfb-event-attendance.module'; 6 | 7 | /* jhipster-needle-add-entity-module-import - JHipster will add entity modules imports here */ 8 | 9 | @NgModule({ 10 | imports: [ 11 | RfbloyaltyRfbLocationModule, 12 | RfbloyaltyRfbEventModule, 13 | RfbloyaltyRfbEventAttendanceModule 14 | /* jhipster-needle-add-entity-module - JHipster will add entity modules here */ 15 | ], 16 | declarations: [], 17 | entryComponents: [], 18 | providers: [], 19 | schemas: [CUSTOM_ELEMENTS_SCHEMA] 20 | }) 21 | export class RfbloyaltyEntityModule {} 22 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/rfb-event-attendance/index.ts: -------------------------------------------------------------------------------- 1 | export * from './rfb-event-attendance.model'; 2 | export * from './rfb-event-attendance-popup.service'; 3 | export * from './rfb-event-attendance.service'; 4 | export * from './rfb-event-attendance-dialog.component'; 5 | export * from './rfb-event-attendance-delete-dialog.component'; 6 | export * from './rfb-event-attendance-detail.component'; 7 | export * from './rfb-event-attendance.component'; 8 | export * from './rfb-event-attendance.route'; 9 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/rfb-event-attendance/rfb-event-attendance-delete-dialog.component.html: -------------------------------------------------------------------------------- 1 |
2 | 7 | 11 | 19 |
20 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/rfb-event-attendance/rfb-event-attendance-detail.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

Event Attendance {{rfbEventAttendance.id}}

4 |
5 | 6 |
7 |
Attendance Date
8 |
9 | {{rfbEventAttendance.attendanceDate | date:'mediumDate'}} 10 |
11 |
Event
12 |
13 | 16 |
17 |
User
18 |
19 | 22 |
23 |
24 | 25 | 30 | 31 | 37 |
38 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/rfb-event-attendance/rfb-event-attendance.model.ts: -------------------------------------------------------------------------------- 1 | import {BaseEntity} from './../../shared'; 2 | import {RfbEvent} from '../rfb-event/rfb-event.model'; 3 | import {User} from '../../shared/user/user.model'; 4 | 5 | export class RfbEventAttendance implements BaseEntity { 6 | constructor( 7 | public id?: number, 8 | public attendanceDate?: any, 9 | public rfbEventDTO?: RfbEvent, 10 | public userDTO?: User 11 | ) { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/rfb-event-attendance/rfb-event-attendance.module.ts: -------------------------------------------------------------------------------- 1 | import {CUSTOM_ELEMENTS_SCHEMA, NgModule} from '@angular/core'; 2 | import {RouterModule} from '@angular/router'; 3 | 4 | import {RfbloyaltySharedModule} from '../../shared'; 5 | import { 6 | RfbEventAttendanceComponent, 7 | RfbEventAttendanceDeleteDialogComponent, 8 | RfbEventAttendanceDeletePopupComponent, 9 | RfbEventAttendanceDetailComponent, 10 | RfbEventAttendanceDialogComponent, 11 | RfbEventAttendancePopupComponent, 12 | rfbEventAttendancePopupRoute, 13 | RfbEventAttendancePopupService, 14 | rfbEventAttendanceRoute, 15 | RfbEventAttendanceService, 16 | } from './'; 17 | 18 | const ENTITY_STATES = [ 19 | ...rfbEventAttendanceRoute, 20 | ...rfbEventAttendancePopupRoute, 21 | ]; 22 | 23 | @NgModule({ 24 | imports: [ 25 | RfbloyaltySharedModule, 26 | RouterModule.forRoot(ENTITY_STATES, { useHash: true }) 27 | ], 28 | declarations: [ 29 | RfbEventAttendanceComponent, 30 | RfbEventAttendanceDetailComponent, 31 | RfbEventAttendanceDialogComponent, 32 | RfbEventAttendanceDeleteDialogComponent, 33 | RfbEventAttendancePopupComponent, 34 | RfbEventAttendanceDeletePopupComponent, 35 | ], 36 | entryComponents: [ 37 | RfbEventAttendanceComponent, 38 | RfbEventAttendanceDialogComponent, 39 | RfbEventAttendancePopupComponent, 40 | RfbEventAttendanceDeleteDialogComponent, 41 | RfbEventAttendanceDeletePopupComponent, 42 | ], 43 | providers: [ 44 | RfbEventAttendanceService, 45 | RfbEventAttendancePopupService, 46 | ], 47 | schemas: [CUSTOM_ELEMENTS_SCHEMA] 48 | }) 49 | export class RfbloyaltyRfbEventAttendanceModule {} 50 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/rfb-event/index.ts: -------------------------------------------------------------------------------- 1 | export * from './rfb-event.model'; 2 | export * from './rfb-event-popup.service'; 3 | export * from './rfb-event.service'; 4 | export * from './rfb-event-dialog.component'; 5 | export * from './rfb-event-delete-dialog.component'; 6 | export * from './rfb-event-detail.component'; 7 | export * from './rfb-event.component'; 8 | export * from './rfb-event.route'; 9 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/rfb-event/rfb-event-delete-dialog.component.html: -------------------------------------------------------------------------------- 1 |
2 | 7 | 11 | 19 |
20 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/rfb-event/rfb-event-detail.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

Event {{rfbEvent.id}}

4 |
5 | 6 |
7 |
Event Date
8 |
9 | {{rfbEvent.eventDate | date:'mediumDate'}} 10 |
11 |
Event Code
12 |
13 | {{rfbEvent.eventCode}} 14 |
15 |
Location
16 |
17 | 20 |
21 |
22 | 23 | 28 | 29 | 35 |
36 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/rfb-event/rfb-event-detail.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, OnDestroy, OnInit} from '@angular/core'; 2 | import {ActivatedRoute} from '@angular/router'; 3 | import {Subscription} from 'rxjs/Rx'; 4 | import {JhiEventManager} from 'ng-jhipster'; 5 | 6 | import {RfbEvent} from './rfb-event.model'; 7 | import {RfbEventService} from './rfb-event.service'; 8 | 9 | @Component({ 10 | selector: 'jhi-rfb-event-detail', 11 | templateUrl: './rfb-event-detail.component.html' 12 | }) 13 | export class RfbEventDetailComponent implements OnInit, OnDestroy { 14 | 15 | rfbEvent: RfbEvent; 16 | private subscription: Subscription; 17 | private eventSubscriber: Subscription; 18 | 19 | constructor( 20 | private eventManager: JhiEventManager, 21 | private rfbEventService: RfbEventService, 22 | private route: ActivatedRoute 23 | ) { 24 | } 25 | 26 | ngOnInit() { 27 | this.subscription = this.route.params.subscribe((params) => { 28 | this.load(params['id']); 29 | }); 30 | this.registerChangeInRfbEvents(); 31 | } 32 | 33 | load(id) { 34 | this.rfbEventService.find(id).subscribe((rfbEvent) => { 35 | this.rfbEvent = rfbEvent; 36 | }); 37 | } 38 | previousState() { 39 | window.history.back(); 40 | } 41 | 42 | ngOnDestroy() { 43 | this.subscription.unsubscribe(); 44 | this.eventManager.destroy(this.eventSubscriber); 45 | } 46 | 47 | registerChangeInRfbEvents() { 48 | this.eventSubscriber = this.eventManager.subscribe( 49 | 'rfbEventListModification', 50 | (response) => this.load(this.rfbEvent.id) 51 | ); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/rfb-event/rfb-event.model.ts: -------------------------------------------------------------------------------- 1 | import {BaseEntity} from './../../shared'; 2 | import {RfbLocation} from '../rfb-location/rfb-location.model'; 3 | 4 | export class RfbEvent implements BaseEntity { 5 | constructor( 6 | public id?: number, 7 | public eventDate?: any, 8 | public eventCode?: string, 9 | public rfbLocationId?: number, 10 | public rfbLocationDTO?: RfbLocation, 11 | public rfbEventAttendances?: BaseEntity[], 12 | ) { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/rfb-event/rfb-event.module.ts: -------------------------------------------------------------------------------- 1 | import {CUSTOM_ELEMENTS_SCHEMA, NgModule} from '@angular/core'; 2 | import {RouterModule} from '@angular/router'; 3 | 4 | import {RfbloyaltySharedModule} from '../../shared'; 5 | import { 6 | RfbEventComponent, 7 | RfbEventDeleteDialogComponent, 8 | RfbEventDeletePopupComponent, 9 | RfbEventDetailComponent, 10 | RfbEventDialogComponent, 11 | RfbEventPopupComponent, 12 | rfbEventPopupRoute, 13 | RfbEventPopupService, 14 | RfbEventResolvePagingParams, 15 | rfbEventRoute, 16 | RfbEventService, 17 | } from './'; 18 | 19 | const ENTITY_STATES = [ 20 | ...rfbEventRoute, 21 | ...rfbEventPopupRoute, 22 | ]; 23 | 24 | @NgModule({ 25 | imports: [ 26 | RfbloyaltySharedModule, 27 | RouterModule.forRoot(ENTITY_STATES, { useHash: true }) 28 | ], 29 | declarations: [ 30 | RfbEventComponent, 31 | RfbEventDetailComponent, 32 | RfbEventDialogComponent, 33 | RfbEventDeleteDialogComponent, 34 | RfbEventPopupComponent, 35 | RfbEventDeletePopupComponent, 36 | ], 37 | entryComponents: [ 38 | RfbEventComponent, 39 | RfbEventDialogComponent, 40 | RfbEventPopupComponent, 41 | RfbEventDeleteDialogComponent, 42 | RfbEventDeletePopupComponent, 43 | ], 44 | providers: [ 45 | RfbEventService, 46 | RfbEventPopupService, 47 | RfbEventResolvePagingParams, 48 | ], 49 | schemas: [CUSTOM_ELEMENTS_SCHEMA] 50 | }) 51 | export class RfbloyaltyRfbEventModule {} 52 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/rfb-location/index.ts: -------------------------------------------------------------------------------- 1 | export * from './rfb-location.model'; 2 | export * from './rfb-location-popup.service'; 3 | export * from './rfb-location.service'; 4 | export * from './rfb-location-dialog.component'; 5 | export * from './rfb-location-delete-dialog.component'; 6 | export * from './rfb-location-detail.component'; 7 | export * from './rfb-location.component'; 8 | export * from './rfb-location.route'; 9 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/rfb-location/rfb-location-delete-dialog.component.html: -------------------------------------------------------------------------------- 1 |
2 | 7 | 11 | 19 |
20 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/rfb-location/rfb-location-detail.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

Rfb Location {{rfbLocation.id}}

4 |
5 | 6 |
7 |
Location Name
8 |
9 | {{rfbLocation.locationName}} 10 |
11 |
Run Day Of Week
12 |
13 | {{rfbLocation.runDayOfWeek}} 14 |
15 |
16 | 17 | 22 | 23 | 29 |
30 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/rfb-location/rfb-location-detail.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, OnDestroy, OnInit} from '@angular/core'; 2 | import {ActivatedRoute} from '@angular/router'; 3 | import {Subscription} from 'rxjs/Rx'; 4 | import {JhiEventManager} from 'ng-jhipster'; 5 | 6 | import {RfbLocation} from './rfb-location.model'; 7 | import {RfbLocationService} from './rfb-location.service'; 8 | 9 | @Component({ 10 | selector: 'jhi-rfb-location-detail', 11 | templateUrl: './rfb-location-detail.component.html' 12 | }) 13 | export class RfbLocationDetailComponent implements OnInit, OnDestroy { 14 | 15 | rfbLocation: RfbLocation; 16 | private subscription: Subscription; 17 | private eventSubscriber: Subscription; 18 | 19 | constructor( 20 | private eventManager: JhiEventManager, 21 | private rfbLocationService: RfbLocationService, 22 | private route: ActivatedRoute 23 | ) { 24 | } 25 | 26 | ngOnInit() { 27 | this.subscription = this.route.params.subscribe((params) => { 28 | this.load(params['id']); 29 | }); 30 | this.registerChangeInRfbLocations(); 31 | } 32 | 33 | load(id) { 34 | this.rfbLocationService.find(id).subscribe((rfbLocation) => { 35 | this.rfbLocation = rfbLocation; 36 | }); 37 | } 38 | previousState() { 39 | window.history.back(); 40 | } 41 | 42 | ngOnDestroy() { 43 | this.subscription.unsubscribe(); 44 | this.eventManager.destroy(this.eventSubscriber); 45 | } 46 | 47 | registerChangeInRfbLocations() { 48 | this.eventSubscriber = this.eventManager.subscribe( 49 | 'rfbLocationListModification', 50 | (response) => this.load(this.rfbLocation.id) 51 | ); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/rfb-location/rfb-location-dialog.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 8 | 27 | 35 |
36 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/rfb-location/rfb-location.model.ts: -------------------------------------------------------------------------------- 1 | import {BaseEntity} from './../../shared'; 2 | 3 | export class RfbLocation implements BaseEntity { 4 | constructor( 5 | public id?: number, 6 | public locationName?: string, 7 | public runDayOfWeek?: number, 8 | public rvbEvents?: BaseEntity[], 9 | ) { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/webapp/app/entities/rfb-location/rfb-location.module.ts: -------------------------------------------------------------------------------- 1 | import {CUSTOM_ELEMENTS_SCHEMA, NgModule} from '@angular/core'; 2 | import {RouterModule} from '@angular/router'; 3 | 4 | import {RfbloyaltySharedModule} from '../../shared'; 5 | import { 6 | RfbLocationComponent, 7 | RfbLocationDeleteDialogComponent, 8 | RfbLocationDeletePopupComponent, 9 | RfbLocationDetailComponent, 10 | RfbLocationDialogComponent, 11 | RfbLocationPopupComponent, 12 | rfbLocationPopupRoute, 13 | RfbLocationPopupService, 14 | RfbLocationResolvePagingParams, 15 | rfbLocationRoute, 16 | RfbLocationService, 17 | } from './'; 18 | 19 | const ENTITY_STATES = [ 20 | ...rfbLocationRoute, 21 | ...rfbLocationPopupRoute, 22 | ]; 23 | 24 | @NgModule({ 25 | imports: [ 26 | RfbloyaltySharedModule, 27 | RouterModule.forRoot(ENTITY_STATES, { useHash: true }) 28 | ], 29 | declarations: [ 30 | RfbLocationComponent, 31 | RfbLocationDetailComponent, 32 | RfbLocationDialogComponent, 33 | RfbLocationDeleteDialogComponent, 34 | RfbLocationPopupComponent, 35 | RfbLocationDeletePopupComponent, 36 | ], 37 | entryComponents: [ 38 | RfbLocationComponent, 39 | RfbLocationDialogComponent, 40 | RfbLocationPopupComponent, 41 | RfbLocationDeleteDialogComponent, 42 | RfbLocationDeletePopupComponent, 43 | ], 44 | providers: [ 45 | RfbLocationService, 46 | RfbLocationPopupService, 47 | RfbLocationResolvePagingParams, 48 | ], 49 | schemas: [CUSTOM_ELEMENTS_SCHEMA] 50 | }) 51 | export class RfbloyaltyRfbLocationModule {} 52 | -------------------------------------------------------------------------------- /src/main/webapp/app/home/home.css: -------------------------------------------------------------------------------- 1 | /* ========================================================================== 2 | Main page styles 3 | ========================================================================== */ 4 | 5 | #rfb-home-intro { 6 | background: url("../../content/images/beer-light.jpg"); 7 | background-size: contain; 8 | padding: 20px 0px 60px 0px; 9 | } 10 | 11 | .display-4 { 12 | font-family: 'Walter Turncoat', cursive; 13 | margin-top:10px; 14 | } 15 | 16 | .events-header { 17 | font-family: 'Walter Turncoat', cursive; 18 | font-size: 18px; 19 | color:#ffffff; 20 | text-align: center; 21 | margin-top:10px; 22 | } 23 | 24 | .img-border-white { 25 | border: solid #ffffff 5px; 26 | } 27 | 28 | /* wait autoprefixer update to allow simple generation of high pixel density media query */ 29 | @media 30 | only screen and (-webkit-min-device-pixel-ratio: 2), 31 | only screen and ( min--moz-device-pixel-ratio: 2), 32 | only screen and ( -o-min-device-pixel-ratio: 2/1), 33 | only screen and ( min-device-pixel-ratio: 2), 34 | only screen and ( min-resolution: 192dpi), 35 | only screen and ( min-resolution: 2dppx) { 36 | 37 | } 38 | 39 | -------------------------------------------------------------------------------- /src/main/webapp/app/home/home.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; 2 | import { RouterModule } from '@angular/router'; 3 | 4 | import { RfbloyaltySharedModule } from '../shared'; 5 | 6 | import { HOME_ROUTE, HomeComponent } from './'; 7 | 8 | @NgModule({ 9 | imports: [ 10 | RfbloyaltySharedModule, 11 | RouterModule.forRoot([ HOME_ROUTE ], { useHash: true }) 12 | ], 13 | declarations: [ 14 | HomeComponent, 15 | ], 16 | entryComponents: [ 17 | ], 18 | providers: [ 19 | ], 20 | schemas: [CUSTOM_ELEMENTS_SCHEMA] 21 | }) 22 | export class RfbloyaltyHomeModule {} 23 | -------------------------------------------------------------------------------- /src/main/webapp/app/home/home.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { UserRouteAccessService } from '../shared'; 4 | import { HomeComponent } from './'; 5 | 6 | export const HOME_ROUTE: Route = { 7 | path: '', 8 | component: HomeComponent, 9 | data: { 10 | authorities: [], 11 | pageTitle: 'Running for Brews Loyalty App' 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /src/main/webapp/app/home/index.ts: -------------------------------------------------------------------------------- 1 | export * from './home.component'; 2 | export * from './home.route'; 3 | export * from './home.module'; 4 | -------------------------------------------------------------------------------- /src/main/webapp/app/layouts/error/error.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 |

Error Page!

8 | 9 |
10 |
{{errorMessage}} 11 |
12 |
13 |
You are not authorized to access this page. 14 |
15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /src/main/webapp/app/layouts/error/error.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ActivatedRoute } from '@angular/router'; 3 | 4 | @Component({ 5 | selector: 'jhi-error', 6 | templateUrl: './error.component.html' 7 | }) 8 | export class ErrorComponent implements OnInit { 9 | errorMessage: string; 10 | error403: boolean; 11 | 12 | constructor( 13 | private route: ActivatedRoute 14 | ) { 15 | } 16 | 17 | ngOnInit() { 18 | this.route.data.subscribe((routeData) => { 19 | if (routeData.error403) { 20 | this.error403 = routeData.error403; 21 | } 22 | if (routeData.errorMessage) { 23 | this.errorMessage = routeData.errorMessage; 24 | } 25 | }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/webapp/app/layouts/error/error.route.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | 3 | import { UserRouteAccessService } from '../../shared'; 4 | import { ErrorComponent } from './error.component'; 5 | 6 | export const errorRoute: Routes = [ 7 | { 8 | path: 'error', 9 | component: ErrorComponent, 10 | data: { 11 | authorities: [], 12 | pageTitle: 'Error page!' 13 | }, 14 | }, 15 | { 16 | path: 'accessdenied', 17 | component: ErrorComponent, 18 | data: { 19 | authorities: [], 20 | pageTitle: 'Error page!', 21 | error403: true 22 | }, 23 | } 24 | ]; 25 | -------------------------------------------------------------------------------- /src/main/webapp/app/layouts/footer/footer.component.html: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /src/main/webapp/app/layouts/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'jhi-footer', 5 | templateUrl: './footer.component.html' 6 | }) 7 | export class FooterComponent { 8 | currentYear: number; 9 | 10 | constructor() { 11 | this.currentYear = new Date().getFullYear(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/webapp/app/layouts/index.ts: -------------------------------------------------------------------------------- 1 | export * from './error/error.component'; 2 | export * from './error/error.route'; 3 | export * from './main/main.component'; 4 | export * from './footer/footer.component'; 5 | export * from './navbar/navbar.component'; 6 | export * from './profiles/page-ribbon.component'; 7 | export * from './profiles/profile.service'; 8 | export * from './profiles/profile-info.model'; 9 | export * from './layout-routing.module'; 10 | -------------------------------------------------------------------------------- /src/main/webapp/app/layouts/layout-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule } from '@angular/router'; 3 | 4 | import { navbarRoute } from '../app.route'; 5 | import { errorRoute } from './'; 6 | 7 | const LAYOUT_ROUTES = [ 8 | navbarRoute, 9 | ...errorRoute 10 | ]; 11 | 12 | @NgModule({ 13 | imports: [ 14 | RouterModule.forRoot(LAYOUT_ROUTES, { useHash: true }) 15 | ], 16 | exports: [ 17 | RouterModule 18 | ] 19 | }) 20 | export class LayoutRoutingModule {} 21 | -------------------------------------------------------------------------------- /src/main/webapp/app/layouts/main/main.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 |
6 | 7 |
8 | 9 | 10 |
11 | 12 |
13 | -------------------------------------------------------------------------------- /src/main/webapp/app/layouts/main/main.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Router, ActivatedRouteSnapshot, NavigationEnd } from '@angular/router'; 3 | 4 | import { Title } from '@angular/platform-browser'; 5 | 6 | @Component({ 7 | selector: 'jhi-main', 8 | templateUrl: './main.component.html' 9 | }) 10 | export class JhiMainComponent implements OnInit { 11 | public cardStyles: string; 12 | public currentRoute: string; 13 | 14 | constructor(private titleService: Title, private router: Router) {} 15 | 16 | private getPageTitle(routeSnapshot: ActivatedRouteSnapshot) { 17 | let title: string = (routeSnapshot.data && routeSnapshot.data['pageTitle']) ? routeSnapshot.data['pageTitle'] : 'rfbloyaltyApp'; 18 | if (routeSnapshot.firstChild) { 19 | title = this.getPageTitle(routeSnapshot.firstChild) || title; 20 | } 21 | this.currentRoute = this.router.url; 22 | return title; 23 | } 24 | 25 | ngOnInit() { 26 | this.router.events.subscribe((event) => { 27 | if (event instanceof NavigationEnd) { 28 | this.titleService.setTitle(this.getPageTitle(this.router.routerState.snapshot.root)); 29 | } 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/webapp/app/layouts/profiles/page-ribbon.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ProfileService } from './profile.service'; 3 | import { ProfileInfo } from './profile-info.model'; 4 | 5 | @Component({ 6 | selector: 'jhi-page-ribbon', 7 | template: ``, 8 | styleUrls: [ 9 | 'page-ribbon.css' 10 | ] 11 | }) 12 | export class PageRibbonComponent implements OnInit { 13 | 14 | profileInfo: ProfileInfo; 15 | ribbonEnv: string; 16 | 17 | constructor(private profileService: ProfileService) {} 18 | 19 | ngOnInit() { 20 | this.profileService.getProfileInfo().subscribe((profileInfo) => { 21 | this.profileInfo = profileInfo; 22 | this.ribbonEnv = profileInfo.ribbonEnv; 23 | }); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/webapp/app/layouts/profiles/page-ribbon.css: -------------------------------------------------------------------------------- 1 | /* ========================================================================== 2 | Developement Ribbon 3 | ========================================================================== */ 4 | .ribbon { 5 | background-color: rgba(170, 0, 0, 0.5); 6 | left: -3.5em; 7 | moz-transform: rotate(-45deg); 8 | ms-transform: rotate(-45deg); 9 | o-transform: rotate(-45deg); 10 | webkit-transform: rotate(-45deg); 11 | transform: rotate(-45deg); 12 | overflow: hidden; 13 | position: absolute; 14 | top: 40px; 15 | white-space: nowrap; 16 | width: 15em; 17 | z-index: 9999; 18 | pointer-events: none; 19 | opacity: 0.75; 20 | } 21 | 22 | .ribbon a { 23 | color: #fff; 24 | display: block; 25 | font-weight: 400; 26 | margin: 1px 0; 27 | padding: 10px 50px; 28 | text-align: center; 29 | text-decoration: none; 30 | text-shadow: 0 0 5px #444; 31 | pointer-events: none; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/webapp/app/layouts/profiles/profile-info.model.ts: -------------------------------------------------------------------------------- 1 | export class ProfileInfo { 2 | activeProfiles: string[]; 3 | ribbonEnv: string; 4 | inProduction: boolean; 5 | swaggerEnabled: boolean; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/webapp/app/layouts/profiles/profile.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http, Response } from '@angular/http'; 3 | import { Observable } from 'rxjs/Rx'; 4 | 5 | import { SERVER_API_URL } from '../../app.constants'; 6 | import { ProfileInfo } from './profile-info.model'; 7 | 8 | @Injectable() 9 | export class ProfileService { 10 | 11 | private profileInfoUrl = SERVER_API_URL + 'api/profile-info'; 12 | 13 | constructor(private http: Http) { } 14 | 15 | getProfileInfo(): Observable { 16 | return this.http.get(this.profileInfoUrl) 17 | .map((res: Response) => { 18 | const data = res.json(); 19 | const pi = new ProfileInfo(); 20 | pi.activeProfiles = data.activeProfiles; 21 | pi.ribbonEnv = data.ribbonEnv; 22 | pi.inProduction = data.activeProfiles.indexOf('prod') !== -1; 23 | pi.swaggerEnabled = data.activeProfiles.indexOf('swagger') !== -1; 24 | return pi; 25 | }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/webapp/app/polyfills.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | import 'reflect-metadata/Reflect'; 3 | import 'zone.js/dist/zone'; 4 | 5 | require('../manifest.webapp'); 6 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/alert/alert.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnDestroy, OnInit } from '@angular/core'; 2 | import { JhiAlertService } from 'ng-jhipster'; 3 | 4 | @Component({ 5 | selector: 'jhi-alert', 6 | template: ` 7 | ` 14 | }) 15 | export class JhiAlertComponent implements OnInit, OnDestroy { 16 | alerts: any[]; 17 | 18 | constructor(private alertService: JhiAlertService) { } 19 | 20 | ngOnInit() { 21 | this.alerts = this.alertService.get(); 22 | } 23 | 24 | ngOnDestroy() { 25 | this.alerts = []; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/auth/account.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http, Response } from '@angular/http'; 3 | import { Observable } from 'rxjs/Rx'; 4 | import { SERVER_API_URL } from '../../app.constants'; 5 | 6 | @Injectable() 7 | export class AccountService { 8 | constructor(private http: Http) { } 9 | 10 | get(): Observable { 11 | return this.http.get(SERVER_API_URL + 'api/account').map((res: Response) => res.json()); 12 | } 13 | 14 | save(account: any): Observable { 15 | return this.http.post(SERVER_API_URL + 'api/account', account); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/auth/auth-session.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http, Response, Headers } from '@angular/http'; 3 | import { Observable } from 'rxjs/Rx'; 4 | import { SERVER_API_URL } from '../../app.constants'; 5 | 6 | @Injectable() 7 | export class AuthServerProvider { 8 | 9 | constructor( 10 | private http: Http 11 | ) {} 12 | 13 | login(credentials): Observable { 14 | const data = 'j_username=' + encodeURIComponent(credentials.username) + 15 | '&j_password=' + encodeURIComponent(credentials.password) + 16 | '&remember-me=' + credentials.rememberMe + '&submit=Login'; 17 | const headers = new Headers ({ 18 | 'Content-Type': 'application/x-www-form-urlencoded' 19 | }); 20 | 21 | return this.http.post(SERVER_API_URL + 'api/authentication', data, { headers }); 22 | } 23 | 24 | logout(): Observable { 25 | // logout from the server 26 | return this.http.post(SERVER_API_URL + 'api/logout', {}).map((response: Response) => { 27 | // to get a new csrf token call the api 28 | this.http.get(SERVER_API_URL + 'api/account').subscribe(() => {}, () => {}); 29 | return response; 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/auth/csrf.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { CookieService } from 'ngx-cookie'; 3 | 4 | @Injectable() 5 | export class CSRFService { 6 | 7 | constructor(private cookieService: CookieService) {} 8 | 9 | getCSRF(name?: string) { 10 | name = `${name ? name : 'XSRF-TOKEN'}`; 11 | return this.cookieService.get(name); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/auth/has-any-authority.directive.ts: -------------------------------------------------------------------------------- 1 | import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core'; 2 | import { Principal } from './principal.service'; 3 | 4 | /** 5 | * @whatItDoes Conditionally includes an HTML element if current user has any 6 | * of the authorities passed as the `expression`. 7 | * 8 | * @howToUse 9 | * ``` 10 | * ... 11 | * 12 | * ... 13 | * ``` 14 | */ 15 | @Directive({ 16 | selector: '[jhiHasAnyAuthority]' 17 | }) 18 | export class HasAnyAuthorityDirective { 19 | 20 | private authorities: string[]; 21 | 22 | constructor(private principal: Principal, private templateRef: TemplateRef, private viewContainerRef: ViewContainerRef) { 23 | } 24 | 25 | @Input() 26 | set jhiHasAnyAuthority(value: string|string[]) { 27 | this.authorities = typeof value === 'string' ? [ value ] : value; 28 | this.updateView(); 29 | // Get notified each time authentication state changes. 30 | this.principal.getAuthenticationState().subscribe((identity) => this.updateView()); 31 | } 32 | 33 | private updateView(): void { 34 | this.principal.hasAnyAuthority(this.authorities).then((result) => { 35 | this.viewContainerRef.clear(); 36 | if (result) { 37 | this.viewContainerRef.createEmbeddedView(this.templateRef); 38 | } 39 | }); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/auth/state-storage.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { SessionStorageService } from 'ng2-webstorage'; 3 | 4 | @Injectable() 5 | export class StateStorageService { 6 | constructor( 7 | private $sessionStorage: SessionStorageService 8 | ) {} 9 | 10 | getPreviousState() { 11 | return this.$sessionStorage.retrieve('previousState'); 12 | } 13 | 14 | resetPreviousState() { 15 | this.$sessionStorage.clear('previousState'); 16 | } 17 | 18 | storePreviousState(previousStateName, previousStateParams) { 19 | const previousState = { 'name': previousStateName, 'params': previousStateParams }; 20 | this.$sessionStorage.store('previousState', previousState); 21 | } 22 | 23 | getDestinationState() { 24 | return this.$sessionStorage.retrieve('destinationState'); 25 | } 26 | 27 | storeUrl(url: string) { 28 | this.$sessionStorage.store('previousUrl', url); 29 | } 30 | 31 | getUrl() { 32 | return this.$sessionStorage.retrieve('previousUrl'); 33 | } 34 | 35 | storeDestinationState(destinationState, destinationStateParams, fromState) { 36 | const destinationInfo = { 37 | 'destination': { 38 | 'name': destinationState.name, 39 | 'data': destinationState.data, 40 | }, 41 | 'params': destinationStateParams, 42 | 'from': { 43 | 'name': fromState.name, 44 | } 45 | }; 46 | this.$sessionStorage.store('destinationState', destinationInfo); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/constants/pagination.constants.ts: -------------------------------------------------------------------------------- 1 | export const ITEMS_PER_PAGE = 20; 2 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/index.ts: -------------------------------------------------------------------------------- 1 | export * from './constants/pagination.constants'; 2 | export * from './alert/alert.component'; 3 | export * from './alert/alert-error.component'; 4 | export * from './auth/csrf.service'; 5 | export * from './auth/state-storage.service'; 6 | export * from './auth/account.service'; 7 | export * from './auth/auth-session.service'; 8 | export * from './auth/principal.service'; 9 | export * from './auth/has-any-authority.directive'; 10 | export * from './auth/user-route-access-service'; 11 | export * from './login/login.component'; 12 | export * from './login/login.service'; 13 | export * from './login/login-modal.service'; 14 | export * from './user/account.model'; 15 | export * from './user/user.model'; 16 | export * from './user/user.service'; 17 | export * from './model/response-wrapper.model'; 18 | export * from './model/request-util'; 19 | export * from './model/base-entity'; 20 | export * from './social/social.service'; 21 | export * from './social/social.component'; 22 | export * from './shared-libs.module'; 23 | export * from './shared-common.module'; 24 | export * from './shared.module'; 25 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/login/login-modal.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; 3 | 4 | import { JhiLoginModalComponent } from './login.component'; 5 | 6 | @Injectable() 7 | export class LoginModalService { 8 | private isOpen = false; 9 | constructor( 10 | private modalService: NgbModal, 11 | ) {} 12 | 13 | open(): NgbModalRef { 14 | if (this.isOpen) { 15 | return; 16 | } 17 | this.isOpen = true; 18 | const modalRef = this.modalService.open(JhiLoginModalComponent, { 19 | container: 'nav' 20 | }); 21 | modalRef.result.then((result) => { 22 | this.isOpen = false; 23 | }, (reason) => { 24 | this.isOpen = false; 25 | }); 26 | return modalRef; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/login/login.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | import { Principal } from '../auth/principal.service'; 4 | import { AuthServerProvider } from '../auth/auth-session.service'; 5 | 6 | @Injectable() 7 | export class LoginService { 8 | 9 | constructor( 10 | private principal: Principal, 11 | private authServerProvider: AuthServerProvider 12 | ) {} 13 | 14 | login(credentials, callback?) { 15 | const cb = callback || function() {}; 16 | 17 | return new Promise((resolve, reject) => { 18 | this.authServerProvider.login(credentials).subscribe((data) => { 19 | this.principal.identity(true).then((account) => { 20 | resolve(data); 21 | }); 22 | return cb(); 23 | }, (err) => { 24 | this.logout(); 25 | reject(err); 26 | return cb(err); 27 | }); 28 | }); 29 | } 30 | 31 | logout() { 32 | this.authServerProvider.logout().subscribe(); 33 | this.principal.authenticate(null); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/model/base-entity.ts: -------------------------------------------------------------------------------- 1 | export interface BaseEntity { 2 | // using type any to avoid methods complaining of invalid type 3 | id?: any; 4 | }; 5 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/model/request-util.ts: -------------------------------------------------------------------------------- 1 | import { URLSearchParams, BaseRequestOptions } from '@angular/http'; 2 | 3 | export const createRequestOption = (req?: any): BaseRequestOptions => { 4 | const options: BaseRequestOptions = new BaseRequestOptions(); 5 | if (req) { 6 | const params: URLSearchParams = new URLSearchParams(); 7 | params.set('page', req.page); 8 | params.set('size', req.size); 9 | if (req.sort) { 10 | params.paramsMap.set('sort', req.sort); 11 | } 12 | params.set('query', req.query); 13 | 14 | options.params = params; 15 | } 16 | return options; 17 | }; 18 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/model/response-wrapper.model.ts: -------------------------------------------------------------------------------- 1 | import { Headers } from '@angular/http'; 2 | 3 | export class ResponseWrapper { 4 | constructor( 5 | public headers: Headers, 6 | public json: any, 7 | public status: number 8 | ) { } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/shared-common.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, LOCALE_ID } from '@angular/core'; 2 | import { Title } from '@angular/platform-browser'; 3 | 4 | import { 5 | RfbloyaltySharedLibsModule, 6 | JhiAlertComponent, 7 | JhiAlertErrorComponent 8 | } from './'; 9 | 10 | @NgModule({ 11 | imports: [ 12 | RfbloyaltySharedLibsModule 13 | ], 14 | declarations: [ 15 | JhiAlertComponent, 16 | JhiAlertErrorComponent 17 | ], 18 | providers: [ 19 | Title, 20 | { 21 | provide: LOCALE_ID, 22 | useValue: 'en' 23 | }, 24 | ], 25 | exports: [ 26 | RfbloyaltySharedLibsModule, 27 | JhiAlertComponent, 28 | JhiAlertErrorComponent 29 | ] 30 | }) 31 | export class RfbloyaltySharedCommonModule {} 32 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/shared-libs.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { FormsModule } from '@angular/forms'; 3 | import { HttpModule } from '@angular/http'; 4 | import { CommonModule } from '@angular/common'; 5 | import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; 6 | import { NgJhipsterModule } from 'ng-jhipster'; 7 | import { InfiniteScrollModule } from 'ngx-infinite-scroll'; 8 | import { CookieModule } from 'ngx-cookie'; 9 | 10 | @NgModule({ 11 | imports: [ 12 | NgbModule.forRoot(), 13 | NgJhipsterModule.forRoot({ 14 | // set below to true to make alerts look like toast 15 | alertAsToast: false, 16 | }), 17 | InfiniteScrollModule, 18 | CookieModule.forRoot() 19 | ], 20 | exports: [ 21 | FormsModule, 22 | HttpModule, 23 | CommonModule, 24 | NgbModule, 25 | NgJhipsterModule, 26 | InfiniteScrollModule 27 | ] 28 | }) 29 | export class RfbloyaltySharedLibsModule {} 30 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/shared.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; 2 | import { DatePipe } from '@angular/common'; 3 | 4 | import { 5 | RfbloyaltySharedLibsModule, 6 | RfbloyaltySharedCommonModule, 7 | CSRFService, 8 | AuthServerProvider, 9 | AccountService, 10 | UserService, 11 | StateStorageService, 12 | LoginService, 13 | LoginModalService, 14 | Principal, 15 | HasAnyAuthorityDirective, 16 | JhiSocialComponent, 17 | SocialService, 18 | JhiLoginModalComponent 19 | } from './'; 20 | 21 | @NgModule({ 22 | imports: [ 23 | RfbloyaltySharedLibsModule, 24 | RfbloyaltySharedCommonModule 25 | ], 26 | declarations: [ 27 | JhiSocialComponent, 28 | JhiLoginModalComponent, 29 | HasAnyAuthorityDirective 30 | ], 31 | providers: [ 32 | LoginService, 33 | LoginModalService, 34 | AccountService, 35 | StateStorageService, 36 | Principal, 37 | CSRFService, 38 | AuthServerProvider, 39 | SocialService, 40 | UserService, 41 | DatePipe 42 | ], 43 | entryComponents: [JhiLoginModalComponent], 44 | exports: [ 45 | RfbloyaltySharedCommonModule, 46 | JhiSocialComponent, 47 | JhiLoginModalComponent, 48 | HasAnyAuthorityDirective, 49 | DatePipe 50 | ], 51 | schemas: [CUSTOM_ELEMENTS_SCHEMA] 52 | 53 | }) 54 | export class RfbloyaltySharedModule {} 55 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/social/social.component.html: -------------------------------------------------------------------------------- 1 |
2 | 5 | 6 | 7 |
8 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/social/social.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, OnInit } from '@angular/core'; 2 | import { SocialService } from './social.service'; 3 | import { CSRFService } from '../auth/csrf.service'; 4 | 5 | @Component({ 6 | selector: 'jhi-social', 7 | templateUrl: './social.component.html' 8 | }) 9 | export class JhiSocialComponent implements OnInit { 10 | @Input() provider: string; 11 | label: string; 12 | providerSetting: string; 13 | providerURL: string; 14 | csrf: string; 15 | 16 | constructor( 17 | private csrfService: CSRFService, 18 | private socialService: SocialService 19 | ) {} 20 | 21 | ngOnInit() { 22 | this.label = this.provider.charAt(0).toUpperCase() + this.provider.slice(1); 23 | this.providerSetting = this.socialService.getProviderSetting(this.provider); 24 | this.providerURL = this.socialService.getProviderURL(this.provider); 25 | this.csrf = this.csrfService.getCSRF(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/social/social.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable() 4 | export class SocialService { 5 | 6 | constructor() {} 7 | 8 | getProviderSetting(provider) { 9 | switch (provider) { 10 | case 'google': return 'https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email'; 11 | case 'facebook': return 'public_profile,email'; 12 | case 'twitter': return ''; 13 | // jhipster-needle-add-social-button 14 | default: return 'Provider setting not defined'; 15 | } 16 | } 17 | 18 | getProviderURL(provider) { 19 | return 'signin/' + provider; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/user/account.model.ts: -------------------------------------------------------------------------------- 1 | export class Account { 2 | constructor( 3 | public activated: boolean, 4 | public authorities: string[], 5 | public email: string, 6 | public firstName: string, 7 | public langKey: string, 8 | public lastName: string, 9 | public login: string, 10 | public imageUrl: string, 11 | public homeLocation: number 12 | ) { } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/webapp/app/shared/user/user.model.ts: -------------------------------------------------------------------------------- 1 | export class User { 2 | public id?: any; 3 | public login?: string; 4 | public firstName?: string; 5 | public lastName?: string; 6 | public email?: string; 7 | public activated?: Boolean; 8 | public langKey?: string; 9 | public authorities?: any[]; 10 | public createdBy?: string; 11 | public createdDate?: Date; 12 | public lastModifiedBy?: string; 13 | public lastModifiedDate?: Date; 14 | public password?: string; 15 | public homeLocation?: number; 16 | 17 | constructor( 18 | id?: any, 19 | login?: string, 20 | firstName?: string, 21 | lastName?: string, 22 | email?: string, 23 | activated?: Boolean, 24 | langKey?: string, 25 | authorities?: any[], 26 | createdBy?: string, 27 | createdDate?: Date, 28 | lastModifiedBy?: string, 29 | lastModifiedDate?: Date, 30 | password?: string, 31 | homeLocation?: number 32 | ) { 33 | this.id = id ? id : null; 34 | this.login = login ? login : null; 35 | this.firstName = firstName ? firstName : null; 36 | this.lastName = lastName ? lastName : null; 37 | this.email = email ? email : null; 38 | this.activated = activated ? activated : false; 39 | this.langKey = langKey ? langKey : null; 40 | this.authorities = authorities ? authorities : null; 41 | this.createdBy = createdBy ? createdBy : null; 42 | this.createdDate = createdDate ? createdDate : null; 43 | this.lastModifiedBy = lastModifiedBy ? lastModifiedBy : null; 44 | this.lastModifiedDate = lastModifiedDate ? lastModifiedDate : null; 45 | this.password = password ? password : null; 46 | this.homeLocation = homeLocation ? homeLocation : null; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/webapp/app/vendor.ts: -------------------------------------------------------------------------------- 1 | /* after changing this file run 'yarn run webpack:build' */ 2 | /* tslint:disable */ 3 | import '../content/css/vendor.css'; 4 | // jhipster-needle-add-element-to-vendor - JHipster will add new menu items here 5 | -------------------------------------------------------------------------------- /src/main/webapp/content/css/documentation.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Your CSS files will be generated in this directory by "gulp sass" 3 | */ 4 | -------------------------------------------------------------------------------- /src/main/webapp/content/css/vendor.css: -------------------------------------------------------------------------------- 1 | /* after changing this file run 'yarn run webpack:build' */ 2 | @import '~bootstrap/dist/css/bootstrap.min.css'; 3 | @import '~font-awesome/css/font-awesome.css'; 4 | 5 | -------------------------------------------------------------------------------- /src/main/webapp/content/images/beer-light.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Angular4JavaDevelopers/rfb-loyalty/84478d7675a6601bdcd83e3fcc636c12dc73c7b8/src/main/webapp/content/images/beer-light.jpg -------------------------------------------------------------------------------- /src/main/webapp/content/images/hipster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Angular4JavaDevelopers/rfb-loyalty/84478d7675a6601bdcd83e3fcc636c12dc73c7b8/src/main/webapp/content/images/hipster.png -------------------------------------------------------------------------------- /src/main/webapp/content/images/hipster2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Angular4JavaDevelopers/rfb-loyalty/84478d7675a6601bdcd83e3fcc636c12dc73c7b8/src/main/webapp/content/images/hipster2x.png -------------------------------------------------------------------------------- /src/main/webapp/content/images/kevincover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Angular4JavaDevelopers/rfb-loyalty/84478d7675a6601bdcd83e3fcc636c12dc73c7b8/src/main/webapp/content/images/kevincover.jpg -------------------------------------------------------------------------------- /src/main/webapp/content/images/logo-jhipster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Angular4JavaDevelopers/rfb-loyalty/84478d7675a6601bdcd83e3fcc636c12dc73c7b8/src/main/webapp/content/images/logo-jhipster.png -------------------------------------------------------------------------------- /src/main/webapp/content/images/rfb_logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Angular4JavaDevelopers/rfb-loyalty/84478d7675a6601bdcd83e3fcc636c12dc73c7b8/src/main/webapp/content/images/rfb_logo_small.png -------------------------------------------------------------------------------- /src/main/webapp/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Angular4JavaDevelopers/rfb-loyalty/84478d7675a6601bdcd83e3fcc636c12dc73c7b8/src/main/webapp/favicon.ico -------------------------------------------------------------------------------- /src/main/webapp/manifest.webapp: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Rfbloyalty", 3 | "short_name": "Rfbloyalty", 4 | "icons": [ 5 | { 6 | "src": "./content/images/logo-jhipster.png", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | }, 10 | { 11 | "src": "./content/images/logo-jhipster.png", 12 | "sizes": "256x256", 13 | "type": "image/png" 14 | }, 15 | { 16 | "src": "./content/images/logo-jhipster.png", 17 | "sizes": "384x384", 18 | "type": "image/png" 19 | }, 20 | { 21 | "src": "./content/images/logo-jhipster.png", 22 | "sizes": "512x512", 23 | "type": "image/png" 24 | } 25 | ], 26 | "theme_color": "#000000", 27 | "background_color": "#e0e0e0", 28 | "start_url": "/index.html", 29 | "display": "standalone", 30 | "orientation": "portrait" 31 | } 32 | -------------------------------------------------------------------------------- /src/main/webapp/robots.txt: -------------------------------------------------------------------------------- 1 | # robotstxt.org/ 2 | 3 | User-agent: * 4 | Disallow: /api/account 5 | Disallow: /api/account/change-password 6 | Disallow: /api/account/sessions 7 | Disallow: /api/audits/ 8 | Disallow: /api/logs/ 9 | Disallow: /api/users/ 10 | Disallow: /management/ 11 | Disallow: /v2/api-docs/ 12 | -------------------------------------------------------------------------------- /src/main/webapp/sw.js: -------------------------------------------------------------------------------- 1 | var dataCacheName = 'Rfbloyalty-v1'; 2 | var cacheName = 'Rfbloyalty-1'; 3 | var filesToCache = [ 4 | '/', 5 | '/index.html' 6 | ]; 7 | 8 | self.addEventListener('install', function(e) { 9 | console.log('[ServiceWorker] Install'); 10 | e.waitUntil( 11 | caches.open(cacheName).then(function(cache) { 12 | console.log('[ServiceWorker] Caching app shell'); 13 | return cache.addAll(filesToCache); 14 | }) 15 | ); 16 | }); 17 | 18 | self.addEventListener('activate', function(e) { 19 | console.log('[ServiceWorker] Activate'); 20 | e.waitUntil( 21 | caches.keys().then(function(keyList) { 22 | return Promise.all(keyList.map(function(key) { 23 | if (key !== cacheName && key !== dataCacheName) { 24 | console.log('[ServiceWorker] Removing old cache', key); 25 | return caches.delete(key); 26 | } 27 | })); 28 | }) 29 | ); 30 | return self.clients.claim(); 31 | }); 32 | 33 | self.addEventListener('fetch', function(e) { 34 | console.log('[Service Worker] Fetch', e.request.url); 35 | e.respondWith( 36 | caches.match(e.request).then(function(response) { 37 | return response || fetch(e.request); 38 | }) 39 | ); 40 | }); 41 | -------------------------------------------------------------------------------- /src/main/webapp/swagger-ui/dist/images/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Angular4JavaDevelopers/rfb-loyalty/84478d7675a6601bdcd83e3fcc636c12dc73c7b8/src/main/webapp/swagger-ui/dist/images/throbber.gif -------------------------------------------------------------------------------- /src/test/java/com/rfb/config/WebConfigurerTestController.java: -------------------------------------------------------------------------------- 1 | package com.rfb.config; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class WebConfigurerTestController { 8 | 9 | @GetMapping("/api/test-cors") 10 | public void testCorsOnApiPath() { 11 | } 12 | 13 | @GetMapping("/test/test-cors") 14 | public void testCorsOnOtherPath() { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/test/java/com/rfb/repository/AbstractRepositoryTest.java: -------------------------------------------------------------------------------- 1 | package com.rfb.repository; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.security.crypto.password.PasswordEncoder; 5 | 6 | /** 7 | * Created by jt on 10/21/17. 8 | */ 9 | abstract class AbstractRepositoryTest { 10 | @Autowired 11 | RfbLocationRepository rfbLocationRepository; 12 | 13 | @Autowired 14 | RfbEventRepository rfbEventRepository; 15 | 16 | @Autowired 17 | RfbEventAttendanceRepository rfbEventAttendanceRepository; 18 | 19 | @Autowired 20 | UserRepository userRepository; 21 | 22 | @Autowired 23 | PasswordEncoder passwordEncoder; 24 | 25 | @Autowired 26 | AuthorityRepository authorityRepository; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/java/com/rfb/repository/RfbEventRepositoryTest.java: -------------------------------------------------------------------------------- 1 | package com.rfb.repository; 2 | 3 | import com.rfb.RfbloyaltyApp; 4 | import com.rfb.bootstrap.RfbBootstrap; 5 | import com.rfb.domain.RfbEvent; 6 | import com.rfb.domain.RfbLocation; 7 | import org.junit.Before; 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | import org.springframework.boot.test.context.SpringBootTest; 11 | import org.springframework.test.context.junit4.SpringRunner; 12 | 13 | import java.time.LocalDate; 14 | 15 | import static org.junit.Assert.assertNotNull; 16 | 17 | @RunWith(SpringRunner.class) 18 | @SpringBootTest(classes = {RfbloyaltyApp.class}) 19 | public class RfbEventRepositoryTest extends AbstractRepositoryTest { 20 | @Before 21 | public void setUp() throws Exception { 22 | RfbBootstrap rfbBootstrap = new RfbBootstrap(rfbLocationRepository, rfbEventRepository, 23 | rfbEventAttendanceRepository, userRepository, passwordEncoder, authorityRepository); 24 | } 25 | 26 | @Test 27 | public void findAllByRfbLocationAndEventDate() throws Exception { 28 | RfbLocation aleAndTheWitch = rfbLocationRepository.findByLocationName("St Pete - Ale and the Witch"); 29 | 30 | assertNotNull(aleAndTheWitch); 31 | 32 | RfbEvent event = rfbEventRepository.findByRfbLocationAndEventDate(aleAndTheWitch, LocalDate.now()); 33 | 34 | assertNotNull(event); 35 | 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/com/rfb/repository/RfbLocationRepositoryTest.java: -------------------------------------------------------------------------------- 1 | package com.rfb.repository; 2 | 3 | import com.rfb.RfbloyaltyApp; 4 | import com.rfb.bootstrap.RfbBootstrap; 5 | import com.rfb.domain.RfbLocation; 6 | import org.junit.Before; 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | import org.springframework.boot.test.context.SpringBootTest; 10 | import org.springframework.test.context.junit4.SpringRunner; 11 | 12 | import java.time.DayOfWeek; 13 | import java.util.List; 14 | 15 | import static org.junit.Assert.assertEquals; 16 | 17 | @RunWith(SpringRunner.class) 18 | @SpringBootTest(classes = {RfbloyaltyApp.class}) 19 | public class RfbLocationRepositoryTest extends AbstractRepositoryTest{ 20 | 21 | @Before 22 | public void setUp() throws Exception { 23 | RfbBootstrap rfbBootstrap = new RfbBootstrap(rfbLocationRepository, rfbEventRepository, 24 | rfbEventAttendanceRepository, userRepository, passwordEncoder, authorityRepository); 25 | } 26 | 27 | @Test 28 | public void findAllByRunDayOfWeek() throws Exception { 29 | List mondayLocations = rfbLocationRepository.findAllByRunDayOfWeek(DayOfWeek.MONDAY.getValue()); 30 | List tuesDayLocations = rfbLocationRepository.findAllByRunDayOfWeek(DayOfWeek.TUESDAY.getValue()); 31 | List wedLocations = rfbLocationRepository.findAllByRunDayOfWeek(DayOfWeek.WEDNESDAY.getValue()); 32 | 33 | assertEquals(2, mondayLocations.size()); 34 | assertEquals(2, tuesDayLocations.size()); 35 | assertEquals(1, wedLocations.size()); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/test/javascript/spec/entry.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import 'core-js'; 3 | import 'zone.js/dist/zone'; 4 | import 'zone.js/dist/long-stack-trace-zone'; 5 | import 'zone.js/dist/async-test'; 6 | import 'zone.js/dist/fake-async-test'; 7 | import 'zone.js/dist/sync-test'; 8 | import 'zone.js/dist/proxy'; 9 | import 'zone.js/dist/jasmine-patch'; 10 | import 'rxjs'; 11 | import 'intl/locale-data/jsonp/en-US.js'; 12 | import { TestBed } from '@angular/core/testing'; 13 | import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; 14 | 15 | TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting()); 16 | 17 | declare let require: any; 18 | const testsContext: any = require.context('./', true, /\.spec/); 19 | testsContext.keys().forEach(testsContext); 20 | -------------------------------------------------------------------------------- /src/test/javascript/spec/helpers/mock-account.service.ts: -------------------------------------------------------------------------------- 1 | import { SpyObject } from './spyobject'; 2 | import { AccountService } from '../../../../main/webapp/app/shared/auth/account.service'; 3 | import Spy = jasmine.Spy; 4 | 5 | export class MockAccountService extends SpyObject { 6 | 7 | getSpy: Spy; 8 | saveSpy: Spy; 9 | fakeResponse: any; 10 | 11 | constructor() { 12 | super(AccountService); 13 | 14 | this.fakeResponse = null; 15 | this.getSpy = this.spy('get').andReturn(this); 16 | this.saveSpy = this.spy('save').andReturn(this); 17 | } 18 | 19 | subscribe(callback: any) { 20 | callback(this.fakeResponse); 21 | } 22 | 23 | setResponse(json: any): void { 24 | this.fakeResponse = json; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/test/javascript/spec/helpers/mock-principal.service.ts: -------------------------------------------------------------------------------- 1 | import { SpyObject } from './spyobject'; 2 | import { Principal } from '../../../../main/webapp/app/shared/auth/principal.service'; 3 | import Spy = jasmine.Spy; 4 | 5 | export class MockPrincipal extends SpyObject { 6 | 7 | identitySpy: Spy; 8 | fakeResponse: any; 9 | 10 | constructor() { 11 | super(Principal); 12 | 13 | this.fakeResponse = {}; 14 | this.identitySpy = this.spy('identity').andReturn(Promise.resolve(this.fakeResponse)); 15 | } 16 | 17 | setResponse(json: any): void { 18 | this.fakeResponse = json; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/javascript/spec/helpers/mock-route.service.ts: -------------------------------------------------------------------------------- 1 | import { ActivatedRoute } from '@angular/router'; 2 | import { Observable } from 'rxjs'; 3 | 4 | export class MockActivatedRoute extends ActivatedRoute { 5 | 6 | constructor(parameters?: any) { 7 | super(); 8 | this.queryParams = Observable.of(parameters); 9 | this.params = Observable.of(parameters); 10 | } 11 | } 12 | 13 | export class MockRouter { 14 | navigate = jasmine.createSpy('navigate'); 15 | } 16 | -------------------------------------------------------------------------------- /src/test/javascript/spec/test.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { MockBackend } from '@angular/http/testing'; 3 | import { Http, BaseRequestOptions } from '@angular/http'; 4 | 5 | @NgModule({ 6 | providers: [ 7 | MockBackend, 8 | BaseRequestOptions, 9 | { 10 | provide: Http, 11 | useFactory: (backendInstance: MockBackend, defaultOptions: BaseRequestOptions) => { 12 | return new Http(backendInstance, defaultOptions); 13 | }, 14 | deps: [MockBackend, BaseRequestOptions] 15 | } 16 | ] 17 | }) 18 | export class RfbloyaltyTestModule {} 19 | -------------------------------------------------------------------------------- /src/test/resources/i18n/messages_en.properties: -------------------------------------------------------------------------------- 1 | email.test.title=test title 2 | -------------------------------------------------------------------------------- /src/test/resources/mails/testEmail.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tsconfig-aot.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "es2015", 5 | "moduleResolution": "node", 6 | "sourceMap": false, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false, 11 | "suppressImplicitAnyIndexErrors": true, 12 | "outDir": "build/www/app", 13 | "lib": ["es2015", "dom"], 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ] 17 | }, 18 | "files": [ 19 | "src/main/webapp/app/app.module.ts", 20 | "src/main/webapp/app/app.main-aot.ts" 21 | ], 22 | "angularCompilerOptions": { 23 | "genDir": "build/aot", 24 | "skipMetadataEmit" : true 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false, 11 | "skipLibCheck": true, 12 | "suppressImplicitAnyIndexErrors": true, 13 | "outDir": "build/www/app", 14 | "lib": ["es6", "dom"], 15 | "typeRoots": [ 16 | "node_modules/@types" 17 | ] 18 | }, 19 | "include": [ 20 | "src/main/webapp/app", 21 | "src/test/javascript/" 22 | ], 23 | "exclude": [ 24 | "src/main/webapp/app/app.main-aot.ts" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /webpack/logo-jhipster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Angular4JavaDevelopers/rfb-loyalty/84478d7675a6601bdcd83e3fcc636c12dc73c7b8/webpack/logo-jhipster.png -------------------------------------------------------------------------------- /webpack/utils.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | 4 | module.exports = { 5 | parseVersion, 6 | root, 7 | isExternalLib 8 | }; 9 | 10 | // Returns the second occurrence of the version number from `build.gradle` file 11 | function parseVersion() { 12 | const versionRegex = /^version\s*=\s*(.*)/gm; // Match and group the version number 13 | const buildGradle = fs.readFileSync('gradle.properties', 'utf8'); 14 | return versionRegex.exec(buildGradle)[0]; 15 | } 16 | 17 | const _root = path.resolve(__dirname, '..'); 18 | 19 | function root(args) { 20 | args = Array.prototype.slice.call(arguments, 0); 21 | return path.join.apply(path, [_root].concat(args)); 22 | } 23 | 24 | function isExternalLib(module, check = /node_modules/) { 25 | const req = module.userRequest; 26 | if (typeof req !== 'string') { 27 | return false; 28 | } 29 | return req.search(check) >= 0; 30 | } 31 | --------------------------------------------------------------------------------