effective_messaging 0.7.5 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7407b82bbf657f12efd728834391a82d5a3f6d2d45e2833e4e092c442a9f87c8
4
- data.tar.gz: 9d5d26c07a3b88e0c8a9786e6c5b35cf75505b647116bd55732b543c163f4756
3
+ metadata.gz: 6d5586319e69df10977387b8dde4f21c28b6c091ba2d013c0aa92356c5d64612
4
+ data.tar.gz: 30780a50e3482bf8f66492f9b965f3dba832c2ccfd237753517214536484bc6c
5
5
  SHA512:
6
- metadata.gz: 79a35234d7e9857bd44190646ed0cb10eeafe10a92998fe90ca56137ca85943516c6759b3ba0fede7b6902296c5d10a3231569cb49fcd39e5f053be50b83e7f7
7
- data.tar.gz: 28e9c078ca521aecdb71da681074cb5e6fc5b9fa6f14f34e4b5a8625a33c6fc7cda767f21b4dcc3fe19f8db804f92b6d95c7b17f31082090adf1593ebecc680e
6
+ metadata.gz: 984b176a01cb8fb1e6935975f20fba184e0c4af16783faef38c6372dc76b85a9735b0b8d87723564026a22add1426c1a78b2c0d14c25f906d4b76470119a612e
7
+ data.tar.gz: 159df93437962685676e463ad350f91326de8d87efd440027b1da1e8f1b6061552a8d1bf307cdc8ba9fedc9faaf87574754421a2d3794a63410f7caf5518a27d
@@ -35,7 +35,13 @@ module Effective
35
35
  validates :body, presence: true
36
36
 
37
37
  def to_s
38
- body.presence || 'New Chat Message'
38
+ truncate(body.presence || 'New Chat Message')
39
+ end
40
+
41
+ private
42
+
43
+ def truncate(value)
44
+ value.length > 100 ? (value.first(100) + '...') : value
39
45
  end
40
46
 
41
47
  end
@@ -0,0 +1,9 @@
1
+ = effective_form_with(model: [:admin, chat_message], engine: true) do |f|
2
+ - unless inline_datatable?
3
+ = f.static_field :chat, label: et(f.object.chat)
4
+
5
+ = f.static_field :name, label: 'From'
6
+ = f.text_area :body
7
+
8
+ = f.submit 'Save'
9
+
@@ -3,6 +3,9 @@
3
3
  = render 'admin/chats/form_chat', chat: chat
4
4
 
5
5
  - if chat.persisted?
6
+ = tab(chat.chat_messages) do
7
+ = render_inline_datatable(Admin::EffectiveChatMessagesDatatable.new(chat: chat))
8
+
6
9
  - if chat.respond_to?(:logs_datatable)
7
10
  = tab "Logs" do
8
11
  = render_inline_datatable(chat.logs_datatable)
data/config/routes.rb CHANGED
@@ -12,7 +12,7 @@ EffectiveMessaging::Engine.routes.draw do
12
12
 
13
13
  namespace :admin do
14
14
  resources :chats
15
- resources :chat_messages, only: [:index, :show, :destroy]
15
+ resources :chat_messages, except: [:new, :create]
16
16
 
17
17
  resources :notifications do
18
18
  post :enable, on: :member
@@ -1,3 +1,3 @@
1
1
  module EffectiveMessaging
2
- VERSION = '0.7.5'.freeze
2
+ VERSION = '0.8.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_messaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-20 00:00:00.000000000 Z
11
+ date: 2024-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -229,6 +229,7 @@ files:
229
229
  - app/models/effective/notification.rb
230
230
  - app/models/effective/notification_log.rb
231
231
  - app/views/admin/chat_messages/_chat_message.html.haml
232
+ - app/views/admin/chat_messages/_form.html.haml
232
233
  - app/views/admin/chats/_chat.html.haml
233
234
  - app/views/admin/chats/_form.html.haml
234
235
  - app/views/admin/chats/_form_chat.html.haml