Fixed collection bug issue. Bug was caused by ordering assumption I made.
This commit is contained in:
parent
3feec479f2
commit
df5052a917
|
@ -5679,7 +5679,7 @@
|
|||
},
|
||||
"core-js": {
|
||||
"version": "2.5.5",
|
||||
"resolved": "http://registry.npmjs.org/core-js/-/core-js-2.5.5.tgz",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.5.tgz",
|
||||
"integrity": "sha1-sU3ek2xkDAV5prUMq8wTLdYSfjs="
|
||||
},
|
||||
"firebase": {
|
||||
|
@ -12513,9 +12513,9 @@
|
|||
}
|
||||
},
|
||||
"react-cookie": {
|
||||
"version": "3.0.7",
|
||||
"resolved": "https://registry.npmjs.org/react-cookie/-/react-cookie-3.0.7.tgz",
|
||||
"integrity": "sha512-c4lGOqIPC54kUocE7kbuqZNeIdXtZGzXQMA7BSWhaJ/5tWeoW5fJ7mF/pR+rU5fYDF9kktTHCIbovwSsNYblOg==",
|
||||
"version": "3.0.8",
|
||||
"resolved": "https://registry.npmjs.org/react-cookie/-/react-cookie-3.0.8.tgz",
|
||||
"integrity": "sha512-Gdop2Cf2pBFA0r4L9l5DRghKsPVMNKRM3x2aeyJ4JSaENpWWPP4v9LJvvtxXs3AboOGCuMj19oUw04Z9cVQQTg==",
|
||||
"requires": {
|
||||
"@types/hoist-non-react-statics": "^3.0.1",
|
||||
"hoist-non-react-statics": "^3.0.0",
|
||||
|
@ -12523,9 +12523,9 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"hoist-non-react-statics": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.2.0.tgz",
|
||||
"integrity": "sha512-3IascCRfaEkbmHjJnUxWSspIUE1okLPjGTMVXW8zraUo1t3yg1BadKAxAGILHwgoBzmMnzrgeeaDGBvpuPz6dA==",
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.2.1.tgz",
|
||||
"integrity": "sha512-TFsu3TV3YLY+zFTZDrN8L2DTFanObwmBLpWvJs1qfUuEQ5bTAdFcwfx2T/bsCXfM9QHSLvjfP+nihEl0yvozxw==",
|
||||
"requires": {
|
||||
"react-is": "^16.3.2"
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"material-ui-icons": "^1.0.0-beta.36",
|
||||
"moment": "^2.22.2",
|
||||
"react": "^16.5.1",
|
||||
"react-cookie": "^3.0.7",
|
||||
"react-cookie": "^3.0.8",
|
||||
"react-dom": "^16.5.1",
|
||||
"react-image-gallery": "^0.8.12",
|
||||
"react-quiz-component": "0.2.0",
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
import React, { Component } from 'react';
|
||||
import flamelinkApp from '../../utilities/flamelink.js';
|
||||
import Grid from '@material-ui/core/Grid';
|
||||
import FlameLinkCollectionComponentCreations from './FlameLinkCollectionComponentCreations';
|
||||
|
||||
class FlameLinkCollection extends Component {
|
||||
state = {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
schemaContent: '',
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
flamelinkApp.content.get(this.props.schemaName)
|
||||
.then(result => this.setState({
|
||||
schemaContent: result
|
||||
|
@ -18,8 +21,13 @@ class FlameLinkCollection extends Component {
|
|||
var arr2 = [];
|
||||
var collectionInfo = [schemaData, this.state.schemaContent];
|
||||
for (var val in this.state.schemaContent) {
|
||||
if ( this.state.schemaContent[val].hasOwnProperty('order') ) {
|
||||
arr2[this.state.schemaContent[val]['order']] = val;
|
||||
}
|
||||
else{
|
||||
arr2.push(val);
|
||||
}
|
||||
}
|
||||
return arr2.map(this.getCollectionComponentInfo, collectionInfo);
|
||||
}
|
||||
|
||||
|
@ -28,6 +36,7 @@ class FlameLinkCollection extends Component {
|
|||
for (var val in this[0]) {
|
||||
arr3.push(val);
|
||||
}
|
||||
|
||||
return <FlameLinkCollectionComponentCreations schemaData={this[0]} schemaContent={this[1][num]} arr={arr3} key={num} />
|
||||
}
|
||||
|
||||
|
@ -44,9 +53,9 @@ class FlameLinkCollection extends Component {
|
|||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<Grid container>
|
||||
{this.getCollectionContent(this.props.schemaData)}
|
||||
</div>
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ const styles = theme => ({
|
|||
class About extends Component {
|
||||
state = {
|
||||
researcherSchemaName: 'martenAbout',
|
||||
developerSchemaName: 'martenAboutDev',
|
||||
developerSchemaName: 'martenAboutDevelopers',
|
||||
researcherSchemaDetails: '',
|
||||
researcherSchemaType: '',
|
||||
developerSchemaDetails: '',
|
||||
|
|
Loading…
Reference in New Issue