-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: GUI actions without navigation #785
Conversation
ffe83c5
to
c040a9b
Compare
853be56
to
0319579
Compare
@elsand As for the But we would still have a problem if the UI is refreshed, front-end would then not know if the user has triggered the action or not. (This would not be helped by the Keep a log of triggered actions in dialogporten..
|
bc29893
to
7d48644
Compare
👍
Yes, that was the idea. If that flag is false (or not set), it would indicate that the write operation would block until the dialog has been updated, so that the frontend could then immediately reload the dialog upon receiving a non-error response. If set, a GQL subscription would be set up (which presumably opens a websocket connection to Dialogporten, either directly from the client or via the BFF) which notifies the client as soon as the dialog is ready to be reloaded. Regardless of the flag, I would expect a spinner of some sort to be shown the user, blocking any interaction with any dialog actions until the dialog can be reloaded again.
I'm not sure this UI-related state should be placed in Dialogporten. We would also have to use the somewhat unorthodox/lesser used 307 HTTP code in order to redirect a POST/DELETE with auth/CORS headers, which might cause compatibility issues in some browsers. I'm thinking it's probably better to keep this state clientside in session storage. When the action is invoked, a key This of course won't stop any second users, or second browers for that matter, invoking any given action multiple times, but this is unlikely to be a problem in the real world - we require all actions to be idempotent anyway. Clientside or not, we need to avoid ending up with the dialog being in a dead locked state when the request to the actual endpoint fails due to intermittent network issues or whatever. So there must be some sort of fixed threshold after which which we assume the action to have failed (eg. 10 seconds passed since |
|
Should this subscription be set up based on one or several conditions, or actually set up every time dialog details are viewed? IMO there are several reasons to subscribe to a dialog when viewing it, every time. One of them being that you've pushed a button. Another being that someone else pushed a button, or the service owner has updated the dialog, or any other reason for the dialog to change. I would argue that if dialog subscription was the default behavior the I am thinking the following flow:
The beauty of this flow is that step 3 is rarely shown because of step 4. |
@elsand @MagnusSandgren
|
Whether or not a subscription is set up conditionally or not is ultimately up to the end-user system (ie. arbeidsflate). I don't think Dialogporten should (at least initially, lest we encounter scaling issues/abuse) actively refuse subscription requests for dialogs not containing non-GET GUI-actions. Having the flag lets other end-user systems that cannot utilize GQL subscriptions get a useful hint whether or not they can immediately reload the dialog upon request completion, or if they need to employ some other heuristic (ie. locally hide buttons or whatever).
Agreed, the subscription feature is covered in #378 (which as of now describes a SignalR implementation, which I should probably update ...) |
It's easy to fall into that trap thinking arbeidsflate is the only end user system. You're absolutely right. |
🤖 I have created a release *beep* *boop* --- ## [1.8.0](v1.7.1...v1.8.0) (2024-06-12) ### Features * Add support for external resource references in authorizationAttributes ([#801](#801)) ([1e674bd](1e674bd)) * Add user types ([#768](#768)) ([b6fd439](b6fd439)) * Front channel embeds ([#792](#792)) ([c3000bd](c3000bd)) * GUI actions without navigation ([#785](#785)) ([f2d9136](f2d9136)) * Remove IsBackChannel concept from GUI Actions ([#819](#819)) ([18101c1](18101c1)) * Rename IsDeleteAction to IsDeleteDialogAction ([#820](#820)) ([18a1f6e](18a1f6e)) * **schema:** Rename MimeType to MediaType ([#813](#813)) ([6490625](6490625)) * **schema:** undo setting performed by if not set ([#802](#802)) ([c19f47a](c19f47a)) ### Bug Fixes * remove maskinporten aux from config ([#827](#827)) ([2e4e81a](2e4e81a)) * **schema:** add package-lock file ([#804](#804)) ([987dfa1](987dfa1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: Ole Jørgen Skogstad <skogstad@softis.net>
Description
Adds
writeAction
to dialog GUI actions.The property has a HTTP method (POST or DELETE), a boolean flag to indicate to the client whether or not a quick update to the dialog is expected , and an optional localization set for a prompt to show the user when triggering this action.
Related Issue(s)
Verification
Documentation
docs
-directory, Altinnpedia or a separate linked PR in altinn-studio-docs., if applicable)