Skip to content

sc-9514 Canvas Plugin to Render Inline PDF#4

Merged
therealjasonkenney merged 5 commits intomainfrom
sc-9514/canvas-plugin-option
Jun 20, 2025
Merged

sc-9514 Canvas Plugin to Render Inline PDF#4
therealjasonkenney merged 5 commits intomainfrom
sc-9514/canvas-plugin-option

Conversation

@therealjasonkenney
Copy link
Collaborator

Canvas Plugin

  • Users can view pdfs inline within Files and Modules

Tickets

Changes

  • This creates a basic canvas plugin.
  • The idea is to then modify the FilePreviewController within canvas to look for enabled plugins with the 'preview' tag and find the first one that previewable?(account, attachment)
  • This also prepends code to Attachment so that the FilesController will know to render that inline as well. (See app/views/files/show.html.erb in Canvas)

@github-actions
Copy link

Coverage (3.4.2)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.1.6)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.3.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.2.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@therealjasonkenney therealjasonkenney force-pushed the sc-9514/canvas-plugin-option branch from c751c0a to c460737 Compare March 18, 2025 15:05
@github-actions
Copy link

Coverage (3.3.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.2.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.4.2)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.1.6)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@therealjasonkenney therealjasonkenney force-pushed the sc-9514/canvas-plugin-option branch from c460737 to b18228a Compare March 18, 2025 15:07
@github-actions
Copy link

Coverage (3.1.6)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.2.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.4.2)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.3.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@therealjasonkenney therealjasonkenney force-pushed the sc-9514/canvas-plugin-option branch from b18228a to 6553fd4 Compare March 18, 2025 15:11
@github-actions
Copy link

Coverage (3.2.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.3.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.4.2)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.1.6)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@therealjasonkenney therealjasonkenney force-pushed the sc-9514/canvas-plugin-option branch from 6553fd4 to 0155979 Compare March 18, 2025 15:31
@github-actions
Copy link

Coverage (3.2.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.3.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.1.6)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.4.2)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@therealjasonkenney therealjasonkenney force-pushed the sc-9514/canvas-plugin-option branch from 0155979 to 8ede8bb Compare March 18, 2025 15:38
@github-actions
Copy link

Coverage (3.4.2)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.1.6)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.3.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.2.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
93.94%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb69.23%100%100%69.23%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@therealjasonkenney therealjasonkenney force-pushed the sc-9514/canvas-plugin-option branch from 8ede8bb to f4d321d Compare March 18, 2025 15:44
@github-actions
Copy link

Coverage (3.2.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
95.45%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb75%100%100%75%
./lib/canvas_inline_pdf
   plugin.rb95.83%75%100%100%30
   preview.rb83.33%50%100%100%29
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Slowest examples

Top 10 slowest examples (0.07 seconds, 91.84% of total time)
Example Description Time in seconds
spec/requests/file_preview_spec.rb:27 PDF Previews when the plugin is enabled and override is turned on redirects to the pdf when the attachment is pdf 0.01679
spec/requests/file_preview_spec.rb:59 PDF Previews when the plugin is enabled and override is turned on should return to the original controller when reading is not allowed 0.01067
spec/requests/file_preview_spec.rb:35 PDF Previews when the plugin is enabled and override is turned on returns to the original controller when the attachment is not pdf 0.01019
spec/requests/file_preview_spec.rb:49 PDF Previews when the plugin is enabled and override is turned on should return to the original controller when downloads are not allowed 0.00878
spec/requests/file_preview_spec.rb:43 PDF Previews when the plugin is enabled and override is turned on returns to the original controller when the attachment does not exist 0.00768
spec/requests/file_preview_spec.rb:76 PDF Previews when the plugin is enabled and override is turned off does not modify the basic request and returns the original controller output 0.00556
spec/canvas_inline_pdf_spec.rb:13 CanvasInlinePdf.override_file_preview? should be able to override if both enabled and override_file_preview are true 0.00541
spec/requests/file_preview_spec.rb:83 PDF Previews when the plugin is disabled does not modify the basic request and returns the original controller output 0.00282
spec/lib/plugin/attachment_extension_spec.rb:18 CanvasInlinePdf::Plugin::AttachmentExtension#inline_content? when plugin is enabled should return true when the content_type is pdf. 0.00116
spec/canvas_inline_pdf_spec.rb:52 CanvasInlinePdf.previewable? when plugin is enabled should return false when the attachment is not pdf 0.00093

@github-actions
Copy link

Slowest examples

Top 10 slowest examples (0.07 seconds, 90.86% of total time)
Example Description Time in seconds
spec/requests/file_preview_spec.rb:27 PDF Previews when the plugin is enabled and override is turned on redirects to the pdf when the attachment is pdf 0.01728
spec/requests/file_preview_spec.rb:59 PDF Previews when the plugin is enabled and override is turned on should return to the original controller when reading is not allowed 0.01067
spec/requests/file_preview_spec.rb:35 PDF Previews when the plugin is enabled and override is turned on returns to the original controller when the attachment is not pdf 0.0101
spec/requests/file_preview_spec.rb:49 PDF Previews when the plugin is enabled and override is turned on should return to the original controller when downloads are not allowed 0.00853
spec/requests/file_preview_spec.rb:43 PDF Previews when the plugin is enabled and override is turned on returns to the original controller when the attachment does not exist 0.00724
spec/requests/file_preview_spec.rb:76 PDF Previews when the plugin is enabled and override is turned off does not modify the basic request and returns the original controller output 0.0059
spec/canvas_inline_pdf_spec.rb:13 CanvasInlinePdf.override_file_preview? should be able to override if both enabled and override_file_preview are true 0.00534
spec/requests/file_preview_spec.rb:83 PDF Previews when the plugin is disabled does not modify the basic request and returns the original controller output 0.00293
spec/lib/plugin/attachment_extension_spec.rb:24 CanvasInlinePdf::Plugin::AttachmentExtension#inline_content? when plugin is enabled should return false when the content_type is not pdf 0.00148
spec/lib/plugin/attachment_extension_spec.rb:18 CanvasInlinePdf::Plugin::AttachmentExtension#inline_content? when plugin is enabled should return true when the content_type is pdf. 0.00112

@github-actions
Copy link

Coverage (3.3.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
95.45%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb75%100%100%75%
./lib/canvas_inline_pdf
   plugin.rb95.83%75%100%100%30
   preview.rb83.33%50%100%100%29
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.4.2)

Coverage after merging sc-9514/canvas-plugin-option into main will be
95.45%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb75%100%100%75%
./lib/canvas_inline_pdf
   plugin.rb95.83%75%100%100%30
   preview.rb83.33%50%100%100%29
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Slowest examples

Top 10 slowest examples (0.06 seconds, 92.21% of total time)
Example Description Time in seconds
spec/requests/file_preview_spec.rb:27 PDF Previews when the plugin is enabled and override is turned on redirects to the pdf when the attachment is pdf 0.0162
spec/requests/file_preview_spec.rb:35 PDF Previews when the plugin is enabled and override is turned on returns to the original controller when the attachment is not pdf 0.00984
spec/requests/file_preview_spec.rb:49 PDF Previews when the plugin is enabled and override is turned on should return to the original controller when downloads are not allowed 0.00751
spec/requests/file_preview_spec.rb:59 PDF Previews when the plugin is enabled and override is turned on should return to the original controller when reading is not allowed 0.0075
spec/requests/file_preview_spec.rb:43 PDF Previews when the plugin is enabled and override is turned on returns to the original controller when the attachment does not exist 0.00669
spec/canvas_inline_pdf_spec.rb:13 CanvasInlinePdf.override_file_preview? should be able to override if both enabled and override_file_preview are true 0.00609
spec/requests/file_preview_spec.rb:76 PDF Previews when the plugin is enabled and override is turned off does not modify the basic request and returns the original controller output 0.00367
spec/requests/file_preview_spec.rb:83 PDF Previews when the plugin is disabled does not modify the basic request and returns the original controller output 0.00248
spec/lib/plugin/attachment_extension_spec.rb:18 CanvasInlinePdf::Plugin::AttachmentExtension#inline_content? when plugin is enabled should return true when the content_type is pdf. 0.00135
spec/canvas_inline_pdf_spec.rb:41 CanvasInlinePdf.previewable? should return false when the attachment is nil 0.00111

@github-actions
Copy link

Coverage (3.1.6)

Coverage after merging sc-9514/canvas-plugin-option into main will be
95.45%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb75%100%100%75%
./lib/canvas_inline_pdf
   plugin.rb95.83%75%100%100%30
   preview.rb83.33%50%100%100%29
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@therealjasonkenney therealjasonkenney force-pushed the sc-9514/canvas-plugin-option branch from 643ad70 to c0a83f7 Compare May 31, 2025 00:34
@github-actions
Copy link

Slowest examples

Top 10 slowest examples (0.08 seconds, 93.5% of total time)
Example Description Time in seconds
spec/requests/file_preview_spec.rb:27 PDF Previews when the plugin is enabled and override is turned on redirects to the pdf when the attachment is pdf 0.03164
spec/requests/file_preview_spec.rb:35 PDF Previews when the plugin is enabled and override is turned on returns to the original controller when the attachment is not pdf 0.01092
spec/requests/file_preview_spec.rb:49 PDF Previews when the plugin is enabled and override is turned on should return to the original controller when downloads are not allowed 0.00832
spec/requests/file_preview_spec.rb:59 PDF Previews when the plugin is enabled and override is turned on should return to the original controller when reading is not allowed 0.00803
spec/requests/file_preview_spec.rb:43 PDF Previews when the plugin is enabled and override is turned on returns to the original controller when the attachment does not exist 0.00758
spec/canvas_inline_pdf_spec.rb:13 CanvasInlinePdf.override_file_preview? should be able to override if both enabled and override_file_preview are true 0.00674
spec/requests/file_preview_spec.rb:76 PDF Previews when the plugin is enabled and override is turned off does not modify the basic request and returns the original controller output 0.00382
spec/requests/file_preview_spec.rb:83 PDF Previews when the plugin is disabled does not modify the basic request and returns the original controller output 0.00253
spec/canvas_inline_pdf_spec.rb:41 CanvasInlinePdf.previewable? should return false when the attachment is nil 0.00161
spec/lib/plugin/attachment_extension_spec.rb:18 CanvasInlinePdf::Plugin::AttachmentExtension#inline_content? when plugin is enabled should return true when the content_type is pdf. 0.00145

@github-actions
Copy link

Slowest examples

Top 10 slowest examples (0.08 seconds, 91.77% of total time)
Example Description Time in seconds
spec/requests/file_preview_spec.rb:27 PDF Previews when the plugin is enabled and override is turned on redirects to the pdf when the attachment is pdf 0.02204
spec/requests/file_preview_spec.rb:35 PDF Previews when the plugin is enabled and override is turned on returns to the original controller when the attachment is not pdf 0.01217
spec/requests/file_preview_spec.rb:59 PDF Previews when the plugin is enabled and override is turned on should return to the original controller when reading is not allowed 0.01215
spec/requests/file_preview_spec.rb:49 PDF Previews when the plugin is enabled and override is turned on should return to the original controller when downloads are not allowed 0.00998
spec/requests/file_preview_spec.rb:43 PDF Previews when the plugin is enabled and override is turned on returns to the original controller when the attachment does not exist 0.00913
spec/requests/file_preview_spec.rb:76 PDF Previews when the plugin is enabled and override is turned off does not modify the basic request and returns the original controller output 0.00666
spec/canvas_inline_pdf_spec.rb:13 CanvasInlinePdf.override_file_preview? should be able to override if both enabled and override_file_preview are true 0.00605
spec/requests/file_preview_spec.rb:83 PDF Previews when the plugin is disabled does not modify the basic request and returns the original controller output 0.00321
spec/lib/plugin/attachment_extension_spec.rb:24 CanvasInlinePdf::Plugin::AttachmentExtension#inline_content? when plugin is enabled should return false when the content_type is not pdf 0.00161
spec/canvas_inline_pdf_spec.rb:41 CanvasInlinePdf.previewable? should return false when the attachment is nil 0.00159

@github-actions
Copy link

Coverage (3.1.6)

Coverage after merging sc-9514/canvas-plugin-option into main will be
95.59%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb75%100%100%75%
./lib/canvas_inline_pdf
   plugin.rb95.83%75%100%100%30
   preview.rb83.33%50%100%100%29
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.4.2)

Coverage after merging sc-9514/canvas-plugin-option into main will be
95.59%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb75%100%100%75%
./lib/canvas_inline_pdf
   plugin.rb95.83%75%100%100%30
   preview.rb83.33%50%100%100%29
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.3.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
95.59%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb75%100%100%75%
./lib/canvas_inline_pdf
   plugin.rb95.83%75%100%100%30
   preview.rb83.33%50%100%100%29
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.2.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
95.59%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb75%100%100%75%
./lib/canvas_inline_pdf
   plugin.rb95.83%75%100%100%30
   preview.rb83.33%50%100%100%29
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb100%100%100%100%

…_url as that handles much of the security magic needed to show the file.
@therealjasonkenney therealjasonkenney force-pushed the sc-9514/canvas-plugin-option branch from c0a83f7 to cbaade6 Compare May 31, 2025 01:34
@github-actions
Copy link

Slowest examples

Top 10 slowest examples (0.07 seconds, 90.74% of total time)
Example Description Time in seconds
spec/requests/file_preview_spec.rb:27 PDF Previews when the plugin is enabled and override is turned on redirects to the pdf when the attachment is pdf 0.01746
spec/requests/file_preview_spec.rb:59 PDF Previews when the plugin is enabled and override is turned on should return to the original controller when reading is not allowed 0.01106
spec/requests/file_preview_spec.rb:35 PDF Previews when the plugin is enabled and override is turned on returns to the original controller when the attachment is not pdf 0.01049
spec/requests/file_preview_spec.rb:49 PDF Previews when the plugin is enabled and override is turned on should return to the original controller when downloads are not allowed 0.0094
spec/requests/file_preview_spec.rb:43 PDF Previews when the plugin is enabled and override is turned on returns to the original controller when the attachment does not exist 0.00832
spec/requests/file_preview_spec.rb:76 PDF Previews when the plugin is enabled and override is turned off does not modify the basic request and returns the original controller output 0.00618
spec/canvas_inline_pdf_spec.rb:13 CanvasInlinePdf.override_file_preview? should be able to override if both enabled and override_file_preview are true 0.00553
spec/requests/file_preview_spec.rb:83 PDF Previews when the plugin is disabled does not modify the basic request and returns the original controller output 0.00289
spec/lib/plugin/attachment_extension_spec.rb:24 CanvasInlinePdf::Plugin::AttachmentExtension#inline_content? when plugin is enabled should return false when the content_type is not pdf 0.00166
spec/canvas_inline_pdf_spec.rb:41 CanvasInlinePdf.previewable? should return false when the attachment is nil 0.00119

@github-actions
Copy link

Slowest examples

Top 10 slowest examples (0.06 seconds, 92.47% of total time)
Example Description Time in seconds
spec/requests/file_preview_spec.rb:27 PDF Previews when the plugin is enabled and override is turned on redirects to the pdf when the attachment is pdf 0.02132
spec/requests/file_preview_spec.rb:35 PDF Previews when the plugin is enabled and override is turned on returns to the original controller when the attachment is not pdf 0.01029
spec/requests/file_preview_spec.rb:49 PDF Previews when the plugin is enabled and override is turned on should return to the original controller when downloads are not allowed 0.00754
spec/requests/file_preview_spec.rb:59 PDF Previews when the plugin is enabled and override is turned on should return to the original controller when reading is not allowed 0.00743
spec/requests/file_preview_spec.rb:43 PDF Previews when the plugin is enabled and override is turned on returns to the original controller when the attachment does not exist 0.00657
spec/canvas_inline_pdf_spec.rb:13 CanvasInlinePdf.override_file_preview? should be able to override if both enabled and override_file_preview are true 0.00647
spec/requests/file_preview_spec.rb:76 PDF Previews when the plugin is enabled and override is turned off does not modify the basic request and returns the original controller output 0.0036
spec/requests/file_preview_spec.rb:83 PDF Previews when the plugin is disabled does not modify the basic request and returns the original controller output 0.00242
spec/lib/plugin/attachment_extension_spec.rb:18 CanvasInlinePdf::Plugin::AttachmentExtension#inline_content? when plugin is enabled should return true when the content_type is pdf. 0.00143
spec/canvas_inline_pdf_spec.rb:41 CanvasInlinePdf.previewable? should return false when the attachment is nil 0.00113

@github-actions
Copy link

Coverage (3.4.2)

Coverage after merging sc-9514/canvas-plugin-option into main will be
91.43%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb75%100%100%75%
./lib/canvas_inline_pdf
   plugin.rb95.83%75%100%100%30
   preview.rb83.33%50%100%100%29
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb91.89%100%100%89.66%102, 63, 73

@github-actions
Copy link

Coverage (3.1.6)

Coverage after merging sc-9514/canvas-plugin-option into main will be
91.43%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb75%100%100%75%
./lib/canvas_inline_pdf
   plugin.rb95.83%75%100%100%30
   preview.rb83.33%50%100%100%29
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb91.89%100%100%89.66%102, 63, 73

@github-actions
Copy link

Slowest examples

Top 10 slowest examples (0.07 seconds, 91.12% of total time)
Example Description Time in seconds
spec/requests/file_preview_spec.rb:27 PDF Previews when the plugin is enabled and override is turned on redirects to the pdf when the attachment is pdf 0.01831
spec/requests/file_preview_spec.rb:35 PDF Previews when the plugin is enabled and override is turned on returns to the original controller when the attachment is not pdf 0.0109
spec/requests/file_preview_spec.rb:59 PDF Previews when the plugin is enabled and override is turned on should return to the original controller when reading is not allowed 0.01027
spec/requests/file_preview_spec.rb:49 PDF Previews when the plugin is enabled and override is turned on should return to the original controller when downloads are not allowed 0.00872
spec/requests/file_preview_spec.rb:43 PDF Previews when the plugin is enabled and override is turned on returns to the original controller when the attachment does not exist 0.0078
spec/canvas_inline_pdf_spec.rb:13 CanvasInlinePdf.override_file_preview? should be able to override if both enabled and override_file_preview are true 0.00579
spec/requests/file_preview_spec.rb:76 PDF Previews when the plugin is enabled and override is turned off does not modify the basic request and returns the original controller output 0.00526
spec/requests/file_preview_spec.rb:83 PDF Previews when the plugin is disabled does not modify the basic request and returns the original controller output 0.00281
spec/canvas_inline_pdf_spec.rb:41 CanvasInlinePdf.previewable? should return false when the attachment is nil 0.00137
spec/lib/plugin/attachment_extension_spec.rb:18 CanvasInlinePdf::Plugin::AttachmentExtension#inline_content? when plugin is enabled should return true when the content_type is pdf. 0.00131

@github-actions
Copy link

Coverage (3.3.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
91.43%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb75%100%100%75%
./lib/canvas_inline_pdf
   plugin.rb95.83%75%100%100%30
   preview.rb83.33%50%100%100%29
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb91.89%100%100%89.66%102, 63, 73

@github-actions
Copy link

Coverage (3.2.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
91.43%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb75%100%100%75%
./lib/canvas_inline_pdf
   plugin.rb95.83%75%100%100%30
   preview.rb83.33%50%100%100%29
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%
   override_file_preview.rb91.89%100%100%89.66%102, 63, 73

@github-actions
Copy link

Coverage (3.4.2)

Coverage after merging sc-9514/canvas-plugin-option into main will be
91.67%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb75%100%100%75%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.1.6)

Coverage after merging sc-9514/canvas-plugin-option into main will be
91.67%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb75%100%100%75%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.3.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
91.67%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb75%100%100%75%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%

@github-actions
Copy link

Coverage (3.2.7)

Coverage after merging sc-9514/canvas-plugin-option into main will be
91.67%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
./lib
   canvas_inline_pdf.rb75%100%100%75%
./lib/canvas_inline_pdf
   plugin.rb100%100%100%100%
   preview.rb100%100%100%100%
./lib/canvas_inline_pdf/plugin
   attachment_extension.rb100%100%100%100%

@therealjasonkenney therealjasonkenney merged commit 43cbb9f into main Jun 20, 2025
4 of 5 checks passed
@therealjasonkenney therealjasonkenney deleted the sc-9514/canvas-plugin-option branch June 20, 2025 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant