Skip to content
Permalink
Browse files

2.14.4

  • Loading branch information...
Fi1osof committed Mar 14, 2019
1 parent abbcc1d commit dd37c15c26ac62c207946c09fe0f02928a6d2d17
Showing with 9 additions and 108 deletions.
  1. +2 −0 changelog.md
  2. +1 −1 package.json
  3. +6 −107 src/components/pages/cooperation/Tasks/Task/index.js
@@ -1,5 +1,7 @@
2.14.4
============================================
- Exclude @modxclub/import-old-site
- Added Task Chat

2.14.3
============================================
@@ -1,6 +1,6 @@
{
"name": "@modxclub/modxclub.ru",
"version": "2.14.3",
"version": "2.14.4",
"description": "Opensource framework CMS powered by GraphQL, Prisma, MySQL, React & Apollo GraphQL",
"private": false,
"scripts": {
@@ -3,121 +3,20 @@ import PropTypes from 'prop-types';

import Page from "../../../layout";

import PageNotFound from "../../../404";
import { graphql } from 'react-apollo';

import {
Task as TaskQuery,
createTaskProcessor,
updateTaskProcessor,
} from "../query";


import TaskView from "../View/Task";

import { Typography } from 'material-ui';

// import {
// Link,
// } from "../../../../components/ui";

const UpdateTask = graphql(updateTaskProcessor)(TaskView);
const CreateTask = graphql(createTaskProcessor)(TaskView);
import CooperationTaskPage from "@prisma-cms/cooperation/lib/components/pages/Tasks/Task";


export class TaskPage extends Page {

static propTypes = {
...Page.propTypes,
};


static defaultProps = {
...Page.defaultProps,
}



setPageMeta(meta = {}) {

const {
data: {
object: task,
},
} = this.props;


if (!task) {
return;
}

const {
name,
} = task;


return super.setPageMeta({
title: `Задача ${name}`,
...meta,
});

}


render() {

const {
data,
...other
} = this.props;

const {
object: task,
loading,
} = data;

if (!task) {

if (loading) {
return null;
}
else {
return <PageNotFound />
}
}


const {
id: taskId,
} = task;

let Mutation;

if (taskId) {
Mutation = UpdateTask;
}
else {
Mutation = CreateTask;
}

return super.render(
<div>
<Mutation
data={data}
linkType="target"
showDetails={true}
{...other}
/>
</div>
);
return super.render(<CooperationTaskPage
{...this.props}
/>);
}
}

}

export default (props) => {

return <TaskQuery
View={TaskPage}
{...props}
/>
};
export default TaskPage;

0 comments on commit dd37c15

Please sign in to comment.
You can’t perform that action at this time.