Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Added static resources section in admin panel #6872

Merged
merged 22 commits into from
Sep 10, 2022
Merged

Conversation

hanzlamateen
Copy link
Member

@hanzlamateen hanzlamateen commented Sep 6, 2022

Summary

This PR introduces static resources section in admin panel and adds search to it.

image

References

closes #6708

Checklist

  • If this PR is still a WIP, convert to a draft
  • ensure all checks pass
  • When this PR is ready, mark it as "Ready for review"
  • Changes have been manually QA'd
  • Changes reviewed by at least 2 approved reviewer

QA Steps

List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.

@hanzlamateen hanzlamateen marked this pull request as ready for review September 7, 2022 03:36
@hanzlamateen hanzlamateen marked this pull request as draft September 7, 2022 11:28
@hanzlamateen hanzlamateen marked this pull request as ready for review September 8, 2022 06:39
@barankyle
Copy link
Member

barankyle commented Sep 9, 2022

It looks like the selector in the new drawer for staticResourceType is using the list of types that can be filtered on. I think the admin ResourceService should get the full list of accepted static-resource-types from the static-resource-type table, stored separately from the list of filterable types, and that that should be used for populating the list of resources.

Let's say we're starting with a clean database. The only types of static resources in the database are avatars and user-thumbnails. As it currently works from what I tested, you can't create an audio, or video, or volumetric static resource from the new admin page since none of those are in the list of filters.

I also don't think that mimeType should be configurable in the drawer. I believe that field is calculated on upload from the type of file, and users shouldn't need to change it, or set it. If I'm creating a new static resource, I shouldn't be expected to say the mime type is image/png; I should just have to add a .png file. I also shouldn't be able to, later, change the mimeType to something that the file is not, like saying a model/gltf-binary is actually an image/jpeg. This could be a read-only text field for the purposes of showing what the mimetype is for existing resources, without letting it be chaned.

@barankyle
Copy link
Member

Letting admins set the key might also warrant reconsideration. If I'm uploading a static resource, I don't think I want to consider what the filename is. When we're creating static resources in other services, we're hard-coding the key based on what we're uploading, like how avatars get put into /avatars/. Maybe new static resources should have a 'name' field in the drawer, and the key is assembled behind-the-scenes into /static-resources/ (though that could collide, so maybe add a UUID onto the end of the name like we do with avatar resources now).

@hanzlamateen
Copy link
Member Author

@barankyle all above comments resolved.

@hanzlamateen hanzlamateen merged commit 3216a1e into dev Sep 10, 2022
@hanzlamateen hanzlamateen deleted the admin-resources branch September 10, 2022 23:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Story] Add search for all types of static resources
3 participants