Skip to content

Commit

Permalink
Merge pull request #9 from alexandesigner/documents-improvements
Browse files Browse the repository at this point in the history
Documents improvements
  • Loading branch information
alexandesigner authored Jun 29, 2018
2 parents 215917b + 2a7dc42 commit 247d245
Show file tree
Hide file tree
Showing 10 changed files with 312 additions and 164 deletions.
2 changes: 2 additions & 0 deletions boilerplate/.meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ meteortesting:[email protected] # A Mocha test driver package for Mete
msavin:[email protected] # In-App MongoDB Editor
underscore
ostrio:files
froala:editor
jquery # Helpful client-side library
2 changes: 2 additions & 0 deletions boilerplate/.meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ [email protected]
[email protected]
[email protected]
[email protected]
fortawesome:[email protected]_1
froala:[email protected]
[email protected]
[email protected]
[email protected]
Expand Down
6 changes: 3 additions & 3 deletions boilerplate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"babel-runtime": "^6.26.0",
"bcrypt": "^1.0.3",
"core-js": "^2.5.7",
"element-theme-chalk": "^2.4.1",
"element-ui": "^2.4.1",
"element-theme-chalk": "^2.4.2",
"element-ui": "^2.4.2",
"intersection-observer": "^0.4.3",
"isomorphic-fetch": "^2.2.1",
"lodash": "^4.17.4",
Expand All @@ -40,7 +40,7 @@
"eslint": "^4.19.1",
"eslint-config-standard": "^11.0.0",
"eslint-plugin-html": "^3.2.2",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-meteor": "^4.2.2",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.8.0",
Expand Down
22 changes: 9 additions & 13 deletions boilerplate/src/imports/api/Documents/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export const insertDocument = new ValidatedMethod({
type: String,
label: 'The title of the document.'
},
subtitle: {
type: String,
label: 'The subtitle of the document.'
},
body: {
type: String,
label: 'The body of the document.'
Expand Down Expand Up @@ -81,6 +85,10 @@ export const updateDocument = new ValidatedMethod({
type: String,
label: 'The title of the document.'
},
subtitle: {
type: String,
label: 'The subtitle of the document.'
},
body: {
type: String,
label: 'The body of the document.'
Expand Down Expand Up @@ -115,19 +123,7 @@ export const updateDocument = new ValidatedMethod({
try {
const documentId = doc._id
return Documents.update(documentId, {
$set: {
updatedAt: new Date(),
owner: doc.owner,
title: doc.title,
body: doc.body,
image: {
name: doc.image.name,
type: doc.image.type,
extension: doc.image.extension,
path: doc.image.path,
imageId: doc.image.imageId
}
}
$set: { ...doc }
})
} catch (exception) {
throw new Meteor.Error('500', exception.message)
Expand Down
4 changes: 4 additions & 0 deletions boilerplate/src/imports/api/Documents/server/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ Documents.schema = new SimpleSchema({
type: String,
label: 'The title of the document.'
},
subtitle: {
type: String,
label: 'The subtitle of the document.'
},
body: {
type: String,
label: 'The body of the document.'
Expand Down
3 changes: 2 additions & 1 deletion boilerplate/src/imports/startup/server/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const documentsSeed = userId => ({
return {
owner: userId,
title: `Document #${dataIndex + 1}`,
body: `This is the body of document #${dataIndex + 1}`,
subtitle: `This is the subtitle of document`,
body: `<p>Hello Document #${dataIndex + 1}</p>`,
image: [{
name: '',
type: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class="admin-content_main-table">
<el-table-column
label="Created At"
width="220">
width="140">
<template slot-scope="scope">
<el-icon class="icon" name="time"></el-icon>
<span>{{ scope.row.createdAt | date("L, LT") }}</span>
Expand Down
Loading

0 comments on commit 247d245

Please sign in to comment.