프로필 오픈시 user seq 만으로 띄울수 있도록 수정.

This commit is contained in:
leejinho 2020-01-02 15:58:16 +09:00
parent 4224b0682d
commit 777756ded8
11 changed files with 37 additions and 64 deletions

View File

@ -17,7 +17,7 @@ import {
CreateChatDialogData,
CreateChatDialogResult
} from '@app/layouts/messenger/dialogs/chat/create-chat.dialog.component';
import { Subscription, of, Observable } from 'rxjs';
import { Subscription, Observable } from 'rxjs';
import { Store, select } from '@ngrx/store';
import * as AppStore from '@app/store';
@ -35,9 +35,8 @@ import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { OpenProfileOptions } from '@ucap-webmessenger/protocol-buddy';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
import { MessageApiService, MessageType } from '@ucap-webmessenger/api-message';
import { DeviceType } from '@ucap-webmessenger/core';
import { map, catchError, tap } from 'rxjs/operators';
import { MessageType } from '@ucap-webmessenger/api-message';
import { tap } from 'rxjs/operators';
import {
MessageWriteDialogComponent,
MessageWriteDialogResult,
@ -46,8 +45,7 @@ import {
import {
EnvironmentsInfo,
KEY_ENVIRONMENTS_INFO,
KEY_VER_INFO,
KEY_LOGIN_RES_INFO
KEY_VER_INFO
} from '@app/types';
import { MessageBoxComponent } from './left-sidenav/message.component';
import { environment } from '../../../../environments/environment';
@ -70,7 +68,7 @@ export enum MainMenu {
export class LeftSideComponent implements OnInit, OnDestroy {
@Output()
openProfile = new EventEmitter<{
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
userSeq: number;
openProfileOptions?: OpenProfileOptions;
}>();
@Output()
@ -264,11 +262,11 @@ export class LeftSideComponent implements OnInit, OnDestroy {
}
onClickOpenProfile(params: {
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
userSeq: number;
openProfileOptions?: OpenProfileOptions;
}) {
this.openProfile.emit({
userInfo: params.userInfo,
userSeq: params.userSeq,
openProfileOptions: params.openProfileOptions
});
}

View File

@ -86,7 +86,7 @@ export class GroupComponent implements OnInit, OnDestroy {
newGroupAndMember = new EventEmitter();
@Output()
openProfile = new EventEmitter<{
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
userSeq: number;
openProfileOptions?: OpenProfileOptions;
}>();
@ -432,7 +432,7 @@ export class GroupComponent implements OnInit, OnDestroy {
switch (menuType) {
case 'VIEW_PROFILE':
this.openProfile.emit({
userInfo,
userSeq: userInfo.seq,
openProfileOptions: {
useDelBuddybutton:
!!group &&
@ -570,11 +570,11 @@ export class GroupComponent implements OnInit, OnDestroy {
}
onClickOpenProfile(
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN,
userSeq: number,
group: GroupDetailData
) {
this.openProfile.emit({
userInfo,
userSeq,
openProfileOptions: {
useDelBuddybutton:
!!group &&

View File

@ -75,7 +75,6 @@ import {
CommonApiService,
FileTalkSaveRequest,
FileTalkSaveResponse,
TranslationReqRequest,
TranslationSaveRequest,
TranslationSaveResponse
} from '@ucap-webmessenger/api-common';
@ -117,7 +116,9 @@ import {
})
export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
@Output()
openProfile = new EventEmitter<{ userInfo: UserInfo }>();
openProfile = new EventEmitter<{
userSeq: number;
}>();
@ViewChild('chatForm', { static: false })
private chatForm: UCapUiChatFormComponent;
@ -1322,7 +1323,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
}
}
onClickOpenProfile(userInfo: UserInfo) {
onClickOpenProfile(userSeq: number) {
if (
this.roomInfo.roomType !== RoomType.Allim &&
this.roomInfo.roomType !== RoomType.Bot &&
@ -1330,7 +1331,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
this.roomInfo.roomType !== RoomType.Allim_Elephant &&
this.roomInfo.roomType !== RoomType.Allim_TMS
) {
this.openProfile.emit({ userInfo });
this.openProfile.emit({ userSeq });
}
}

View File

@ -1,11 +1,5 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { RightDrawer } from '@app/types';
import { UserInfo } from '@ucap-webmessenger/protocol-room';
import {
UserInfoSS,
UserInfoF,
UserInfoDN
} from '@ucap-webmessenger/protocol-query';
@Component({
selector: 'app-layout-messenger-right-drawer',
@ -18,7 +12,7 @@ export class RightDrawerComponent implements OnInit {
@Output()
openProfile = new EventEmitter<{
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
userSeq: number;
}>();
@Output()
closeRightDrawer = new EventEmitter();
@ -29,8 +23,8 @@ export class RightDrawerComponent implements OnInit {
ngOnInit() {}
onClickOpenProfile(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) {
this.openProfile.emit({ userInfo });
onClickOpenProfile(userSeq: number) {
this.openProfile.emit({ userSeq });
}
onClickClose() {

View File

@ -6,7 +6,7 @@
[presence]="getStatusBulkInfo(userInfo) | async"
[sessionVerinfo]="sessionVerinfo"
(contextmenu)="onContextMenuRoomUser($event, userInfo)"
(openProfile)="onClickOpenProfile($event)"
(openProfile)="onClickOpenProfile(userInfo.seq)"
>
</ucap-profile-user-list-item>
</div>

View File

@ -49,7 +49,7 @@ import { MatMenuTrigger, MatDialog } from '@angular/material';
})
export class RoomUserListComponent implements OnInit, OnDestroy {
@Output()
openProfile = new EventEmitter<UserInfo>();
openProfile = new EventEmitter<number>();
@ViewChild('roomUserContextMenuTrigger', { static: true })
roomUserContextMenuTrigger: MatMenuTrigger;
@ -131,8 +131,8 @@ export class RoomUserListComponent implements OnInit, OnDestroy {
);
}
onClickOpenProfile(userInfo: UserInfo) {
this.openProfile.emit(userInfo);
onClickOpenProfile(userSeq: number) {
this.openProfile.emit(userSeq);
}
async onClickAddMember() {

View File

@ -16,12 +16,6 @@ import * as MessageStore from '@app/store/messenger/message';
import { Observable, Subscription, of } from 'rxjs';
import { UCAP_NATIVE_SERVICE, NativeService } from '@ucap-webmessenger/native';
import { UserInfo } from '@ucap-webmessenger/protocol-sync';
import {
UserInfoSS,
UserInfoF,
UserInfoDN
} from '@ucap-webmessenger/protocol-query';
import { StatusProtocolService } from '@ucap-webmessenger/protocol-status';
import { StatusType, StatusCode } from '@ucap-webmessenger/core';
import {
@ -211,14 +205,17 @@ export class MainPageComponent implements OnInit, OnDestroy {
}
onClickOpenProfile(params: {
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
userSeq: number;
openProfileOptions?: OpenProfileOptions;
}) {
if (!params.userSeq || params.userSeq < 0) {
return;
}
// [GROUP]
// this.queryProtocolService
// .dataUser({
// divCd: 'OPENPROF',
// seq: userInfo.seq,
// seq: params.userSeq,
// senderCompanyCode: this.loginRes.userInfo.companyCode,
// senderEmployeeType: this.loginRes.userInfo.employeeType
// })
@ -244,7 +241,7 @@ export class MainPageComponent implements OnInit, OnDestroy {
this.daesangProtocolService
.dataUserDaesang({
divCd: 'OPENPROF',
seq: params.userInfo.seq,
seq: params.userSeq,
senderCompanyCode: this.loginRes.userInfo.companyCode,
senderEmployeeType: this.loginRes.userInfo.employeeType
})

View File

@ -120,7 +120,7 @@
[base]="profileImageRoot"
[path]="getUserProfile(message.senderSeq)"
[default]="'assets/images/img_nophoto_50.png'"
(click)="onClickOpenProfile($event, getUerInfo(message.senderSeq))"
(click)="onClickOpenProfile($event, message.senderSeq)"
/>
<!-- <ucap-ui-imaage
[style]="'width: 50px; height: 50px;'"

View File

@ -54,7 +54,7 @@ export class MessagesComponent implements OnInit {
translationSimpleview = false;
@Output()
openProfile = new EventEmitter<UserInfo>();
openProfile = new EventEmitter<number>();
@Output()
moreEvent = new EventEmitter<number>();
@Output()
@ -120,18 +120,6 @@ export class MessagesComponent implements OnInit {
}
return '';
}
getUerInfo(seq: number): UserInfo {
if (!this.userInfos) {
return null;
}
const userInfo: UserInfo[] = this.userInfos.filter(
user => user.seq === seq
);
if (!!userInfo && userInfo.length > 0) {
return userInfo[0];
}
}
getEventSearched(seq: number): boolean {
return (
!!this.searchedList &&
@ -213,11 +201,11 @@ export class MessagesComponent implements OnInit {
return false;
}
onClickOpenProfile(event: MouseEvent, userInfo: UserInfo) {
onClickOpenProfile(event: MouseEvent, userSeq: number) {
event.preventDefault();
event.stopPropagation();
this.openProfile.emit(userInfo);
this.openProfile.emit(userSeq);
}
onClickMore(event: any) {

View File

@ -11,7 +11,7 @@
[base]="profileImageRoot"
[path]="userInfo.profileImageFile"
[default]="'assets/images/img_nophoto_50.png'"
(click)="onClickOpenProfile($event, userInfo)"
(click)="onClickOpenProfile($event, userInfo.seq)"
/>
</div>
<span

View File

@ -52,9 +52,7 @@ export class UserListItemComponent implements OnInit {
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
}>();
@Output()
openProfile = new EventEmitter<
UserInfo | UserInfoSS | UserInfoF | UserInfoDN
>();
openProfile = new EventEmitter<number>();
PresenceType = PresenceType;
@ -108,13 +106,10 @@ export class UserListItemComponent implements OnInit {
});
}
onClickOpenProfile(
event: MouseEvent,
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN
) {
onClickOpenProfile(event: MouseEvent, userSeq: number) {
event.preventDefault();
event.stopPropagation();
this.openProfile.emit(userInfo);
this.openProfile.emit(userSeq);
}
}