Task #511: Fully remove Chat feature
Destructive removal per user confirmation ("حذف نهائي ما يرجع").
Removed:
- API: routes/conversations.ts, schema/conversations.ts, all chat
socket handlers in src/index.ts, /admin/users/:id/dependents/
conversations+messages endpoints, conversation/message dependency
counts in users/stats routes.
- Web: pages/chat.tsx, /chat route, dock chat filter, MessageSquare
icon and messages StatCard on home, all chat-related UI in
notifications + admin (dependency badges, delete-dialog rows,
UserDependentConversations/Messages sections, count map keys).
- Locales: nav.chat, home.stats.messages, full chat.* block,
admin.deleteUser conv/msgCount, admin.users.counts.conv/msg,
admin.audit.unit.conversation_*/message_*, admin.dependents.user*.
- OpenAPI spec: tags, all /conversations/* paths, conv/msg dependent
paths, related schemas (ConversationWithDetails, MessageWithSender,
UserDependentConversation/MessageItem+Page, etc.), UserProfile and
UserDeletionConflict conv/msg fields, HomeStats.unreadMessages.
Regenerated client via orval.
- Database: dropped message_reads, messages,
conversation_participants, conversations (CASCADE); deleted
notifications with related_type='conversation' or type='chat';
deleted apps row with slug='chat'; ran drizzle push-force.
- Seed: removed chat:access permission + user-role assignment +
seeded chat app entry from scripts/src/seed.ts.
- Tests: deleted conversations-leave.test.mjs; cleaned chat refs from
list-dependency-counts, delete-force-warnings, audit-log-coverage,
and admin-inline-dependency-counts (e2e) — replaced chat dependents
with note dependents where needed for force-delete coverage.
Notes preserved: notes.tsx noConversationsYet/conversationWith refer
to NOTE THREADS (not chat) and were intentionally NOT touched.
executive-meetings.ts not modified per replit.md restriction.
Pre-existing flaky test failures in executive-meetings/group/etc
suites remain unrelated to this task.
This commit is contained in:
@@ -43,7 +43,6 @@ async function main() {
|
||||
{ name: "apps:manage", descriptionAr: "إدارة التطبيقات", descriptionEn: "Manage Apps" },
|
||||
{ name: "services:manage", descriptionAr: "إدارة الخدمات", descriptionEn: "Manage Services" },
|
||||
{ name: "users:manage", descriptionAr: "إدارة المستخدمين", descriptionEn: "Manage Users" },
|
||||
{ name: "chat:access", descriptionAr: "الوصول للمحادثات", descriptionEn: "Access Chat" },
|
||||
{ name: "orders.receive", descriptionAr: "استلام الطلبات", descriptionEn: "Receive service orders" },
|
||||
];
|
||||
|
||||
@@ -78,17 +77,6 @@ async function main() {
|
||||
.onConflictDoNothing();
|
||||
}
|
||||
|
||||
// Assign chat permission to user role
|
||||
if (userRoleResolved && allInsertedPerms.length > 0) {
|
||||
const chatPerm = allInsertedPerms.find((p) => p.name === "chat:access");
|
||||
if (chatPerm) {
|
||||
await db
|
||||
.insert(rolePermissionsTable)
|
||||
.values({ roleId: userRoleResolved.id, permissionId: chatPerm.id })
|
||||
.onConflictDoNothing();
|
||||
}
|
||||
}
|
||||
|
||||
// Assign orders:receive permission to order_receiver role
|
||||
if (orderReceiverResolved && allInsertedPerms.length > 0) {
|
||||
const ordersPerm = allInsertedPerms.find((p) => p.name === "orders.receive");
|
||||
@@ -170,19 +158,6 @@ async function main() {
|
||||
isSystem: true,
|
||||
sortOrder: 1,
|
||||
},
|
||||
{
|
||||
slug: "chat",
|
||||
nameAr: "المحادثات",
|
||||
nameEn: "Chat",
|
||||
descriptionAr: "تواصل مع زملائك",
|
||||
descriptionEn: "Connect with your colleagues",
|
||||
iconName: "MessageCircle",
|
||||
route: "/chat",
|
||||
color: "#22c55e",
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
sortOrder: 2,
|
||||
},
|
||||
{
|
||||
slug: "notifications",
|
||||
nameAr: "الإشعارات",
|
||||
|
||||
Reference in New Issue
Block a user