Migration du client sur Typescript
This commit is contained in:
@ -4,7 +4,7 @@ export const defaultState = {
|
||||
byID: {},
|
||||
};
|
||||
|
||||
export function boardsReducer(state = defaultState, action) {
|
||||
export function boardsReducer(state = defaultState, action: any) {
|
||||
switch(action.type) {
|
||||
case SAVE_BOARD_SUCCESS:
|
||||
return handleSaveBoardSuccess(state, action);
|
||||
@ -15,7 +15,7 @@ export function boardsReducer(state = defaultState, action) {
|
||||
}
|
||||
}
|
||||
|
||||
function handleSaveBoardSuccess(state, action) {
|
||||
function handleSaveBoardSuccess(state: any, action: any) {
|
||||
const { board } = action;
|
||||
return {
|
||||
...state,
|
||||
@ -28,8 +28,8 @@ function handleSaveBoardSuccess(state, action) {
|
||||
};
|
||||
}
|
||||
|
||||
function handleFetchBoardsSuccess(state, action) {
|
||||
const boardsByID = action.boards.reduce((byID, board) => {
|
||||
function handleFetchBoardsSuccess(state: any, action: any) {
|
||||
const boardsByID = action.boards.reduce((byID: any, board: any) => {
|
||||
byID[board.id] = board;
|
||||
return byID;
|
||||
}, {});
|
@ -2,7 +2,7 @@ const defaultState = {
|
||||
actions: {}
|
||||
};
|
||||
|
||||
export function flagsReducer(state = defaultState, action) {
|
||||
export function flagsReducer(state = defaultState, action: any) {
|
||||
const matches = (/^(.*)_((SUCCESS)|(FAILURE)|(REQUEST))$/).exec(action.type);
|
||||
|
||||
if(!matches) return state;
|
@ -4,7 +4,7 @@ const defaultState = {
|
||||
byProject: {}
|
||||
};
|
||||
|
||||
export function issuesReducer(state = defaultState, action) {
|
||||
export function issuesReducer(state = defaultState, action: any) {
|
||||
switch(action.type) {
|
||||
case FETCH_ISSUES_SUCCESS:
|
||||
return handleFetchIssuesSuccess(state, action);
|
||||
@ -16,7 +16,7 @@ export function issuesReducer(state = defaultState, action) {
|
||||
|
||||
}
|
||||
|
||||
function handleFetchIssuesSuccess(state, action) {
|
||||
function handleFetchIssuesSuccess(state: any, action: any) {
|
||||
return {
|
||||
...state,
|
||||
byProject: {
|
||||
@ -28,7 +28,7 @@ function handleFetchIssuesSuccess(state, action) {
|
||||
}
|
||||
}
|
||||
|
||||
function handleCreateIssueSuccess(state, action) {
|
||||
function handleCreateIssueSuccess(state: any, action: any) {
|
||||
return {
|
||||
...state,
|
||||
byProject: {
|
@ -5,7 +5,7 @@ export const defaultState = {
|
||||
byID: {},
|
||||
};
|
||||
|
||||
export function kanboardsReducer(state = defaultState, action) {
|
||||
export function kanboardsReducer(state = defaultState, action: any) {
|
||||
switch(action.type) {
|
||||
case BUILD_KANBOARD_SUCCESS:
|
||||
return handleBuildKanboardSuccess(state, action);
|
||||
@ -16,7 +16,7 @@ export function kanboardsReducer(state = defaultState, action) {
|
||||
}
|
||||
}
|
||||
|
||||
function handleBuildKanboardSuccess(state, action) {
|
||||
function handleBuildKanboardSuccess(state: any, action: any) {
|
||||
return {
|
||||
...state,
|
||||
byID: {
|
||||
@ -28,7 +28,7 @@ function handleBuildKanboardSuccess(state, action) {
|
||||
};
|
||||
}
|
||||
|
||||
function handleMoveCard(state, action) {
|
||||
function handleMoveCard(state: any, action: any) {
|
||||
const {
|
||||
boardID, fromLaneID,
|
||||
fromPosition, toLaneID,
|
@ -4,7 +4,7 @@ export const defaultState = {
|
||||
byName: {},
|
||||
};
|
||||
|
||||
export function projectsReducer(state = defaultState, action) {
|
||||
export function projectsReducer(state = defaultState, action: any) {
|
||||
switch(action.type) {
|
||||
case FETCH_PROJECTS_SUCCESS:
|
||||
return handleFetchProjectsSuccess(state, action);
|
||||
@ -13,8 +13,8 @@ export function projectsReducer(state = defaultState, action) {
|
||||
}
|
||||
}
|
||||
|
||||
function handleFetchProjectsSuccess(state, action) {
|
||||
const projectsByName = action.projects.reduce((byName, project) => {
|
||||
function handleFetchProjectsSuccess(state: any, action: any) {
|
||||
const projectsByName = action.projects.reduce((byName: any, project: any) => {
|
||||
byName[project.full_name] = project;
|
||||
return byName;
|
||||
}, {});
|
Reference in New Issue
Block a user