Terrastories / terrastories

Terrastories is a geostorytelling application for mapping, managing and sharing place-based stories.
https://terrastories.app
MIT License
318 stars 157 forks source link

Improve the error message when a media upload exceeds the permitted threshold for the file type #989

Open rudokemper opened 8 months ago

rudokemper commented 8 months ago

Currently, when you try to upload a media attachment for a Story/Place/Speaker/User/Theme that exceeds the permitted threshold for the file type (image/audio/video/pdf), the following message is shown (for example, for photo):

Photo size {filesize} MB is not between required range

This is not the most helpful message. Let's instead show a more legible message, like:

The photo you uploaded is {filesize} MB, and exceeds the maximum permitted filesize of {maxFilesize} MB. Please reduce the size of your image and try to upload again.

Let's implement the same for all possible file types.

(Writing on a plane and don't have the proper connectivity to figure out the exact vars or threshold limits).

ughrisha commented 7 months ago

Hi I would like to take this up but can't find where the error is stated, could you please help. Thanks!

rudokemper commented 7 months ago

Hi, thanks!

image

The new / edit views where this error message shows are in /rails/app/views/dashboard/ (for places, speakers, stories, and theme).

The relevant media filesize validations were introduced in this commit: https://github.com/Terrastories/terrastories/commit/4e03e99af166eb9340d70f72d89f3319d367907b

ughrisha commented 7 months ago

thanks a lot!

asimdelvi commented 6 months ago

I would like to take up this issue if @ughrisha is working on it.

ughrisha commented 6 months ago

@rudokemper The task is done just sorting out some issues with stories media validation.

evelynmitchell commented 3 months ago

Hi @ughrisha You mentioned in April this task is done, but I don't see a patch. Is there anything I can do to help?

ahp64 commented 2 months ago

Is this task complete yet? I would love to help with this