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 actions property on CustomButton component #13765

Open
nkylstad opened this issue Oct 10, 2024 · 4 comments
Open

Support actions property on CustomButton component #13765

nkylstad opened this issue Oct 10, 2024 · 4 comments
Labels
area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. kind/user-story Used for issues that describes functionality for our users. status/draft Status: When you create an issue before you have enough info to properly describe the issue. team/studio-domain2 ux UX help needed

Comments

@nkylstad
Copy link
Member

Description

Setting up a CustomButton with actions is required for a subform layoutset. The action must be a closeSubform action. See reference docs.

We currently have no support for actions config for the CustomButton component. We should implement a custom config for this property.

There are 2 types of actions:

  • ClientActions - pre-defined list of options, with some of the options having additional parameters
  • ServerActions - completely custom, the user must refer to the name of a custom coded action on the app backed.

actions is an array of objects. The items in the array all have the properties

  • id: string - the id of the action
  • type: "ClientAction" | "ServerAction".

In addition, items with type "ClientAction" may also have additional properties. See the documentation for CustomButton for details.

Additional Information

One alternative we might consider in the short run is to implement a "CloseSubformButton" which is a specific implementation of the CustomButton:

"id": "<some-generated-id",
"type": "CustomButton",
"actions": [
  {
    "type": "ClientAction",
    "id": "closeSubForm",
    "validation": {
        "page": "all",
        "show": ["All"]
      }
  }
]

and make this available as a pre-configured component.

Tasks

No response

Acceptance Criterias

No response

@nkylstad nkylstad added kind/user-story Used for issues that describes functionality for our users. status/draft Status: When you create an issue before you have enough info to properly describe the issue. labels Oct 10, 2024
@nkylstad nkylstad added the ux UX help needed label Oct 14, 2024
@nkylstad
Copy link
Member Author

Functionality-wise this is quite similar to tableColumns setting in subform. Suggest design to match.

@Annikenkbrathen
Copy link

I got some questions🤓

If a button is required to be added when adding a subform component, maybe it should be automatically added to the structure column, below the subform component? (Similar to what we have done with the navigation button when adding a page.)

In future iterations of the functionality, we might automatically configure the CustomButton to match the subform component it is associated with. Specifically, the idea is for the button to automatically use the same subform layoutset that is already set in the subform component.

Also, will this suggestions it be confusing if the button could be used in contexts other than in a subform?
Do we have any need for a CustomButton in other cases today? And what is the difference between this and the one called "Handlingsknapp" in Studio today?

Image

@wrt95
Copy link
Contributor

wrt95 commented Oct 21, 2024

We can add the config as a Switch at the top of a SubForm page.
Let the user see a text with information about what happens when adding this button.
The switch design can be similar to the PDF switch.
This switch adds the component to the list, and the user must be able to define the text on this. We should also have a default text initially on the button.
If button is deleted from component list, turn switch off.

Could be placed here:
Image

Take this out of sprint.
New issue estimation: 3

@lassopicasso
Copy link
Contributor

Utilizing custom button for the isolated context with subform: #13836

@nkylstad nkylstad added the area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. kind/user-story Used for issues that describes functionality for our users. status/draft Status: When you create an issue before you have enough info to properly describe the issue. team/studio-domain2 ux UX help needed
Projects
Status: No status
Development

No branches or pull requests

4 participants