Skip to content

Commit

Permalink
refactor to fix codeclimate issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazy-poet committed Aug 5, 2023
1 parent 10fb5be commit 8ddf164
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
46 changes: 24 additions & 22 deletions public/js/sidebar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from 'react';
import React, { Component } from 'react';
import _ from 'underscore';

import downloadFASTA from './download_fasta';
Expand Down Expand Up @@ -353,6 +353,7 @@ export default class extends Component {
}

sharingPanelJSX() {
const link_class = 'btn-link cursor-pointer';
return (
<div className="sharing-panel">
<div className="section-header-sidebar">
Expand All @@ -361,29 +362,30 @@ export default class extends Component {
</h4>
</div>
<ul className="nav">
{!this.props.cloudSharingEnabled ?
<>
<li>
<a id="copyURL" className="btn-link copy-URL cursor-pointer" data-toggle="tooltip"
onClick={this.copyURL}>
<i className="fa fa-copy"></i> Copy URL to clipboard
</a>
</li>
{
!this.props.cloudSharingEnabled ?
<React.Fragment>
<li>
<a id="copyURL" className={`${link_class} copy-URL`} data-toggle="tooltip"
onClick={this.copyURL}>
<i className="fa fa-copy"></i> Copy URL to clipboard
</a>
</li>
<li>
<a id="sendEmail" className={`${link_class} email-URL`} data-toggle="tooltip"
title="Send by email" href={asMailtoHref(this.props.data.querydb, this.props.data.program, this.props.data.queries, window.location.href)}
target="_blank" rel="noopener noreferrer">
<i className="fa fa-envelope"></i> Send by email
</a>
</li>
</React.Fragment> :
<li>
<a id="sendEmail" className="btn-link email-URL cursor-pointer" data-toggle="tooltip"
title="Send by email" href={asMailtoHref(this.props.data.querydb, this.props.data.program, this.props.data.queries, window.location.href)}
target="_blank" rel="noopener noreferrer">
<i className="fa fa-envelope"></i> Send by email
</a>
</li>
</> :
<li>
<button className="btn-link cloud-Post cursor-pointer" data-toggle="tooltip"
title="Upload results to SequenceServer Cloud where it will become accessable
<button id="shareToCloud" className={`${link_class} cloud-Post`} data-toggle="tooltip"
title="Upload results to SequenceServer Cloud where it will become accessable
to everyone who has a link." onClick={this.shareCloudInit}>
<i className="fa fa-cloud"></i> Share to cloud
</button>
</li>
<i className="fa fa-cloud"></i> Share to cloud
</button>
</li>
}
</ul>
{
Expand Down
Loading

0 comments on commit 8ddf164

Please sign in to comment.