diff --git a/databox/api/src/Controller/Admin/AttributeCrudController.php b/databox/api/src/Controller/Admin/AttributeCrudController.php index 130ae71c5..cda187ce6 100644 --- a/databox/api/src/Controller/Admin/AttributeCrudController.php +++ b/databox/api/src/Controller/Admin/AttributeCrudController.php @@ -60,7 +60,7 @@ public function configureCrud(Crud $crud): Crud return parent::configureCrud($crud) ->setEntityLabelInSingular('Attribute') ->setEntityLabelInPlural('Attribute') - ->setSearchFields(['id', 'locale', 'position', 'translationOriginHash', 'value', 'origin', 'originVendor', 'originUserId', 'originVendorContext', 'coordinates', 'status', 'confidence']) + ->setSearchFields(['id', 'locale', 'position', 'value', 'origin', 'originVendor', 'originUserId', 'originVendorContext', 'status', 'confidence']) ->setPaginatorPageSize(20); } diff --git a/databox/api/src/Listener/AssetIngestWorkflowListener.php b/databox/api/src/Listener/AssetIngestWorkflowListener.php new file mode 100644 index 000000000..154453dfd --- /dev/null +++ b/databox/api/src/Listener/AssetIngestWorkflowListener.php @@ -0,0 +1,30 @@ +getState(); + if (str_starts_with($state->getWorkflowName(), 'asset-ingest:') && in_array($state->getStatus(), [ + WorkflowState::STATUS_SUCCESS, + WorkflowState::STATUS_FAILURE, + ])) { + $assetId = $state->getEvent()->getInputs()['assetId']; + $this->pusherManager->trigger('asset-'.$assetId, 'asset_ingested', [], direct: true); + } + } +} diff --git a/databox/client/src/components/Dialog/Workspace/Acl.tsx b/databox/client/src/components/Dialog/Workspace/Acl.tsx index 93603c49b..68c3c1c1e 100644 --- a/databox/client/src/components/Dialog/Workspace/Acl.tsx +++ b/databox/client/src/components/Dialog/Workspace/Acl.tsx @@ -21,7 +21,7 @@ export default function Acl({data, onClose, minHeight}: Props) { objectType={PermissionObject.Workspace} displayedPermissions={Object.keys(aclPermissions).filter( p => p !== AclPermission.SHARE - )} + ).concat([AclPermission.ALL])} /> ); diff --git a/databox/client/src/components/Media/Asset/AssetView.tsx b/databox/client/src/components/Media/Asset/AssetView.tsx index 2f52ab708..7802e7b3d 100644 --- a/databox/client/src/components/Media/Asset/AssetView.tsx +++ b/databox/client/src/components/Media/Asset/AssetView.tsx @@ -22,6 +22,8 @@ import AssetViewActions from './Actions/AssetViewActions.tsx'; import {Trans} from 'react-i18next'; import {getMediaBackgroundColor} from '../../../themes/base.ts'; import {useModalFetch} from '../../../hooks/useModalFetch.ts'; +import {useChannelRegistration} from "../../../lib/pusher.ts"; +import {queryClient} from "../../../lib/query.ts"; export type IntegrationOverlayCommonProps = { dimensions: Dimensions; @@ -50,8 +52,18 @@ export default function AssetView({modalIndex, open}: Props) { AssetAnnotation[] | undefined >(); + const queryKey = ['assets', assetId]; + + useChannelRegistration( + `asset-${assetId}`, + `asset_ingested`, + () => { + queryClient.invalidateQueries({queryKey}); + } + ); + const {data, isSuccess} = useModalFetch({ - queryKey: ['assets', assetId], + queryKey, queryFn: () => Promise.all([ getAsset(assetId!), diff --git a/lib/php/workflow/src/Listener/WorkflowUpdateEvent.php b/lib/php/workflow/src/Listener/WorkflowUpdateEvent.php new file mode 100644 index 000000000..44a85e482 --- /dev/null +++ b/lib/php/workflow/src/Listener/WorkflowUpdateEvent.php @@ -0,0 +1,18 @@ +state; + } +} diff --git a/lib/php/workflow/src/WorkflowOrchestrator.php b/lib/php/workflow/src/WorkflowOrchestrator.php index 2529dbbde..9ffd3e225 100644 --- a/lib/php/workflow/src/WorkflowOrchestrator.php +++ b/lib/php/workflow/src/WorkflowOrchestrator.php @@ -6,6 +6,7 @@ use Alchemy\Workflow\Date\MicroDateTime; use Alchemy\Workflow\Event\WorkflowEvent; +use Alchemy\Workflow\Listener\WorkflowUpdateEvent; use Alchemy\Workflow\Model\Job; use Alchemy\Workflow\Model\Workflow; use Alchemy\Workflow\Planner\Plan; @@ -20,6 +21,7 @@ use Alchemy\Workflow\Trigger\JobTrigger; use Alchemy\Workflow\Trigger\JobTriggerInterface; use Alchemy\Workflow\Validator\EventValidatorInterface; +use Psr\EventDispatcher\EventDispatcherInterface; final class WorkflowOrchestrator { @@ -33,6 +35,7 @@ public function __construct( private readonly StateRepositoryInterface $stateRepository, private readonly JobTriggerInterface $trigger, private readonly EventValidatorInterface $eventValidator, + private readonly EventDispatcherInterface $eventDispatcher, ) { } @@ -185,6 +188,8 @@ private function doContinueWorkflow(WorkflowState $workflowState): void $workflowState->setEndedAt(new MicroDateTime()); $workflowState->setStatus($workflowEndStatus); $this->stateRepository->persistWorkflowState($workflowState); + + $this->eventDispatcher->dispatch(new WorkflowUpdateEvent($workflowState)); } }