diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e38c832 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/README.md b/README.md index 7e06f76..f6b922e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# The Ionic JHipster Starter 🤓 +# [BETA] The Ionic4 JHipster Starter 🤓 > Because Ionic Apps need some JHipster 💙 too! @@ -10,9 +10,7 @@ The Ionic JHipster Starter is designed to be used with a JHipster backend that uses JWT Authentication. You can create a project with it directly, or use [Ionic for JHipster](https://github.com/oktadeveloper/generator-jhipster-ionic). -This project provides a base template of functionality for an Ionic app. The Ionic for JHipster module provides entity generation and additional features that require logic to install (e.g. OAuth authentication). - -This project is in a beta state, see its [v1.0 milestone](https://github.com/oktadeveloper/ionic-jhipster-starter/milestone/2) for progress towards a release. +This project provides a base template of functionality for an Ionic app. The Ionic for JHipster module provides ~~entity generation and additional features that require logic to install (e.g. OAuth authentication)~~. [![Build Status][travis-image]][travis-url] @@ -29,7 +27,7 @@ This project is in a beta state, see its [v1.0 milestone](https://github.com/okt To use this starter, install the latest version of the Ionic CLI and run: ```bash -ionic start ionic4j oktadeveloper/jhipster +ionic start ionic4j fleboulch/jhipster ``` You can also install it using the [Ionic for JHipster Module](https://github.com/oktadeveloper/generator-jhipster-ionic): @@ -39,11 +37,7 @@ npm install -g generator-jhipster-ionic yo jhipster-ionic ``` -This module allows you to generate entities using: - -```bash -yo jhipster-ionic:entity -``` +~~This module allows you to generate entities using:~~ ### Tips @@ -59,27 +53,26 @@ The emulator runs on port 8080, so you will need to change your backend to run o ``` {jhipster-project}/src/main/resources/config/application-dev.yml {jhipster-project}/webpack/webpack.dev.js -{ionic-project}/src/providers/api/api.ts +{ionic-project}/src/environments/environment{.prod}.ts ``` ## Pages The Ionic JHipster Starter comes with a variety of ready-made pages. -## Providers +## Services -The Ionic JHipster Starter comes with some basic implementations of common providers. +The Ionic JHipster Starter comes with some basic implementations of common services. ### User -The `User` provider is used to authenticate users through its +The `User` service is used to authenticate users through its `login(accountInfo)` and `signup(accountInfo)` methods, which perform `POST` requests to an API endpoint that you will need to configure. ### Api -The `Api` provider is a simple CRUD frontend to an API. Simply put the root of -your API url in the Api class and call get/post/put/patch/delete. +The `Api` service is a simple CRUD frontend to an API. ## i18n @@ -154,7 +147,7 @@ npm run e2e The [Protractor configuration](test/protractor.conf.js) uses [serve](https://www.npmjs.com/package/serve) to serve up the contents of `www` on port 8100 before running its tests. -Apache-2.0 © [Okta](https://developer.okta.com/) +Apache-2.0 [travis-image]: https://travis-ci.org/oktadeveloper/ionic-jhipster-starter.svg?branch=master -[travis-url]: https://travis-ci.org/oktadeveloper/ionic-jhipster-starter \ No newline at end of file +[travis-url]: https://travis-ci.org/oktadeveloper/ionic-jhipster-starter diff --git a/ionic.starter.json b/ionic.starter.json index e82ffde..e12f726 100644 --- a/ionic.starter.json +++ b/ionic.starter.json @@ -1,7 +1,7 @@ { "name": "JHipster Starter", - "baseref": "fc4e95672c34e8462f4deffa543e4702a890b97f", - "welcome": "Welcome to the \u001b[34m\u001b[1mIonic\u001b[22m\u001b[39m \u001b[32m\u001b[1mJ\u001b[22m\u001b[39m\u001b[31m\u001b[1mHipster\u001b[22m\u001b[39m Starter!\n\nThe Ionic JHipster Starter ships with login and signup that will work with a JHipster backend (with JWT Authentication). \n\nFor more details, please see the project's README: \u001b[1mhttps://github.com/oktadeveloper/ionic-jhipster-starter/blob/master/README.md\u001b[22m", + "baseref": "a1abd0df2aaa0ab46c8c6495e1f63e07c4f7c977", + "welcome": "Welcome to the \u001b[34m\u001b[1mIonic\u001b[22m\u001b[39m \u001b[32m\u001b[1mJ\u001b[22m\u001b[39m\u001b[31m\u001b[1mHipster\u001b[22m\u001b[39m Starter!\n\nThe Ionic JHipster Starter ships with login and signup that will work with a JHipster backend (with JWT Authentication). \n\nFor more details, please see the project's README: \u001b[1mhttps://github.com/fleboulch/ionic-jhipster-starter/blob/master/README.md\u001b[22m", "packageJson": { "scripts": { "test": "jest", @@ -13,30 +13,30 @@ "e2e-update": "webdriver-manager update --standalone false --gecko false" }, "dependencies": { - "@ionic-native/camera": "4.6.0", - "@ngx-translate/core": "8.0.0", - "@ngx-translate/http-loader": "2.0.0", + "@ionic-native/camera": "5.3.0", + "@ngx-translate/core": "11.0.1", + "@ngx-translate/http-loader": "4.0.0", "ngx-webstorage": "2.0.1", - "ng-jhipster": "0.4.5" + "ng-jhipster": "0.9.3" }, "devDependencies": { - "generator-jhipster": "^4.10.2", - "@types/node": "8.0.0", - "@types/jest": "22.2.3", - "typescript": "2.8.1", - "html-loader": "0.5.1", - "ionic-mocks-jest": "1.0.3", - "istanbul-instrumenter-loader": "3.0.0", - "jasmine": "3.1.0", - "jasmine-spec-reporter": "4.1.0", - "jest": "22.4.3", - "jest-localstorage-mock": "2.2.0", - "jest-preset-angular": "5.2.1", + "generator-jhipster": "^5.8.2", + "@types/node": "11.12.2", + "@types/jest": "24.0.11", + "typescript": "3.1.1", + "html-loader": "0.5.5", + "ionic-mocks-jest": "1.3.3", + "istanbul-instrumenter-loader": "3.0.1", + "jasmine": "3.3.1", + "jasmine-spec-reporter": "4.2.1", + "jest": "24.5.0", + "jest-localstorage-mock": "2.4.0", + "jest-preset-angular": "7.0.1", "null-loader": "0.1.1", - "protractor": "5.1.1", + "protractor": "5.4.2", "node-http-server": "8.1.2", - "ts-loader": "4.2.0", - "ts-node": "6.0.0" + "ts-loader": "5.3.3", + "ts-node": "8.0.3" }, "cordova": { "plugins": { diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts new file mode 100644 index 0000000..07dcd31 --- /dev/null +++ b/src/app/app-routing.module.ts @@ -0,0 +1,15 @@ +import { NgModule } from '@angular/core'; +import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; + +const routes: Routes = [ + { path: '', loadChildren: './pages/welcome/welcome.module#WelcomePageModule' }, + { path: 'tabs', loadChildren: './pages/tabs/tabs.module#TabsPageModule' }, + { path: 'login', loadChildren: './pages/login/login.module#LoginPageModule' }, + { path: 'signup', loadChildren: './pages/signup/signup.module#SignupPageModule' }, + { path: 'accessdenied', redirectTo: '', pathMatch: 'full' } +]; +@NgModule({ + imports: [RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })], + exports: [RouterModule] +}) +export class AppRoutingModule {} diff --git a/src/app/app.component.html b/src/app/app.component.html new file mode 100644 index 0000000..13b9677 --- /dev/null +++ b/src/app/app.component.html @@ -0,0 +1,3 @@ + + + diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 9f67bd9..bf14b09 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,67 +1,45 @@ -import { async, TestBed } from '@angular/core/testing'; -import { Config, IonicModule, Platform } from 'ionic-angular'; -import { StatusBar } from '@ionic-native/status-bar'; -import { SplashScreen } from '@ionic-native/splash-screen'; -import { ConfigMock, PlatformMock, SplashScreenMock, StatusBarMock } from 'ionic-mocks-jest'; -import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; -import { MyApp } from './app.component'; -import { IonicStorageModule, Storage } from '@ionic/storage'; - -import * as en from '../assets/i18n/en.json'; -import { provideSettings } from './app.module'; -import { Settings } from '../providers/providers'; -import { Observable } from 'rxjs/Observable'; -import { of } from 'rxjs/observable/of'; - -const TRANSLATIONS = { - EN: en -}; - -class JsonTranslationLoader implements TranslateLoader { - getTranslation(code: string = ''): Observable { - const uppercased = code.toUpperCase(); - return of(TRANSLATIONS[uppercased]); - } -} - -describe('MyApp Component', () => { - let fixture; - let component; - - beforeEach( - async(() => { - TestBed.configureTestingModule({ - declarations: [MyApp], - imports: [ - IonicModule.forRoot(MyApp), - TranslateModule.forRoot({ - loader: { provide: TranslateLoader, useClass: JsonTranslationLoader } - }), - IonicStorageModule.forRoot({ - name: 'storage', - driverOrder: ['localstorage'], - })], - providers: [ - {provide: StatusBar, useFactory: () => StatusBarMock.instance()}, - {provide: SplashScreen, useFactory: () => SplashScreenMock.instance()}, - {provide: Platform, useFactory: () => PlatformMock.instance()}, - {provide: Config, useFactory: () => ConfigMock.instance()}, - {provide: Settings, useFactory: provideSettings, deps: [Storage]} - ] - }); - }) - ); - - beforeEach(() => { - fixture = TestBed.createComponent(MyApp); - component = fixture.componentInstance; +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { TestBed, async } from '@angular/core/testing'; + +import { Platform } from '@ionic/angular'; +import { SplashScreen } from '@ionic-native/splash-screen/ngx'; +import { StatusBar } from '@ionic-native/status-bar/ngx'; + +import { AppComponent } from './app.component'; + +describe('AppComponent', () => { + let statusBarSpy, splashScreenSpy, platformReadySpy, platformSpy; + + beforeEach(async(() => { + statusBarSpy = jasmine.createSpyObj('StatusBar', ['styleDefault']); + splashScreenSpy = jasmine.createSpyObj('SplashScreen', ['hide']); + platformReadySpy = Promise.resolve(); + platformSpy = jasmine.createSpyObj('Platform', { ready: platformReadySpy }); + + TestBed.configureTestingModule({ + declarations: [AppComponent], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + providers: [ + { provide: StatusBar, useValue: statusBarSpy }, + { provide: SplashScreen, useValue: splashScreenSpy }, + { provide: Platform, useValue: platformSpy } + ] + }).compileComponents(); + })); + + it('should create the app', () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app).toBeTruthy(); }); - it('should be created', () => { - expect(component instanceof MyApp).toBe(true); + it('should initialize the app', async () => { + TestBed.createComponent(AppComponent); + expect(platformSpy.ready).toHaveBeenCalled(); + await platformReadySpy; + expect(statusBarSpy.styleDefault).toHaveBeenCalled(); + expect(splashScreenSpy.hide).toHaveBeenCalled(); }); - it('should show tabs page', () => { - expect(component.rootPage).toEqual('TabsPage'); - }); -}); \ No newline at end of file + // TODO: add more tests! +}); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 4834b2a..41b7777 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,50 +1,25 @@ -import { Component, ViewChild } from '@angular/core'; -import { SplashScreen } from '@ionic-native/splash-screen'; -import { StatusBar } from '@ionic-native/status-bar'; +import { Component } from '@angular/core'; +import { SplashScreen } from '@ionic-native/splash-screen/ngx'; +import { StatusBar } from '@ionic-native/status-bar/ngx'; +import { Platform } from '@ionic/angular'; import { TranslateService } from '@ngx-translate/core'; -import { Config, Nav, Platform } from 'ionic-angular'; -import { MainPage } from '../pages/pages'; -import { Settings } from '../providers/providers'; @Component({ - template: ` - - - Pages - - - - - - - - - - - ` + selector: 'app-root', + templateUrl: 'app.component.html' }) -export class MyApp { - rootPage = MainPage; - - @ViewChild(Nav) nav: Nav; - - pages: any[] = [ - { title: 'Welcome', component: 'WelcomePage' }, - { title: 'Tabs', component: 'TabsPage' }, - { title: 'Login', component: 'LoginPage' }, - { title: 'Signup', component: 'SignupPage' }, - { title: 'Menu', component: 'MenuPage' }, - { title: 'Settings', component: 'SettingsPage' }, - { title: 'Entities', component: 'EntityPage' } - ]; +export class AppComponent { + constructor( + private platform: Platform, + private splashScreen: SplashScreen, + private statusBar: StatusBar, + private translate: TranslateService + ) { + this.initializeApp(); + } - constructor(private translate: TranslateService, platform: Platform, settings: Settings, private config: Config, - private statusBar: StatusBar, private splashScreen: SplashScreen) { - platform.ready().then(() => { - // Okay, so the platform is ready and our plugins are available. - // Here you can do any higher level native things you might need. + initializeApp() { + this.platform.ready().then(() => { this.statusBar.styleDefault(); this.splashScreen.hide(); }); @@ -52,23 +27,19 @@ export class MyApp { } initTranslate() { + const enLang = 'en'; + // Set the default language for translation strings, and the current language. - this.translate.setDefaultLang('en'); + this.translate.setDefaultLang(enLang); if (this.translate.getBrowserLang() !== undefined) { this.translate.use(this.translate.getBrowserLang()); } else { - this.translate.use('en'); // Set your language here + this.translate.use(enLang); // Set your language here } - this.translate.get(['BACK_BUTTON_TEXT']).subscribe(values => { - this.config.set('ios', 'backButtonText', values.BACK_BUTTON_TEXT); - }); - } - - openPage(page) { - // Reset the content nav to have just this page - // we wouldn't want the back button to show in this scenario - this.nav.setRoot(page.component); + // this.translate.get(['BACK_BUTTON_TEXT']).subscribe(values => { + // this.config.set('ios', 'backButtonText', values.BACK_BUTTON_TEXT); + // }); } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 2727aaa..9cb0b3a 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,82 +1,54 @@ -import { HTTP_INTERCEPTORS, HttpClient, HttpClientModule } from '@angular/common/http'; -import { ErrorHandler, NgModule } from '@angular/core'; +import { HttpClient, HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; +import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; -import { Camera } from '@ionic-native/camera'; -import { SplashScreen } from '@ionic-native/splash-screen'; -import { StatusBar } from '@ionic-native/status-bar'; -import { IonicStorageModule, Storage } from '@ionic/storage'; +import { RouteReuseStrategy } from '@angular/router'; +import { SplashScreen } from '@ionic-native/splash-screen/ngx'; +import { StatusBar } from '@ionic-native/status-bar/ngx'; +import { IonicModule, IonicRouteStrategy } from '@ionic/angular'; import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; -import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular'; -import { Api, Settings, User } from '../providers/providers'; -import { MyApp } from './app.component'; -import { LoginService } from '../providers/login/login.service'; -import { Principal } from '../providers/auth/principal.service'; -import { AccountService } from '../providers/auth/account.service'; -import { AuthServerProvider } from '../providers/auth/auth-jwt.service'; -import { LocalStorageService, SessionStorageService } from 'ngx-webstorage'; -import { AuthInterceptor } from '../providers/auth/auth-interceptor'; -import { EntityPageModule } from '../pages/entities/entity.module'; +import { Ng2Webstorage } from 'ngx-webstorage'; +import { AppRoutingModule } from './app-routing.module'; +import { AppComponent } from './app.component'; +import { AuthExpiredInterceptor } from './interceptors/auth-expired.interceptor'; +import { AuthInterceptor } from './interceptors/auth.interceptor'; -// The translate loader needs to know where to load i18n files -// in Ionic's static asset pipeline. export function createTranslateLoader(http: HttpClient) { return new TranslateHttpLoader(http, './assets/i18n/', '.json'); } -export function provideSettings(storage: Storage) { - /** - * The Settings provider takes a set of default settings for your app. - * - * You can add new settings options at any time. Once the settings are saved, - * these values will not overwrite the saved values (this can be done manually if desired). - */ - return new Settings(storage, { - option1: true, - option2: 'Ionitron J. Framework', - option3: '3', - option4: 'Hello' - }); -} - @NgModule({ - declarations: [ - MyApp - ], + declarations: [AppComponent], + entryComponents: [], imports: [ BrowserModule, HttpClientModule, TranslateModule.forRoot({ loader: { provide: TranslateLoader, - useFactory: (createTranslateLoader), + useFactory: createTranslateLoader, deps: [HttpClient] } }), - IonicModule.forRoot(MyApp), - IonicStorageModule.forRoot(), - EntityPageModule - ], - bootstrap: [IonicApp], - entryComponents: [ - MyApp + IonicModule.forRoot(), + Ng2Webstorage.forRoot({ prefix: 'jhi', separator: '-' }), + AppRoutingModule ], providers: [ - Api, - User, - LoginService, - Principal, - AccountService, - AuthServerProvider, - LocalStorageService, - SessionStorageService, - Camera, - SplashScreen, StatusBar, - { provide: Settings, useFactory: provideSettings, deps: [Storage] }, - // Keep this to enable Ionic's runtime error handling during development - { provide: ErrorHandler, useClass: IonicErrorHandler }, - { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true } - ] + SplashScreen, + { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }, + { + provide: HTTP_INTERCEPTORS, + useClass: AuthInterceptor, + multi: true + }, + { + provide: HTTP_INTERCEPTORS, + useClass: AuthExpiredInterceptor, + multi: true + } + ], + bootstrap: [AppComponent] }) -export class AppModule { } +export class AppModule {} diff --git a/src/app/app.scss b/src/app/app.scss deleted file mode 100644 index ee7b9b8..0000000 --- a/src/app/app.scss +++ /dev/null @@ -1,38 +0,0 @@ -// http://ionicframework.com/docs/v2/theming/ - - -// App Global Sass -// -------------------------------------------------- -// Put style rules here that you want to apply globally. These -// styles are for the entire app and not just one component. -// Additionally, this file can be also used as an entry point -// to import other Sass files to be included in the output CSS. -// -// Shared Sass variables, which can be used to adjust Ionic's -// default Sass variables, belong in "theme/variables.scss". -// -// To declare rules for a specific mode, create a child rule -// for the .md, .ios, or .wp mode classes. The mode class is -// automatically applied to the element in the app. - -.hipster { - display: inline-block; - width: 347px; - height: 497px; - background: url("../assets/img/hipster.png") no-repeat center top; - background-size: contain; -} - -/* wait autoprefixer update to allow simple generation of high pixel density media query */ -@media -only screen and (-webkit-min-device-pixel-ratio: 2), -only screen and ( min--moz-device-pixel-ratio: 2), -only screen and ( -o-min-device-pixel-ratio: 2/1), -only screen and ( min-device-pixel-ratio: 2), -only screen and ( min-resolution: 192dpi), -only screen and ( min-resolution: 2dppx) { - .hipster { - background: url("../assets/img/hipster2x.png") no-repeat center top; - background-size: contain; - } -} diff --git a/src/app/interceptors/auth-expired.interceptor.ts b/src/app/interceptors/auth-expired.interceptor.ts new file mode 100644 index 0000000..16b72e5 --- /dev/null +++ b/src/app/interceptors/auth-expired.interceptor.ts @@ -0,0 +1,25 @@ +import { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { tap } from 'rxjs/operators'; +import { LoginService } from '../services/login/login.service'; + +@Injectable() +export class AuthExpiredInterceptor implements HttpInterceptor { + constructor(private loginService: LoginService) {} + + intercept(request: HttpRequest, next: HttpHandler): Observable> { + return next.handle(request).pipe( + tap( + (event: HttpEvent) => {}, + (err: any) => { + if (err instanceof HttpErrorResponse) { + if (err.status === 401) { + this.loginService.logout(); + } + } + } + ) + ); + } +} diff --git a/src/providers/auth/auth-interceptor.ts b/src/app/interceptors/auth.interceptor.ts similarity index 54% rename from src/providers/auth/auth-interceptor.ts rename to src/app/interceptors/auth.interceptor.ts index a4d1313..fdd4b69 100644 --- a/src/providers/auth/auth-interceptor.ts +++ b/src/app/interceptors/auth.interceptor.ts @@ -1,33 +1,26 @@ +import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { - HttpRequest, - HttpHandler, - HttpEvent, - HttpInterceptor, HttpResponse -} from '@angular/common/http'; -import { Observable } from 'rxjs/Observable'; import { LocalStorageService, SessionStorageService } from 'ngx-webstorage'; +import { Observable } from 'rxjs'; +import { ApiService } from '../services/api/api.service'; @Injectable() export class AuthInterceptor implements HttpInterceptor { - - constructor(private localStorage: LocalStorageService, private sessionStorage: SessionStorageService) { - } + constructor(private localStorage: LocalStorageService, private sessionStorage: SessionStorageService) {} intercept(request: HttpRequest, next: HttpHandler): Observable> { + if (!request || !request.url || (/^http/.test(request.url) && !(ApiService.API_URL && request.url.startsWith(ApiService.API_URL)))) { + return next.handle(request); + } + const token = this.localStorage.retrieve('authenticationToken') || this.sessionStorage.retrieve('authenticationToken'); if (!!token) { request = request.clone({ setHeaders: { - Authorization: `Bearer ${token}` + Authorization: 'Bearer ' + token } }); } - - return next.handle(request).do((event: any) => { - if (event instanceof HttpResponse) { - return event; - } - }); + return next.handle(request); } } diff --git a/src/app/main.ts b/src/app/main.ts deleted file mode 100644 index 6af7a5b..0000000 --- a/src/app/main.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; - -import { AppModule } from './app.module'; - -platformBrowserDynamic().bootstrapModule(AppModule); diff --git a/src/app/pages/account/account.module.ts b/src/app/pages/account/account.module.ts new file mode 100644 index 0000000..52c6a25 --- /dev/null +++ b/src/app/pages/account/account.module.ts @@ -0,0 +1,25 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { RouterModule, Routes } from '@angular/router'; +import { IonicModule } from '@ionic/angular'; +import { TranslateModule } from '@ngx-translate/core'; +import { UserRouteAccessService } from 'src/app/services/auth/user-route-access.service'; +import { AccountPage } from './account.page'; + +const routes: Routes = [ + { + path: '', + component: AccountPage, + data: { + authorities: ['ROLE_USER'] + }, + canActivate: [UserRouteAccessService] + } +]; + +@NgModule({ + imports: [IonicModule, CommonModule, FormsModule, RouterModule.forChild(routes), TranslateModule], + declarations: [AccountPage] +}) +export class AccountPageModule {} diff --git a/src/app/pages/account/account.page.html b/src/app/pages/account/account.page.html new file mode 100644 index 0000000..cec1ba5 --- /dev/null +++ b/src/app/pages/account/account.page.html @@ -0,0 +1,9 @@ + + + + {{ 'TAB3_TITLE' | translate }} + + + + + diff --git a/src/app/pages/account/account.page.scss b/src/app/pages/account/account.page.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/account/account.page.spec.ts b/src/app/pages/account/account.page.spec.ts new file mode 100644 index 0000000..d656e5d --- /dev/null +++ b/src/app/pages/account/account.page.spec.ts @@ -0,0 +1,26 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AccountPage } from './account.page'; + +describe('AccountPage', () => { + let component: AccountPage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [AccountPage], + schemas: [CUSTOM_ELEMENTS_SCHEMA] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AccountPage); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/account/account.page.ts b/src/app/pages/account/account.page.ts new file mode 100644 index 0000000..441f9f7 --- /dev/null +++ b/src/app/pages/account/account.page.ts @@ -0,0 +1,8 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-account', + templateUrl: 'account.page.html', + styleUrls: ['account.page.scss'] +}) +export class AccountPage {} diff --git a/src/app/pages/entities/entities.module.ts b/src/app/pages/entities/entities.module.ts new file mode 100644 index 0000000..ae3e2ae --- /dev/null +++ b/src/app/pages/entities/entities.module.ts @@ -0,0 +1,25 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { RouterModule, Routes } from '@angular/router'; +import { IonicModule } from '@ionic/angular'; +import { TranslateModule } from '@ngx-translate/core'; +import { UserRouteAccessService } from 'src/app/services/auth/user-route-access.service'; +import { EntitiesPage } from './entities.page'; + +const routes: Routes = [ + { + path: '', + component: EntitiesPage, + data: { + authorities: ['ROLE_USER'] + }, + canActivate: [UserRouteAccessService] + } +]; + +@NgModule({ + imports: [IonicModule, CommonModule, FormsModule, RouterModule.forChild(routes), TranslateModule], + declarations: [EntitiesPage] +}) +export class EntitiesPageModule {} diff --git a/src/app/pages/entities/entities.page.html b/src/app/pages/entities/entities.page.html new file mode 100644 index 0000000..59f2309 --- /dev/null +++ b/src/app/pages/entities/entities.page.html @@ -0,0 +1,19 @@ + + + + {{ 'TAB2_TITLE' | translate }} + + + + + + + +

{{entity.name}}

+
+
+ +
+ {{ 'EMPTY_ENTITIES_MESSAGE' | translate }} +
+
diff --git a/src/pages/entities/entity.scss b/src/app/pages/entities/entities.page.scss similarity index 98% rename from src/pages/entities/entity.scss rename to src/app/pages/entities/entities.page.scss index 040b223..81a8856 100644 --- a/src/pages/entities/entity.scss +++ b/src/app/pages/entities/entities.page.scss @@ -4,4 +4,4 @@ margin-top: -125px; color: red; font-size: 16px; -} \ No newline at end of file +} diff --git a/src/app/pages/entities/entities.page.spec.ts b/src/app/pages/entities/entities.page.spec.ts new file mode 100644 index 0000000..209334e --- /dev/null +++ b/src/app/pages/entities/entities.page.spec.ts @@ -0,0 +1,26 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EntitiesPage } from './entities.page'; + +describe('EntitiesPage', () => { + let component: EntitiesPage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [EntitiesPage], + schemas: [CUSTOM_ELEMENTS_SCHEMA] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EntitiesPage); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/entities/entities.page.ts b/src/app/pages/entities/entities.page.ts new file mode 100644 index 0000000..bf27ba6 --- /dev/null +++ b/src/app/pages/entities/entities.page.ts @@ -0,0 +1,46 @@ +import { Component } from '@angular/core'; +import { NavController } from '@ionic/angular'; + +@Component({ + selector: 'app-entities', + templateUrl: 'entities.page.html', + styleUrls: ['entities.page.scss'] +}) +export class EntitiesPage { + entities: Array = [ + /* jhipster-needle-add-entity-page - JHipster will add entity pages here */ + ]; + + constructor(public navController: NavController) {} + + openPage(page) { + // Reset the content nav to have just this page + // we wouldn't want the back button to show in this scenario + this.navController.navigateForward(page.component); + } + + // ionViewWillLoad() { + // let page = location.hash.substring(location.hash.lastIndexOf('/') + 1); + // let urlParts = location.hash.split('/'); + // page = page.charAt(0).toUpperCase() + page.substring(1) + 'Page'; + // let destination; + // this.entities.forEach(entity => { + // if (entity.component === page) { + // destination = entity.component; + // } + // }); + // if (destination) { + // this.nav.push(destination); + // } else if (urlParts.length === 5) { + // // convert from URL to page name: foo-detail to FooDetailPage + // const detailPage = this.urlToTitleCase(urlParts[3]) + 'Page'; + // this.nav.push(detailPage, {id: urlParts[4]}) + // } + // } + + // private urlToTitleCase(str) { + // return str.replace(/(-|^)([^-]?)/g, (_, prep, letter) => { + // return (prep && '') + letter.toUpperCase(); + // }); + // } +} diff --git a/src/app/pages/home/home.module.ts b/src/app/pages/home/home.module.ts new file mode 100644 index 0000000..1d93a6a --- /dev/null +++ b/src/app/pages/home/home.module.ts @@ -0,0 +1,25 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { RouterModule, Routes } from '@angular/router'; +import { IonicModule } from '@ionic/angular'; +import { TranslateModule } from '@ngx-translate/core'; +import { UserRouteAccessService } from 'src/app/services/auth/user-route-access.service'; +import { HomePage } from './home.page'; + +const routes: Routes = [ + { + path: '', + component: HomePage, + data: { + authorities: ['ROLE_USER'] + }, + canActivate: [UserRouteAccessService] + } +]; + +@NgModule({ + imports: [IonicModule, CommonModule, FormsModule, TranslateModule, RouterModule.forChild(routes)], + declarations: [HomePage] +}) +export class HomePageModule {} diff --git a/src/app/pages/home/home.page.html b/src/app/pages/home/home.page.html new file mode 100644 index 0000000..16417e4 --- /dev/null +++ b/src/app/pages/home/home.page.html @@ -0,0 +1,20 @@ + + + + {{ 'WELCOME_TITLE' | translate }}, {{account?.firstName}} + + + + {{ 'LOGOUT_TITLE' | translate }} + + + + + + + +

{{ 'WELCOME_INTRO' | translate }}

+ + + +
diff --git a/src/app/pages/home/home.page.scss b/src/app/pages/home/home.page.scss new file mode 100644 index 0000000..45637c5 --- /dev/null +++ b/src/app/pages/home/home.page.scss @@ -0,0 +1,21 @@ +/* this code needs to be factored but can't be put in global.scss as it is generated by Ionic */ +.hipster { + display: inline-block; + width: 347px; + height: 497px; + background: url('../../../assets/img/hipster.png') no-repeat center top; + background-size: contain; +} + +/* wait autoprefixer update to allow simple generation of high pixel density media query */ +@media only screen and (-webkit-min-device-pixel-ratio: 2), + only screen and (min--moz-device-pixel-ratio: 2), + only screen and (-o-min-device-pixel-ratio: 2/1), + only screen and (min-device-pixel-ratio: 2), + only screen and (min-resolution: 192dpi), + only screen and (min-resolution: 2dppx) { + .hipster { + background: url('../../../assets/img/hipster2x.png') no-repeat center top; + background-size: contain; + } +} diff --git a/src/app/pages/home/home.page.spec.ts b/src/app/pages/home/home.page.spec.ts new file mode 100644 index 0000000..2269575 --- /dev/null +++ b/src/app/pages/home/home.page.spec.ts @@ -0,0 +1,26 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HomePage } from './home.page'; + +describe('HomePage', () => { + let component: HomePage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [HomePage], + schemas: [CUSTOM_ELEMENTS_SCHEMA] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HomePage); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/home/home.page.ts b/src/app/pages/home/home.page.ts new file mode 100644 index 0000000..23ab342 --- /dev/null +++ b/src/app/pages/home/home.page.ts @@ -0,0 +1,39 @@ +import { Component, OnInit } from '@angular/core'; +import { NavController } from '@ionic/angular'; +import { AccountService } from 'src/app/services/auth/account.service'; +import { LoginService } from 'src/app/services/login/login.service'; +import { Account } from 'src/model/account.model'; + +@Component({ + selector: 'app-home', + templateUrl: 'home.page.html', + styleUrls: ['home.page.scss'] +}) +export class HomePage implements OnInit { + account: Account; + + constructor(public navController: NavController, private accountService: AccountService, private loginService: LoginService) {} + + ngOnInit() { + this.accountService.identity().then(account => { + if (account === null) { + this.goBackToHomePage(); + } else { + this.account = account; + } + }); + } + + isAuthenticated() { + return this.accountService.isAuthenticated(); + } + + logout() { + this.loginService.logout(); + this.goBackToHomePage(); + } + + private goBackToHomePage(): void { + this.navController.navigateBack(''); + } +} diff --git a/src/app/pages/login/login.module.ts b/src/app/pages/login/login.module.ts new file mode 100644 index 0000000..913e49d --- /dev/null +++ b/src/app/pages/login/login.module.ts @@ -0,0 +1,20 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { RouterModule, Routes } from '@angular/router'; +import { IonicModule } from '@ionic/angular'; +import { TranslateModule } from '@ngx-translate/core'; +import { LoginPage } from './login.page'; + +const routes: Routes = [ + { + path: '', + component: LoginPage + } +]; + +@NgModule({ + imports: [CommonModule, FormsModule, IonicModule, RouterModule.forChild(routes), TranslateModule], + declarations: [LoginPage] +}) +export class LoginPageModule {} diff --git a/src/pages/login/login.html b/src/app/pages/login/login.page.html similarity index 60% rename from src/pages/login/login.html rename to src/app/pages/login/login.page.html index 71701f3..e684b17 100644 --- a/src/pages/login/login.html +++ b/src/app/pages/login/login.page.html @@ -1,17 +1,22 @@ - + + + + {{ 'LOGIN_TITLE' | translate }} - + + +
- {{ 'USERNAME' | translate }} + {{ 'USERNAME' | translate }} - {{ 'PASSWORD' | translate }} + {{ 'PASSWORD' | translate }} @@ -19,8 +24,11 @@ - + + {{ 'LOGIN_BUTTON' | translate }} +
+
diff --git a/src/app/pages/login/login.page.scss b/src/app/pages/login/login.page.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/login/login.page.spec.ts b/src/app/pages/login/login.page.spec.ts new file mode 100644 index 0000000..0db7c20 --- /dev/null +++ b/src/app/pages/login/login.page.spec.ts @@ -0,0 +1,26 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LoginPage } from './login.page'; + +describe('LoginPage', () => { + let component: LoginPage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [LoginPage], + schemas: [CUSTOM_ELEMENTS_SCHEMA] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LoginPage); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts new file mode 100644 index 0000000..acee24a --- /dev/null +++ b/src/app/pages/login/login.page.ts @@ -0,0 +1,52 @@ +import { Component, OnInit } from '@angular/core'; +import { NavController, ToastController } from '@ionic/angular'; +import { TranslateService } from '@ngx-translate/core'; +import { LoginService } from 'src/app/services/login/login.service'; + +@Component({ + selector: 'app-login', + templateUrl: './login.page.html', + styleUrls: ['./login.page.scss'] +}) +export class LoginPage implements OnInit { + // The account fields for the login form. + account: { username: string; password: string; rememberMe: boolean } = { + username: '', + password: '', + rememberMe: false + }; + + // Our translated text strings + private loginErrorString: string; + + constructor( + public translateService: TranslateService, + public loginService: LoginService, + public toastController: ToastController, + public navController: NavController + ) {} + + ngOnInit() { + this.translateService.get('LOGIN_ERROR').subscribe(value => { + this.loginErrorString = value; + }); + } + + doLogin() { + this.loginService.login(this.account).then( + () => { + this.navController.navigateRoot('/tabs'); + }, + async err => { + // Unable to log in + this.account.password = ''; + const toast = await this.toastController.create({ + message: this.loginErrorString, + duration: 3000, + position: 'top' + }); + toast.present(); + } + ); + } +} diff --git a/src/app/pages/signup/signup.module.ts b/src/app/pages/signup/signup.module.ts new file mode 100644 index 0000000..bccef95 --- /dev/null +++ b/src/app/pages/signup/signup.module.ts @@ -0,0 +1,20 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { RouterModule, Routes } from '@angular/router'; +import { IonicModule } from '@ionic/angular'; +import { TranslateModule } from '@ngx-translate/core'; +import { SignupPage } from './signup.page'; + +const routes: Routes = [ + { + path: '', + component: SignupPage + } +]; + +@NgModule({ + imports: [CommonModule, FormsModule, IonicModule, RouterModule.forChild(routes), TranslateModule], + declarations: [SignupPage] +}) +export class SignupPageModule {} diff --git a/src/app/pages/signup/signup.page.html b/src/app/pages/signup/signup.page.html new file mode 100644 index 0000000..087629f --- /dev/null +++ b/src/app/pages/signup/signup.page.html @@ -0,0 +1,42 @@ + + + + + + {{ 'SIGNUP_TITLE' | translate }} + + + + +
+ + + + {{ 'FIRST_NAME' | translate }} + + + + + {{ 'LAST_NAME' | translate }} + + + + + {{ 'EMAIL' | translate }} + + + + + {{ 'PASSWORD' | translate }} + + + + + + {{ 'SIGNUP_BUTTON' | translate }} + + + + +
+
diff --git a/src/app/pages/signup/signup.page.scss b/src/app/pages/signup/signup.page.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/signup/signup.page.spec.ts b/src/app/pages/signup/signup.page.spec.ts new file mode 100644 index 0000000..7ef1d91 --- /dev/null +++ b/src/app/pages/signup/signup.page.spec.ts @@ -0,0 +1,26 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SignupPage } from './signup.page'; + +describe('SignupPage', () => { + let component: SignupPage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [SignupPage], + schemas: [CUSTOM_ELEMENTS_SCHEMA] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SignupPage); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/signup/signup.page.ts b/src/app/pages/signup/signup.page.ts new file mode 100644 index 0000000..56a0ade --- /dev/null +++ b/src/app/pages/signup/signup.page.ts @@ -0,0 +1,87 @@ +import { Component, OnInit } from '@angular/core'; +import { NavController, ToastController } from '@ionic/angular'; +import { TranslateService } from '@ngx-translate/core'; +import { UserService } from 'src/app/services/user/user.service'; + +@Component({ + selector: 'app-signup', + templateUrl: './signup.page.html', + styleUrls: ['./signup.page.scss'] +}) +export class SignupPage implements OnInit { + // The account fields for the signup form + account: { + login: string; + email: string; + firstName: string; + lastName: string; + password: string; + langKey: string; + } = { + login: '', + email: '', + firstName: '', + lastName: '', + password: '', + langKey: 'en' + }; + + // Our translated text strings + private signupErrorString: string; + private signupSuccessString: string; + private existingUserError: string; + private invalidPasswordError: string; + + constructor( + public navController: NavController, + public userService: UserService, + public toastController: ToastController, + public translateService: TranslateService + ) { + this.translateService.get(['SIGNUP_ERROR', 'SIGNUP_SUCCESS', 'EXISTING_USER_ERROR', 'INVALID_PASSWORD_ERROR']).subscribe(values => { + this.signupErrorString = values.SIGNUP_ERROR; + this.signupSuccessString = values.SIGNUP_SUCCESS; + this.existingUserError = values.EXISTING_USER_ERROR; + this.invalidPasswordError = values.INVALID_PASSWORD_ERROR; + }); + } + + ngOnInit() {} + + doSignup() { + // set login to same as email + this.account.login = this.account.email; + // Attempt to login in through our User service + this.userService.signup(this.account).subscribe( + async () => { + const toast = await this.toastController.create({ + message: this.signupSuccessString, + duration: 3000, + position: 'top' + }); + toast.present(); + }, + async response => { + // Unable to sign up + const error = JSON.parse(response.error); + let displayError = this.signupErrorString; + if (response.status === 400 && error.type.includes('already-used')) { + displayError = this.existingUserError; + } else if ( + response.status === 400 && + error.message === 'error.validation' && + error.fieldErrors[0].field === 'password' && + error.fieldErrors[0].message === 'Size' + ) { + displayError = this.invalidPasswordError; + } + const toast = await this.toastController.create({ + message: displayError, + duration: 3000, + position: 'middle' + }); + toast.present(); + } + ); + } +} diff --git a/src/app/pages/tabs/tabs.module.ts b/src/app/pages/tabs/tabs.module.ts new file mode 100644 index 0000000..f83548b --- /dev/null +++ b/src/app/pages/tabs/tabs.module.ts @@ -0,0 +1,13 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { IonicModule } from '@ionic/angular'; +import { TranslateModule } from '@ngx-translate/core'; +import { TabsPage } from './tabs.page'; +import { TabsPageRoutingModule } from './tabs.router.module'; + +@NgModule({ + imports: [IonicModule, CommonModule, FormsModule, TabsPageRoutingModule, TranslateModule], + declarations: [TabsPage] +}) +export class TabsPageModule {} diff --git a/src/app/pages/tabs/tabs.page.html b/src/app/pages/tabs/tabs.page.html new file mode 100644 index 0000000..4c30531 --- /dev/null +++ b/src/app/pages/tabs/tabs.page.html @@ -0,0 +1,26 @@ + + + + + + + {{ 'TAB1_TITLE' | translate }} + + + + + + + {{ 'TAB2_TITLE' | translate }} + + + + + + + {{ 'TAB3_TITLE' | translate }} + + + + + diff --git a/src/app/pages/tabs/tabs.page.scss b/src/app/pages/tabs/tabs.page.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/tabs/tabs.page.spec.ts b/src/app/pages/tabs/tabs.page.spec.ts new file mode 100644 index 0000000..e94908c --- /dev/null +++ b/src/app/pages/tabs/tabs.page.spec.ts @@ -0,0 +1,26 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TabsPage } from './tabs.page'; + +describe('TabsPage', () => { + let component: TabsPage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [TabsPage], + schemas: [CUSTOM_ELEMENTS_SCHEMA] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TabsPage); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/tabs/tabs.page.ts b/src/app/pages/tabs/tabs.page.ts new file mode 100644 index 0000000..c4d3305 --- /dev/null +++ b/src/app/pages/tabs/tabs.page.ts @@ -0,0 +1,8 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-tabs', + templateUrl: 'tabs.page.html', + styleUrls: ['tabs.page.scss'] +}) +export class TabsPage {} diff --git a/src/app/pages/tabs/tabs.router.module.ts b/src/app/pages/tabs/tabs.router.module.ts new file mode 100644 index 0000000..e72ae3e --- /dev/null +++ b/src/app/pages/tabs/tabs.router.module.ts @@ -0,0 +1,55 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { TabsPage } from './tabs.page'; + +const routes: Routes = [ + { + path: '', + component: TabsPage, + children: [ + { + path: 'home', + children: [ + { + path: '', + loadChildren: '../home/home.module#HomePageModule' + } + ] + }, + { + path: 'entities', + children: [ + { + path: '', + loadChildren: '../entities/entities.module#EntitiesPageModule' + } + ] + }, + { + path: 'account', + children: [ + { + path: '', + loadChildren: '../account/account.module#AccountPageModule' + } + ] + }, + { + path: '', + redirectTo: '/tabs/home', + pathMatch: 'full' + } + ] + }, + { + path: '', + redirectTo: '/tabs/home', + pathMatch: 'full' + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class TabsPageRoutingModule {} diff --git a/src/app/pages/welcome/welcome.module.ts b/src/app/pages/welcome/welcome.module.ts new file mode 100644 index 0000000..4a13546 --- /dev/null +++ b/src/app/pages/welcome/welcome.module.ts @@ -0,0 +1,20 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { RouterModule, Routes } from '@angular/router'; +import { IonicModule } from '@ionic/angular'; +import { TranslateModule } from '@ngx-translate/core'; +import { WelcomePage } from './welcome.page'; + +const routes: Routes = [ + { + path: '', + component: WelcomePage + } +]; + +@NgModule({ + imports: [IonicModule, CommonModule, FormsModule, RouterModule.forChild(routes), TranslateModule], + declarations: [WelcomePage] +}) +export class WelcomePageModule {} diff --git a/src/app/pages/welcome/welcome.page.html b/src/app/pages/welcome/welcome.page.html new file mode 100644 index 0000000..44b2983 --- /dev/null +++ b/src/app/pages/welcome/welcome.page.html @@ -0,0 +1,18 @@ + + + + {{ 'WELCOME_TITLE' | translate }}, Java Hipster! + + + + + + +
+ {{ 'LOGIN' | translate }} + +

{{ 'NO_ACCOUNT_MESSAGE' | translate }}

+ {{ 'SIGNUP' | translate }} + +
+
diff --git a/src/app/pages/welcome/welcome.page.scss b/src/app/pages/welcome/welcome.page.scss new file mode 100644 index 0000000..797acad --- /dev/null +++ b/src/app/pages/welcome/welcome.page.scss @@ -0,0 +1,22 @@ +/* this code needs to be factored but can't be put in global.scss as it is generated by Ionic */ +.hipster { + display: block; + width: 209px; + height: 300px; + margin: 20px auto; + background: url('../../../assets/img/hipster.png') no-repeat center top; + background-size: contain; +} + +/* wait autoprefixer update to allow simple generation of high pixel density media query */ +@media only screen and (-webkit-min-device-pixel-ratio: 2), + only screen and (min--moz-device-pixel-ratio: 2), + only screen and (-o-min-device-pixel-ratio: 2/1), + only screen and (min-device-pixel-ratio: 2), + only screen and (min-resolution: 192dpi), + only screen and (min-resolution: 2dppx) { + .hipster { + background: url('../../../assets/img/hipster2x.png') no-repeat center top; + background-size: contain; + } +} diff --git a/src/app/pages/welcome/welcome.page.spec.ts b/src/app/pages/welcome/welcome.page.spec.ts new file mode 100644 index 0000000..9071b75 --- /dev/null +++ b/src/app/pages/welcome/welcome.page.spec.ts @@ -0,0 +1,26 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WelcomePage } from './welcome.page'; + +describe('WelcomePage', () => { + let component: WelcomePage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [WelcomePage], + schemas: [CUSTOM_ELEMENTS_SCHEMA] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WelcomePage); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/welcome/welcome.page.ts b/src/app/pages/welcome/welcome.page.ts new file mode 100644 index 0000000..1d67111 --- /dev/null +++ b/src/app/pages/welcome/welcome.page.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-welcome', + templateUrl: 'welcome.page.html', + styleUrls: ['welcome.page.scss'] +}) +export class WelcomePage implements OnInit { + constructor() {} + + ngOnInit() {} +} diff --git a/src/app/services/api/api.service.spec.ts b/src/app/services/api/api.service.spec.ts new file mode 100644 index 0000000..85ab897 --- /dev/null +++ b/src/app/services/api/api.service.spec.ts @@ -0,0 +1,11 @@ +import { TestBed } from '@angular/core/testing'; +import { ApiService } from './api.service'; + +describe('ApiService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: ApiService = TestBed.get(ApiService); + expect(service).toBeTruthy(); + }); +}); diff --git a/src/providers/api/api.ts b/src/app/services/api/api.service.ts similarity index 53% rename from src/providers/api/api.ts rename to src/app/services/api/api.service.ts index e9044b3..33f48ea 100644 --- a/src/providers/api/api.ts +++ b/src/app/services/api/api.service.ts @@ -1,15 +1,14 @@ import { HttpClient, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { environment } from 'src/environments/environment'; -/** - * Api is a generic REST Api handler. Set your API url first. - */ -@Injectable() -export class Api { - public static API_URL: string = 'http://localhost:8080/api'; +@Injectable({ + providedIn: 'root' +}) +export class ApiService { + public static API_URL = environment.apiUrl; - constructor(public http: HttpClient) { - } + constructor(public http: HttpClient) {} get(endpoint: string, params?: any, reqOpts?: any) { if (!reqOpts) { @@ -26,22 +25,22 @@ export class Api { } } - return this.http.get(Api.API_URL + '/' + endpoint, reqOpts); + return this.http.get(ApiService.API_URL + '/' + endpoint, reqOpts); } post(endpoint: string, body: any, reqOpts?: any) { - return this.http.post(Api.API_URL + '/' + endpoint, body, reqOpts); + return this.http.post(ApiService.API_URL + '/' + endpoint, body, reqOpts); } put(endpoint: string, body: any, reqOpts?: any) { - return this.http.put(Api.API_URL + '/' + endpoint, body, reqOpts); + return this.http.put(ApiService.API_URL + '/' + endpoint, body, reqOpts); } delete(endpoint: string, reqOpts?: any) { - return this.http.delete(Api.API_URL + '/' + endpoint, reqOpts); + return this.http.delete(ApiService.API_URL + '/' + endpoint, reqOpts); } patch(endpoint: string, body: any, reqOpts?: any) { - return this.http.put(Api.API_URL + '/' + endpoint, body, reqOpts); + return this.http.put(ApiService.API_URL + '/' + endpoint, body, reqOpts); } } diff --git a/src/app/services/auth/account.service.spec.ts b/src/app/services/auth/account.service.spec.ts new file mode 100644 index 0000000..d3dfe3b --- /dev/null +++ b/src/app/services/auth/account.service.spec.ts @@ -0,0 +1,11 @@ +import { TestBed } from '@angular/core/testing'; +import { AccountService } from './account.service'; + +describe('AccountService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: AccountService = TestBed.get(AccountService); + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/auth/account.service.ts b/src/app/services/auth/account.service.ts new file mode 100644 index 0000000..a278def --- /dev/null +++ b/src/app/services/auth/account.service.ts @@ -0,0 +1,119 @@ +import { HttpClient, HttpResponse } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { SessionStorageService } from 'ngx-webstorage'; +import { Observable, Subject } from 'rxjs'; +import { Account } from 'src/model/account.model'; +import { ApiService } from '../api/api.service'; + +@Injectable({ + providedIn: 'root' +}) +export class AccountService { + private userIdentity: any; + private authenticated = false; + private authenticationState = new Subject(); + + constructor(private sessionStorage: SessionStorageService, private http: HttpClient) {} + + fetch(): Observable> { + return this.http.get(ApiService.API_URL + '/account', { observe: 'response' }); + } + + save(account: any): Observable> { + return this.http.post(ApiService.API_URL + '/account', account, { observe: 'response' }); + } + + authenticate(identity) { + this.userIdentity = identity; + this.authenticated = identity !== null; + this.authenticationState.next(this.userIdentity); + } + + hasAnyAuthority(authorities: string[]): Promise { + return Promise.resolve(this.hasAnyAuthorityDirect(authorities)); + } + + hasAnyAuthorityDirect(authorities: string[]): boolean { + if (!this.authenticated || !this.userIdentity || !this.userIdentity.authorities) { + return false; + } + + for (let i = 0; i < authorities.length; i++) { + if (this.userIdentity.authorities.includes(authorities[i])) { + return true; + } + } + + return false; + } + + hasAuthority(authority: string): Promise { + if (!this.authenticated) { + return Promise.resolve(false); + } + + return this.identity().then( + id => { + return Promise.resolve(id.authorities && id.authorities.includes(authority)); + }, + () => { + return Promise.resolve(false); + } + ); + } + + identity(force?: boolean): Promise { + if (force === true) { + this.userIdentity = undefined; + } + + // check and see if we have retrieved the userIdentity data from the server. + // if we have, reuse it by immediately resolving + if (this.userIdentity) { + return Promise.resolve(this.userIdentity); + } + + // retrieve the userIdentity data from the server, update the identity object, and then resolve. + return this.fetch() + .toPromise() + .then(response => { + const account = response.body; + if (account) { + this.userIdentity = account; + this.authenticated = true; + // After retrieve the account info, the language will be changed to + // the user's preferred language configured in the account setting + + const langKey = this.sessionStorage.retrieve('locale') || this.userIdentity.langKey; + // this.languageService.changeLanguage(langKey); + } else { + this.userIdentity = null; + this.authenticated = false; + } + this.authenticationState.next(this.userIdentity); + return this.userIdentity; + }) + .catch(err => { + this.userIdentity = null; + this.authenticated = false; + this.authenticationState.next(this.userIdentity); + return null; + }); + } + + isAuthenticated(): boolean { + return this.authenticated; + } + + isIdentityResolved(): boolean { + return this.userIdentity !== undefined; + } + + getAuthenticationState(): Observable { + return this.authenticationState.asObservable(); + } + + getImageUrl(): string { + return this.isIdentityResolved() ? this.userIdentity.imageUrl : null; + } +} diff --git a/src/app/services/auth/auth-jwt.service.spec.ts b/src/app/services/auth/auth-jwt.service.spec.ts new file mode 100644 index 0000000..ee23ba5 --- /dev/null +++ b/src/app/services/auth/auth-jwt.service.spec.ts @@ -0,0 +1,11 @@ +import { TestBed } from '@angular/core/testing'; +import { AuthServerProvider } from './auth-jwt.service'; + +describe('AuthServerProvider', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: AuthServerProvider = TestBed.get(AuthServerProvider); + expect(service).toBeTruthy(); + }); +}); diff --git a/src/providers/auth/auth-jwt.service.ts b/src/app/services/auth/auth-jwt.service.ts similarity index 64% rename from src/providers/auth/auth-jwt.service.ts rename to src/app/services/auth/auth-jwt.service.ts index 8e3988b..ceff8e3 100644 --- a/src/providers/auth/auth-jwt.service.ts +++ b/src/app/services/auth/auth-jwt.service.ts @@ -1,36 +1,37 @@ +import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs/Rx'; import { LocalStorageService, SessionStorageService } from 'ngx-webstorage'; -import { Api } from '../api/api'; -import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { ApiService } from '../api/api.service'; -@Injectable() +@Injectable({ + providedIn: 'root' +}) export class AuthServerProvider { - - constructor(private http: HttpClient, - private $localStorage: LocalStorageService, - private $sessionStorage: SessionStorageService) { - } + constructor(private http: HttpClient, private $localStorage: LocalStorageService, private $sessionStorage: SessionStorageService) {} getToken() { return this.$localStorage.retrieve('authenticationToken') || this.$sessionStorage.retrieve('authenticationToken'); } login(credentials): Observable { - const data = { username: credentials.username, password: credentials.password, rememberMe: credentials.rememberMe }; - return this.http.post(Api.API_URL + '/authenticate', data).map((response: any) => { - const jwt = response['id_token']; - if (jwt) { + return this.http.post(ApiService.API_URL + '/authenticate', data, { observe: 'response' }).pipe(map(authenticateSuccess.bind(this))); + + function authenticateSuccess(resp) { + const bearerToken = resp.headers.get('Authorization'); + if (bearerToken && bearerToken.slice(0, 7) === 'Bearer ') { + const jwt = bearerToken.slice(7, bearerToken.length); this.storeAuthenticationToken(jwt, credentials.rememberMe); return jwt; } - }); + } } loginWithToken(jwt, rememberMe) { @@ -51,7 +52,7 @@ export class AuthServerProvider { } logout(): Observable { - return new Observable((observer) => { + return new Observable(observer => { this.$localStorage.clear('authenticationToken'); this.$sessionStorage.clear('authenticationToken'); observer.complete(); diff --git a/src/app/services/auth/user-route-access.service.spec.ts b/src/app/services/auth/user-route-access.service.spec.ts new file mode 100644 index 0000000..493935d --- /dev/null +++ b/src/app/services/auth/user-route-access.service.spec.ts @@ -0,0 +1,11 @@ +import { TestBed } from '@angular/core/testing'; +import { UserRouteAccessService } from './user-route-access.service'; + +describe('UserRouteAccessService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: UserRouteAccessService = TestBed.get(UserRouteAccessService); + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/auth/user-route-access.service.ts b/src/app/services/auth/user-route-access.service.ts new file mode 100644 index 0000000..f0067db --- /dev/null +++ b/src/app/services/auth/user-route-access.service.ts @@ -0,0 +1,54 @@ +import { Injectable, isDevMode } from '@angular/core'; +import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router'; +import { NavController } from '@ionic/angular'; +import { AccountService } from './account.service'; + +@Injectable({ + providedIn: 'root' +}) +export class UserRouteAccessService implements CanActivate { + constructor( + private router: Router, + private navController: NavController, + private accountService: AccountService // private stateStorageService: StateStorageService + ) {} + + canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean | Promise { + const authorities = route.data['authorities']; + // We need to call the checkLogin / and so the accountService.identity() function, to ensure, + // that the client has a principal too, if they already logged in by the server. + // This could happen on a page refresh. + return this.checkLogin(authorities, state.url); + } + + checkLogin(authorities: string[], url: string): Promise { + return this.accountService.identity().then(account => { + if (!authorities || authorities.length === 0) { + return true; + } + + if (account) { + const hasAnyAuthority = this.accountService.hasAnyAuthority(authorities); + if (hasAnyAuthority) { + return true; + } + if (isDevMode()) { + console.error('User has not any of required authorities: ', authorities); + } + return false; + } + + // this.stateStorageService.storeUrl(url); + // this.router.navigate(['accessdenied']).then(() => { + // // only show the login dialog, if the user hasn't logged in yet + // if (!account) { + // // this.loginModalService.open(); + // console.log('go to login page'); + // } + // }); + this.navController.navigateRoot('/accessdenied'); + + return false; + }); + } +} diff --git a/src/app/services/login/login.service.spec.ts b/src/app/services/login/login.service.spec.ts new file mode 100644 index 0000000..99abaa4 --- /dev/null +++ b/src/app/services/login/login.service.spec.ts @@ -0,0 +1,11 @@ +import { TestBed } from '@angular/core/testing'; +import { LoginService } from './login.service'; + +describe('LoginService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: LoginService = TestBed.get(LoginService); + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/login/login.service.ts b/src/app/services/login/login.service.ts new file mode 100644 index 0000000..2b735a0 --- /dev/null +++ b/src/app/services/login/login.service.ts @@ -0,0 +1,49 @@ +import { Injectable } from '@angular/core'; +import { TranslateService } from '@ngx-translate/core'; +import { AccountService } from '../auth/account.service'; +import { AuthServerProvider } from '../auth/auth-jwt.service'; + +@Injectable({ + providedIn: 'root' +}) +export class LoginService { + constructor( + private accountService: AccountService, + private authServerProvider: AuthServerProvider, + private translate: TranslateService + ) {} + + login(credentials, callback?) { + const cb = callback || function() {}; + + return new Promise((resolve, reject) => { + this.authServerProvider.login(credentials).subscribe( + data => { + this.accountService.identity(true).then(account => { + // After the login the language will be changed to + // the language selected by the user during his registration + if (account !== null) { + this.translate.use(account.langKey); + } + resolve(data); + }); + return cb(); + }, + err => { + this.logout(); + reject(err); + return cb(err); + } + ); + }); + } + + loginWithToken(jwt, rememberMe) { + return this.authServerProvider.loginWithToken(jwt, rememberMe); + } + + logout() { + this.authServerProvider.logout().subscribe(); + this.accountService.authenticate(null); + } +} diff --git a/src/app/services/user/user.service.spec.ts b/src/app/services/user/user.service.spec.ts new file mode 100644 index 0000000..61c6778 --- /dev/null +++ b/src/app/services/user/user.service.spec.ts @@ -0,0 +1,11 @@ +import { TestBed } from '@angular/core/testing'; +import { UserService } from './user.service'; + +describe('UserService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: UserService = TestBed.get(UserService); + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/user/user.service.ts b/src/app/services/user/user.service.ts new file mode 100644 index 0000000..e2e5992 --- /dev/null +++ b/src/app/services/user/user.service.ts @@ -0,0 +1,58 @@ +import { Injectable } from '@angular/core'; +import { Observable, of, throwError } from 'rxjs'; +import { share } from 'rxjs/operators'; +import { ApiService } from '../api/api.service'; +import { LoginService } from '../login/login.service'; + +@Injectable({ + providedIn: 'root' +}) +export class UserService { + private user: any; + + constructor(public apiService: ApiService, public loginService: LoginService) {} + + /** + * Send a POST request to our login endpoint with the data + * the user entered on the form. + */ + login(accountInfo: any) { + this.loginService + .login(accountInfo) + .then(res => { + this.loggedIn(res); + return of(res); + }) + .catch(err => { + console.error('ERROR', err); + return throwError(err); + }); + } + + findAll(): Observable { + return this.apiService.get('users'); + } + + /** + * Send a POST request to our signup endpoint with the data + * the user entered on the form. + */ + signup(accountInfo: any) { + return this.apiService.post('register', accountInfo, { responseType: 'text' as 'text' }).pipe(share()); + } + + /** + * Log the user out, which forgets the session + */ + logout() { + this.loginService.logout(); + this.user = null; + } + + /** + * Process a login/signup response to store user data + */ + private loggedIn(resp) { + this.user = resp.user; + } +} diff --git a/src/assets/i18n/ar.json b/src/assets/i18n/ar.json index 34dcb42..8fbd67a 100644 --- a/src/assets/i18n/ar.json +++ b/src/assets/i18n/ar.json @@ -2,15 +2,19 @@ "BACK_BUTTON_TEXT": "رجوع", "NAME": "الاسم", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "EMAIL": "البريد الإلكتروني", "USERNAME": "اسم المستخدم", "PASSWORD": "كلمة السر", + "REMEMBER_ME": "Remember Me", "LOGIN": "تسجيل الدخول", "SIGNUP": "انشاء الحساب", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "عناصر", "TAB2_TITLE": "بحث", - "TAB3_TITLE": "إعدادات", + "TAB3_TITLE": "Account", "MAP_TITLE": "خريطة", @@ -41,12 +45,16 @@ "SETTINGS_PAGE_PROFILE": "تعديل الملف الشخصي", "WELCOME_TITLE": "مرحبا", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "تسجيل الدخول", "LOGIN_ERROR": "تعذر تسجيل الدخول. يرجى التحقق من معلومات حسابك وإعادة المحاولة.", "LOGIN_BUTTON": "تسجيل الدخول", "SIGNUP_TITLE": "انشاء الحساب", "SIGNUP_ERROR": "تعذر إنشاء الحساب. يرجى التحقق من معلومات حسابك وإعادة المحاولة.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "انشاء الحساب", "LIST_MASTER_TITLE": "عناصر", @@ -64,5 +72,6 @@ "CARDS_TITLE": "اجتماعي", "SEARCH_TITLE": "بحث", - "SEARCH_PLACEHOLDER": "ابحث في قائمة العناصر، مثل \"Donald Duck\"" -} \ No newline at end of file + "SEARCH_PLACEHOLDER": "ابحث في قائمة العناصر، مثل \"Donald Duck\"", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/bs.json b/src/assets/i18n/bs.json index b39f816..9e78382 100644 --- a/src/assets/i18n/bs.json +++ b/src/assets/i18n/bs.json @@ -1,13 +1,18 @@ { "NAME": "Ime", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "PASSWORD": "Šifra", + "REMEMBER_ME": "Remember Me", "EMAIL": "E-mail", + "USERNAME": "Username", "LOGIN": "Prijava", "SIGNUP": "Registracija", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Stavke", "TAB2_TITLE": "Traži", - "TAB3_TITLE": "Postavke", + "TAB3_TITLE": "Account", "MAP_TITLE": "Mapa", @@ -29,12 +34,16 @@ "SETTINGS_PAGE_PROFILE": "Uredi profil", "WELCOME_TITLE": "Dobrodošli", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Prijavi se", "LOGIN_ERROR": "Prijava nije uspjela. Molimo provjerite vaše podatke za prijavu, a zatim pokušajte ponovo.", "LOGIN_BUTTON": "Prijava", "SIGNUP_TITLE": "Registruj se", "SIGNUP_ERROR": "Nije moguće kreirati novi korisnički račun. Molimo vas provjerite podatke, a zatim pokušajte ponovo.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Registracija", "LIST_MASTER_TITLE": "Stavke", @@ -44,5 +53,6 @@ "CARDS_TITLE": "Socijalno", - "SEARCH_TITLE": "Traži" -} \ No newline at end of file + "SEARCH_TITLE": "Traži", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/by.json b/src/assets/i18n/by.json index ae530b6..4cec4ee 100644 --- a/src/assets/i18n/by.json +++ b/src/assets/i18n/by.json @@ -1,13 +1,18 @@ { "NAME": "Імя", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "EMAIL": "Email", + "USERNAME": "Username", "PASSWORD": "Пароль", + "REMEMBER_ME": "Remember Me", "LOGIN": "Увайсці", "SIGNUP": "Зарэгістравацца", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Спіс", "TAB2_TITLE": "Пошук", - "TAB3_TITLE": "Налады", + "TAB3_TITLE": "Профіль", "MAP_TITLE": "Мапа", @@ -29,12 +34,16 @@ "SETTINGS_PAGE_PROFILE": "Профіль", "WELCOME_TITLE": "Прывітанне", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Уваход", "LOGIN_ERROR": "Не атрымалася ўвайсці ў сістэму. Калі ласка, праверце ўведзеныя ўліковыя дадзеныя і паспрабуйце зноў.", "LOGIN_BUTTON": "Увайсці", "SIGNUP_TITLE": "Рэгістрацыя", "SIGNUP_ERROR": "Не атрымалася стварыць уліковы запіс. Калі ласка, праверце ўведзеныя ўліковыя дадзеныя і паспрабуйце зноў.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Зарэгістравацца", "LIST_MASTER_TITLE": "Спіс", @@ -44,5 +53,6 @@ "CARDS_TITLE": "Суполкі", - "SEARCH_TITLE": "Пошук" -} \ No newline at end of file + "SEARCH_TITLE": "Пошук", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/da.json b/src/assets/i18n/da.json index aa0bdb5..9366172 100644 --- a/src/assets/i18n/da.json +++ b/src/assets/i18n/da.json @@ -1,13 +1,18 @@ { "NAME": "Navn", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "PASSWORD": "Adgangskode", + "REMEMBER_ME": "Remember Me", "EMAIL": "Email", + "USERNAME": "Username", "LOGIN": "Log Ind", "SIGNUP": "Tilmeld", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Poster", "TAB2_TITLE": "Søg", - "TAB3_TITLE": "Indstillinger", + "TAB3_TITLE": "Konto", "MAP_TITLE": "Kort", @@ -29,12 +34,16 @@ "SETTINGS_PAGE_PROFILE": "Rediger Profil", "WELCOME_TITLE": "Velkommen", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Log ind", "LOGIN_ERROR": "Fejl ved log ind. Kontroller venligst kontooplysningerne og prøv igen.", "LOGIN_BUTTON": "Log ind", "SIGNUP_TITLE": "Registrer", "SIGNUP_ERROR": "Fejl ved oprettelse. Kontroller venligst kontooplysningerne og prøv igen.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Registrer", "LIST_MASTER_TITLE": "Poster", @@ -44,5 +53,6 @@ "CARDS_TITLE": "Social", - "SEARCH_TITLE": "Søg" -} \ No newline at end of file + "SEARCH_TITLE": "Søg", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/de.json b/src/assets/i18n/de.json index a9faeee..de33652 100644 --- a/src/assets/i18n/de.json +++ b/src/assets/i18n/de.json @@ -2,15 +2,21 @@ "BACK_BUTTON_TEXT": "Zurück", "NAME": "Name", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "PASSWORD": "Passwort", + "REMEMBER_ME": "Remember Me", "EMAIL": "Email", + "USERNAME": "Username", "LOGIN": "Anmelden", "SIGNUP": "Registrieren", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", + "CANCEL_BUTTON": "Schließen", "TAB1_TITLE": "Items", "TAB2_TITLE": "Suche", - "TAB3_TITLE": "Einstellung", + "TAB3_TITLE": "Zugang", "MAP_TITLE": "Karte", @@ -36,12 +42,16 @@ "SETTINGS_PAGE_PROFILE": "Profil ändern", "WELCOME_TITLE": "Willkommen", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Anmelden", "LOGIN_ERROR": "Fehler beim Anmelden, bitte überprüfe deine Informationen und versuche es erneut.", "LOGIN_BUTTON": "Anmelden", "SIGNUP_TITLE": "Registrieren", "SIGNUP_ERROR": "Fehler beim Registrieren, bitte überprüfe deine Informationen und versuche es erneut.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Registrieren", "LIST_MASTER_TITLE": "Artikel", @@ -52,5 +62,6 @@ "CARDS_TITLE": "Social", "SEARCH_TITLE": "Suche", - "SEARCH_PLACEHOLDER": "Suche in der Artikel-Liste, z.B. \"Donald Duck\"" -} \ No newline at end of file + "SEARCH_PLACEHOLDER": "Suche in der Artikel-Liste, z.B. \"Donald Duck\"", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/el.json b/src/assets/i18n/el.json index c8c6362..db3e792 100644 --- a/src/assets/i18n/el.json +++ b/src/assets/i18n/el.json @@ -1,13 +1,18 @@ { "NAME": "Όνομα", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "PASSWORD": "Κωδικός", + "REMEMBER_ME": "Remember Me", "EMAIL": "Email", + "USERNAME": "Username", "LOGIN": "Σύνδεση", "SIGNUP": "Εγγραφή", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Αντικείμενα", "TAB2_TITLE": "Αναζήτηση", - "TAB3_TITLE": "Ρυθμίσεις", + "TAB3_TITLE": "Λογαριασμός", "MAP_TITLE": "Χάρτης", @@ -29,12 +34,16 @@ "SETTINGS_PAGE_PROFILE": "Επεξεργασία Προφίλ", "WELCOME_TITLE": "Καλώς ορίσατε", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Σύνδεση", "LOGIN_ERROR": "Η σύνδεση ήταν ανέφικτη. Παρακαλούμε ελέγξτε τις πληροφορίες λογαριασμού σας και ξαναπροσπαθήστε.", "LOGIN_BUTTON": "Σύνδεση", "SIGNUP_TITLE": "Εγγραφή", "SIGNUP_ERROR": "Η δημιουργία λογαριασμού ήταν ανέφικτη. Παρακαλούμε ελέγξτε τις πληροφορίες λογαριασμού σας και ξαναπροσπαθήστε.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Εγγραφή", "LIST_MASTER_TITLE": "Αντικείμενα", @@ -44,5 +53,6 @@ "CARDS_TITLE": "Κοινωνικά", - "SEARCH_TITLE": "Αναζήτηση" -} \ No newline at end of file + "SEARCH_TITLE": "Αναζήτηση", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index c519b92..52dee45 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -10,10 +10,11 @@ "REMEMBER_ME": "Remember Me", "LOGIN": "Sign in", "SIGNUP": "Sign up", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Home", "TAB2_TITLE": "Entities", - "TAB3_TITLE": "Settings", + "TAB3_TITLE": "Account", "MAP_TITLE": "Map", @@ -44,6 +45,7 @@ "SETTINGS_PAGE_PROFILE": "Edit Profile", "WELCOME_TITLE": "Welcome", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Sign in", "LOGIN_ERROR": "Unable to sign in. Please check your account information and try again.", @@ -72,5 +74,6 @@ "CARDS_TITLE": "Social", "SEARCH_TITLE": "Search", - "SEARCH_PLACEHOLDER": "Search the items list, e.g. \"Donald Duck\"" -} \ No newline at end of file + "SEARCH_PLACEHOLDER": "Search the items list, e.g. \"Donald Duck\"", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/es-eu.json b/src/assets/i18n/es-eu.json index 4b75ff5..65c1fed 100644 --- a/src/assets/i18n/es-eu.json +++ b/src/assets/i18n/es-eu.json @@ -1,35 +1,45 @@ { - "NAME": "Izena", - "PASSWORD": "Pasahitza", - "EMAIL": "Email Helbidea", - "LOGIN": "Saioa Hasi", - "SIGNUP": "Izena Eman", - "TAB1_TITLE": "Artikuluak", - "TAB2_TITLE": "Bilatu", - "TAB3_TITLE": "Xehetasunak", - "MAP_TITLE": "Mapa", - "TUTORIAL_SLIDE1_TITLE": "Ongi etorri Ionic Super Starter-era", - "TUTORIAL_SLIDE1_DESCRIPTION": "Ionic Super Starter hasierako txantiloi bat da, 'page' askorekin eta ereduak", - "TUTORIAL_SLIDE2_TITLE": "Nola erabili Super Starter", - "TUTORIAL_SLIDE2_DESCRIPTION": "Sortu gustatzen zaizkizun orrialdeak eta ezabatu besteak. Adibidez: login signup, tabs eta tutorialeak.", - "TUTORIAL_SLIDE3_TITLE": "Ikasten", - "TUTORIAL_SLIDE3_DESCRIPTION": "Laguntzarik nahi? irakurri README,Super Starter-ren tutorial osoa daukazu", - "SETTINGS_TITLE": "Xehetasunak", - "SETTINGS_OPTION1": "1 Aukera", - "SETTINGS_OPTION2": "2 Aukera", - "SETTINGS_OPTION3": "3 Aukera", - "SETTINGS_OPTION4": "4 Aukera", - "SETTINGS_PAGE_PROFILE": "Zure datual editatu", - "WELCOME_TITLE": "Ongi Etorri", - "LOGIN_TITLE": "Sesioa Hasi", - "LOGIN_ERROR": "Arazoa sesioa hasteko. Mesedez,sahiatu berriz zure datuak idazten.", - "LOGIN_BUTTON": "Sesioa Hasi", - "SIGNUP_TITLE": "Izena eman", - "SIGNUP_ERROR": "Arazoa kontua sortzen.or, Mesedez,sahiatu berriz zure datuak idazten.", - "SIGNUP_BUTTON": "Izena Eman", - "LIST_MASTER_TITLE": "Artikuluak", - "ITEM_CREATE_TITLE": "Artikulu berria", - "ITEM_CREATE_CHOOSE_IMAGE": "Argazkia sortu", - "CARDS_TITLE": "Sozial", - "SEARCH_TITLE": "Bilatu" -} \ No newline at end of file + "NAME": "Izena", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", + "PASSWORD": "Pasahitza", + "REMEMBER_ME": "Remember Me", + "EMAIL": "Email Helbidea", + "USERNAME": "Username", + "LOGIN": "Saioa Hasi", + "SIGNUP": "Izena Eman", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", + "TAB1_TITLE": "Artikuluak", + "TAB2_TITLE": "Bilatu", + "TAB3_TITLE": "Account", + "MAP_TITLE": "Mapa", + "TUTORIAL_SLIDE1_TITLE": "Ongi etorri Ionic Super Starter-era", + "TUTORIAL_SLIDE1_DESCRIPTION": "Ionic Super Starter hasierako txantiloi bat da, 'page' askorekin eta ereduak", + "TUTORIAL_SLIDE2_TITLE": "Nola erabili Super Starter", + "TUTORIAL_SLIDE2_DESCRIPTION": "Sortu gustatzen zaizkizun orrialdeak eta ezabatu besteak. Adibidez: login signup, tabs eta tutorialeak.", + "TUTORIAL_SLIDE3_TITLE": "Ikasten", + "TUTORIAL_SLIDE3_DESCRIPTION": "Laguntzarik nahi? irakurri README,Super Starter-ren tutorial osoa daukazu", + "SETTINGS_TITLE": "Xehetasunak", + "SETTINGS_OPTION1": "1 Aukera", + "SETTINGS_OPTION2": "2 Aukera", + "SETTINGS_OPTION3": "3 Aukera", + "SETTINGS_OPTION4": "4 Aukera", + "SETTINGS_PAGE_PROFILE": "Zure datual editatu", + "WELCOME_TITLE": "Ongi Etorri", + "LOGOUT_TITLE": "Logout", + "LOGIN_TITLE": "Sesioa Hasi", + "LOGIN_ERROR": "Arazoa sesioa hasteko. Mesedez,sahiatu berriz zure datuak idazten.", + "LOGIN_BUTTON": "Sesioa Hasi", + "SIGNUP_TITLE": "Izena eman", + "SIGNUP_ERROR": "Arazoa kontua sortzen.or, Mesedez,sahiatu berriz zure datuak idazten.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", + "SIGNUP_BUTTON": "Izena Eman", + "LIST_MASTER_TITLE": "Artikuluak", + "ITEM_CREATE_TITLE": "Artikulu berria", + "ITEM_CREATE_CHOOSE_IMAGE": "Argazkia sortu", + "CARDS_TITLE": "Sozial", + "SEARCH_TITLE": "Bilatu", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/es.json b/src/assets/i18n/es.json index 1bd5223..c8be400 100644 --- a/src/assets/i18n/es.json +++ b/src/assets/i18n/es.json @@ -1,13 +1,18 @@ { "NAME": "Nombre", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "PASSWORD": "Contraseña", + "REMEMBER_ME": "Remember Me", "EMAIL": "Email", + "USERNAME": "Username", "LOGIN": "Iniciar sesión", "SIGNUP": "Registrarse", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Items", "TAB2_TITLE": "Buscar", - "TAB3_TITLE": "Ajustes", + "TAB3_TITLE": "Cuenta", "MAP_TITLE": "Mapa", @@ -29,12 +34,16 @@ "SETTINGS_PAGE_PROFILE": "Editar Perfil", "WELCOME_TITLE": "Bienvenido/a", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Iniciar sesión", "LOGIN_ERROR": "No se ha podido iniciar sesión. Por favor revisa la información de la cuenta e inténtalo de nuevo.", "LOGIN_BUTTON": "Iniciar sesión", "SIGNUP_TITLE": "Registro", "SIGNUP_ERROR": "No se ha podido crear la cuenta. Por favor revisa la información de la cuenta e inténtalo de nuevo.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Registrarse", "LIST_MASTER_TITLE": "Items", @@ -44,5 +53,6 @@ "CARDS_TITLE": "Social", - "SEARCH_TITLE": "Buscar" -} \ No newline at end of file + "SEARCH_TITLE": "Buscar", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/fil.json b/src/assets/i18n/fil.json index affee35..18fac4d 100644 --- a/src/assets/i18n/fil.json +++ b/src/assets/i18n/fil.json @@ -1,13 +1,18 @@ { "NAME": "Pangalan", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "PASSWORD": "Password", + "REMEMBER_ME": "Remember Me", "EMAIL": "Email", + "USERNAME": "Username", "LOGIN": "Sign in", "SIGNUP": "Sign up", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Mga Gamit", "TAB2_TITLE": "Hanapin", - "TAB3_TITLE": "Mga Setting", + "TAB3_TITLE": "Account", "MAP_TITLE": "Mapa", @@ -29,12 +34,16 @@ "SETTINGS_PAGE_PROFILE": "Baguhin ang Profile", "WELCOME_TITLE": "Maligayang Pagdating", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Sign in", "LOGIN_ERROR": "Hindi makapag-sign-in. Paki-kumpirma ang iyong impormasyon at subukan ulit", "LOGIN_BUTTON": "Sign in", "SIGNUP_TITLE": "Sign up", "SIGNUP_ERROR": "Hindi makagawa ng bagong account. Paki-kumpirma ang iyong impormasyon at subukan ulit", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Sign up", "LIST_MASTER_TITLE": "Mga Item", @@ -44,5 +53,6 @@ "CARDS_TITLE": "Social", - "SEARCH_TITLE": "Hanapin" -} \ No newline at end of file + "SEARCH_TITLE": "Hanapin", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 69074e5..4edffcf 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -1,13 +1,18 @@ { "NAME": "Nom", + "FIRST_NAME": "Prénom", + "LAST_NAME": "Nom", "PASSWORD": "Mot de passe", + "REMEMBER_ME": "Se souvenir de moi", "EMAIL": "E-mail", + "USERNAME": "Nom d'utilisateur", "LOGIN": "Connexion", "SIGNUP": "Inscription", + "NO_ACCOUNT_MESSAGE": "Vous n'avez pas encore de compte ?", - "TAB1_TITLE": "Items", - "TAB2_TITLE": "Recherche", - "TAB3_TITLE": "Paramètres", + "TAB1_TITLE": "Accueil", + "TAB2_TITLE": "Entités", + "TAB3_TITLE": "Compte", "MAP_TITLE": "Carte", @@ -20,6 +25,8 @@ "TUTORIAL_SLIDE3_TITLE": "Pour commencer", "TUTORIAL_SLIDE3_DESCRIPTION": "Si vous avez besoin d’aide, consultez le README du Super Starter pour un tutoriel complet.", + "WELCOME_INTRO": "Le point d'entrée pour ta future application Ionic", + "SETTINGS_TITLE": "Paramètres", "SETTINGS_OPTION1": "Option 1", "SETTINGS_OPTION2": "Option 2", @@ -29,12 +36,16 @@ "SETTINGS_PAGE_PROFILE": "Modifier le profil", "WELCOME_TITLE": "Bienvenue", + "LOGOUT_TITLE": "Déconnexion", "LOGIN_TITLE": "Connexion", "LOGIN_ERROR": "Connexion impossible. Veuillez vérifier les informations de votre compte et réessayer.", "LOGIN_BUTTON": "Connexion", "SIGNUP_TITLE": "Inscription", "SIGNUP_ERROR": "Inscription impossible. Veuillez vérifier les informations de votre compte et réessayer.", + "SIGNUP_SUCCESS": "Inscription enregistrée ! Un email de validation vous a été envoyé.", + "EXISTING_USER_ERROR": "Adresse email déjà utilisée ! Merci d'en choisir une autre.", + "INVALID_PASSWORD_ERROR": "Mot de passe invalide.", "SIGNUP_BUTTON": "Inscription", "LIST_MASTER_TITLE": "Items", @@ -44,5 +55,6 @@ "CARDS_TITLE": "Social", - "SEARCH_TITLE": "Recherche" -} \ No newline at end of file + "SEARCH_TITLE": "Recherche", + "EMPTY_ENTITIES_MESSAGE": "Aucune entité générée. Tape `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/he.json b/src/assets/i18n/he.json index 6a354d1..ec8a14b 100644 --- a/src/assets/i18n/he.json +++ b/src/assets/i18n/he.json @@ -1,13 +1,18 @@ { "NAME": "שם", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "PASSWORD": "סיסמא", + "REMEMBER_ME": "Remember Me", "EMAIL": "דואר אלקטרוני", + "USERNAME": "Username", "LOGIN": "התחברות", "SIGNUP": "הרשמה", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "פריטים", "TAB2_TITLE": "חיפוש", - "TAB3_TITLE": "הגדרות", + "TAB3_TITLE": "Account", "MAP_TITLE": "מפה", @@ -29,12 +34,16 @@ "SETTINGS_PAGE_PROFILE": "עריכת פרופיל", "WELCOME_TITLE": "ברוכים הבאים", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "התחברות", "LOGIN_ERROR": "לא ניתן להתחבר. אנא בדוק את פרטי ההתחברות ונסה שנית.", "LOGIN_BUTTON": "התחבר", "SIGNUP_TITLE": "הרשמה", "SIGNUP_ERROR": "לא ניתן ליצור חשבון. אנא בדוק את פרטי ההתחברות ונסה שנית.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "הירשם", "LIST_MASTER_TITLE": "פריטים", @@ -44,5 +53,6 @@ "CARDS_TITLE": "חברתי", - "SEARCH_TITLE": "חיפוש" -} \ No newline at end of file + "SEARCH_TITLE": "חיפוש", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/it.json b/src/assets/i18n/it.json index 2c8ca38..4a204a7 100644 --- a/src/assets/i18n/it.json +++ b/src/assets/i18n/it.json @@ -2,15 +2,19 @@ "BACK_BUTTON_TEXT": "Indietro", "NAME": "Nome", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "EMAIL": "Email", "USERNAME": "Nome utente", "PASSWORD": "Password", + "REMEMBER_ME": "Remember Me", "LOGIN": "Login", "SIGNUP": "Registrati", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Elenco", "TAB2_TITLE": "Ricerca", - "TAB3_TITLE": "Impostazioni", + "TAB3_TITLE": "Utente", "MAP_TITLE": "Mappa", @@ -41,12 +45,16 @@ "SETTINGS_PAGE_PROFILE": "Modifica Profilo", "WELCOME_TITLE": "Benvenuto", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Login", "LOGIN_ERROR": "Non è possibile accedere. Ricontrollare le informazioni utente digitate prima di riprovare.", "LOGIN_BUTTON": "Accedi", "SIGNUP_TITLE": "Registrazione", "SIGNUP_ERROR": "Non è possibile creare l'utente. Assicurarsi di aver inserito le informazioni utente correttamente e poi riprovare.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Registrati", "LIST_MASTER_TITLE": "Elenco elementi", @@ -64,5 +72,6 @@ "CARDS_TITLE": "Social", "SEARCH_TITLE": "Ricerca", - "SEARCH_PLACEHOLDER": "Trova elementi in lista, ex. \"Donald Duck\"" -} \ No newline at end of file + "SEARCH_PLACEHOLDER": "Trova elementi in lista, ex. \"Donald Duck\"", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/ja.json b/src/assets/i18n/ja.json index 94c649f..ca08916 100644 --- a/src/assets/i18n/ja.json +++ b/src/assets/i18n/ja.json @@ -2,15 +2,19 @@ "BACK_BUTTON_TEXT": "戻る", "NAME": "名前", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "EMAIL": "Eメール", "USERNAME": "ユーザー名", "PASSWORD": "パスワード", + "REMEMBER_ME": "Remember Me", "LOGIN": "サインイン", "SIGNUP": "サインアップ", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "項目", "TAB2_TITLE": "検索", - "TAB3_TITLE": "設定", + "TAB3_TITLE": "アカウント", "MAP_TITLE": "地図", @@ -41,12 +45,16 @@ "SETTINGS_PAGE_PROFILE": "プロフィールの編集", "WELCOME_TITLE": "ようこそ", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "サインイン", "LOGIN_ERROR": "サインインできません。アカウント情報を確認して、もう一度お試しください。", "LOGIN_BUTTON": "サインイン", "SIGNUP_TITLE": "サインアップ", "SIGNUP_ERROR": "アカウントを作成できません。 アカウント情報を確認して、もう一度お試しください。", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "サインアップ", "LIST_MASTER_TITLE": "項目", @@ -64,5 +72,6 @@ "CARDS_TITLE": "ソーシャル", "SEARCH_TITLE": "検索", - "SEARCH_PLACEHOLDER": "項目一覧を検索 例 \"Donald Duck\"" -} \ No newline at end of file + "SEARCH_PLACEHOLDER": "項目一覧を検索 例 \"Donald Duck\"", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/nb.json b/src/assets/i18n/nb.json index f601d97..5a0cf67 100644 --- a/src/assets/i18n/nb.json +++ b/src/assets/i18n/nb.json @@ -1,13 +1,18 @@ { "NAME": "Navn", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "PASSWORD": "Passord", + "REMEMBER_ME": "Remember Me", "EMAIL": "Email", + "USERNAME": "Username", "LOGIN": "Logg inn", "SIGNUP": "Registrer deg", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Innlegg", "TAB2_TITLE": "Søk", - "TAB3_TITLE": "Innstillinger", + "TAB3_TITLE": "Account", "MAP_TITLE": "Kart", @@ -29,12 +34,16 @@ "SETTINGS_PAGE_PROFILE": "Endre Profil", "WELCOME_TITLE": "Velkommen", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Innlogging", "LOGIN_ERROR": "Feil ved innlogging. Bekreft at kontodetaljene er riktig og prøv igjen.", "LOGIN_BUTTON": "Logg inn", "SIGNUP_TITLE": "Registrering", "SIGNUP_ERROR": "Feil ved registrering. Bekreft kontodetaljene og prøv igjen.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Registrer deg", "LIST_MASTER_TITLE": "Innlegg", @@ -44,5 +53,6 @@ "CARDS_TITLE": "Sosialt", - "SEARCH_TITLE": "Søk" -} \ No newline at end of file + "SEARCH_TITLE": "Søk", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/nl.json b/src/assets/i18n/nl.json index 66e87d0..bd9f091 100644 --- a/src/assets/i18n/nl.json +++ b/src/assets/i18n/nl.json @@ -1,13 +1,18 @@ { "NAME": "Naam", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "PASSWORD": "Wachtwoord", + "REMEMBER_ME": "Remember Me", "EMAIL": "E-mail", + "USERNAME": "Username", "LOGIN": "Inloggen", "SIGNUP": "Aanmelden", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Items", "TAB2_TITLE": "Zoeken", - "TAB3_TITLE": "Instellingen", + "TAB3_TITLE": "Gebruiker", "MAP_TITLE": "Kaart", @@ -29,12 +34,16 @@ "SETTINGS_PAGE_PROFILE": "Wijzig Profiel", "WELCOME_TITLE": "Welkom", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Aanmelden", "LOGIN_ERROR": "Inloggen mislukt. Controleer a.u.b. uw account informatie en probeer het nogmaals.", "LOGIN_BUTTON": "Inloggen", "SIGNUP_TITLE": "Aanmelden", "SIGNUP_ERROR": "Aanmelden mislukt. Controleer a.u.b. uw account informatie en probeer het nogmaals.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Aanmelden", "LIST_MASTER_TITLE": "Items", @@ -44,5 +53,6 @@ "CARDS_TITLE": "Sociaal", - "SEARCH_TITLE": "Zoeken" -} \ No newline at end of file + "SEARCH_TITLE": "Zoeken", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/pl.json b/src/assets/i18n/pl.json index cb3ee66..f9194a1 100644 --- a/src/assets/i18n/pl.json +++ b/src/assets/i18n/pl.json @@ -1,13 +1,18 @@ { "NAME": "Imię", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "PASSWORD": "Hasło", + "REMEMBER_ME": "Remember Me", "EMAIL": "Email", + "USERNAME": "Username", "LOGIN": "Zaloguj", "SIGNUP": "Zarejestruj", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Pozycje", "TAB2_TITLE": "Szukaj", - "TAB3_TITLE": "Ustawienia", + "TAB3_TITLE": "Konto", "MAP_TITLE": "Mapa", @@ -29,12 +34,16 @@ "SETTINGS_PAGE_PROFILE": "Edytuj Profil", "WELCOME_TITLE": "Witaj", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Zaloguj", "LOGIN_ERROR": "Nie udało się zalogować. Sprawdź raz jeszcze dane swoje konta i spróbuj ponownie.", "LOGIN_BUTTON": "Zaloguj", "SIGNUP_TITLE": "Zarejestruj", "SIGNUP_ERROR": "Nie udało się stworzyć konta. Sprawdź raz jeszcze dane swoje konta i spróbuj ponownie.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Zarejestruj", "LIST_MASTER_TITLE": "Pozycje", @@ -44,5 +53,6 @@ "CARDS_TITLE": "Społeczność", - "SEARCH_TITLE": "Szukaj" -} \ No newline at end of file + "SEARCH_TITLE": "Szukaj", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/pt-PT.json b/src/assets/i18n/pt-PT.json index 7377eb5..52d4438 100644 --- a/src/assets/i18n/pt-PT.json +++ b/src/assets/i18n/pt-PT.json @@ -1,13 +1,18 @@ { "NAME": "Nome", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "PASSWORD": "Password", + "REMEMBER_ME": "Remember Me", "EMAIL": "Email", + "USERNAME": "Username", "LOGIN": "Entrar", "SIGNUP": "Criar conta", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Items", "TAB2_TITLE": "Pesquisa", - "TAB3_TITLE": "Configurações", + "TAB3_TITLE": "Conta", "MAP_TITLE": "Mapa", @@ -29,12 +34,16 @@ "SETTINGS_PAGE_PROFILE": "Editar Perfil", "WELCOME_TITLE": "Bem-vindo", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Entrar", "LOGIN_ERROR": "Não foi possível entrar na sua conta. Por favor confirme os seus dados e tente novamente.", "LOGIN_BUTTON": "Entrar", "SIGNUP_TITLE": "Criar conta", "SIGNUP_ERROR": "Não foi possível criar a sua conta. Por favor confirme os seus dados e tente novamente.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Criar conta", "LIST_MASTER_TITLE": "Items", @@ -44,5 +53,6 @@ "CARDS_TITLE": "Social", - "SEARCH_TITLE": "Pesquisa" -} \ No newline at end of file + "SEARCH_TITLE": "Pesquisa", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/pt-br.json b/src/assets/i18n/pt-br.json index 3c02d45..3f6f55a 100644 --- a/src/assets/i18n/pt-br.json +++ b/src/assets/i18n/pt-br.json @@ -2,15 +2,19 @@ "BACK_BUTTON_TEXT": "Voltar", "NAME": "Nome", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "EMAIL": "Email", "USERNAME": "Nome de Usuário", "PASSWORD": "Senha", + "REMEMBER_ME": "Remember Me", "LOGIN": "Entrar", "SIGNUP": "Cadastre-se", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Itens", "TAB2_TITLE": "Busca", - "TAB3_TITLE": "Configurações", + "TAB3_TITLE": "Conta", "MAP_TITLE": "Mapa", @@ -41,12 +45,16 @@ "SETTINGS_PAGE_PROFILE": "Editar Perfil", "WELCOME_TITLE": "Bem-vindo", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Entrar", "LOGIN_ERROR": "Não foi possível entrar na sua conta. Verifique seus dados e tente novamente.", "LOGIN_BUTTON": "Entrar", "SIGNUP_TITLE": "Cadastre-se", "SIGNUP_ERROR": "Não foi possível criar sua conta. Verifique seus dados e tente novamente.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Cadastre-se", "LIST_MASTER_TITLE": "Itens", @@ -64,5 +72,6 @@ "CARDS_TITLE": "Social", "SEARCH_TITLE": "Busca", - "SEARCH_PLACEHOLDER": "Procure um item da lista, ex: \"Donald Duck\"" -} \ No newline at end of file + "SEARCH_PLACEHOLDER": "Procure um item da lista, ex: \"Donald Duck\"", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/ru.json b/src/assets/i18n/ru.json index 4283d72..c119cf9 100644 --- a/src/assets/i18n/ru.json +++ b/src/assets/i18n/ru.json @@ -1,13 +1,18 @@ { "NAME": "Имя", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "PASSWORD": "Пароль", + "REMEMBER_ME": "Remember Me", "EMAIL": "Email", + "USERNAME": "Username", "LOGIN": "Вход", "SIGNUP": "Регистрация", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Список", "TAB2_TITLE": "Поиск", - "TAB3_TITLE": "Настройки", + "TAB3_TITLE": "Профиль", "MAP_TITLE": "Карта", @@ -29,12 +34,16 @@ "SETTINGS_PAGE_PROFILE": "Редактирование профиля", "WELCOME_TITLE": "Добро пожаловать", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Вход", "LOGIN_ERROR": "Невозможно войти. Пожалуйста проверьте информацию о Вашей учетной записи и попробуйте войти еще раз.", "LOGIN_BUTTON": "Войти", "SIGNUP_TITLE": "Регистрация", "SIGNUP_ERROR": "Невозможно создать учетную запись. Пожалуйста проверьте информацию о Вашей учетной записи и попробуйте еще раз.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Регистрация", "LIST_MASTER_TITLE": "Список", @@ -44,5 +53,6 @@ "CARDS_TITLE": "Социальный", - "SEARCH_TITLE": "Поиск" -} \ No newline at end of file + "SEARCH_TITLE": "Поиск", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/sk.json b/src/assets/i18n/sk.json index 96ad1d0..9e1776b 100644 --- a/src/assets/i18n/sk.json +++ b/src/assets/i18n/sk.json @@ -2,15 +2,19 @@ "BACK_BUTTON_TEXT": "Späť", "NAME": "Meno", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "EMAIL": "Email", "USERNAME": "Prihlasovacie meno", "PASSWORD": "Heslo", + "REMEMBER_ME": "Remember Me", "LOGIN": "Prihlásiť", "SIGNUP": "Registrovať", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Položky", "TAB2_TITLE": "Hľadať", - "TAB3_TITLE": "Nastavenia", + "TAB3_TITLE": "Účet", "MAP_TITLE": "Mapa", @@ -28,8 +32,6 @@ "TUTORIAL_SLIDE4_TITLE": "Ste pripravený?", - - "WELCOME_INTRO": "Prvý krok vašej novej Ionic aplikácie.", "SETTINGS_TITLE": "Nastavenia", @@ -40,21 +42,19 @@ "SETTINGS_PROFILE_BUTTON": "Upraviť profil", - "SETTINGS_PAGE_PROFILE": "Profil", - "WELCOME_TITLE": "Vitajte", - - - - + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Prihlásenie", "LOGIN_ERROR": "Nedá sa prihlásiť. Skotrolujte zadané informácie a skuste to znova.", "LOGIN_BUTTON": "Prihlásiť", "SIGNUP_TITLE": "Registrácia", "SIGNUP_ERROR": "Nedá sa vytvoriť konto. Skotrolujte zadané informácie a skuste to znova.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Registrovať", "LIST_MASTER_TITLE": "Položky", @@ -62,10 +62,6 @@ "ITEM_CREATE_TITLE": "Nová položka", "ITEM_CREATE_CHOOSE_IMAGE": "Pridať obrázok", - - - - "ITEM_NAME_PLACEHOLDER": "Názov", "ITEM_ABOUT_PLACEHOLDER": "O položke", @@ -76,5 +72,6 @@ "CARDS_TITLE": "Soc. siete", "SEARCH_TITLE": "Hľadať", - "SEARCH_PLACEHOLDER": "Napíšte hľadaný výraz, e.g. \"Donald Duck\"" -} \ No newline at end of file + "SEARCH_PLACEHOLDER": "Napíšte hľadaný výraz, e.g. \"Donald Duck\"", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/sl.json b/src/assets/i18n/sl.json index 7d689e2..f117c7f 100644 --- a/src/assets/i18n/sl.json +++ b/src/assets/i18n/sl.json @@ -1,13 +1,18 @@ { "NAME": "Ime", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "PASSWORD": "Geslo", + "REMEMBER_ME": "Remember Me", "EMAIL": "E-mail", + "USERNAME": "Username", "LOGIN": "Prijava", "SIGNUP": "Ustvari račun", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Elementi", "TAB2_TITLE": "Iskanje", - "TAB3_TITLE": "Nastavitve", + "TAB3_TITLE": "Account", "MAP_TITLE": "Zemljevid", @@ -29,12 +34,16 @@ "SETTINGS_PAGE_PROFILE": "Uredi profil", "WELCOME_TITLE": "Dobrodošli", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Prijava", "LOGIN_ERROR": "Napaka pri prijavi. Prosimo preglejte prijavne podatke računa in poskusite ponovno.", "LOGIN_BUTTON": "Prijava", "SIGNUP_TITLE": "Ustvari račun", "SIGNUP_ERROR": "Napaka pri kreiranju računa. Prosimo preglejte podatke kreiranega računa in poskusite ponovno. ", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Ustvari račun", "LIST_MASTER_TITLE": "Elementi", @@ -44,5 +53,6 @@ "CARDS_TITLE": "Socialno", - "SEARCH_TITLE": "Iskanje" -} \ No newline at end of file + "SEARCH_TITLE": "Iskanje", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/sn.json b/src/assets/i18n/sn.json index 230265c..c197b6c 100644 --- a/src/assets/i18n/sn.json +++ b/src/assets/i18n/sn.json @@ -2,15 +2,19 @@ "BACK_BUTTON_TEXT": "Dzoka Shure", "NAME": "Zita", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "EMAIL": "Tsambambozha", "USERNAME": "Zitamushandisi", "PASSWORD": "Chihori", + "REMEMBER_ME": "Remember Me", "LOGIN": "Sign mu", "SIGNUP": "Gadzira homwe yejikichidzo", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Maaitemu", "TAB2_TITLE": "Tsvaga", - "TAB3_TITLE": "Gadziro", + "TAB3_TITLE": "Account", "MAP_TITLE": "Mepu", @@ -41,12 +45,16 @@ "SETTINGS_PAGE_PROFILE": "Pepeta Profile", "WELCOME_TITLE": "Tinokuchingamidza", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Sign mu", "LOGIN_ERROR": "Takundikana kuita sign in. Tinokumbirawo mutarire homwe yenyu yejikichidzo mugoedza zvakare", "LOGIN_BUTTON": "Sign mu", "SIGNUP_TITLE": "Gadzira homwe yejikichidzo", "SIGNUP_ERROR": "Takundikana kugadzira homwe yejikichidzo ,Tinokumbirawo mutarire zvakatarwa pahomwe yenyu yejikichidzo moedza zvakare.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Gadzira homwe yejikichidzo", "LIST_MASTER_TITLE": "maaitemu", @@ -64,5 +72,6 @@ "CARDS_TITLE": "Social", "SEARCH_TITLE": "Tsvaga", - "SEARCH_PLACEHOLDER": "Tsvaga mumaaitemu sokuti \"Donald Duck\"" -} \ No newline at end of file + "SEARCH_PLACEHOLDER": "Tsvaga mumaaitemu sokuti \"Donald Duck\"", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/sv.json b/src/assets/i18n/sv.json index fccbb4b..9778869 100644 --- a/src/assets/i18n/sv.json +++ b/src/assets/i18n/sv.json @@ -1,13 +1,18 @@ { "NAME": "Namn", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "PASSWORD": "Lösenord", + "REMEMBER_ME": "Remember Me", "EMAIL": "E-post", + "USERNAME": "Username", "LOGIN": "Logga in", "SIGNUP": "Skapa konto", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Inlägg", "TAB2_TITLE": "Sök", - "TAB3_TITLE": "Inställningar", + "TAB3_TITLE": "Konto", "MAP_TITLE": "Karta", @@ -29,12 +34,16 @@ "SETTINGS_PAGE_PROFILE": "Redigera profil", "WELCOME_TITLE": "Välkommen", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Logga in", "LOGIN_ERROR": "Det gick inte att logga in. Kontrollera inloggningsuppgifterna och försök igen.", "LOGIN_BUTTON": "Logga in", "SIGNUP_TITLE": "Skapa konto", "SIGNUP_ERROR": "Det gick inte att skapa ett konto. Kontrollera dina uppgifter och försök igen.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Skapa konto", "LIST_MASTER_TITLE": "Inlägg", @@ -44,5 +53,6 @@ "CARDS_TITLE": "Socialt", - "SEARCH_TITLE": "Sök" -} \ No newline at end of file + "SEARCH_TITLE": "Sök", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/th.json b/src/assets/i18n/th.json index d269768..4925847 100644 --- a/src/assets/i18n/th.json +++ b/src/assets/i18n/th.json @@ -1,13 +1,18 @@ { "NAME": "ชื่อ", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "PASSWORD": "รหัสผ่าน", + "REMEMBER_ME": "Remember Me", "EMAIL": "อีเมล์", + "USERNAME": "Username", "LOGIN": "เข้าระบบ", "SIGNUP": "สมัครใช้งาน", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "รายการ", "TAB2_TITLE": "ค้นหา", - "TAB3_TITLE": "ตั้งค่า", + "TAB3_TITLE": "บัญชี", "MAP_TITLE": "แผนที่", @@ -29,12 +34,16 @@ "SETTINGS_PAGE_PROFILE": "แก้ไขข้อมูลส่วนตัว", "WELCOME_TITLE": "ยินดีต้อนรับ", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "การเข้าระบบ", "LOGIN_ERROR": "เข้าระบบไม่ได้. ตรวจสอบข้อมูลที่กรอกแล้วกรุณาลองใหม่", "LOGIN_BUTTON": "เข้าระบบ", "SIGNUP_TITLE": "สมัครใช้งาน", "SIGNUP_ERROR": "ไม่สามารถสร้างผู้ใช้ใหม่ กรุณาตรวจสอบข้อมูลที่กรอกแล้วลองใหม่", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "สมัคร", "LIST_MASTER_TITLE": "รายการ", @@ -43,5 +52,6 @@ "CARDS_TITLE": "โซเชียลเน็ตเวิร์ค", - "SEARCH_TITLE": "ค้นหา" -} \ No newline at end of file + "SEARCH_TITLE": "ค้นหา", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/tr.json b/src/assets/i18n/tr.json index 395830b..29f2800 100644 --- a/src/assets/i18n/tr.json +++ b/src/assets/i18n/tr.json @@ -2,13 +2,18 @@ "BACK_BUTTON_TEXT": "Geri", "NAME": "İsim", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "PASSWORD": "Şifre", + "REMEMBER_ME": "Remember Me", "EMAIL": "Email", + "USERNAME": "Username", "LOGIN": "Giriş yap", "SIGNUP": "Kayıt ol", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Öğeler", "TAB2_TITLE": "Arama", - "TAB3_TITLE": "Ayarlar", + "TAB3_TITLE": "Hesap", "MAP_TITLE": "Harita", "TUTORIAL_SLIDE1_TITLE": "Ionic Super Starter'a Hoşgeldin", "TUTORIAL_SLIDE1_DESCRIPTION": "Ionic Super Starter hazırlanmış sayfalar ve çok iyi örneklerle tam donanımlı bir başlangıç paketidir.", @@ -23,15 +28,20 @@ "SETTINGS_OPTION4": "Seçenek 4", "SETTINGS_PAGE_PROFILE": "Profilini Düzenle", "WELCOME_TITLE": "Hoşgeldiniz", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Giriş yap", "LOGIN_ERROR": "Giriş yapılamadı. Lütfen hesap bilgilerinizi kontrol edip tekrar deneyin.", "LOGIN_BUTTON": "Giriş yap", "SIGNUP_TITLE": "Kayıt ol", "SIGNUP_ERROR": "Hesap oluşturulamadı. Lütfen hesap bilgilerinizi kontrol edip tekrar deneyin.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Kayıt ol", "LIST_MASTER_TITLE": "Öğeler", "ITEM_CREATE_TITLE": "Yeni Öğe", "ITEM_CREATE_CHOOSE_IMAGE": "Yeni Görsel", "CARDS_TITLE": "Sosyal", - "SEARCH_TITLE": "Arama" -} \ No newline at end of file + "SEARCH_TITLE": "Arama", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/i18n/ua.json b/src/assets/i18n/ua.json index 7b779f8..b175e58 100644 --- a/src/assets/i18n/ua.json +++ b/src/assets/i18n/ua.json @@ -1,13 +1,18 @@ { "NAME": "Ім'я", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", "PASSWORD": "Пароль", + "REMEMBER_ME": "Remember Me", "EMAIL": "Email", + "USERNAME": "Username", "LOGIN": "Вхід", "SIGNUP": "Реєстрація", + "NO_ACCOUNT_MESSAGE": "Don't have an account yet?", "TAB1_TITLE": "Список", "TAB2_TITLE": "Пошук", - "TAB3_TITLE": "Налаштування", + "TAB3_TITLE": "Профіль", "MAP_TITLE": "Мапа", @@ -29,12 +34,16 @@ "SETTINGS_PAGE_PROFILE": "Редагування профілю", "WELCOME_TITLE": "Ласкаво просимо", + "LOGOUT_TITLE": "Logout", "LOGIN_TITLE": "Вхід", "LOGIN_ERROR": "Неможливо увійти. Будь ласка перевірте інформацію Вашого облікового запису та спробуйте увійти ще раз.", "LOGIN_BUTTON": "Увійти", "SIGNUP_TITLE": "Реєстрація", "SIGNUP_ERROR": "Неможливо створити обліковий запис. Будь ласка перевірте інформацію Вашого облікового запису та спробуйте ще раз.", + "SIGNUP_SUCCESS": "Registration saved! Please check your email for confirmation.", + "EXISTING_USER_ERROR": "Email is already in use! Please choose another one.", + "INVALID_PASSWORD_ERROR": "Invalid password, please try again.", "SIGNUP_BUTTON": "Зареєструвати", "LIST_MASTER_TITLE": "Список", @@ -44,5 +53,6 @@ "CARDS_TITLE": "Соціальний", - "SEARCH_TITLE": "Пошук" -} \ No newline at end of file + "SEARCH_TITLE": "Пошук", + "EMPTY_ENTITIES_MESSAGE": "You haven't generated entities yet. Run `yo jhipster-ionic:entity `" +} diff --git a/src/assets/icon/favicon.ico b/src/assets/icon/favicon.ico deleted file mode 100644 index d76fa29..0000000 Binary files a/src/assets/icon/favicon.ico and /dev/null differ diff --git a/src/assets/icon/favicon.png b/src/assets/icon/favicon.png new file mode 100644 index 0000000..51888a7 Binary files /dev/null and b/src/assets/icon/favicon.png differ diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts new file mode 100644 index 0000000..a27e32d --- /dev/null +++ b/src/environments/environment.prod.ts @@ -0,0 +1,4 @@ +export const environment = { + production: true, + apiUrl: 'http://localhost:8080/api' +}; diff --git a/src/environments/environment.ts b/src/environments/environment.ts new file mode 100644 index 0000000..af83cfb --- /dev/null +++ b/src/environments/environment.ts @@ -0,0 +1,17 @@ +// This file can be replaced during build by using the `fileReplacements` array. +// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. +// The list of file replacements can be found in `angular.json`. + +export const environment = { + production: false, + apiUrl: 'http://localhost:8080/api' +}; + +/* + * For easier debugging in development mode, you can import the following file + * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. + * + * This import should be commented out in production mode because it will have a negative impact + * on performance if an error is thrown. + */ +// import 'zone.js/dist/zone-error'; // Included with Angular CLI. diff --git a/src/model/account.model.ts b/src/model/account.model.ts new file mode 100644 index 0000000..4d2c833 --- /dev/null +++ b/src/model/account.model.ts @@ -0,0 +1,12 @@ +export class Account { + constructor( + public activated: boolean, + public authorities: string[], + public email: string, + public firstName: string, + public langKey: string, + public lastName: string, + public login: string, + public imageUrl: string + ) {} +} diff --git a/src/models/account.model.ts b/src/models/account.model.ts deleted file mode 100644 index c8b9750..0000000 --- a/src/models/account.model.ts +++ /dev/null @@ -1,12 +0,0 @@ -export class Account { - constructor( - public activated: boolean, - public authorities: string[], - public email: string, - public firstName: string, - public langKey: string, - public lastName: string, - public login: string, - public imageUrl: string - ) { } -} diff --git a/src/models/base-entity.ts b/src/models/base-entity.ts deleted file mode 100644 index 04cf71a..0000000 --- a/src/models/base-entity.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface BaseEntity { - // using type any to avoid methods complaining of invalid type - id?: any; -}; \ No newline at end of file diff --git a/src/models/index.ts b/src/models/index.ts deleted file mode 100644 index 0118a2b..0000000 --- a/src/models/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './base-entity'; -export * from './account.model'; -export * from './user.model'; \ No newline at end of file diff --git a/src/models/user.model.ts b/src/models/user.model.ts deleted file mode 100644 index ce76a51..0000000 --- a/src/models/user.model.ts +++ /dev/null @@ -1,45 +0,0 @@ -export class User { - public id?: any; - public login?: string; - public firstName?: string; - public lastName?: string; - public email?: string; - public activated?: Boolean; - public langKey?: string; - public authorities?: any[]; - public createdBy?: string; - public createdDate?: Date; - public lastModifiedBy?: string; - public lastModifiedDate?: Date; - public password?: string; - - constructor( - id?: any, - login?: string, - firstName?: string, - lastName?: string, - email?: string, - activated?: Boolean, - langKey?: string, - authorities?: any[], - createdBy?: string, - createdDate?: Date, - lastModifiedBy?: string, - lastModifiedDate?: Date, - password?: string - ) { - this.id = id ? id : null; - this.login = login ? login : null; - this.firstName = firstName ? firstName : null; - this.lastName = lastName ? lastName : null; - this.email = email ? email : null; - this.activated = activated ? activated : false; - this.langKey = langKey ? langKey : null; - this.authorities = authorities ? authorities : null; - this.createdBy = createdBy ? createdBy : null; - this.createdDate = createdDate ? createdDate : null; - this.lastModifiedBy = lastModifiedBy ? lastModifiedBy : null; - this.lastModifiedDate = lastModifiedDate ? lastModifiedDate : null; - this.password = password ? password : null; - } -} diff --git a/src/pages/README.md b/src/pages/README.md deleted file mode 100644 index 08b9d23..0000000 --- a/src/pages/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Pages - -Each page type available has a corresponding README, take a look by navigating to a page directory above. diff --git a/src/pages/entities/entity.html b/src/pages/entities/entity.html deleted file mode 100644 index b20f8f3..0000000 --- a/src/pages/entities/entity.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - Entities - - - - - - - -

{{entity.name}}

-
-
-
diff --git a/src/pages/entities/entity.module.ts b/src/pages/entities/entity.module.ts deleted file mode 100644 index ba2a181..0000000 --- a/src/pages/entities/entity.module.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; -import { TranslateModule } from '@ngx-translate/core'; -import { IonicPageModule } from 'ionic-angular'; -import { EntityPage } from './entity'; -import { NgJhipsterModule } from 'ng-jhipster'; - -@NgModule({ - declarations: [ - EntityPage - /* jhipster-needle-add-entity-module - JHipster will add entity modules here */ - ], - imports: [ - IonicPageModule.forChild(EntityPage), - TranslateModule.forChild(), - NgJhipsterModule.forRoot({ - alertAsToast: true, - i18nEnabled: false - }) - ], - exports: [EntityPage], - schemas: [CUSTOM_ELEMENTS_SCHEMA] -}) -export class EntityPageModule { -} diff --git a/src/pages/entities/entity.ts b/src/pages/entities/entity.ts deleted file mode 100644 index 1420679..0000000 --- a/src/pages/entities/entity.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { Component } from '@angular/core'; -import { IonicPage, NavController } from 'ionic-angular'; - -@IonicPage({ - defaultHistory: ['HomePage'] -}) -@Component({ - selector: 'page-entity', - templateUrl: 'entity.html' -}) -export class EntityPage { - - entities: Array = [ - /* jhipster-needle-add-entity-page - JHipster will add entity pages here */ - ]; - - constructor(public nav: NavController) { } - - openPage(page) { - // Reset the content nav to have just this page - // we wouldn't want the back button to show in this scenario - this.nav.push(page.component); - } - - ionViewWillLoad() { - let page = location.hash.substring(location.hash.lastIndexOf('/') + 1); - let urlParts = location.hash.split('/'); - page = page.charAt(0).toUpperCase() + page.substring(1) + 'Page'; - let destination; - this.entities.forEach(entity => { - if (entity.component === page) { - destination = entity.component; - } - }); - if (destination) { - this.nav.push(destination); - } else if (urlParts.length === 5) { - // convert from URL to page name: foo-detail to FooDetailPage - const detailPage = this.urlToTitleCase(urlParts[3]) + 'Page'; - this.nav.push(detailPage, {id: urlParts[4]}) - } - } - - private urlToTitleCase(str) { - return str.replace(/(-|^)([^-]?)/g, (_, prep, letter) => { - return (prep && '') + letter.toUpperCase(); - }); - } -} diff --git a/src/pages/home/home.html b/src/pages/home/home.html deleted file mode 100644 index 21e5abb..0000000 --- a/src/pages/home/home.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - Welcome, {{account?.firstName}}! - - - - - - - - -

{{ 'WELCOME_INTRO' | translate }}

- - -
diff --git a/src/pages/home/home.module.ts b/src/pages/home/home.module.ts deleted file mode 100644 index 275297d..0000000 --- a/src/pages/home/home.module.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { NgModule } from '@angular/core'; -import { TranslateModule } from '@ngx-translate/core'; -import { IonicPageModule } from 'ionic-angular'; - -import { HomePage } from './home'; - -@NgModule({ - declarations: [ - HomePage - ], - imports: [ - IonicPageModule.forChild(HomePage), - TranslateModule.forChild() - ], - exports: [ - HomePage - ] -}) -export class HomePageModule { } diff --git a/src/pages/home/home.scss b/src/pages/home/home.scss deleted file mode 100644 index d4cc8fc..0000000 --- a/src/pages/home/home.scss +++ /dev/null @@ -1,3 +0,0 @@ -page-home { - -} diff --git a/src/pages/home/home.ts b/src/pages/home/home.ts deleted file mode 100644 index 579b311..0000000 --- a/src/pages/home/home.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { App, IonicPage, NavController } from 'ionic-angular'; -import { Principal } from '../../providers/auth/principal.service'; -import { FirstRunPage } from '../pages'; -import { LoginService } from '../../providers/login/login.service'; - -@IonicPage() -@Component({ - selector: 'page-home', - templateUrl: 'home.html' -}) -export class HomePage implements OnInit { - account: Account; - - constructor(public navCtrl: NavController, - private principal: Principal, - private app: App, - private loginService: LoginService) { } - - ngOnInit() { - this.principal.identity().then((account) => { - if (account === null) { - this.app.getRootNavs()[0].setRoot(FirstRunPage); - } else { - this.account = account; - } - }); - } - - isAuthenticated() { - return this.principal.isAuthenticated(); - } - - logout() { - this.loginService.logout(); - this.app.getRootNavs()[0].setRoot(FirstRunPage); - } -} diff --git a/src/pages/login/README.md b/src/pages/login/README.md deleted file mode 100644 index 1d6b13d..0000000 --- a/src/pages/login/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Login - -The Login page renders a login form with email/password by default and a remember me checkbox. diff --git a/src/pages/login/login.module.ts b/src/pages/login/login.module.ts deleted file mode 100644 index 5f60452..0000000 --- a/src/pages/login/login.module.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { NgModule } from '@angular/core'; -import { TranslateModule } from '@ngx-translate/core'; -import { IonicPageModule } from 'ionic-angular'; - -import { LoginPage } from './login'; - -@NgModule({ - declarations: [ - LoginPage, - ], - imports: [ - IonicPageModule.forChild(LoginPage), - TranslateModule.forChild() - ], - exports: [ - LoginPage - ] -}) -export class LoginPageModule { } diff --git a/src/pages/login/login.scss b/src/pages/login/login.scss deleted file mode 100644 index ea9d5c1..0000000 --- a/src/pages/login/login.scss +++ /dev/null @@ -1,2 +0,0 @@ -page-login { -} diff --git a/src/pages/login/login.ts b/src/pages/login/login.ts deleted file mode 100644 index 0e4efe8..0000000 --- a/src/pages/login/login.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { Component } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { IonicPage, NavController, ToastController } from 'ionic-angular'; -import { MainPage } from '../pages'; -import { LoginService } from '../../providers/login/login.service'; - -@IonicPage() -@Component({ - selector: 'page-login', - templateUrl: 'login.html' -}) -export class LoginPage { - // The account fields for the login form. - account: { username: string, password: string, rememberMe: boolean } = { - username: '', - password: '', - rememberMe: false, - }; - - // Our translated text strings - private loginErrorString: string; - - constructor(public navCtrl: NavController, - public loginService: LoginService, - public toastCtrl: ToastController, - public translateService: TranslateService) { - - this.translateService.get('LOGIN_ERROR').subscribe((value) => { - this.loginErrorString = value; - }) - } - - // Attempt to login in through our User service - doLogin() { - this.loginService.login(this.account).then((response) => { - this.navCtrl.push(MainPage); - }, (err) => { - // Unable to log in - this.account.password = ''; - let toast = this.toastCtrl.create({ - message: this.loginErrorString, - duration: 3000, - position: 'top' - }); - toast.present(); - }); - } -} diff --git a/src/pages/menu/README.md b/src/pages/menu/README.md deleted file mode 100644 index f61754e..0000000 --- a/src/pages/menu/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Menu - -The Menu page renders a side menu UI. diff --git a/src/pages/menu/menu.html b/src/pages/menu/menu.html deleted file mode 100644 index 57a3ea9..0000000 --- a/src/pages/menu/menu.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/src/pages/menu/menu.module.ts b/src/pages/menu/menu.module.ts deleted file mode 100644 index 004c82f..0000000 --- a/src/pages/menu/menu.module.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { NgModule } from '@angular/core'; -import { TranslateModule } from '@ngx-translate/core'; -import { IonicPageModule } from 'ionic-angular'; - -import { MenuPage } from './menu'; - -@NgModule({ - declarations: [ - MenuPage, - ], - imports: [ - IonicPageModule.forChild(MenuPage), - TranslateModule.forChild() - ], - exports: [ - MenuPage - ] -}) -export class MenuPageModule { } diff --git a/src/pages/menu/menu.scss b/src/pages/menu/menu.scss deleted file mode 100644 index 1a07e9a..0000000 --- a/src/pages/menu/menu.scss +++ /dev/null @@ -1,3 +0,0 @@ -page-menu { - -} diff --git a/src/pages/menu/menu.ts b/src/pages/menu/menu.ts deleted file mode 100644 index 2439c68..0000000 --- a/src/pages/menu/menu.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Component, ViewChild } from '@angular/core'; -import { IonicPage, Nav, NavController } from 'ionic-angular'; - -@IonicPage() -@Component({ - selector: 'page-menu', - templateUrl: 'menu.html' -}) -export class MenuPage { - // A reference to the ion-nav in our component - @ViewChild(Nav) nav: Nav; - - rootPage: any = 'ContentPage'; - - pages: Array<{ title: string, component: any }>; - - constructor(public navCtrl: NavController) { - // used for an example of ngFor and navigation - this.pages = [ - { title: 'Sign in', component: 'LoginPage' }, - { title: 'Signup', component: 'SignupPage' } - ]; - } - - ionViewDidLoad() { - console.log('Hello MenuPage Page'); - } - - openPage(page) { - // Reset the content nav to have just this page - // we wouldn't want the back button to show in this scenario - this.nav.setRoot(page.component); - } -} diff --git a/src/pages/pages.ts b/src/pages/pages.ts deleted file mode 100644 index 6690d2a..0000000 --- a/src/pages/pages.ts +++ /dev/null @@ -1,11 +0,0 @@ -// The page the user lands on after opening the app and without a session -export const FirstRunPage = 'WelcomePage'; - -// The main page the user will see as they use the app over a long period of time. -// Change this if not using tabs -export const MainPage = 'TabsPage'; - -// The initial root pages for our tabs (remove if not using tabs) -export const Tab1Root = 'HomePage'; -export const Tab2Root = 'EntityPage'; -export const Tab3Root = 'SettingsPage'; diff --git a/src/pages/settings/README.md b/src/pages/settings/README.md deleted file mode 100644 index 55515fa..0000000 --- a/src/pages/settings/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Settings - -The Settings page shows a settings form that is configurable, along with features for nested options where the user navigates to sub options while still using the same Settings page code. diff --git a/src/pages/settings/settings.html b/src/pages/settings/settings.html deleted file mode 100644 index a8089de..0000000 --- a/src/pages/settings/settings.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - {{ pageTitle }} - - - - - - -
- - - {{ 'SETTINGS_OPTION1' | translate }} - - - - - {{ 'SETTINGS_OPTION2' | translate }} - - - - - {{ 'SETTINGS_OPTION3' | translate }} - - 1 - 2 - 3 - - - - - - - - - {{ 'SETTINGS_OPTION4' | translate }} - - - -
- -
\ No newline at end of file diff --git a/src/pages/settings/settings.module.ts b/src/pages/settings/settings.module.ts deleted file mode 100644 index a0f55e5..0000000 --- a/src/pages/settings/settings.module.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { NgModule } from '@angular/core'; -import { TranslateModule } from '@ngx-translate/core'; -import { IonicPageModule } from 'ionic-angular'; - -import { SettingsPage } from './settings'; - -@NgModule({ - declarations: [ - SettingsPage, - ], - imports: [ - IonicPageModule.forChild(SettingsPage), - TranslateModule.forChild() - ], - exports: [ - SettingsPage - ] -}) -export class SettingsPageModule { } diff --git a/src/pages/settings/settings.scss b/src/pages/settings/settings.scss deleted file mode 100644 index ee78e1c..0000000 --- a/src/pages/settings/settings.scss +++ /dev/null @@ -1,3 +0,0 @@ -page-settings { - -} diff --git a/src/pages/settings/settings.ts b/src/pages/settings/settings.ts deleted file mode 100644 index 283e0c4..0000000 --- a/src/pages/settings/settings.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { Component } from '@angular/core'; -import { FormBuilder, FormGroup } from '@angular/forms'; -import { TranslateService } from '@ngx-translate/core'; -import { IonicPage, NavController, NavParams } from 'ionic-angular'; - -import { Settings } from '../../providers/providers'; - -/** - * The Settings page is a simple form that syncs with a Settings provider - * to enable the user to customize settings for the app. - * - */ -@IonicPage() -@Component({ - selector: 'page-settings', - templateUrl: 'settings.html' -}) -export class SettingsPage { - // Our local settings object - options: any; - - settingsReady = false; - - form: FormGroup; - - profileSettings = { - page: 'profile', - pageTitleKey: 'SETTINGS_PAGE_PROFILE' - }; - - page: string = 'main'; - pageTitleKey: string = 'SETTINGS_TITLE'; - pageTitle: string; - - subSettings: any = SettingsPage; - - constructor(public navCtrl: NavController, - public settings: Settings, - public formBuilder: FormBuilder, - public navParams: NavParams, - public translate: TranslateService) { - } - - _buildForm() { - let group: any = { - option1: [this.options.option1], - option2: [this.options.option2], - option3: [this.options.option3] - }; - - switch (this.page) { - case 'main': - break; - case 'profile': - group = { - option4: [this.options.option4] - }; - break; - } - this.form = this.formBuilder.group(group); - - // Watch the form for changes, and - this.form.valueChanges.subscribe((v) => { - this.settings.merge(this.form.value); - }); - } - - ionViewDidLoad() { - // Build an empty form for the template to render - this.form = this.formBuilder.group({}); - } - - ionViewWillEnter() { - // Build an empty form for the template to render - this.form = this.formBuilder.group({}); - - this.page = this.navParams.get('page') || this.page; - this.pageTitleKey = this.navParams.get('pageTitleKey') || this.pageTitleKey; - - this.translate.get(this.pageTitleKey).subscribe((res) => { - this.pageTitle = res; - }) - - this.settings.load().then(() => { - this.settingsReady = true; - this.options = this.settings.allSettings; - - this._buildForm(); - }); - } - - ngOnChanges() { - console.log('Ng All Changes'); - } -} diff --git a/src/pages/signup/README.md b/src/pages/signup/README.md deleted file mode 100644 index d58dead..0000000 --- a/src/pages/signup/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Signup - -The Signup page renders a signup form with email/password by default and an optional username field. diff --git a/src/pages/signup/signup.html b/src/pages/signup/signup.html deleted file mode 100644 index 7825090..0000000 --- a/src/pages/signup/signup.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - {{ 'SIGNUP_TITLE' | translate }} - - - - - - -
- - - - {{ 'FIRST_NAME' | translate }} - - - - - {{ 'LAST_NAME' | translate }} - - - - - {{ 'EMAIL' | translate }} - - - - - {{ 'PASSWORD' | translate }} - - - -
- -
- -
-
-
\ No newline at end of file diff --git a/src/pages/signup/signup.module.ts b/src/pages/signup/signup.module.ts deleted file mode 100644 index a29dd6a..0000000 --- a/src/pages/signup/signup.module.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { NgModule } from '@angular/core'; -import { TranslateModule } from '@ngx-translate/core'; -import { IonicPageModule } from 'ionic-angular'; - -import { SignupPage } from './signup'; - -@NgModule({ - declarations: [ - SignupPage, - ], - imports: [ - IonicPageModule.forChild(SignupPage), - TranslateModule.forChild() - ], - exports: [ - SignupPage - ] -}) -export class SignupPageModule { } diff --git a/src/pages/signup/signup.scss b/src/pages/signup/signup.scss deleted file mode 100644 index bcff1ff..0000000 --- a/src/pages/signup/signup.scss +++ /dev/null @@ -1,3 +0,0 @@ -page-signup { - -} diff --git a/src/pages/signup/signup.ts b/src/pages/signup/signup.ts deleted file mode 100644 index fe9a34a..0000000 --- a/src/pages/signup/signup.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { Component } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { IonicPage, NavController, ToastController } from 'ionic-angular'; - -import { User } from '../../providers/providers'; -import { MainPage } from '../pages'; - -@IonicPage() -@Component({ - selector: 'page-signup', - templateUrl: 'signup.html' -}) -export class SignupPage { - // The account fields for the signup form - account: { login: string, email: string, firstName: string, lastName: string, password: string, langKey: string } = { - login: '', - email: '', - firstName: '', - lastName: '', - password: '', - langKey: 'en' - }; - - // Our translated text strings - private signupErrorString: string; - private signupSuccessString: string; - private existingUserError: string; - private invalidPasswordError: string; - - constructor(public navCtrl: NavController, - public user: User, - public toastCtrl: ToastController, - public translateService: TranslateService) { - - this.translateService.get(['SIGNUP_ERROR', 'SIGNUP_SUCCESS', - 'EXISTING_USER_ERROR', 'INVALID_PASSWORD_ERROR']).subscribe((values) => { - this.signupErrorString = values.SIGNUP_ERROR; - this.signupSuccessString = values.SIGNUP_SUCCESS; - this.existingUserError = values.EXISTING_USER_ERROR; - this.invalidPasswordError = values.INVALID_PASSWORD_ERROR; - }) - } - - doSignup() { - // set login to same as email - this.account.login = this.account.email; - // Attempt to login in through our User service - this.user.signup(this.account).subscribe(() => { - let toast = this.toastCtrl.create({ - message: this.signupSuccessString, - duration: 3000, - position: 'top' - }); - toast.present(); - this.navCtrl.push(MainPage); - }, (response) => { - // Unable to sign up - const error = JSON.parse(response.error); - let displayError = this.signupErrorString; - if (response.status === 400 && error.type.includes('already-used')) { - displayError = this.existingUserError; - } else if (response.status === 400 && error.message === 'error.validation' - && error.fieldErrors[0].field === 'password' && error.fieldErrors[0].message === 'Size') { - displayError = this.invalidPasswordError; - } - let toast = this.toastCtrl.create({ - message: displayError, - duration: 3000, - position: 'middle' - }); - toast.present(); - }); - } -} diff --git a/src/pages/tabs/README.md b/src/pages/tabs/README.md deleted file mode 100644 index 2774ec6..0000000 --- a/src/pages/tabs/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Tabs - -Tabs is a common tabbed layout. diff --git a/src/pages/tabs/tabs.html b/src/pages/tabs/tabs.html deleted file mode 100644 index a83f1f6..0000000 --- a/src/pages/tabs/tabs.html +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/pages/tabs/tabs.module.ts b/src/pages/tabs/tabs.module.ts deleted file mode 100644 index 6a26e67..0000000 --- a/src/pages/tabs/tabs.module.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { NgModule } from '@angular/core'; -import { TranslateModule } from '@ngx-translate/core'; -import { IonicPageModule } from 'ionic-angular'; - -import { TabsPage } from './tabs'; - -@NgModule({ - declarations: [ - TabsPage, - ], - imports: [ - IonicPageModule.forChild(TabsPage), - TranslateModule.forChild() - ], - exports: [ - TabsPage - ] -}) -export class TabsPageModule { } diff --git a/src/pages/tabs/tabs.scss b/src/pages/tabs/tabs.scss deleted file mode 100644 index 1e4454e..0000000 --- a/src/pages/tabs/tabs.scss +++ /dev/null @@ -1,3 +0,0 @@ -page-tabs { - -} diff --git a/src/pages/tabs/tabs.ts b/src/pages/tabs/tabs.ts deleted file mode 100644 index 63755f4..0000000 --- a/src/pages/tabs/tabs.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Component } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { IonicPage, NavController } from 'ionic-angular'; - -import { Tab1Root } from '../pages'; -import { Tab2Root } from '../pages'; -import { Tab3Root } from '../pages'; - -@IonicPage({ priority: 'high', segment: 'tabs' }) -@Component({ - selector: 'page-tabs', - templateUrl: 'tabs.html' -}) -export class TabsPage { - tab1Root: any = Tab1Root; - tab2Root: any = Tab2Root; - tab3Root: any = Tab3Root; - - tab1Title = " "; - tab2Title = " "; - tab3Title = " "; - - constructor(public navCtrl: NavController, public translateService: TranslateService) { - translateService.get(['TAB1_TITLE', 'TAB2_TITLE', 'TAB3_TITLE']).subscribe(values => { - this.tab1Title = values['TAB1_TITLE']; - this.tab2Title = values['TAB2_TITLE']; - this.tab3Title = values['TAB3_TITLE']; - }); - } - - getSelectedIndex() { - let page = location.hash.substring(location.hash.lastIndexOf('/') + 1); - page = page.charAt(0).toUpperCase() + page.substring(1) + 'Page'; - const tabs = [this.tab1Root, this.tab2Root, this.tab3Root]; - const index = tabs.indexOf(page); - const entitiesTab = tabs.indexOf(this.tab2Root); - if (location.hash.includes('entities')) { - return entitiesTab; - } else if (index > -1) { - return index; - } - } -} diff --git a/src/pages/tutorial/README.md b/src/pages/tutorial/README.md deleted file mode 100644 index 4c356bf..0000000 --- a/src/pages/tutorial/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Tutorial - -The Tutorial page renders a Slides component that lets you swipe through different sections or skip it alltogether. diff --git a/src/pages/tutorial/tutorial.html b/src/pages/tutorial/tutorial.html deleted file mode 100644 index 8008820..0000000 --- a/src/pages/tutorial/tutorial.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - -

-

-
- - -

{{ 'TUTORIAL_SLIDE4_TITLE' | translate }}

- -
-
-
diff --git a/src/pages/tutorial/tutorial.module.ts b/src/pages/tutorial/tutorial.module.ts deleted file mode 100644 index 1c2bebc..0000000 --- a/src/pages/tutorial/tutorial.module.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { NgModule } from '@angular/core'; -import { IonicPageModule } from 'ionic-angular'; -import { TutorialPage } from './tutorial'; -import { TranslateModule } from '@ngx-translate/core'; - -@NgModule({ - declarations: [ - TutorialPage, - ], - imports: [ - IonicPageModule.forChild(TutorialPage), - TranslateModule.forChild() - ], - exports: [ - TutorialPage - ] -}) -export class TutorialPageModule { } diff --git a/src/pages/tutorial/tutorial.scss b/src/pages/tutorial/tutorial.scss deleted file mode 100644 index d8b3c61..0000000 --- a/src/pages/tutorial/tutorial.scss +++ /dev/null @@ -1,36 +0,0 @@ -page-tutorial { - .toolbar-background { - background: transparent; - border-color: transparent; - } - - .slide-zoom { - height: 100%; - } - - .slide-title { - margin-top: 2.8rem; - } - - .slide-image { - max-height: 40%; - max-width: 60%; - margin: 36px 0; - } - - b { - font-weight: 500; - } - - p { - padding: 0 40px; - font-size: 14px; - line-height: 1.5; - color: #60646B; - - b { - color: #000000; - } - } - -} diff --git a/src/pages/tutorial/tutorial.ts b/src/pages/tutorial/tutorial.ts deleted file mode 100644 index 6dcbe73..0000000 --- a/src/pages/tutorial/tutorial.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { Component } from '@angular/core'; -import { IonicPage, MenuController, NavController, Platform } from 'ionic-angular'; - -import { TranslateService } from '@ngx-translate/core'; - -export interface Slide { - title: string; - description: string; - image: string; -} - -@IonicPage() -@Component({ - selector: 'page-tutorial', - templateUrl: 'tutorial.html' -}) -export class TutorialPage { - slides: Slide[]; - showSkip = true; - dir: string = 'ltr'; - - constructor(public navCtrl: NavController, public menu: MenuController, translate: TranslateService, public platform: Platform) { - this.dir = platform.dir(); - translate.get(["TUTORIAL_SLIDE1_TITLE", - "TUTORIAL_SLIDE1_DESCRIPTION", - "TUTORIAL_SLIDE2_TITLE", - "TUTORIAL_SLIDE2_DESCRIPTION", - "TUTORIAL_SLIDE3_TITLE", - "TUTORIAL_SLIDE3_DESCRIPTION", - ]).subscribe( - (values) => { - console.log('Loaded values', values); - this.slides = [ - { - title: values.TUTORIAL_SLIDE1_TITLE, - description: values.TUTORIAL_SLIDE1_DESCRIPTION, - image: 'assets/img/ica-slidebox-img-1.png', - }, - { - title: values.TUTORIAL_SLIDE2_TITLE, - description: values.TUTORIAL_SLIDE2_DESCRIPTION, - image: 'assets/img/ica-slidebox-img-2.png', - }, - { - title: values.TUTORIAL_SLIDE3_TITLE, - description: values.TUTORIAL_SLIDE3_DESCRIPTION, - image: 'assets/img/ica-slidebox-img-3.png', - } - ]; - }); - } - - startApp() { - this.navCtrl.setRoot('WelcomePage', {}, { - animate: true, - direction: 'forward' - }); - } - - onSlideChangeStart(slider) { - this.showSkip = !slider.isEnd(); - } - - ionViewDidEnter() { - // the root left menu should be disabled on the tutorial page - this.menu.enable(false); - } - - ionViewWillLeave() { - // enable the root left menu when leaving the tutorial page - this.menu.enable(true); - } - -} diff --git a/src/pages/welcome/README.md b/src/pages/welcome/README.md deleted file mode 100644 index 08e3ba5..0000000 --- a/src/pages/welcome/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Welcome - -Welcome is a splash screen that displays some info about the app and directs the user to log in our create an account. diff --git a/src/pages/welcome/welcome.html b/src/pages/welcome/welcome.html deleted file mode 100644 index 9253fa9..0000000 --- a/src/pages/welcome/welcome.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - Welcome, Java Hipster! - - - - - - -
- - -

Don't have an account yet?

- - -
-
diff --git a/src/pages/welcome/welcome.module.ts b/src/pages/welcome/welcome.module.ts deleted file mode 100644 index 13dcf60..0000000 --- a/src/pages/welcome/welcome.module.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { NgModule } from '@angular/core'; -import { TranslateModule } from '@ngx-translate/core'; -import { IonicPageModule } from 'ionic-angular'; - -import { WelcomePage } from './welcome'; - -@NgModule({ - declarations: [ - WelcomePage, - ], - imports: [ - IonicPageModule.forChild(WelcomePage), - TranslateModule.forChild() - ], - exports: [ - WelcomePage - ] -}) -export class WelcomePageModule { } diff --git a/src/pages/welcome/welcome.scss b/src/pages/welcome/welcome.scss deleted file mode 100644 index 946b268..0000000 --- a/src/pages/welcome/welcome.scss +++ /dev/null @@ -1,9 +0,0 @@ -page-welcome { - - .hipster { - width: 209px; - height: 300px; - margin: 20px auto; - display: block; - } -} diff --git a/src/pages/welcome/welcome.ts b/src/pages/welcome/welcome.ts deleted file mode 100644 index 5296a2c..0000000 --- a/src/pages/welcome/welcome.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Component } from '@angular/core'; -import { IonicPage, NavController } from 'ionic-angular'; - -/** - * The Welcome Page is a splash page that quickly describes the app, - * and then directs the user to create an account or log in. - * If you'd like to immediately put the user onto a login/signup page, - * we recommend not using the Welcome page. -*/ -@IonicPage() -@Component({ - selector: 'page-welcome', - templateUrl: 'welcome.html' -}) -export class WelcomePage { - - constructor(public navCtrl: NavController) { } - - login() { - this.navCtrl.push('LoginPage'); - } - - signup() { - this.navCtrl.push('SignupPage'); - } -} diff --git a/src/providers/auth/account.service.ts b/src/providers/auth/account.service.ts deleted file mode 100644 index 82c0d9d..0000000 --- a/src/providers/auth/account.service.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs/Rx'; -import { Api } from '../api/api'; -import { HttpClient } from '@angular/common/http'; - -@Injectable() -export class AccountService { - constructor(private http: HttpClient) { } - - get(): Observable { - return this.http.get(Api.API_URL + '/account'); - } - - save(account: any): Observable { - return this.http.post(Api.API_URL + '/account', account); - } -} diff --git a/src/providers/auth/principal.service.ts b/src/providers/auth/principal.service.ts deleted file mode 100644 index 79c4af6..0000000 --- a/src/providers/auth/principal.service.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs/Observable'; -import { Subject } from 'rxjs/Subject'; -import { AccountService } from './account.service'; - -@Injectable() -export class Principal { - private userIdentity: any; - private authenticated = false; - private authenticationState = new Subject(); - - constructor( - private account: AccountService - ) {} - - authenticate(identity) { - this.userIdentity = identity; - this.authenticated = identity !== null; - this.authenticationState.next(this.userIdentity); - } - - hasAnyAuthority(authorities: string[]): Promise { - return Promise.resolve(this.hasAnyAuthorityDirect(authorities)); - } - - hasAnyAuthorityDirect(authorities: string[]): boolean { - if (!this.authenticated || !this.userIdentity || !this.userIdentity.authorities) { - return false; - } - - for (let i = 0; i < authorities.length; i++) { - if (this.userIdentity.authorities.indexOf(authorities[i]) !== -1) { - return true; - } - } - - return false; - } - - hasAuthority(authority: string): Promise { - if (!this.authenticated) { - return Promise.resolve(false); - } - - return this.identity().then((id) => { - return Promise.resolve(id.authorities && id.authorities.indexOf(authority) !== -1); - }, () => { - return Promise.resolve(false); - }); - } - - identity(force?: boolean): Promise { - if (force === true) { - this.userIdentity = undefined; - } - - // check and see if we have retrieved the userIdentity data from the server. - // if we have, reuse it by immediately resolving - if (this.userIdentity) { - return Promise.resolve(this.userIdentity); - } - - // retrieve the userIdentity data from the server, update the identity object, and then resolve. - return this.account.get().toPromise().then((account) => { - if (account) { - this.userIdentity = account; - this.authenticated = true; - } else { - this.userIdentity = null; - this.authenticated = false; - } - this.authenticationState.next(this.userIdentity); - return this.userIdentity; - }).catch((err) => { - this.userIdentity = null; - this.authenticated = false; - this.authenticationState.next(this.userIdentity); - return null; - }); - } - - isAuthenticated(): boolean { - return this.authenticated; - } - - isIdentityResolved(): boolean { - return this.userIdentity !== undefined; - } - - getAuthenticationState(): Observable { - return this.authenticationState.asObservable(); - } - - getImageUrl(): String { - return this.isIdentityResolved() ? this.userIdentity.imageUrl : null; - } -} diff --git a/src/providers/login/login.service.ts b/src/providers/login/login.service.ts deleted file mode 100644 index 6920fb1..0000000 --- a/src/providers/login/login.service.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Injectable } from '@angular/core'; -//import { JhiLanguageService } from 'ng-jhipster'; - -import { Principal } from '../auth/principal.service'; -import { AuthServerProvider } from '../auth/auth-jwt.service'; -import { TranslateService } from '@ngx-translate/core'; - -@Injectable() -export class LoginService { - - constructor( - private principal: Principal, - private authServerProvider: AuthServerProvider, - private translate: TranslateService - ) {} - - login(credentials, callback?) { - const cb = callback || function() {}; - - return new Promise((resolve, reject) => { - this.authServerProvider.login(credentials).subscribe((data) => { - this.principal.identity(true).then((account) => { - // After the login the language will be changed to - // the language selected by the user during his registration - if (account !== null) { - this.translate.use(account.langKey); - } - resolve(data); - }); - return cb(); - }, (err) => { - this.logout(); - reject(err); - return cb(err); - }); - }); - } - - loginWithToken(jwt, rememberMe) { - return this.authServerProvider.loginWithToken(jwt, rememberMe); - } - - logout() { - this.authServerProvider.logout().subscribe(); - this.principal.authenticate(null); - } -} diff --git a/src/providers/providers.ts b/src/providers/providers.ts deleted file mode 100644 index ba2825e..0000000 --- a/src/providers/providers.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Api } from './api/api'; -import { Settings } from './settings/settings'; -import { User } from './user/user'; - -export { - Api, - Settings, - User -}; diff --git a/src/providers/settings/settings.ts b/src/providers/settings/settings.ts deleted file mode 100644 index e70d245..0000000 --- a/src/providers/settings/settings.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Storage } from '@ionic/storage'; - -/** - * A simple settings/config class for storing key/value pairs with persistence. - */ -@Injectable() -export class Settings { - private SETTINGS_KEY: string = '_settings'; - - settings: any; - - _defaults: any; - _readyPromise: Promise; - - constructor(public storage: Storage, defaults: any) { - this._defaults = defaults; - } - - load() { - return this.storage.get(this.SETTINGS_KEY).then((value) => { - if (value) { - this.settings = value; - return this._mergeDefaults(this._defaults); - } else { - return this.setAll(this._defaults).then((val) => { - this.settings = val; - }) - } - }); - } - - _mergeDefaults(defaults: any) { - for (let k in defaults) { - if (!(k in this.settings)) { - this.settings[k] = defaults[k]; - } - } - return this.setAll(this.settings); - } - - merge(settings: any) { - for (let k in settings) { - this.settings[k] = settings[k]; - } - return this.save(); - } - - setValue(key: string, value: any) { - this.settings[key] = value; - return this.storage.set(this.SETTINGS_KEY, this.settings); - } - - setAll(value: any) { - return this.storage.set(this.SETTINGS_KEY, value); - } - - getValue(key: string) { - return this.storage.get(this.SETTINGS_KEY) - .then(settings => { - return settings[key]; - }); - } - - save() { - return this.setAll(this.settings); - } - - get allSettings() { - return this.settings; - } -} diff --git a/src/providers/user/user.ts b/src/providers/user/user.ts deleted file mode 100644 index 7897b21..0000000 --- a/src/providers/user/user.ts +++ /dev/null @@ -1,74 +0,0 @@ -import 'rxjs/add/operator/toPromise'; - -import { Injectable } from '@angular/core'; - -import { Api } from '../api/api'; -import { LoginService } from '../login/login.service'; -import { Observable } from 'rxjs/Observable'; - -/** - * Most apps have the concept of a User. This is a simple provider - * with stubs for login/signup/etc. - * - * This User provider makes calls to our API at the `login` and `signup` endpoints. - * - * By default, it expects `login` and `signup` to return a JSON object of the shape: - * - * ```json - * { - * status: 'success', - * user: { - * // User fields your app needs, like "id", "name", "email", etc. - * } - * }Ø - * ``` - * - * If the `status` field is not `success`, then an error is detected and returned. - */ -@Injectable() -export class User { - _user: any; - - constructor(public api: Api, public loginService: LoginService) { } - - /** - * Send a POST request to our login endpoint with the data - * the user entered on the form. - */ - login(accountInfo: any) { - this.loginService.login(accountInfo).then((res) => { - this._loggedIn(res); - return Observable.of(res); - }).catch((err) => { - console.error('ERROR', err); - return Observable.throw(err); - }); - } - - findAll(): Observable { - return this.api.get('users'); - } - - /** - * Send a POST request to our signup endpoint with the data - * the user entered on the form. - */ - signup(accountInfo: any) { - return this.api.post('register', accountInfo, { responseType: 'text' as 'text' }).share(); - } - - /** - * Log the user out, which forgets the session - */ - logout() { - this.loginService.logout(); - this._user = null; - } - - /** - * Process a login/signup response to store user data - */ - _loggedIn(resp) { - this._user = resp.user; - } -} diff --git a/src/tsconfig.spec.json b/src/tsconfig.spec.json deleted file mode 100644 index 547c3ce..0000000 --- a/src/tsconfig.spec.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "../out-tsc/spec", - "module": "commonjs", - "target": "es5", - "allowJs": true - }, - "include": [ - "**/*.spec.ts" - ], - "exclude": [ - "**/*e2e-spec.ts" - ] -} \ No newline at end of file diff --git a/welcome.message.js b/welcome.message.js index 9b909bb..48bd07a 100644 --- a/welcome.message.js +++ b/welcome.message.js @@ -3,9 +3,9 @@ const chalk = require('chalk'); const msg = ` Welcome to the ${chalk.blue.bold('Ionic')} ${chalk.green.bold('J')}${chalk.red.bold('Hipster')} Starter! -The Ionic JHipster Starter ships with login and signup that will work with a JHipster backend (with JWT Authentication). +The Ionic JHipster Starter ships with login and signup that will work with a JHipster backend (with JWT Authentication). -For more details, please see the project's README: ${chalk.bold('https://github.com/oktadeveloper/ionic-jhipster-starter/blob/master/README.md')} +For more details, please see the project's README: ${chalk.bold('https://github.com/fleboulch/ionic-jhipster-starter/blob/master/README.md')} `.trim() console.log(msg);