Added ability to handle collection type schemas

This commit is contained in:
ajmaley
2018-11-23 13:07:42 -05:00
parent 31a5887b7b
commit 598f3bd0a0
7 changed files with 300 additions and 75 deletions

View File

@@ -6,26 +6,31 @@ class About extends Component {
constructor() {
super();
global.schemaName = 'martenSchemaDemo';
global.schemaName = 'martenAbout';
this.state = {
schemaDetails: '',
schemaType: '',
}
flamelinkApp.schemas.getFields(global.schemaName, { fields: [ 'title', 'key', 'type', 'gridColumns', 'description', 'options' ] })
.then(result => this.setState({
schemaDetails: result
}))
}
flamelinkApp.schemas.get(global.schemaName)
.then(result => this.setState({
schemaType: result.type
}))
}
render() {
return (
<div>
<Fragment>
<FlameLinkComponentCreations schemaDetails = {this.state.schemaDetails}/>
<FlameLinkComponentCreations schemaDetails = {this.state.schemaDetails} schemaType = {this.state.schemaType}/>
</Fragment>
</div>
);
}

View File

@@ -10,17 +10,23 @@ class Home extends Component {
this.state = {
schemaDetails: '',
schemaType: '',
}
flamelinkApp.schemas.getFields(global.schemaName, { fields: ['title', 'key', 'type', 'gridColumns', 'description', 'options'] })
flamelinkApp.schemas.getFields(global.schemaName, { fields: [ 'title', 'key', 'type', 'gridColumns', 'description', 'options'] })
.then(result => this.setState({
schemaDetails: result
}))
flamelinkApp.schemas.get(global.schemaName)
.then(result => this.setState({
schemaType: result.type
}))
}
render() {
return (
<FlameLinkComponentCreations schemaDetails={this.state.schemaDetails} />
<FlameLinkComponentCreations schemaDetails={this.state.schemaDetails} schemaType = {this.state.schemaType}/>
);
}
}