diff --git a/.gitignore b/.gitignore index 629e1676e..d058d20d1 100644 --- a/.gitignore +++ b/.gitignore @@ -52,4 +52,6 @@ coverage # ignore packages node_modules -package-lock.json \ No newline at end of file +package-lock.json + +*.dump diff --git a/Gemfile.lock b/Gemfile.lock index 7131f36e3..0da099209 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -293,7 +293,7 @@ GEM pry-rails (0.3.9) pry (>= 0.10.4) public_suffix (4.0.3) - puma (4.3.2) + puma (4.3.3) nio4r (~> 2.0) pundit (2.1.0) activesupport (>= 3.0.0) diff --git a/app/controllers/api/v1/conversations/messages_controller.rb b/app/controllers/api/v1/conversations/messages_controller.rb index 22fdd88fb..793b3d054 100644 --- a/app/controllers/api/v1/conversations/messages_controller.rb +++ b/app/controllers/api/v1/conversations/messages_controller.rb @@ -1,8 +1,18 @@ class Api::V1::Conversations::MessagesController < Api::BaseController - before_action :set_conversation, only: [:create] + before_action :set_conversation, only: [:index, :create] + + def index + @messages = message_finder.perform + end def create mb = Messages::Outgoing::NormalBuilder.new(current_user, @conversation, params) @message = mb.perform end + + private + + def message_finder + @message_finder ||= MessageFinder.new(@conversation, params) + end end diff --git a/app/controllers/api/v1/conversations_controller.rb b/app/controllers/api/v1/conversations_controller.rb index 6c44114be..cf0d55779 100644 --- a/app/controllers/api/v1/conversations_controller.rb +++ b/app/controllers/api/v1/conversations_controller.rb @@ -7,9 +7,7 @@ class Api::V1::ConversationsController < Api::BaseController @conversations_count = result[:count] end - def show - @messages = messages_finder.perform - end + def show; end def toggle_status @status = @conversation.toggle_status @@ -34,8 +32,4 @@ class Api::V1::ConversationsController < Api::BaseController def conversation_finder @conversation_finder ||= ConversationFinder.new(current_user, params) end - - def messages_finder - @message_finder ||= MessageFinder.new(@conversation, params) - end end diff --git a/app/controllers/twitter/callbacks_controller.rb b/app/controllers/twitter/callbacks_controller.rb index 876720f26..a46c54821 100644 --- a/app/controllers/twitter/callbacks_controller.rb +++ b/app/controllers/twitter/callbacks_controller.rb @@ -1,5 +1,7 @@ class Twitter::CallbacksController < Twitter::BaseController def show + return redirect_to app_new_twitter_inbox_url if permitted_params[:denied] + @response = twitter_client.access_token( oauth_token: permitted_params[:oauth_token], oauth_verifier: permitted_params[:oauth_verifier] @@ -46,6 +48,6 @@ class Twitter::CallbacksController < Twitter::BaseController end def permitted_params - params.permit(:oauth_token, :oauth_verifier) + params.permit(:oauth_token, :oauth_verifier, :denied) end end diff --git a/app/javascript/dashboard/api/inbox/message.js b/app/javascript/dashboard/api/inbox/message.js index 367e3e00c..00dda8a63 100644 --- a/app/javascript/dashboard/api/inbox/message.js +++ b/app/javascript/dashboard/api/inbox/message.js @@ -15,7 +15,7 @@ class MessageApi extends ApiClient { } getPreviousMessages({ conversationId, before }) { - return axios.get(`${this.url}/${conversationId}`, { + return axios.get(`${this.url}/${conversationId}/messages`, { params: { before }, }); } diff --git a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue index 7e7bacfd2..fff476945 100644 --- a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue +++ b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue @@ -33,14 +33,18 @@
+
{{ $t('PROFILE_SETTINGS.FORM.EMAIL_NOTIFICATIONS_SECTION.NOTE') }}
{{ $t('PROFILE_SETTINGS.FORM.PROFILE_SECTION.NOTE') }}
{{ $t('PROFILE_SETTINGS.FORM.PASSWORD_SECTION.NOTE') }}