diff --git a/backend/config/ConfigLoader.ts b/backend/config/ConfigLoader.ts index 30287b74..a7823424 100644 --- a/backend/config/ConfigLoader.ts +++ b/backend/config/ConfigLoader.ts @@ -25,7 +25,6 @@ export class ConfigLoader { let argv = optimist.argv; delete(argv._); delete(argv.$0); - console.log(argv); this.processHierarchyVar(configObject, argv); }; diff --git a/backend/middlewares/user/UserMWs.ts b/backend/middlewares/user/UserMWs.ts index 7e7a2568..0047351a 100644 --- a/backend/middlewares/user/UserMWs.ts +++ b/backend/middlewares/user/UserMWs.ts @@ -3,6 +3,7 @@ import {Error, ErrorCodes} from "../../../common/entities/Error"; import {ObjectManagerRepository} from "../../model/ObjectManagerRepository"; import {User} from "../../../common/entities/User"; import {Config} from "../../config/Config"; +import {Utils} from "../../../common/Utils"; export class UserMWs { @@ -91,6 +92,7 @@ export class UserMWs { if ((err) || (!result)) { return next(new Error(ErrorCodes.GENERAL_ERROR)); } + result = Utils.clone(result); for (let i = 0; i < result.length; i++) { result[i].password = ""; } diff --git a/frontend/app/admin/admin.component.html b/frontend/app/admin/admin.component.html index d2e69ba6..2e4ee117 100644 --- a/frontend/app/admin/admin.component.html +++ b/frontend/app/admin/admin.component.html @@ -1,77 +1,5 @@
-
-
-

User management

-
-
- - - - - - - - - - - - - - - -
NameRole
{{user.name}} - - - {{user.role | stringifyRole}} - - -
- - -
-
-
- - -
diff --git a/frontend/app/admin/admin.component.ts b/frontend/app/admin/admin.component.ts index 07a98f2d..8612b937 100644 --- a/frontend/app/admin/admin.component.ts +++ b/frontend/app/admin/admin.component.ts @@ -4,31 +4,23 @@ import {Component, OnInit} from "@angular/core"; import {AuthenticationService} from "../model/network/authentication.service.ts"; import {Router} from "@angular/router-deprecated"; import {FrameComponent} from "../frame/frame.component"; -import {User, UserRoles} from "../../../common/entities/User"; +import {UserRoles} from "../../../common/entities/User"; import {FORM_DIRECTIVES} from "@angular/common"; -import {Utils} from "../../../common/Utils"; -import {AdminService} from "./admin.service"; -import {Message} from "../../../common/entities/Message"; import {StringifyRole} from "./../pipes/StringifyRolePipe"; import {Config} from "../config/Config"; +import {UserMangerSettingsComponent} from "../settings/usermanager/usermanager.settings.component"; @Component({ selector: 'admin', templateUrl: 'app/admin/admin.component.html', styleUrls: ['app/admin/admin.component.css'], - directives: [FrameComponent, FORM_DIRECTIVES], - providers: [AdminService], + directives: [FrameComponent, FORM_DIRECTIVES, UserMangerSettingsComponent], pipes: [StringifyRole] }) export class AdminComponent implements OnInit { - - private newUser = new User(); - private userRoles:Array = []; - private users:Array = []; userManagementEnable:boolean = false; - constructor(private _authService:AuthenticationService, private _router:Router, private _adminService:AdminService) { - + constructor(private _authService:AuthenticationService, private _router:Router) { this.userManagementEnable = Config.Client.authenticationRequired; } @@ -37,50 +29,8 @@ export class AdminComponent implements OnInit { this._router.navigate(['Login']); return; } - if (Config.Client.authenticationRequired === true) { - this.userRoles = Utils.enumToArray(UserRoles).filter(r => r.key <= this._authService.getUser().role); - this.getUsersList(); - } } - private getUsersList() { - this._adminService.getUsers().then((result:Message>) => { - this.users = result.result; - }); - } - - - canModifyUser(user:User):boolean { - let currentUser = this._authService.getUser(); - if (!currentUser) { - return false; - } - - return currentUser.name != user.name && currentUser.role >= user.role; - } - - initNewUser() { - this.newUser = new User(); - this.newUser.role = UserRoles.User; - } - - addNewUser() { - this._adminService.createUser(this.newUser).then(() => { - this.getUsersList(); - }); - } - - updateRole(user:User) { - this._adminService.updateRole(user).then(() => { - this.getUsersList(); - }); - } - - deleteUser(user:User) { - this._adminService.deleteUser(user).then(() => { - this.getUsersList(); - }); - } } diff --git a/frontend/app/gallery/grid/grid.gallery.component.ts b/frontend/app/gallery/grid/grid.gallery.component.ts index 553386ca..7eef5bc6 100644 --- a/frontend/app/gallery/grid/grid.gallery.component.ts +++ b/frontend/app/gallery/grid/grid.gallery.component.ts @@ -49,6 +49,7 @@ export class GalleryGridComponent implements OnChanges,AfterViewInit { if (this.isAfterViewInit === false) { return; } + this.updateContainerWidth(); this.sortPhotos(); this.mergeNewPhotos(); setImmediate(() => { diff --git a/frontend/app/gallery/grid/photo/photo.grid.gallery.component.ts b/frontend/app/gallery/grid/photo/photo.grid.gallery.component.ts index a843a494..4ea62386 100644 --- a/frontend/app/gallery/grid/photo/photo.grid.gallery.component.ts +++ b/frontend/app/gallery/grid/photo/photo.grid.gallery.component.ts @@ -57,21 +57,16 @@ export class GalleryPhotoComponent implements IRenderable, OnInit, AfterViewInit } ngOnInit() { + this.loading.show = true; //set up befoar adding task to thumbnail generator if (this.gridPhoto.isThumbnailAvailable()) { this.image.src = this.gridPhoto.getThumbnailPath(); this.image.show = true; - // this.loading.show = false; - - } else { - if (this.gridPhoto.isReplacementThumbnailAvailable()) { - this.image.src = this.gridPhoto.getReplacementThumbnailPath(); - this.image.show = true; - this.loading.show = false; - } else { - this.loading.show = true; - } + } else if (this.gridPhoto.isReplacementThumbnailAvailable()) { + this.image.src = this.gridPhoto.getReplacementThumbnailPath(); + this.image.show = true; } + } ngAfterViewInit() { diff --git a/frontend/app/login/login.component.html b/frontend/app/login/login.component.html index ba7fddcb..4ce1e4f8 100644 --- a/frontend/app/login/login.component.html +++ b/frontend/app/login/login.component.html @@ -2,6 +2,9 @@