From c76d1fbeb6e46f9015d93d485e418277cdfbf4cc Mon Sep 17 00:00:00 2001 From: ajmaley Date: Tue, 27 Nov 2018 17:46:12 -0500 Subject: [PATCH] Reordering the collection entries works now. --- src/components/FlameLinkCollection.js | 14 ++++++++++++-- src/components/FlameLinkCollectionStructure.js | 5 ----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/FlameLinkCollection.js b/src/components/FlameLinkCollection.js index ecb1b2b..ab1f13e 100644 --- a/src/components/FlameLinkCollection.js +++ b/src/components/FlameLinkCollection.js @@ -6,7 +6,6 @@ class FlameLinkCollection extends Component { constructor() { super(); - global.mediaID = ''; this.state = { schemaContent: '', @@ -22,7 +21,7 @@ class FlameLinkCollection extends Component { var arr2 = []; var collectionInfo = [schemaData, this.state.schemaContent]; for (var val in this.state.schemaContent){ - arr2.push(val); + arr2[this.state.schemaContent[val]['order']] = val; } return arr2.map(this.getCollectionComponentInfo, collectionInfo); } @@ -35,6 +34,17 @@ class FlameLinkCollection extends Component { return } + countProperties(obj) { + var count = 0; + + for(var prop in obj) { + if(obj.hasOwnProperty(prop)) + ++count; + } + + return count; +} + render() { return(
diff --git a/src/components/FlameLinkCollectionStructure.js b/src/components/FlameLinkCollectionStructure.js index ba963cd..95aadca 100644 --- a/src/components/FlameLinkCollectionStructure.js +++ b/src/components/FlameLinkCollectionStructure.js @@ -103,11 +103,6 @@ class FlameLinkCollectionStructure extends Component { return } } - console.log('Content: ', content) - console.log('Field: ', field) - console.log('Key: ', key) - console.log('Type: ', type) - console.log('Description: ', description) } render() {