Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix links on sample page #164

Merged
merged 16 commits into from
Oct 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions app/assets/javascripts/components/PipelineSampleReads.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class PipelineSampleReads extends React.Component {
}

let pipeline_run = null;
let download_section = null;
if (this.pipelineOutput) {
pipeline_run = (
<div className="data">
Expand Down Expand Up @@ -80,7 +81,22 @@ class PipelineSampleReads extends React.Component {
</div>
</div>
</div>
)
);

download_section = (
<div>
<a className="custom-button" href= { this.sampleInfo.sample_annotated_fasta_url }>
<i className="fa fa-cloud-download left"></i> DOWNLOAD NON HUMAN READS
</a>
<a className="custom-button" href= { this.sampleInfo.sample_output_folder_url }>
<i className="fa fa-cloud-download left"></i> GO TO RESULTS FOLDER
</a>
<a className="custom-button" href= { '/reports/new?report[pipeline_output_id]=' + this.pipelineOutput.id }>
<i className="fa fa-file-text-o left"></i> GENERATE REPORT
</a>
</div>
);

} else {
pipeline_run = (
<div className="center">
Expand Down Expand Up @@ -192,16 +208,11 @@ class PipelineSampleReads extends React.Component {
</div>

<div className="col s3 download-area">
<a className="custom-button">
<a className="custom-button" href={ this.sampleInfo.sample_input_folder_url }>
<i className="fa fa-cloud-download left"></i> DOWNLOAD ALL READS
</a>
{ download_section }

<a className="custom-button">
<i className="fa fa-user-times left"></i> DOWNLOAD NON HUMAN READS
</a>
<a onClick={this.gotoReport} className="custom-button">
<i className="fa fa-file-text-o left"></i> GENERATE REPORT
</a>
</div>

</div>
Expand Down
6 changes: 5 additions & 1 deletion app/controllers/reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ def show

# GET /reports/new
def new
@report = Report.new
@report = if params[:report]
Report.new(params.require(:report).permit(:pipeline_output_id))
else
Report.new
end
end

# GET /reports/1/edit
Expand Down
8 changes: 8 additions & 0 deletions app/models/sample.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ def sample_output_folder_url
"https://s3.console.aws.amazon.com/s3/object/#{SAMPLES_BUCKET_NAME}/#{sample_path}/results/"
end

def sample_input_folder_url
"https://s3.console.aws.amazon.com/s3/object/#{SAMPLES_BUCKET_NAME}/#{sample_path}/fastqs/"
end

def as_json(_options = {})
super(methods: [:sample_input_folder_url, :sample_output_folder_url, :sample_annotated_fasta_url])
end

def pipeline_command
script_name = File.basename(IdSeqPipeline::S3_SCRIPT_LOC)
batch_command_env_variables = "INPUT_BUCKET=#{sample_input_s3_path} OUTPUT_BUCKET=#{sample_output_s3_path} " \
Expand Down