vaidikgarg-bit opened a new pull request, #842:
URL: https://github.com/apache/fineract-backoffice-ui/pull/842

   Closes #790
   
   ## What changed
   
   The External Services screen now offers SMS next to S3, SMTP and 
Notification. SMS is the message gateway that SMS campaigns and SMS 
notifications send through. Fineract stores it as `MESSAGE_GATEWAY`.
   
   - The four properties Fineract accepts for SMS (`host_name`, `port_number`, 
`end_point`, `tenant_app_key`) are always listed, even if none is stored yet. 
The port is a number input.
   - `tenant_app_key` is handled as a credential. `GET /externalservice/SMS` 
returns it in clear text (`ExternalServiceMapper` masks only `password` and 
`server_key`), so the stored value is never put into the form. The field is a 
password input whose placeholder says whether a key is set, and the key is sent 
only when a new one is typed.
   - Save sends only the fields that were edited. 
`updateExternalServicesProperties` updates just the keys it receives, so 
untouched settings keep their stored values. Before this, every field was sent 
back on each save. Values go out as text, including the port, which Ionic's 
number input hands back as a number (or `null` once cleared). If nothing 
changed, Save says so and sends nothing.
   - The error interceptor now drops the `args` of any error entry whose 
parameter name contains `app_key`, the same way it already handles passwords 
and secrets, so a refused key's value is not echoed in the error toast. 
Fineract's messages for these errors name the parameter, not its value.
   
   These changes apply to all four services:
   
   - A 403 on load shows a "no access" message instead of an empty form. Other 
load failures offer Retry.
   - A response that arrives after a newer load has started is ignored.
   - Save is gated with `appRequiresPermission="UPDATE_EXTERNALSERVICES"` and 
also bound to the permission in `[disabled]`. The directive sets Ionic's 
`disabled` property once, and the existing `[disabled]` binding overwrote it 
when the data arrived, so a read-only user would have seen an enabled Save.
   - A successful save shows a toast and refreshes the values in place. If that 
refresh fails, the form is cleared so stale values can't be saved again.
   
   ## Known limits
   
   - A stored app key can't be cleared from this screen, because a blank field 
means "keep the current key". Clearing it still needs the API.
   - Fineract returns 404 for a property that has no row in 
`c_external_service_properties`. I couldn't confirm that every deployment seeds 
the `MESSAGE_GATEWAY` rows. Because only edited fields are sent, an untouched 
field never triggers this.
   
   ## Testing
   
   - 15 unit tests for the component cover the SMS field list, the masked key, 
the payload with and without a new key, a numeric port and one typed then 
cleared, a failed save, a 403 and a retryable load failure, a stale response, 
the refresh after a save (and a failed one), and Save staying disabled without 
the permission after the data arrives. I checked that the permission test and 
both refresh tests fail without their fixes.
   - A new interceptor test checks that a refused `tenant_app_key` value is not 
echoed in the toast.
   - Full unit suite (2734 tests), lint, translation check and production build 
pass locally.
   - No new e2e spec. This is a settings form with no flow beyond load and 
save, and the unit tests cover the payload.
   


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