CaptainAni187 opened a new pull request, #711:
URL: https://github.com/apache/fineract-backoffice-ui/pull/711

   ## What and why
   
   This fixes parts 2 and the message half of part 3 of #671.
   
   - **Business date.** `GET /businessdate` answers `[]` when the feature is 
not configured, and the header showed `BUSINESS DATE: -` for the whole session. 
The chip is now left out when there is no business date.
   - **Sign-in failure message.** Every failure used to show "Login failed. 
Check credentials/server.", or the platform's "Unauthenticated. Please login." 
for a wrong password. Now:
     - a 401 with `error.msg.not.authenticated` (wrong username or password) 
says the username or password was not accepted;
     - a 404 says no sign-in endpoint was found and points at the API endpoint 
selection;
     - status 0 (network or CORS failure) says the server could not be reached;
     - anything else keeps the platform's own message, such as "Invalid tenant 
identifier provided with request.", or a generic one.
   
     The new strings are in `en.json` under `login.errors`, next to 
`endpointNotAllowed`.
   
   Not changed:
   
   - **Part 1** was already fixed on `main` by c2f0bdd0. I checked the other 
transaction forms against the platform's validators. Only the savings deposit, 
withdrawal, force withdrawal and adjustment commands require `paymentTypeId` 
(`SavingsAccountTransactionDataValidator.validate`). It is optional 
(`ignoreIfNull`) for fixed and recurring deposit transactions 
(`DepositAccountTransactionDataValidator`) and loan transactions 
(`LoanTransactionValidatorImpl`), so those forms need no change.
   - **The default endpoint in part 3** is left as it is, since the issue 
leaves that as a decision.
   
   Part of #671
   
   ## Verification
   
   - Unit tests: `npm run test` (2017 passed). There are new header tests for 
no business date and a configured one, and new login tests for 401 
(credentials), 401 (unknown tenant), 404, status 0 and other errors. The four 
new message tests and the empty business date test fail on `main`.
   - E2E, mocked: `npx playwright test --project=mocked --project=mobile`. 
Three header checks in `e2e-journey.spec.ts` and `feature-coverage.spec.ts` 
relied on the old `-` chip, because those specs never mocked `/businessdate`. 
Their login helpers now mock a business date.
   - `npm run lint`, `prettier --check` and `npm run i18n:check` pass.
   - The UI was exercised with mocks only, not against a real Fineract.
   
   ## Screenshots
   
   No business date (`GET /businessdate` answers `[]`):
   
   ![header without business 
date](https://raw.githubusercontent.com/CaptainAni187/fineract-backoffice-ui/pr-671-screenshots/header-no-business-date.png)
   
   A configured business date:
   
   ![header with business 
date](https://raw.githubusercontent.com/CaptainAni187/fineract-backoffice-ui/pr-671-screenshots/header-with-business-date.png)
   
   Sign-in against an endpoint that answers 404:
   
   ![login 
404](https://raw.githubusercontent.com/CaptainAni187/fineract-backoffice-ui/pr-671-screenshots/login-404.png)
   
   Wrong username or password (401, `error.msg.not.authenticated`):
   
   ![login 
401](https://raw.githubusercontent.com/CaptainAni187/fineract-backoffice-ui/pr-671-screenshots/login-401.png)
   


-- 
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]

Reply via email to