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

Add actions to process task

Open nkylstad opened this issue 1 year ago • 2 comments

Description

App developer should be able to add/edit actions to a task in their process. An action can have a type (serverAction or processAction), and a name/value that defines the name of the action. See https://docs.altinn.studio/app/development/process/actions/ for more details.

This is probably something that will have to be done through a customized bpmn properties panel

nkylstad avatar Jan 25 '24 09:01 nkylstad

Combobox should support adding custom values, and will probably be supported soon. So first version of this is to POC the functionality, without any specific design. If combobox supports the custom value functionality we can add this, otherwise add the functionality under a feature flag.

nkylstad avatar Feb 21 '24 09:02 nkylstad

Waiting for #12272 to ensure we implement this in the same way.

nkylstad avatar Feb 26 '24 09:02 nkylstad

Great work! 👏 🚀

I have some feedback on the user experience and UI for this feature.

The saving challenge When choosing a predefined action, the input field must be blurred for the save button to be enabled. This currently disrupts the keyboard navigation, because when tabbing to the next element it focuses on the delete button instead of the saving button. The reason is that the save button is disabled when tabbing happens.

Suggestion: Could we fix the issue above by implementing auto-saving when selecting a predefined action?

Note: It's easy to forget to save since I can select an option and navigate to another place without getting a warning about unsaved changes

Figure 1: Shows that the save button is disabled after a predefined action is selected. Image

Custom Actions When writing a custom action I got the dropdown menu telling me to "Write a custom action", and I think this might confuse some of our users. The reason for the confusion is that normally the dropdown has clickable/selectable items. In this case, is just plain text information about writing a custom action. The user needs to understand that it means the text the user already has written in the input field.

Suggestion: What about splitting the view? Ex. using tabs for predefined and custom actions? @Annikenkbrathen.

Figure 2: Displays the custom actions Image

Adding empty actions It's possible to add empty actions to the XML, will this cause any side-effect or issues? 🤔

Figure 3: Displays bpmn file with empty actions. Image

Filtering options on the client I see this more like a nice-to-have feature. But, should we do some filtering on the client side to avoid the opportunity to add the same action multiple times before saving?

Figure 4: Displays that is possible to add more of the same Image

All predefined actions is already added When all predefined actions is already added, should we inform the user about it? I think this would be easier and more clear if the split the predefined and custom actions.

Figure 5: Image

Edit custom actions If we continue to have predefined and custom actions altogether, should we add/merge your custom actions with the predefined ones? To make it easier to change to a predefined action without needing to erase the custom action first?

Figure: 6: Edit custom action Image

framitdavid avatar May 13 '24 08:05 framitdavid

Very thoroughly testing @framitdavid! 😍

When choosing a predefined action, the input field must be blurred for the save button to be enabled. This is in some way a limitation that comes from the combobox from ds is not designed for this usecase (yet).

So as you are mentioning:

Could we fix the issue above by implementing auto-saving when selecting a predefined action?

I have included a comment on that in the code. Enabling the auto-saving onBlur will also remove the need of a useState to hold the current value ☺️ It is explained a bit here

It's possible to add empty actions to the XML, will this cause any side-effect or issues? 🤔

Maybe that could be a part of some global app validation on deploy (as we have discussed earlier)? Or maybe it is not really an issue. But deffinetly something we should check out! 🤩

I see this more like a nice-to-have feature. But, should we do some filtering on the client side to avoid the opportunity to add the same action multiple times before saving?

I agree that it would be nice! But maybe we should also consider the value it gives for what cost? In other words, the backside to that they are able to define multiple similar actions, I think are none? So even though it is not logic and useless I think it is unnecessary resources for us to implement a hard restriction since it is not directly dissructive for the app 🫣

When all predefined actions is already added, should we inform the user about it? I think this would be easier and more clear if the split the predefined and custom actions.

Agree that we could consider a split. But if we decide to keep it as is, could it be enough to change the wording of the description a bit; Velg en ledig handling eller definer din egen or Velg en av de predefinert handlingene eller definer din egen?

If we continue to have predefined and custom actions altogether, should we add/merge your custom actions with the predefined ones? To make it easier to change to a predefined action without needing to erase the custom action first?

Is it possible with the combobox? I think it only shows the options that matches the current value 🤔

standeren avatar May 13 '24 10:05 standeren

Agree! The save buttons should be replaced by an auto-save function if possible. To have a save button here and not in other places might confuse the user about whether Studio has autosave or not. We should be consistent with the use of autosave in Studio. Additionally, it’s easy for the user to forget after you’ve made a selection; the select box closes, and it might seem like you’ve selected and saved in the same step.

I can look into how we can split predefined and custom actions into two separate options, for example by using tabs. If we don't like that option, we can keep it as one combobox, but then we should make it clear how to create a custom action by saying something like 'write your own name for your custom action in the select box to define your own action.'

Annikenkbrathen avatar May 15 '24 06:05 Annikenkbrathen

Skjermbilde 2024-05-15 kl  09 01 19

Could this work? @standeren @framitdavid

Annikenkbrathen avatar May 15 '24 07:05 Annikenkbrathen

@Annikenkbrathen based on the screenshots above, I like that they are explicit between choosing an action and creating an action. Is the idea that the one you create will appear in the list under the "Velg handling" tab along with the ones that are already predefined?

framitdavid avatar May 21 '24 18:05 framitdavid

@standeren let's keep this issue as is! I have created a new one that takes care of the feedback. However, should we change the text to: "Velg en forhåndsdefinert handling fra nedtrekkslisten eller definer din egen ved å skrive inn navnet som fritekst i feltet", to make it more clear for the user about how to add a custom action?

framitdavid avatar May 22 '24 12:05 framitdavid

@standeren let's keep this issue as is! I have created a new one that takes care of the feedback. However, should we change the text to: "Velg en forhåndsdefinert handling fra nedtrekkslisten eller definer din egen ved å skrive inn navnet som fritekst i feltet", to make it more clear for the user about how to add a custom action?

https://github.com/Altinn/altinn-studio/pull/12837 😁

standeren avatar May 22 '24 13:05 standeren