Compare commits
20
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f998d6123 | ||
|
|
80a66174a7 | ||
|
|
1b55172eb7 | ||
|
|
590ce788b9 | ||
|
|
a25179c342 | ||
|
|
aea9470b6a | ||
|
|
6382707146 | ||
|
|
318e0b10e4 | ||
|
|
db9daa5fb6 | ||
|
|
d68345672c | ||
|
|
1a74e52445 | ||
|
|
ae5deca24b | ||
|
|
7c174cacc8 | ||
|
|
43b5750314 | ||
|
|
1a19c864d3 | ||
|
|
9614e19d82 | ||
|
|
1a812692c9 | ||
|
|
ce394e7f08 | ||
|
|
d3afe64bb1 | ||
|
|
9cff6c04ee |
+1
-1
@@ -1 +1 @@
|
||||
2.2.0
|
||||
2.17.0
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
2.1.0
|
||||
2.3.0
|
||||
|
||||
@@ -261,6 +261,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Basic filter dropdown
|
||||
.basic-filter {
|
||||
left: 0;
|
||||
right: unset;
|
||||
}
|
||||
|
||||
// Card label
|
||||
.label-container {
|
||||
.label {
|
||||
|
||||
+4
-1
@@ -37,7 +37,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<thumbnail
|
||||
v-if="notificationItem.primary_actor.meta.assignee"
|
||||
v-if="hasAssignee(notificationItem)"
|
||||
:src="notificationItem.primary_actor.meta.assignee.thumbnail"
|
||||
size="16px"
|
||||
:username="notificationItem.primary_actor.meta.assignee.name"
|
||||
@@ -127,6 +127,9 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
hasAssignee(notification) {
|
||||
return notification.primary_actor.meta?.assignee;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -31,6 +31,6 @@ class Webhooks::InstagramEventsJob < ApplicationJob
|
||||
end
|
||||
|
||||
def messages(entry)
|
||||
(entry[:messaging].presence || entry[:standby])
|
||||
(entry[:messaging].presence || entry[:standby] || [])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -48,7 +48,6 @@ class JsonSchemaValidator < ActiveModel::Validator
|
||||
|
||||
# Add validation errors to the record with a formatted statement
|
||||
validation_errors.each do |error|
|
||||
# byebug
|
||||
format_and_append_error(error, record)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,6 +3,7 @@ module Labelable
|
||||
|
||||
included do
|
||||
acts_as_taggable_on :labels
|
||||
before_save :clear_labels_cache
|
||||
end
|
||||
|
||||
def update_labels(labels = nil)
|
||||
@@ -13,4 +14,21 @@ module Labelable
|
||||
new_labels << labels
|
||||
update!(label_list: new_labels)
|
||||
end
|
||||
|
||||
def preloaded_label_list
|
||||
unless @labels_cache
|
||||
@labels_cache = []
|
||||
taggings.each do |tagging|
|
||||
@labels_cache << tagging.tag.name
|
||||
end
|
||||
end
|
||||
|
||||
@labels_cache || []
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def clear_labels_cache
|
||||
@labels_cache = nil
|
||||
end
|
||||
end
|
||||
|
||||
@@ -58,8 +58,9 @@ class Conversations::FilterService < FilterService
|
||||
|
||||
def conversations
|
||||
@conversations = @conversations.includes(
|
||||
:taggings, :inbox, { assignee: { avatar_attachment: [:blob] } }, { contact: { avatar_attachment: [:blob] } }, :team
|
||||
:taggings, :inbox, { assignee: { avatar_attachment: [:blob] } }, { contact: { avatar_attachment: [:blob] } }, :team, :messages
|
||||
)
|
||||
|
||||
@conversations.latest.page(current_page)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -17,8 +17,8 @@ json.meta do
|
||||
end
|
||||
|
||||
json.id conversation.display_id
|
||||
if conversation.messages.count.zero?
|
||||
json.messages []
|
||||
if !conversation.messages.first.present?
|
||||
json.messages []
|
||||
elsif conversation.unread_incoming_messages.count.zero?
|
||||
json.messages [conversation.messages.includes([{ attachments: [{ file_attachment: [:blob] }] }]).last.try(:push_event_data)]
|
||||
else
|
||||
@@ -33,7 +33,7 @@ json.can_reply conversation.can_reply?
|
||||
json.contact_last_seen_at conversation.contact_last_seen_at.to_i
|
||||
json.custom_attributes conversation.custom_attributes
|
||||
json.inbox_id conversation.inbox_id
|
||||
json.labels conversation.label_list
|
||||
json.labels conversation.preloaded_label_list
|
||||
json.muted conversation.muted?
|
||||
json.snoozed_until conversation.snoozed_until
|
||||
json.status conversation.status
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# Description: Install and manage a Chatwoot installation.
|
||||
# OS: Ubuntu 20.04 LTS
|
||||
# Script Version: 2.2.0
|
||||
# Script Version: 2.3.0
|
||||
# Run this script as root
|
||||
|
||||
set -eu -o errexit -o pipefail -o noclobber -o nounset
|
||||
@@ -19,7 +19,7 @@ fi
|
||||
# option --output/-o requires 1 argument
|
||||
LONGOPTS=console,debug,help,install,Install:,logs:,restart,ssl,upgrade,webserver,version
|
||||
OPTIONS=cdhiI:l:rsuwv
|
||||
CWCTL_VERSION="2.2.0"
|
||||
CWCTL_VERSION="2.3.0"
|
||||
pg_pass=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 15 ; echo '')
|
||||
|
||||
# if user does not specify an option
|
||||
@@ -175,6 +175,8 @@ function install_dependencies() {
|
||||
curl -sL https://deb.nodesource.com/setup_16.x | bash -
|
||||
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
||||
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
|
||||
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
|
||||
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
|
||||
apt update
|
||||
|
||||
apt install -y \
|
||||
@@ -183,7 +185,8 @@ function install_dependencies() {
|
||||
libssl-dev libyaml-dev libreadline-dev gnupg2 \
|
||||
postgresql-client redis-tools \
|
||||
nodejs yarn patch ruby-dev zlib1g-dev liblzma-dev \
|
||||
libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev sudo
|
||||
libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev sudo \
|
||||
libvips
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
@@ -708,6 +711,26 @@ function upgrade_prereq() {
|
||||
EOF
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
# Update redis to v7+ for Rails 7 support(-u/--upgrade)
|
||||
# and install libvips for image processing support in Rails 7
|
||||
# Globals:
|
||||
# None
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# None
|
||||
##############################################################################
|
||||
function upgrade_redis() {
|
||||
echo "Upgrading Redis to v7+ for Rails 7 support(Chatwoot v2.17+)"
|
||||
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
|
||||
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
|
||||
apt update -y
|
||||
apt upgrade redis-server -y
|
||||
apt install libvips -y
|
||||
}
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Upgrade an existing installation to latest stable version(-u/--upgrade)
|
||||
# Globals:
|
||||
@@ -722,6 +745,7 @@ function upgrade() {
|
||||
echo "Upgrading Chatwoot to v$CW_VERSION"
|
||||
sleep 3
|
||||
upgrade_prereq
|
||||
upgrade_redis
|
||||
sudo -i -u chatwoot << "EOF"
|
||||
|
||||
# Navigate to the Chatwoot directory
|
||||
|
||||
@@ -243,6 +243,20 @@ RSpec.describe Conversation, type: :model do
|
||||
expect(conversation.label_list).to match_array(labels)
|
||||
end
|
||||
|
||||
it 'ensures preloaded labels are always in sync with the database' do
|
||||
labels = [first_label].map(&:title)
|
||||
expect(conversation.update_labels(labels)).to be(true)
|
||||
expect(conversation.label_list).to match_array(labels)
|
||||
expect(conversation.preloaded_label_list).to match_array(labels)
|
||||
|
||||
updated_labels = [second_label].map(&:title)
|
||||
# reload this so that the taggins collection is updated
|
||||
conversation.reload
|
||||
expect(conversation.update_labels(updated_labels)).to be(true)
|
||||
expect(conversation.label_list).to match_array(updated_labels)
|
||||
expect(conversation.preloaded_label_list).to match_array(updated_labels)
|
||||
end
|
||||
|
||||
it 'adds and removes previously added labels' do
|
||||
labels = [first_label, fourth_label].map(&:title)
|
||||
expect { conversation.update_labels(labels) }
|
||||
|
||||
Reference in New Issue
Block a user