Skip to content
This repository has been archived by the owner on Aug 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request #488 from h3poteto/update/echo/v4
Browse files Browse the repository at this point in the history
Update echo version to v4.1.11
  • Loading branch information
h3poteto committed Nov 10, 2019
2 parents 867a789 + 96eb145 commit 9118b65
Show file tree
Hide file tree
Showing 35 changed files with 325 additions and 228 deletions.
6 changes: 4 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
"plugin:react/recommended",
"prettier"
],
"parserOptions": {
"ecmaFeatures": {
Expand All @@ -18,7 +19,8 @@
"sourceType": "module"
},
"plugins": [
"react"
"react",
"prettier"
],
"rules": {
"quotes": [
Expand Down
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"printWidth": 140
}
115 changes: 56 additions & 59 deletions frontend/javascripts/actions/ListAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export function openEditListModal(list) {
}
}


export const REQUEST_LISTS = 'REQUEST_LISTS'
function requestLists() {
return {
Expand All @@ -56,14 +55,14 @@ export function fetchLists(projectID) {
return dispatch => {
dispatch(requestLists())
return axios
.get(`/projects/${projectID}/lists`)
.then((res) => {
.get(`/api/projects/${projectID}/lists`)
.then(res => {
dispatch(receiveLists(res.data))
})
.catch((err) => {
.catch(err => {
ErrorHandler(err)
.then()
.catch((error) => {
.catch(error => {
dispatch(ServerError(error))
})
})
Expand All @@ -89,21 +88,20 @@ export function fetchProject(projectID) {
return dispatch => {
dispatch(requestProject())
return axios
.get(`/projects/${projectID}/show`)
.then((res) => {
.get(`/api/projects/${projectID}/show`)
.then(res => {
dispatch(receiveProject(res.data))
})
.catch((err) => {
.catch(err => {
ErrorHandlerWithoutSubmission(err)
.then()
.catch((error) => {
.catch(error => {
dispatch(ServerError(error))
})
})
}
}


export const TASK_DRAG_START = 'TASK_DRAG_START'
export function taskDragStart(ev) {
ev.dataTransfer.effectAllowed = 'moved'
Expand Down Expand Up @@ -159,18 +157,18 @@ export function taskDrop(projectID, taskDraggingFrom, taskDraggingTo) {
return dispatch => {
dispatch(requestMoveTask())
return axios
.post(`/projects/${projectID}/lists/${taskDraggingFrom.fromList.ID}/tasks/${taskDraggingFrom.fromTask.ID}/move_task`, {
.post(`/api/projects/${projectID}/lists/${taskDraggingFrom.fromList.ID}/tasks/${taskDraggingFrom.fromTask.ID}/move_task`, {
to_list_id: taskDraggingTo.toList.ID,
prev_to_task_id: prevToTaskID,
prev_to_task_id: prevToTaskID
})
.then((res) => {
.then(res => {
dispatch(receiveMoveTask(res.data))
})
.catch((err) => {
.catch(err => {
// TODO: ここはドラッグしたviewを元に戻す必要がある
ErrorHandlerWithoutSubmission(err)
.then()
.catch((error) => {
.catch(error => {
dispatch(ServerError(error))
})
})
Expand All @@ -186,22 +184,22 @@ export const TASK_DRAG_OVER = 'TASK_DRAG_OVER'
export function taskDragOver(ev) {
ev.preventDefault()
var targetList
switch(ev.target.dataset.droppedDepth) {
case '0':
targetList = ev.target
break
case '1':
targetList = ev.target.parentNode
break
case '2':
targetList = ev.target.parentNode.parentNode
break
case '3':
targetList = ev.target.parentNode.parentNode.parentNode
break
default:
targetList = ev.target.parentNode.parentNode
break
switch (ev.target.dataset.droppedDepth) {
case '0':
targetList = ev.target
break
case '1':
targetList = ev.target.parentNode
break
case '2':
targetList = ev.target.parentNode.parentNode
break
case '3':
targetList = ev.target.parentNode.parentNode.parentNode
break
default:
targetList = ev.target.parentNode.parentNode
break
}
return {
type: TASK_DRAG_OVER,
Expand Down Expand Up @@ -232,16 +230,16 @@ export function fetchProjectGithub(projectID) {
dispatch(startLoading())
dispatch(requestFetchGithub())
return axios
.post(`/projects/${projectID}/fetch_github`)
.then((res) => {
.post(`/api/projects/${projectID}/fetch_github`)
.then(res => {
dispatch(stopLoading())
dispatch(receiveFetchGithub(res.data))
})
.catch((err) => {
.catch(err => {
dispatch(stopLoading())
ErrorHandlerWithoutSubmission(err)
.then()
.catch((error) => {
.catch(error => {
dispatch(ServerError(error))
})
})
Expand All @@ -268,14 +266,14 @@ export function fetchListOptions() {
return dispatch => {
dispatch(requestListOptions())
return axios
.get('/list_options')
.then((res) => {
.get('/api/list_options')
.then(res => {
dispatch(receiveListOptions(res.data))
})
.catch((err) => {
.catch(err => {
ErrorHandlerWithoutSubmission(err)
.then()
.catch((error) => {
.catch(error => {
dispatch(ServerError(error))
})
})
Expand All @@ -302,17 +300,17 @@ export function showIssues(projectID, showIssues, showPullRequests) {
return dispatch => {
dispatch(requestSettingsProject())
return axios
.patch(`/projects/${projectID}/settings`, {
.patch(`/api/projects/${projectID}/settings`, {
show_issues: !showIssues,
show_pull_requests: showPullRequests,
show_pull_requests: showPullRequests
})
.then((res) => {
.then(res => {
dispatch(receiveProject(res.data))
})
.catch((err) => {
.catch(err => {
ErrorHandlerWithoutSubmission(err)
.then()
.catch((error) => {
.catch(error => {
dispatch(ServerError(error))
})
})
Expand All @@ -324,24 +322,23 @@ export function showPullRequests(projectID, showIssues, showPullRequests) {
return dispatch => {
dispatch(requestSettingsProject())
return axios
.patch(`/projects/${projectID}/settings`, {
.patch(`/api/projects/${projectID}/settings`, {
show_issues: showIssues,
show_pull_requests: !showPullRequests,
show_pull_requests: !showPullRequests
})
.then((res) => {
.then(res => {
dispatch(receiveProject(res.data))
})
.catch((err) => {
.catch(err => {
ErrorHandlerWithoutSubmission(err)
.then()
.catch((error) => {
.catch(error => {
dispatch(ServerError(error))
})
})
}
}


export const REQUEST_HIDE_LIST = 'REQUEST_HIDE_LIST'
function requestHideList() {
return {
Expand All @@ -363,14 +360,14 @@ export function hideList(projectID, listID) {
return dispatch => {
dispatch(requestHideList())
return axios
.patch(`/projects/${projectID}/lists/${listID}/hide`)
.then((res) => {
.patch(`/api/projects/${projectID}/lists/${listID}/hide`)
.then(res => {
dispatch(receiveHideList(res.data))
})
.catch((err) => {
.catch(err => {
ErrorHandlerWithoutSubmission(err)
.then()
.catch((error) => {
.catch(error => {
dispatch(ServerError(error))
})
})
Expand Down Expand Up @@ -398,14 +395,14 @@ export function displayList(projectID, listID) {
return dispatch => {
dispatch(requestDisplayList())
return axios
.patch(`/projects/${projectID}/lists/${listID}/display`)
.then((res) => {
.patch(`/api/projects/${projectID}/lists/${listID}/display`)
.then(res => {
dispatch(receiveDisplayList(res.data))
})
.catch((err) => {
.catch(err => {
ErrorHandlerWithoutSubmission(err)
.then()
.catch((error) => {
.catch(error => {
dispatch(ServerError(error))
})
})
Expand All @@ -423,6 +420,6 @@ export function openShowTaskModal(task) {
export const OPEN_DELETE_PROJECT = 'OPEN_DELETE_PROJECT'
export function openDeleteProjectModal() {
return {
type: OPEN_DELETE_PROJECT,
type: OPEN_DELETE_PROJECT
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,45 @@ import { startLoading, stopLoading } from '../Loading'
export const CLOSE_DELETE_PROJECT = 'CLOSE_DELETE_PROJECT'
export function closeDeleteProjectModal() {
return {
type: CLOSE_DELETE_PROJECT,
type: CLOSE_DELETE_PROJECT
}
}

export const REQUEST_DELETE_PROJECT = 'REQUEST_DELETE_PROJECT'
function requestDeleteProject() {
return {
type: REQUEST_DELETE_PROJECT,
type: REQUEST_DELETE_PROJECT
}
}

export const RECEIVE_DELETE_PROJECT = 'RECEIVE_DELETE_PROJECT'
function receiveDeleteProject() {
return {
type: RECEIVE_DELETE_PROJECT,
type: RECEIVE_DELETE_PROJECT
}
}

export function fetchDeleteProject() {
return (dispatch, getState) => {
const { ListReducer: { project: { ID: projectID }}} = getState()
const {
ListReducer: {
project: { ID: projectID }
}
} = getState()
dispatch(startLoading())
dispatch(requestDeleteProject())
return axios
.delete(`/projects/${projectID}`)
.then((res) => {
.delete(`/api/projects/${projectID}`)
.then(res => {
dispatch(stopLoading())
dispatch(receiveDeleteProject(res.data))
dispatch(push('/'))
})
.catch((err) => {
.catch(err => {
dispatch(stopLoading())
ErrorHandler(err)
.then()
.catch((error) => {
.catch(error => {
dispatch(ServerError(error))
})
})
Expand Down

0 comments on commit 9118b65

Please sign in to comment.