shivaansh0610-LUFFY opened a new pull request, #712: URL: https://github.com/apache/fineract-backoffice-ui/pull/712
## What and why Closes #671. #671 reports three small defects found while browsing a live instance. The payment-type item was already fixed on `main` (c2f0bdd0), so this PR adds coverage for it. It also fixes the other two and the local-setup cause behind the third. - **Business date chip.** When `GET /businessdate` returns `[]` (no business date configured), the header showed `BUSINESS DATE: -` for the whole session. The chip is now omitted; the render time stays. - **Sign-in failure message.** Every failure showed "Login failed. Check credentials/server.". The message now depends on the failure: a 401 says the sign-in was refused, a 404 names the endpoint that does not serve sign-in, and a status of 0 (unreachable or blocked by CORS) says the server could not be reached. Other failures keep the platform's own message. - **Default endpoint in the local setup.** `config.json` ships `/api/v1`, which the dev proxy did not forward, so the default selection returned a 404 under `npm start`. `proxy.conf.json` now forwards `/api/v1` as well as `/fineract-provider/api/v1`. The shipped default and the Docker deployment are unchanged. - **Payment type on savings deposits and withdrawals.** Already required on `main` (c2f0bdd0). This PR adds the regression tests. I also checked the other transaction forms: the platform only requires `paymentTypeId` for savings deposits and withdrawals. Recurring and fixed deposits, loan transactions and chargebacks treat it as optional, so no client change is needed there. ## Changes - `src/app/layout/header.component.ts`: the business date starts as `null` and the chip renders only once a date is reported. - `src/app/features/login/login.component.ts`: `failureMessage()` picks the message by status code. New `login.errors.rejected`, `login.errors.notFound` and `login.errors.unreachable` keys in `src/assets/i18n/en.json`. Hindi and Korean fall back to English, as the existing login error keys do. - `proxy.conf.json` and `SETUP.md`: the dev proxy forwards `/api/v1`, and the setup guide says so. This affects `npm start` only. - New and updated unit tests in `header.component.test.ts`, `login.component.test.ts` and `savings-account-transaction-form.component.test.ts`. The payment-type test asserts on the payment-type control itself, so it does not pass on the amount field. - `e2e/e2e-journey.spec.ts` and `e2e/feature-coverage.spec.ts`: these mock a business date, since the chip is now hidden without one. No files under `src/app/api/` changed. ## Verification - **Unit (`npm run test:unit`):** 292 files and 2020 tests pass. Four of the new tests (one header, three login) and two savings payment-type tests fail on the pre-fix commit `e8aac9b6`, so they guard the change. - **Mocked e2e (`npm run test:e2e -- --project=mocked`):** 411 passed, 1 skipped. - **Other checks:** `npm run lint`, `npm run typecheck:e2e`, `npm run build`, `prettier --check`, `npm run i18n:check`, `npm run check:template-text`, `npm run check:a11y-names`, `npm run check:internal-endpoints` and `npm run check:route-permissions` all pass. - **Live, against a stand-in Fineract server (not in the repo):** with the default endpoint, the pre-fix dev server returned 404 for `POST /api/v1/authentication`; with this change the request is proxied and a correct password signs in. The header chip appears before the fix and is absent after it. - **Not run:** the real-backend (`--project=backend`) specs, which need the Docker stack. ## Screenshots Before and after comparisons for each changed screen, plus two side-by-side recordings: sign-in and the savings deposit form. They were captured against the stand-in server. The 404 and unreachable sign-in responses are mocked. https://github.com/user-attachments/assets/deef3398-4d16-48df-9a82-357fa9d52c2b https://github.com/user-attachments/assets/52d25aa3-a843-4582-8380-731a28d6cf1d ## AI assistance (optional) - Tool / model: - Harness / workflow: ## Checklist - [x] I did not hand-edit generated files under `src/app/api/`. - [x] N/A: no new component or service code. The changed login and header code keeps its existing translation and notification patterns. - [x] User-facing strings use translation keys. - [x] I added or updated tests appropriate to this change. - [x] UI workflow changes have mocked e2e coverage. Real-backend coverage was not run for this change. - [ ] Commits are signed (see [Commit Signing](CONTRIBUTING.md#commit-signing)). - [ ] I followed the [AI-assisted contributions guidance](CONTRIBUTING.md#ai-assisted-contributions). - [x] N/A: this is a bug fix and test change, so no dev-list thread is needed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
