Skip to content
This repository has been archived by the owner on Oct 6, 2021. It is now read-only.

Commit

Permalink
Classify page rendering and links
Browse files Browse the repository at this point in the history
  • Loading branch information
eatyourgreens committed Aug 15, 2016
1 parent 469b0da commit b81fa78
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/classifier.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ module.exports = React.createClass

componentWillReceiveProps: (newProps)->
{api, project, subject_set, workflow} = newProps
@subjects.update {api, project, subject_set_id: subject_set.id}
@subjects.update {api, project, subject_set_id: subject_set?.id}
@classifications.update {api, project, workflow}

if newProps.user != @props.user || newProps.subject_set.id != @props.subject_set.id
if newProps.user != @props.user || newProps.subject_set?.id != @props.subject_set?.id
@setState currentSubjects: [], =>
@subjects.flush()
@subjects.fetch()
Expand Down
1 change: 1 addition & 0 deletions app/classify/subject.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = React.createClass
viewAll: false

componentWillReceiveProps: (newProps) ->
return unless newProps.subject?
{nextSubjectIds, prevSubjectIds} = newProps.subject.metadata
@props.api.type('subjects')
.get([nextSubjectIds[0], prevSubjectIds[0]])
Expand Down
4 changes: 2 additions & 2 deletions app/main.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Main = React.createClass
ReactDOM.render <UserStatus user={@state.user} auth={@auth} onSignOut={@signOut} />, document.querySelector '#user-status'
ReactDOM.render <ChooseSubjectSet workflow={@state.workflow} onChange={@changeSubjectSet} />, document.querySelector '#reports'
ReactDOM.render <Page project={@state.project} url_key='science_case' />, document.querySelector '#about'
@renderClassifier()
ReactDOM.render <Classifier project={@state.project} workflow={@state.workflow} user={@state.user} api={@client} talk={@talk} subject_set={@state.subject_set} />, document.querySelector '#classify'

componentDidMount: ->
document.querySelector('#classify').addEventListener 'activate', @startTutorial
Expand All @@ -67,7 +67,7 @@ Main = React.createClass
</div>
<div className="readymade-project-summary"> {@state.project?.description} </div>
<div className="readymade-project-description"> {@state.project?.introduction} </div>
{<div className="readymade-footer"> <a href="#/#{ if @state.subject_set? then 'classify' else 'reports'}" className="major-button"> Get started! </a> </div> if @state.project?}
{<div className="readymade-footer"> <a href="#/classify" className="major-button"> Get started! </a> </div> if @state.project?}
<ProjectStatistics project={@state.project} workflow={@state.workflow} />
</div>

Expand Down

0 comments on commit b81fa78

Please sign in to comment.