aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_pages/profile
diff options
context:
space:
mode:
authorNevena Bojovic <nenabojov@gmail.com>2022-04-04 21:52:26 +0200
committerNevena Bojovic <nenabojov@gmail.com>2022-04-04 21:52:26 +0200
commitcfaf42a42223bc60621ae583e8ac536d980a794a (patch)
treef43987731445ff7c0af42a2a1e014db905f37087 /frontend/src/app/_pages/profile
parent6ffac0e8f7803e895e411328917f6c49b2520b28 (diff)
parent8077f508fa552b789b669c433776357da1f809eb (diff)
Merge branch 'dev' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into dev
Diffstat (limited to 'frontend/src/app/_pages/profile')
-rw-r--r--frontend/src/app/_pages/profile/profile.component.ts13
1 files changed, 6 insertions, 7 deletions
diff --git a/frontend/src/app/_pages/profile/profile.component.ts b/frontend/src/app/_pages/profile/profile.component.ts
index 7a7796da..d055fad3 100644
--- a/frontend/src/app/_pages/profile/profile.component.ts
+++ b/frontend/src/app/_pages/profile/profile.component.ts
@@ -6,6 +6,7 @@ import { Router } from '@angular/router';
import { PICTURES } from 'src/app/_data/ProfilePictures';
import { Picture } from 'src/app/_data/ProfilePictures';
import shared from '../../Shared';
+import { share } from 'rxjs';
@Component({
@@ -15,8 +16,6 @@ import shared from '../../Shared';
})
export class ProfileComponent implements OnInit {
-
-
user: User = new User();
pictures: Picture[] = PICTURES;
@@ -90,18 +89,18 @@ export class ProfileComponent implements OnInit {
if (this.user.username != editedUser.username) { //promenio username, ide logout
this.user = editedUser;
this.resetInfo();
- alert("Nakon promene korisničkog imena, moraćete ponovo da se ulogujete.");
+ shared.openDialog("Obaveštenje", "Nakon promene korisničkog imena, moraćete ponovo da se ulogujete.");
this.authService.logOut();
this.router.navigate(['']);
return;
}
- alert("Podaci su uspešno promenjeni.");
+ shared.openDialog("Obaveštenje", "Podaci su uspešno promenjeni.");
this.user = editedUser;
console.log(this.user);
this.resetInfo();
}, (error: any) =>{
if (error.error == "Username already exists!") {
- alert("Ukucano korisničko ime je već zauzeto!\nIzaberite neko drugo.");
+ shared.openDialog("Obaveštenje", "Ukucano korisničko ime je već zauzeto! Izaberite neko drugo.");
//(<HTMLSelectElement>document.getElementById("inputUsername")).focus();
//poruka obavestenja ispod inputa
this.resetInfo();
@@ -131,7 +130,7 @@ export class ProfileComponent implements OnInit {
this.userInfoService.changeUserPassword(passwordArray).subscribe((response: any) => {
//console.log("PROMENIO LOZINKU");
this.resetNewPassInputs();
- alert("Nakon promene lozinke, moraćete ponovo da se ulogujete.");
+ shared.openDialog("Obaveštenje", "Nakon promene lozinke, moraćete ponovo da se ulogujete.");
this.authService.logOut();
this.router.navigate(['']);
}, (error: any) => {
@@ -142,7 +141,7 @@ export class ProfileComponent implements OnInit {
return;
}
else if (error.error == 'Identical password!') {
- alert("Stara i nova lozinka su identične.");
+ shared.openDialog("Obaveštenje", "Stara i nova lozinka su identične.");
this.resetNewPassInputs();
//(<HTMLSelectElement>document.getElementById("inputNewPassword")).focus();
return;