Skip to content

feat(core): implements fields max length service - #333

Merged
zikani03 merged 1 commit into
openimis:developfrom
Y-Note-SAS:feature-36919
Jul 15, 2026
Merged

feat(core): implements fields max length service#333
zikani03 merged 1 commit into
openimis:developfrom
Y-Note-SAS:feature-36919

Conversation

@Blue-B-code

@Blue-B-code Blue-B-code commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

#Thank you for your contribution to openIMIS!
#Please complete the sections below. Anything in comments is guidance and can be deleted.

Description

In Openimis, several backend models enforce maximum field lengths (max_length). Consequently, when the frontend sends a payload with fields exceeding these limits, the backend returns an error message for the mutation. To prevent users from encountering this—given that the backend error message is not particularly user-friendly—we implemented a service that blocks further input once the max_length is reached and displays a message to inform the user (see screenshot).

The implemented approach is as follows:

On the backend, a new type is added to the queries: MaxLengthConstraintsGQLType

Expected payload:

query GetMaxLengthConstraints { maxLengthConstraints { constraints } }

which returns something like:

{ "data": { "maxLengthConstraints": { "insuree": { "uuid": 36, "chfId": 50, "lastName": 100, "otherNames": 100, "marital": 1, "passport": 25, "phone": 50, "email": 100, "currentAddress": 200, "geolocation": 250, "status": 2 } } } }

On the frontend, this payload is retrieved, and component properties are used to identify the max_length for the current field and manage user interaction.

Type of Change

  • Feature
  • Bug fix
  • Chore (Refactor, Docs, CI/CD)
  • Enhancement

Related Issue(s) / Task(s)

Demo

Upload screenshots/gifs or link to any demo video here.

Capture d’écran du 2026-06-30 00-08-27

Checklist

  • Unit tests added/modified
  • I18n / translation handled

Comment thread src/translations/en.json Outdated
@Blue-B-code
Blue-B-code force-pushed the feature-36919 branch 2 times, most recently from 4ac47ef to 4bfde67 Compare July 14, 2026 15:19
@sonarqubecloud

Copy link
Copy Markdown

@zikani03
zikani03 merged commit de17331 into openimis:develop Jul 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants