Skip to content

Commit

Permalink
Merge pull request #731 from dhruvCW/bundle_bootstrap_poppler
Browse files Browse the repository at this point in the history
Bundle bootstrap, jquery and poppler with the library.
  • Loading branch information
jnunemaker authored May 24, 2023
2 parents 50dafc1 + fc323eb commit 4e31057
Show file tree
Hide file tree
Showing 5 changed files with 8,808 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lib/flipper/ui/action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,30 @@ def feature_name

SOURCES = {
bootstrap_css: {
src: 'https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css'.freeze,
src: '/css/bootstrap-4.6.0.min.css'.freeze,
hash: 'sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l'.freeze
}.freeze,
jquery_js: {
src: 'https://code.jquery.com/jquery-3.6.0.slim.js'.freeze,
src: '/js/jquery-3.6.0.slim.js'.freeze,
hash: 'sha256-HwWONEZrpuoh951cQD1ov2HUK5zA5DwJ1DNUXaM6FsY='.freeze
}.freeze,
popper_js: {
src: 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js'.freeze,
src: '/js/popper-1.12.9.min.js'.freeze,
hash: 'sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q'.freeze
}.freeze,
bootstrap_js: {
src: 'https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.min.js'.freeze,
src: '/js/bootstrap-4.6.0.min.js'.freeze,
hash: 'sha384-+YQ4JLhjyBLPDQt//I+STsc9iw4uQqACwlvpslubQzn4u2UU2UFM80nGisd026JF'.freeze
}.freeze
}.freeze
SCRIPT_SRCS = SOURCES.values_at(:jquery_js, :popper_js, :bootstrap_js).map { |s| s[:src] }
STYLE_SRCS = SOURCES.values_at(:bootstrap_css).map { |s| s[:src] }
CONTENT_SECURITY_POLICY = <<-CSP.delete("\n")
default-src 'none';
img-src 'self';
font-src 'self';
script-src 'report-sample' 'self' #{SCRIPT_SRCS.join(' ')};
style-src 'self' 'unsafe-inline' #{STYLE_SRCS.join(' ')};
script-src 'report-sample' 'self';
style-src 'self' 'unsafe-inline';
style-src-attr 'unsafe-inline' ;
style-src-elem 'self' #{STYLE_SRCS.join(' ')};
style-src-elem 'self';
CSP

# Public: Call this in subclasses so the action knows its route.
Expand Down
7 changes: 7 additions & 0 deletions lib/flipper/ui/public/css/bootstrap-4.6.0.min.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions lib/flipper/ui/public/js/bootstrap-4.6.0.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 4e31057

Please sign in to comment.