Skip to content
Snippets Groups Projects
Commit f02aec1d authored by Chif Gergő's avatar Chif Gergő
Browse files

Merge branch 'homework_page' of https://github.com/DevTeamSCH/kszkepzes-frontend into audit

parents 4bc146e8 30d883f1
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,9 @@ import { connect } from 'react-redux';
import CorrectSolutionForm from './CorrectSolutionForm';
import { emptyMessage } from '../pages/Homework';
import './Forms.css';
import {
getSolutions,
} from '../../actions/homework';
class SolutionDetailsForm extends Component {
constructor(props) {
......@@ -45,7 +48,13 @@ class SolutionDetailsForm extends Component {
<Modal
open={this.state.showModal}
trigger={
<button id='task' onClick={() => { this.setState({ showModal: true }); }}>
<button
id='task'
onClick={() => {
this.setState({ showModal: true });
this.props.getSolutions();
}}
>
<Icon name='external' />
{this.props.tasktitle}
</button>
......@@ -115,4 +124,5 @@ class SolutionDetailsForm extends Component {
const mapStateToProps = ({ homeworks, user }) => ({ homeworks, user });
export default connect(mapStateToProps, {
getSolutions,
})(SolutionDetailsForm);
......@@ -68,8 +68,8 @@ export const emptyMessage = (header, text, marginBottom, warning) => (
class Homework extends Component {
componentDidMount() {
this.props.getTasks();
this.props.getSolutions(this.props.user.id);
this.props.getProfiles();
this.props.getSolutions(this.props.user.id);
this.props.getDocuments();
}
......@@ -161,7 +161,11 @@ class Homework extends Component {
}
>
<Table.Cell>
<SolutionDetailsForm taskid={task.id} tasktitle={task.title} taskdesc={task.text} />
<SolutionDetailsForm
taskid={task.id}
tasktitle={task.title}
taskdesc={task.text}
/>
</Table.Cell>
<Table.Cell>
{moment(task.deadline).format('YYYY. MM. DD. HH:mm')}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment