diff --git a/imports/startup/server/api.js b/imports/startup/server/api.js index edd05c3..e5684d2 100644 --- a/imports/startup/server/api.js +++ b/imports/startup/server/api.js @@ -1,6 +1,6 @@ -import '../../api/Documents/methods'; -import '../../api/Documents/server/publications'; +// import '../../api/Documents/methods'; +// import '../../api/Documents/server/publications'; import '../../api/Invoices/methods'; import '../../api/Invoices/server/publications'; diff --git a/imports/ui/components/Content/Content.js b/imports/ui/components/Content/Content.js deleted file mode 100644 index b38d9ca..0000000 --- a/imports/ui/components/Content/Content.js +++ /dev/null @@ -1,16 +0,0 @@ -/* eslint-disable react/no-danger */ - -import React from 'react'; -import PropTypes from 'prop-types'; - -import './Content.scss'; - -const Content = ({ content }) => ( -
-); - -Content.propTypes = { - content: PropTypes.string.isRequired, -}; - -export default Content; diff --git a/imports/ui/components/Content/Content.scss b/imports/ui/components/Content/Content.scss deleted file mode 100644 index a1573ea..0000000 --- a/imports/ui/components/Content/Content.scss +++ /dev/null @@ -1,36 +0,0 @@ -@import '../../stylesheets/mixins'; - -.Content { - max-width: 700px; - margin: 0 auto; - font-size: 14px; - line-height: 22px; - - h1, - h2, - h3, - h4, - h5, - h6 { - margin: 30px 0 20px; - } - - p { - margin-bottom: 20px; - } - - > *:first-child { - margin-top: 0px; - } - - > *:last-child { - margin-bottom: 0px; - } -} - -@include breakpoint(tablet) { - .Content { - font-size: 16px; - line-height: 22px; - } -} diff --git a/imports/ui/components/DocumentEditor/DocumentEditor.js b/imports/ui/components/DocumentEditor/DocumentEditor.js deleted file mode 100644 index 4a42df7..0000000 --- a/imports/ui/components/DocumentEditor/DocumentEditor.js +++ /dev/null @@ -1,97 +0,0 @@ -/* eslint-disable max-len, no-return-assign */ - -import React from 'react'; -import PropTypes from 'prop-types'; -import { FormGroup, ControlLabel, Button } from 'react-bootstrap'; -import { Meteor } from 'meteor/meteor'; -import { Bert } from 'meteor/themeteorchef:bert'; -import validate from '../../../modules/validate'; - -class DocumentEditor extends React.Component { - componentDidMount() { - const component = this; - validate(component.form, { - rules: { - title: { - required: true, - }, - body: { - required: true, - }, - }, - messages: { - title: { - required: 'Need a title in here, Seuss.', - }, - body: { - required: 'This thneeds a body, please.', - }, - }, - submitHandler() { component.handleSubmit(); }, - }); - } - - handleSubmit() { - const { history } = this.props; - const existingDocument = this.props.doc && this.props.doc._id; - const methodToCall = existingDocument ? 'documents.update' : 'documents.insert'; - const doc = { - title: this.title.value.trim(), - body: this.body.value.trim(), - }; - - if (existingDocument) doc._id = existingDocument; - - Meteor.call(methodToCall, doc, (error, documentId) => { - if (error) { - Bert.alert(error.reason, 'danger'); - } else { - const confirmation = existingDocument ? 'Document updated!' : 'Document added!'; - this.form.reset(); - Bert.alert(confirmation, 'success'); - history.push(`/documents/${documentId}`); - } - }); - } - - render() { - const { doc } = this.props; - return (); - } -} - -DocumentEditor.defaultProps = { - doc: { title: '', body: '' }, -}; - -DocumentEditor.propTypes = { - doc: PropTypes.object, - history: PropTypes.object.isRequired, -}; - -export default DocumentEditor; diff --git a/imports/ui/pages/Documents/Documents.js b/imports/ui/pages/Documents/Documents.js deleted file mode 100644 index 6b7b2df..0000000 --- a/imports/ui/pages/Documents/Documents.js +++ /dev/null @@ -1,82 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { Link } from 'react-router-dom'; -import { Table, Alert, Button } from 'react-bootstrap'; -import { timeago, monthDayYearAtTime } from '@cleverbeagle/dates'; -import { Meteor } from 'meteor/meteor'; -import { createContainer } from 'meteor/react-meteor-data'; -import { Bert } from 'meteor/themeteorchef:bert'; -import DocumentsCollection from '../../../api/Documents/Documents'; -import Loading from '../../components/Loading/Loading'; - -import './Documents.scss'; - -const handleRemove = (documentId) => { - if (confirm('Are you sure? This is permanent!')) { - Meteor.call('documents.remove', documentId, (error) => { - if (error) { - Bert.alert(error.reason, 'danger'); - } else { - Bert.alert('Document deleted!', 'success'); - } - }); - } -}; - -const Documents = ({ loading, documents, match, history }) => (!loading ? ( -Title | -Last Updated | -Created | -- | - |
---|---|---|---|---|
{title} | -{timeago(updatedAt)} | -{monthDayYearAtTime(createdAt)} | -- - | -- - | -