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'; ...@@ -4,6 +4,9 @@ import { connect } from 'react-redux';
import CorrectSolutionForm from './CorrectSolutionForm'; import CorrectSolutionForm from './CorrectSolutionForm';
import { emptyMessage } from '../pages/Homework'; import { emptyMessage } from '../pages/Homework';
import './Forms.css'; import './Forms.css';
import {
getSolutions,
} from '../../actions/homework';
class SolutionDetailsForm extends Component { class SolutionDetailsForm extends Component {
constructor(props) { constructor(props) {
...@@ -45,7 +48,13 @@ class SolutionDetailsForm extends Component { ...@@ -45,7 +48,13 @@ class SolutionDetailsForm extends Component {
<Modal <Modal
open={this.state.showModal} open={this.state.showModal}
trigger={ trigger={
<button id='task' onClick={() => { this.setState({ showModal: true }); }}> <button
id='task'
onClick={() => {
this.setState({ showModal: true });
this.props.getSolutions();
}}
>
<Icon name='external' /> <Icon name='external' />
{this.props.tasktitle} {this.props.tasktitle}
</button> </button>
...@@ -115,4 +124,5 @@ class SolutionDetailsForm extends Component { ...@@ -115,4 +124,5 @@ class SolutionDetailsForm extends Component {
const mapStateToProps = ({ homeworks, user }) => ({ homeworks, user }); const mapStateToProps = ({ homeworks, user }) => ({ homeworks, user });
export default connect(mapStateToProps, { export default connect(mapStateToProps, {
getSolutions,
})(SolutionDetailsForm); })(SolutionDetailsForm);
...@@ -68,8 +68,8 @@ export const emptyMessage = (header, text, marginBottom, warning) => ( ...@@ -68,8 +68,8 @@ export const emptyMessage = (header, text, marginBottom, warning) => (
class Homework extends Component { class Homework extends Component {
componentDidMount() { componentDidMount() {
this.props.getTasks(); this.props.getTasks();
this.props.getSolutions(this.props.user.id);
this.props.getProfiles(); this.props.getProfiles();
this.props.getSolutions(this.props.user.id);
this.props.getDocuments(); this.props.getDocuments();
} }
...@@ -161,7 +161,11 @@ class Homework extends Component { ...@@ -161,7 +161,11 @@ class Homework extends Component {
} }
> >
<Table.Cell> <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>
<Table.Cell> <Table.Cell>
{moment(task.deadline).format('YYYY. MM. DD. HH:mm')} {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