Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/components/Layout/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ class Layout extends Component {
}
}

const mapStateToProps = ({ loadUser }) => {
const mapStateToProps = ({ loadUser, projectState, projectSearch }) => {
const projectDetailApiCheck = !projectState.isLoading && !!projectState.error && projectState.error.code === 404
const projectListingApiCheck = !projectSearch.isLoading && !!projectSearch.error
return {
user : loadUser.user,
isLoadingUser: loadUser.isLoading
isLoadingUser: loadUser.isLoading,
maintenanceMode: projectDetailApiCheck || projectListingApiCheck
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/components/Layout/Layout.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import Footer from '../Footer/Footer'
import { MAINTENANCE_MODE } from '../../config/constants'
// import { MAINTENANCE_MODE } from '../../config/constants'
import Alert from 'react-s-alert'
import cn from 'classnames'
import Maintenance from '../Maintenance/Maintenance'
Expand All @@ -12,11 +12,11 @@ import '../../styles/vendors/s-alert-default.css'
import 'react-s-alert/dist/s-alert-css-effects/slide.css'

const Layout = (props) => {
const { isLoadingUser } = props
const { isLoadingUser, maintenanceMode } = props

if (isLoadingUser) {
return (<div />)
} else if (MAINTENANCE_MODE) {
} else if (maintenanceMode) {
return <Maintenance />
} else {
return (
Expand Down
3 changes: 2 additions & 1 deletion src/projects/reducers/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ const initialState = {

const parseErrorObj = (action) => {
const data = _.get(action.payload, 'response.data.result')
const httpStatus = _.get(action.payload, 'response.status')
return {
type: action.type,
code: _.get(data, 'status', 500),
code: _.get(data, 'status', httpStatus || 500),
msg: _.get(data, 'content.message', ''),
details: JSON.parse(_.get(data, 'details', null))
}
Expand Down