سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 4, 09:15 UTC
fix(navigation): place workspaces in topbar and access in Settings
JVK committed
Nov 10, 2026 at 12:21 UTC
e6cc879e5b8dfa26618b2620ff58db05b4c59da0
10 files changed
+75
-11
PROJECT_STATE.md
+6
@@ -236,3 +236,9 @@ 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.
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
+اجرای کامل regression پس از ترکیب با اصلاح فوری ورود، بررسی CI، انتشار محافظتشده و بازخوانی نسخهٔ سایت هنوز در انتظار است. نتیجهٔ نهایی و شناسهٔ انتشار در PR مربوط ثبت میشود. این تغییر بهمعنای تکمیل 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/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
+}