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, },