Commit ac19ac50 authored by PDuarte's avatar PDuarte

clear selected project

parent e79c85e0
......@@ -2,7 +2,7 @@
import { Link } from 'react-router-dom'
// ** Store & Actions
import { getProject } from '../store/actions'
import { getProject, cleanProject } from '../store/actions'
import { store } from '@store/storeConfig/store'
// ** Custom Components
......@@ -259,7 +259,7 @@ export const serverSideColumns = [
<Link
to={`/settings/projects/edit/${row.id}`}
className='user-name text-truncate mb-0'
// onClick={() => store.dispatch(getProject(row.id))}
onClick={() => store.dispatch(cleanProject(row.id))}
>
<span className='font-weight-bold'>{row.app_name}</span>
</Link>
......
......@@ -34,8 +34,8 @@ const ProjectsEdit = () => {
return store.selectedProject !== null && store.selectedProject !== undefined ? (
<ProjectCard selectedProject={store.selectedProject} />
) : (
<Alert color='danger'>
<h4 className='alert-heading'>Project not found</h4>
<Alert color='info'>
<h4 className='alert-heading'>Loading Project</h4>
<div className='alert-body'>
User with id: {id} doesn't exist. Check list of all Projects: <Link to='/settings/projects'>Projects List</Link>
</div>
......
......@@ -30,7 +30,7 @@ const SuccessProgressToast = () => (
<Avatar size='sm' color='success' icon={<Check size={12} />} />
<h6 className='toast-title'>Saving Project !</h6>
</div>
<small className='text-muted'>now</small>
<small className='text-muted'></small>
</div>
<div className='toastify-body'>
<span role='img' aria-label='toast-text'>
......
......@@ -71,6 +71,15 @@ export const getProject = id => {
}
}
export const cleanProject = id => {
return async dispatch => {
dispatch({
type: 'GET_PROJECT',
data: null
})
}
}
// ** Add new project
export const updateProject = project => {
return (dispatch, getState) => {
......
......@@ -50,12 +50,11 @@ const settings = (state = initialState, action) => {
allDataProjects: action.allData,
dataProjects: action.data,
totalProjects: action.totalPages,
selectedProject: null,
// selectedProject: null,
paramsProjects: action.params
}
case 'GET_PROJECT':
return { ...state,
selectedProject : action.data
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment