This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/app
Martin Brennan dba6a5eabf
FEATURE: Humanize file size error messages (#14398)
The file size error messages for max_image_size_kb and
max_attachment_size_kb are shown to the user in the KB
format, regardless of how large the limit is. Since we
are going to support uploading much larger files soon,
this KB-based limit soon becomes unfriendly to the end
user.

For example, if the max attachment size is set to 512000
KB, this is what the user sees:

> Sorry, the file you are trying to upload is too big (maximum
size is 512000KB)

This makes the user do math. In almost all file explorers that
a regular user would be familiar width, the file size is shown
in a format based on the maximum increment (e.g. KB, MB, GB).

This commit changes the behaviour to output a humanized file size
instead of the raw KB. For the above example, it would now say:

> Sorry, the file you are trying to upload is too big (maximum
size is 512 MB)

This humanization also handles decimals, e.g. 1536KB = 1.5 MB
2021-09-22 07:59:45 +10:00
..
adapters DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
components A11Y: Add more descriptive labels for some dropdowns (#14402) 2021-09-21 11:19:49 -04:00
controllers UX: Add second Search button on mobile (#14404) 2021-09-21 13:02:00 -04:00
helpers FIX: Use named params correctly with dir-span (#14203) 2021-09-01 07:58:26 -06:00
initializers FEATURE: Topic-level bookmarks (#14353) 2021-09-21 08:45:47 +10:00
lib FEATURE: Humanize file size error messages (#14398) 2021-09-22 07:59:45 +10:00
mixins DEV: Trigger an app event when a card is shown (#14399) 2021-09-21 15:51:45 +03:00
models FEATURE: add update banner to the categories and latest topics view (#14403) 2021-09-21 12:35:38 -04:00
pre-initializers FIX: Composer height issue in Safari on iOS 15 (#14282) 2021-09-08 13:35:09 -04:00
raw-views FEATURE: Add last visit indication to topic view page. (#13471) 2021-07-05 14:17:31 +08:00
routes FEATURE: add update banner to the categories and latest topics view (#14403) 2021-09-21 12:35:38 -04:00
services DEV: Add addComposerUploadPreProcessor to plugin-api (#14222) 2021-09-06 08:22:50 +10:00
styles DEV: Migrate to Ember CLI (#11932) 2021-02-03 14:22:20 -05:00
templates UX: Add second Search button on mobile (#14404) 2021-09-21 13:02:00 -04:00
widgets DEV: Use a better selector for search menu (#14390) 2021-09-21 15:51:29 +03:00
app.js DEV: uses forked Mousetrap to avoid leaking listeners (#14198) 2021-09-08 14:48:13 +02:00
index.html DEV: Match viewport metadata on mobile in Ember CLI (#14330) 2021-09-13 21:14:04 -04:00
mapping-router.js DEV: prettier 2.2.1 (#11862) 2021-01-27 12:39:20 +01:00