This commit is contained in:
Sacha Greif 2016-11-25 11:46:31 +09:00
parent d2948e487a
commit 4b70802c00
10 changed files with 50 additions and 27 deletions

View file

@ -6,19 +6,19 @@ nova:core # do not remove!
# nova:settings
nova:users
# nova:posts
# nova:comments
# nova:newsletter
# nova:search
# nova:notifications
# nova:getting-started
# nova:categories
# nova:voting
nova:posts
nova:comments
nova:newsletter
nova:search
nova:notifications
nova:getting-started
nova:categories
nova:voting
nova:forms
# nova:embedly
# nova:api
# nova:email
# nova:rss
nova:embedly
nova:api
nova:email
nova:rss
# nova:subscribe
# nova:cloudinary
nova:routing
@ -29,7 +29,7 @@ nova:apollo # do not remove!
############ Customizable Packages ############
# nova:base-components # default ui components
nova:base-components # default ui components
nova:base-styles # default styling
# nova:email-templates # default email templates for notifications

View file

@ -32,6 +32,7 @@ ecmascript@0.6.1
ecmascript-runtime@0.3.15
ejson@1.0.13
email@1.1.18
fortawesome:fontawesome@4.5.0
fourseven:scss@3.10.1
geojson-utils@1.0.10
hot-code-push@1.0.4
@ -54,6 +55,7 @@ meteorhacks:inject-data@2.0.1-nova-patch
meteorhacks:inject-initial@1.0.4
meteorhacks:meteorx@1.4.1
meteorhacks:picker@1.0.3
meteorhacks:subs-manager@1.6.4
minifier-css@1.2.15
minifier-js@1.2.15
minimongo@1.0.19
@ -61,16 +63,28 @@ modules@0.7.7
modules-runtime@0.7.7
mongo@1.1.14
mongo-id@1.0.6
nova:api@0.27.4-nova
nova:apollo@0.27.4-nova
nova:base-components@0.27.4-nova
nova:base-styles@0.27.4-nova
nova:categories@0.27.4-nova
nova:comments@0.27.4-nova
nova:core@0.27.4-nova
nova:email@0.27.4-nova
nova:embedly@0.27.4-nova
nova:events@0.27.4-nova
nova:forms@0.27.4-nova
nova:getting-started@0.27.4-nova
nova:i18n-en-us@0.27.4-nova
nova:lib@0.27.4-nova
nova:newsletter@0.27.4-nova
nova:notifications@0.27.4-nova
nova:posts@0.27.4-nova
nova:routing@0.27.4-nova
nova:rss@0.27.4-nova
nova:search@0.27.4-nova
nova:users@0.27.4-nova
nova:voting@0.27.4-nova
npm-bcrypt@0.9.2
npm-mongo@2.2.11_2
observe-sequence@1.0.14
@ -104,5 +118,6 @@ tracker@1.1.1
ui@1.0.12
underscore@1.0.10
url@1.0.11
utilities:react-list-container@0.1.14
webapp@1.3.12
webapp-hashing@1.0.9

View file

@ -9,10 +9,23 @@ const Movies = Telescope.createCollection({
typeName: 'Movie',
// a SimpleSchema-compatible JSON schema
schema,
/*
Three resolvers are expected:
- list (e.g.: moviesList(terms: JSON, offset: Int, limit: Int) )
- single (e.g.: moviesSingle(_id: String) )
- listTotal (e.g.: moviesTotal )
*/
resolvers,
/*
Three mutations are expected:
- new (e.g.: moviesNew(document: moviesInput) : Movie )
- edit (e.g.: moviesEdit(documentId: String, set: moviesInput, unset: moviesUnset) : Movie )
- remove (e.g.: moviesRemove(documentId: String) : Movie )
*/
mutations,
});

View file

@ -29,7 +29,7 @@ class MoviesList extends Component {
title="Add Movie"
component={<Button bsStyle="primary">Add Movie</Button>}
>
<MoviesNewForm currentUser={this.props.currentUser}/>
<MoviesNewForm />
</ModalTrigger>
<hr/>
</div>
@ -45,7 +45,7 @@ class MoviesList extends Component {
console.log("//MoviesList")
console.log(this)
if (this.props.loading && !this.props.results) { // TODO: remove !this.props.results since it shouldn't be needed
if (this.props.loading) {
return <div className="movies"><p>Loading</p></div>
} else {
const hasMore = this.props.totalCount > this.props.results.length;

View file

@ -13,7 +13,6 @@ const MoviesNewForm = (props, context) => {
return (
<NovaForm
collection={Movies}
currentUser={props.currentUser}
queryName="moviesListQuery"
/>
)

View file

@ -4,6 +4,6 @@ import './permissions.js';
import './routes.js';
import './schema.js';
import './components/App.jsx';
import './components/Icon.jsx';
import './components/Loading.jsx';
// import './components/App.jsx';
// import './components/Icon.jsx';
// import './components/Loading.jsx';

View file

@ -17,7 +17,7 @@ const resolvers = {
name: 'moviesList',
resolver(root, {offset, limit}, context, info) {
resolver(root, {terms, offset, limit}, context, info) {
const options = {
sort: {createdAt: -1},
// protected limit
@ -35,7 +35,7 @@ const resolvers = {
name: 'moviesSingle',
resolver(root, args, context) {
resolver(root, {_id}, context) {
return context.Movies.findOne({_id: args._id}, { fields: context.getViewableFields(context.currentUser, context.Movies) });
},

View file

@ -15,6 +15,7 @@ Package.onUse(function (api) {
'nova:posts@0.27.4-nova',
'nova:users@0.27.4-nova',
'nova:comments@0.27.4-nova',
'nova:voting@0.27.4-nova',
// third-party packages
'fortawesome:fontawesome@4.5.0',

View file

@ -52,8 +52,6 @@ class FormWithMutations extends Component{
}
componentWillUnmount() {
console.log("// FormWithMutations unmounting…")
console.log(this)
// note: patch to cancel closeCallback given by parent
// we clean the event by hand
// example : the closeCallback is a function that closes a modal by calling setState, this modal being the parent of this NovaForm component
@ -315,10 +313,6 @@ class FormWithMutations extends Component{
mutationSuccessCallback(result) {
console.log("//success!")
console.log(result)
console.log(this)
const document = result.data[Object.keys(result.data)[0]]; // document is always on first property
// run success callback if it exists

View file

@ -2,6 +2,7 @@ import Telescope from 'meteor/nova:lib';
import Users from 'meteor/nova:users';
import marked from 'marked';
import mutations from './mutations.js';
import Posts from './collection.js';
/**
* @summary Posts config namespace