@davoodmehraban89 / Factor-easy-2 Mirror · read-only / commits / 13a21a6
Fork 0

سامانه صدور فاکتور و حسابداری

Mirrored from https://github.com/davoodmehraban89/Factor-easy.git

Synced Dec 3, 22:00 UTC

Move module chooser to topbar and organization access to Settings (#197)

* fix(navigation): place workspaces in topbar and access in Settings * test: align independent diagnostic readiness and record integrated verification --------- Co-authored-by: JVK <lanxniew246@gmail.com>

davoodmehraban89 committed Nov 10, 2026 at 22:12 UTC 13a21a611422d86ca896aa3d7207237433538171
13 files changed +85 -17
PROJECT_STATE.md
+7
@@ -236,3 +236,10 @@ Owner requests layer-by-layer click/functional testing of all controls and compa
236 - Focused62/62 browser scenarios PASS, all51 existing pre-browser/server/static/release commands PASS; final syntax/diagnostic/quality/release checks rerun PASS. Full220-browser run is in progress at this commit; exact-head CI and production release still pending. See docs/LOGIN_BOOTSTRAP_INCIDENT_2026-11-10.md. Public baseline visit works from this environment; exact owner-network cause/account acceptance remains NOT VERIFIED. TinyFish connected but profile metadata lists no factoreasy.ir session.
237 - Autonomous protected frontend release is covered by the owner's continuing authorization; preserve all exact-SHA checks and publish/read back before claiming live. No production Auth/schema/data change. Navigation relocation resumes separately; WP1 candidate61092e4 verified all three remote workflows SUCCESS (Quality41957583573,Security41957583565,WP141957583675), still not merged/deployed.
238 - CI infrastructure finding: PR196 Quality42814653548 completed all static/server checks but could not install Chromium: GitHub's ubuntu-latest moved to26.04, unsupported by the pinned Playwright1.55.0. Pin only the browser/static job to supported ubuntu-24.04; retain browser version, assertions and all release gates. Local full run is invalid because its prior-turn HTTP server ended (connection refused); restart with server lifetime tied to the test process, not classify as product failures or a passing run.
239 +
240 +### 2026-11-05 — Owner asks to correct utilities above/below logout
241 +- Owner explicitly asks whether the two controls around logout were repositioned, then says continue. Live factoreasy.ir HTML and currentmain4416794 confirm module launcher still sits above Logout; organization-rbac dynamically appends Access below it. Existing Settings organization/module routes fromPR191 did not fix those footer placements. No completion claim is inherited.
242 +- Scoped navigation repair on separate branch fromcurrentmain: move existing licensed launcher to the topbar actions, keep access management at Settings -> users/access/capacity and remove the duplicate footer access injection. Preserve exact eight-module rail, licensing/authorization, invitation/capacity callbacks and logout behavior; no financial/server changes. Canonical reference image inspected. Verify responsive placement, actual control clicks, permission refresh and generatedPages; publish protectedPR separately fromWP1.
243 +- Financial continuation remains onPR195, publishedcandidate61092e4 withreadgraphprerequisite; preceding4149d50 allQuality/Security/WP1CI passed. It is not merged into this UI repair or production. WP1 stillincomplete; detailed phase state is onthatbranch.
244 +- 2026-11-10 local checkpoint after urgent login work resumed: launcher moved to responsive topbar; organization access moved to a guarded Settings card with full users/access/capacity label. Existing submenu, exact eight-module rail, late-bound invitation/capacity wrappers and authority checks preserved. Three viewport cases RED before fix ->GREEN. All9 workspace cases PASS in source and generatedPages;51static/server/release commands PASS. Root visually inspected synthetic desktop/mobile screenshots. See docs/NAVIGATION_UTILITIES_2026-11-10.md. Full regression after integrating loginPR196, protectedCI/release and live readback remain pending; no production/data change claimed.
245 +- Integrated navigation checkpoint: rebased onto urgent-login main4382e83 without changing the tested application tree. PR196 local220/220 and exact-head Quality42814901014/Security42814901043 PASS; protected merge completed, gated production verification tracked inPR196. Navigation prior candidate d24f85c Quality42815227230/Security42815227293 PASS. Local integrated run222/223 exposed an old timing assumption: diagnostic readiness now precedes login handlers. Added an explicit bounded login-button readiness assertion while preserving all early-ERP/actual-click assertions;5/5 repeats PASS. Final navigation exact-head CI/release ledger isPR197. No final independent review available due provider quota; root reviewed code and synthetic desktop/mobile captures. Remaining PR193 account/member read feedback, authenticated owner acceptance and financialWP1 work remain distinct.
docs/EXECUTION_STATUS.md
+5 -4
@@ -8,11 +8,12 @@
8
9 |کار|وضعیت|شواهد / اقدام بعدی|
10 |---|---|---|
11 -|ورود با دکمه‌های غیرفعال|اصلاح و تست متمرکز ۶۲/۶۲ قبول؛ انتشار در انتظار بررسی کامل|[گزارش رخداد](LOGIN_BOOTSTRAP_INCIDENT_2026-11-10.md)؛ پذیرش حساب و اینترنت مالک هنوز تأیید نشده|
12 -|جابه‌جایی ماژول‌ها و دسترسی‌ها کنار خروج|برنامه ثبت شده؛ بعد از رفع ورود|انتقال انتخابگر به نوار بالا و مدیریت دسترسی به تنظیمات؛ هنوز منتشر نشده|
11 +|ورود با دکمه‌های غیرفعال|اصلاح ادغام شد؛ ۲۲۰/۲۲۰ آزمون کامل و بررسی‌های PR196 موفق|[گزارش رخداد](LOGIN_BOOTSTRAP_INCIDENT_2026-11-10.md)؛ مرجع وضعیت انتشار و بازخوانی سایت: [PR196](https://github.com/davoodmehraban89/Factor-easy/pull/196)؛ پذیرش حساب و اینترنت مالک هنوز تأیید نشده|
12 +|جابه‌جایی ماژول‌ها و دسترسی‌ها کنار خروج|پیاده‌سازی و بررسی؛ انتخابگر در نوار بالا، دسترسی در تنظیمات|۹/۹ source و ۹/۹ Pages؛ [گزارش](NAVIGATION_UTILITIES_2026-11-10.md) و مرجع CI/انتشار [PR197](https://github.com/davoodmehraban89/Factor-easy/pull/197)|
13 |WP1 سخت‌سازی مالی|کاندیدای جداگانه؛ روی سایت فعال نشده|PR195، نسخه61092e4: Quality41957583573 / Security41957583565 / WP141957583675 موفق؛ اتصال امن کلاینت و گیت‌های انتشار باقی است|
14 -|تفکیک نوع سند خرید/فروش|پیاده‌سازی؛ تست جدید source/Pages قبول|فروش: فروش/پیش‌فاکتور/صورت‌وضعیت؛ خرید: خرید؛ ۲۱۰/۲۱۱ اجرای کامل؛ یک انتظار کش قدیمی اصلاح شد؛ اجرای نهایی در PR191|
15 -|سازمان، درخواست‌ها و مدیریت اعضا|پیاده‌سازی؛ تست Pages قبول|ورودی تنظیمات، سازمان در انتخابگر، دعوت/ظرفیت موجود؛ شواهد زنده انتشار و SHA در PR191|
14 +|تفکیک نوع سند خرید/فروش|منتشر در PR191؛ آزمون‌های مجدد در مجموعهٔ ۲۲۰ موفق|فروش: فروش/پیش‌فاکتور/صورت‌وضعیت؛ خرید: خرید؛ اسناد قبلی حفظ می‌شوند|
15 +|سازمان، درخواست‌ها و مدیریت اعضا|مسیرها در PR191 منتشر شدند؛ جایگذاری جدید در PR197|پنجرهٔ مدیریت در خطای خواندن هنوز نیازمند PR193 است؛ نشر آن با جایگذاری منو یکی نیست|
16 +|خطاهای دریافت حساب و بارگذاری پنل کاربران|PR193 باز؛ اجرا و انتشار نهایی باقی است|کاندیدا۱۹source/۱۹Pages موفق؛ آزمون کامل و تطبیق با اصلاحات جدید قبل از انتشار|
17 |اصلاح شرکت|منتشر؛ بازکردن/انصراف واقعی قبول|ذخیرهٔ تغییر شرکت در حساب واقعی از این پذیرش نتیجه نمی‌شود|
18 |تعیین رمز مدیر کل|منتشر؛ تست مصنوعی موفق|آزمون واقعی پنجره با نقش مدیر کل و حساب کنترل‌شده باقی است|
19 |منوهای فازA|منتشر؛۲۰۳تست نسخهٔ مربوط موفق|پذیرش همهٔ نقش‌ها و داده‌ها جداست|
docs/LOGIN_BOOTSTRAP_INCIDENT_2026-11-10.md
+2 -2
@@ -23,7 +23,7 @@ The reproducible defect is dependency coupling: initial HTML deliberately disabl
23 - All 51 existing pre-browser/static/server/release commands passed before final review; syntax, diagnostic, static quality and release safety were rerun successfully after review corrections.
24 - Independent initial review found three P2 defects in the candidate (hidden CSS media scope, callback fragment loss, unversioned early probe). All three corrected and covered by browser assertions. Follow-up independent review could not run because its provider quota was exhausted; no independent final approval claimed.
25 - Earlier focused failures remain accounted for: fixed retained handler failure classification; updated fixture expectations for report version/probed core; replaced VM fixture with browser fail-closed private-key check. A Pages diagnostic fixture matched only a query-free Auth URL and left REST live; both endpoints are now explicitly mocked while retaining the 2.5-second limit and early-login assertions.
26 -- Full canonical browser suite and exact-head remote CI/release: pending at this documentation checkpoint. Deployment identifiers and public artifact comparison belong in the linked release PR after they actually exist.
26 +- Full canonical local browser suite **220/220 PASS** (4.8m). PR196 head `f34f84b818c08aa6960f048bab66fcf0a7a21b98`: Quality42814901014 and Security42814901043 SUCCESS, including all3 disposable DB jobs. Protected merge: `4382e83a73bc3636d53273f07f0eaaa4911b5879`. Exact-main CI, gated deployment and public readback are recorded in the live [PR196 release ledger](https://github.com/davoodmehraban89/Factor-easy/pull/196); merge alone does not prove deployment.
27
28 CI infrastructure: run42814653548 passed all pre-browser checks but failed installing the pinned Playwright1.55 on the newly migrated ubuntu-latest (26.04). The browser/static job now pins supported Ubuntu24.04; no test/gate removed. The initial full local run lost its prior-turn HTTP server and is excluded (connection refused); rerun owns its HTTP server lifetime.
29
@@ -31,6 +31,6 @@ CI infrastructure: run42814653548 passed all pre-browser checks but failed insta
31
32 Owner-device/ISP and real-account acceptance remain unverified. TinyFish is connected, but its profile listing currently records no signed-in factoreasy.ir session. Do not collect passwords in chat or infer authenticated acceptance from public/bootstrap tests.
33
34 -After urgent release: move the module launcher above Logout into the topbar, and access administration below Logout into a discoverable authorized Settings entry. That navigation task is still planned, not implemented. Resume the separate WP1 graph-to-client adapter afterward, preserving financial release gates. PR193 addresses different account-hydration errors and remains separate.
34 +After urgent release: move the module launcher above Logout into the topbar, and access administration below Logout into a discoverable authorized Settings entry. The navigation implementation and synthetic verification are now in [PR197](https://github.com/davoodmehraban89/Factor-easy/pull/197), separately gated for release. Resume the separate WP1 graph-to-client adapter afterward, preserving financial release gates. PR193 addresses different account-hydration errors and remains separate.
35
36 Rollback: revert this frontend/build PR through normal protected release. No database rollback is involved.
docs/NAVIGATION_UTILITIES_2026-11-10.md new
+17
@@ -0,0 +1,17 @@
1 +# جایگزینی دو ورودی کنار خروج
2 +
3 +هدف: انتخابگر ماژول‌های دارای لایسنس و مدیریت کاربران سازمان در جای قابل کشف و قابل استفاده در موبایل قرار بگیرند. مرجع ظاهر همان تصویر تأییدشدهٔ مخزن است؛ ترتیب هشت ماژول اصلی تغییر نمی‌کند.
4 +
5 +- «ماژول‌ها» از بالای خروج به نوار بالای برنامه منتقل شد و در موبایل نیز دیده می‌شود. همان انتخابگر و کنترل لایسنس قبلی اجرا می‌شود.
6 +- «دسترسی‌ها» از پایین خروج به کارت «سازمان و کاربران» در تنظیمات منتقل شد. دکمهٔ کامل «کاربران، دسترسی‌ها و ظرفیت سازمان» همان پنجرهٔ مدیریت، دعوت و ظرفیت موجود را باز می‌کند. ورودی زیرمنوی تنظیمات نیز حفظ شده است.
7 +- کارت و دکمه با مجوز جاری سازمان هماهنگ می‌شوند؛ تغییر نقش آن‌ها را پنهان می‌کند و کلیک نیز مجوز را دوباره بررسی می‌کند. مدیر کل بدون اختیار سازمان به مدیریت آن سازمان دسترسی پیدا نمی‌کند.
8 +- هیچ تغییر سرور، ظرفیت لایسنس، محاسبه مالی یا ذخیره دادهٔ مشتری انجام نشده است.
9 +
10 +آزمون سه اندازهٔ ۱۴۴۰، ۱۰۲۴ و ۳۹۰ پیش از اصلاح شکست خورد: دو ورودی همچنان در footer بودند. پس از اصلاح، ۹/۹ آزمون source و ۹/۹ آزمون Pages با کلیک واقعی قبول شدند؛ بازشدن درخواست‌ها از انتخابگر، مدیریت اعضا، دعوت و ظرفیت و حذف دسترسی پس از تغییر مجوز پوشش داده شد. ۵۱ فرمان بررسی ایستا/سرور/انتشار نیز موفق بودند. نخستین تلاش پیش از نصب مسیر وابستگی‌های محلی اجرا نشد و به‌عنوان نتیجهٔ آزمون حساب نشده است.
11 +
12 +تصاویر زیر از دادهٔ مصنوعی‌اند، نه حساب واقعی:
13 +
14 +- [دسکتاپ](audits/2026-11-10/navigation-desktop.png)
15 +- [موبایل](audits/2026-11-10/navigation-mobile.png)
16 +
17 +پس از ترکیب با اصلاح فوری ورود، اجرای کامل محلی۲۲۲قبول/۱شکست داشت: تست قدیمی آمادگی مستقل بررسی اتصال را با آمادگی ورود یکی فرض می‌کرد. انتظار صریح آمادگی دکمهٔ ورود اضافه شد؛ محدودیت زمانی و تمام آزمون‌های کلیک و عدم انتظار برای ERP حفظ شد. پنج اجرای متوالی سناریوی اصلاح‌شده موفق بود. CI نسخهٔ ترکیبی قبلیd24f85c نیز موفق بود؛ نتیجهٔ نهایی نسخهٔ منتشرشونده، انتشار محافظت‌شده و بازخوانی سایت در [PR197](https://github.com/davoodmehraban89/Factor-easy/pull/197) ثبت می‌شود. این تغییر به‌معنای تکمیل WP1 یا پذیرش همهٔ کنترل‌های برنامه نیست.
docs/audits/2026-11-10/navigation-desktop.png
Binary files /dev/null and b/docs/audits/2026-11-10/navigation-desktop.png differ
docs/audits/2026-11-10/navigation-mobile.png
Binary files /dev/null and b/docs/audits/2026-11-10/navigation-mobile.png differ
index.html
+10 -2
@@ -193,6 +193,7 @@ body{background:#f6f9fc}
193 .command-result{padding:9px 10px;border-radius:7px;cursor:pointer;color:#334155;font-size:12px}
194 .command-result:hover{background:#f0f8fa;color:#087c8a}
195 .command-result small{float:left;color:#94a3b8}
196 +#finora-org-access-settings-card[hidden]{display:none!important}
197 .topbar-actions{display:flex;gap:7px;align-items:center}
198 .topbar-pill{height:38px;border:1px solid #dce4ee;border-radius:9px;background:#fff;color:#334155;padding:0 11px;font:inherit;font-size:11.5px;font-weight:650;cursor:pointer;white-space:nowrap}
199 .topbar-pill:hover{border-color:#a9cbd0;background:#f7fbfc}
@@ -220,6 +221,7 @@ body{background:#f6f9fc}
221 .topbar,.shell-panel-collapsed .topbar{right:0;height:58px;padding:8px 10px;gap:7px}
222 .topbar-menu{display:none}
223 .topbar-actions .topbar-pill{display:none}
224 + .topbar-actions #finora-module-launcher-toggle{display:block}
225 .global-search{height:38px;max-width:none}
226 .main-surface,.shell-panel-collapsed .main-surface{margin-right:0;max-width:100%;padding:72px 12px 92px}
227 .workspace-context{overflow:hidden;white-space:nowrap}
@@ -309,7 +311,6 @@ body{background:#f6f9fc}
311 </div>
312 <div class="sidebar-footer">
313 <span id="logged-user-label">کاربر</span>
312 - <button class="shell-logout" id="finora-module-launcher-toggle" type="button" onclick="showModuleLauncher(true)" title="ماژول‌های فعال لایسنس">ماژول‌ها</button>
314 <button class="shell-logout" onclick="handleLogout()" title="خروج">خروج</button>
315 </div>
316 </aside>
@@ -327,6 +328,7 @@ body{background:#f6f9fc}
328 <div id="command-search-results" class="command-results"></div>
329 </div>
330 <div class="topbar-actions">
331 + <button class="topbar-pill" id="finora-module-launcher-toggle" type="button" onclick="showModuleLauncher(true)" title="ماژول‌های فعال لایسنس">ماژول‌ها</button>
332 <button class="topbar-pill fiscal-pill" id="topbar-fiscal-year" onclick="navigateShell('accounting','view-accounting-foundation','fiscal')" title="سال مالی">سال مالی جاری</button>
333 <button class="topbar-pill" id="topbar-company" onclick="navigateShell('settings','view-settings','company')" title="شرکت فعال">شرکت فعال</button>
334 <div class="quick-create">
@@ -670,6 +672,12 @@ body{background:#f6f9fc}
672 <button class="btn btn-danger btn-inline no-print" style="padding:6px 12px;font-size:12px;min-height:32px" onclick="handleLogout()">🚪 خروج از حساب کاربری</button>
673 </div>
674
675 +<div id="finora-org-access-settings-card" class="card" data-finora-task="organization-access" hidden>
676 +<h3 style="font-size:15px;margin-bottom:8px">سازمان و کاربران</h3>
677 +<p style="color:var(--text-muted);margin-bottom:12px">مدیریت اعضا و سطح دسترسی، دعوت کاربران و مشاهده ظرفیت کاربران و شرکت‌های سازمان.</p>
678 +<button id="finora-org-access-btn" type="button" class="btn btn-primary">کاربران، دسترسی‌ها و ظرفیت سازمان</button>
679 +</div>
680 +
681 <div class="accordion-item" data-finora-task="account">
682 <div class="accordion-header" onclick="toggleAccordion(this)"><span>🔐 حساب کاربری و رمز عبور</span><span>▼</span></div>
683 <div class="accordion-body">
@@ -940,7 +948,7 @@ body{background:#f6f9fc}
948 <script src="js/companies.js?v=20261028-company-edit-v1"></script>
949 <script src="js/backup.js?v=20260928-data-v3"></script>
950 <script src="js/words.js"></script>
943 -<script src="js/bootstrap.js?v=20261031-workspace-recovery-v1"></script>
951 +<script src="js/bootstrap.js?v=20261110-navigation-utilities-v1"></script>
952
953 <style>
954 .form-control, textarea, select { direction: rtl; }
js/bootstrap.js
+1 -1
@@ -3,7 +3,7 @@
3 // browsers may download in parallel but preserve script execution/dependencies.
4 // Auth starts only once all extensions have finished loading or failed.
5 const FINORA_EXTENSION_SCRIPTS=[
6 - "js/organization-rbac.js?v=20261031-workspace-recovery-v1",
6 + "js/organization-rbac.js?v=20261110-navigation-utilities-v1",
7 "js/organization-invitations.js?v=20260930-eli3-v1",
8 "js/organization-enterprise-ux.js?v=20260930-eli4-v1",
9 "js/platform-modules.js?v=20261031-workspace-recovery-v1",
js/organization-rbac.js
+6 -5
@@ -216,11 +216,12 @@ window.organizationSavePermissionFromUi=async function(){
216 const {error}=await sb.rpc('organization_set_member_permission',{p_organization_id:currentUser.organizationId,p_member_id:member,p_module_key:module,p_capabilities:caps,p_scope_type:scope,p_scope_id:scopeId,p_confidentiality_level:clearance});if(error)return alert('ثبت مجوز انجام نشد: '+error.message);alert('مجوز عضو ثبت شد.');await showOrganizationAccessManager();
217 };
218 function ensureOrgAccessButton(){
219 - const footer=document.querySelector('.app-shell-nav .sidebar-footer');if(!footer)return;
220 - let b=document.getElementById('finora-org-access-btn');
221 - if(!b){b=document.createElement('button');b.id='finora-org-access-btn';b.className='shell-logout';b.title='سازمان و دسترسی‌ها';b.textContent='دسترسی‌ها';footer.appendChild(b)}
222 - b.onclick=()=>window.showOrganizationAccessManager();
223 - b.style.display=window.finoraCanOpenOrganizationAccess()?'':'none';
219 + const card=document.getElementById('finora-org-access-settings-card');
220 + const b=document.getElementById('finora-org-access-btn');if(!card||!b)return;
221 + // Resolve the current wrapper at click time (invitations and capacity extend it).
222 + b.onclick=()=>{if(window.finoraCanOpenOrganizationAccess())return window.showOrganizationAccessManager();};
223 + const allowed=window.finoraCanOpenOrganizationAccess();
224 + card.hidden=!allowed;b.disabled=!allowed;
225 }
226 window.refreshFinoraOrganizationAccessButton=ensureOrgAccessButton;
227 const baseEnterAppOrg=enterApp;
scripts/dom-smoke.spec.js
+5 -1
@@ -48,11 +48,15 @@ test('Phase A rail stays exact through organization refresh and real commerce/ac
48 await page.evaluate(()=>{refreshAllSurfaces();applyLicensedModuleUI()});
49 await expectPhaseARail(page);
50 }
51 - for(const id of ['finora-org-switch-btn','finora-org-access-btn']){
51 + for(const id of ['finora-org-switch-btn']){
52 await expect(page.locator('#'+id)).toBeVisible();
53 await expect(page.locator('#module-rail #'+id)).toHaveCount(0);
54 await expect(page.locator('#'+id)).toHaveCount(1);
55 }
56 + await page.locator('#module-rail [data-module="settings"]').click();
57 + await expect(page.locator('#view-settings #finora-org-access-btn')).toBeVisible();
58 + await expect(page.locator('#finora-org-access-btn')).toHaveCount(1);
59 + await expect(page.locator('.sidebar-footer #finora-org-access-btn')).toHaveCount(0);
60 const rail=page.locator('#module-rail'),panel=page.locator('#module-panel-links');
61 await rail.locator('[data-module="commerce"]').click();
62 const sale=panel.locator('[data-view="view-invoices"]');
scripts/login-connectivity-check.mjs
+1 -1
@@ -9,7 +9,7 @@ assert(html.includes('id="auth-connectivity-result" aria-live="polite"'),'Diagno
9 assert(html.includes('js/login-connectivity.js?v=20261110-login-bootstrap-v6'),'Missing versioned script');
10 assert(html.includes('js/core.js?v=20261110-login-bootstrap-v2'),'Production login controls must use new cache version');
11 assert(html.indexOf('<script src="js/login-connectivity.js?v=20261110-login-bootstrap-v6"')<html.indexOf('<script src="js/core.js?v=20261110-login-bootstrap-v2"'),'Connectivity handler script must execute before core (not just preload)');
12 -assert(html.includes('js/bootstrap.js?v=20261031-workspace-recovery-v1'),'Parallel bootstrap must also be cache-busted');
12 +assert(html.includes('js/bootstrap.js?v=20261110-navigation-utilities-v1'),'Parallel bootstrap must also be cache-busted');
13 assert(html.includes('id="auth-login-button"')&&html.includes('id="auth-login-status"'),'Login control requires real readiness/progress feedback');
14 assert(core.includes('window.FinoraAppAssetsReady'),'Authenticated workspace must remain gated until all module scripts settle');
15 assert(core.includes('window.FinoraOrganizationContextReady')&&core.includes('organizationAccount'),'Profile and license lookup must wait for the organization account adapter');
scripts/pages-artifact.spec.js
+2
@@ -44,6 +44,8 @@ test('Production CSP login and connectivity actions work while later ERP JS is s
44 // The actual hardened Pages output removes inline onclick attributes.
45 await page.goto(base,{waitUntil:'commit'});
46 await expect(page.locator('#auth-connectivity-check')).toBeEnabled({timeout:4000});
47 + // Diagnostics is intentionally independent and can be ready before login handlers.
48 + await expect(page.locator('#auth-login-button')).toBeEnabled({timeout:4000});
49 expect(await page.evaluate(()=>window.FinoraLoginActionsBound)).toBe(true);
50 expect(delayedModuleFinished,'Login actions must be wired before slow ERP scripts').toBe(false);
51 await page.locator('#auth-connectivity-check').click();
scripts/workspace-access.spec.js
+29 -1
@@ -31,7 +31,7 @@ test('Settings module chooser reaches organization and requests through real cli
31 await expect(page.locator('#'+view)).toHaveClass(/active/);
32 }
33 });
34 -test('permission refresh removes organization management entry and stale footer access',async({page})=>{
34 +test('permission refresh removes organization management entries including the Settings card',async({page})=>{
35 await fixture(page);await page.locator('#module-rail [data-module="settings"]').click();
36 await expect(page.locator('#finora-org-access-btn')).toBeVisible();
37 await page.evaluate(()=>{currentUser.isOrganizationOwner=false;currentUser.modules=['accounting'];currentUser.commercialModules=['accounting'];refreshAllSurfaces()});
@@ -81,3 +81,31 @@ test('accounting and treasury licenses retain their organization workspace witho
81 await expect(page.locator('#module-panel-links [data-task="group"]')).toHaveCount(0);
82 }
83 });
84 +
85 +for(const viewport of [{width:1440,height:900},{width:1024,height:768},{width:390,height:844}]){
86 + test('module chooser and organization administration have usable homes at '+viewport.width,async({page})=>{
87 + await page.setViewportSize(viewport);await fixture(page);
88 + await expect(page.locator('.sidebar-footer #finora-module-launcher-toggle,.sidebar-footer #finora-org-access-btn')).toHaveCount(0);
89 + const launcher=page.locator('.topbar #finora-module-launcher-toggle');
90 + await expect(launcher).toBeVisible();
91 + const box=await launcher.boundingBox();expect(box.x).toBeGreaterThanOrEqual(0);expect(box.x+box.width).toBeLessThanOrEqual(viewport.width);
92 + await launcher.click();
93 + await page.locator('#finora-launcher-grid').getByRole('button',{name:/درخواست‌ها و فرایندها/}).click();
94 + await expect(page.locator('#view-requests')).toHaveClass(/active/);
95 + const settings=viewport.width<=820?page.locator('.mobile-dock [data-view="view-settings"]'):page.locator('#module-rail [data-module="settings"]');
96 + await settings.click();
97 + const entry=page.locator('#view-settings #finora-org-access-btn');
98 + await expect(entry).toBeVisible();
99 + await expect(entry).toContainText('کاربران، دسترسی‌ها و ظرفیت سازمان');
100 + await entry.click();
101 + await expect(page.locator('#finora-org-access-modal.active')).toBeVisible();
102 + await expect(page.locator('#org-invitation-card')).toContainText('دعوت کاربر جدید');
103 + await expect(page.locator('#org-seat-summary')).toContainText('۵');
104 + await expect(page.locator('#enterprise-org-dashboard')).toContainText('شرکت‌های حقوقی');
105 + await page.locator('#finora-org-access-modal').getByRole('button',{name:'بستن',exact:true}).click();
106 + await page.evaluate(()=>{currentUser.isOrganizationOwner=false;refreshAllSurfaces()});
107 + await settings.click();
108 + await expect(page.locator('#finora-org-access-settings-card')).toBeHidden();
109 + await expect(entry).toBeHidden();
110 + });
111 +}