-
Notifications
You must be signed in to change notification settings - Fork 186
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
Custom branding: assets upload #4434
Comments
ProposalThe previous settings to customize the subpath where the assets were exposed in the plugin platform server are no longer necessary. Design specificationsThe configuration of these settings will be done in the These settings will use a file picker to drag or select the file. It should validate the supported extensions of the input file (this could change in the future of the implementation). If the setting is configured, the UI will display a preview of the image and a button besides it to remove the image. It is required to create new backend endpoints to manage the upload and removal of the assets. Tasks
|
Details of the new plugin's settingsDue to the new design, the current logo customization will be removed, as file upload was not possible. Also, we want to support multiple file extensions to make it easier for the final user. As a consequence, the plugin will need to be aware of the file extension being used. In case of having several extensions for the same image, one, and only one of them must be used (priorities have to be defined yet). The UI must be aware of this selected setting in order to use the correct content type in the image preview. An approach to this requirement would be to return this information in the same backend endpoint call that returns the plugin's settings (
These changes will be implemented in the |
Specifications of endpoints to manage the assetsTarget path:
File upload
File removal
|
UI designThe following things have been done:
Screenshots
|
Changes in the specification
Tasks
|
Latest changes:
|
|
The button to |
Changes
|
Limit the size of the uploaded fileWe can limit the maximum size of the uploaded file by defining the router.put(
{
path: '/utils/configuration/files/{key}',
validate: validation,
options: {
body: {
maxBytes: <MAXIMUM_BYTES_PAYLOAD_UPLOAD_CUSTOM_FILE>,
},
}
},
handler
); Information about the routes' options: https://github.com/elastic/kibana/blob/v7.10.2/src/core/server/http/router/route.ts#L81-L86 But the user can define a global value for using Do we want to set this value for the endpoint to upload the custom images? What value in bytes? |
New requirement
|
ChangesFrontendBackend
|
Can the unit be megabytes, or at least kilobytes? |
I added a service to format the value to a meaningful unit. |
The |
Description
In order to ease the white-label process to the user, file upload for images and logos needs to be implemented.
Tasks
We won't let the user select the name or folder of the file, just upload one, or reset to the original.
The tasks above might be elevated to issues, for the time being, this is what it's required:
GET, PUT & DELETE operations to read, upload and reset custom imagery. No files are created or removed, only read and overwritten. See the parent issue for details.
We need to be very careful with these endpoints in terms of security. The image must be validated in the backend (format and dimensions). Their names and paths must be decided beforehand, by the backend.
Replace the text inputs by file pickers from the EUI framework. Validate the files in the frontend (format and dimensions). Send the files to the new endpoints.
Depends on: #4443
The text was updated successfully, but these errors were encountered: