From 8f907b276217ae1d294c07f562e5c008815c7881 Mon Sep 17 00:00:00 2001 From: amazuecos Date: Wed, 4 Dec 2024 18:19:29 +0100 Subject: [PATCH 1/3] remove this.selectUsers repeated --- .../js/safekat/pages/configuracion/messages/messagePage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/httpdocs/assets/js/safekat/pages/configuracion/messages/messagePage.js b/httpdocs/assets/js/safekat/pages/configuracion/messages/messagePage.js index b97191b4..ce8d102b 100644 --- a/httpdocs/assets/js/safekat/pages/configuracion/messages/messagePage.js +++ b/httpdocs/assets/js/safekat/pages/configuracion/messages/messagePage.js @@ -14,7 +14,7 @@ class MessagePage { this.formNewDirectMessage = this.modalNewMessage.item.find("#formNewDirectMessage") this.alert = new Alert($("#alertDirectMessage")) this.selectUsers = $("#select-users") - this.selectUsers = $("#select-departments") + this.selectDepartments = $("#select-departments") this.selectPlaceholder = { id: '0', @@ -25,7 +25,7 @@ class MessagePage { text: "Seleccione un departamento" } this.selectMessageUsers = new ClassSelect(this.selectUsers, '/chat/users/all', this.selectPlaceholder, true) - this.selectChatDepartment = new ClassSelect(this.selectUsers, '/chat/department/select', this.selectDepartmentPlaceholder, true) + this.selectChatDepartment = new ClassSelect(this.selectDepartments, '/chat/department/select', this.selectDepartmentPlaceholder, true) } init() { From 16cec58431460e75572672375c073c145c4d34ae Mon Sep 17 00:00:00 2001 From: amazuecos Date: Wed, 4 Dec 2024 18:26:37 +0100 Subject: [PATCH 2/3] default message when no notifications --- ci4/app/Language/es/Chat.php | 3 ++- ci4/app/Views/themes/vuexy/main/defaultlayout.php | 3 ++- httpdocs/assets/js/safekat/components/chat.js | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ci4/app/Language/es/Chat.php b/ci4/app/Language/es/Chat.php index 1aca873e..0f130fb1 100644 --- a/ci4/app/Language/es/Chat.php +++ b/ci4/app/Language/es/Chat.php @@ -28,5 +28,6 @@ return [ "add_notification" => "Notificación", "check_as_unviewed" => "Marcar como no leídos", "add_notification_message" => "Envía a los usuarios añadidos una notificación con los mensajes presentes en el chat.", - "chat_title_presupuesto" => 'Presupuesto[{title,string,0}][{id}]' + "chat_title_presupuesto" => 'Presupuesto[{title,string,0}][{id}]', + "no_messages_notification" => 'No hay mensajes que revisar por el momento' ]; \ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/main/defaultlayout.php b/ci4/app/Views/themes/vuexy/main/defaultlayout.php index 40358745..c2cccd59 100644 --- a/ci4/app/Views/themes/vuexy/main/defaultlayout.php +++ b/ci4/app/Views/themes/vuexy/main/defaultlayout.php @@ -136,8 +136,9 @@ $picture = "/assets/img/default-user.png";
diff --git a/httpdocs/assets/js/safekat/components/chat.js b/httpdocs/assets/js/safekat/components/chat.js index 6099c028..8d0e7f06 100644 --- a/httpdocs/assets/js/safekat/components/chat.js +++ b/httpdocs/assets/js/safekat/components/chat.js @@ -722,9 +722,11 @@ export const showNotificationMessages = (dom) => { dom.empty() $("#chat-notification-number") if (data.totalMessages > 0) { + $("#chat-message-notification-title").addClass("d-none") $("#chat-notification-number").removeClass("d-none") $("#chat-notification-number").text(data.totalMessages ?? 0) } else { + $("#chat-message-notification-title").removeClass("d-none") $("#chat-notification-number").addClass("d-none") $("#chat-notification-number").text(0) } From ea4d4327b7a28e9835964fadc6f7bfa6da6b2a9e Mon Sep 17 00:00:00 2001 From: amazuecos Date: Wed, 4 Dec 2024 18:31:18 +0100 Subject: [PATCH 3/3] fix chat_department as object --- ci4/app/Controllers/Configuracion/Users.php | 2 +- ci4/app/Views/themes/vuexy/form/user/_userFormItems.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ci4/app/Controllers/Configuracion/Users.php b/ci4/app/Controllers/Configuracion/Users.php index 82cf1422..7864620f 100755 --- a/ci4/app/Controllers/Configuracion/Users.php +++ b/ci4/app/Controllers/Configuracion/Users.php @@ -265,7 +265,7 @@ class Users extends \App\Controllers\GoBaseController foreach ($chatDepartments as $chatDepartment) { $this->chat_department_user_model->insert([ "user_id" => $id, - "chat_department_id" => $this->chat_department_model->where("name", $chatDepartment)->first()["id"] + "chat_department_id" => $this->chat_department_model->where("name", $chatDepartment)->first()->id ]); } $id = $user->id ?? $id; diff --git a/ci4/app/Views/themes/vuexy/form/user/_userFormItems.php b/ci4/app/Views/themes/vuexy/form/user/_userFormItems.php index 3e75ae63..e7e5b32a 100644 --- a/ci4/app/Views/themes/vuexy/form/user/_userFormItems.php +++ b/ci4/app/Views/themes/vuexy/form/user/_userFormItems.php @@ -61,11 +61,11 @@ $selectedChatDepartments = isset($chatDepartmentUser) && is_array($chatDepartmentUser) ? $chatDepartmentUser : []; $selectedKeywords = array_map(fn($chatDepartment) => $chatDepartment->name, $selectedChatDepartments); foreach ($chatDepartments as $item) : - $isSelected = in_array($item["name"], $selectedKeywords) ? 'selected' : ''; + $isSelected = in_array($item->name, $selectedKeywords) ? 'selected' : ''; ?> -