Skip to content

Conversation

@Arnei
Copy link
Member

@Arnei Arnei commented Dec 4, 2024

Instead of only being able to view lifecycle policies, this commit lets you edit them, create new ones and even delete them.

Includes #943. Can serve to replace it.

Depends on changes to the backend: opencast/opencast#6139. These changes are currently pointed at develop.

To test this, you'll need an Opencast with backend changes mentioned above.

Demonstration:
Bildschirmaufzeichnung vom 2024-12-04 10-45-28.webm

@Arnei Arnei added the type:enhancement New feature or request label Dec 4, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2024

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2024

Use docker or podman to test this pull request locally.

Run test server using develop.opencast.org as backend:

podman run --rm -it -p 127.0.0.1:3000:3000 ghcr.io/opencast/opencast-admin-interface:pr-1004

Specify a different backend like stable.opencast.org:

podman run --rm -it -p 127.0.0.1:3000:3000 -e PROXY_TARGET=https://stable.opencast.org ghcr.io/opencast/opencast-admin-interface:pr-1004

It may take a few seconds for the interface to spin up.
It will then be available at http://127.0.0.1:3000.
For more options you can pass on to the proxy, take a look at the README.md.

Arnei added 2 commits December 4, 2024 11:24
Adds a new tab to recordings called "LifeCycle
Policies". Much like other tabs this tab displays
information on its subject in a table format.
Unlike i.e. the events tab, the LifeCycle Policies
cannot be changed in any way, just be viewed.
Editing is supposed to be added at a later date.

Depends on PR opencast/opencast#6139
being merged to make any sense. Similarly, if you
would like to test this, your admin interface
should point to an Opencast with the PR
installed.
Type LifeCyclePolicy was missing on a union type.
Instead of only being able to view lifecycle policies, this commit
lets you edit them, create new ones and even delete them.

Depends on changes to the backend.
@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2024

This pull request is deployed at test.admin-interface.opencast.org/1004/2025-12-03_15-05-58/ .
It might take a few minutes for it to become available.

@github-actions
Copy link
Contributor

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@github-actions
Copy link
Contributor

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@LukasKalbertodt
Copy link
Member

I have some random UI-related notes that I took when @Arnei recently presented this PR to us internally.

  • I don't mind the "technical enum names" in the drop down menus, but I think the one enum could be improved. SPECIFIC_DATA -> ONCE? And ALWAYS also confuses me, maybe there is a better name for it as well.
  • Filters
    • It wasn't clear to me whether its a "contains string" check or a "exact string match" or wildcard or regex, ... maybe add a short note or sth?
    • For some field types (e.g. strings, like title) the "greater than" comparison makes little sense I think? Maybe hide it then?
    • The label "Must" also confuses me, maybe rename that to "negate" or sth?
    • Maybe add a note that the filters are ANDed together, i.e. all filters must match.
    • Finally, I think one feature would be really nice, but is more work than anything I mentioned so far: it would be nice if the UI would show how many events currently match your filter. That gives you a lot more feedback. Maybe there can be a link that links to the admin UI event view with all those filters applied? Not sure if that's possible. Or even a link to the external API with those exact filters would be helpful in my opinion.

Other than that I had no complaints. Looked very finished and very like the other UIs in this project.

@majosch
Copy link

majosch commented Dec 18, 2024

@Arnei I just tried to spin up a test container via podman as noticed above, but unfortunately it fails to start:

~$ podman run --rm -it -p 127.0.0.1:3000:3000 ghcr.io/opencast/opencast-admin-interface:pr-1004

> admin-ui-picard@0.1.0 start
> vite --host 0.0.0.0

/admin-interface/node_modules/rollup/dist/native.js:63
		throw new Error(
		      ^

Error: Cannot find module @rollup/rollup-linux-x64-musl. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.
    at requireWithFriendlyError (/admin-interface/node_modules/rollup/dist/native.js:63:9)
    at Object.<anonymous> (/admin-interface/node_modules/rollup/dist/native.js:72:76)
    ... 3 lines matching cause stack trace ...
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at cjsLoader (node:internal/modules/esm/translators:346:17)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:286:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:473:24) {
  [cause]: Error: Cannot find module '@rollup/rollup-linux-x64-musl'
  Require stack:
  - /admin-interface/node_modules/rollup/dist/native.js
      at Module._resolveFilename (node:internal/modules/cjs/loader:1225:15)
      at Module._load (node:internal/modules/cjs/loader:1051:27)
      at Module.require (node:internal/modules/cjs/loader:1311:19)
      at require (node:internal/modules/helpers:179:18)
      at requireWithFriendlyError (/admin-interface/node_modules/rollup/dist/native.js:45:10)
      at Object.<anonymous> (/admin-interface/node_modules/rollup/dist/native.js:72:76)
      at Module._compile (node:internal/modules/cjs/loader:1469:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
      at Module.load (node:internal/modules/cjs/loader:1288:32)
      at Module._load (node:internal/modules/cjs/loader:1104:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/admin-interface/node_modules/rollup/dist/native.js' ]
  }
}

Node.js v20.18.1

@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2025

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@github-actions
Copy link
Contributor

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@github-actions
Copy link
Contributor

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@github-actions
Copy link
Contributor

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

Arnei added 3 commits November 5, 2025 16:57
Greater/Less than makes no sense for text values.
Instead of having to type the workflow id and the workflow
parameters per hand as strings for lifecycle policies,
this adds the proper UI known from other modals.
Adds a new page to the event details. There all active policies
that would affect th event
are listed.
@majosch
Copy link

majosch commented Nov 17, 2025

  • It would be nice if changing the "Filter" to created/start date/end date would automatically update the "Type"
Bildschirmaufzeichnung.vom.2025-11-17.10-13-36.mp4
  • Setting an "Action Date" with a dedicated "Time" is a bit awkward:
Bildschirmaufzeichnung.vom.2025-11-17.10-16-36.mp4
  • When not specifying any "Filters", all events are targeted. That's a valid use case - but maybe there should be a warning?

  • When using REPEATING as "Timing" the "Cron Trigger" doesn't work for me:

Bildschirmaufzeichnung.vom.2025-11-17.10-30-14.mp4
  • In the "Summary" tab, the value for "Active" is always empty:
Bildschirmfoto vom 2025-11-17 10-33-36
  • As reported by @JasminNovotni: If a series name contains . and :, the value is not displayed properly:
Bildschirmaufzeichnung.vom.2025-11-17.10-40-51.mp4
  • When editing an existing policy and clicking "Save", the notification is not human readable but "NOTIFIACTIONS.LIFECYCLEPOLICY_ADDED"

  • If a policy has already fired: Is there any scenario that does trigger new tasks, when changing filters/timing/action date? When I try to do so (and enabling the "Active"-boolean), no new tasks are created. I'm absolutely fine with this approach, but maybe it would be more intelligible if the policy is immutable and prevent users from changing filters/timing/action date?

  • Is it reasonable to enforce the ACL "public" to policies or are there any use cases you want to have private/authenticated/custom ACLS?

The structure for targetFilters changed in the backend.
There is now another map wrapper that splits filters
by metadata catalogs.
This commit makes the necessary code changes to
accomadate the new structure.
Still, the behaviour remains the same, meaning only
filters for the common event metadata can be added
or changed. This does not add support for other catalogs.
@Arnei
Copy link
Member Author

Arnei commented Nov 18, 2025

Thanks for testing, will take a look at all those bugs.

As for your other remarks:

If a policy has already fired: Is there any scenario that does trigger new tasks, when changing filters/timing/action date? When I try to do so (and enabling the "Active"-boolean), no new tasks are created. I'm absolutely fine with this approach, but maybe it would be more intelligible if the policy is immutable and prevent users from changing filters/timing/action date?

If you reenable a lifecycle policy by setting it to active again, it should run again when the timing condition is met. It won't create tasks for entities it has already created tasks for though. So if you have a situation where you reenabled a lifecycle policy, that policy was triggered according to its timing and that policy should have created a task for a new event but did not, then I would consider that a bug.

Is it reasonable to enforce the ACL "public" to policies or are there any use cases you want to have private/authenticated/custom ACLS?

I don't see what the benefit(s) of forcing a "public" ACL would be, could you elaborate?

@majosch
Copy link

majosch commented Dec 1, 2025

Regarding ACLs... It feels like I'm missing some point... does it make any difference using different ACLs when creating/updating polices? Especially when these actions are restricted to admins only, who can always access all assets?

@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2025

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@Arnei
Copy link
Member Author

Arnei commented Dec 2, 2025

If you restrict these actions to admins only, which is entirely reasonable, then what you do with the ACL does not matter because admins get to ignore the ACL anyway. But then there is also no reason to force them "public". If anything I would enforce "private", to make it entirely clear that no one but the admins is supposed to have access.

ACLs for lifecycle policies are not useful if only admins handle them. They are there for a future where we have figured out how to reasonably run lifecycle policies for non-admin users, at least in my opinion.

Arnei added 7 commits December 2, 2025 11:21
The displayed value for a selected value in a metadata
dropdown would sometimes be cut off if the string for the value
looked something like "Test.Test: 1". This fixes that.
For some reason, if a <Cron> from react-js-cron is a child of
<Focustrap>, the dropdowns from the <Cron> will not respond
properly. In particular, no options in the dropdown can be selected.
This commit introduces a workaround by deactivating
the <Focustrap> for the LifeCyclePolicy Modals,
the only places where <Cron> is used.
The validation for lifecycle policy filters was not yet respecting
the recent changes to the structure of the filters object
(which now allows for extended metadata).
Validation should now work again, and require at least one
filter to be set.

Additionally, the workflowId is now also
required again.
A filter for a lifecycle policy can have different types, like
"text" or "date". When changing from one type to another type,
the value selectors should change accordingly (i.e. displaying a
date selector for filter of type "date", then displaying a dropdown
for a filter of type "text". This was not working, but should be
working now.
@Arnei
Copy link
Member Author

Arnei commented Dec 3, 2025

I hope I managed to address all the other feedback.

I did not address

Setting an "Action Date" with a dedicated "Time" is a bit awkward

because I could not come up with a good idea on how to improve setting a date here (and this could arguably be considered a more general problem as our date pickers work like this everywhere).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:low type:enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants