chore: remove chat module references and settings
This commit is contained in:
parent
d766b8f158
commit
f1893b1c7b
14 changed files with 25 additions and 127 deletions
|
|
@ -30,11 +30,6 @@ export default {
|
|||
"link_doctype": "Contact",
|
||||
"link_fieldname": "user"
|
||||
},
|
||||
{
|
||||
"group": "Profile",
|
||||
"link_doctype": "Chat Profile",
|
||||
"link_fieldname": "user"
|
||||
},
|
||||
],
|
||||
modified_by: 'Administrator',
|
||||
module: 'Custom',
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
"navigation_settings_section",
|
||||
"search_bar",
|
||||
"notifications",
|
||||
"chat",
|
||||
"list_settings_section",
|
||||
"list_sidebar",
|
||||
"bulk_actions",
|
||||
|
|
@ -85,12 +84,6 @@
|
|||
"fieldtype": "Check",
|
||||
"label": "Search Bar"
|
||||
},
|
||||
{
|
||||
"default": "1",
|
||||
"fieldname": "chat",
|
||||
"fieldtype": "Check",
|
||||
"label": "Chat"
|
||||
},
|
||||
{
|
||||
"fieldname": "list_settings_section",
|
||||
"fieldtype": "Section Break",
|
||||
|
|
@ -155,10 +148,11 @@
|
|||
"idx": 1,
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-01-27 10:35:37.638350",
|
||||
"modified": "2021-10-08 14:06:55.729364",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Core",
|
||||
"name": "Role",
|
||||
"naming_rule": "By fieldname",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import frappe
|
|||
|
||||
from frappe.model.document import Document
|
||||
|
||||
desk_properties = ("search_bar", "notifications", "chat", "list_sidebar",
|
||||
desk_properties = ("search_bar", "notifications", "list_sidebar",
|
||||
"bulk_actions", "view_switcher", "form_sidebar", "timeline", "dashboard")
|
||||
|
||||
class Role(Document):
|
||||
|
|
@ -82,4 +82,4 @@ def role_query(doctype, txt, searchfield, start, page_len, filters):
|
|||
report_filters.extend(filters)
|
||||
|
||||
return frappe.get_all('Role', limit_start=start, limit_page_length=page_len,
|
||||
filters=report_filters, as_list=1)
|
||||
filters=report_filters, as_list=1)
|
||||
|
|
|
|||
|
|
@ -65,9 +65,7 @@
|
|||
"attach_view_link",
|
||||
"prepared_report_section",
|
||||
"enable_prepared_report_auto_deletion",
|
||||
"prepared_report_expiry_period",
|
||||
"chat",
|
||||
"enable_chat"
|
||||
"prepared_report_expiry_period"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
|
|
@ -381,18 +379,6 @@
|
|||
"fieldtype": "Check",
|
||||
"label": "Hide footer in auto email reports"
|
||||
},
|
||||
{
|
||||
"collapsible": 1,
|
||||
"fieldname": "chat",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Chat"
|
||||
},
|
||||
{
|
||||
"default": "1",
|
||||
"fieldname": "enable_chat",
|
||||
"fieldtype": "Check",
|
||||
"label": "Enable Chat"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_21",
|
||||
"fieldtype": "Column Break"
|
||||
|
|
@ -474,7 +460,7 @@
|
|||
"icon": "fa fa-cog",
|
||||
"issingle": 1,
|
||||
"links": [],
|
||||
"modified": "2021-03-30 11:47:47.330437",
|
||||
"modified": "2021-10-08 14:04:11.406725",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Core",
|
||||
"name": "System Settings",
|
||||
|
|
@ -492,4 +478,4 @@
|
|||
"sort_field": "modified",
|
||||
"sort_order": "ASC",
|
||||
"track_changes": 1
|
||||
}
|
||||
}
|
||||
|
|
@ -613,11 +613,6 @@
|
|||
"link_doctype": "Contact",
|
||||
"link_fieldname": "user"
|
||||
},
|
||||
{
|
||||
"group": "Profile",
|
||||
"link_doctype": "Chat Profile",
|
||||
"link_fieldname": "user"
|
||||
},
|
||||
{
|
||||
"group": "Profile",
|
||||
"link_doctype": "Blogger",
|
||||
|
|
@ -670,7 +665,7 @@
|
|||
}
|
||||
],
|
||||
"max_attachments": 5,
|
||||
"modified": "2021-02-02 16:11:06.037543",
|
||||
"modified": "2021-10-11 11:15:15.272615",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Core",
|
||||
"name": "User",
|
||||
|
|
|
|||
|
|
@ -414,9 +414,6 @@ class User(Document):
|
|||
WHERE `%s` = %s""" %
|
||||
(tab, field, '%s', field, '%s'), (new_name, old_name))
|
||||
|
||||
if frappe.db.exists("Chat Profile", old_name):
|
||||
frappe.rename_doc("Chat Profile", old_name, new_name, force=True, show_alert=False)
|
||||
|
||||
if frappe.db.exists("Notification Settings", old_name):
|
||||
frappe.rename_doc("Notification Settings", old_name, new_name, force=True, show_alert=False)
|
||||
|
||||
|
|
@ -1047,4 +1044,4 @@ def get_enabled_users():
|
|||
enabled_users = frappe.get_all("User", filters={"enabled": "1"}, pluck="name")
|
||||
return enabled_users
|
||||
|
||||
return frappe.cache().get_value("enabled_users", _get_enabled_users)
|
||||
return frappe.cache().get_value("enabled_users", _get_enabled_users)
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class TestUserPermission(unittest.TestCase):
|
|||
def test_for_applicable_on_update_from_apply_to_all(self):
|
||||
''' Update User Permission from all to some applicable Doctypes'''
|
||||
user = create_user('test_bulk_creation_update@example.com')
|
||||
param = get_params(user,'User', user.name, applicable = ["Chat Room", "Chat Message"])
|
||||
param = get_params(user,'User', user.name, applicable = ["Comment", "Contact"])
|
||||
|
||||
# Initially create User Permission document with apply_to_all checked
|
||||
is_created = add_user_permissions(get_params(user, 'User', user.name))
|
||||
|
|
@ -84,8 +84,8 @@ class TestUserPermission(unittest.TestCase):
|
|||
frappe.db.commit()
|
||||
|
||||
removed_apply_to_all = frappe.db.exists("User Permission", get_exists_param(user))
|
||||
is_created_applicable_first = frappe.db.exists("User Permission", get_exists_param(user, applicable = "Chat Room"))
|
||||
is_created_applicable_second = frappe.db.exists("User Permission", get_exists_param(user, applicable = "Chat Message"))
|
||||
is_created_applicable_first = frappe.db.exists("User Permission", get_exists_param(user, applicable = "Comment"))
|
||||
is_created_applicable_second = frappe.db.exists("User Permission", get_exists_param(user, applicable = "Contact"))
|
||||
|
||||
# Check that apply_to_all is removed
|
||||
self.assertIsNone(removed_apply_to_all)
|
||||
|
|
@ -101,14 +101,14 @@ class TestUserPermission(unittest.TestCase):
|
|||
param = get_params(user, 'User', user.name)
|
||||
|
||||
# create User permissions that with applicable
|
||||
is_created = add_user_permissions(get_params(user, 'User', user.name, applicable = ["Chat Room", "Chat Message"]))
|
||||
is_created = add_user_permissions(get_params(user, 'User', user.name, applicable = ["Comment", "Contact"]))
|
||||
|
||||
self.assertEqual(is_created, 1)
|
||||
|
||||
is_created = add_user_permissions(param)
|
||||
is_created_apply_to_all = frappe.db.exists("User Permission", get_exists_param(user))
|
||||
removed_applicable_first = frappe.db.exists("User Permission", get_exists_param(user, applicable = "Chat Room"))
|
||||
removed_applicable_second = frappe.db.exists("User Permission", get_exists_param(user, applicable = "Chat Message"))
|
||||
removed_applicable_first = frappe.db.exists("User Permission", get_exists_param(user, applicable = "Comment"))
|
||||
removed_applicable_second = frappe.db.exists("User Permission", get_exists_param(user, applicable = "Contact"))
|
||||
|
||||
# To check that a User permission with apply_to_all exists
|
||||
self.assertIsNotNone(is_created_apply_to_all)
|
||||
|
|
|
|||
|
|
@ -76,8 +76,6 @@ before_tests = "frappe.utils.install.before_tests"
|
|||
|
||||
email_append_to = ["Event", "ToDo", "Communication"]
|
||||
|
||||
get_rooms = 'frappe.chat.doctype.chat_room.chat_room.get_rooms'
|
||||
|
||||
calendars = ["Event"]
|
||||
|
||||
leaderboards = "frappe.desk.leaderboard.get_leaderboards"
|
||||
|
|
@ -281,11 +279,6 @@ sounds = [
|
|||
{"name": "error", "src": "/assets/frappe/sounds/error.mp3", "volume": 0.1},
|
||||
{"name": "alert", "src": "/assets/frappe/sounds/alert.mp3", "volume": 0.2},
|
||||
# {"name": "chime", "src": "/assets/frappe/sounds/chime.mp3"},
|
||||
|
||||
# frappe.chat sounds
|
||||
{ "name": "chat-message", "src": "/assets/frappe/sounds/chat-message.mp3", "volume": 0.1 },
|
||||
{ "name": "chat-notification", "src": "/assets/frappe/sounds/chat-notification.mp3", "volume": 0.1 }
|
||||
# frappe.chat sounds
|
||||
]
|
||||
|
||||
bot_parsers = [
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ Integrations
|
|||
Printing
|
||||
Contacts
|
||||
Data Migration
|
||||
Chat
|
||||
Social
|
||||
Automation
|
||||
Event Streaming
|
||||
Event Streaming
|
||||
|
|
@ -99,7 +99,6 @@ import "./frappe/query_string.js";
|
|||
|
||||
// import "./frappe/ui/comment.js";
|
||||
|
||||
import "./frappe/chat.js";
|
||||
import "./frappe/utils/energy_point_utils.js";
|
||||
import "./frappe/utils/dashboard_utils.js";
|
||||
import "./frappe/ui/chart.js";
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@
|
|||
window.dev_server = {{ dev_server }};
|
||||
window.socketio_port = {{ (frappe.socketio_port or 'null') }};
|
||||
window.show_language_picker = {{ show_language_picker or 'false' }};
|
||||
window.is_chat_enabled = {{ chat_enable }};
|
||||
</script>
|
||||
</head>
|
||||
<body frappe-session-status="{{ 'logged-in' if frappe.session.user != 'Guest' else 'logged-out'}}" data-path="{{ path | e }}" {%- if template and template.endswith('.md') %} frappe-content-type="markdown" {%- endif %} class="{{ body_class or ''}}">
|
||||
|
|
|
|||
|
|
@ -63,14 +63,7 @@
|
|||
"subdomain",
|
||||
"head_html",
|
||||
"robots_txt",
|
||||
"route_redirects",
|
||||
"section_break_39",
|
||||
"chat_enable",
|
||||
"chat_enable_from",
|
||||
"chat_enable_to",
|
||||
"chat_room_name",
|
||||
"chat_welcome_message",
|
||||
"chat_operators"
|
||||
"route_redirects"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
|
|
@ -266,51 +259,6 @@
|
|||
"fieldtype": "Code",
|
||||
"label": "Robots.txt"
|
||||
},
|
||||
{
|
||||
"collapsible": 1,
|
||||
"fieldname": "section_break_39",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Chat"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "chat_enable",
|
||||
"fieldtype": "Check",
|
||||
"label": "Enable Chat"
|
||||
},
|
||||
{
|
||||
"depends_on": "chat_enable",
|
||||
"fieldname": "chat_enable_from",
|
||||
"fieldtype": "Time",
|
||||
"label": "From"
|
||||
},
|
||||
{
|
||||
"depends_on": "chat_enable",
|
||||
"fieldname": "chat_enable_to",
|
||||
"fieldtype": "Time",
|
||||
"label": "To"
|
||||
},
|
||||
{
|
||||
"default": "Support",
|
||||
"depends_on": "chat_enable",
|
||||
"fieldname": "chat_room_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Chat Room Name"
|
||||
},
|
||||
{
|
||||
"default": "Hi, how may I help you?",
|
||||
"depends_on": "chat_enable",
|
||||
"fieldname": "chat_welcome_message",
|
||||
"fieldtype": "Data",
|
||||
"label": "Welcome Message"
|
||||
},
|
||||
{
|
||||
"depends_on": "chat_enable",
|
||||
"fieldname": "chat_operators",
|
||||
"fieldtype": "Table",
|
||||
"label": "Chat Operators",
|
||||
"options": "Chat Room User"
|
||||
},
|
||||
{
|
||||
"fieldname": "route_redirects",
|
||||
"fieldtype": "Table",
|
||||
|
|
@ -470,4 +418,4 @@
|
|||
"sort_field": "modified",
|
||||
"sort_order": "ASC",
|
||||
"track_changes": 1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,8 +120,7 @@ def get_website_settings(context=None):
|
|||
"facebook_share", "google_plus_one", "twitter_share", "linked_in_share",
|
||||
"disable_signup", "hide_footer_signup", "head_html", "title_prefix",
|
||||
"navbar_template", "footer_template", "navbar_search", "enable_view_tracking",
|
||||
"footer_logo", "call_to_action", "call_to_action_url", "show_language_picker",
|
||||
"chat_enable"]:
|
||||
"footer_logo", "call_to_action", "call_to_action_url", "show_language_picker"]:
|
||||
if hasattr(settings, k):
|
||||
context[k] = settings.get(k)
|
||||
|
||||
|
|
|
|||
|
|
@ -633,17 +633,11 @@ $(document).on("page-change", function() {
|
|||
|
||||
frappe.ready(function() {
|
||||
frappe.show_language_picker();
|
||||
if (window.is_chat_enabled) {
|
||||
frappe.require([
|
||||
"/assets/frappe/node_modules/moment/min/moment-with-locales.min.js",
|
||||
"/assets/frappe/node_modules/moment-timezone/builds/moment-timezone-with-data.min.js",
|
||||
"chat.bundle.css",
|
||||
"/assets/frappe/js/lib/socket.io.min.js"
|
||||
], () => {
|
||||
frappe.require('chat.bundle.js', () => {
|
||||
frappe.chat.setup();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
frappe.require([
|
||||
"/assets/frappe/node_modules/moment/min/moment-with-locales.min.js",
|
||||
"/assets/frappe/node_modules/moment-timezone/builds/moment-timezone-with-data.min.js",
|
||||
"/assets/frappe/js/lib/socket.io.min.js"
|
||||
]);
|
||||
frappe.socketio.init(window.socketio_port);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue