altinn-studio icon indicating copy to clipboard operation
altinn-studio copied to clipboard

Add `prefix` and `suffix` text resource binding for input component

Open bjosttveit opened this issue 1 year ago • 2 comments

Description

prefix and suffix text resource bindings for input component are available since version 4.4.0 of app-frontend. https://docs.altinn.studio//nb/altinn-studio/reference/ux/styling/#prefiks-og-suffiks

Additional Information

No response

bjosttveit avatar Jun 17 '24 13:06 bjosttveit

We should re-run the script for generating component json schemas.https://docs.altinn.studio/nb/altinn-studio/guides/contributing/add-new-component/#1-få-json-skjema-for-den-nye-komponenten

nkylstad avatar Jul 01 '24 12:07 nkylstad

During execution of this issue I found there is some missing information in the documentation:

  • Add to docs that the component name must be added to the list of components of exported schemas in component-list.json in the same folder as the actual schemas. And add the schema to the list of schemas in componentSchemaMocks.
  • If the new component contains the property children it has to be assigned the itemType: LayoutItemType.Container in formItemConfig.ts which also includes adding the new component as a valid container and assigning what other components that should be added to the property validChildTypes also in formItemConfig.ts. And as far as I know there is no way to tell directly from the generated schema what components that are valid children(?) so this information must be gathered by logistical thinking or asking team apps? 😅

standeren avatar Jul 06 '24 06:07 standeren

Testing

This works 😊

There is one visual issue - the text key for the prefix/suffix is shown upon creation, and it overflows: https://github.com/user-attachments/assets/19657f4c-0a01-41d1-9ca1-4720ab6274ea

Edit: Created a new issue #13167 for this.

ErlingHauan avatar Jul 17 '24 06:07 ErlingHauan