Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
caiosba committed Mar 3, 2024
2 parents ccb8861 + 00e7074 commit f19070f
Show file tree
Hide file tree
Showing 131 changed files with 5,853 additions and 4,268 deletions.
7 changes: 4 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ end
gem 'webmock'
gem 'pender_client', git: 'https://github.com/meedan/pender-client.git', ref: '89c9072'
gem 'lograge'
gem 'rails', '~> 6.1.0'
gem 'rails', '~> 6.1.7'
gem 'pg', '~> 1.1'
gem "json", ">= 2.3.0"
gem 'turbolinks'
Expand All @@ -60,8 +60,9 @@ gem 'elasticsearch-persistence', '7.1.1'
gem 'paper_trail', '13.0.0'
gem 'graphiql-rails', git: 'https://github.com/meedan/graphiql-rails.git', ref: '8db0eac'
gem 'graphql-formatter'
gem 'nokogiri', '1.14.3'
gem 'nokogiri', '1.16.2'
gem 'puma'
gem 'rack-attack'
gem 'rack-cors', '1.0.6', require: 'rack/cors'
gem 'sidekiq', '5.2.10'
gem 'sidekiq-cloudwatchmetrics'
Expand Down Expand Up @@ -96,7 +97,7 @@ gem 'json-schema', '2.5.0'
gem 'google_drive'
gem 'activerecord-import', '1.1.0'
gem 'redis-rails'
gem 'rack', '2.2.6.4'
gem 'rack', '2.2.8.1'
gem 'jwt'
gem 'smooch-api', '> 5.34.1', git: 'https://github.com/meedan/sunshine-conversations-ruby', branch: 'v5.34.2'
gem 'typhoeus'
Expand Down
149 changes: 76 additions & 73 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -74,62 +74,62 @@ GEM
specs:
aasm (5.2.0)
concurrent-ruby (~> 1.0)
actioncable (6.1.7.6)
actionpack (= 6.1.7.6)
activesupport (= 6.1.7.6)
actioncable (6.1.7.7)
actionpack (= 6.1.7.7)
activesupport (= 6.1.7.7)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.7.6)
actionpack (= 6.1.7.6)
activejob (= 6.1.7.6)
activerecord (= 6.1.7.6)
activestorage (= 6.1.7.6)
activesupport (= 6.1.7.6)
actionmailbox (6.1.7.7)
actionpack (= 6.1.7.7)
activejob (= 6.1.7.7)
activerecord (= 6.1.7.7)
activestorage (= 6.1.7.7)
activesupport (= 6.1.7.7)
mail (>= 2.7.1)
actionmailer (6.1.7.6)
actionpack (= 6.1.7.6)
actionview (= 6.1.7.6)
activejob (= 6.1.7.6)
activesupport (= 6.1.7.6)
actionmailer (6.1.7.7)
actionpack (= 6.1.7.7)
actionview (= 6.1.7.7)
activejob (= 6.1.7.7)
activesupport (= 6.1.7.7)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.7.6)
actionview (= 6.1.7.6)
activesupport (= 6.1.7.6)
actionpack (6.1.7.7)
actionview (= 6.1.7.7)
activesupport (= 6.1.7.7)
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.7.6)
actionpack (= 6.1.7.6)
activerecord (= 6.1.7.6)
activestorage (= 6.1.7.6)
activesupport (= 6.1.7.6)
actiontext (6.1.7.7)
actionpack (= 6.1.7.7)
activerecord (= 6.1.7.7)
activestorage (= 6.1.7.7)
activesupport (= 6.1.7.7)
nokogiri (>= 1.8.5)
actionview (6.1.7.6)
activesupport (= 6.1.7.6)
actionview (6.1.7.7)
activesupport (= 6.1.7.7)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.7.6)
activesupport (= 6.1.7.6)
activejob (6.1.7.7)
activesupport (= 6.1.7.7)
globalid (>= 0.3.6)
activemodel (6.1.7.6)
activesupport (= 6.1.7.6)
activerecord (6.1.7.6)
activemodel (= 6.1.7.6)
activesupport (= 6.1.7.6)
activemodel (6.1.7.7)
activesupport (= 6.1.7.7)
activerecord (6.1.7.7)
activemodel (= 6.1.7.7)
activesupport (= 6.1.7.7)
activerecord-import (1.1.0)
activerecord (>= 3.2)
activestorage (6.1.7.6)
actionpack (= 6.1.7.6)
activejob (= 6.1.7.6)
activerecord (= 6.1.7.6)
activesupport (= 6.1.7.6)
activestorage (6.1.7.7)
actionpack (= 6.1.7.7)
activejob (= 6.1.7.7)
activerecord (= 6.1.7.7)
activesupport (= 6.1.7.7)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.7.6)
activesupport (6.1.7.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -165,7 +165,7 @@ GEM
aws-sigv4 (~> 1.1)
aws-sigv4 (1.4.0)
aws-eventstream (~> 1, >= 1.0.2)
bcrypt (3.1.18)
bcrypt (3.1.20)
bitly (2.0.1)
oauth2 (>= 0.5.0, < 2.0)
bootsnap (1.16.0)
Expand Down Expand Up @@ -196,7 +196,7 @@ GEM
rexml
crass (1.0.6)
daemons (1.4.1)
date (3.3.3)
date (3.3.4)
debugger-ruby_core_source (1.3.8)
declarative (0.0.20)
deep_cloneable (3.2.0)
Expand All @@ -215,7 +215,7 @@ GEM
devise (~> 4.0)
railties (< 7.1)
rotp (~> 6.0)
devise_invitable (2.0.7)
devise_invitable (2.0.9)
actionmailer (>= 5.0)
devise (>= 4.6)
diff-lcs (1.5.0)
Expand Down Expand Up @@ -313,8 +313,8 @@ GEM
geojsonlint (0.1.3)
activemodel (>= 3.0.0)
json-schema (~> 2.5.0)
globalid (1.1.0)
activesupport (>= 5.0)
globalid (1.2.1)
activesupport (>= 6.1)
google-apis-core (0.4.2)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.16.2, < 2.a)
Expand Down Expand Up @@ -420,7 +420,7 @@ GEM
mime-types-data (3.2022.0105)
mini_magick (4.10.1)
mini_mime (1.1.5)
mini_portile2 (2.8.4)
mini_portile2 (2.8.5)
minitest (5.19.0)
minitest-hooks (1.5.0)
minitest (> 5.3)
Expand All @@ -436,19 +436,19 @@ GEM
net-http-digest_auth (1.4.1)
net-http-persistent (4.0.1)
connection_pool (~> 2.2)
net-imap (0.3.7)
net-imap (0.4.10)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
net-protocol (0.2.2)
timeout
net-smtp (0.3.3)
net-smtp (0.4.0.1)
net-protocol
netrc (0.11.0)
nio4r (2.7.0)
nokogiri (1.14.3)
mini_portile2 (~> 2.8.0)
nokogiri (1.16.2)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
numerizer (0.1.1)
oauth (0.5.8)
Expand Down Expand Up @@ -635,29 +635,31 @@ GEM
pusher-signature (~> 0.1.8)
pusher-signature (0.1.8)
raabro (1.4.0)
racc (1.7.1)
rack (2.2.6.4)
racc (1.7.3)
rack (2.2.8.1)
rack-attack (6.7.0)
rack (>= 1.0, < 4)
rack-cors (1.0.6)
rack (>= 1.6.0)
rack-protection (2.2.0)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
railroady (1.6.0)
rails (6.1.7.6)
actioncable (= 6.1.7.6)
actionmailbox (= 6.1.7.6)
actionmailer (= 6.1.7.6)
actionpack (= 6.1.7.6)
actiontext (= 6.1.7.6)
actionview (= 6.1.7.6)
activejob (= 6.1.7.6)
activemodel (= 6.1.7.6)
activerecord (= 6.1.7.6)
activestorage (= 6.1.7.6)
activesupport (= 6.1.7.6)
rails (6.1.7.7)
actioncable (= 6.1.7.7)
actionmailbox (= 6.1.7.7)
actionmailer (= 6.1.7.7)
actionpack (= 6.1.7.7)
actiontext (= 6.1.7.7)
actionview (= 6.1.7.7)
activejob (= 6.1.7.7)
activemodel (= 6.1.7.7)
activerecord (= 6.1.7.7)
activestorage (= 6.1.7.7)
activesupport (= 6.1.7.7)
bundler (>= 1.15.0)
railties (= 6.1.7.6)
railties (= 6.1.7.7)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
Expand All @@ -670,15 +672,15 @@ GEM
rails-graphql-generator (0.1.0)
rails-html-sanitizer (1.4.4)
loofah (~> 2.19, >= 2.19.1)
railties (6.1.7.6)
actionpack (= 6.1.7.6)
activesupport (= 6.1.7.6)
railties (6.1.7.7)
actionpack (= 6.1.7.7)
activesupport (= 6.1.7.7)
method_source
rake (>= 12.2)
thor (~> 1.0)
rainbow (2.2.2)
rake
rake (13.0.6)
rake (13.1.0)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
Expand Down Expand Up @@ -827,9 +829,9 @@ GEM
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thor (1.2.2)
thor (1.3.1)
thread_safe (0.3.6)
timeout (0.4.0)
timeout (0.4.1)
tins (1.31.0)
sync
to_regexp (0.2.1)
Expand Down Expand Up @@ -874,7 +876,7 @@ GEM
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.11)
zeitwerk (2.6.13)

PLATFORMS
ruby
Expand Down Expand Up @@ -939,7 +941,7 @@ DEPENDENCIES
minitest-retry
mocha (~> 2.0)
multi_json (= 1.15.0)
nokogiri (= 1.14.3)
nokogiri (= 1.16.2)
omniauth-facebook
omniauth-google-oauth2!
omniauth-slack
Expand Down Expand Up @@ -982,11 +984,12 @@ DEPENDENCIES
phony_rails
puma
pusher
rack (= 2.2.6.4)
rack (= 2.2.8.1)
rack-attack
rack-cors (= 1.0.6)
rack-protection (= 2.2.0)
railroady
rails (~> 6.1.0)
rails (~> 6.1.7)
rails-controller-testing
rails-graphql-generator
rails-html-sanitizer (= 1.4.4)
Expand Down
2 changes: 1 addition & 1 deletion app/graph/mutations/graphql_crud_operations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def self.define_returns(obj, parent_names)
ret["#{obj_name}Edge".to_sym] = GraphQL::Relay::Edge.between(
child,
parent
) if !%w[related_to public_team version].include?(parent_name)
) if !%w[related_to public_team version me].include?(parent_name)
ret[parent_name.to_sym] = parent
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/graph/mutations/tipline_message_mutations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ class Send < Mutations::BaseMutation
field :success, GraphQL::Types::Boolean, null: true

def resolve(in_reply_to_id: nil, message: nil)
request = Annotation.find(in_reply_to_id).load
request = TiplineRequest.find(in_reply_to_id)
ability = context[:ability] || Ability.new
success = false
if Team.current&.id && User.current&.id && ability.can?(:send, TiplineMessage.new(team: Team.current)) && request.annotated.team_id == Team.current.id
if Team.current&.id && User.current&.id && ability.can?(:send, TiplineMessage.new(team: Team.current)) && request.team_id == Team.current.id
success = Bot::Smooch.reply_to_request_with_custom_message(request, message)
end
{ success: success }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class UserDisconnectLoginAccountMutation < Mutations::BaseMutation
argument :uid, GraphQL::Types::String, required: true

field :success, GraphQL::Types::Boolean, null: true
field :user, UserType, null: true
field :user, MeType, null: true

def resolve(provider:, uid:)
user = User.current
Expand Down
2 changes: 1 addition & 1 deletion app/graph/mutations/user_mutations.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module UserMutations
MUTATION_TARGET = 'user'.freeze
PARENTS = [].freeze
PARENTS = ['me'].freeze

module SharedCreateAndUpdateFields
extend ActiveSupport::Concern
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class UserTwoFactorAuthenticationMutation < Mutations::BaseMutation
argument :otp_required, GraphQL::Types::Boolean, required: false, camelize: false

field :success, GraphQL::Types::Boolean, null: true
field :user, UserType, null: true
field :user, MeType, null: true

def resolve(id:, password:, qrcode: nil, otp_required: nil)
user = User.where(id: id).last
Expand Down
2 changes: 2 additions & 0 deletions app/graph/relay_on_rails_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class RelayOnRailsSchema < GraphQL::Schema

lazy_resolve(Concurrent::Future, :value)

disable_introspection_entry_points unless Rails.env.development?

class << self
def resolve_type(_type, object, _ctx)
klass = (object.respond_to?(:type) && object.type) ? object.type : object.class_name
Expand Down
2 changes: 1 addition & 1 deletion app/graph/types/bot_user_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def settings_as_json_schema(team_slug: nil)
object.settings_as_json_schema(false, team_slug)
end

field :team_author, TeamType, null: true
field :team_author, PublicTeamType, null: true

def team_author
RecordLoader.for(Team).load(object.team_author_id.to_i)
Expand Down
Loading

0 comments on commit f19070f

Please sign in to comment.