mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
user-info fixes and performance improvements (#1171)
* #1167 document-list improvements - allow setting custom root path - document-list module now re-exports datatable module (no need importing it separately if document-list is already used) - documentation updates and fixes * readme updates and unit test * user-info fixes and performance improvements - setup live reloads for user-info (demo shell) - optimise user-info template (single *ngIf, [mdl] directive for ‘user-profile-lists’ instead of CPU-hungry `ngAfterViewChecked`)
This commit is contained in:
committed by
Eugenio Romano
parent
9066ce49e0
commit
5c401007f2
@@ -6,6 +6,7 @@
|
|||||||
"node_modules/ng2-alfresco-login/dist/**/*.{html,css,js}",
|
"node_modules/ng2-alfresco-login/dist/**/*.{html,css,js}",
|
||||||
"node_modules/ng2-alfresco-search/dist/**/*.{html,css,js}",
|
"node_modules/ng2-alfresco-search/dist/**/*.{html,css,js}",
|
||||||
"node_modules/ng2-alfresco-upload/dist/**/*.{html,css,js}",
|
"node_modules/ng2-alfresco-upload/dist/**/*.{html,css,js}",
|
||||||
|
"node_modules/ng2-alfresco-userinfo/dist/**/*.{html,css,js}",
|
||||||
"node_modules/ng2-alfresco-viewer/dist/**/*.{html,css,js}",
|
"node_modules/ng2-alfresco-viewer/dist/**/*.{html,css,js}",
|
||||||
"node_modules/ng2-alfresco-webscript/dist/**/*.{html,css,js}",
|
"node_modules/ng2-alfresco-webscript/dist/**/*.{html,css,js}",
|
||||||
"node_modules/ng2-activiti-form/dist/**/*.{html,css,js}",
|
"node_modules/ng2-activiti-form/dist/**/*.{html,css,js}",
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
<div id="userinfo_container" *ngIf="isLoggedIn()">
|
<div id="userinfo_container" *ngIf="isLoggedIn()">
|
||||||
<div *ngIf="ecmUser || bpmUser" class="button-profile" id="user-profile" data-automation-id="user-profile">
|
<div *ngIf="ecmUser || bpmUser">
|
||||||
|
<div class="button-profile" id="user-profile" data-automation-id="user-profile">
|
||||||
<img id="logged-user-img"
|
<img id="logged-user-img"
|
||||||
[src]="getUserAvatar()"
|
[src]="getUserAvatar()"
|
||||||
alt="user-info-profile-button"
|
alt="user-info-profile-button"
|
||||||
(error)="onImageLoadingError($event)"
|
(error)="onImageLoadingError($event)"
|
||||||
class="profile-image"/>
|
class="profile-image"/>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="ecmUser || bpmUser" id="user-profile-lists" class="user-profile-list-mdl
|
<div mdl id="user-profile-lists" class="user-profile-list-mdl mdl-menu mdl-js-menu mdl-js-ripple-effect"
|
||||||
mdl-menu mdl-js-menu mdl-js-ripple-effect"
|
|
||||||
[class.mdl-menu--bottom-left]="menuOpenType === 'left'? true : false"
|
[class.mdl-menu--bottom-left]="menuOpenType === 'left'? true : false"
|
||||||
[class.mdl-menu--bottom-right]="menuOpenType === 'right'? true : false"
|
[class.mdl-menu--bottom-right]="menuOpenType === 'right'? true : false"
|
||||||
for="user-profile" (click)="stopClosing($event)">
|
for="user-profile" (click)="stopClosing($event)">
|
||||||
@@ -80,4 +80,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, OnInit, Input, AfterViewChecked } from '@angular/core';
|
import { Component, OnInit, Input } from '@angular/core';
|
||||||
import { EcmUserModel } from './../models/ecm-user.model';
|
import { EcmUserModel } from './../models/ecm-user.model';
|
||||||
import { BpmUserModel } from './../models/bpm-user.model';
|
import { BpmUserModel } from './../models/bpm-user.model';
|
||||||
import { EcmUserService } from './../services/ecm-user.service';
|
import { EcmUserService } from './../services/ecm-user.service';
|
||||||
@@ -30,7 +30,7 @@ declare let componentHandler: any;
|
|||||||
styleUrls: ['./user-info.component.css'],
|
styleUrls: ['./user-info.component.css'],
|
||||||
templateUrl: './user-info.component.html'
|
templateUrl: './user-info.component.html'
|
||||||
})
|
})
|
||||||
export class UserInfoComponent implements AfterViewChecked, OnInit {
|
export class UserInfoComponent implements OnInit {
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
ecmBackgroundImage: string;
|
ecmBackgroundImage: string;
|
||||||
@@ -69,13 +69,6 @@ export class UserInfoComponent implements AfterViewChecked, OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewChecked() {
|
|
||||||
// workaround for MDL issues with dynamic components
|
|
||||||
if (componentHandler) {
|
|
||||||
componentHandler.upgradeAllRegistered();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.getUserInfo();
|
this.getUserInfo();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user