Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support link a sub-form to data model #13764

Open
framitdavid opened this issue Oct 10, 2024 · 10 comments · May be fixed by #14138
Open

Support link a sub-form to data model #13764

framitdavid opened this issue Oct 10, 2024 · 10 comments · May be fixed by #14138
Assignees
Labels
kind/analysis Used when an issue needs to be analysed before it becomes a user story. team/studio-domain2 UX research ux UX help needed

Comments

@framitdavid
Copy link
Collaborator

We need to be able to configure which data model a subform should use. Should this be configured directly in the subform component, or through the layout set configuration?

@framitdavid framitdavid added ux UX help needed UX research kind/analysis Used when an issue needs to be analysed before it becomes a user story. labels Oct 10, 2024
@nkylstad
Copy link
Member

According to the documentation, this is done via the layout-set. That being said, we could still tie it to the config of the subform component in our UI, as one of the "required" configs. I believe we have talked about moving the creation of a subform layoutset into the flow of adding/configuring the subform component - datatype could be a part of that.
We could even provide an option to create a new data model directly from that config. Some possible flows:

  • Add subform component --> Create new subform layoutset --> Create datamodel/type to associate with the subform layoutset
  • Add subform component --> Create new subform layoutset --> Connect subform layoutset to existing data model
  • Add subform component --> Connect to existing subform layoutset

@framitdavid
Copy link
Collaborator Author

framitdavid commented Oct 11, 2024

Add subform component --> Create new subform layoutset --> Create datamodel/type to associate with the subform layoutset

I liked the first bullet point. In addition to that, should the user have the option to change which data model/type is referenced from the settings on the layout set itself? @nkylstad

There might be some validations concerns by allowing editing the data model reference...

@nkylstad
Copy link
Member

nkylstad commented Oct 11, 2024

I think we should consider supporting all 3 flows. i.e. starting with nothing, starting with an existing data model, and starting with a ready configured layoutset, incl. datamodel,
I suppose there may be more flows to consider as well, but these 3 seem to be a good starting point.

I liked the first bullet point. In addition to that, should the user have the option to change which data model/type is referenced from the >settings on the layout set itself? @nkylstad

There might be some validations concerns by allowing editing the data model reference...

Yep, I think we should keep it simple, and say that all config related to subform has to be done via the subform component. You can edit the contents of the data model, and layouts f.ex., but not really swap it out with anything else.
Any major changes should probably result in having to set up a new subform component imo.

@Annikenkbrathen probably has some thoughts here as well 😊

@framitdavid
Copy link
Collaborator Author

I think we should consider supporting all 3 flows. i.e. starting with nothing, starting with an existing data model, and starting with a ready configured layoutset, incl. datamodel, I suppose there may be more flows to consider as well, but these 3 seem to be a good starting point.

I liked the first bullet point. In addition to that, should the user have the option to change which data model/type is referenced from the >settings on the layout set itself? @nkylstad
There might be some validations concerns by allowing editing the data model reference...

Yep, I think we should keep it simple, and say that all config related to subform has to be done via the subform component. You can edit the contents of the data model, and layouts f.ex., but not really swap it out with anything else. Any major changes should probably result in having to set up a new subform component imo.

@Annikenkbrathen probably has some thoughts here as well 😊

Yes, I agree with that! 👍

@Annikenkbrathen
Copy link

I agree with your points, Nina! I think that when adding a subform to the subform component, the user should be able to choose between an existing subform or setting up a new one. I also believe it should be possible for the user to change between existing subforms chosen in the component, but they should not be able to edit the subform itself further, such as by changing the data model.

So essentially, we support adding or creating subforms and changing which one to use in the component, but not editing them. This is something we could consider handling on the layout set for the subform, but not within the component itself.

I made some sketches for connecting a data model to the subform.
Image
I'm still missing a sketch for creating a new data model when creating a new subform.Do you have any thoughts on the GUI here?

  1. A blank data model will be created that can be edited later on the Data Model page.

  2. The user will be linked to the Data Model page to create it there and then have to find the subform component later to continue setting it up.
    The second option could be difficult for the user because it makes it hard to get an overview of what needs to be set up first (before they can configure the component) and where they should do it.Image

@Annikenkbrathen
Copy link

Annikenkbrathen commented Oct 16, 2024

Maybe something like this?
Image

@wrt95
Copy link
Contributor

wrt95 commented Oct 21, 2024

If no data model connected --> Enable dropdown to select data model and have the "Lag ny datamodell" button.
Else --> Have the dropdown disabled, and show the "Navn på datamodell" view textfield (disabled) with the data model.

@wrt95 wrt95 moved this to 📈 Todo in Team Studio Oct 21, 2024
@lassopicasso lassopicasso moved this from 📈 Todo to ⚠️ Blocked in Team Studio Oct 21, 2024
@JamalAlabdullah JamalAlabdullah self-assigned this Oct 28, 2024
@Altinn Altinn deleted a comment from wrt95 Oct 29, 2024
@JamalAlabdullah
Copy link
Contributor

we should wait for this #13999

@lassopicasso lassopicasso linked a pull request Nov 22, 2024 that will close this issue
4 tasks
@lassopicasso lassopicasso moved this from 👷 In Progress to 🔎 Review in Team Studio Nov 22, 2024
@lassopicasso lassopicasso removed their assignment Nov 22, 2024
@mlqn mlqn self-assigned this Nov 25, 2024
@mlqn mlqn linked a pull request Nov 26, 2024 that will close this issue
4 tasks
@mlqn mlqn removed their assignment Nov 26, 2024
@lassopicasso lassopicasso assigned mlqn and unassigned lassopicasso Nov 27, 2024
@mlqn mlqn moved this from 🔎 Review to 🧪 Test in Team Studio Nov 27, 2024
@mlqn mlqn removed their assignment Nov 27, 2024
@Jondyr Jondyr self-assigned this Nov 28, 2024
@Jondyr
Copy link
Member

Jondyr commented Nov 28, 2024

Tested in dev, noticed two issues:

  • deleting subformlayouts created with a new datamodel gives a toast error message and layout does not seem to be deleted
  • creating two subformlayouts and making a new datamodel with the same name for both seems to work but does not create a new datamodel for the second subform, and shows a toast error message

@Jondyr Jondyr assigned lassopicasso and unassigned Jondyr Nov 28, 2024
@lassopicasso
Copy link
Contributor

lassopicasso commented Nov 28, 2024

Tested in dev, noticed two issues:

  • deleting subformlayouts created with a new datamodel gives a toast error message and layout does not seem to be deleted
  • creating two subformlayouts and making a new datamodel with the same name for both seems to work but does not create a new datamodel for the second subform, and shows a toast error message

@Jondyr
I indirectly mention these issues at the end of the description to the PR, Remaining Tasks, but I should have been more explicit. 🙂

  1. It will be handled by this issue, I see Andrea is working on it. :) The reason for the error message, is that it doesn't find the id in app metadata file.
  2. The subtask of this issue, implement validation, will solve this issue were you can't create a datamodel with a name that already exists :)

@lassopicasso lassopicasso assigned Jondyr and unassigned lassopicasso Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/analysis Used when an issue needs to be analysed before it becomes a user story. team/studio-domain2 UX research ux UX help needed
Projects
Status: 🧪 Test
Development

Successfully merging a pull request may close this issue.

8 participants