This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
043c6a9
commit 3cf03a3
Showing
6 changed files
with
74 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
import {AutoForm, TextField, LongTextField, HiddenField, SubmitField, ErrorsField} from 'uniforms-ionic'; | ||
import {schema} from './schema'; | ||
|
||
export function TaskForm({model, handleSubmit}) { | ||
return ( | ||
<AutoForm | ||
schema={schema} | ||
onSubmit={handleSubmit} | ||
model={model} | ||
> | ||
<ErrorsField /> | ||
<TextField name="title" /> | ||
<LongTextField name="description" /> | ||
<HiddenField name="status" value="OPEN" /> | ||
<HiddenField name="version" value={model.version ?? 1} /> | ||
<SubmitField /> | ||
</AutoForm> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import SimpleSchema from 'simpl-schema'; | ||
import SimpleSchema2Bridge from 'uniforms-bridge-simple-schema-2'; | ||
import { LongTextField } from 'uniforms-ionic'; | ||
|
||
const s = new SimpleSchema({ | ||
title: { | ||
type: String, | ||
uniforms: { | ||
required: true | ||
} | ||
}, | ||
|
||
description: { | ||
type: String, | ||
uniforms: { | ||
component: LongTextField, | ||
} | ||
}, | ||
|
||
status: { | ||
type: String, | ||
allowedValues: ['OPEN', 'ASSIGNED', 'COMPLETE'] | ||
}, | ||
|
||
version: { | ||
type: Number | ||
} | ||
}); | ||
|
||
export const schema = new SimpleSchema2Bridge(s); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters