This commit is contained in:
병준 박 2019-11-25 10:29:06 +09:00
commit fae557890f
8 changed files with 133 additions and 16 deletions

View File

@ -140,10 +140,12 @@
</mat-tab> </mat-tab>
</mat-tab-group> </mat-tab-group>
<div class="myprofile"> <ucap-profile-my-profile-widget
<span class="myprofile-img"></span> [profileImageRoot]="sessionVerinfo.profileRoot"
<span>내프로필</span> [profileImageFile]="loginRes.userInfo.profileImageFile"
</div> (click)="onClickOpenProfile(loginRes.userInfo)"
class="myprofile"
></ucap-profile-my-profile-widget>
<div class="left-side-tabs-body"> <div class="left-side-tabs-body">
<div <div

View File

@ -45,16 +45,8 @@
color: #ffffff; color: #ffffff;
font-size: 11px; font-size: 11px;
text-align: center; text-align: center;
z-index: 1;
.myprofile-img { cursor: pointer;
display: block;
border-radius: 10px;
height: 42px;
width: 42px;
background-color: #efefef;
align-self: center;
margin-bottom: 6px;
}
} }
::ng-deep .organization-side { ::ng-deep .organization-side {

View File

@ -30,6 +30,11 @@ import {
} from '@ucap-webmessenger/protocol-query'; } from '@ucap-webmessenger/protocol-query';
import { MatTabChangeEvent, MatTabGroup } from '@angular/material'; import { MatTabChangeEvent, MatTabGroup } from '@angular/material';
import { RightDrawer } from '@app/types'; import { RightDrawer } from '@app/types';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
import { KEY_VER_INFO } from '@app/types/ver-info.type';
export enum MainMenu { export enum MainMenu {
Group = 'GROUP', Group = 'GROUP',
@ -67,11 +72,22 @@ export class LeftSideComponent implements OnInit, OnDestroy {
MainMenu = MainMenu; MainMenu = MainMenu;
sessionVerinfo: VersionInfo2Response;
loginRes: LoginResponse;
constructor( constructor(
private store: Store<any>, private store: Store<any>,
private dialogService: DialogService, private dialogService: DialogService,
private sessionStorageService: SessionStorageService,
private logger: NGXLogger private logger: NGXLogger
) {} ) {
this.loginRes = this.sessionStorageService.get<LoginResponse>(
KEY_LOGIN_RES_INFO
);
this.sessionVerinfo = this.sessionStorageService.get<VersionInfo2Response>(
KEY_VER_INFO
);
}
ngOnInit() { ngOnInit() {
this.badgeChatUnReadCountSubscription = this.store this.badgeChatUnReadCountSubscription = this.store

View File

@ -0,0 +1,12 @@
<div class="myprofile">
<span class="myprofile-img">
<img
class="thumbnail"
ucapImage
[base]="profileImageRoot"
[path]="profileImageFile"
[default]="'assets/images/img_nophoto_50.png'"
/>
</span>
<span>내프로필</span>
</div>

View File

@ -0,0 +1,26 @@
.myprofile {
position: absolute;
display: flex;
flex-flow: column;
justify-content: center;
height: 80px;
width: 68px;
bottom: 10px;
color: #ffffff;
font-size: 11px;
text-align: center;
.myprofile-img {
display: block;
border-radius: 10px;
height: 42px;
width: 42px;
background-color: #efefef;
align-self: center;
margin-bottom: 6px;
.thumbnail {
border-radius: 10px;
}
}
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MyProfileWidgetComponent } from './my-profile-widget.component';
describe('MyProfileWidgetComponent', () => {
let component: MyProfileWidgetComponent;
let fixture: ComponentFixture<MyProfileWidgetComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ MyProfileWidgetComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(MyProfileWidgetComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,38 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { UserInfo } from '@ucap-webmessenger/protocol-room';
import {
UserInfoSS,
UserInfoF,
UserInfoDN
} from '@ucap-webmessenger/protocol-query';
@Component({
selector: 'ucap-profile-my-profile-widget',
templateUrl: './my-profile-widget.component.html',
styleUrls: ['./my-profile-widget.component.scss']
})
export class MyProfileWidgetComponent implements OnInit {
@Input()
profileImageRoot: string;
@Input()
profileImageFile: string;
@Output()
openProfile = new EventEmitter<
UserInfo | UserInfoSS | UserInfoF | UserInfoDN
>();
constructor() {}
ngOnInit() {}
onClickOpenProfile(
event: MouseEvent,
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN
) {
event.preventDefault();
event.stopPropagation();
this.openProfile.emit(userInfo);
}
}

View File

@ -14,8 +14,14 @@ import { UCapUiModule } from '@ucap-webmessenger/ui';
import { ListItemComponent } from './components/list-item.component'; import { ListItemComponent } from './components/list-item.component';
import { UserListItemComponent } from './components/user-list-item.component'; import { UserListItemComponent } from './components/user-list-item.component';
import { ProfileComponent } from './components/profile.component'; import { ProfileComponent } from './components/profile.component';
import { MyProfileWidgetComponent } from './components/my-profile-widget.component';
const COMPONENTS = [ListItemComponent, UserListItemComponent, ProfileComponent]; const COMPONENTS = [
ListItemComponent,
UserListItemComponent,
ProfileComponent,
MyProfileWidgetComponent
];
const SERVICES = []; const SERVICES = [];