-
Notifications
You must be signed in to change notification settings - Fork 32
Fix clean metadata #1235
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
base: main
Are you sure you want to change the base?
Fix clean metadata #1235
Conversation
Hi @priya-tik |
Use Run test server using develop.opencast.org as backend:
Specify a different backend like stable.opencast.org:
It may take a few seconds for the interface to spin up. |
This pull request is deployed at test.admin-interface.opencast.org/1235/2025-05-23_10-13-06/ . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This helps with #1230 a little. It only requests /admin-ng/event/new/metadata
once each time you click "create event", but now it looks like nothing is happening for several seconds while it loads. Closing the dialog also takes a couple of seconds.
metadata.fix.mp4
Also for opening an existing event metadata there are still 2 requests
metadata.fix.existing.mp4
It also looks like there are a bunch of unrelated changes in this PR.
on further testing I don't think this PR has an effect on #1230 at all. @priya-tik did you comment on the correct issue? |
@ppettit, Thanks for the feedback! You're right — this looks like a separate issue. My PR focuses on reducing the amount of unnecessary series data fetched from /admin-ng/event/{id}/metadata, but it doesn’t address the number of times the endpoint is called. I agree that repeated calls on open and close are a performance concern — I can look into that next as a follow-up task. |
This pull request has conflicts ☹ |
This pull request has conflicts ☹ |
8b3f6e9
to
8f72174
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does very significantly reduce the payload when sending updated event or series metadata to the backend. Code looks generally good and from my testing nothing else seems to break.
Mostly nitpicks below.
@@ -1,3 +1,4 @@ | |||
import { User } from "../../slices/userSlice"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead import
// Redirect to login if not in ROLE_ADMIN_UI | ||
if (!(res.roles.includes('ROLE_ADMIN') || res.roles.includes('ROLE_ADMIN_UI'))) { | ||
window.location.href = "/login.html"; | ||
export const fetchUserInfo = createAppAsyncThunk( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All changes in this file seem unrelated to the issue you are trying to fix. If you still feel like they belong in the codebase, please explain why they belong in this PR or submit them as another PR and state your intentions there,
@@ -69,6 +69,7 @@ export const fetchUsers = createAppAsyncThunk('users/fetchUsers', async (_, { ge | |||
// This will automatically dispatch a `pending` action first, | |||
// and then `fulfilled` or `rejected` actions based on the promise. | |||
const res = await axios.get("/admin-ng/users/users.json", { params: params }); | |||
console.log("this is the response", res); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Superfluous logging statement.
While you're latest commit addressed some of the style issues, it also applied style changes to a bunch of unrelated code. It would be nice if you could avoid that. |
Refactored the "transformMetadataForUpdate" function to clean the metadata payload and ensure only the essential fields (id and value) are included in the request.
This change reduces the size of the payload and ensures it aligns with the backend's expected structure.