From 7d651982984d6dbd6963120b414a592f66aec09e Mon Sep 17 00:00:00 2001 From: riyadhafraa <49757212-riyadhafraa@users.noreply.replit.com> Date: Mon, 18 May 2026 07:18:15 +0000 Subject: [PATCH] Disable unwanted default applications and clean up related scripts Remove `enable-default-apps.ts` script, add `disable-deprecated-apps.ts`, update seeding logic in `seed.ts` to set `isActive` to false for documents, and modify `DOCKER.md` and `scripts/package.json` accordingly. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: ac51f801-911b-4be5-b27c-e3212d5c0c73 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/1WKAcHk Replit-Helium-Checkpoint-Created: true --- DOCKER.md | 8 ++++---- scripts/package.json | 2 +- ...enable-default-apps.ts => disable-deprecated-apps.ts} | 8 ++++---- scripts/src/seed.ts | 9 ++++++++- 4 files changed, 17 insertions(+), 10 deletions(-) rename scripts/src/{enable-default-apps.ts => disable-deprecated-apps.ts} (72%) diff --git a/DOCKER.md b/DOCKER.md index 03bfc161..f4e2cdbe 100644 --- a/DOCKER.md +++ b/DOCKER.md @@ -115,12 +115,12 @@ git pull > رقم البناء (`build`) يُولَّد تلقائياً من git قبل كل `pnpm run build` (انظر `scripts/update-version.mjs`)، فلا تحتاج تعديله يدوياً في `version.json`. -## تفعيل تطبيقي التقويم والإشعارات +## تعطيل تطبيقات التقويم والإشعارات والمستندات -افتراضياً يصلان مُعطَّلَين في البيئات الجديدة. لتفعيلهما على بيئة موجودة (مرة واحدة): +افتراضياً تصل الثلاثة مُعطَّلة في البيئات الجديدة (السيد فقط يُدخل صفوفاً جديدة، ولا يعدّل الموجودة). لتعطيلها على بيئة موجودة فيها هذه التطبيقات مفعّلة (مرة واحدة): ```bash -docker compose exec api pnpm --filter @workspace/scripts run enable-default-apps +docker compose exec api pnpm --filter @workspace/scripts run disable-deprecated-apps ``` -السكربت idempotent (آمن لإعادة التشغيل) ويعيد فقط `is_active=true` لـ `calendar` و `notifications`. +السكربت idempotent (آمن لإعادة التشغيل) ويضبط `is_active=false` لـ `calendar` و `notifications` و `documents` فقط. يمكن إعادة تفعيل أي منها لاحقاً من إعدادات التطبيقات داخل لوحة التحكم. diff --git a/scripts/package.json b/scripts/package.json index 191b53eb..5b266007 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -7,7 +7,7 @@ "hello": "tsx ./src/hello.ts", "seed": "tsx ./src/seed.ts", "remove-chat": "tsx ./src/remove-chat.ts", - "enable-default-apps": "tsx ./src/enable-default-apps.ts", + "disable-deprecated-apps": "tsx ./src/disable-deprecated-apps.ts", "typecheck": "tsc -p tsconfig.json --noEmit", "test": "node --test 'tests/**/*.test.mjs'" }, diff --git a/scripts/src/enable-default-apps.ts b/scripts/src/disable-deprecated-apps.ts similarity index 72% rename from scripts/src/enable-default-apps.ts rename to scripts/src/disable-deprecated-apps.ts index c2318497..aa33d27f 100644 --- a/scripts/src/enable-default-apps.ts +++ b/scripts/src/disable-deprecated-apps.ts @@ -1,13 +1,13 @@ import { db, appsTable } from "@workspace/db"; import { inArray } from "drizzle-orm"; -const SLUGS = ["calendar", "notifications"]; +const SLUGS = ["calendar", "notifications", "documents"]; async function main() { - console.log(`Enabling apps: ${SLUGS.join(", ")}...`); + console.log(`Disabling apps: ${SLUGS.join(", ")}...`); const updated = await db .update(appsTable) - .set({ isActive: true }) + .set({ isActive: false }) .where(inArray(appsTable.slug, SLUGS)) .returning({ slug: appsTable.slug, isActive: appsTable.isActive }); @@ -15,7 +15,7 @@ async function main() { console.warn("No matching apps found — did seed run yet?"); } else { for (const row of updated) { - console.log(` ✓ ${row.slug} (isActive=${row.isActive})`); + console.log(` - ${row.slug} (isActive=${row.isActive})`); } } console.log("Done."); diff --git a/scripts/src/seed.ts b/scripts/src/seed.ts index 7b3e578c..c3dbb0f7 100644 --- a/scripts/src/seed.ts +++ b/scripts/src/seed.ts @@ -294,7 +294,14 @@ async function main() { iconName: "FileText", route: "/documents", color: "#64748b", - isActive: true, + // #577: same policy as notifications/calendar — ship Documents + // DISABLED on fresh installs. There is no Documents surface the + // user is actively using yet and the tile cluttered the home + // launcher. Insert uses onConflictDoNothing, so existing + // environments keep whatever the current row says — see + // scripts/src/disable-deprecated-apps.ts for the one-shot that + // flips already-seeded rows off. + isActive: false, isSystem: false, sortOrder: 6, },