Skip to content
This repository has been archived by the owner on Jan 28, 2020. It is now read-only.

Commit

Permalink
Deal with the zero-taxonomy to LR type mapping case.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiefolsom committed Aug 18, 2015
1 parent e957419 commit 77e7f9e
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions ui/static/ui/js/learning_resources.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,25 +161,30 @@ define('learning_resources', [
render: function () {

var vocabulariesAndTerms = this.state.vocabulariesAndTerms;

var vocabSelector =
<VocabSelect
vocabs={vocabulariesAndTerms}
selectedVocabulary={this.state.selectedVocabulary}
setValues={this.setSelectedVocabulary}
/>;

var termSelector =
<TermSelect
var vocabSelector = "There are no terms for this resource";
var termSelector = "";
var termList = "";

if (vocabulariesAndTerms.length) {
vocabSelector =
<VocabSelect
vocabs={vocabulariesAndTerms}
selectedVocabulary={this.state.selectedVocabulary}
setValues={this.setSelectedVocabulary}
/>;

termSelector =
<TermSelect
vocabs={vocabulariesAndTerms}
selectedVocabulary={this.state.selectedVocabulary}
setValues={this.setSelectedTerms}
/>;

termList =
<TermList
vocabs={vocabulariesAndTerms}
selectedVocabulary={this.state.selectedVocabulary}
setValues={this.setSelectedTerms}
/>;

var termList =
<TermList
vocabs={vocabulariesAndTerms}
/>;
}

return <div>
<form className="form-horizontal">
Expand Down Expand Up @@ -301,9 +306,14 @@ define('learning_resources', [

thiz.setState({
vocabulariesAndTerms: vocabulariesAndTerms,
selectedVocabulary: vocabulariesAndTerms[0].vocabulary
});

if (vocabulariesAndTerms.length) {
thiz.setState({
selectedVocabulary: vocabulariesAndTerms[0].vocabulary
});
}

}).fail(function () {
thiz.setState({
message: {
Expand Down

0 comments on commit 77e7f9e

Please sign in to comment.