Skip to content
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

Fix required metadata not being required #800

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Arnei
Copy link
Member

@Arnei Arnei commented Jul 3, 2024

In the backend, metadata catalogs can be configured as needed. One thing that can be configured for each metadata field is if is considered required. A user should not be able to leave a required field empty (or set it to

empty). Our validation was ignoring said configuration, merely enforcing the title field.

This fixes the issue by dynamically creating a validation schema based on configuration for the existing metadata fields. Although it really feels like Yup does not want me to do this.

Fixes #317.
Includes #798.

Bildschirmfoto vom 2024-07-03 16-25-45
Bildschirmfoto vom 2024-07-03 16-25-56

Fix typescript errors in validates.ts
@Arnei Arnei added the type:bug Something isn't working label Jul 3, 2024
Copy link
Contributor

github-actions bot commented Jul 3, 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-800

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-800

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 Arnei force-pushed the validate-metadata-dynamically branch from b2bca2a to e1d6c40 Compare July 3, 2024 14:35
Copy link
Contributor

github-actions bot commented Jul 3, 2024

This pull request is deployed at test.admin-interface.opencast.org/800/2024-09-16_07-34-33/ .
It might take a few minutes for it to become available.

In the backend, metadata catalogs can be
configured as needed. One thing that can be
configured for each metadata field is if is
considered required. A user should not be able
to leave a required field empty (or set it to empty).
Our validation was ignoring said configuration,
merely enforcing the title field.

This fixes the issue by dynamically creating a validation
schema based on configuration for the
existing metadata fields. Although it really
feels like Yup does not want me to do this.
@Arnei Arnei force-pushed the validate-metadata-dynamically branch from e1d6c40 to d721382 Compare July 3, 2024 14:46
@gregorydlogan
Copy link
Member

Does what it says on the tin. Does not address the series side of things, which has the same options (at least in the config file). Is that something you want to address here since I'm assuming the logic would be more or less copy+paste?

@Arnei
Copy link
Member Author

Arnei commented Sep 16, 2024

Series side addressed (I think. Have not looked at this code in a while.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metadata validation does not respect "required" for any field other than "title"
2 participants