Skip to content

Process budget entries view

https://redmine.teklia.com/issues/8453

Requires #1537 (closed) and enterprise#51

The <Paginator /> for the budget entries from the budget details view should be moved into a separate component, as it will be reused here and will later see further customization.

The listBudgetEntries API helper and the useBudgetStore().listEntries store action need to be updated to support the new optional process_id filter.

A new /process/:id/budget view allows displaying the budget entries for a process. This view requires authentication as a verified user and requires the enterprise feature flag.

The view has the same header as the process workers activity view, with a button to return to the process details view and a <h1> showing the process name or ID.

Below it, a paginator displays the budget entries returned by ListBudgetEntries with a process_id filter set to the process ID. Because this requires knowing the budget ID, the view first shows a loader instead of the paginator, until the process itself has been retrieved.

If the process has no corpus, something which should never happen as this only occurs on processes that cannot be retrieved through RetrieveProcess, you can throw an explicit Error directly.

If the corpus has no budget, show a notification is-warning in place of the paginator to state that there is no budget on the corpus of this process.

If an error occurs while listing the budget entries, particularly an HTTP 403 if the user does not have the necessary access rights on the budget itself, then a notification is-error should be shown in place the paginator.

In the Actions dropdown of the process details view, a new Budget entries action is shown only when the enterprise feature flag is enabled, and it links to the new process budget entries view.

When the process mode is neither Workers nor Dataset, or the user does not have a verified email, the action is disabled but still visible. A title either says View budget entries for this process, or shows an explicit error message if the action is disabled.