Altinn / altinn-studio

Next generation open source Altinn platform and applications.
https://docs.altinn.studio
BSD 3-Clause "New" or "Revised" License
109 stars 73 forks source link

Text editor `appName` doesn't update `title` in `applicationMetaData` #12917

Open lassopicasso opened 1 month ago

lassopicasso commented 1 month ago

Description of the bug

Edit: read the comment from @standeren below.

The appName field in the text editor should update the title field in applicationMetaData. Currently, this field can only be changed through the settings modal. When the appName is updated in the settings modal, it correctly updates as well the appName field in the text editor for Bokmål.

However, there is a one-way sync issue:

Additionally, enabling the text editor to change this field in applicationMetaData should also allow for the inclusion of other languages, such as Nynorsk.

Additionally issue, when changing title manually in applicationmetadata - it doesn't update the name in studio because studio read the config file instead of applicationmetadata. As @standeren suggested in the slack thread, maybe change this to only read from metadata instead and get rid of the config file?

Steps To Reproduce

  1. Go to settings modal, change the app name
  2. Go to text editor, see that appName is updated
  3. Push changes and see that applicationMetaData is updated
  4. Repeat this, but change it in text editor.

Additional Information

Should add some playwright tests for this :)

Slack: https://altinndevops.slack.com/archives/CDU1S3NLW/p1717492210499339

No response

standeren commented 1 month ago

Open question; but do we need two entrances for editing appName? Could it be sufficient changing it from Settings? Meaning that appName in textResources is updated under the hood when changing name in settings modal, but we do not list the appName from Text-editor? If so we need to adapt the Settings editor to handle all languages that the app have resource files for. Maybe only by changing the current language from a dropdown next to the appName in the settings modal 🤷‍♀️

lassopicasso commented 1 month ago

I agree, it is maybe not necessary to handle changes for appName in both settings and text editor. I think that sounds like a good solution to use a dropdown in settings to handle other languages as well. We should discuss this with the team :)

nkylstad commented 3 weeks ago

We also need to verify where the app name in applicationMetadata is actually used. My hypothesis is that it is only used in the inbox. This means that only nb, nn and en languages are relevant.

nkylstad commented 3 weeks ago

From refinement:

Only way to update application name should be through settings modal. Updating the application name there should update applicationMetadata.json when relevant (nb, nn, en), and textResource (key: appName) always.