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 authored and yannickwurm committed Aug 9, 2023
1 parent f429bd0 commit 11f0bae
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
47 changes: 25 additions & 22 deletions public/js/sidebar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component } from 'react';
// eslint-disable-next-line no-unused-vars
import { Component, Fragment } from 'react';
import _ from 'underscore';

import downloadFASTA from './download_fasta';
Expand Down Expand Up @@ -353,6 +354,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 +363,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 ?
<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>
</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 11f0bae

Please sign in to comment.