mirror of
https://github.com/vale981/Vulcan
synced 2025-03-05 09:31:43 -05:00
don't bump version after all, more readme work
This commit is contained in:
parent
1e4f732082
commit
7316b25e74
3 changed files with 48 additions and 2 deletions
|
@ -89,7 +89,7 @@ nova:core@0.25.7
|
||||||
nova:email@0.25.7
|
nova:email@0.25.7
|
||||||
nova:embedly@0.25.7
|
nova:embedly@0.25.7
|
||||||
nova:events@0.25.7
|
nova:events@0.25.7
|
||||||
nova:forms@0.25.8
|
nova:forms@0.25.7
|
||||||
nova:getting-started@0.25.7
|
nova:getting-started@0.25.7
|
||||||
nova:i18n@0.25.7
|
nova:i18n@0.25.7
|
||||||
nova:lib@0.25.7
|
nova:lib@0.25.7
|
||||||
|
|
|
@ -22,6 +22,52 @@ This package can generate new document and edit document forms from a [SimpleSch
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
|
Example schema:
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
|
import BodyFormControl from './components/BodyFormControl.jsx';
|
||||||
|
|
||||||
|
const isLoggedIn = (user) => !!user;
|
||||||
|
const isOwner = (user, document) => user._id === document.userId;
|
||||||
|
const isAdmin = (user) => user.isAdmin;
|
||||||
|
|
||||||
|
const PostsSchema = new SimpleSchema({
|
||||||
|
postedAt: {
|
||||||
|
type: Date,
|
||||||
|
optional: true
|
||||||
|
// no insertableIf or editableIf means this field won't appear in forms
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
optional: false,
|
||||||
|
max: 500,
|
||||||
|
insertableIf: isLoggedIn,
|
||||||
|
editableIf: isOwner,
|
||||||
|
control: "text",
|
||||||
|
order: 1
|
||||||
|
},
|
||||||
|
body: {
|
||||||
|
type: String,
|
||||||
|
optional: true,
|
||||||
|
max: 3000,
|
||||||
|
insertableIf: isLoggedIn,
|
||||||
|
editableIf: isOwner,
|
||||||
|
control: BodyFormControl,
|
||||||
|
order: 2
|
||||||
|
},
|
||||||
|
sticky: {
|
||||||
|
type: Boolean,
|
||||||
|
optional: true,
|
||||||
|
defaultValue: false,
|
||||||
|
insertableIf: isAdmin,
|
||||||
|
editableIf: isAdmin,
|
||||||
|
control: "checkbox",
|
||||||
|
order: 3
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
New document form:
|
New document form:
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
Package.describe({
|
Package.describe({
|
||||||
name: "nova:forms",
|
name: "nova:forms",
|
||||||
summary: "Form containers for React",
|
summary: "Form containers for React",
|
||||||
version: "0.25.8",
|
version: "0.25.7",
|
||||||
git: "https://github.com/meteor-utilities/react-form-containers.git"
|
git: "https://github.com/meteor-utilities/react-form-containers.git"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue