[Update Package] whole packages updated.

This commit is contained in:
Qolzam
2018-12-07 09:45:06 +07:00
parent 48a86a5b6e
commit c128b9d599
58 changed files with 2545 additions and 2539 deletions

View File

@@ -13,7 +13,7 @@ import { Map } from 'immutable'
* @param {object} state
* @param {object} action
*/
export let authorizeReducer = (state = Map(new AuthorizeState()), action: IAuthorizeAction) => {
export let authorizeReducer = (state = Map(new AuthorizeState() as any), action: IAuthorizeAction) => {
const { payload } = action
switch (action.type) {
case AuthorizeActionType.LOGIN:

View File

@@ -3,22 +3,16 @@ import {Map} from 'immutable'
/**
* Circle state
*
* @export
* @class CircleState
*/
export class CircleState {
[key: string]: any
/**
* The list of users belong to users circle
*
* @memberof CircleState
*/
userTies: Map<string, UserTie> = Map({})
/**
* The list of users belong to users circle
*
* @memberof CircleState
*/
userTieds: Map<string, UserTie> = Map({})
@@ -49,8 +43,6 @@ export class CircleState {
/**
* If user circles are loaded {true} or not {false}
*
* @memberof CircleState
*/
loaded: boolean = false

View File

@@ -136,11 +136,10 @@ export let circleReducer = (state = Map(new CircleState()), action: ICircleActio
/**
* Map user ties selected to selected circles
*/
const getSelectedCircles = (userTies: { [userId: string]: UserTie }) => {
const getSelectedCircles = (userTies: Map<string, any>) => {
let selectedCircles: Map<string, List<string>> = Map({})
Object.keys(userTies).forEach((userId: string) => {
const userTie = (userTies as { [userId: string]: UserTie })[userId]
selectedCircles = selectedCircles.set(userTie.userId!, List(userTie.circleIdList!))
userTies.forEach((userTie) => {
selectedCircles = selectedCircles.set(userTie.get('userId'), List(userTie.get('circleIdList')))
})
return selectedCircles

View File

@@ -9,6 +9,8 @@ import {Map} from 'immutable'
*/
export class CommentState {
[key: string]: any
/**
* The list of comments on the posts
*/

View File

@@ -25,7 +25,7 @@ export let commentReducer = (state = Map(new CommentState()), action: ICommentAc
/* _____________ CRUD _____________ */
case CommentActionType.ADD_COMMENT:
return state
.setIn(['postComments', payload.postId, payload.id], payload)
.setIn(['postComments', payload.get('postId'), payload.get('id')], payload)
case CommentActionType.ADD_COMMENT_LIST:
return state

View File

@@ -7,6 +7,8 @@ import { Map, fromJS, List } from 'immutable'
*/
export class GlobalState {
[key: string]: any
/**
* Set percent of loading progress and visibility for Master component
*

View File

@@ -8,6 +8,8 @@ import {Map, Collection, List} from 'immutable'
* @class ImageGalleryState
*/
export class ImageGalleryState {
[key: string]: any
/**
* Image gallery is open {true} or not {false}

View File

@@ -9,6 +9,8 @@ import {Map} from 'immutable'
*/
export class NotificationState {
[key: string]: any
/**
* The list of users notification
*/

View File

@@ -8,7 +8,7 @@ import { Map, fromJS, List } from 'immutable'
* @class PostState
*/
export class PostState {
[key: string]: any
/**
* The list of user posts
*

View File

@@ -14,10 +14,10 @@ import { postReducer } from './posts'
import { userReducer } from './users'
import { voteReducer } from './votes'
import { serverReducer } from './server'
import { routerReducer, routerMiddleware } from 'react-router-redux'
import { connectRouter } from 'connected-react-router/immutable'
// - Reducers
export const rootReducer = combineReducers({
export const rootReducer = (history: any) => combineReducers({
locale,
imageGallery: imageGalleryReducer,
post: postReducer,
@@ -26,7 +26,7 @@ export const rootReducer = combineReducers({
vote: voteReducer,
server: serverReducer,
authorize: authorizeReducer,
router: routerReducer,
router: connectRouter(history),
user: userReducer,
notify: notificationReducer,
global: globalReducer

View File

@@ -8,7 +8,7 @@ import {Map} from 'immutable'
* @class ServerState
*/
export class ServerState {
[key: string]: any
/**
* The list of posts server
* @memberof ServerState

View File

@@ -8,6 +8,7 @@ import { Map, fromJS, List } from 'immutable'
* @class UserState
*/
export class UserState {
[key: string]: any
/**
* The list of users information
*/

View File

@@ -7,7 +7,7 @@ import { Vote } from 'src/core/domain/votes'
* @class VoteState
*/
export class VoteState {
[key: string]: any
/**
* The list of posts vote
*