소속부서 기능 추가에 따른 프로필 유효성 체크부분 추가.

This commit is contained in:
leejinho 2019-12-26 17:34:52 +09:00
parent 40e787ff1e
commit 5236f0e37b
31 changed files with 335 additions and 141 deletions

View File

@ -31,6 +31,7 @@ import {
} from '@ucap-webmessenger/protocol-query';
import { MatTabChangeEvent } from '@angular/material';
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';
@ -69,9 +70,10 @@ export enum MainMenu {
})
export class LeftSideComponent implements OnInit, OnDestroy {
@Output()
openProfile = new EventEmitter<
UserInfo | UserInfoSS | UserInfoF | UserInfoDN
>();
openProfile = new EventEmitter<{
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
openProfileOptions?: OpenProfileOptions;
}>();
@Output()
sendCall = new EventEmitter<string>();
@Output()
@ -262,8 +264,14 @@ export class LeftSideComponent implements OnInit, OnDestroy {
}
}
onClickOpenProfile(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) {
this.openProfile.emit(userInfo);
onClickOpenProfile(params: {
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
openProfileOptions?: OpenProfileOptions;
}) {
this.openProfile.emit({
userInfo: params.userInfo,
openProfileOptions: params.openProfileOptions
});
}
onClickSendClickToCall(calleeNumber: string) {
this.sendCall.emit(calleeNumber);

View File

@ -38,7 +38,7 @@
[presence]="getStatusBulkInfo(userInfo) | async"
[sessionVerinfo]="sessionVerinfo"
(click)="onSelectBuddy(userInfo)"
(openProfile)="onClickOpenProfile($event)"
(openProfile)="onClickOpenProfile($event, group)"
(contextmenu)="onContextMenuProfile($event, userInfo, group, false)"
class="list-item-frame ucap-clickable"
>
@ -159,7 +159,7 @@
>
<button
mat-menu-item
(click)="onClickProfileContextMenu('VIEW_PROFILE', userInfo)"
(click)="onClickProfileContextMenu('VIEW_PROFILE', userInfo, group)"
>
프로필 보기
</button>

View File

@ -44,6 +44,7 @@ import {
SSVC_TYPE_QUERY_DEPT_USER_RES,
DeptUserData
} from '@ucap-webmessenger/protocol-query';
import { OpenProfileOptions } from '@ucap-webmessenger/protocol-buddy';
import {
ucapAnimations,
@ -84,9 +85,10 @@ export class GroupComponent implements OnInit, OnDestroy {
@Output()
newGroupAndMember = new EventEmitter();
@Output()
openProfile = new EventEmitter<
UserInfo | UserInfoSS | UserInfoF | UserInfoDN
>();
openProfile = new EventEmitter<{
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
openProfileOptions?: OpenProfileOptions;
}>();
@ViewChild('groupExpansionPanel', { static: false })
groupExpansionPanel: GroupExpansionPanelComponent;
@ -430,7 +432,18 @@ export class GroupComponent implements OnInit, OnDestroy {
);
switch (menuType) {
case 'VIEW_PROFILE':
this.openProfile.emit(userInfo);
this.openProfile.emit({
userInfo,
openProfileOptions: {
useDelBuddybutton:
!!group &&
environment.productConfig.CommonSetting.useMyDeptGroup &&
environment.productConfig.CommonSetting.myDeptGroupSeq ===
group.seq
? false
: true
}
});
break;
case 'CHAT':
this.onSelectBuddy(userInfo);
@ -557,8 +570,21 @@ export class GroupComponent implements OnInit, OnDestroy {
}
}
onClickOpenProfile(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) {
this.openProfile.emit(userInfo);
onClickOpenProfile(
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN,
group: GroupDetailData
) {
this.openProfile.emit({
userInfo,
openProfileOptions: {
useDelBuddybutton:
!!group &&
environment.productConfig.CommonSetting.useMyDeptGroup &&
environment.productConfig.CommonSetting.myDeptGroupSeq === group.seq
? false
: true
}
});
}
onContextMenuProfile(

View File

@ -9,13 +9,10 @@ import {
AfterViewChecked
} from '@angular/core';
import { Subscription, of } from 'rxjs';
import { Store, select } from '@ngrx/store';
import { tap, map, catchError, take } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { map, catchError, take } from 'rxjs/operators';
import { NGXLogger } from 'ngx-logger';
import * as AppStore from '@app/store';
import { UserInfo } from '@ucap-webmessenger/protocol-room';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { DialogService } from '@ucap-webmessenger/ui';

View File

@ -82,7 +82,7 @@
<ucap-profile-user-list-item
*cdkVirtualFor="let userInfo of searchUserInfos"
[userInfo]="userInfo"
[checkable]="true"
[checkable]="userInfo.seq !== loginRes.userSeq"
[sessionVerinfo]="sessionVerinfo"
[selectedUserList]="selectedUserList"
[isChecked]="getCheckedUser(userInfo)"

View File

@ -98,9 +98,9 @@ export class OrganizationComponent
userInfos: (UserInfo | UserInfoSS | UserInfoF | UserInfoDN)[];
}>();
@Output()
openProfile = new EventEmitter<
UserInfo | UserInfoSS | UserInfoF | UserInfoDN
>();
openProfile = new EventEmitter<{
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
}>();
@Output()
sendCall = new EventEmitter<string>();
@Output()
@ -395,9 +395,10 @@ export class OrganizationComponent
onCheckAllUser(value: boolean) {
this.checkAllUser.emit({
isChecked: value,
userInfos: this.isShowSearch
userInfos: (this.isShowSearch
? this.searchUserInfos
: this.selectedDepartmentUserInfoList
).filter(user => user.seq !== this.loginRes.userSeq)
});
}
@ -416,7 +417,7 @@ export class OrganizationComponent
}
onClickOpenProfile(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) {
this.openProfile.emit(userInfo);
this.openProfile.emit({ userInfo });
}
onClickSendClickToCall(calleeNumber: string) {
this.sendCall.emit(calleeNumber);

View File

@ -108,7 +108,7 @@ import { environment } from '../../../../environments/environment';
})
export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
@Output()
openProfile = new EventEmitter<UserInfo>();
openProfile = new EventEmitter<{ userInfo: UserInfo }>();
@ViewChild('chatForm', { static: false })
private chatForm: UCapUiChatFormComponent;
@ -1192,7 +1192,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({ userInfo });
}
}

View File

@ -4,22 +4,22 @@ import { UserInfo } from '@ucap-webmessenger/protocol-room';
import {
UserInfoSS,
UserInfoF,
UserInfoDN,
UserInfoDN
} from '@ucap-webmessenger/protocol-query';
@Component({
selector: 'app-layout-messenger-right-drawer',
templateUrl: './right-drawer.component.html',
styleUrls: ['./right-drawer.component.scss'],
styleUrls: ['./right-drawer.component.scss']
})
export class RightDrawerComponent implements OnInit {
@Input()
selectedRightDrawer: RightDrawer;
@Output()
openProfile = new EventEmitter<
UserInfo | UserInfoSS | UserInfoF | UserInfoDN
>();
openProfile = new EventEmitter<{
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
}>();
@Output()
closeRightDrawer = new EventEmitter();
@ -30,7 +30,7 @@ export class RightDrawerComponent implements OnInit {
ngOnInit() {}
onClickOpenProfile(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) {
this.openProfile.emit(userInfo);
this.openProfile.emit({ userInfo });
}
onClickClose() {

View File

@ -6,6 +6,7 @@
[myMadn]="loginRes.madn"
[isBuddy]="isBuddy"
[isFavorit]="isFavorit"
[openProfileOptions]="data.openProfileOptions"
(openChat)="onClickChat($event)"
(sendMessage)="onClickSendMessage($event)"
(sendCall)="onClickSendClickToCall($event)"

View File

@ -36,6 +36,7 @@ import {
} from '../group/select-group.dialog.component';
import { FileUploadItem } from '@ucap-webmessenger/api';
import { CommonApiService } from '@ucap-webmessenger/api-common';
import { OpenProfileOptions } from '@ucap-webmessenger/protocol-buddy';
import { EnvironmentsInfo, KEY_ENVIRONMENTS_INFO } from '@app/types';
import { StatusCode } from '@ucap-webmessenger/api';
import {
@ -54,6 +55,7 @@ import { environment } from '../../../../../environments/environment';
export interface ProfileDialogData {
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
openProfileOptions?: OpenProfileOptions;
}
export interface ProfileDialogResult {}
@ -102,6 +104,8 @@ export class ProfileDialogComponent implements OnInit, OnDestroy {
this.editableProfileImage =
environment.productConfig.CommonSetting.editableProfileImage;
console.log(data.openProfileOptions);
}
ngOnInit() {

View File

@ -42,13 +42,10 @@ import {
import { MatDrawer } from '@angular/material';
import { NGXLogger } from 'ngx-logger';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { OpenProfileOptions } from '@ucap-webmessenger/protocol-buddy';
import { DaesangProtocolService, SmsUtils } from '@ucap-webmessenger/daesang';
import { CallService } from '@ucap-webmessenger/api-prompt';
import {
EnvironmentsInfo,
KEY_ENVIRONMENTS_INFO,
KEY_URL_INFO
} from '@app/types';
import { EnvironmentsInfo, KEY_ENVIRONMENTS_INFO } from '@app/types';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import {
MessageApiService,
@ -63,7 +60,6 @@ import {
MessageDetailDialogResult,
MessageDetailDialogData
} from '@app/layouts/messenger/dialogs/message/message-detail.dialog.component';
import { DaesangUrlInfoResponse } from '@ucap-webmessenger/api-external';
@Component({
selector: 'app-page-messenger-main',
@ -96,8 +92,7 @@ export class MainPageComponent implements OnInit, OnDestroy {
private callService: CallService,
private sessionStorageService: SessionStorageService,
private dialogService: DialogService,
private logger: NGXLogger,
private changeDetectorRef: ChangeDetectorRef
private logger: NGXLogger
) {
this.environmentsInfo = this.sessionStorageService.get<EnvironmentsInfo>(
KEY_ENVIRONMENTS_INFO
@ -244,7 +239,10 @@ export class MainPageComponent implements OnInit, OnDestroy {
this.leftSideComponentWidth = this.defaultLeftSideComponentWidth;
}
onClickOpenProfile(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) {
onClickOpenProfile(params: {
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
openProfileOptions?: OpenProfileOptions;
}) {
// [GROUP]
// this.queryProtocolService
// .dataUser({
@ -275,7 +273,7 @@ export class MainPageComponent implements OnInit, OnDestroy {
this.daesangProtocolService
.dataUserDaesang({
divCd: 'OPENPROF',
seq: userInfo.seq,
seq: params.userInfo.seq,
senderCompanyCode: this.loginRes.userInfo.companyCode,
senderEmployeeType: this.loginRes.userInfo.employeeType
})
@ -289,7 +287,8 @@ export class MainPageComponent implements OnInit, OnDestroy {
ProfileDialogResult
>(ProfileDialogComponent, {
data: {
userInfo: res.userInfo
userInfo: res.userInfo,
openProfileOptions: params.openProfileOptions
}
});
}

View File

@ -39,7 +39,6 @@ export const deptFailure = createAction(
'[Messenger::Query] Dept Failure',
props<{ error: any }>()
);
export const deptUser = createAction(
'[Messenger::Query] Dept User',
props<DeptUserRequest>()
@ -54,3 +53,8 @@ export const deptUserFailure = createAction(
'[Messenger::Query] Dept User Failure',
props<{ error: any }>()
);
export const myDeptUserSuccess = createAction(
'[Messenger::Query] My Dept User Success',
props<{ userInfos: UserInfoSS[] }>()
);

View File

@ -11,7 +11,8 @@ import {
deptFailure,
deptUser,
deptUserSuccess,
deptUserFailure
deptUserFailure,
myDeptUserSuccess
} from './actions';
import {
@ -28,6 +29,9 @@ import {
} from '@ucap-webmessenger/protocol-query';
import { Store } from '@ngrx/store';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { KEY_LOGIN_RES_INFO } from '@app/types';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
@Injectable()
export class Effects {
@ -94,6 +98,18 @@ export class Effects {
res: res as DeptUserResponse
})
);
const loginResInfo: LoginResponse = this.sessionStorageService.get<
LoginResponse
>(KEY_LOGIN_RES_INFO);
if (req.seq === loginResInfo.departmentCode) {
this.store.dispatch(
myDeptUserSuccess({
userInfos
})
);
}
break;
}
}),
@ -108,6 +124,7 @@ export class Effects {
constructor(
private actions$: Actions,
private store: Store<any>,
private queryProtocolService: QueryProtocolService
private queryProtocolService: QueryProtocolService,
private sessionStorageService: SessionStorageService
) {}
}

View File

@ -5,7 +5,8 @@ import {
deptSuccess,
deptUserSuccess,
deptUser,
deptUserFailure
deptUserFailure,
myDeptUserSuccess
} from './actions';
import * as AuthenticationStore from '@app/store/account/authentication';
@ -49,6 +50,13 @@ export const reducer = createReducer(
};
}),
on(myDeptUserSuccess, (state, action) => {
return {
...state,
myDepartmentUserInfoList: action.userInfos
};
}),
on(AuthenticationStore.logoutInitialize, (state, action) => {
return {
...initialState

View File

@ -14,6 +14,8 @@ export interface State {
selectedDepartmentUserInfoList: UserInfoSS[] | null;
selectedDepartmentStatus: DeptUserResponse | null;
selectedDepartmentProcessing: boolean;
myDepartmentUserInfoList: UserInfoSS[] | null;
}
export const initialState: State = {
@ -21,15 +23,13 @@ export const initialState: State = {
departmentInfoList: null,
selectedDepartmentUserInfoList: null,
selectedDepartmentStatus: null,
selectedDepartmentProcessing: false
selectedDepartmentProcessing: false,
myDepartmentUserInfoList: null
};
export function selectors<S>(selector: Selector<any, State>) {
return {
auth: createSelector(
selector,
(state: State) => state.auth
),
auth: createSelector(selector, (state: State) => state.auth),
departmentInfoList: createSelector(
selector,
(state: State) => state.departmentInfoList
@ -45,6 +45,10 @@ export function selectors<S>(selector: Selector<any, State>) {
selectedDepartmentProcessing: createSelector(
selector,
(state: State) => state.selectedDepartmentProcessing
),
myDepartmentUserInfoList: createSelector(
selector,
(state: State) => state.myDepartmentUserInfoList
)
};
}

View File

@ -111,6 +111,7 @@ import {
DialogService,
AlertDialogData
} from '@ucap-webmessenger/ui';
import { UserInfoSS } from '@ucap-webmessenger/protocol-query';
@Injectable()
export class Effects {
@ -719,9 +720,15 @@ export class Effects {
GroupDetailData
>
)
)
),
this.store.pipe(
select(
(state: any) =>
state.messenger.query.myDepartmentUserInfoList as UserInfoSS[]
)
) // 내 부서원 비교.
),
tap(([action, buddyList, groupList]) => {
tap(([action, buddyList, groupList, myDeptUserList]) => {
// Add Buddy
const addBuddyList: number[] = [];
action.trgtUserSeq.forEach(item => {
@ -734,15 +741,23 @@ export class Effects {
let delBuddyInGroup: number[] = action.oldGroup.userSeqs.filter(
v => action.trgtUserSeq.indexOf(v) < 0
);
// tslint:disable-next-line: no-shadowed-variable
delBuddyInGroup = delBuddyInGroup.filter(delBuddy => {
// 소속부서(내부서) 고정그룹 사용시 소속부서원을 삭제하지 않는다.
if (environment.productConfig.CommonSetting.useMyDeptGroup) {
delBuddyInGroup = delBuddyInGroup.filter(
delbuddy =>
myDeptUserList.filter(deptUser => deptUser.seq === delbuddy)
.length === 0
);
}
delBuddyInGroup = delBuddyInGroup.filter(delbuddy => {
let exist = false;
// tslint:disable-next-line: forin
for (const key in groupList) {
const group: GroupDetailData = groupList[key];
if (
group.seq !== action.oldGroup.seq &&
group.userSeqs.filter(v => v === delBuddy).length > 0
group.userSeqs.filter(v => v === delbuddy).length > 0
) {
exist = true;
break;
@ -856,20 +871,36 @@ export class Effects {
GroupDetailData
>
)
)
),
this.store.pipe(
select(
(state: any) =>
state.messenger.query.myDepartmentUserInfoList as UserInfoSS[]
)
) // 내 부서원 비교.
),
exhaustMap(([action, groupList]) => {
exhaustMap(([action, groupList, myDeptUserList]) => {
// Del Buddy
const trgtBuddys = action.group.userSeqs;
// tslint:disable-next-line: no-shadowed-variable
const delBuddyList = trgtBuddys.filter(delBuddy => {
let delBuddyList: number[] = [];
// 소속부서(내부서) 고정그룹 사용시 소속부서원을 삭제하지 않는다.
if (environment.productConfig.CommonSetting.useMyDeptGroup) {
delBuddyList = trgtBuddys.filter(
delbuddy =>
myDeptUserList.filter(deptUser => deptUser.seq === delbuddy)
.length === 0
);
}
delBuddyList = trgtBuddys.filter(delbuddy => {
let exist = false;
// tslint:disable-next-line: forin
for (const key in groupList) {
const group: GroupDetailData = groupList[key];
if (
group.seq !== action.group.seq &&
group.userSeqs.filter(v => v === delBuddy).length > 0
group.userSeqs.filter(v => v === delbuddy).length > 0
) {
exist = true;
break;
@ -961,36 +992,60 @@ export class Effects {
GroupDetailData
>
)
)
),
this.store.pipe(
select(
(state: any) =>
state.messenger.query.myDepartmentUserInfoList as UserInfoSS[]
)
) // 내 부서원 비교.
),
tap(([req, groupList]) => {
tap(([req, groupList, myDeptUserList]) => {
// tslint:disable-next-line: forin
for (const key in groupList) {
const group: GroupDetailData = groupList[key];
if (group.userSeqs.indexOf(req.seq) > -1) {
// Group Clear..
this.store.dispatch(
updateGroup({
groupSeq: group.seq,
groupName: group.name,
userSeqs: group.userSeqs.filter(
userSeq => userSeq !== req.seq
)
})
);
// 소속부서(내부서) 고정그룹 사용시 소속부서원을 삭제하지 않는다.
if (
environment.productConfig.CommonSetting.useMyDeptGroup &&
myDeptUserList.filter(deptUser => deptUser.seq === group.seq)
.length > 0
) {
// skip;;
} else {
// Group Clear..
this.store.dispatch(
updateGroup({
groupSeq: group.seq,
groupName: group.name,
userSeqs: group.userSeqs.filter(
userSeq => userSeq !== req.seq
)
})
);
}
}
}
// Favorit Clear..
this.store.dispatch(
updateBuddy({
seq: req.seq,
isFavorit: false
})
);
// 소속부서(내부서) 고정그룹 사용시 소속부서원을 삭제하지 않는다.
if (
environment.productConfig.CommonSetting.useMyDeptGroup &&
myDeptUserList.filter(deptUser => deptUser.seq === req.seq).length >
0
) {
// skip;;
} else {
// Favorit Clear..
this.store.dispatch(
updateBuddy({
seq: req.seq,
isFavorit: false
})
);
// Buddy Clear..
this.store.dispatch(delBuddy({ userSeqs: [req.seq] }));
// Buddy Clear..
this.store.dispatch(delBuddy({ userSeqs: [req.seq] }));
}
})
);
},

View File

@ -606,7 +606,10 @@
"addNew": "Add new group",
"expandMore": "Expand all groups",
"expandLess": "Collapse all groups",
"name": "Group name"
"name": "Group name",
"nameFavorit": "Favorit",
"nameMyDept": "My Dept",
"nameDefault": "Default"
},
"chat": {
"room": "Chat room",

View File

@ -606,7 +606,10 @@
"addNew": "새 그룹 추가",
"expandMore": "그룹 전체 열기",
"expandLess": "그룹 전체 닫기",
"name": "그룹 이름"
"name": "그룹 이름",
"nameFavorit": "즐겨찾기",
"nameMyDept": "소속부서",
"nameDefault": "기본"
},
"chat": {
"room": "대화방",

View File

@ -66,6 +66,9 @@ export const environment: Environment = {
CommonSetting: {
editableProfileImage: false,
useMyDeptGroup: true,
myDeptGroupSeq: -5,
useTimerRoom: false,
timerRoomDefaultInterval: 24 * 60 * 60,

View File

@ -66,6 +66,9 @@ export const environment: Environment = {
CommonSetting: {
editableProfileImage: false,
useMyDeptGroup: true,
myDeptGroupSeq: -5,
useTimerRoom: false,
timerRoomDefaultInterval: 24 * 60 * 60,

View File

@ -66,6 +66,9 @@ export const environment: Environment = {
CommonSetting: {
editableProfileImage: true,
useMyDeptGroup: false,
myDeptGroupSeq: -999,
useTimerRoom: true,
timerRoomDefaultInterval: 24 * 60 * 60,

View File

@ -66,6 +66,9 @@ export const environment: Environment = {
CommonSetting: {
editableProfileImage: true,
useMyDeptGroup: false,
myDeptGroupSeq: -999,
useTimerRoom: true,
timerRoomDefaultInterval: 24 * 60 * 60,

View File

@ -64,8 +64,14 @@ export interface Environment {
defaultSettings: Settings;
CommonSetting: {
/** 내 프로필 이미지 수정 가능 여부 */
editableProfileImage: boolean;
/** 소속부서(내부서) 그룹핑 사용여부 */
useMyDeptGroup: boolean;
/** 소속부서(내부서) 고정 그룹 SEQ */
myDeptGroupSeq: number;
/** 타이머대화방 사용유무 */
useTimerRoom: boolean;
/** 타이머대화방 기본 interval */

View File

@ -0,0 +1,3 @@
export interface OpenProfileOptions {
useDelBuddybutton?: boolean;
}

View File

@ -7,6 +7,7 @@ export * from './lib/protocols/update';
export * from './lib/services/buddy-protocol.service';
export * from './lib/types/openProfileOptions';
export * from './lib/types/service';
export * from './lib/ucap-buddy-protocol.module';

View File

@ -52,26 +52,38 @@
{{ treeControl.isExpanded(node) ? 'expand_less' : 'expand_more' }}
</mat-icon>
</button>
<ng-container [ngSwitch]="node.nodeType">
<span *ngSwitchCase="NodeType.Profile">
<span class="title-name ellipsis">내 프로필</span>
</span>
<span *ngSwitchCase="NodeType.Favorit">
<span class="title-name ellipsis">즐겨찾기</span>
<span class="text-accent-color number">
({{ node.countOfChildren }}명)</span
></span
>
<span class="title-name ellipsis">{{
'group.nameFavorit' | translate
}}</span>
</span>
<span *ngSwitchCase="NodeType.Default">
<span class="title-name ellipsis">{{
'group.nameDefault' | translate
}}</span>
</span>
<span *ngSwitchCase="NodeType.MyDept">
<span class="title-name ellipsis">{{
'group.nameMyDept' | translate
}}</span>
</span>
<span *ngSwitchCase="NodeType.Buddy">
<span class="title-name ellipsis">{{
node.groupDetail.name
}}</span>
<span class="text-accent-color number">
({{ node.countOfChildren }}명)</span
>
</span>
</ng-container>
<span class="text-accent-color number">
({{ node.countOfChildren }}명)</span
>
<mat-checkbox
*ngIf="checkable"
#checkbox

View File

@ -33,7 +33,9 @@ enum NodeType {
None = 'None',
Favorit = 'Favorit',
Profile = 'Profile',
Buddy = 'Buddy'
Buddy = 'Buddy',
Default = 'Default',
MyDept = 'MyDept'
}
interface GroupNode {
@ -111,8 +113,15 @@ export class ExpansionPanelComponent
this.buddyNodes = [];
for (const item of list) {
let nodeType = NodeType.Buddy;
if (item.group.seq === 0) {
nodeType = NodeType.Default;
} else if (item.group.seq === -5) {
nodeType = NodeType.MyDept;
}
const groupNode: GroupNode = {
nodeType: NodeType.Buddy,
nodeType,
groupDetail: item.group,
children: []
};
@ -123,7 +132,7 @@ export class ExpansionPanelComponent
item.buddyList.forEach(userInfo => {
groupNode.children.push({
nodeType: NodeType.Buddy,
nodeType,
groupDetail: item.group,
userInfo
});

View File

@ -16,6 +16,7 @@ import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
import { ExpansionPanelComponent } from './components/expansion-panel.component';
import { ExpansionPanelItemDirective } from './directives/expansion-panel-item.directive';
import { TranslateModule } from '@ngx-translate/core';
const COMPONENTS = [ExpansionPanelComponent];
const DIALOGS = [];
@ -30,6 +31,8 @@ const SERVICES = [];
ScrollingModule,
TranslateModule,
MatButtonModule,
MatExpansionModule,
MatIconModule,

View File

@ -19,6 +19,9 @@
</span>
<span class="dept">
{{ message.regDate | ucapDate: 'MM:DD' }}
<div *ngIf="message.type === MessageType.Receive && !message.readYn">
New
</div>
</span>
</div>
</dd>

View File

@ -86,50 +86,48 @@
</svg>
</span>
<span class="btn-groupadd">
<ng-container [ngSwitch]="isBuddy">
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="butt"
stroke-linejoin="round"
class="on"
*ngSwitchCase="false"
(click)="onClickAddBuddy()"
matTooltip="동료추가"
>
<!-- not buddy -->
<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
<circle cx="8.5" cy="7" r="4"></circle>
<line x1="20" y1="8" x2="20" y2="14"></line>
<line x1="23" y1="11" x2="17" y2="11"></line>
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="butt"
stroke-linejoin="round"
class="on"
*ngIf="!isBuddy"
(click)="onClickAddBuddy()"
matTooltip="동료추가"
>
<!-- not buddy -->
<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
<circle cx="8.5" cy="7" r="4"></circle>
<line x1="20" y1="8" x2="20" y2="14"></line>
<line x1="23" y1="11" x2="17" y2="11"></line>
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="butt"
stroke-linejoin="round"
class="on"
*ngSwitchCase="true"
(click)="onClickDelBuddy()"
matTooltip="동료삭제"
>
<!-- is buddy -->
<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
<circle cx="8.5" cy="7" r="4"></circle>
<line x1="23" y1="11" x2="17" y2="11"></line>
</svg>
</ng-container>
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="butt"
stroke-linejoin="round"
class="on"
*ngIf="getShowBuddyDelBtn()"
(click)="onClickDelBuddy()"
matTooltip="동료삭제"
>
<!-- is buddy -->
<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
<circle cx="8.5" cy="7" r="4"></circle>
<line x1="23" y1="11" x2="17" y2="11"></line>
</svg>
</span>
</div>
<!-- <div *ngIf="isMe" class="profile-edit">

View File

@ -9,8 +9,8 @@ import {
Inject
} from '@angular/core';
import { UserInfo } from '@ucap-webmessenger/protocol-sync';
import { UserInfoF, UserInfoSS } from '@ucap-webmessenger/protocol-query';
import { UserInfoSS } from '@ucap-webmessenger/protocol-query';
import { OpenProfileOptions } from '@ucap-webmessenger/protocol-buddy';
import { FileUploadItem } from '@ucap-webmessenger/api';
import { FormControl } from '@angular/forms';
import { SmsUtils } from '@ucap-webmessenger/daesang';
@ -37,6 +37,8 @@ export class ProfileComponent implements OnInit {
userInfo: UserInfoSS;
@Input()
myMadn?: string;
@Input()
openProfileOptions?: OpenProfileOptions;
@Output()
openChat = new EventEmitter<UserInfoSS>();
@ -194,4 +196,19 @@ export class ProfileComponent implements OnInit {
return true;
}
getShowBuddyDelBtn(): boolean {
if (!!this.isBuddy) {
if (
!!this.openProfileOptions &&
!this.openProfileOptions.useDelBuddybutton
) {
return false;
}
return true;
}
return false;
}
}