import React from 'react' import { connect } from 'react-redux' import Sidebar from './Sidebar.jsx' import imgProfil from '../img/imgProfil.png' import { getAppList, getContentTypeList, getWorkspaceList } from '../action-creator.async.js' import { setAppList, setContentTypeList, setWorkspaceListIsOpenInSidebar, updateWorkspaceListData } from '../action-creator.sync.js' import { translate } from 'react-i18next' class Dashboard extends React.Component { constructor (props) { super(props) this.state = { workspaceIdInUrl: props.match.params.idws ? parseInt(props.match.params.idws) : null, // this is used to avoid handling the parseInt everytime displayNewMemberDashboard: false, displayNotifBtn: false, displayWebdavBtn: false, displayCalendarBtn: false } } async componentDidMount () { const { workspaceIdInUrl } = this.state const { user, workspaceList, app, contentType, dispatch } = this.props console.log(' componentDidMount') if (app.length === 0) { const fetchGetAppList = await dispatch(getAppList(user)) if (fetchGetAppList.status === 200) dispatch(setAppList(fetchGetAppList.json)) } if (contentType.length === 0) { const fetchGetContentTypeList = await dispatch(getContentTypeList(user)) if (fetchGetContentTypeList.status === 200) dispatch(setContentTypeList(fetchGetContentTypeList.json)) } if (user.user_id !== -1 && workspaceList.length === 0) { const fetchGetWorkspaceList = await dispatch(getWorkspaceList(user)) if (fetchGetWorkspaceList.status === 200) { dispatch(updateWorkspaceListData(fetchGetWorkspaceList.json)) dispatch(setWorkspaceListIsOpenInSidebar(workspaceIdInUrl || fetchGetWorkspaceList.json[0].workspace_id, true)) } } } handleToggleNewMemberDashboard = () => this.setState(prevState => ({ displayNewMemberDashboard: !prevState.displayNewMemberDashboard })) handleToggleNotifBtn = () => this.setState(prevState => ({ displayNotifBtn: !prevState.displayNotifBtn })) handleToggleWebdavBtn = () => this.setState(prevState => ({ displayWebdavBtn: !prevState.displayWebdavBtn })) handleToggleCalendarBtn = () => this.setState(prevState => ({ displayCalendarBtn: !prevState.displayCalendarBtn })) render () { return (
{this.props.t('Dashboard')}
Développement tracim
Ligne directive pour le prochain design de Tracim et des futurs fonctionnalités.
Hi ! Alexi, vous êtes actuellement
Gestionnaire de projet
Vous êtes abonné(e) aux notifications de ce workspace
{this.state.displayNotifBtn === false &&
{this.props.t('Change your status')}
} {this.state.displayNotifBtn === true &&
{this.props.t('subscriber')}
{this.props.t('unsubscribed')}
}
{this.props.t('Start a new Thread')}
{this.props.t('Writing a document')}
{this.props.t('Upload a file')}
{/*
{this.props.t('Start a videoconference')}
{this.props.t('View the Calendar')}
*/ }
{this.props.t('Explore the workspace')}
{this.props.t('Recent activity')}
{this.props.t('Mark everything as read')}
Développement Tracim
Mission externe
Recherche et developpement
Marketing
Évolution
Commercialisation
{this.props.t('See more')}
{this.props.t('Member List')}
{this.state.displayNewMemberDashboard === false &&
  • avatar
    Jean Dupont
    Responsable
  • avatar
    Aldwin Vinel
    Lecteur
  • avatar
    William Himme
    Contributeur
  • avatar
    Yacine Lite
    Contributeur
  • avatar
    Alexi Falcin
    Gestionnaire
  • avatar
    Mickaël Fonati
    Gestionnaire
  • avatar
    Eva Lonbard
    Gestionnaire
{this.props.t('Add a member')}
} {this.state.displayNewMemberDashboard === true &&
{this.props.t('Create an account')}
{this.props.t('Choose the role of the member')}
  • {this.props.t('Supervisor')}
  • {this.props.t('Content Manager')}
  • {this.props.t('Contributor')}
  • {this.props.t('Reader')}
}
{this.props.t('Implement Tracim in your explorer')}
{this.state.displayWebdavBtn === true &&
{this.props.t('Find all your documents deposited online directly on your computer via the workstation, without going through the software.')}'
http://algoo.trac.im/webdav/
}
{this.props.t('Workspace Calendar')}
{this.state.displayCalendarBtn === true &&
{this.props.t('Each workspace has its own calendar.')}
http://algoo.trac.im/calendar/
}
) } } const mapStateToProps = ({ user, app, contentType, workspaceList }) => ({ user, app, contentType, workspaceList }) export default connect(mapStateToProps)(translate()(Dashboard))