Skip to content

Commit

Permalink
Stage (#460)
Browse files Browse the repository at this point in the history
* exclude number nth

* docs client i18n fix

* collection selector on docs , checkbox fix

* load i18n listen on dev env

* dashboard links to tester & playground

* fix current locale set on client

* lint

* husky precommit

* force encoding on body email message

* rails upgrade

* article display fix
  • Loading branch information
michelson committed Aug 7, 2021
1 parent 3719141 commit 691b840
Show file tree
Hide file tree
Showing 156 changed files with 2,163 additions and 1,628 deletions.
5 changes: 5 additions & 0 deletions .husky/pre-commit
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn format:prettier
yarn format:ruby
5 changes: 5 additions & 0 deletions .prettierignore
@@ -0,0 +1,5 @@
.esm
dist
app/javascript/src/styles/styles.css
translations.json
messenger-translations.json
4 changes: 4 additions & 0 deletions .rubocop.yml
Expand Up @@ -25,9 +25,13 @@ Style/AsciiComments:
Enabled: false
Lint/MissingSuper:
Enabled: false
Rails/SkipsModelValidations:
Enabled: false
Metrics/ModuleLength:
Exclude:
- app/services/message_apis/helpers.rb
Rails/InverseOf:
Enabled: false
AllCops:
NewCops: enable
Exclude:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -7,7 +7,7 @@ ruby "2.7.2"

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem "pg"
gem "rails", "6.1.3.1" # , github: "rails/rails",
gem "rails", "6.1.4" # , github: "rails/rails",

gem "anycable-rails"
# Use sqlite3 as the database for Active Record
Expand Down
136 changes: 68 additions & 68 deletions Gemfile.lock
Expand Up @@ -59,62 +59,62 @@ GEM
action_policy (>= 0.5.0)
graphql (>= 1.9.3)
ruby-next-core (>= 0.10.0)
actioncable (6.1.3.1)
actionpack (= 6.1.3.1)
activesupport (= 6.1.3.1)
actioncable (6.1.4)
actionpack (= 6.1.4)
activesupport (= 6.1.4)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.3.1)
actionpack (= 6.1.3.1)
activejob (= 6.1.3.1)
activerecord (= 6.1.3.1)
activestorage (= 6.1.3.1)
activesupport (= 6.1.3.1)
actionmailbox (6.1.4)
actionpack (= 6.1.4)
activejob (= 6.1.4)
activerecord (= 6.1.4)
activestorage (= 6.1.4)
activesupport (= 6.1.4)
mail (>= 2.7.1)
actionmailer (6.1.3.1)
actionpack (= 6.1.3.1)
actionview (= 6.1.3.1)
activejob (= 6.1.3.1)
activesupport (= 6.1.3.1)
actionmailer (6.1.4)
actionpack (= 6.1.4)
actionview (= 6.1.4)
activejob (= 6.1.4)
activesupport (= 6.1.4)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.3.1)
actionview (= 6.1.3.1)
activesupport (= 6.1.3.1)
actionpack (6.1.4)
actionview (= 6.1.4)
activesupport (= 6.1.4)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.3.1)
actionpack (= 6.1.3.1)
activerecord (= 6.1.3.1)
activestorage (= 6.1.3.1)
activesupport (= 6.1.3.1)
actiontext (6.1.4)
actionpack (= 6.1.4)
activerecord (= 6.1.4)
activestorage (= 6.1.4)
activesupport (= 6.1.4)
nokogiri (>= 1.8.5)
actionview (6.1.3.1)
activesupport (= 6.1.3.1)
actionview (6.1.4)
activesupport (= 6.1.4)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_importer (0.2.6)
roo
activejob (6.1.3.1)
activesupport (= 6.1.3.1)
activejob (6.1.4)
activesupport (= 6.1.4)
globalid (>= 0.3.6)
activemodel (6.1.3.1)
activesupport (= 6.1.3.1)
activerecord (6.1.3.1)
activemodel (= 6.1.3.1)
activesupport (= 6.1.3.1)
activestorage (6.1.3.1)
actionpack (= 6.1.3.1)
activejob (= 6.1.3.1)
activerecord (= 6.1.3.1)
activesupport (= 6.1.3.1)
activemodel (6.1.4)
activesupport (= 6.1.4)
activerecord (6.1.4)
activemodel (= 6.1.4)
activesupport (= 6.1.4)
activestorage (6.1.4)
actionpack (= 6.1.4)
activejob (= 6.1.4)
activerecord (= 6.1.4)
activesupport (= 6.1.4)
marcel (~> 1.0.0)
mini_mime (~> 1.0.2)
activesupport (6.1.3.1)
mini_mime (>= 1.1.0)
activesupport (6.1.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -167,7 +167,7 @@ GEM
code-scanning-rubocop (0.5.0)
rubocop (~> 1.0)
coderay (1.1.3)
concurrent-ruby (1.1.8)
concurrent-ruby (1.1.9)
connection_pool (2.2.3)
crack (0.4.4)
crass (1.0.6)
Expand Down Expand Up @@ -244,8 +244,8 @@ GEM
geocoder (1.6.4)
geoip (1.6.4)
glob (0.2.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
globalid (0.5.2)
activesupport (>= 5.0)
goldiloader (3.2.0)
activerecord (>= 4.2, < 6.3)
activesupport (>= 4.2, < 6.3)
Expand Down Expand Up @@ -328,29 +328,29 @@ GEM
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
loofah (2.9.0)
loofah (2.11.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.0)
marcel (1.0.1)
memoist (0.16.2)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.1104)
mini_magick (4.11.0)
mini_mime (1.0.3)
mini_portile2 (2.5.1)
mini_mime (1.1.0)
mini_portile2 (2.6.1)
minitest (5.14.4)
msgpack (1.3.3)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.1.1)
mustache (1.1.1)
nio4r (2.5.7)
nokogiri (1.11.5)
mini_portile2 (~> 2.5.0)
nio4r (2.5.8)
nokogiri (1.12.2)
mini_portile2 (~> 2.6.1)
racc (~> 1.4)
oauth (0.5.5)
oauth2 (1.4.4)
Expand Down Expand Up @@ -392,34 +392,34 @@ GEM
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.1.3.1)
actioncable (= 6.1.3.1)
actionmailbox (= 6.1.3.1)
actionmailer (= 6.1.3.1)
actionpack (= 6.1.3.1)
actiontext (= 6.1.3.1)
actionview (= 6.1.3.1)
activejob (= 6.1.3.1)
activemodel (= 6.1.3.1)
activerecord (= 6.1.3.1)
activestorage (= 6.1.3.1)
activesupport (= 6.1.3.1)
rails (6.1.4)
actioncable (= 6.1.4)
actionmailbox (= 6.1.4)
actionmailer (= 6.1.4)
actionpack (= 6.1.4)
actiontext (= 6.1.4)
actionview (= 6.1.4)
activejob (= 6.1.4)
activemodel (= 6.1.4)
activerecord (= 6.1.4)
activestorage (= 6.1.4)
activesupport (= 6.1.4)
bundler (>= 1.15.0)
railties (= 6.1.3.1)
railties (= 6.1.4)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (6.1.3.1)
actionpack (= 6.1.3.1)
activesupport (= 6.1.3.1)
railties (6.1.4)
actionpack (= 6.1.4)
activesupport (= 6.1.4)
method_source
rake (>= 0.8.7)
rake (>= 0.13)
thor (~> 1.0)
rainbow (3.0.0)
rake (13.0.3)
rake (13.0.6)
ransack (2.4.0)
activerecord (>= 5.2.4)
activesupport (>= 5.2.4)
Expand Down Expand Up @@ -570,7 +570,7 @@ GEM
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
websocket-driver (0.7.3)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xml-simple (1.1.8)
Expand Down Expand Up @@ -638,7 +638,7 @@ DEPENDENCIES
puma (~> 5.3)
rack-cors (~> 1.0)
rack-mini-profiler (~> 2.0)
rails (= 6.1.3.1)
rails (= 6.1.4)
ransack
redis (~> 4.0)
redis-namespace (~> 1.8)
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -9,7 +9,7 @@ Rails.application.load_tasks

namespace :locales do
desc "compile i18n before compile"
task :build do
task build: :environment do
system("yarn i18n:export")
end
end
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/api/v1/hooks_controller.rb
Expand Up @@ -64,7 +64,8 @@ def process_email_notification(message)

# EmailReplyParser.parse_reply(mail.text_part.body.to_s)
# message = EmailReplyParser.parse_reply(mail.text_part.body.to_s).gsub("\n", "<br/>").force_encoding(Encoding::UTF_8)
message = EmailReplyTrimmer.trim(mail.text_part.body.to_s).gsub("\n", "<br/>").force_encoding(Encoding::UTF_8)
body = mail.text_part.body.to_s.force_encoding(Encoding::UTF_8)
message = EmailReplyTrimmer.trim(body).gsub("\n", "<br/>")

app, conversation, from = handle_conversation_part(mail)

Expand Down
5 changes: 4 additions & 1 deletion app/controllers/concerns/package_iframe_behavior.rb
Expand Up @@ -56,9 +56,10 @@ def package_iframe_internal

html = presenter.sheet_view(opts)

# rubocop:disable Rails/OutputSafety
response.headers.delete "X-Frame-Options"

render html: html.html_safe, layout: false
# rubocop:enable Rails/OutputSafety
end

def handle_user_data(data)
Expand Down Expand Up @@ -88,6 +89,8 @@ def iframe_package_request(url, data, app_user)
resp = Faraday.post(url, data.merge!(user: app_user).to_json,
"Content-Type" => "application/json")
response.headers.delete "X-Frame-Options"
# rubocop:disable Rails/OutputSafety
resp.body.html_safe
# rubocop:enable Rails/OutputSafety
end
end

0 comments on commit 691b840

Please sign in to comment.