notification of status is implemented
This commit is contained in:
parent
9b0106a4be
commit
e9088572d5
@ -12,8 +12,6 @@ import {
|
|||||||
LogoutRemoteNotification
|
LogoutRemoteNotification
|
||||||
} from '@ucap-webmessenger/protocol-authentication';
|
} from '@ucap-webmessenger/protocol-authentication';
|
||||||
|
|
||||||
import * as AuthenticationStore from '@app/store/account/authentication';
|
|
||||||
import * as EventStore from '@app/store/messenger/event';
|
|
||||||
import { NGXLogger } from 'ngx-logger';
|
import { NGXLogger } from 'ngx-logger';
|
||||||
import {
|
import {
|
||||||
EventProtocolService,
|
EventProtocolService,
|
||||||
@ -53,6 +51,12 @@ import {
|
|||||||
UpdateFontNotification
|
UpdateFontNotification
|
||||||
} from '@ucap-webmessenger/protocol-room';
|
} from '@ucap-webmessenger/protocol-room';
|
||||||
|
|
||||||
|
import * as AuthenticationStore from '@app/store/account/authentication';
|
||||||
|
import * as InfoStore from '@app/store/account/info';
|
||||||
|
import * as EventStore from '@app/store/messenger/event';
|
||||||
|
import * as RoomStore from '@app/store/messenger/room';
|
||||||
|
import * as StatusStore from '@app/store/messenger/status';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AppNotificationService {
|
export class AppNotificationService {
|
||||||
constructor(
|
constructor(
|
||||||
@ -175,6 +179,11 @@ export class AppNotificationService {
|
|||||||
'Notification::infoProtocolService::UserNotification',
|
'Notification::infoProtocolService::UserNotification',
|
||||||
noti
|
noti
|
||||||
);
|
);
|
||||||
|
this.store.dispatch(
|
||||||
|
InfoStore.userNotification({
|
||||||
|
noti
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -194,6 +203,11 @@ export class AppNotificationService {
|
|||||||
'Notification::roomProtocolService::InviteNotification',
|
'Notification::roomProtocolService::InviteNotification',
|
||||||
noti
|
noti
|
||||||
);
|
);
|
||||||
|
this.store.dispatch(
|
||||||
|
RoomStore.inviteNotification({
|
||||||
|
noti
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SSVC_TYPE_ROOM_EXIT_NOTI:
|
case SSVC_TYPE_ROOM_EXIT_NOTI:
|
||||||
@ -203,6 +217,11 @@ export class AppNotificationService {
|
|||||||
'Notification::roomProtocolService::ExitNotification',
|
'Notification::roomProtocolService::ExitNotification',
|
||||||
noti
|
noti
|
||||||
);
|
);
|
||||||
|
this.store.dispatch(
|
||||||
|
RoomStore.exitNotification({
|
||||||
|
noti
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SSVC_TYPE_ROOM_EXIT_FORCING_NOTI:
|
case SSVC_TYPE_ROOM_EXIT_FORCING_NOTI:
|
||||||
@ -212,6 +231,11 @@ export class AppNotificationService {
|
|||||||
'Notification::roomProtocolService::ExitForcingNotification',
|
'Notification::roomProtocolService::ExitForcingNotification',
|
||||||
noti
|
noti
|
||||||
);
|
);
|
||||||
|
this.store.dispatch(
|
||||||
|
RoomStore.exitForcingNotification({
|
||||||
|
noti
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SSVC_TYPE_ROOM_FONT_UPD_NOTI:
|
case SSVC_TYPE_ROOM_FONT_UPD_NOTI:
|
||||||
@ -221,6 +245,11 @@ export class AppNotificationService {
|
|||||||
'Notification::roomProtocolService::UpdateFontNotification',
|
'Notification::roomProtocolService::UpdateFontNotification',
|
||||||
noti
|
noti
|
||||||
);
|
);
|
||||||
|
this.store.dispatch(
|
||||||
|
RoomStore.updateFontNotification({
|
||||||
|
noti
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -240,6 +269,11 @@ export class AppNotificationService {
|
|||||||
'Notification::statusProtocolService::StatusNotification',
|
'Notification::statusProtocolService::StatusNotification',
|
||||||
noti
|
noti
|
||||||
);
|
);
|
||||||
|
this.store.dispatch(
|
||||||
|
StatusStore.statusNotification({
|
||||||
|
noti
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -73,16 +73,16 @@ export class Effects {
|
|||||||
{ dispatch: false }
|
{ dispatch: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
statusNotification$ = createEffect(
|
// statusNotification$ = createEffect(
|
||||||
() => {
|
// () => {
|
||||||
return this.actions$.pipe(
|
// return this.actions$.pipe(
|
||||||
ofType(statusNotification),
|
// ofType(statusNotification),
|
||||||
map(action => action.noti),
|
// map(action => action.noti),
|
||||||
tap(noti => {})
|
// tap(noti => {})
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
{ dispatch: false }
|
// { dispatch: false }
|
||||||
);
|
// );
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private actions$: Actions,
|
private actions$: Actions,
|
||||||
|
@ -1,15 +1,41 @@
|
|||||||
import { createReducer, on } from '@ngrx/store';
|
import { createReducer, on } from '@ngrx/store';
|
||||||
import { initialState } from './state';
|
import { initialState, State, adapterStatusBulkInfo } from './state';
|
||||||
import { bulkInfoSuccess } from './actions';
|
import { bulkInfoSuccess, statusNotification } from './actions';
|
||||||
|
|
||||||
import * as AuthenticationStore from '@app/store/account/authentication';
|
import * as AuthenticationStore from '@app/store/account/authentication';
|
||||||
|
import { StatusBulkInfo } from '@ucap-webmessenger/protocol-status';
|
||||||
|
|
||||||
export const reducer = createReducer(
|
export const reducer = createReducer(
|
||||||
initialState,
|
initialState,
|
||||||
on(bulkInfoSuccess, (state, action) => {
|
on(bulkInfoSuccess, (state, action) => {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
statusBulkInfoList: action.statusBulkInfoList
|
statusBulkInfo: adapterStatusBulkInfo.addAll(action.statusBulkInfoList, {
|
||||||
|
...state.statusBulkInfo
|
||||||
|
})
|
||||||
|
} as State;
|
||||||
|
}),
|
||||||
|
|
||||||
|
on(statusNotification, (state, action) => {
|
||||||
|
const noti = action.noti;
|
||||||
|
|
||||||
|
const statusBulkInfoState: StatusBulkInfo = {
|
||||||
|
...state.statusBulkInfo.entities[noti.userSeq],
|
||||||
|
conferenceStatus: noti.conferenceStatus,
|
||||||
|
imessengerStatus: noti.imessengerStatus,
|
||||||
|
mobileConferenceStatus: noti.mobileConferenceStatus,
|
||||||
|
mobileStatus: noti.mobileStatus,
|
||||||
|
pcStatus: noti.pcStatus,
|
||||||
|
phoneStatus: noti.phoneStatus,
|
||||||
|
statusMessage: noti.statusMessage
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
statusBulkInfo: adapterStatusBulkInfo.updateOne(
|
||||||
|
{ id: noti.userSeq, changes: statusBulkInfoState },
|
||||||
|
{ ...state.statusBulkInfo }
|
||||||
|
)
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
@ -1,19 +1,48 @@
|
|||||||
import { Selector, createSelector } from '@ngrx/store';
|
import { Selector, createSelector } from '@ngrx/store';
|
||||||
import { StatusBulkInfo } from '@ucap-webmessenger/protocol-status';
|
import { StatusBulkInfo } from '@ucap-webmessenger/protocol-status';
|
||||||
|
import { EntityState, createEntityAdapter } from '@ngrx/entity';
|
||||||
|
|
||||||
|
export interface StatusBulkInfoState extends EntityState<StatusBulkInfo> {}
|
||||||
|
|
||||||
export interface State {
|
export interface State {
|
||||||
statusBulkInfoList: StatusBulkInfo[];
|
statusBulkInfo: StatusBulkInfoState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const adapterStatusBulkInfo = createEntityAdapter<StatusBulkInfo>({
|
||||||
|
selectId: statusBulkInfo => statusBulkInfo.userSeq
|
||||||
|
});
|
||||||
|
|
||||||
|
const statusBulkInfoInitialState: StatusBulkInfoState = adapterStatusBulkInfo.getInitialState(
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
export const initialState: State = {
|
export const initialState: State = {
|
||||||
statusBulkInfoList: []
|
statusBulkInfo: statusBulkInfoInitialState
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const {
|
||||||
|
selectAll: ngeSelectAllStatusBulkInfo,
|
||||||
|
selectEntities: ngeSelectEntitiesStatusBulkInfo,
|
||||||
|
selectIds: ngeSelectIdsStatusBulkInfo,
|
||||||
|
selectTotal: ngeSelectTotalStatusBulkInfo
|
||||||
|
} = adapterStatusBulkInfo.getSelectors();
|
||||||
|
|
||||||
export function selectors<S>(selector: Selector<any, State>) {
|
export function selectors<S>(selector: Selector<any, State>) {
|
||||||
return {
|
const selectStatusBulkInfo = createSelector(
|
||||||
statusBulkInfoList: createSelector(
|
|
||||||
selector,
|
selector,
|
||||||
(state: State) => state.statusBulkInfoList
|
(state: State) => state.statusBulkInfo
|
||||||
|
);
|
||||||
|
|
||||||
|
return {
|
||||||
|
selectAllStatusBulkInfo: createSelector(
|
||||||
|
selectStatusBulkInfo,
|
||||||
|
ngeSelectAllStatusBulkInfo
|
||||||
|
),
|
||||||
|
selectStatusBulkInfo: (userSeq: number) =>
|
||||||
|
createSelector(
|
||||||
|
selectStatusBulkInfo,
|
||||||
|
ngeSelectEntitiesStatusBulkInfo,
|
||||||
|
(_, entities) => entities[userSeq]
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -286,6 +286,7 @@ export class RoomProtocolService {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public updateTimerSet(
|
public updateTimerSet(
|
||||||
req: UpdateTimerSetRequest
|
req: UpdateTimerSetRequest
|
||||||
): Observable<UpdateTimerSetResponse> {
|
): Observable<UpdateTimerSetResponse> {
|
||||||
@ -302,6 +303,7 @@ export class RoomProtocolService {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public updateFont(req: UpdateFontRequest): Observable<UpdateFontResponse> {
|
public updateFont(req: UpdateFontRequest): Observable<UpdateFontResponse> {
|
||||||
return this.protocolService
|
return this.protocolService
|
||||||
.call(
|
.call(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user