diff --git a/src/app/account/register.component.ts b/src/app/account/register.component.ts index a2f1f16..0e6e9c2 100644 --- a/src/app/account/register.component.ts +++ b/src/app/account/register.component.ts @@ -1,5 +1,6 @@ import { Inject, Input, Component, Output, EventEmitter, provide } from 'ng-forward'; -import {RegisterService} from "./../../lib/ng-noosfero-api/http/register.service"; +import { RegisterService } from "./../../lib/ng-noosfero-api/http/register.service"; +import { NotificationService } from "./../shared/services/notification.service"; @Component({ selector: 'noosfero-register', @@ -9,11 +10,11 @@ import {RegisterService} from "./../../lib/ng-noosfero-api/http/register.service ] }) -@Inject("$state", RegisterService) +@Inject("$state", RegisterService, NotificationService) export class RegisterComponent { @Input() account: any; - constructor(private $state: ng.ui.IStateService, public registerService: RegisterService) { + constructor(private $state: ng.ui.IStateService, public registerService: RegisterService, private notificationService: NotificationService) { this.account = {}; } @@ -22,13 +23,13 @@ export class RegisterComponent { this.registerService.createAccount(this.account).then((response) => { if (response.status === 201) { this.$state.transitionTo('main.environment'); + this.notificationService.success({ title: "account.register.success.title", message: "account.register.success.message" }); } else { throw new Error('Invalid attributes'); } }); } else { - alert("Wrong password confirmation."); + this.notificationService.error({ message: "account.register.passwordConfirmation.failed" }); } } - } diff --git a/src/app/login/login.html b/src/app/login/login.html index a4ca688..51cced5 100644 --- a/src/app/login/login.html +++ b/src/app/login/login.html @@ -21,4 +21,7 @@ +
+ {{"auth.createAccount" | translate}} +
diff --git a/src/languages/en.json b/src/languages/en.json index 86f3ee5..1e78188 100644 --- a/src/languages/en.json +++ b/src/languages/en.json @@ -28,6 +28,7 @@ "auth.form.password": "Password", "auth.form.keepLoggedIn": "Keep me logged in", "auth.form.login_button": "Login", + "auth.createAccount": "Create account", "navbar.content_viewer_actions.new_item": "New Item", "navbar.profile_actions.new_item": "New Item", "account.register.welcomeMessage": "Nice to have you there!", diff --git a/src/languages/pt.json b/src/languages/pt.json index 7330dbd..b9a54f7 100644 --- a/src/languages/pt.json +++ b/src/languages/pt.json @@ -28,6 +28,7 @@ "auth.form.password": "Senha", "auth.form.keepLoggedIn": "Continuar logado", "auth.form.login_button": "Login", + "auth.createAccount": "Criar conta", "navbar.content_viewer_actions.new_item": "Novo Item", "navbar.profile_actions.new_item": "Novo Item", "navbar.content_viewer_actions.new_post": "Novo Artigo", @@ -113,5 +114,8 @@ "account.register.accountCreatingMessage": "Ao criar uma conta, você está concordando com os ", "account.register.termsOfUseMessage": "termos de uso", "account.register.signupMessage": "Criar Conta", - "account.register.haveAccountMessage": "Já possui uma conta?" + "account.register.haveAccountMessage": "Já possui uma conta?", + "account.register.success.title": "Bom trabalho!", + "account.register.success.message": "Conta criada com sucesso!", + "account.register.passwordConfirmation.failed": "A confirmação de senha não corresponde à senha" } -- libgit2 0.21.2