سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 3, 14:30 UTC
fix: open a generic support draft from About bug report
JVK committed
Nov 14, 2026 at 09:04 UTC
96007df7bb9cd1cf80fd8c6c79dde0079eeeb727
5 files changed
+100
-2
.github/workflows/quality.yml
+6
-1
@@ -130,7 +130,12 @@ jobs:
130
- name: Real DOM smoke
131
run: |
132
python3 -m http.server 4173 >/tmp/finora-http.log 2>&1 &
133
- npx playwright test scripts/login-account-errors.spec.js scripts/organization-manager-read-state.spec.js scripts/commerce-route-types.spec.js scripts/workspace-access.spec.js scripts/password-recovery.spec.js scripts/password-admin-ui.spec.js scripts/login-auth-transport.spec.js scripts/login-startup-readiness.spec.js scripts/phase0-startup-performance.spec.js scripts/dom-smoke.spec.js scripts/platform-office.spec.js scripts/enterprise-license.spec.js scripts/enterprise-role.spec.js scripts/enterprise-invitation.spec.js scripts/enterprise-org-ux.spec.js scripts/identity-wave5a.spec.js scripts/identity-wave5b.spec.js scripts/identity-wave5c.spec.js scripts/branding-login.spec.js scripts/login-connectivity.spec.js scripts/shell-scroll-ownership.spec.js scripts/office-slice-c1.spec.js scripts/office-slice-c2.spec.js scripts/office-slice-c3.spec.js scripts/office-slice-c4.spec.js scripts/office-slice-c5.spec.js scripts/office-slice-c6.spec.js scripts/office-slice-c7.spec.js scripts/office-slice-c8.spec.js scripts/office-slice-c8-runtime.spec.js scripts/request-workflow-d2.spec.js scripts/request-workflow-d3b.spec.js scripts/request-workflow-d3c.spec.js scripts/request-workflow-d4a.spec.js scripts/taxpayer-print.spec.js scripts/chart-completeness.spec.js scripts/accounting-p0-journal.spec.js scripts/ux-hardening-r2.spec.js scripts/ux-keyboard-f2.spec.js scripts/phase0-dark-theme-contrast.spec.js scripts/phase0-selector-stress.spec.js scripts/phase0-invoice-persistence.spec.js scripts/phase0-modal-dashboard.spec.js scripts/accounting-document-workflow.spec.js scripts/admin-provisioning.spec.js scripts/pages-artifact.spec.js --reporter=line --workers=1
133
+ npx playwright test scripts/about-support.spec.js scripts/login-account-errors.spec.js scripts/organization-manager-read-state.spec.js scripts/commerce-route-types.spec.js scripts/workspace-access.spec.js scripts/password-recovery.spec.js scripts/password-admin-ui.spec.js scripts/login-auth-transport.spec.js scripts/login-startup-readiness.spec.js scripts/phase0-startup-performance.spec.js scripts/dom-smoke.spec.js scripts/platform-office.spec.js scripts/enterprise-license.spec.js scripts/enterprise-role.spec.js scripts/enterprise-invitation.spec.js scripts/enterprise-org-ux.spec.js scripts/identity-wave5a.spec.js scripts/identity-wave5b.spec.js scripts/identity-wave5c.spec.js scripts/branding-login.spec.js scripts/login-connectivity.spec.js scripts/shell-scroll-ownership.spec.js scripts/office-slice-c1.spec.js scripts/office-slice-c2.spec.js scripts/office-slice-c3.spec.js scripts/office-slice-c4.spec.js scripts/office-slice-c5.spec.js scripts/office-slice-c6.spec.js scripts/office-slice-c7.spec.js scripts/office-slice-c8.spec.js scripts/office-slice-c8-runtime.spec.js scripts/request-workflow-d2.spec.js scripts/request-workflow-d3b.spec.js scripts/request-workflow-d3c.spec.js scripts/request-workflow-d4a.spec.js scripts/taxpayer-print.spec.js scripts/chart-completeness.spec.js scripts/accounting-p0-journal.spec.js scripts/ux-hardening-r2.spec.js scripts/ux-keyboard-f2.spec.js scripts/phase0-dark-theme-contrast.spec.js scripts/phase0-selector-stress.spec.js scripts/phase0-invoice-persistence.spec.js scripts/phase0-modal-dashboard.spec.js scripts/accounting-document-workflow.spec.js scripts/admin-provisioning.spec.js scripts/pages-artifact.spec.js --reporter=line --workers=1
134
+
135
+ - name: About support on generated Pages
136
+ run: |
137
+ node scripts/build-pages.mjs
138
+ FINORA_TEST_BASE_URL=http://127.0.0.1:4173/_site/index.html npx playwright test scripts/about-support.spec.js --reporter=line --workers=1
139
140
identity-wave5a-database:
141
runs-on: ubuntu-latest
PROJECT_STATE.md
+7
@@ -292,3 +292,10 @@ Owner requests layer-by-layer click/functional testing of all controls and compa
292
- These are preflight tools, not a converter. `executable` remains false by design. The first missing implementation is compatible source-linked draft CRUD/finalization (current invoice classifier treats any journal link as posted; purchase finalizer rejects an attached draft). Then transactional identity/numbering, conversion executor, stale-client protection and reporting must be proved before conversion. The external backup waiver remains effective; no renewed connection/approval request.
293
- Contact summary PR199 deployment verified: main80bef2b Quality43483857525/Security43483857824,Release43484610692,Pages43484680688 allSUCCESS. Public10/10readback exact; public synthetic purchase1000 minus unallocatedpayment450 yields liability550 without network financial writes. This evidence does not prove new cheque accounting or draft-first behavior.
294
- Continuity goal/status/remaining updated in docs/EXECUTION_STATUS.md and docs/GLOBAL_DRAFT_CONVERSION_2026-11-13.md. Draft-only source adapters, three identifiers, review/referral/reporting, global conversion and cheque lifecycle are OPEN. Do not label the latest request complete or any existing journal converted.
295
+
296
+### 2026-11-14 — FE-A01 worker handoff reviewed; lead completes implementation
297
+- Owner returned FE-A01 from an ordinary chat: correct source diagnosis and proposal, explicitly unexecuted. The pasted URL is truncated/malformed and no executable test file was delivered. Classify as reviewed proposal needing completion, not an accepted implementation or PASS.
298
+- Lead verifies current main155ee89 still has the static support alert. Scoped branch fix/about-bug-report-20261114 replaces only that About control with an ordinary link to the existing support destination and a fixed, fully encoded generic bug-report draft. No customer/account/storage data collection or automatic message; update-check remains a separate unresolved task.
299
+- Validate real Settings/About clicks, keyboard activation, mobile layout and generated strict-CSP Pages with all external requests intercepted; no actual WhatsApp request or message. Root may register the new regression in existing CI, outside worker's narrower scope. Preserve financial work separately; no production SQL/Auth or financial data change. Existing autonomous protected frontend release authority applies after exact checks.
300
+- Local acceptance: four new source cases failed before repair because the real About link did not exist, then4/4 source and4/4 generated Pages PASS; real route/header clicks, existing destination, exact decoded generic draft, no pre-click navigation, keyboard Tab/Enter,390px bounds and noopener verified. Every external request was intercepted; WhatsApp delivery/editing UI itself is not tested. Static quality, public CSP/build checks, release-safety and diff checks PASS.
301
+- Independent read-only review found no application/security defect and one CI gap: source-only invocation omitted the generated artifact. Added a dedicated generated-Pages invocation to the existing Quality job; no assertion or security gate weakened. Exact PR/main CI and publication evidence will be maintained in this fix PR. Financial work remains separate and incomplete.
docs/agent-workflow/FE-A01_RESULT_FA.md
new
+21
@@ -0,0 +1,21 @@
1
+# نتیجهٔ مأموریت FE-A01
2
+
3
+## پذیرش تحویل عامل
4
+
5
+گزارش عامل، تشخیص منبع و پیشنهاد را درست بیان میکرد و ادعای اجرای تست نداشت؛ اما URL نمایشی ناقص/دارای کدگذاری خراب بود، diff کامل ضمیمه نشده بود و فایل آزمون وجود نداشت. بنابراین «پیادهسازی تحویلشده» پذیرفته نشد؛ وضعیت ورودی: پیشنهاد بررسیشده، نیازمند تکمیل.
6
+
7
+## تکمیل توسط مدیر
8
+
9
+مدیر لینک کامل را از متن ثابت فارسی تولید کرد و دکمهٔ پیام ثابت را به «گزارش باگ در واتساپ» تبدیل کرد. مقصد همان پشتیبانی موجود است. متن شامل شرح مشکل، مراحل بازتولید، نتیجهٔ مورد انتظار و نتیجهٔ مشاهدهشده است؛ هیچ اطلاعات کاربر یا مالی خودکار اضافه نمیشود. لینک فقط با اقدام کاربر باز میشود؛ ارسال خودکار ندارد. بررسی آپدیت همچنان مأموریت جداگانهٔ باز است.
10
+
11
+چهار آزمون جدید ابتدا روی نسخهٔ قبلی به دلیل نبود لینک شکست خوردند. پس از اصلاح: ۴/۴ منبع و ۴/۴ خروجی Pages موفق، شامل دسکتاپ/موبایل۳۹۰، کلیک/Tab+Enter، مقصد و متن کامل، عدم بازشدن خودکار، مرز نمای صفحه و noopener. تمام درخواستهای بیرونی رهگیری و متوقف شدند؛ پیام واقعی ارسال نشده و رابط/تحویل پیام واتساپ آزموده نشده است. کنترلهای کیفیت ایستا، CSP/build، ایمنی انتشار و diff موفقاند.
12
+
13
+بازبین مستقل ایراد محصول/امنیت پیدا نکرد؛ نبود اجرای آزمون نسخهٔ ساختهشده در CI را گزارش کرد که با افزودن اجرای جداگانه رفع شد. این آزمون برای تغییر محصول متناسب است؛ قبولی کل CI/استقرار باید برای SHA جدید خوانده شود.
14
+
15
+## وضعیت
16
+
17
+پیادهسازی و بررسی محلی تکمیل؛ انتشار تا قبولی CI و بازخوانی عمومی ادعا نمیشود. مرجع شناسهٔ commit، PR، CI و انتشار در شرح PR اصلاح نگهداری میشود. هیچ تغییر SQL، Auth یا دادهٔ مالی انجام نشده است.
18
+
19
+## بازخورد برای تحویلهای بعدی
20
+
21
+فایل diff کامل و فایل تست را واقعاً ضمیمه کنید؛ نمونهٔ کوتاهشده را patch قابلاعمال ننامید. نبود محیط اجرا مانع ارائهٔ کد کامل تست نیست؛ وضعیت اجرا باید همچنان «اجرا نشده» بماند. در جدول آزمون خانهٔ خالی نگذارید: بررسیشده، اجراشده، اجرا نشده، یا نامرتبط را صریح بنویسید.
index.html
+1
-1
@@ -770,7 +770,7 @@ body{background:#f6f9fc}
770
</div>
771
<div style="display:flex;gap:10px;margin-top:10px">
772
<button class="btn btn-primary" onclick="alert('آخرین نگارش نصب است.')">بررسی آپدیت</button>
773
-<button class="btn btn-secondary" onclick="alert('پشتیبانی فعال است.')">گزارش باگ</button>
773
+<a class="btn btn-secondary" href="https://wa.me/989124376991?text=%D8%B3%D9%84%D8%A7%D9%85%D8%8C%20%D9%85%DB%8C%E2%80%8C%D8%AE%D9%88%D8%A7%D9%87%D9%85%20%DB%8C%DA%A9%20%D9%85%D8%B4%DA%A9%D9%84%20%D8%AF%D8%B1%20%D9%86%D8%B1%D9%85%E2%80%8C%D8%A7%D9%81%D8%B2%D8%A7%D8%B1%20%D9%81%DB%8C%D9%86%D9%88%D8%B1%D8%A7%20%DA%AF%D8%B2%D8%A7%D8%B1%D8%B4%20%DA%A9%D9%86%D9%85.%0A%D8%B4%D8%B1%D8%AD%20%D9%85%D8%B4%DA%A9%D9%84%3A%0A%D9%85%D8%B1%D8%A7%D8%AD%D9%84%20%D8%A8%D8%A7%D8%B2%D8%AA%D9%88%D9%84%DB%8C%D8%AF%3A%0A%D9%86%D8%AA%DB%8C%D8%AC%D9%87%20%D9%85%D9%88%D8%B1%D8%AF%20%D8%A7%D9%86%D8%AA%D8%B8%D8%A7%D8%B1%3A%0A%D9%86%D8%AA%DB%8C%D8%AC%D9%87%20%D9%85%D8%B4%D8%A7%D9%87%D8%AF%D9%87%E2%80%8C%D8%B4%D8%AF%D9%87%3A" target="_blank" rel="noopener">گزارش باگ در واتساپ</a>
774
</div>
775
</div>
776
</div>
scripts/about-support.spec.js
new
+65
@@ -0,0 +1,65 @@
1
+const {test,expect}=require('@playwright/test');
2
+const BASE=process.env.FINORA_TEST_BASE_URL||'http://127.0.0.1:4173/index.html';
3
+const DRAFT='سلام، میخواهم یک مشکل در نرمافزار فینورا گزارش کنم.\nشرح مشکل:\nمراحل بازتولید:\nنتیجه مورد انتظار:\nنتیجه مشاهدهشده:';
4
+test.setTimeout(20000);
5
+
6
+for(const width of [1440,390])for(const activation of ['click','keyboard']){
7
+ test(`About bug report opens only a generic support draft: ${width} ${activation}`,async({page,context})=>{
8
+ await page.setViewportSize({width,height:900});
9
+ const outgoing=[],errors=[];
10
+ page.on('pageerror',e=>errors.push(e.message));
11
+ // Context routing covers the popup's FIRST navigation too. No real external
12
+ // service receives even a GET; synthetic page stands in for the destination.
13
+ await context.route('**/*',route=>{
14
+ const request=route.request(),url=new URL(request.url());
15
+ if(url.origin===new URL(BASE).origin)return route.continue();
16
+ if(url.hostname==='wa.me'){
17
+ outgoing.push({url:request.url(),method:request.method()});
18
+ return route.fulfill({contentType:'text/html',body:'<title>Intercepted support draft</title>'});
19
+ }
20
+ return route.abort();
21
+ });
22
+ await page.goto(BASE,{waitUntil:'domcontentloaded'});
23
+ await page.waitForFunction(()=>window.FinoraStartupStatus?.extensionsReady&&window.FinoraStartupStatus?.authChecked);
24
+ await page.evaluate(()=>{
25
+ currentUser={id:'QA_SUPPORT_PRIVATE_SENTINEL',email:'private-sentinel@example.invalid',role:'user',isOrganizationOwner:true,organizationId:'QA_ORG',organizations:[],modules:['full_suite'],commercialModules:['full_suite'],modulePermissions:[],subscription:{type:'lifetime',status:'active',endDate:'2099-01-01'}};
26
+ COLLS.forEach(k=>datastore[k]=[]);saveDatastore=()=>{};
27
+ sb.from=()=>({select(){return this},eq(){return this},in(){return this},order(){return this},then(resolve,reject){return Promise.resolve({data:[],error:null}).then(resolve,reject)}});
28
+ sb.rpc=async()=>({data:[],error:null});
29
+ document.querySelector('#auth-screen').style.display='none';document.body.classList.remove('shell-panel-collapsed');refreshAllSurfaces();
30
+ });
31
+ const settings=width<=820?page.locator('.mobile-dock [data-view="view-settings"]'):page.locator('#module-rail [data-module="settings"]');
32
+ await settings.click();
33
+ const about=page.locator('#view-settings [data-finora-task="about"]');
34
+ if(width>820)await page.locator('#module-panel-links [data-task="about"]').click();
35
+ if(!await about.locator('.accordion-body').isVisible())await about.locator('.accordion-header').click();
36
+ const link=about.getByRole('link',{name:'گزارش باگ در واتساپ',exact:true});
37
+ await expect(link).toBeVisible();
38
+ const href=await link.getAttribute('href'),url=new URL(href);
39
+ const existing=new URL(await about.locator('.btn-wa').getAttribute('href'));
40
+ expect(url.origin+url.pathname).toBe(existing.origin+existing.pathname);
41
+ expect(url.protocol).toBe('https:');expect(url.hostname).toBe('wa.me');
42
+ expect([...url.searchParams.keys()]).toEqual(['text']);
43
+ expect(url.searchParams.get('text')).toBe(DRAFT);
44
+ expect(url.hash).toBe('');expect(href).not.toContain('PRIVATE_SENTINEL');
45
+ await expect(link).toHaveAttribute('target','_blank');
46
+ expect((await link.getAttribute('rel')).split(/\s+/)).toContain('noopener');
47
+ await expect(link).not.toHaveAttribute('onclick',/.+/);
48
+ await link.scrollIntoViewIfNeeded();
49
+ const box=await link.boundingBox();expect(box.x).toBeGreaterThanOrEqual(0);expect(box.x+box.width).toBeLessThanOrEqual(width);
50
+ expect(outgoing).toEqual([]);expect(context.pages()).toHaveLength(1);
51
+ const popupPromise=context.waitForEvent('page');
52
+ if(activation==='keyboard'){
53
+ await about.getByRole('button',{name:'بررسی آپدیت',exact:true}).focus();
54
+ await page.keyboard.press('Tab');await expect(link).toBeFocused();await page.keyboard.press('Enter');
55
+ }else await link.click();
56
+ const popup=await popupPromise;await popup.waitForLoadState('domcontentloaded');
57
+ expect(outgoing).toEqual([{url:href,method:'GET'}]);
58
+ expect(await popup.evaluate(()=>window.opener===null)).toBe(true);
59
+ expect(errors).toEqual([]);
60
+ if(BASE.includes('_site')||BASE.includes(':4188')){
61
+ expect(await page.locator('meta[http-equiv="Content-Security-Policy"]').getAttribute('content')).not.toMatch(/script-src[^;]*'unsafe-inline'/);
62
+ }
63
+ await popup.close();
64
+ });
65
+}