perspectivesx_project/static/js/index.js
//take care  of no perspective case
take care  of no perspective case
take care of no perspective case
render() {
        const containerStyle = {
            marginLeft: "15px",
            marginRight: "15px"
        };
        if (this.state.perspectives) {
            var perspectiveNodes = this.state.perspectives.map(
                (perspective) => this.mapPerspectives(perspective)
            );
            if (perspectiveNodes.length == 0) {
                perspectiveNodes =
                    <div className="alert alert-warning"><h4>Something went wrong</h4><br/> <p>No perspective for this
                        activity ! </p></div>
            }
            return (
                <div className="row">
                    <ScoreComponent score={this.state.score} participation_score={this.state.participation_score} curation_score={this.state.curation_score} />
                    <div>
                        <h3>{this.state.activity.title}</h3>
                        <div>{this.state.activity.description}</div>
                    </div>
                    <div className="container-fluid" style={containerStyle}>
                         {this.renderPerspectives()}
                     </div>
                </div>
            )
        }
    }
render ( ) { const containerStyle = { marginLeft : "15px" , marginRight : "15px" } ; if ( this . state . perspectives ) { var perspectiveNodes = this . state . perspectives . map ( ( perspective ) => this . mapPerspectives ( perspective ) ) ; if ( perspectiveNodes . length == 0 ) { perspectiveNodes = < div className = "alert alert-warning" > < h4 > Something went wrong < / h4 > < br / > < p > No perspective for this
                        activity !  < / p > < / div > } return ( < div className = "row" > < ScoreComponent score = { this . state . score } participation_score = { this . state . participation_score } curation_score = { this . state . curation_score } / > < div > < h3 > { this . state . activity . title } < / h3 > < div > { this . state . activity . description } < / div > < / div > < div className = "container-fluid" style = { containerStyle } > { this . renderPerspectives ( ) } < / div > < / div > ) } }
take care  of no perspective case
take care of no perspective case